(()=>{var e,t,i,n={192:(e,t,i)=>{"use strict";i.d(t,{ZG:()=>n,ZS:()=>r,Kt:()=>C});class n{constructor(e,t){this.password=e,this.date=t}}class r{}var s=i(3204),o=i(69194),a=i(22327),l=i(21590),c=i(9764),d=i(16845);class u{constructor(e,t,i){this.credential=e,this.category=t,this.generationDate="number"==typeof i?new Date(i):i}static fromJSON(e){return new u(e.credential,e.category,e.generationDate)}toJSON(){return{credential:this.credential,category:this.category,generationDate:this.generationDate.valueOf()}}}var h=i(31857),p=i(4132);class m{constructor(e,t){this.disclosed=e,this.excluded=t}static allSecret(){const e=Object.freeze([]),t=Object.freeze([]);return new m(e,t)}disclose(e){const t=[...this.disclosed,e];return new m(Object.freeze(t),this.excluded)}exclude(e){const t=[...this.excluded,e];return new m(this.disclosed,Object.freeze(t))}classify(e){const t=JSON.parse(JSON.stringify(e));for(const n of this.excluded)delete t[n];const i={};for(const n of this.disclosed)i[n]=t[n],delete t[n];return{disclosed:i,secret:t}}declassify(e,t){const i={};for(const r of this.disclosed)i[r]=e[r];const n=Object.assign(i,t);for(const r of this.excluded)delete n[r];return n}}var v=i(89097),f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const g=v.l.array(h.qd,"localGeneratorHistory",m.allSecret(),{deserializer:u.fromJSON,clearOn:["logout"]}),y=new p.A(h.qd,"localGeneratorHistoryBuffer",{deserializer(e){const t=e;return null==t?void 0:t.map(e=>new n(e.password,e.date))},isValid(e){return f(this,void 0,void 0,function*(){return!!e.length})},map(e,t){return f(this,void 0,void 0,function*(){return(yield t.decrypt(e)).map(e=>new u(e.password,"password",e.date))})},clearOn:["logout"]});var b=i(72245),w=i(39306),S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class I{constructor(e,t,i){this.userId=e,this.keyService=t,this.encryptService=i}decrypt(e){return S(this,void 0,void 0,function*(){const t=yield(0,b._)(this.keyService.userKey$(this.userId));if(null==t)throw new Error("No user key found for decryption");const i=(null!=e?e:[]).map(e=>S(this,void 0,void 0,function*(){const i=new w.k(e.password),r=yield this.encryptService.decryptString(i,t);return new n(r,e.date)}));return yield Promise.all(i)})}}var k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C extends r{constructor(e,t,i,n={maxTotal:200}){super(),this.encryptService=e,this.keyService=t,this.stateProvider=i,this.options=n,this._credentialStates=new Map,this.track=(e,t,i,n)=>k(this,void 0,void 0,function*(){const r=this.getCredentialState(e);let s=null;return yield r.update(e=>{e=null!=e?e:[],s=new u(t,i,null!=n?n:Date.now()),e.unshift(s);const r=Math.max(0,this.options.maxTotal);return e.splice(r,1/0),e},{shouldUpdate:e=>{var i;return!(null!==(i=null==e?void 0:e.some(e=>e.credential===t))&&void 0!==i&&i)}}),s}),this.take=(e,t)=>k(this,void 0,void 0,function*(){const i=this.getCredentialState(e);let n,r=null;return yield i.update(e=>(e=null!=e?e:[],[r]=e.splice(n,1),e),{shouldUpdate:e=>{var i;return n=null!==(i=null==e?void 0:e.findIndex(e=>e.credential===t))&&void 0!==i?i:-1,n>=0}}),r}),this.clear=e=>k(this,void 0,void 0,function*(){var t;const i=this.getCredentialState(e);return null!==(t=yield i.update(()=>null))&&void 0!==t?t:[]}),this.credentials$=e=>this.getCredentialState(e).state$.pipe((0,s.T)(e=>null!=e?e:[]))}getCredentialState(e){let t=this._credentialStates.get(e);return t||(t=this.createSecretState(e),this._credentialStates.set(e,t)),t}createSecretState(e){const t=new c.n(2048),i=this.keyService.userKey$(e).pipe((0,s.T)(i=>i?new a.f(e,this.encryptService,i,t):null),(0,o.p)(e=>!!e)),n=d.m.from(e,g,this.stateProvider,i),r=new I(e,this.keyService,this.encryptService),u=this.keyService.userKey$(e).pipe((0,s.T)(e=>e&&r));return new l.d(this.stateProvider,y,n,u)}}},274:(e,t,i)=>{"use strict";i.d(t,{X:()=>n});const n=i(13299).Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 80 73.33">
  <path class="tw-fill-illustration-bg-primary" d="M11.667 31.666c0-5.523 3.805-10 8.5-10h39.666c4.695 0 8.5 4.477 8.5 10v31.667c0 5.523-3.805 10-8.5 10H20.167c-4.695 0-8.5-4.477-8.5-10V31.666Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.833 23.333H20.167c-3.912 0-7.084 3.73-7.084 8.333v31.667c0 4.602 3.172 8.333 7.084 8.333h39.666c3.912 0 7.084-3.73 7.084-8.333V31.666c0-4.602-3.172-8.333-7.084-8.333Zm-39.666-1.667c-4.695 0-8.5 4.477-8.5 10v31.667c0 5.523 3.805 10 8.5 10h39.666c4.695 0 8.5-4.477 8.5-10V31.666c0-5.523-3.805-10-8.5-10H20.167Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M55.833 22.5v-5.834C55.833 7.922 48.745.833 40 .833c-8.744 0-15.833 7.089-15.833 15.833V22.5h5v-5.834c0-5.983 4.85-10.833 10.833-10.833 5.983 0 10.833 4.85 10.833 10.833V22.5h5Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M23.333 16.667C23.333 7.462 30.795 0 40 0c9.205 0 16.667 7.462 16.667 16.667v6.666H50v-6.666c0-5.523-4.477-10-10-10s-10 4.477-10 10v6.666h-6.667v-6.666ZM40 1.667c-8.284 0-15 6.715-15 15v5h3.333v-5C28.333 10.223 33.557 5 40 5s11.667 5.223 11.667 11.667v5H55v-5c0-8.285-6.716-15-15-15Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-secondary" d="M13.333 55.833h53.334V62.5H13.333v-6.667Z"/>
  <path class="tw-fill-illustration-bg-primary" d="M25 18.333h3.333v3.333H25v-3.333Zm26.667 0H55v3.333h-3.333v-3.333Z"/>
  <path class="tw-fill-illustration-tertiary" d="M0 47.5c0-5.523 4.477-10 10-10h60c5.523 0 10 4.477 10 10s-4.477 10-10 10H10c-5.523 0-10-4.477-10-10Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 39.167H10a8.333 8.333 0 1 0 0 16.666h60a8.333 8.333 0 1 0 0-16.666ZM10 37.5c-5.523 0-10 4.477-10 10s4.477 10 10 10h60c5.523 0 10-4.477 10-10s-4.477-10-10-10H10Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16.667 42.5c.46 0 .833.389.833.868v3.48l3.117-1.658c.424-.225.942-.078 1.158.328.216.407.048.919-.375 1.144l-3.365 1.789 2.69 2.885c.327.35.32.89-.017 1.203-.337.314-.875.284-1.202-.067l-2.84-3.045-2.839 3.045c-.327.351-.865.38-1.201.067-.337-.314-.345-.853-.018-1.203l2.69-2.885-3.364-1.79c-.423-.224-.591-.736-.375-1.143.216-.406.734-.553 1.157-.328l3.118 1.658v-3.48c0-.48.373-.868.833-.868ZM30 42.5c.46 0 .834.389.834.868v3.48l3.116-1.658c.424-.225.942-.078 1.158.328.216.407.048.919-.375 1.144l-3.365 1.789 2.69 2.885c.328.35.32.89-.017 1.203-.336.314-.874.284-1.201-.067L30 49.427l-2.84 3.045c-.326.351-.864.38-1.2.067-.338-.314-.345-.853-.018-1.203l2.69-2.885-3.365-1.79c-.423-.224-.591-.736-.375-1.143.216-.406.734-.553 1.158-.328l3.117 1.658v-3.48c0-.48.373-.868.833-.868Zm14.167.868c0-.48-.373-.868-.834-.868-.46 0-.833.389-.833.868v3.48l-3.117-1.658c-.423-.225-.942-.078-1.158.328-.216.407-.048.919.376 1.144l3.364 1.789-2.69 2.885c-.327.35-.32.89.017 1.203.337.314.875.284 1.202-.067l2.84-3.045 2.839 3.045c.327.351.865.38 1.202.067.336-.314.344-.853.017-1.203l-2.69-2.885 3.364-1.79c.424-.224.592-.736.376-1.143-.216-.406-.735-.553-1.158-.328l-3.117 1.657v-3.479Zm6.666 8.299c0-.46.374-.834.834-.834h6.666a.833.833 0 0 1 0 1.667h-6.666a.833.833 0 0 1-.834-.833Zm10.834-.834a.833.833 0 0 0 0 1.667h6.666a.833.833 0 0 0 0-1.667h-6.666Z" clip-rule="evenodd"/>
</svg>
`},286:(e,t,i)=>{"use strict";i.d(t,{y:()=>Se});var n=i(77468),r=i(33812),s=i(51757),o=i(66046),a=i(72737),l=i(16878),c=i(69194),d=i(80909),u=i(3204),h=i(72245),p=i(33338),m=i(36359),v=i(14803),f=i(34040),g=i(75811),y=i(8131),b=i(58625),w=i(56962),S=i(20136),I=i(92697),k=i(14318),C=i(27520),T=i(36288),F=i(25024),R=i(88832),P=i(58950),x=i(75583),$=i(26411),E=i(8433),A=i(29776),D=i(192),O=i(36801),M=i(8245),U=i(23979),G=i(44500),j=i(59257),N=i(31176),V=i(3633),B=i(74208),z=i(35500),L=i(58806),K=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function q(e,t){if(1&e){const e=r.RV6();r.j41(0,"div",0)(1,"bit-spotlight",1),r.nI1(2,"i18n"),r.bIt("onDismiss",function(){B.eBV(e);const t=r.XpG();return B.Njj(t.dismissGeneratorSpotlight(t.NudgeType.GeneratorNudgeStatus))}),r.j41(3,"p",2)(4,"span",3),r.EFF(5),r.nI1(6,"i18n"),r.k0s(),r.j41(7,"span",4),r.EFF(8),r.nI1(9,"i18n"),r.nrm(10,"i",5),r.EFF(11),r.nI1(12,"i18n"),r.k0s()()()()}2&e&&(r.R7$(),r.Y8G("title",r.bMT(2,4,"generatorNudgeTitle")),r.R7$(4),r.SpI(" ",r.bMT(6,6,"generatorNudgeBodyAria")," "),r.R7$(3),r.SpI(" ",r.bMT(9,8,"generatorNudgeBodyOne")," "),r.R7$(3),r.SpI(" ",r.bMT(12,10,"generatorNudgeBodyTwo")," "))}class _{constructor(e,t){this.nudgesService=e,this.accountService=t,this.NudgeType=j.m,this.activeUserId$=this.accountService.activeAccount$.pipe(V.F6),this.showGeneratorSpotlight$=this.activeUserId$.pipe((0,G.n)(e=>this.nudgesService.showNudgeSpotlight$(j.m.GeneratorNudgeStatus,e)))}dismissGeneratorSpotlight(e){return K(this,void 0,void 0,function*(){const t=yield(0,h._)(this.activeUserId$);yield this.nudgesService.dismissNudge(e,t)})}}_.ɵfac=function(e){return new(e||_)(r.rXU(j.u),r.rXU(z.Di))},_.ɵcmp=r.VBU({type:_,selectors:[["nudge-generator-spotlight"]],decls:2,vars:3,consts:[[1,"tw-mb-4"],[3,"onDismiss","title"],["bitTypography","body2",1,"tw-text-main","tw-mb-0"],[1,"tw-sr-only"],["aria-hidden","true"],[1,"bwi","bwi-generate"]],template:function(e,t){1&e&&(r.nVh(0,q,13,12,"div",0),r.nI1(1,"async")),2&e&&r.vxM(r.bMT(1,1,t.showGeneratorSpotlight$)?0:-1)},dependencies:[N.c,n.MD,x.E,L.r,O.$Z,n.Jj],encapsulation:2});var X=i(94615),Y=i(63968),H=i(91261),W=i(58503),J=i(18030),Z=i(69855),Q=i(50700),ee=i(60989),te=i(12694),ie=i(16496),ne=i(86226),re=i(93199),se=i(43759),oe=i(33886),ae=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function le(e,t){if(1&e&&(r.j41(0,"bit-toggle",1),r.EFF(1),r.k0s()),2&e){const e=t.$implicit;r.Y8G("value",e.value),r.R7$(),r.SpI(" ",e.label," ")}}function ce(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-password-settings",9),r.bIt("onUpdated",function(){B.eBV(e);const t=r.XpG();return B.Njj(t.generate("password settings"))}),r.k0s()}if(2&e){r.XpG();const e=r.r8f(24);r.Y8G("account",e)}}function de(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-passphrase-settings",9),r.bIt("onUpdated",function(){B.eBV(e);const t=r.XpG();return B.Njj(t.generate("passphrase settings"))}),r.k0s()}if(2&e){r.XpG();const e=r.r8f(24);r.Y8G("account",e)}}function ue(e,t){if(1&e&&(r.j41(0,"bit-hint"),r.EFF(1),r.nI1(2,"async"),r.k0s()),2&e){const e=r.XpG(2);r.R7$(),r.JRh(r.bMT(2,1,e.credentialTypeHint$))}}function he(e,t){if(1&e&&(r.j41(0,"form",12)(1,"bit-form-field")(2,"bit-label"),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.nrm(5,"bit-select",16),r.nI1(6,"async"),r.k0s()()),2&e){const e=r.XpG(2);r.Y8G("formGroup",e.forwarder),r.R7$(3),r.JRh(r.bMT(4,3,"service")),r.R7$(2),r.Y8G("items",r.bMT(6,5,e.forwarderOptions$))}}function pe(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-catchall-settings",17),r.bIt("onUpdated",function(){B.eBV(e);const t=r.XpG(2);return B.Njj(t.generate("catchall settings"))}),r.k0s()}if(2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)}}function me(e,t){if(1&e&&r.nrm(0,"tools-forwarder-settings",15),2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)("forwarder",t)}}function ve(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-subaddress-settings",17),r.bIt("onUpdated",function(){B.eBV(e);const t=r.XpG(2);return B.Njj(t.generate("subaddress settings"))}),r.k0s()}if(2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)}}function fe(e,t){if(1&e){const e=r.RV6();r.j41(0,"tools-username-settings",17),r.bIt("onUpdated",function(){B.eBV(e);const t=r.XpG(2);return B.Njj(t.generate("username settings"))}),r.k0s()}if(2&e){r.XpG(2);const e=r.r8f(24);r.Y8G("account",e)}}function ge(e,t){if(1&e&&(r.j41(0,"bit-section")(1,"bit-section-header")(2,"h2",10),r.EFF(3),r.nI1(4,"i18n"),r.k0s()(),r.j41(5,"div",11)(6,"bit-card")(7,"form",12)(8,"bit-form-field")(9,"bit-label"),r.EFF(10),r.nI1(11,"i18n"),r.k0s(),r.nrm(12,"bit-select",13),r.nI1(13,"async"),r.nVh(14,ue,3,3,"bit-hint"),r.nI1(15,"async"),r.k0s()(),r.nVh(16,he,7,7,"form",12),r.nI1(17,"async"),r.nVh(18,pe,1,1,"tools-catchall-settings",14),r.nVh(19,me,1,2,"tools-forwarder-settings",15),r.nI1(20,"async"),r.nVh(21,ve,1,1,"tools-subaddress-settings",14),r.nVh(22,fe,1,1,"tools-username-settings",14),r.k0s()()()),2&e){let e;const t=r.XpG(),i=r.r8f(22);r.R7$(3),r.JRh(r.bMT(4,10,"options")),r.R7$(4),r.Y8G("formGroup",t.username),r.R7$(3),r.JRh(r.bMT(11,12,"type")),r.R7$(2),r.Y8G("items",r.bMT(13,14,t.usernameOptions$)),r.R7$(2),r.vxM(r.bMT(15,16,t.credentialTypeHint$)?14:-1),r.R7$(2),r.vxM(r.bMT(17,18,t.showForwarder$)?16:-1),r.R7$(2),r.vxM((null==i?null:i.id)===t.Algorithm.catchall?18:-1),r.R7$(),r.vxM((e=r.bMT(20,20,t.forwarderId$))?19:-1,e),r.R7$(2),r.vxM((null==i?null:i.id)===t.Algorithm.plusAddress?21:-1),r.R7$(),r.vxM((null==i?null:i.id)===t.Algorithm.username?22:-1)}}const ye="identifier",be="forwarder",we="none";class Se{constructor(e,t,i,n,s,h,p,m,v){this.generatorService=e,this.generatorHistoryService=t,this.toastService=i,this.logService=n,this.i18nService=s,this.accountService=h,this.zone=p,this.formBuilder=m,this.ariaLive=v,this.destroyed=new o.B,this.Algorithm=A.oG,this.account=null,this.debug=!1,this.log=(0,S.S2)({}),this.account$=new a.m(1),this.website=null,this.onGenerated=new r.bkB,this.root$=new l.t({nav:null}),this.username=this.formBuilder.group({nav:[null]}),this.forwarder=this.formBuilder.group({nav:[null]}),this.rootOptions$=new l.t([]),this.usernameOptions$=new l.t([]),this.forwarderOptions$=new l.t([]),this.forwarderId$=new l.t(null),this.showForwarder$=new l.t(!1),this.maybeAlgorithm$=new a.m(1),this.algorithm$=this.maybeAlgorithm$.pipe((0,c.p)(e=>!!e)),this.showAlgorithm$=this.maybeAlgorithm$.pipe((0,d.v)(this.showForwarder$),(0,u.T)(([e,t])=>t?null:e)),this.credentialTypeCopyLabel$=this.algorithm$.pipe((0,u.T)(({i18nKeys:{copyCredential:e}})=>(0,J.Tl)(e,this.i18nService))),this.credentialTypeGenerateLabel$=this.algorithm$.pipe((0,u.T)(({i18nKeys:{generateCredential:e}})=>(0,J.Tl)(e,this.i18nService))),this.credentialTypeLabel$=this.algorithm$.pipe((0,u.T)(({i18nKeys:{credentialType:e}})=>(0,J.Tl)(e,this.i18nService))),this.credentialTypeHint$=new a.m(1),this.category$=new a.m(1),this.generatedCredential$=new l.t(void 0),this.value$=this.generatedCredential$.pipe((0,u.T)(e=>{var t;return null!==(t=null==e?void 0:e.credential)&&void 0!==t?t:"-"})),this.USER_REQUEST="user request",this.generate$=new o.B}ngOnChanges(e){return ae(this,void 0,void 0,function*(){var t,i,n,r,s;const o=null==e?void 0:e.account;(null===(t=null==o?void 0:o.previousValue)||void 0===t?void 0:t.id)!==(null===(i=null==o?void 0:o.currentValue)||void 0===i?void 0:i.id)&&(this.log.debug({previousUserId:null===(n=null==o?void 0:o.previousValue)||void 0===n?void 0:n.id,currentUserId:null===(r=null==o?void 0:o.currentValue)||void 0===r?void 0:r.id},"account input change detected"),this.account$.next(null!==(s=o.currentValue)&&void 0!==s?s:this.account))})}onRootChanged(e){this.root$.value.nav!==e.nav&&this.zone.run(()=>{this.root$.next(e)})}ngOnInit(){return ae(this,void 0,void 0,function*(){if(this.log=(0,S.mJ)(this.debug,this.logService,{type:"CredentialGeneratorComponent"}),!this.account){const e=yield(0,h._)(this.accountService.activeAccount$);e||this.log.panic("active account cannot be `null`."),this.log.info({userId:e.id},"account not specified; using active account settings"),this.account$.next(e)}(0,p.z)([this.generatorService.algorithms$("email",{account$:this.account$}),this.generatorService.algorithms$("username",{account$:this.account$})]).pipe((0,u.T)(e=>e.flat()),(0,u.T)(e=>{const t=e.filter(e=>!(0,A.$S)(e.id));t.sort((e,t)=>e.weight-t.weight);const i=this.toOptions(t);i.splice(-1,0,{value:be,label:this.i18nService.t("forwardedEmail")});const n=e.filter(e=>(0,A.$S)(e.id));n.sort((e,t)=>e.weight-t.weight);const r=this.toOptions(n);return r.unshift({value:we,label:this.i18nService.t("select")}),[i,r]}),(0,m.M)(e=>this.log.debug({algorithms:e},"algorithms loaded")),(0,v.Q)(this.destroyed)).subscribe(([e,t])=>{this.zone.run(()=>{this.usernameOptions$.next(e),this.forwarderOptions$.next(t)})}),this.generatorService.algorithms$("password",{account$:this.account$}).pipe((0,u.T)(e=>{const t=this.toOptions(e);return t.push({value:ye,label:this.i18nService.t("username")}),t}),(0,v.Q)(this.destroyed)).subscribe(this.rootOptions$),this.maybeAlgorithm$.pipe((0,u.T)(e=>{var t;return(null===(t=null==e?void 0:e.i18nKeys)||void 0===t?void 0:t.description)?(0,J.Tl)(e.i18nKeys.description,this.i18nService):""}),(0,v.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{this.credentialTypeHint$.next(e)})}),this.maybeAlgorithm$.pipe((0,u.T)(e=>null==e?void 0:e.type),(0,f.F)(),(0,v.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{this.category$.next(e)})}),this.generatorService.generate$({on$:this.generate$,account$:this.account$}).pipe((0,g.W)((e,t)=>("string"==typeof e?this.toastService.showToast({message:e,variant:"error",title:""}):this.logService.error(e),t)),(0,y.E)(this.account$,this.maybeAlgorithm$),(0,v.Q)(this.destroyed)).subscribe(([e,t,i])=>{var n,r;this.log.debug({source:null!==(n=e.source)&&void 0!==n?n:null,algorithm:null!==(r=null==i?void 0:i.id)&&void 0!==r?r:null},"credential generated"),this.generatorHistoryService.track(t.id,e.credential,e.category,e.generationDate).catch(e=>{this.logService.error(e)}),this.zone.run(()=>{i&&e.source===this.USER_REQUEST&&this.announce((0,J.Tl)(i.i18nKeys.credentialGenerated,this.i18nService)),this.generatedCredential$.next(e),this.onGenerated.next(e)})});const e=new o.B,t=new o.B,i=new o.B;this.root$.pipe((0,u.T)(e=>e.nav===ye?{nav:e.nav}:e.nav?{nav:e.nav,algorithm:JSON.parse(e.nav)}:{nav:ye}),(0,v.Q)(this.destroyed)).subscribe(e),this.username.valueChanges.pipe((0,u.T)(e=>{if(e.nav===be)return{nav:e.nav};if(e.nav)return{nav:e.nav,algorithm:JSON.parse(e.nav)};{const[e]=A.I4[A.ZU.username];return{nav:JSON.stringify(e),algorithm:e}}}),(0,v.Q)(this.destroyed)).subscribe(t),this.forwarder.valueChanges.pipe((0,u.T)(e=>e.nav===we?{nav:e.nav}:e.nav?{nav:e.nav,algorithm:JSON.parse(e.nav)}:{nav:we}),(0,v.Q)(this.destroyed)).subscribe(i),(0,p.z)([e,t,i]).pipe((0,u.T)(([e,t,i])=>{const n=!e.algorithm&&!t.algorithm;return[n,n&&i.algorithm&&(0,A.$S)(i.algorithm)?i.algorithm.forwarder:null]}),(0,f.F)((e,t)=>e[0]===t[0]&&e[1]===t[1]),(0,v.Q)(this.destroyed)).subscribe(([e,t])=>{this.log.debug({forwarderId:t,showForwarder:e},"forwarder visibility updated"),this.zone.run(()=>{this.showForwarder$.next(e),this.forwarderId$.next(t)})}),(0,p.z)([e,t,i]).pipe((0,u.T)(([e,t,i])=>{var n,r;const s=null!==(r=null!==(n=e.algorithm)&&void 0!==n?n:t.algorithm)&&void 0!==r?r:i.algorithm;return s?this.generatorService.algorithm(s):null}),(0,f.F)((e,t)=>null!==e&&null!==t&&(0,A.W0)(e.id,t.id)),(0,v.Q)(this.destroyed)).subscribe(e=>{var t;this.log.debug({algorithm:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null},"algorithm selected"),this.zone.run(()=>{this.maybeAlgorithm$.next(e)})});const n=yield this.generatorService.preferences({account$:this.account$});this.algorithm$.pipe((0,y.E)(n),(0,v.Q)(this.destroyed)).subscribe(([e,t])=>{function i(i){const n=t[i];n.algorithm=e.id,n.updated=new Date}if((0,A.MP)(e.id))i("email");else if((0,A.yJ)(e.id))i("username");else{if(!(0,A.xu)(e.id))return;i("password")}this.log.info({algorithm:e.id,type:e.type},"algorithm preferences updated"),n.next(t)}),n.pipe((0,u.T)(({email:e,username:t,password:i})=>{const n=e.updated>t.updated?e:t,r=(0,A.$S)(n.algorithm)?n:null,s=r?JSON.stringify(r.algorithm):we,o=r?be:JSON.stringify(n.algorithm),a=n.updated>i.updated?ye:JSON.stringify(i.algorithm);return{root:{selection:{nav:a},active:{nav:a,algorithm:a===ye?void 0:i.algorithm}},username:{selection:{nav:o},active:{nav:o,algorithm:r?void 0:n.algorithm}},forwarder:{selection:{nav:s},active:{nav:s,algorithm:null==r?void 0:r.algorithm}}}}),(0,v.Q)(this.destroyed)).subscribe(({root:n,username:r,forwarder:s})=>{this.log.debug({root:n.selection,username:r.selection,forwarder:s.selection},"navigation updated"),this.onRootChanged(n.selection),this.username.setValue(r.selection,{emitEvent:!1}),this.forwarder.setValue(s.selection,{emitEvent:!1}),e.next(n.active),t.next(r.active),i.next(s.active)}),this.maybeAlgorithm$.pipe((0,v.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{var t;(null===(t=null==e?void 0:e.capabilities)||void 0===t?void 0:t.autogenerate)?(this.log.debug("autogeneration enabled"),this.generate("autogenerate").catch(e=>{this.log.error(e,"a failure occurred during autogeneration")})):(this.log.debug("autogeneration disabled; clearing generated credential"),this.generatedCredential$.next(void 0))})}),this.log.debug("component initialized")})}announce(e){this.ariaLive.announce(e).catch(e=>this.logService.error(e))}generate(e){return ae(this,void 0,void 0,function*(){const t=yield(0,h._)(this.algorithm$),i={source:e,algorithm:t.id};this.website&&(i.website=this.website),this.log.debug(i,"generation requested"),this.generate$.next(i)})}toOptions(e){return e.map(e=>({value:JSON.stringify(e.id),label:(0,J.Tl)(e.i18nKeys.name,this.i18nService)}))}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.generate$.complete(),this.generatedCredential$.complete(),this.onGenerated.complete(),this.log.debug("component destroyed")}}Se.ɵfac=function(e){return new(e||Se)(r.rXU(A.iE),r.rXU(D.ZS),r.rXU(Z.f),r.rXU(w.K),r.rXU(Q.W),r.rXU(z.Di),r.rXU(r.SKi),r.rXU(s.ok),r.rXU(ee.Ai))},Se.ɵcmp=r.VBU({type:Se,selectors:[["tools-credential-generator"]],inputs:{account:"account",debug:"debug",website:"website"},outputs:{onGenerated:"onGenerated"},features:[r.OA$],decls:30,vars:42,consts:[["fullWidth","",1,"tw-mb-4",3,"selectedChange","selected"],[3,"value"],[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-grow","tw-flex","tw-items-center","tw-min-w-0"],[1,"tw-font-mono",3,"password"],[1,"tw-flex","tw-items-center","tw-space-x-1"],["type","button","bitIconButton","bwi-generate","buttonType","main",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","buttonType","main","showToast","",3,"label","appCopyClick","valueLabel","disabled"],[1,"tw-mt-6",3,"account"],[1,"tw-mt-6",3,"onUpdated","account"],["bitTypography","h6"],[1,"tw-mb-4"],[1,"tw-container",3,"formGroup"],["formControlName","nav","data-testid","username-type",3,"items"],[3,"account"],[3,"account","forwarder"],["formControlName","nav","data-testid","email-forwarding-service",3,"items"],[3,"onUpdated","account"]],template:function(e,t){if(1&e){const e=r.RV6();r.j41(0,"bit-toggle-group",0),r.nI1(1,"async"),r.nI1(2,"i18n"),r.bIt("selectedChange",function(i){return B.eBV(e),B.Njj(t.onRootChanged({nav:i}))}),r.Z7z(3,le,2,2,"bit-toggle",1,r.fX1),r.nI1(5,"async"),r.k0s(),r.nrm(6,"nudge-generator-spotlight"),r.j41(7,"bit-card",2)(8,"div",3),r.nrm(9,"bit-color-password",4),r.nI1(10,"async"),r.k0s(),r.j41(11,"div",5)(12,"button",6),r.nI1(13,"async"),r.nI1(14,"async"),r.bIt("click",function(){return B.eBV(e),B.Njj(t.generate(t.USER_REQUEST))}),r.EFF(15),r.nI1(16,"async"),r.k0s(),r.nrm(17,"button",7),r.nI1(18,"async"),r.nI1(19,"async"),r.nI1(20,"async"),r.nI1(21,"async"),r.k0s()(),r.SS7(22),r.nI1(23,"async"),r.SS7(24),r.nI1(25,"async"),r.nVh(26,ce,1,1,"tools-password-settings",8)(27,de,1,1,"tools-passphrase-settings",8),r.nVh(28,ge,23,22,"bit-section"),r.nI1(29,"async")}if(2&e){let e;r.Y8G("selected",r.bMT(1,12,t.root$).nav),r.BMQ("aria-label",r.bMT(2,14,"type")),r.R7$(3),r.Dyx(r.bMT(5,16,t.rootOptions$)),r.R7$(6),r.Y8G("password",r.bMT(10,18,t.value$)),r.R7$(3),r.Y8G("label",r.bMT(13,20,t.credentialTypeGenerateLabel$))("disabled",!r.bMT(14,22,t.algorithm$)),r.R7$(3),r.SpI(" ",r.bMT(16,24,t.credentialTypeGenerateLabel$)," "),r.R7$(2),r.Y8G("label",r.bMT(18,26,t.credentialTypeCopyLabel$))("appCopyClick",r.bMT(19,28,t.value$))("valueLabel",r.bMT(20,30,t.credentialTypeLabel$))("disabled",!r.bMT(21,32,t.algorithm$)),r.R7$(5);const i=r.bH3(r.bMT(23,34,t.showAlgorithm$));r.R7$(2),r.bH3(r.bMT(25,37,t.account$)),r.R7$(2),r.vxM((e=null==i?null:i.id)===t.Algorithm.password?26:e===t.Algorithm.passphrase?27:-1),r.R7$(2),r.vxM("password"!==r.bMT(29,40,t.category$)?28:-1)}},dependencies:[I.E,te.H,ie.a,_,k.i,C.S,T.s,F.D,Y.q,X.H,R.n,P.U,x.E,L.r,s.X1,s.qT,s.BC,s.cb,s.j4,s.JD,$.L,ne.j,re.I,se.h,E.p,oe.w,M.b,U.h,H.z,W.b,b.p,n.Jj,O.$Z],encapsulation:2})},304:(e,t,i)=>{"use strict";i.d(t,{l:()=>n});class n{}},347:(e,t,i)=>{"use strict";i.d(t,{h5:()=>x,Fx:()=>f,kg:()=>O});var n=i(77468),r=i(72245),s=i(274),o=i(81285),a=i(81441),l=i(56962),c=i(83516),d=i(49272),u=i(44432),h=i(36801),p=i(33812),m=i(74208),v=i(35500);class f{}var g=i(50700),y=i(83541),b=i(1221),w=i(69855),S=i(21274),I=i(52717),k=i(18499),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const T=()=>({key:"changeMasterPassword"});function F(e,t){1&e&&(p.nrm(0,"i",0),p.nI1(1,"i18n"),p.j41(2,"span",1),p.EFF(3),p.nI1(4,"i18n"),p.k0s()),2&e&&(p.Y8G("title",p.mNQ(p.bMT(1,3,"loading"))),p.R7$(3),p.JRh(p.bMT(4,5,"loading")))}function R(e,t){1&e&&(p.j41(0,"bit-callout",4),p.EFF(1),p.nI1(2,"i18n"),p.k0s()),2&e&&(p.R7$(),p.JRh(p.bMT(2,1,"changePasswordWarning")))}function P(e,t){if(1&e){const e=p.RV6();p.DNE(0,R,3,3,"bit-callout",2),p.j41(1,"auth-input-password",3),p.bIt("onPasswordFormSubmit",function(t){m.eBV(e);const i=p.XpG();return m.Njj(i.handlePasswordFormSubmit(t))})("onSecondaryButtonClick",function(){m.eBV(e);const t=p.XpG();return m.Njj(t.logOut())}),p.k0s()}if(2&e){const e=p.XpG();p.Y8G("ngIf",e.forceSetPasswordReason!==e.ForceSetPasswordReason.AdminForcePasswordReset),p.R7$(),p.Y8G("flow",e.inputPasswordFlow)("email",e.email)("userId",e.userId)("loading",e.submitting)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)("inlineButtons",!0)("primaryButtonText",p.lJ4(9,T))("secondaryButtonText",e.secondaryButtonText())}}class x{constructor(e,t,i,n,r,s,l,c,d,u,h,p){this.accountService=e,this.changePasswordService=t,this.i18nService=i,this.masterPasswordService=n,this.anonLayoutWrapperDataService=r,this.organizationInviteService=s,this.messagingService=l,this.policyService=c,this.toastService=d,this.syncService=u,this.dialogService=h,this.logService=p,this.inputPasswordFlow=o.m5.ChangePassword,this.activeAccount=null,this.initializing=!0,this.submitting=!1,this.forceSetPasswordReason=a.n.None,this.ForceSetPasswordReason=a.n}ngOnInit(){return C(this,void 0,void 0,function*(){if(this.activeAccount=yield(0,r._)(this.accountService.activeAccount$),!this.activeAccount)throw new Error("No active active account found while trying to change passwords.");if(this.userId=this.activeAccount.id,this.email=this.activeAccount.email,!this.userId)throw new Error("userId not found");this.masterPasswordPolicyOptions=yield(0,r._)(this.policyService.masterPasswordPolicyOptions$(this.userId)),this.forceSetPasswordReason=yield(0,r._)(this.masterPasswordService.forceSetPasswordReason$(this.userId)),this.forceSetPasswordReason===a.n.AdminForcePasswordReset?this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:s.X,pageTitle:{key:"updateMasterPassword"},pageSubtitle:{key:"accountRecoveryUpdateMasterPasswordSubtitle"}}):this.forceSetPasswordReason===a.n.WeakMasterPassword&&this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:s.X,pageTitle:{key:"updateMasterPassword"},pageSubtitle:{key:"updateMasterPasswordSubtitle"},maxWidth:"lg"}),this.initializing=!1})}logOut(){return C(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}))&&(yield this.organizationInviteService.clearOrganizationInvitation(),this.changePasswordService.clearDeeplinkState&&(yield this.changePasswordService.clearDeeplinkState()),this.messagingService.send("logout"))})}handlePasswordFormSubmit(e){return C(this,void 0,void 0,function*(){var t,i;this.submitting=!0;try{if(e.rotateUserKey){if(null==this.activeAccount)throw new Error("activeAccount not found");if(null==e.currentPassword||null==e.newPasswordHint)throw new Error("currentPassword or newPasswordHint not found");yield this.syncService.fullSync(!0),yield this.changePasswordService.rotateUserKeyMasterPasswordAndEncryptedData(e.currentPassword,e.newPassword,this.activeAccount,e.newPasswordHint)}else{if(!this.userId)throw new Error("userId not found");this.forceSetPasswordReason===a.n.AdminForcePasswordReset?yield this.changePasswordService.changePasswordForAccountRecovery(e,this.userId):yield this.changePasswordService.changePassword(e,this.userId),this.toastService.showToast({variant:"success",message:this.i18nService.t("masterPasswordChanged")}),this.messagingService.send("logout"),null===(i=(t=this.changePasswordService).closeBrowserExtensionPopout)||void 0===i||i.call(t)}}catch(n){this.logService.error(n),this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("errorOccurred")})}finally{this.submitting=!1}})}secondaryButtonText(){return this.forceSetPasswordReason===a.n.AdminForcePasswordReset||this.forceSetPasswordReason===a.n.WeakMasterPassword?{key:"logOut"}:void 0}}x.ɵfac=function(e){return new(e||x)(p.rXU(v.Di),p.rXU(f),p.rXU(g.W),p.rXU(y.O),p.rXU(b.f),p.rXU(I.i),p.rXU(c.U),p.rXU(k.m),p.rXU(w.f),p.rXU(d.H),p.rXU(S.o3),p.rXU(l.K))},x.ɵcmp=p.VBU({type:x,selectors:[["auth-change-password"]],inputs:{inputPasswordFlow:"inputPasswordFlow"},decls:2,vars:1,consts:[["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],["type","warning",4,"ngIf"],[3,"onPasswordFormSubmit","onSecondaryButtonClick","flow","email","userId","loading","masterPasswordPolicyOptions","inlineButtons","primaryButtonText","secondaryButtonText"],["type","warning"]],template:function(e,t){1&e&&p.nVh(0,F,5,7)(1,P,2,10),2&e&&p.vxM(t.initializing?0:1)},dependencies:[o.tu,u.G,n.MD,n.bT,h.$Z],encapsulation:2});var $=i(22397),E=i(28202);class A extends E.W7{}var D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class O{constructor(e,t,i){this.keyService=e,this.masterPasswordApiService=t,this.masterPasswordService=i}rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n){return D(this,void 0,void 0,function*(){throw new Error("rotateUserKeyMasterPasswordAndEncryptedData() is only implemented in Web")})}preparePasswordChange(e,t,i){return D(this,void 0,void 0,function*(){if(!t)throw new Error("userId not found");if(!(e.currentMasterKey&&e.currentServerMasterKeyHash&&e.newMasterKey&&e.newServerMasterKeyHash&&null!=e.newPasswordHint))throw new Error("invalid PasswordInputResult credentials, could not change password");const n=yield this.masterPasswordService.decryptUserKeyWithMasterKey(e.currentMasterKey,t);if(null==n)throw new Error("Could not decrypt user key");const r=yield this.keyService.encryptUserKeyWithMasterKey(e.newMasterKey,n);return i instanceof $.T?(i.masterPasswordHash=e.currentServerMasterKeyHash,i.newMasterPasswordHash=e.newServerMasterKeyHash,i.masterPasswordHint=e.newPasswordHint):i instanceof A&&(i.newMasterPasswordHash=e.newServerMasterKeyHash,i.masterPasswordHint=e.newPasswordHint),r})}changePassword(e,t){return D(this,void 0,void 0,function*(){const i=new $.T,n=yield this.preparePasswordChange(e,t,i);i.key=n[1].encryptedString;try{yield this.masterPasswordApiService.postPassword(i)}catch(r){throw new Error("Could not change password")}})}changePasswordForAccountRecovery(e,t){return D(this,void 0,void 0,function*(){const i=new A,n=yield this.preparePasswordChange(e,t,i);i.key=n[1].encryptedString;try{yield this.masterPasswordApiService.putUpdateTempPassword(i)}catch(r){throw new Error("Could not change password")}})}}},406:(e,t,i)=>{"use strict";i.d(t,{b:()=>I});var n=i(39180),r=i(94573),s=i(33812),o=i(51757),a=i(97658),l=i(36801),c=i(639),d=i(22949),u=i(83632),h=i(74208),p=i(50700),m=i(47696);function v(e,t){1&e&&s.nrm(0,"bit-spinner")}function f(e,t){if(1&e&&s.nrm(0,"i",8),2&e){const e=s.XpG().item;s.HbH(s.VkB("bwi bwi-fw ",e.icon))}}function g(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",4),s.bIt("click",function(){const t=h.eBV(e),i=t.item,n=t.clear;return h.Njj(n(i))}),s.nVh(1,f,1,3,"i",5),s.j41(2,"span",6),s.EFF(3),s.k0s(),s.nrm(4,"i",7),s.k0s()}if(2&e){const e=t.item,i=s.XpG();s.Y8G("disabled",i.disabled),s.R7$(),s.vxM(null!=e.icon?1:-1),s.R7$(2),s.SpI(" ",e.labelName," ")}}function y(e,t){1&e&&s.nrm(0,"i",11)}function b(e,t){if(1&e&&s.nrm(0,"i",8),2&e){const e=s.XpG().item;s.HbH(s.VkB("bwi bwi-fw ",e.icon))}}function w(e,t){if(1&e&&(s.j41(0,"div",9)(1,"div",10),s.nVh(2,y,1,0,"i",11),s.k0s(),s.j41(3,"div",12),s.nVh(4,b,1,3,"i",5),s.k0s(),s.j41(5,"div",13),s.EFF(6),s.k0s()()),2&e){const e=t.item,i=s.XpG();s.R7$(2),s.vxM(i.isSelected(e)?2:-1),s.R7$(2),s.vxM(null!=e.icon?4:-1),s.R7$(2),s.SpI(" ",e.listName," ")}}let S=0;class I{constructor(e,t){this.i18nService=e,this.ngControl=t,this.select=r.ebz.required(a.vr),this.baseItems=r.geq.required(),this.removeSelectedItems=(0,r.hFB)(!1),this.placeholder=(0,r.geq)(),this.loading=(0,r.hFB)(!1),this.selectedItems=null,this.searchInputId="search-input-"+S++,this.onItemsConfirmed=new s.bkB,this.keyDown=e=>{const t=this.select();return!(!t.isOpen()&&"Enter"===e.key&&!(0,n.rp)(e))&&(!(t.isOpen()&&"Escape"===e.key&&!(0,n.rp)(e))||(this.selectedItems=[],t.close(),e.stopPropagation(),!1))},this.id=(0,r.hFB)("bit-multi-select-"+S++),null!=t&&(t.valueAccessor=this)}ngOnInit(){this.placeholder.update(e=>null!=e?e:this.i18nService.t("multiSelectPlaceholder")),this.loadingText=this.i18nService.t("multiSelectLoading")}isSelected(e){var t;return null!=(null===(t=this.selectedItems)||void 0===t?void 0:t.find(t=>t.id===e.id))}onDropdownClosed(){if(null!=this.selectedItems&&0!=this.selectedItems.length&&(this.onItemsConfirmed.emit(this.selectedItems),this.removeSelectedItems())){let e=this.baseItems();this.selectedItems.forEach(t=>{e=e.filter(e=>t.id!==e.id)}),this.selectedItems=null,this.baseItems.set(e)}}writeValue(e){this.selectedItems=e}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouched=e}setDisabledState(e){this.disabled=e}onChange(e){this.notifyOnChange&&this.notifyOnChange(e)}onBlur(){this.notifyOnTouched&&this.notifyOnTouched()}get ariaDescribedBy(){return this._ariaDescribedBy}set ariaDescribedBy(e){var t;this._ariaDescribedBy=e,null===(t=this.select())||void 0===t||t.searchInput().nativeElement.setAttribute("aria-describedby",null!=e?e:"")}get labelForId(){return this.searchInputId}get required(){var e,t,i,n;return null!==(n=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(o.k0.required))&&void 0!==n&&n}set required(e){this._required=null!=e&&!1!==e}get hasError(){var e,t;return!("INVALID"!==(null===(e=this.ngControl)||void 0===e?void 0:e.status)||!(null===(t=this.ngControl)||void 0===t?void 0:t.touched))}get error(){var e,t;const i=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}}I.ɵfac=function(e){return new(e||I)(s.rXU(p.W),s.rXU(o.vO,10))},I.ɵcmp=s.VBU({type:I,selectors:[["bit-multi-select"]],viewQuery:function(e,t){1&e&&s.wEZ(t.select,a.vr,5),2&e&&s.NyB()},hostVars:3,hostBindings:function(e,t){2&e&&(s.Avn("id",t.id()),s.BMQ("aria-describedby",t.ariaDescribedBy)("required",t.required))},inputs:{baseItems:[1,"baseItems"],removeSelectedItems:[1,"removeSelectedItems"],placeholder:[1,"placeholder"],loading:[1,"loading"],disabled:[2,"disabled","disabled",r.L39],id:[1,"id"],required:"required"},outputs:{baseItems:"baseItemsChange",placeholder:"placeholderChange",onItemsConfirmed:"onItemsConfirmed"},features:[s.Jv_([{provide:d.p,useExisting:I}])],decls:6,vars:19,consts:[["bindLabel","listName","groupBy","parentGrouping","appendTo","body",3,"ngModelChange","blur","close","items","ngModel","placeholder","loading","loadingText","notFoundText","clearAllText","multiple","closeOnSelect","disabled","clearSearchOnAdd","labelForId","keyDownFn"],["ng-loadingspinner-tmp",""],["ng-label-tmp",""],["ng-option-tmp",""],["type","button","bitBadge","","variant","primary",1,"tw-me-1","disabled:tw-border-0","tw-flex","tw-gap-1.5","tw-items-center",3,"click","disabled"],["aria-hidden","true",3,"class"],[1,"tw-truncate"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close","bwi-sm"],["aria-hidden","true"],[1,"tw-flex"],[1,"tw-w-7","tw-flex-none"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check"],[1,"tw-me-2","tw-flex-initial"],[1,"tw-flex-1"]],template:function(e,t){1&e&&(s.j41(0,"ng-select",0),s.nI1(1,"i18n"),s.nI1(2,"i18n"),s.mxI("ngModelChange",function(e){return s.DH7(t.selectedItems,e)||(t.selectedItems=e),e}),s.bIt("ngModelChange",function(e){return t.onChange(e)})("blur",function(){return t.onBlur()})("close",function(){return t.onDropdownClosed()}),s.DNE(3,v,1,0,"ng-template",1)(4,g,5,3,"ng-template",2)(5,w,7,3,"ng-template",3),s.k0s()),2&e&&(s.Y8G("notFoundText",s.mNQ(s.bMT(1,15,"multiSelectNotFound")))("clearAllText",s.mNQ(s.bMT(2,17,"multiSelectClearAll")))("items",t.baseItems()),s.R50("ngModel",t.selectedItems),s.Y8G("placeholder",t.placeholder())("loading",t.loading())("loadingText",t.loadingText)("multiple",!0)("closeOnSelect",!1)("disabled",t.disabled)("clearSearchOnAdd",!0)("labelForId",t.labelForId)("keyDownFn",t.keyDown))},dependencies:[a.MQ,a.vr,a.Uq,a.ZZ,a.QQ,o.X1,o.BC,o.YN,o.vS,c.E,m.n,u.t,l.$Z],encapsulation:2})},440:(e,t,i)=>{"use strict";i.d(t,{z:()=>p});var n=i(33812),r=(i(84488),i(90097)),s=i(25065),o=i(27760),a=i(74208),l=i(91326),c=i(59032),d=i(77468),u=i(88016);function h(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-banner",0),n.EFF(1),n.j41(2,"a",1),n.bIt("click",function(){a.eBV(e);const t=n.XpG();return a.Njj(t.clicked.emit())}),n.EFF(3),n.nI1(4,"i18n"),n.k0s()()}if(2&e){n.XpG();const e=n.r8f(0);n.Y8G("showClose",!1),n.R7$(),n.SpI(" ",e.message," "),n.R7$(2),n.SpI(" ",n.bMT(4,3,"clickHereToAddPaymentMethod")," ")}}class p{constructor(e){this.organizationWarningsService=e,this.includeOrganizationNameInMessaging=!1,this.clicked=new n.bkB}ngOnInit(){this.warning$=this.organizationWarningsService.getFreeTrialWarning$(this.organization,this.includeOrganizationNameInMessaging)}}p.ɵfac=function(e){return new(e||p)(n.rXU(o.S))},p.ɵcmp=n.VBU({type:p,selectors:[["app-organization-free-trial-warning"]],inputs:{organization:"organization",includeOrganizationNameInMessaging:"includeOrganizationNameInMessaging"},outputs:{clicked:"clicked"},decls:3,vars:4,consts:[["id","free-trial-banner","icon","bwi-billing","bannerType","premium",3,"showClose"],["bitLink","","linkType","secondary","rel","noreferrer noopener",1,"tw-cursor-pointer",3,"click"]],template:function(e,t){if(1&e&&(n.SS7(0),n.nI1(1,"async"),n.nVh(2,h,5,5,"bit-banner",0)),2&e){const e=n.bH3(n.bMT(1,1,t.warning$));n.R7$(2),n.vxM(e?2:-1)}},dependencies:[r.H,l.K,s.G,c.L,d.Jj,u.$],encapsulation:2})},639:(e,t,i)=>{"use strict";i.d(t,{E:()=>o});var n=i(47696),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.n]})},685:(e,t,i)=>{"use strict";i.d(t,{XS:()=>y,Zc:()=>g});var n=i(3204),r=i(33338),s=i(93695),o=i(72245),a=i(44500),l=i(3633),c=i(43978),d=i(46217),u=i(38449),h=i(17989);class p extends h.A{constructor(){super(...arguments),this.autoEnrollEnabled=!1}}var m=i(31857);const v=m.Ok.record(m.jb,"policies",{deserializer:e=>e,clearOn:["logout"]});var f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const g=(0,n.T)(e=>{var t;return null!==(t=e.at(0))&&void 0!==t?t:void 0});class y{constructor(e,t,i){this.stateProvider=e,this.organizationService=t,this.accountService=i}policyState(e){return this.stateProvider.getUser(e,v)}policyData$(e){return this.policyState(e).state$.pipe((0,n.T)(e=>null!=e?e:{}))}policies$(e){return this.policyData$(e).pipe((0,n.T)(e=>{return t=e,Object.values(t||{}).map(e=>new u.P(e));var t}))}policiesByType$(e,t){if(!t)throw new Error("No userId provided");const i=this.policies$(t),s=this.organizationService.organizations$(t);return(0,r.z)([i,s]).pipe((0,n.T)(([e,t])=>this.enforcedPolicyFilter(e,t)),(0,n.T)(t=>t.filter(t=>t.type===e)))}policyAppliesToUser$(e,t){return this.policiesByType$(e,t).pipe(g,(0,n.T)(e=>!!e))}enforcedPolicyFilter(e,t){const i=Object.fromEntries(t.map(e=>[e.id,e]));return e.filter(t=>{const n=i[t.organizationId];return!n||t.enabled&&n.status>=c.Zx.Accepted&&n.usePolicies&&!this.isExemptFromPolicy(t.type,n,e)})}masterPasswordPolicyOptions$(e,t){return(t?(0,s.of)(t):this.policies$(e)).pipe((0,n.T)(e=>{var t;let i;const n=null!==(t=e.filter(e=>e.type===c.tt.MasterPassword))&&void 0!==t?t:[];if(0!==n.length)return n.forEach(e=>{e.enabled&&e.data&&(i||(i=new d.U),null!=e.data.minComplexity&&e.data.minComplexity>i.minComplexity&&(i.minComplexity=e.data.minComplexity),null!=e.data.minLength&&e.data.minLength>i.minLength&&(i.minLength=e.data.minLength),e.data.requireUpper&&(i.requireUpper=!0),e.data.requireLower&&(i.requireLower=!0),e.data.requireNumbers&&(i.requireNumbers=!0),e.data.requireSpecial&&(i.requireSpecial=!0),e.data.enforceOnLogin&&(i.enforceOnLogin=!0))}),i}))}combinePoliciesIntoMasterPasswordPolicyOptions(e){var t;let i;const n=null!==(t=e.filter(e=>e.type===c.tt.MasterPassword))&&void 0!==t?t:[];if(0!==n.length)return n.forEach(e=>{e.enabled&&e.data&&(i||(i=new d.U),this.mergeMasterPasswordPolicyOptions(i,e.data))}),i}combineMasterPasswordPolicyOptions(...e){let t;return e.forEach(e=>{t||(t=new d.U),this.mergeMasterPasswordPolicyOptions(t,e)}),t}evaluateMasterPassword(e,t,i){return!i||!(i.minComplexity>0&&i.minComplexity>e)&&(!(i.minLength>0&&i.minLength>t.length)&&((!i.requireUpper||t.toLocaleLowerCase()!==t)&&((!i.requireLower||t.toLocaleUpperCase()!==t)&&(!(i.requireNumbers&&!/[0-9]/.test(t))&&!(i.requireSpecial&&!/[!@#$%\^&*]/g.test(t))))))}getResetPasswordPolicyOptions(e,t){var i,n,r;const s=new p;if(!e||!t)return[s,!1];const o=e.find(e=>e.organizationId===t&&e.type===c.tt.ResetPassword&&e.enabled);return s.autoEnrollEnabled=null!==(n=null===(i=null==o?void 0:o.data)||void 0===i?void 0:i.autoEnrollEnabled)&&void 0!==n&&n,[s,null!==(r=null==o?void 0:o.enabled)&&void 0!==r&&r]}upsert(e,t){return f(this,void 0,void 0,function*(){yield this.policyState(t).update(t=>(null!=t||(t={}),t[e.id]=e,t))})}replace(e,t){return f(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(v,e,t)})}isExemptFromPolicy(e,t,i){switch(e){case c.tt.MaximumVaultTimeout:return t.isOwner;case c.tt.PasswordGenerator:case c.tt.FreeFamiliesSponsorshipPolicy:case c.tt.RestrictedItemTypes:case c.tt.RemoveUnlockWithPin:case c.tt.AutoConfirm:return!1;case c.tt.OrganizationDataOwnership:return t.isAdmin;case c.tt.SingleOrg:return!i.find(e=>e.organizationId===t.id&&e.type===c.tt.AutoConfirm&&e.enabled)&&t.canManagePolicies;default:return t.canManagePolicies}}mergeMasterPasswordPolicyOptions(e,t){var i,n;e||(e=new d.U),t&&(e.minComplexity=Math.max(e.minComplexity,null!==(i=t.minComplexity)&&void 0!==i?i:e.minComplexity),e.minLength=Math.max(e.minLength,null!==(n=t.minLength)&&void 0!==n?n:e.minLength),e.requireUpper=Boolean(e.requireUpper||t.requireUpper),e.requireLower=Boolean(e.requireLower||t.requireLower),e.requireNumbers=Boolean(e.requireNumbers||t.requireNumbers),e.requireSpecial=Boolean(e.requireSpecial||t.requireSpecial),e.enforceOnLogin=Boolean(e.enforceOnLogin||t.enforceOnLogin))}syncPolicy(e){return f(this,void 0,void 0,function*(){yield(0,o._)(this.accountService.activeAccount$.pipe(l.F6,(0,a.n)(t=>this.upsert(e,t))))})}}},1036:(e,t,i)=>{"use strict";var n;i.d(t,{t:()=>n}),function(e){e[e.TwoFactorAuthentication=0]="TwoFactorAuthentication",e[e.MasterPassword=1]="MasterPassword",e[e.PasswordGenerator=2]="PasswordGenerator",e[e.SingleOrg=3]="SingleOrg",e[e.RequireSso=4]="RequireSso",e[e.OrganizationDataOwnership=5]="OrganizationDataOwnership",e[e.DisableSend=6]="DisableSend",e[e.SendOptions=7]="SendOptions",e[e.ResetPassword=8]="ResetPassword",e[e.MaximumVaultTimeout=9]="MaximumVaultTimeout",e[e.DisablePersonalVaultExport=10]="DisablePersonalVaultExport",e[e.ActivateAutofill=11]="ActivateAutofill",e[e.AutomaticAppLogIn=12]="AutomaticAppLogIn",e[e.FreeFamiliesSponsorshipPolicy=13]="FreeFamiliesSponsorshipPolicy",e[e.RemoveUnlockWithPin=14]="RemoveUnlockWithPin",e[e.RestrictedItemTypes=15]="RestrictedItemTypes",e[e.UriMatchDefaults=16]="UriMatchDefaults",e[e.AutotypeDefaultSetting=17]="AutotypeDefaultSetting",e[e.AutoConfirm=18]="AutoConfirm",e[e.BlockClaimedDomainAccountCreation=19]="BlockClaimedDomainAccountCreation"}(n||(n={}))},1086:(e,t,i)=>{"use strict";i.d(t,{B:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.publicKey=this.getResponseProperty("PublicKey"),this.requestDeviceType=this.getResponseProperty("RequestDeviceType"),this.requestDeviceTypeValue=this.getResponseProperty("RequestDeviceTypeValue"),this.requestDeviceIdentifier=this.getResponseProperty("RequestDeviceIdentifier"),this.requestIpAddress=this.getResponseProperty("RequestIpAddress"),this.requestCountryName=this.getResponseProperty("RequestCountryName"),this.key=this.getResponseProperty("Key"),this.masterPasswordHash=this.getResponseProperty("MasterPasswordHash"),this.creationDate=this.getResponseProperty("CreationDate"),this.requestApproved=this.getResponseProperty("RequestApproved"),this.responseDate=this.getResponseProperty("ResponseDate"),this.deviceId=this.getResponseProperty("RequestDeviceId");const t=new Date(this.creationDate),i=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds()),n=new Date(Date.now()),r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds());this.isExpired=r-i>=9e5,this.isAnswered=null!=this.requestApproved&&null!=this.responseDate}}},1094:(e,t,i)=>{"use strict";i.d(t,{z:()=>n.z,h:()=>u});var n=i(440),r=(i(84488),i(90097)),s=i(25065),o=i(27760),a=i(33812),l=i(91326),c=i(77468);function d(e,t){if(1&e&&(a.j41(0,"bit-banner",0),a.EFF(1),a.k0s()),2&e){a.XpG();const e=a.r8f(0);a.Y8G("showClose",!1),a.R7$(),a.SpI(" ",e.message," ")}}class u{constructor(e){this.organizationWarningsService=e}ngOnInit(){this.warning$=this.organizationWarningsService.getResellerRenewalWarning$(this.organization)}}u.ɵfac=function(e){return new(e||u)(a.rXU(o.S))},u.ɵcmp=a.VBU({type:u,selectors:[["app-organization-reseller-renewal-warning"]],inputs:{organization:"organization"},decls:3,vars:4,consts:[["id","reseller-warning-banner","icon","bwi-billing","bannerType","info",3,"showClose"]],template:function(e,t){if(1&e&&(a.SS7(0),a.nI1(1,"async"),a.nVh(2,d,2,2,"bit-banner",0)),2&e){const e=a.bH3(a.bMT(1,1,t.warning$));a.R7$(2),a.vxM(e?2:-1)}},dependencies:[r.H,l.K,s.G,c.Jj],encapsulation:2})},1221:(e,t,i)=>{"use strict";i.d(t,{f:()=>n});class n{}},1463:(e,t,i)=>{"use strict";i.d(t,{s:()=>E});var n=i(77468),r=i(60989),s=i(37831),o=i(74208),a=i(94573),l=i(6056),c=i(29400),d=i(26477),u=i(21823),h=i(89207),p=i(69672),m=i(33812);class v{constructor(){this._portal=(0,o.vPA)(void 0),this.portal=this._portal.asReadonly()}open(e){this._portal.set(e)}close(e){e===this.portal()&&this._portal.set(void 0)}}v.ɵfac=function(e){return new(e||v)},v.ɵdir=m.FsC({type:v,selectors:[["","bitDrawerHost",""]]});var f=i(59032),g=i(25740);const y=["main"],b=["skipLink"],w=[[["bit-side-nav"],["","slot","side-nav"]],"*"],S=()=>[],I=e=>({open:e}),k=e=>[e];function C(e,t){if(1&e){const e=m.RV6();m.j41(0,"div",12),m.bIt("click",function(){o.eBV(e);const t=m.XpG(2);return o.Njj(t.sideNavService.toggle())}),m.k0s()}}function T(e,t){if(1&e&&(m.j41(0,"div",8),m.nVh(1,C,1,0,"div",11),m.k0s()),2&e){const e=t;m.Y8G("ngClass",m.eq3(2,k,e.open?"tw-bg-opacity-30 md:tw-bg-opacity-0":"tw-bg-opacity-0")),m.R7$(),m.vxM(e.open?1:-1)}}function F(e,t){}class R{constructor(){this.sideNavService=(0,o.WQX)(u.G),this.drawerPortal=(0,o.WQX)(c.d).portal,this.mainContent=a.ebz.required("main"),this.skipLink=a.ebz.required("skipLink")}focusMainContent(){this.mainContent().nativeElement.focus()}handleKeydown(e){P()&&(e.preventDefault(),this.skipLink().nativeElement.focus())}}R.ɵfac=function(e){return new(e||R)},R.ɵcmp=m.VBU({type:R,selectors:[["bit-layout"]],viewQuery:function(e,t){1&e&&(m.wEZ(t.mainContent,y,5),m.wEZ(t.skipLink,b,5)),2&e&&m.NyB(2)},hostAttrs:[1,"tw-block","tw-h-screen"],hostBindings:function(e,t){1&e&&m.bIt("keydown.tab",function(e){return t.handleKeydown(e)},m.EBC)},features:[m.nM4([v])],ngContentSelectors:["bit-side-nav, [slot=side-nav]","*"],decls:16,vars:13,consts:[["skipLink",""],["main",""],[1,"tw-flex","tw-size-full"],["cdkTrapFocus","",1,"tw-flex","tw-size-full"],[1,"tw-fixed","tw-z-50","tw-w-full","tw-flex","tw-justify-center","tw-opacity-0","focus-within:tw-opacity-100","tw-pointer-events-none","focus-within:tw-pointer-events-auto"],[1,"tw-bg-background-alt3","tw-rounded-md","tw-rounded-t-none","tw-py-2","tw-text-alt2"],["bitLink","","linkType","light",1,"tw-mx-6","focus-visible:before:!tw-ring-0",3,"click","fragment","routerLink"],["tabindex","-1","bitScrollLayoutHost","",1,"tw-overflow-auto","tw-max-h-full","tw-min-w-0","tw-flex-1","tw-bg-background","tw-p-8","tw-pt-6","tw-@container",3,"id"],[1,"tw-pointer-events-none","tw-fixed","tw-inset-0","tw-z-10","tw-bg-black","tw-bg-opacity-0","motion-safe:tw-transition-colors","md:tw-hidden",3,"ngClass"],[1,"tw-absolute","tw-z-50","tw-left-0","md:tw-sticky","tw-top-0","tw-h-full","md:tw-w-auto"],[3,"cdkPortalOutlet"],[1,"tw-pointer-events-auto","tw-size-full"],[1,"tw-pointer-events-auto","tw-size-full",3,"click"]],template:function(e,t){if(1&e){const e=m.RV6();m.NAR(w),m.j41(0,"div",2)(1,"div",3)(2,"div",4)(3,"nav",5)(4,"a",6,0),m.bIt("click",function(){return o.eBV(e),o.Njj(t.focusMainContent())}),m.EFF(6),m.nI1(7,"i18n"),m.k0s()()(),m.SdG(8),m.j41(9,"main",7,1),m.SdG(11,1),m.k0s(),m.nVh(12,T,2,4,"div",8),m.nI1(13,"async"),m.k0s(),m.j41(14,"div",9),m.DNE(15,F,0,0,"ng-template",10),m.k0s()()}if(2&e){let e;const i="main-content";m.R7$(4),m.Y8G("fragment",i)("routerLink",m.lJ4(10,S)),m.R7$(2),m.JRh(m.bMT(7,6,"skipToContent")),m.R7$(3),m.Y8G("id",i),m.R7$(3),m.vxM((e=m.eq3(11,I,m.bMT(13,8,t.sideNavService.open$)))?12:-1,e),m.R7$(3),m.Y8G("cdkPortalOutlet",t.drawerPortal())}},dependencies:[n.MD,n.YU,h.G,d.V,f.L,l.iI,l.Wk,s.jc,s.I3,r.Pd,r.kB,p.TT,n.Jj,g.$],encapsulation:2});const P=()=>[document.documentElement,document.body,null].includes(document.activeElement);var x=i(87916);const $=[[["app-side-nav"],["","slot","side-nav"]],"*"];class E{constructor(){}}E.ɵfac=function(e){return new(e||E)},E.ɵcmp=m.VBU({type:E,selectors:[["app-layout"]],ngContentSelectors:["app-side-nav, [slot=side-nav]","*"],decls:3,vars:0,template:function(e,t){1&e&&(m.NAR($),m.j41(0,"bit-layout"),m.SdG(1,0,["slot","side-nav"]),m.SdG(2,1),m.k0s())},dependencies:[n.MD,R,x.V],encapsulation:2})},1576:(e,t,i)=>{"use strict";i.d(t,{m:()=>E});var n=i(77468),r=i(94573),s=i(6056),o=i(36801),a=i(22191),l=i(26477),c=i(90647),d=i(88547),u=i(74208),h=i(33812),p=i(59032),m=i(36288),v=i(13496),f=i(53997),g=i(78952);function y(e,t){if(1&e&&(h.j41(0,"a",1),h.eu8(1,4),h.k0s()),2&e){const e=h.XpG().$implicit;h.Y8G("routerLink",t)("queryParams",e.queryParams())("queryParamsHandling",e.queryParamsHandling()),h.R7$(),h.Y8G("ngTemplateOutlet",e.content())}}function b(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",5),h.bIt("click",function(t){u.eBV(e);const i=h.XpG().$implicit;return u.Njj(i.onClick(t))}),h.eu8(1,4),h.k0s()}if(2&e){const e=h.XpG().$implicit;h.R7$(),h.Y8G("ngTemplateOutlet",e.content())}}function w(e,t){1&e&&h.nrm(0,"i",3)}function S(e,t){if(1&e&&(h.nVh(0,y,2,4,"a",1)(1,b,2,1,"button",2),h.nVh(2,w,1,0,"i",3)),2&e){let e;const i=t.$implicit,n=t.$index,r=t.$count;h.vxM((e=i.route())?0:1,e),h.R7$(2),h.vxM(n!==r-1?2:-1)}}function I(e,t){1&e&&h.nrm(0,"i",3)}function k(e,t){if(1&e&&(h.j41(0,"a",7),h.eu8(1,4),h.k0s()),2&e){const e=h.XpG().$implicit;h.Y8G("routerLink",t)("queryParams",e.queryParams())("queryParamsHandling",e.queryParamsHandling()),h.R7$(),h.Y8G("ngTemplateOutlet",e.content())}}function C(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",9),h.bIt("click",function(t){u.eBV(e);const i=h.XpG().$implicit;return u.Njj(i.onClick(t))}),h.eu8(1,4),h.k0s()}if(2&e){const e=h.XpG().$implicit;h.R7$(),h.Y8G("ngTemplateOutlet",e.content())}}function T(e,t){if(1&e&&h.nVh(0,k,2,4,"a",7)(1,C,2,1,"button",8),2&e){let e;const i=t.$implicit;h.vxM((e=i.route())?0:1,e)}}function F(e,t){if(1&e&&(h.j41(0,"a",1),h.eu8(1,4),h.k0s()),2&e){const e=h.XpG().$implicit;h.Y8G("routerLink",t)("queryParams",e.queryParams())("queryParamsHandling",e.queryParamsHandling()),h.R7$(),h.Y8G("ngTemplateOutlet",e.content())}}function R(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",5),h.bIt("click",function(t){u.eBV(e);const i=h.XpG().$implicit;return u.Njj(i.onClick(t))}),h.eu8(1,4),h.k0s()}if(2&e){const e=h.XpG().$implicit;h.R7$(),h.Y8G("ngTemplateOutlet",e.content())}}function P(e,t){1&e&&h.nrm(0,"i",3)}function x(e,t){if(1&e&&(h.nVh(0,F,2,4,"a",1)(1,R,2,1,"button",2),h.nVh(2,P,1,0,"i",3)),2&e){let e;const i=t.$implicit,n=t.$index,r=t.$count;h.vxM((e=i.route())?0:1,e),h.R7$(2),h.vxM(n!==r-1?2:-1)}}function $(e,t){if(1&e&&(h.nVh(0,I,1,0,"i",3),h.nrm(1,"button",6),h.nI1(2,"i18n"),h.j41(3,"bit-menu",null,0),h.Z7z(5,T,2,1,null,null,h.fX1),h.k0s(),h.nrm(7,"i",3),h.Z7z(8,x,3,2,null,null,h.fX1)),2&e){const e=h.sdS(4),t=h.XpG();h.vxM(t.beforeOverflow.length>0?0:-1),h.R7$(),h.Y8G("bitMenuTriggerFor",e)("label",h.bMT(2,3,"moreBreadcrumbs")),h.R7$(4),h.Dyx(t.overflow),h.R7$(3),h.Dyx(t.afterOverflow)}}class E{constructor(){this.show=(0,r.hFB)(3),this.breadcrumbs=[]}set breadcrumbList(e){this.breadcrumbs=e.toArray()}get beforeOverflow(){return this.hasOverflow?this.breadcrumbs.slice(0,this.show()-1):this.breadcrumbs}get overflow(){return this.breadcrumbs.slice(this.show()-1,-1)}get afterOverflow(){return this.breadcrumbs.slice(-1)}get hasOverflow(){return this.breadcrumbs.length>this.show()}}E.ɵfac=function(e){return new(e||E)},E.ɵcmp=h.VBU({type:E,selectors:[["bit-breadcrumbs"]],contentQueries:function(e,t,i){if(1&e&&h.wni(i,d.D,4),2&e){let e;h.mGM(e=h.lsd())&&(t.breadcrumbList=e)}},inputs:{show:[1,"show"]},decls:3,vars:1,consts:[["overflowMenu",""],["bitLink","","linkType","primary",1,"tw-my-2","tw-inline-block",3,"routerLink","queryParams","queryParamsHandling"],["type","button","bitLink","","linkType","primary",1,"tw-my-2","tw-inline-block"],[1,"bwi","bwi-angle-right","tw-mx-1.5","tw-text-main"],[3,"ngTemplateOutlet"],["type","button","bitLink","","linkType","primary",1,"tw-my-2","tw-inline-block",3,"click"],["type","button","bitIconButton","bwi-ellipsis-h","size","small",3,"bitMenuTriggerFor","label"],["bitMenuItem","","linkType","primary",3,"routerLink","queryParams","queryParamsHandling"],["type","button","bitMenuItem","","linkType","primary"],["type","button","bitMenuItem","","linkType","primary",3,"click"]],template:function(e,t){1&e&&(h.Z7z(0,S,3,2,null,null,h.fX1),h.nVh(2,$,10,5)),2&e&&(h.Dyx(t.beforeOverflow),h.R7$(2),h.vxM(t.hasOverflow?2:-1))},dependencies:[n.MD,n.T3,l.V,p.L,p.o,s.iI,s.Wk,a.Q,m.s,c.M,v.Z,f.O,g.S,o.$Z],encapsulation:2})},1580:(e,t,i)=>{"use strict";i.d(t,{f:()=>n});const n={generatePasswordClearClipboardTimeout:"generatePasswordClearClipboardTimeout",systemClearClipboardTimeout:"systemClearClipboardTimeout",loginStrategySessionTimeout:"loginStrategySessionTimeout",notificationsReconnectTimeout:"notificationsReconnectTimeout",fido2ClientAbortTimeout:"fido2ClientAbortTimeout",scheduleNextSyncInterval:"scheduleNextSyncInterval",eventUploadsInterval:"eventUploadsInterval",vaultTimeoutCheckInterval:"vaultTimeoutCheckInterval",clearPopupViewCache:"clearPopupViewCache",phishingDomainUpdate:"phishingDomainUpdate"}},1601:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});class n{}},1758:(e,t,i)=>{"use strict";i.d(t,{u:()=>a});var n=i(78781),r=i(43890),s=i(58389),o=i(48550);class a{constructor(e){this.id=null,this.accessId=null,this.name=null,this.notes=null,this.type=null,this.text=new o.t,this.file=new s.Q,this.maxAccessCount=null,this.accessCount=0,this.revisionDate=null,this.deletionDate=null,this.expirationDate=null,this.password=null,this.emails=[],this.disabled=!1,this.hideEmail=!1,e&&(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.revisionDate=e.revisionDate,this.deletionDate=e.deletionDate,this.expirationDate=e.expirationDate,this.disabled=e.disabled,this.password=e.password,this.hideEmail=e.hideEmail)}get urlB64Key(){return n.A.fromBufferToUrlB64(this.key)}get maxAccessCountReached(){return null!=this.maxAccessCount&&this.accessCount>=this.maxAccessCount}get expired(){return null!=this.expirationDate&&this.expirationDate<=new Date}get pendingDelete(){return this.deletionDate<=new Date}toJSON(){return n.A.merge(Object.assign({},this),{key:n.A.fromBufferToB64(this.key)})}static fromJSON(e){return null==e?null:Object.assign(new a,e,{key:n.A.fromB64ToArray(e.key),cryptoKey:r.e.fromJSON(e.cryptoKey),text:o.t.fromJSON(e.text),file:s.Q.fromJSON(e.file),revisionDate:null==e.revisionDate?null:new Date(e.revisionDate),deletionDate:null==e.deletionDate?null:new Date(e.deletionDate),expirationDate:null==e.expirationDate?null:new Date(e.expirationDate)})}}},2073:(e,t,i)=>{"use strict";i.d(t,{A5:()=>c,G$:()=>d,Hq:()=>b,Kk:()=>I,Pn:()=>v,U1:()=>p,Ug:()=>w,Vc:()=>h,Xk:()=>m,aZ:()=>n.aZ,dZ:()=>u,de:()=>g,e$:()=>l,eL:()=>f,jf:()=>r,ml:()=>a,mq:()=>y,oq:()=>S,qQ:()=>s,ye:()=>o});var n=i(36801);const r=new n.aZ("WINDOW"),s=new n.aZ("DOCUMENT"),o=new n.aZ("OBSERVABLE_MEMORY_STORAGE"),a=new n.aZ("OBSERVABLE_DISK_STORAGE"),l=new n.aZ("OBSERVABLE_DISK_LOCAL_STORAGE"),c=new n.aZ("MEMORY_STORAGE"),d=new n.aZ("SECURE_STORAGE"),u=new n.aZ("LOGOUT_CALLBACK"),h=new n.aZ("SUPPORTS_SECURE_STORAGE"),p=new n.aZ("LOCALES_DIRECTORY"),m=new n.aZ("SYSTEM_LANGUAGE"),v=new n.aZ("LOG_MAC_FAILURES"),f=new n.aZ("SYSTEM_THEME_OBSERVABLE"),g=new n.aZ("DEFAULT_VAULT_TIMEOUT"),y=new n.aZ("INTRAPROCESS_MESSAGING_SUBJECT"),b=new n.aZ("CLIENT_TYPE"),w=new n.aZ("REFRESH_ACCESS_TOKEN_ERROR_CALLBACK"),S=new n.aZ("ENV_ADDITIONAL_REGIONS"),I=new n.aZ("HTTP_OPERATIONS")},2096:(e,t,i)=>{"use strict";i.d(t,{n:()=>r});var n=i(33812);class r{transform(e,t,i){return`${e} ${1===e?t:i}`}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"pluralize",type:r,pure:!0})},2195:(e,t,i)=>{"use strict";i.d(t,{RZ:()=>R,GW:()=>Ce,_K:()=>T,jN:()=>Fe});var n=i(51757),r=i(66046),s=i(72245),o=i(3204),a=i(14803),l=i(36359),c=i(69194),d=i(44500),u=i(27442),h=i(93695),p=i(33338),m=i(14928),v=i(28202),f=i(67553),g=i(3633),y=i(15639),b=i(78781);var w=i(81525),S=i(8433),I=i(16452),k=i(25065),C=i(81667);var T,F,R,P=i(43184),x=i(45980),$=i(97434),E=i(33812),A=i(74208),D=i(94573),O=i(21274),M=i(69855),U=i(50700),G=i(35500),j=i(1601),N=i(77468),V=i(49519),B=i(3892),z=i(26657),L=i(45154),K=i(56898),q=i(44432),_=i(68016),X=i(86226),Y=i(93199),H=i(97553),W=i(43759),J=i(36288),Z=i(33886),Q=i(68923),ee=i(88516),te=i(49608),ie=i(88016),ne=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function re(e,t){if(1&e&&(E.j41(0,"span",12),E.EFF(1),E.k0s()),2&e){const e=E.XpG(2);E.R7$(),E.JRh(e.collection.name)}}function se(e,t){if(1&e&&(E.qex(0),E.EFF(1),E.nI1(2,"i18n"),E.DNE(3,re,2,1,"span",11),E.bVm()),2&e){const e=E.XpG();E.R7$(),E.SpI(" ",E.bMT(2,2,"editCollection")," "),E.R7$(2),E.Y8G("ngIf",!e.loading)}}function oe(e,t){1&e&&(E.qex(0),E.EFF(1),E.nI1(2,"i18n"),E.bVm()),2&e&&(E.R7$(),E.SpI(" ",E.bMT(2,1,"newCollection")," "))}function ae(e,t){1&e&&(E.qex(0,null,0),E.nrm(2,"i",13),E.bVm())}function le(e,t){if(1&e&&E.nrm(0,"bit-option",27),2&e){const e=t.$implicit;E.Y8G("value",e.id)("label",e.name)}}function ce(e,t){if(1&e&&(E.j41(0,"bit-form-field")(1,"bit-label"),E.EFF(2),E.nI1(3,"i18n"),E.k0s(),E.j41(4,"bit-select",25),E.DNE(5,le,1,2,"bit-option",26),E.nI1(6,"async"),E.k0s()()),2&e){const e=E.XpG(2);E.R7$(2),E.JRh(E.bMT(3,2,"organization")),E.R7$(3),E.Y8G("ngForOf",E.bMT(6,4,e.organizations$))}}function de(e,t){1&e&&(E.j41(0,"bit-form-field")(1,"bit-label"),E.EFF(2),E.nI1(3,"i18n"),E.k0s(),E.nrm(4,"input",28),E.j41(5,"bit-hint"),E.EFF(6),E.nI1(7,"i18n"),E.k0s()()),2&e&&(E.R7$(2),E.JRh(E.bMT(3,2,"externalId")),E.R7$(4),E.JRh(E.bMT(7,4,"externalIdDesc")))}function ue(e,t){if(1&e&&(E.nrm(0,"bit-option",29),E.nI1(1,"i18n")),2&e){const e=E.XpG(2);E.Y8G("label",E.ai1("",e.deletedParentName," (",E.bMT(1,4,"deleted"),")"))("value",e.deletedParentName)}}function he(e,t){if(1&e&&E.nrm(0,"bit-option",30),2&e){const e=t.$implicit;E.Y8G("value",e.name)("label",e.name)}}function pe(e,t){1&e&&(E.qex(0),E.j41(1,"span"),E.EFF(2),E.nI1(3,"i18n"),E.k0s(),E.bVm()),2&e&&(E.R7$(2),E.JRh(E.bMT(3,1,"readOnlyCollectionAccess")))}function me(e,t){1&e&&(E.j41(0,"bit-callout",32),E.nI1(1,"i18n"),E.EFF(2),E.nI1(3,"i18n"),E.k0s()),2&e&&(E.Y8G("title",E.mNQ(E.bMT(1,3,"grantManageCollectionWarningTitle"))),E.R7$(2),E.SpI(" ",E.bMT(3,5,"grantManageCollectionWarning")," "))}function ve(e,t){1&e&&(E.j41(0,"span"),E.EFF(1),E.nI1(2,"i18n"),E.k0s()),2&e&&(E.R7$(),E.JRh(E.bMT(2,1,"grantCollectionAccess")))}function fe(e,t){1&e&&(E.j41(0,"span"),E.EFF(1),E.nI1(2,"i18n"),E.k0s()),2&e&&(E.R7$(),E.JRh(E.bMT(2,1,"grantCollectionAccessMembersOnly")))}function ge(e,t){1&e&&(E.j41(0,"span"),E.EFF(1),E.nI1(2,"i18n"),E.k0s()),2&e&&(E.R7$(),E.SpI(" "," "+E.bMT(2,1,"adminCollectionAccess")," "))}function ye(e,t){if(1&e&&(E.qex(0),E.DNE(1,me,4,7,"bit-callout",31)(2,ve,3,3,"span",4)(3,fe,3,3,"span",4)(4,ge,3,3,"span",4),E.bVm()),2&e){const e=E.XpG(2);E.R7$(),E.Y8G("ngIf",e.showAddAccessWarning),E.R7$(),E.Y8G("ngIf",e.organization.useGroups),E.R7$(),E.Y8G("ngIf",!e.organization.useGroups),E.R7$(),E.Y8G("ngIf",e.organization.allowAdminAccessToAllCollectionItems)}}function be(e,t){1&e&&(E.j41(0,"div",33),E.nrm(1,"i",34),E.EFF(2),E.nI1(3,"i18n"),E.k0s()),2&e&&(E.R7$(2),E.SpI(" ",E.bMT(3,1,"managePermissionRequired")," "))}function we(e,t){if(1&e&&(E.nrm(0,"bit-access-selector",35),E.nI1(1,"i18n"),E.nI1(2,"i18n"),E.nI1(3,"i18n"),E.nI1(4,"i18n")),2&e){const e=E.XpG(2);E.Y8G("permissionMode",e.dialogReadonly?e.PermissionMode.Readonly:e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",E.bMT(1,7,"groupSlashMemberColumnHeader"))("selectorLabelText",E.bMT(2,9,"selectGroupsAndMembers"))("selectorHelpText",E.bMT(3,11,"userPermissionOverrideHelperDesc"))("emptySelectionText",E.bMT(4,13,"noMembersOrGroupsAdded"))("initialPermission",e.initialPermission)}}function Se(e,t){if(1&e&&(E.nrm(0,"bit-access-selector",36),E.nI1(1,"i18n"),E.nI1(2,"i18n"),E.nI1(3,"i18n")),2&e){const e=E.XpG(2);E.Y8G("permissionMode",e.dialogReadonly?e.PermissionMode.Readonly:e.PermissionMode.Edit)("items",e.accessItems)("columnHeader",E.bMT(1,5,"memberColumnHeader"))("selectorLabelText",E.bMT(2,7,"selectMembers"))("emptySelectionText",E.bMT(3,9,"noMembersAdded"))}}function Ie(e,t){if(1&e){const e=E.RV6();E.j41(0,"bit-tab-group",14),E.mxI("selectedIndexChange",function(t){A.eBV(e);const i=E.XpG();return E.DH7(i.tabIndex,t)||(i.tabIndex=t),A.Njj(t)}),E.j41(1,"bit-tab",15),E.nI1(2,"i18n"),E.j41(3,"bit-form-field")(4,"bit-label"),E.EFF(5),E.nI1(6,"i18n"),E.k0s(),E.nrm(7,"input",16),E.k0s(),E.DNE(8,ce,7,6,"bit-form-field",4)(9,de,8,6,"bit-form-field",4),E.j41(10,"bit-form-field")(11,"bit-label"),E.EFF(12),E.nI1(13,"i18n"),E.k0s(),E.j41(14,"bit-select",17),E.nrm(15,"bit-option",18),E.nI1(16,"i18n"),E.DNE(17,ue,2,6,"bit-option",19)(18,he,1,2,"bit-option",20),E.k0s()()(),E.j41(19,"bit-tab",15),E.nI1(20,"i18n"),E.j41(21,"div",21),E.DNE(22,pe,4,3,"ng-container",4)(23,ye,5,4,"ng-container",4),E.k0s(),E.DNE(24,be,4,3,"div",22)(25,we,5,15,"bit-access-selector",23)(26,Se,4,11,"bit-access-selector",24),E.k0s()()}if(2&e){const e=E.XpG();E.R50("selectedIndex",e.tabIndex),E.R7$(),E.Y8G("label",E.mNQ(E.bMT(2,18,"collectionInfo"))),E.R7$(4),E.JRh(E.bMT(6,20,"name")),E.R7$(3),E.Y8G("ngIf",e.showOrgSelector),E.R7$(),E.Y8G("ngIf",e.isExternalIdVisible),E.R7$(3),E.JRh(E.bMT(13,22,"nestCollectionUnder")),E.R7$(3),E.Y8G("value",void 0)("label",E.bMT(16,24,"noCollection")),E.R7$(2),E.Y8G("ngIf",e.deletedParentName),E.R7$(),E.Y8G("ngForOf",e.nestOptions),E.R7$(),E.Y8G("label",E.mNQ(E.bMT(20,26,"access"))),E.R7$(3),E.Y8G("ngIf",e.dialogReadonly),E.R7$(),E.Y8G("ngIf",!e.dialogReadonly),E.R7$(),E.Y8G("ngIf",e.formGroup.controls.access.hasError("managePermissionRequired")&&!e.showAddAccessWarning),E.R7$(),E.Y8G("ngIf",e.organization.useGroups),E.R7$(),E.Y8G("ngIf",!e.organization.useGroups)}}function ke(e,t){if(1&e&&(E.nrm(0,"button",37),E.nI1(1,"i18n")),2&e){const e=E.XpG();E.Y8G("label",E.bMT(1,3,"delete"))("bitAction",e.delete)("disabled",e.loading)}}!function(e){e[e.Info=0]="Info",e[e.Access=1]="Access"}(T||(T={})),function(e){e.Upgrade="upgrade",e.Save="save"}(F||(F={})),function(e){e.Saved="saved",e.Canceled="canceled",e.Deleted="deleted",e.Upgrade="upgrade"}(R||(R={}));class Ce{constructor(e,t,i,o,a,l,c,d,u,h,p,m,f,y){var b,w,S;this.params=e,this.formBuilder=t,this.dialogRef=i,this.organizationService=o,this.groupService=a,this.collectionAdminService=l,this.i18nService=c,this.organizationUserApiService=d,this.dialogService=u,this.changeDetectorRef=h,this.accountService=p,this.toastService=m,this.collectionService=f,this.configService=y,this.destroy$=new r.B,this.loading=!0,this.nestOptions=[],this.accessItems=[],this.showOrgSelector=!1,this.formGroup=this.formBuilder.group({name:["",[n.k0.required,(S=["/"],e=>{if(!(e instanceof n.MJ))throw new Error("forbiddenCharacters only supports validating FormControls");if(null===e.value||void 0===e.value)return null;const t=String(e.value);for(const i of t)if(S.includes(i))return{forbiddenCharacters:{value:e.value,characters:S}};return null})]],externalId:{value:"",disabled:!0},parent:void 0,access:[[]],selectedOrg:""}),this.PermissionMode=P.Z,this.showDeleteButton=!1,this.showAddAccessWarning=!1,this.buttonDisplayName=F.Save,this.submit=()=>ne(this,void 0,void 0,function*(){var e,t;if(this.dialogReadonly)return;if(this.formGroup.markAllAsTouched(),this.buttonDisplayName==F.Upgrade)return this.close(R.Upgrade),void this.changePlan(this.orgExceedingCollectionLimit);if(this.formGroup.invalid){const e=this.formGroup.controls.access.hasError("managePermissionRequired");return void(this.tabIndex!==T.Access||e?this.tabIndex===T.Info&&e&&this.toastService.showToast({variant:"error",message:this.i18nService.t("fieldOnTabRequiresAttention",this.i18nService.t("access"))}):this.toastService.showToast({variant:"error",message:this.i18nService.t("fieldOnTabRequiresAttention",this.i18nService.t("collectionInfo"))}))}if(this.editMode&&!(null===(e=this.collection)||void 0===e?void 0:e.canEditName(this.organization))&&this.formGroup.controls.name.dirty)throw new Error("Cannot change readonly field: Name");const i=null===(t=this.formGroup.controls.parent)||void 0===t?void 0:t.value,n=Object.assign(new v.nb({id:"",organizationId:"",name:""}),this.collection);n.name=i?`${i}/${this.formGroup.controls.name.value}`:this.formGroup.controls.name.value,n.id=this.params.collectionId,n.organizationId=this.formGroup.controls.selectedOrg.value,n.externalId=this.formGroup.controls.externalId.value,n.groups=this.formGroup.controls.access.value.filter(e=>e.type===x.Uv.Group).map(x.yo),n.users=this.formGroup.controls.access.value.filter(e=>e.type===x.Uv.Member).map(x.yo);const r=yield(0,s._)(this.accountService.activeAccount$.pipe(g.F6)),o=this.editMode?yield this.collectionAdminService.update(n,r):yield this.collectionAdminService.create(n,r);this.toastService.showToast({variant:"success",message:this.i18nService.t(this.editMode?"editedCollectionId":"createdCollectionId",n.name)}),this.close(R.Saved,o)}),this.delete=()=>ne(this,void 0,void 0,function*(){var e,t;if(this.dialogReadonly)return;if(!(yield this.dialogService.openSimpleDialog({title:null===(e=this.collection)||void 0===e?void 0:e.name,content:{key:"deleteCollectionConfirmation"},type:"warning"}))&&this.params.collectionId)return!1;yield this.collectionAdminService.delete(this.params.organizationId,this.params.collectionId),this.toastService.showToast({variant:"success",message:this.i18nService.t("deletedCollectionId",null===(t=this.collection)||void 0===t?void 0:t.name)}),this.close(R.Deleted,this.collection)}),this.tabIndex=null!==(b=e.initialTab)&&void 0!==b?b:T.Info,this.initialPermission=null!==(w=e.initialPermission)&&void 0!==w?w:x.aF.View}ngOnInit(){return ne(this,void 0,void 0,function*(){const e=yield(0,s._)(this.accountService.activeAccount$.pipe((0,o.T)(e=>null==e?void 0:e.id)));var t,i,r;this.params.showOrgSelector?(this.showOrgSelector=!0,this.formGroup.controls.selectedOrg.valueChanges.pipe((0,a.Q)(this.destroy$)).subscribe(e=>this.loadOrg(e)),this.organizations$=this.organizationService.organizations$(e).pipe((0,m.$)(),(0,o.T)(e=>e.filter(e=>e.canCreateNewCollections&&!e.isProviderUser).sort(b.A.getSortFunction(this.i18nService,"name")))),this.formGroup.patchValue({selectedOrg:this.params.organizationId})):(this.formGroup.patchValue({selectedOrg:this.params.organizationId}),yield this.loadOrg(this.params.organizationId)),this.organizationSelected.setAsyncValidators((t=this.organizations$,i=this.collectionService.encryptedCollections$(e).pipe((0,o.T)(e=>null!=e?e:[])),r=this.i18nService,e=>{if(!(e instanceof n.MJ))return(0,h.of)(null);const s=e.value;return s?(0,p.z)([t.pipe((0,y.Hc)(s)),i]).pipe((0,o.T)(([e,t])=>{if(!e)return null;const i=t.filter(t=>t.organizationId===e.id);return e.maxCollections===i.length?{cannotCreateCollections:{message:r.t("cannotCreateCollection")}}:null})):(0,h.of)(null)})),this.formGroup.updateValueAndValidity(),this.organizationSelected.valueChanges.pipe((0,l.M)(e=>{var t;(null===(t=this.organizationSelected.errors)||void 0===t?void 0:t.cannotCreateCollections)?this.buttonDisplayName=F.Upgrade:this.buttonDisplayName=F.Save}),(0,c.p)(()=>{var e;return null===(e=this.organizationSelected.errors)||void 0===e?void 0:e.cannotCreateCollections}),(0,d.n)(e=>this.organizations$.pipe((0,y.Hc)(e))),(0,a.Q)(this.destroy$)).subscribe(e=>{this.orgExceedingCollectionLimit=e,this.organizationSelected.markAsTouched(),this.formGroup.updateValueAndValidity()})})}loadOrg(e){return ne(this,void 0,void 0,function*(){const t=yield(0,s._)((0,g.F6)(this.accountService.activeAccount$)),i=this.organizationService.organizations$(t).pipe((0,f.Sw)(e)).pipe((0,u.t)({refCount:!0,bufferSize:1})),n=i.pipe((0,d.n)(t=>t.useGroups?this.groupService.getAll(e):(0,h.of)([]))),r=this.accountService.activeAccount$.pipe(g.F6,(0,d.n)(t=>this.collectionAdminService.collectionAdminViews$(e,t)));(0,p.z)({organization:i,collections:r,groups:n,users:this.organizationUserApiService.getAllMiniUserDetails(e)}).pipe((0,a.Q)(this.formGroup.controls.selectedOrg.valueChanges),(0,a.Q)(this.destroy$)).subscribe(({organization:e,collections:t,groups:i,users:n})=>{var r,s;if(this.organization=e,this.params.collectionId&&(this.collection=t.find(e=>e.id===this.collectionId),!this.collection))throw new Error("Could not find collection to edit.");if(this.accessItems=[].concat(i.map(e=>function(e,t){return{id:e.id,type:x.Uv.Group,listName:e.name,labelName:e.name,readonly:!1,readonlyPermission:null!=t?(0,x.Jh)(t.groups.find(t=>t.id===e.id)):void 0}}(e,this.collection)),n.data.map(e=>function(e,t){var i,n;return{id:e.id,type:x.Uv.Member,email:e.email,role:e.type,listName:(null===(i=e.name)||void 0===i?void 0:i.length)>0?`${e.name} (${e.email})`:e.email,labelName:null!==(n=e.name)&&void 0!==n?n:e.email,status:e.status,readonly:!1,readonlyPermission:null!=t?(0,x.Jh)(new v.sK(t.users.find(t=>t.id===e.id))):void 0}}(e,this.collection))),this.changeDetectorRef.detectChanges(),this.nestOptions=this.params.limitNestedCollections?t.filter(e=>e.manage):t,this.collection){this.nestOptions=this.nestOptions.filter(e=>e.id!==this.collectionId);const{name:i,parent:n}=function(e){var t;const i=null===(t=e.name)||void 0===t?void 0:t.split("/"),n=i[i.length-1],r=i.length>1?i.slice(0,-1).join("/"):void 0;return{name:n,parent:r}}(this.collection);void 0!==n&&(this.organization.canViewAllCollections&&!t.find(e=>e.name===n)?this.deletedParentName=n:this.nestOptions.find(e=>e.name===n)||this.nestOptions.unshift({name:n}));const r=function(e){if(null==e)return[];return[].concat(e.groups.map(e=>({id:e.id,type:x.Uv.Group,permission:(0,x.Jh)(e)})),e.users.map(e=>({id:e.id,type:x.Uv.Member,permission:(0,x.Jh)(e)})))}(this.collection);this.formGroup.patchValue({name:i,externalId:this.collection.externalId,parent:n,access:r}),this.showDeleteButton=!this.dialogReadonly&&this.collection.canDelete(e)}else{const e=this.nestOptions.find(e=>e.id===this.params.parentCollectionId),t=null===(r=n.data.find(e=>{var t;return e.userId===(null===(t=this.organization)||void 0===t?void 0:t.userId)}))||void 0===r?void 0:r.id,i=void 0!==t?[{id:t,type:x.Uv.Member,permission:x.aF.Manage}]:[];this.formGroup.patchValue({parent:null!==(s=null==e?void 0:e.name)&&void 0!==s?s:void 0,access:i})}e.allowAdminAccessToAllCollectionItems?this.formGroup.controls.access.removeValidators(Te):this.formGroup.controls.access.addValidators(Te),this.formGroup.controls.access.updateValueAndValidity(),this.handleFormGroupReadonly(this.dialogReadonly),this.loading=!1,this.showAddAccessWarning=this.handleAddAccessWarning()})})}get organizationSelected(){return this.formGroup.controls.selectedOrg}get isExternalIdVisible(){var e;return this.params.isAdminConsoleActive&&!!(null===(e=this.formGroup.get("externalId"))||void 0===e?void 0:e.value)}get collectionId(){return this.params.collectionId}get editMode(){return null!=this.params.collectionId}get dialogReadonly(){return!0===this.params.readonly}cancel(){return ne(this,void 0,void 0,function*(){this.close(R.Canceled)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}changePlan(e){(0,I.IO)(this.dialogService,{data:{organizationId:e.id,subscription:null,productTierType:e.productTierType}})}handleAddAccessWarning(){var e;return!((null===(e=this.organization)||void 0===e?void 0:e.allowAdminAccessToAllCollectionItems)||!this.params.isAddAccessCollection)}handleFormGroupReadonly(e){if(e)return this.formGroup.controls.access.disable(),this.formGroup.controls.name.disable(),void this.formGroup.controls.parent.disable();if(this.formGroup.controls.access.enable(),!this.editMode)return this.formGroup.controls.name.enable(),void this.formGroup.controls.parent.enable();const t=this.collection.canEditName(this.organization);this.formGroup.controls.name[t?"enable":"disable"](),this.formGroup.controls.parent[t?"enable":"disable"]()}close(e,t){this.dialogRef.close({action:e,collection:t})}}function Te(e){return e.value.some(e=>e.permission===x.aF.Manage)?null:{managePermissionRequired:!0}}function Fe(e,t){return e.open(Ce,t)}Ce.ɵfac=function(e){return new(e||Ce)(E.rXU(w.Qs),E.rXU(n.ok),E.rXU(O.ce),E.rXU(f.PV),E.rXU(C.nK),E.rXU(v.vE),E.rXU(U.W),E.rXU(v.uB),E.rXU(O.o3),E.rXU(D.gRc),E.rXU(G.Di),E.rXU(M.f),E.rXU(v.YD),E.rXU(j.w))},Ce.ɵcmp=E.VBU({type:Ce,selectors:[["ng-component"]],decls:16,vars:16,consts:[["spinner",""],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"disablePadding"],["bitDialogTitle",""],[4,"ngIf"],["bitDialogContent",""],[3,"selectedIndex","selectedIndexChange",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click","disabled"],["type","button","bitIconButton","bwi-trash","buttonType","danger","class","tw-ml-auto","bitFormButton","",3,"label","bitAction","disabled",4,"ngIf"],["class","tw-text-sm tw-normal-case tw-text-muted",4,"ngIf"],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-lg","bwi-spin"],[3,"selectedIndexChange","selectedIndex"],[3,"label"],["bitInput","","appAutofocus","","formControlName","name"],["bitInput","","formControlName","parent"],[3,"value","label"],["disabled","","icon","bwi-collection-shared",3,"value","label",4,"ngIf"],["icon","bwi-collection-shared",3,"value","label",4,"ngFor","ngForOf"],[1,"tw-mb-3"],["class","tw-mb-3 tw-text-danger",4,"ngIf"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText","initialPermission",4,"ngIf"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText",4,"ngIf"],["bitInput","","formControlName","selectedOrg"],["icon","bwi-business",3,"value","label",4,"ngFor","ngForOf"],["icon","bwi-business",3,"value","label"],["bitInput","","formControlName","externalId"],["disabled","","icon","bwi-collection-shared",3,"value","label"],["icon","bwi-collection-shared",3,"value","label"],["type","warning",3,"title",4,"ngIf"],["type","warning",3,"title"],[1,"tw-mb-3","tw-text-danger"],[1,"bwi","bwi-error"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","selectorHelpText","emptySelectionText","initialPermission"],["formControlName","access",3,"permissionMode","items","columnHeader","selectorLabelText","emptySelectionText"],["type","button","bitIconButton","bwi-trash","buttonType","danger","bitFormButton","",1,"tw-ml-auto",3,"label","bitAction","disabled"]],template:function(e,t){1&e&&(E.j41(0,"form",1)(1,"bit-dialog",2)(2,"span",3),E.DNE(3,se,4,4,"ng-container",4)(4,oe,3,3,"ng-container",4),E.k0s(),E.j41(5,"div",5),E.DNE(6,ae,3,0,"ng-container",4)(7,Ie,27,28,"bit-tab-group",6),E.k0s(),E.qex(8,7),E.j41(9,"button",8),E.EFF(10),E.nI1(11,"i18n"),E.k0s(),E.j41(12,"button",9),E.bIt("click",function(){return t.cancel()}),E.EFF(13),E.nI1(14,"i18n"),E.k0s(),E.DNE(15,ke,2,5,"button",10),E.bVm(),E.k0s()()),2&e&&(E.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),E.R7$(),E.Y8G("disablePadding",!t.loading),E.R7$(2),E.Y8G("ngIf",t.editMode),E.R7$(),E.Y8G("ngIf",!t.editMode),E.R7$(2),E.Y8G("ngIf",t.loading),E.R7$(),E.Y8G("ngIf",!t.loading),E.R7$(2),E.Y8G("disabled",t.loading||t.dialogReadonly),E.R7$(),E.SpI(" ",E.bMT(11,12,t.buttonDisplayName)," "),E.R7$(2),E.Y8G("disabled",t.loading),E.R7$(),E.SpI(" ",E.bMT(14,14,"cancel")," "),E.R7$(2),E.Y8G("ngIf",t.showDeleteButton))},dependencies:[k.G,N.Sq,N.bT,n.qT,n.me,n.BC,n.cb,n.j4,n.JD,V.B,B.p,z.$,L.L,K.Q,q.G,_.m,X.j,Y.I,H.J,W.h,J.s,Z.w,Q.P,ee.W,te.j,$.m,P.t,S.p,N.Jj,ie.$],encapsulation:2})},2471:(e,t,i)=>{"use strict";i.d(t,{B:()=>n});class n{}},2738:(e,t,i)=>{"use strict";var n;i.d(t,{s:()=>n}),function(e){e.Web="web",e.Browser="browser",e.Desktop="desktop",e.Cli="cli"}(n||(n={}))},2780:(e,t,i)=>{"use strict";i.d(t,{CV:()=>y,W_:()=>m,HG:()=>C,EO:()=>P,Xt:()=>E,Z6:()=>O});var n=i(74208),r=i(23649),s=i(72245),o=i(35500),a=i(68455),l=i(84110),c=i(81441),d=i(52057),u=i(83541),h=i(83516),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const m=(e,t)=>p(void 0,void 0,void 0,function*(){const e=(0,n.WQX)(a.u),i=(0,n.WQX)(r.Ix),p=(0,n.WQX)(h.U),m=(0,n.WQX)(d.K),v=(0,n.WQX)(o.Di),f=(0,n.WQX)(u.L),g=yield e.getAuthStatus();if(g===l.J.LoggedOut)return p.send("authBlocked",{url:t.url}),!1;const y=(yield(0,s._)(v.activeAccount$)).id,b=yield(0,s._)(f.forceSetPasswordReason$(y));if(g===l.J.Locked&&b===c.n.SsoNewJitProvisionedUser&&!t.url.includes("set-initial-password"))return i.createUrlTree(["/set-initial-password"]);if(g===l.J.Locked&&b===c.n.TdeOffboardingUntrustedDevice&&!t.url.includes("set-initial-password"))return i.createUrlTree(["/set-initial-password"]);if(g===l.J.Locked&&b!==c.n.SsoNewJitProvisionedUser&&b!==c.n.TdeOffboardingUntrustedDevice)return null!=t&&p.send("lockedUrl",{url:t.url}),i.createUrlTree(["lock"],{queryParams:{promptBiometric:!0}});if((b===c.n.TdeUserWithoutPasswordHasPasswordResetPermission||b===c.n.TdeOffboarding)&&!t.url.includes("set-initial-password")){const e="/set-initial-password";return i.createUrlTree([e])}if((b===c.n.AdminForcePasswordReset||b===c.n.WeakMasterPassword)&&!t.url.includes("change-password")){const e="/change-password";return i.createUrlTree([e])}return!(b==c.n.None&&!t.url.includes("remove-password")&&(yield(0,s._)(m.convertAccountRequired$)))||i.createUrlTree(["/remove-password"])});var v=i(93241),f=i(56962),g=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function y(){return()=>g(this,void 0,void 0,function*(){const e=(0,n.WQX)(v.sg),t=(0,n.WQX)(f.K),i=(0,n.WQX)(r.Ix);return null!==(yield(0,s._)(e.currentAuthType$))||(t.error("No active login session found."),i.createUrlTree(["/login"]))})}var b=i(62166),w=i(39935),S=i(16184),I=i(22848),k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function C(){return(e,t)=>k(this,void 0,void 0,function*(){const t=(0,n.WQX)(a.u),i=(0,n.WQX)(I.Lu),c=(0,n.WQX)(w.M),u=(0,n.WQX)(r.Ix),h=(0,n.WQX)(b.i),p=(0,n.WQX)(S.ep),m=(0,n.WQX)(o.Di),v=(0,n.WQX)(d.K),f=yield(0,s._)(m.activeAccount$);if(!f)return u.createUrlTree(["/"]);if((yield(0,s._)(t.authStatusFor$(f.id)))!==l.J.Locked)return u.createUrlTree(["/"]);if(null!=(yield(0,s._)(v.requiresDomainConfirmation$(f.id))))return u.createUrlTree(["confirm-key-connector-domain"]);if(!(yield p.canLock(f.id)))return!1;const g=yield(0,s._)(c.supportsDeviceTrust$);if("login-initiated"===e.queryParams.from&&g&&(yield h.hasMasterPassword()))return!0;const y=yield(0,s._)(i.everHadUserKey$(f.id));return!(g&&!y)})}var T=i(3633),F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const R={loggedIn:"/vault",loggedOut:"/login",locked:"/lock",notDecrypted:"/login-initiated"};function P(e={}){const t=Object.assign(Object.assign({},R),e);return e=>F(this,void 0,void 0,function*(){const i=(0,n.WQX)(a.u),c=(0,n.WQX)(I.Lu),d=(0,n.WQX)(w.M),u=(0,n.WQX)(o.Di),h=(0,n.WQX)(f.K),p=(0,n.WQX)(r.Ix),m=yield i.getAuthStatus();if(m===l.J.LoggedOut)return p.createUrlTree([t.loggedOut],{queryParams:e.queryParams});if(m===l.J.Unlocked)return p.createUrlTree([t.loggedIn],{queryParams:e.queryParams});const v=yield(0,s._)(d.supportsDeviceTrust$),g=yield(0,s._)(u.activeAccount$.pipe(T.F6)),y=yield(0,s._)(c.everHadUserKey$(g));return m===l.J.Locked&&v&&!y?(h.info("Sending user to TDE decryption options. AuthStatus is %s. TDE support is %s. Ever had user key is %s.",l.J[m],v,y),p.createUrlTree([t.notDecrypted],{queryParams:e.queryParams})):m===l.J.Locked?p.createUrlTree([t.locked],{queryParams:e.queryParams}):p.createUrlTree(["/"])})}var x=i(3204),$=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function E(){return(e,t)=>$(this,void 0,void 0,function*(){const e=(0,n.WQX)(a.u),t=(0,n.WQX)(I.Lu),i=(0,n.WQX)(w.M),c=(0,n.WQX)(o.Di),d=(0,n.WQX)(f.K),u=(0,n.WQX)(r.Ix),h=yield(0,s._)(c.activeAccount$.pipe((0,x.T)(e=>null==e?void 0:e.id)));if(null==h)return u.createUrlTree(["/"]);const p=yield e.getAuthStatus(),m=yield(0,s._)(i.supportsDeviceTrust$),v=yield(0,s._)(t.everHadUserKey$(h));return p!==l.J.Locked||!m||v?u.createUrlTree(["/"]):(d.info("Sending user to TDE decryption options. AuthStatus is %s. TDE support is %s. Ever had user key is %s.",l.J[p],m,v),!0)})}var A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const D={homepage:()=>"/vault",locked:"/lock"};function O(e={}){return t=>A(this,void 0,void 0,function*(){return function(e,t){return A(this,void 0,void 0,function*(){const e=(0,n.WQX)(o.Di),i=(0,n.WQX)(a.u),c=(0,n.WQX)(r.Ix),d=(0,n.WQX)(I.Lu),u=(0,n.WQX)(w.M),h=(0,n.WQX)(f.K),p=yield(0,s._)(e.activeAccount$);if(!p)return!0;const m=yield(0,s._)(i.authStatusFor$(p.id));if(null==m||m===l.J.LoggedOut)return!0;if(m===l.J.Unlocked)return c.createUrlTree([t.homepage()]);const v=yield(0,s._)(u.supportsDeviceTrustByUserId$(p.id)),g=yield(0,s._)(d.everHadUserKey$(p.id));return m===l.J.Locked&&v&&!g?(h.info("Sending user to TDE decryption options. AuthStatus is %s. TDE support is %s. Ever had user key is %s.",l.J[m],v,g),c.createUrlTree(["/login-initiated"])):c.createUrlTree([t.locked])})}(0,Object.assign(Object.assign({},D),e))})}},2922:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});class n{}},3160:(e,t,i)=>{"use strict";i.d(t,{z:()=>n});class n{}},3633:(e,t,i)=>{"use strict";i.d(t,{F6:()=>I,bB:()=>k,xU:()=>y,xy:()=>C});var n=i(16878),r=i(33338),s=i(93695),o=i(80909),a=i(34040),l=i(69194),c=i(3204),d=i(27442),u=i(44500),h=i(22485),p=i(35500),m=i(78781),v=i(31857),f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const g=v.Zs.record(v.ie,"accounts",{deserializer:e=>e}),y=new v.Zs(v.ie,"activeAccountId",{deserializer:e=>e}),b=v.Zs.record(v.ie,"activity",{deserializer:e=>new Date(e)}),w=new v.Ok(v.ie,"verifyNewDeviceLogin",{deserializer:e=>e,clearOn:["logout"]}),S={email:"",emailVerified:!1,name:void 0,creationDate:void 0},I=(0,c.T)(e=>{if(null==e)throw new Error("Null or undefined account");return e.id}),k=(0,c.T)(e=>{var t;return null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null});class C{constructor(e,t,i,s){this.messagingService=e,this.logService=t,this.globalStateProvider=i,this.singleUserStateProvider=s,this._showHeader$=new n.t(!0),this.showHeader$=this._showHeader$.asObservable(),this.accountsState=this.globalStateProvider.get(g),this.activeAccountIdState=this.globalStateProvider.get(y),this.accounts$=this.accountsState.state$.pipe((0,c.T)(e=>null==e?{}:e)),this.activeAccount$=this.activeAccountIdState.state$.pipe((0,o.v)(this.accounts$),(0,c.T)(([e,t])=>e?Object.assign({id:e},t[e]):null),(0,a.F)((e,t)=>(null==e?void 0:e.id)===(null==t?void 0:t.id)&&(0,p.Wm)(e,t)),(0,d.t)({bufferSize:1,refCount:!1})),this.accountActivity$=this.globalStateProvider.get(b).state$.pipe((0,c.T)(e=>null!=e?e:{})),this.sortedUserIds$=this.accountActivity$.pipe((0,c.T)(e=>Object.entries(e).map(([e,t])=>({userId:e,lastActive:t})).sort((e,t)=>t.lastActive.getTime()-e.lastActive.getTime()).map(e=>e.userId))),this.nextUpAccount$=(0,r.z)([this.accounts$,this.activeAccount$,this.sortedUserIds$]).pipe((0,c.T)(([e,t,i])=>{const n=i.find(i=>i!==(null==t?void 0:t.id)&&null!=e[i]);return n?Object.assign({id:n},e[n]):null})),this.accountVerifyNewDeviceLogin$=this.activeAccountIdState.state$.pipe((0,u.n)(e=>this.singleUserStateProvider.get(e,w).state$))}addAccount(e,t){return f(this,void 0,void 0,function*(){if(!m.A.isGuid(e))throw new Error("userId is required");yield this.accountsState.update(i=>(i||(i={}),i[e]=t,i)),yield this.setAccountActivity(e,new Date)})}setAccountName(e,t){return f(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{name:t})})}setAccountEmail(e,t){return f(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{email:t})})}setAccountEmailVerified(e,t){return f(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{emailVerified:t})})}setAccountCreationDate(e,t){return f(this,void 0,void 0,function*(){yield this.setAccountInfo(e,{creationDate:t})})}clean(e){return f(this,void 0,void 0,function*(){yield this.setAccountInfo(e,S),yield this.removeAccountActivity(e)})}switchAccount(e){return f(this,void 0,void 0,function*(){let t=!1;yield this.activeAccountIdState.update((i,n)=>(t=!0,e),{combineLatestWith:this.accountsState.state$.pipe((0,l.p)(t=>null==e||null!=(null==t?void 0:t[e])),(0,h.w)({first:1e3,with:()=>(0,s.of)({})})),shouldUpdate:(t,i)=>{if(null!=e&&null==(null==i?void 0:i[e]))throw new Error("Account does not exist");return t!==e}}),t&&(yield this.setAccountActivity(e,new Date))})}setAccountActivity(e,t){return f(this,void 0,void 0,function*(){m.A.isGuid(e)&&(yield this.globalStateProvider.get(b).update(i=>(i||(i={}),i[e]=t,i),{shouldUpdate:i=>{var n;return(null===(n=null==i?void 0:i[e])||void 0===n?void 0:n.getTime())!==(null==t?void 0:t.getTime())}}))})}setAccountVerifyNewDeviceLogin(e,t){return f(this,void 0,void 0,function*(){m.A.isGuid(e)&&(yield this.singleUserStateProvider.get(e,w).update(()=>t,{shouldUpdate:e=>e!==t}))})}removeAccountActivity(e){return f(this,void 0,void 0,function*(){yield this.globalStateProvider.get(b).update(t=>(null==t||delete t[e],t),{shouldUpdate:t=>null!=(null==t?void 0:t[e])})})}delete(){return f(this,void 0,void 0,function*(){var e;try{null===(e=this.messagingService)||void 0===e||e.send("logout")}catch(t){throw this.logService.error(t),t}})}setShowHeader(e){return f(this,void 0,void 0,function*(){this._showHeader$.next(e)})}setAccountInfo(e,t){return f(this,void 0,void 0,function*(){function i(e){return Object.assign(Object.assign({},e),t)}yield this.accountsState.update(t=>(t[e]=i(t[e]),t),{shouldUpdate:t=>{if(null==(null==t?void 0:t[e]))throw new Error("Account does not exist");return!(0,p.Wm)(t[e],i(t[e]))}})})}}},3892:(e,t,i)=>{"use strict";i.d(t,{p:()=>v});var n=i(94573),r=i(74208),s=i(83731),o=i(16878),a=i(96070),l=i(36359),c=i(56962),d=i(26038),u=i(33812),h=i(53100),p=i(2471),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class v{get loading(){return this._loading$.value}set loading(e){this._loading$.next(e),this.buttonComponent.loading.set(e)}constructor(e,t,i){this.buttonComponent=e,this.validationService=t,this.logService=i,this._loading$=new o.t(!1),this.loading$=this._loading$.asObservable(),this.disabled=!1,this.handler=n.geq.required({alias:"bitAction"}),this.destroyRef=(0,r.WQX)(r.abz)}onClick(){return m(this,void 0,void 0,function*(){!this.handler()||this.loading||this.disabled||this.buttonComponent.disabled()||(this.loading=!0,(0,d.Z)(this.handler()).pipe((0,l.M)({error:e=>{var t,i;null===(t=this.logService)||void 0===t||t.error(`Async action exception: ${e}`),null===(i=this.validationService)||void 0===i||i.showError(e)}}),(0,a.j)(()=>this.loading=!1),(0,s.pQ)(this.destroyRef)).subscribe())})}}v.ɵfac=function(e){return new(e||v)(u.rXU(h.E),u.rXU(p.B,8),u.rXU(c.K,8))},v.ɵdir=u.FsC({type:v,selectors:[["","bitAction",""]],hostBindings:function(e,t){1&e&&u.bIt("click",function(){return t.onClick()})},inputs:{handler:[1,"bitAction","handler"]},outputs:{handler:"bitActionChange"}})},4017:(e,t,i)=>{"use strict";i.d(t,{D:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-item-action"]],hostAttrs:[1,"[&>button]:tw-relative","[&>button:not([bit-item-content])]:after:tw-content-['']","[&>button]:after:tw-absolute","[&>button]:after:tw-block","bit-compact:[&>button]:after:tw-top-[-0.7rem]","bit-compact:[&>button]:after:tw-bottom-[-0.7rem]","[&>button]:after:tw-top-[-0.8rem]","[&>button]:after:tw-bottom-[-0.80rem]","[&>button]:after:tw-right-0","[&>button]:after:tw-left-0"],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2})},4132:(e,t,i)=>{"use strict";i.d(t,{A:()=>r});var n=i(31857);class r{constructor(e,t,i){this.stateDefinition=e,this.key=t,this.options=i}toKeyDefinition(){return new n.Ok(this.stateDefinition,this.key,this.options)}shouldOverwrite(e){var t;const i=null===(t=this.options)||void 0===t?void 0:t.shouldOverwrite;return i?i(e):!!e}map(e,t){var i;const n=null===(i=this.options)||void 0===i?void 0:i.map;return n?n(e,t):Promise.resolve(e)}isValid(e,t){var i;if(null===e)return Promise.resolve(!1);const n=null===(i=this.options)||void 0===i?void 0:i.isValid;return n?n(e,t):Promise.resolve(!!e)}}},4162:(e,t,i)=>{"use strict";i.d(t,{M:()=>z});var n=i(93161),r=i(77468),s=i(33812),o=i(66046),a=i(16878),l=i(72737),c=i(72245),d=i(75811),u=i(34040),h=i(69194),p=i(3204),m=i(14803),v=i(8131),f=i(58625),g=i(56962),y=i(20136),b=i(25024),w=i(92697),S=i(14318),I=i(27520),k=i(36288),C=i(29776),T=i(192),F=i(36801),R=i(94615),P=i(63968),x=i(18030),$=i(74208),E=i(69855),A=i(50700),D=i(35500),O=i(60989),M=i(12694),U=i(16496),G=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function j(e,t){if(1&e&&(s.j41(0,"bit-toggle",9),s.EFF(1),s.k0s()),2&e){const e=t.$implicit;s.Y8G("value",e.value),s.R7$(),s.SpI(" ",e.label," ")}}function N(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-toggle-group",8),s.nI1(1,"async"),s.nI1(2,"i18n"),s.bIt("selectedChange",function(t){$.eBV(e);const i=s.XpG();return $.Njj(i.onCredentialTypeChanged(t))}),s.Z7z(3,j,2,2,"bit-toggle",9,s.fX1),s.nI1(5,"async"),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("selected",s.bMT(1,2,e.credentialType$)),s.BMQ("aria-label",s.bMT(2,4,"type")),s.R7$(3),s.Dyx(s.bMT(5,6,e.passwordOptions$))}}function V(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-password-settings",10),s.nI1(1,"async"),s.bIt("onUpdated",function(){$.eBV(e);const t=s.XpG();return $.Njj(t.generate("password settings"))}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("account",s.bMT(1,2,e.account$))("disableMargin",e.disableMargin)}}function B(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-passphrase-settings",10),s.nI1(1,"async"),s.bIt("onUpdated",function(){$.eBV(e);const t=s.XpG();return $.Njj(t.generate("passphrase settings"))}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("account",s.bMT(1,2,e.account$))("disableMargin",e.disableMargin)}}class z{constructor(e,t,i,n,r,c,d,u){this.generatorService=e,this.generatorHistoryService=t,this.toastService=i,this.i18nService=n,this.logService=r,this.accountService=c,this.zone=d,this.ariaLive=u,this.Algorithm=C.oG,this.account=null,this.account$=new l.m(1),this.debug=!1,this.log=(0,y.S2)({}),this.profile=C.WV.account,this.disableMargin=!1,this.credentialType$=new a.t(null),this.value$=new a.t(""),this.generate$=new o.B,this.USER_REQUEST="user request",this.onGenerated=new s.bkB,this.onAlgorithm=new s.bkB,this.passwordOptions$=new a.t([]),this.showCredentialTypes$=this.passwordOptions$.pipe((0,p.T)(e=>e.length>1)),this.maybeAlgorithm$=new l.m(1),this.algorithm$=this.maybeAlgorithm$.pipe((0,h.p)(e=>!!e)),this.credentialTypeCopyLabel$=this.algorithm$.pipe((0,p.T)(({i18nKeys:{copyCredential:e}})=>(0,x.Tl)(e,this.i18nService))),this.credentialTypeGenerateLabel$=this.algorithm$.pipe((0,p.T)(({i18nKeys:{generateCredential:e}})=>(0,x.Tl)(e,this.i18nService))),this.credentialTypeLabel$=this.algorithm$.pipe((0,p.T)(({i18nKeys:{credentialType:e}})=>(0,x.Tl)(e,this.i18nService))),this.destroyed=new o.B}ngOnChanges(e){return G(this,void 0,void 0,function*(){var t,i;const n=null==e?void 0:e.account;n&&n.currentValue.id&&n.previousValue.id!==n.currentValue.id&&(this.log.debug({previousUserId:null===(t=null==n?void 0:n.previousValue)||void 0===t?void 0:t.id,currentUserId:null===(i=null==n?void 0:n.currentValue)||void 0===i?void 0:i.id},"account input change detected"),this.account$.next(n.currentValue.id))})}generate(e){return G(this,void 0,void 0,function*(){const t=yield(0,c._)(this.algorithm$),i={source:e,algorithm:t.id,profile:this.profile};this.log.debug(i,"generation requested"),this.generate$.next(i)})}onCredentialTypeChanged(e){this.credentialType$.value!==e&&this.zone.run(()=>{this.credentialType$.next(e)})}ngOnInit(){return G(this,void 0,void 0,function*(){if(this.log=(0,y.mJ)(this.debug,this.logService,{type:"PasswordGeneratorComponent"}),!this.account){const e=yield(0,c._)(this.accountService.activeAccount$);e||this.log.panic("active account cannot be `null`."),this.log.info({userId:e.id},"account not specified; using active account settings"),this.account$.next(e)}this.generatorService.algorithms$("password",{account$:this.account$}).pipe((0,p.T)(e=>this.toOptions(e)),(0,m.Q)(this.destroyed)).subscribe(this.passwordOptions$),this.generatorService.generate$({on$:this.generate$,account$:this.account$}).pipe((0,d.W)((e,t)=>("string"==typeof e?this.toastService.showToast({message:e,variant:"error",title:""}):this.logService.error(e),t)),(0,v.E)(this.account$,this.algorithm$),(0,m.Q)(this.destroyed)).subscribe(([e,t,i])=>{var n;this.log.debug({source:null!==(n=e.source)&&void 0!==n?n:null},"credential generated"),this.generatorHistoryService.track(t.id,e.credential,e.category,e.generationDate).catch(e=>{this.logService.error(e)}),this.zone.run(()=>{e.source===this.USER_REQUEST&&this.announce((0,x.Tl)(i.i18nKeys.credentialGenerated,this.i18nService)),this.onGenerated.next(e),this.value$.next(e.credential)})});const e=yield this.generatorService.preferences({account$:this.account$});this.credentialType$.pipe((0,h.p)(e=>!!e),(0,v.E)(e),(0,m.Q)(this.destroyed)).subscribe(([t,i])=>{(0,C.xu)(t)&&(this.log.info({algorithm:t,type:C.ZU.password},"algorithm preferences updated"),i.password.algorithm=t,i.password.updated=new Date,e.next(i))}),e.pipe((0,p.T)(({password:e})=>this.generatorService.algorithm(e.algorithm)),(0,u.F)((e,t)=>null!==e&&null!==t&&(0,C.W0)(e.id,t.id)),(0,m.Q)(this.destroyed)).subscribe(e=>{this.log.debug({algorithm:e.id},"algorithm selected"),this.onCredentialTypeChanged(e.id),this.zone.run(()=>{this.maybeAlgorithm$.next(e),this.onAlgorithm.next((0,x.VI)(e,this.i18nService))})}),this.maybeAlgorithm$.pipe((0,m.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{var t;(null===(t=null==e?void 0:e.capabilities)||void 0===t?void 0:t.autogenerate)?(this.log.debug("autogeneration enabled"),this.generate("autogenerate").catch(e=>{this.log.error(e,"a failure occurred during autogeneration")})):(this.log.debug("autogeneration disabled; clearing generated credential"),this.value$.next("-"))})}),this.log.debug("component initialized")})}announce(e){this.ariaLive.announce(e).catch(e=>this.logService.error(e))}toOptions(e){return e.map(e=>({value:e.id,label:(0,x.Tl)(e.i18nKeys.name,this.i18nService)}))}ngOnDestroy(){this.destroyed.complete(),this.generate$.complete(),this.value$.complete(),this.onGenerated.complete()}}z.ɵfac=function(e){return new(e||z)(s.rXU(C.iE),s.rXU(T.ZS),s.rXU(E.f),s.rXU(A.W),s.rXU(g.K),s.rXU(D.Di),s.rXU(s.SKi),s.rXU(O.Ai))},z.ɵcmp=s.VBU({type:z,selectors:[["tools-password-generator"]],inputs:{account:"account",debug:"debug",profile:"profile",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onGenerated:"onGenerated",onAlgorithm:"onAlgorithm"},features:[s.OA$],decls:21,vars:33,consts:[["fullWidth","",1,"tw-mb-4",3,"selected"],[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-grow","tw-flex","tw-items-center","tw-min-w-0"],[1,"tw-font-mono",3,"password"],[1,"tw-flex","tw-items-center","tw-space-x-1"],["type","button","bitIconButton","bwi-generate","buttonType","main",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","buttonType","main","showToast","",3,"label","appCopyClick","valueLabel","disabled"],[1,"tw-mt-6",3,"account","disableMargin"],["fullWidth","",1,"tw-mb-4",3,"selectedChange","selected"],[3,"value"],[1,"tw-mt-6",3,"onUpdated","account","disableMargin"]],template:function(e,t){if(1&e&&(s.nVh(0,N,6,8,"bit-toggle-group",0),s.nI1(1,"async"),s.j41(2,"bit-card",1)(3,"div",2),s.nrm(4,"bit-color-password",3),s.nI1(5,"async"),s.k0s(),s.j41(6,"div",4)(7,"button",5),s.nI1(8,"async"),s.nI1(9,"async"),s.bIt("click",function(){return t.generate(t.USER_REQUEST)}),s.EFF(10),s.nI1(11,"async"),s.k0s(),s.nrm(12,"button",6),s.nI1(13,"async"),s.nI1(14,"async"),s.nI1(15,"async"),s.nI1(16,"async"),s.k0s()(),s.nVh(17,V,2,4,"tools-password-settings",7),s.nI1(18,"async"),s.nVh(19,B,2,4,"tools-passphrase-settings",7),s.nI1(20,"async")),2&e){let e,i;s.vxM(s.bMT(1,11,t.showCredentialTypes$)?0:-1),s.R7$(4),s.Y8G("password",s.bMT(5,13,t.value$)),s.R7$(3),s.Y8G("label",s.bMT(8,15,t.credentialTypeGenerateLabel$))("disabled",!s.bMT(9,17,t.algorithm$)),s.R7$(3),s.SpI(" ",s.bMT(11,19,t.credentialTypeGenerateLabel$)," "),s.R7$(2),s.Y8G("label",s.bMT(13,21,t.credentialTypeCopyLabel$))("appCopyClick",s.bMT(14,23,t.value$))("valueLabel",s.bMT(15,25,t.credentialTypeLabel$))("disabled",!s.bMT(16,27,t.algorithm$)),s.R7$(5),s.vxM((null==(e=s.bMT(18,29,t.algorithm$))?null:e.id)===t.Algorithm.password?17:-1),s.R7$(2),s.vxM((null==(i=s.bMT(20,31,t.algorithm$))?null:i.id)===t.Algorithm.passphrase?19:-1)}},dependencies:[w.E,M.H,U.a,S.i,I.S,k.s,b.D,P.q,R.H,f.p,r.Jj,F.$Z],encapsulation:2})},4717:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});class n{}},5076:(e,t,i)=>{"use strict";i.d(t,{e:()=>s,v:()=>r});var n=i(53323);const r="00000000-0000-0000-0000-000000000000";function s(e){return"string"==typeof e&&(0,n.W_)(e)}},5513:(e,t,i)=>{"use strict";i.d(t,{d:()=>v});var n=i(43380),r=i(37831),s=i(94573),o=i(74208),a=i(33812),l=i(33277);const c=[{id:"right-center",offsetX:10,originX:"end",originY:"center",overlayX:"start",overlayY:"center",panelClass:["bit-tooltip-right-center"]},{id:"left-center",offsetX:-10,originX:"start",originY:"center",overlayX:"end",overlayY:"center",panelClass:["bit-tooltip-left-center"]},{id:"below-center",offsetY:10,originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",panelClass:["bit-tooltip-below-center"]},{id:"above-center",offsetY:-10,originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",panelClass:["bit-tooltip-above-center"]}];var d=i(77468);function u(e,t){if(1&e&&a.EFF(0),2&e){const e=a.XpG(2);a.JRh(e.tooltipData.content())}}function h(e,t){if(1&e&&(a.rj2(0,"div",0)(1,"div",1),a.SdG(2,0,null,u,1,1),a.eux()()),2&e){const e=a.XpG();a.BMQ("data-position",e.tooltipData.tooltipPosition())("data-visible",e.tooltipData.isVisible()),a.R7$(),a.Avn("id",e.tooltipData.id())}}const p=new o.nKC("TOOLTIP_DATA");class m{constructor(){this.templateRef=s.ebz.required(a.C4Q),this.elementRef=(0,o.WQX)(a.aKT),this.tooltipData=(0,o.WQX)(p)}}m.ɵfac=function(e){return new(e||m)},m.ɵcmp=a.VBU({type:m,selectors:[["bit-tooltip"]],viewQuery:function(e,t){1&e&&a.wEZ(t.templateRef,a.C4Q,5),2&e&&a.NyB()},ngContentSelectors:["*"],decls:1,vars:1,consts:[[1,"bit-tooltip-container"],["role","tooltip",1,"bit-tooltip",3,"id"]],template:function(e,t){1&e&&(a.NAR(),a.nVh(0,h,4,3,"div",0)),2&e&&a.vxM(t.tooltipData.content()?0:-1)},dependencies:[d.MD],encapsulation:2});class v{constructor(){this.tooltipContent=(0,s.geq)("",{alias:"bitTooltip"}),this.tooltipPosition=(0,s.hFB)("above-center"),this.addTooltipToDescribedby=(0,s.hFB)(!1),this.isVisible=(0,o.vPA)(!1),this.elementRef=(0,o.WQX)(a.aKT),this.overlay=(0,o.WQX)(n.hJ),this.viewContainerRef=(0,o.WQX)(a.c1b),this.positionStrategy=this.overlay.position().flexibleConnectedTo(this.elementRef).withFlexibleDimensions(!1).withPush(!0),this.tooltipId="bit-tooltip-"+v.nextId++,this.currentDescribedByIds=this.elementRef.nativeElement.getAttribute("aria-describedby")||null,this.tooltipPortal=new r.A8(m,this.viewContainerRef,o.zZn.create({providers:[{provide:p,useValue:{content:this.tooltipContent,isVisible:this.isVisible,tooltipPosition:this.tooltipPosition,id:(0,o.vPA)(this.tooltipId)}}]})),this.destroyTooltip=()=>{var e;null===(e=this.overlayRef)||void 0===e||e.dispose(),this.overlayRef=void 0,this.isVisible.set(!1)},this.showTooltip=()=>{this.overlayRef||(this.overlayRef=this.overlay.create(Object.assign(Object.assign({},this.defaultPopoverConfig),{positionStrategy:this.positionStrategy})),this.overlayRef.attach(this.tooltipPortal)),setTimeout(()=>{this.isVisible.set(!0)},800)},this.hideTooltip=()=>{this.destroyTooltip()},this.resolvedDescribedByIds=(0,l.EW)(()=>this.addTooltipToDescribedby()?this.currentDescribedByIds?`${this.currentDescribedByIds||""} ${this.tooltipId}`:this.tooltipId:this.currentDescribedByIds)}computePositions(e){const t=c.find(t=>t.id===e);return t?[t,...c]:c}get defaultPopoverConfig(){return{hasBackdrop:!1,scrollStrategy:this.overlay.scrollStrategies.reposition()}}ngOnInit(){this.positionStrategy.withPositions(this.computePositions(this.tooltipPosition()))}}v.nextId=0,v.ɵfac=function(e){return new(e||v)},v.ɵdir=a.FsC({type:v,selectors:[["","bitTooltip",""]],hostVars:1,hostBindings:function(e,t){1&e&&a.bIt("mouseenter",function(){return t.showTooltip()})("mouseleave",function(){return t.hideTooltip()})("focus",function(){return t.showTooltip()})("blur",function(){return t.hideTooltip()}),2&e&&a.BMQ("aria-describedby",t.resolvedDescribedByIds())},inputs:{tooltipContent:[1,"bitTooltip","tooltipContent"],tooltipPosition:[1,"tooltipPosition"],addTooltipToDescribedby:[1,"addTooltipToDescribedby"]},outputs:{tooltipContent:"bitTooltipChange"}})},5520:(e,t,i)=>{"use strict";i.d(t,{S:()=>g});var n=i(77468),r=i(94573),s=i(74208),o=i(33277),a=i(51757);i(9249);var l=i(36801),c=i(89479),d=i(70171),u=i(33812),h=i(97553);const p=["input"],m=(e,t)=>({"tw-opacity-0":e,"tw-bg-text-muted":t});function v(e,t){if(1&e){const e=u.RV6();u.j41(0,"button",7),u.nI1(1,"i18n"),u.bIt("click",function(){s.eBV(e);const t=u.XpG();return s.Njj(t.clearSearch())}),u.k0s()}if(2&e){const e=u.XpG();u.Y8G("ngClass",u.l_i(4,m,!e.showResetButton(),e.showResetButton())),u.BMQ("aria-label",u.bMT(1,2,"resetSearch"))}}let f=0;class g{constructor(){this.input=(0,r.ebz)("input"),this.id="search-id-"+f++,this.inputType=-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf(" Chrome/")&&-1===navigator.userAgent.indexOf(" Chromium/")?"text":"search",this.isInputFocused=(0,s.vPA)(!1),this.isFormHovered=(0,s.vPA)(!1),this.showResetButton=(0,o.EW)(()=>this.isInputFocused()||this.isFormHovered()),this.disabled=(0,r.geq)(),this.placeholder=(0,r.hFB)(),this.autocomplete=(0,r.hFB)()}getFocusTarget(){var e;return null===(e=this.input())||void 0===e?void 0:e.nativeElement}onChange(e){this.searchText=e,null!=this.notifyOnChange&&this.notifyOnChange(e)}clearSearch(){this.searchText="",this.notifyOnChange&&this.notifyOnChange("")}onTouch(){null!=this.notifyOnTouch&&this.notifyOnTouch()}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouch=e}writeValue(e){this.searchText=e}setDisabledState(e){this.disabled.set(e)}}g.ɵfac=function(e){return new(e||g)},g.ɵcmp=u.VBU({type:g,selectors:[["bit-search"]],viewQuery:function(e,t){1&e&&u.wEZ(t.input,p,5),2&e&&u.NyB()},inputs:{disabled:[1,"disabled"],placeholder:[1,"placeholder"],autocomplete:[1,"autocomplete"]},outputs:{disabled:"disabledChange"},features:[u.Jv_([{provide:a.kq,multi:!0,useExisting:g},{provide:d.H,useExisting:g}])],decls:10,vars:14,consts:[["input",""],["role","search",1,"tw-relative","tw-flex","tw-items-center","tw-w-full","tw-h-10",3,"mouseenter","mouseleave"],[1,"tw-sr-only",3,"for"],["aria-hidden","true",1,"tw-absolute","tw-start-2","tw-z-20","!tw-mb-0","tw-cursor-text",3,"for"],[1,"bwi","bwi-search","bwi-fw","tw-text-muted"],["bitInput","","name","searchText",1,"tw-ps-9","tw-h-full",3,"ngModelChange","focus","blur","type","id","placeholder","ngModel","disabled"],["class","bw-reset-btn tw-size-6 tw-absolute hover:tw-bg-text-main tw-end-2 tw-z-20 !tw-mb-0 tw-cursor-pointer","type","reset",3,"ngClass","click",4,"ngIf"],["type","reset",1,"bw-reset-btn","tw-size-6","tw-absolute","hover:tw-bg-text-main","tw-end-2","tw-z-20","!tw-mb-0","tw-cursor-pointer",3,"click","ngClass"]],template:function(e,t){var i;if(1&e){const e=u.RV6();u.j41(0,"form",1),u.bIt("mouseenter",function(){return s.eBV(e),s.Njj(t.isFormHovered.set(!0))})("mouseleave",function(){return s.eBV(e),s.Njj(t.isFormHovered.set(!1))}),u.j41(1,"label",2),u.EFF(2),u.nI1(3,"i18n"),u.k0s(),u.j41(4,"label",3),u.nrm(5,"i",4),u.k0s(),u.j41(6,"input",5,0),u.nI1(8,"i18n"),u.bIt("ngModelChange",function(i){return s.eBV(e),s.Njj(t.onChange(i))})("focus",function(){return s.eBV(e),s.Njj(t.isInputFocused.set(!0))})("blur",function(){return s.eBV(e),t.isInputFocused.set(!1),s.Njj(t.onTouch())}),u.k0s(),u.DNE(9,v,2,7,"button",6),u.k0s()}2&e&&(u.R7$(),u.Y8G("for",t.id),u.R7$(),u.JRh(u.bMT(3,10,"search")),u.R7$(2),u.Y8G("for",t.id),u.R7$(2),u.Y8G("type",t.inputType)("id",t.id)("placeholder",null!==(i=t.placeholder())&&void 0!==i?i:u.bMT(8,12,"search"))("ngModel",t.searchText)("disabled",t.disabled()),u.BMQ("autocomplete",t.autocomplete()),u.R7$(3),u.Y8G("ngIf",t.searchText&&t.showResetButton()))},dependencies:[c.x,h.J,a.X1,a.qT,a.me,a.BC,a.cb,a.YN,a.vS,a.cV,n.bT,n.YU,l.$Z],encapsulation:2})},5556:(e,t,i)=>{"use strict";i.d(t,{p:()=>n});class n{}},5571:(e,t,i)=>{"use strict";i.d(t,{o:()=>c});var n=i(78781),r=i(17989),s=i(24072),o=i(59281),a=i(34461),l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class c extends r.A{constructor(e){super(),null!=e&&(this.id=e.id,this.url=e.url,this.size=e.size,this.sizeName=e.sizeName,this.fileName=(0,s.e)(e.fileName),this.key=(0,s.e)(e.key))}decrypt(e){return l(this,arguments,void 0,function*(e,t="No Cipher Context"){const i=yield this.decryptObj(this,new a.$(this),["fileName"],e,"DomainType: Attachment; "+t);return null!=this.key&&(i.key=yield this.decryptAttachmentKey(e),i.encryptedKey=this.key),i})}decryptAttachmentKey(e){return l(this,void 0,void 0,function*(){try{if(null==this.key)return;const t=n.A.getContainerService().getEncryptService();return yield t.unwrapSymmetricKey(this.key,e)}catch(t){return void console.error("[Attachment] Error decrypting attachment",t)}})}toAttachmentData(){const e=new o.e;return null!=this.size&&(e.size=this.size),this.buildDataModel(this,e,{id:null,url:null,sizeName:null,fileName:null,key:null},["id","url","sizeName"]),e}static fromJSON(e){if(null==e)return;const t=new c;return t.id=e.id,t.url=e.url,t.size=e.size,t.sizeName=e.sizeName,t.key=(0,s.u)(e.key),t.fileName=(0,s.u)(e.fileName),t}toSdkAttachment(){var e,t;return{id:this.id,url:this.url,size:this.size,sizeName:this.sizeName,fileName:null===(e=this.fileName)||void 0===e?void 0:e.toSdk(),key:null===(t=this.key)||void 0===t?void 0:t.toSdk()}}static fromSdkAttachment(e){if(!e)return;const t=new c;return t.id=e.id,t.url=e.url,t.size=e.size,t.sizeName=e.sizeName,t.fileName=(0,s.u)(e.fileName),t.key=(0,s.u)(e.key),t}}},5771:(e,t,i)=>{"use strict";i.d(t,{k:()=>o});var n=i(56962),r=i(33812),s=i(2471);class o{constructor(e,t,i){this.el=e,this.validationService=t,this.logService=i}ngOnChanges(e){null!=this.appApiAction&&null!=this.appApiAction.then&&(this.el.nativeElement.loading=!0,this.appApiAction.then(e=>{this.el.nativeElement.loading=!1},e=>{var t;this.el.nativeElement.loading=!1,null===(t=this.logService)||void 0===t||t.error("Received API exception:",e),this.validationService.showError(e)}))}}o.ɵfac=function(e){return new(e||o)(r.rXU(r.aKT),r.rXU(s.B),r.rXU(n.K))},o.ɵdir=r.FsC({type:o,selectors:[["","appApiAction",""]],inputs:{appApiAction:"appApiAction"},standalone:!1,features:[r.OA$]})},5819:(e,t,i)=>{"use strict";i.d(t,{Lg:()=>l,qk:()=>s,D$:()=>a,fg:()=>c});var n=i(69194),r=i(99969);class s{constructor(e){this.messageStream=e,this.allMessages$=this.messageStream}messages$(e){return this.allMessages$.pipe((0,n.p)(t=>(null==t?void 0:t.command)===e.command))}}s.EMPTY=new s(r.w);class o{constructor(e){this.innerMessageSenders=e}send(e,t={}){for(const i of this.innerMessageSenders)i.send(e,t)}}class a{static combine(...e){return new o(e)}}a.EMPTY=new o([]);class l{constructor(e){this.command=e}}Symbol("externalSource");class c{constructor(e){this.messagesSubject=e}send(e,t={}){const i=(e=>"string"==typeof e?e:e.command)(e);this.messagesSubject.next(Object.assign(null!=t?t:{},{command:i}))}}},5864:(e,t,i)=>{"use strict";i.d(t,{Q:()=>s});var n=i(74208),r=i(12012);class s{constructor(){this.apiService=(0,n.WQX)(r.G)}postUserKeyUpdate(e){return this.apiService.send("POST","/accounts/key-management/rotate-user-account-keys",e,!0,!1)}}s.ɵfac=function(e){return new(e||s)},s.ɵprov=n.jDH({token:s,factory:s.ɵfac})},6307:(e,t,i)=>{"use strict";i.d(t,{m:()=>r});var n=i(83731);function r(e,t){(0,n.br)(t).pipe((0,n.pQ)()).subscribe(t=>{t?(e.removeAttribute("disabled"),e.setAttribute("aria-disabled","true")):e.removeAttribute("aria-disabled")})}},6528:(e,t,i)=>{"use strict";i.d(t,{G:()=>c});var n=i(39907),r=i(31442),s=i(69473),o=i(8583),a=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class c extends o.n{get maskedCode(){return null!=this.code?"•".repeat(this.code.length):void 0}get maskedNumber(){return null!=this.number?"•".repeat(this.number.length):void 0}get brand(){return this._brand}set brand(e){this._brand=e,this._subTitle=void 0}get number(){return this._number}set number(e){this._number=e,this._subTitle=void 0}get subTitle(){if(null==this._subTitle&&(this._subTitle=this.brand,null!=this.number&&this.number.length>=4)){null!=this._subTitle&&""!==this._subTitle?this._subTitle+=", ":this._subTitle="";const e=this.number.length>=5&&null!=this.number.match(new RegExp("^3[47]"))?5:4;this._subTitle+="*"+this.number.substr(this.number.length-e)}return this._subTitle}get expiration(){const e=this.expYear?(0,n.jd)(this.expYear):void 0;if(!this.expMonth&&!e)return;let t=null!=this.expMonth?("0"+this.expMonth).slice(-2):"__";return t+=" / "+(e||"____"),t}static fromJSON(e){return Object.assign(new c,e)}static getCardBrandByPatterns(e){if(null==e||"string"!=typeof e||""===e.trim())return;let t=new RegExp("^4");return null!=e.match(t)?"Visa":/^(5[1-5][0-9]{14}|2(22[1-9][0-9]{12}|2[3-9][0-9]{13}|[3-6][0-9]{14}|7[0-1][0-9]{13}|720[0-9]{12}))$/.test(e)?"Mastercard":(t=new RegExp("^3[47]"),null!=e.match(t)?"Amex":(t=new RegExp("^(6011|622(12[6-9]|1[3-9][0-9]|[2-8][0-9]{2}|9[0-1][0-9]|92[0-5]|64[4-9])|65)"),null!=e.match(t)?"Discover":(t=new RegExp("^36"),null!=e.match(t)?"Diners Club":(t=new RegExp("^30[0-5]"),null!=e.match(t)?"Diners Club":(t=new RegExp("^35(2[89]|[3-8][0-9])"),null!=e.match(t)?"JCB":(t=new RegExp("^(4026|417500|4508|4844|491(3|7))"),null!=e.match(t)?"Visa":void 0))))))}static fromSdkCardView(e){const t=new c;return t.cardholderName=e.cardholderName,t.brand=e.brand,t.number=e.number,t.expMonth=e.expMonth,t.expYear=e.expYear,t.code=e.code,t}toSdkCardView(){return this}}a([(0,s.V)(r.xP.CardholderName,{sortPosition:0}),l("design:type",String)],c.prototype,"cardholderName",void 0),a([(0,s.V)(r.xP.ExpMonth,{sortPosition:3,i18nKey:"expirationMonth"}),l("design:type",String)],c.prototype,"expMonth",void 0),a([(0,s.V)(r.xP.ExpYear,{sortPosition:4,i18nKey:"expirationYear"}),l("design:type",String)],c.prototype,"expYear",void 0),a([(0,s.V)(r.xP.Code,{sortPosition:5,i18nKey:"securityCode"}),l("design:type",String)],c.prototype,"code",void 0),a([(0,s.V)(r.xP.Brand,{sortPosition:2}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"brand",null),a([(0,s.V)(r.xP.Number,{sortPosition:1}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"number",null)},6804:(e,t,i)=>{"use strict";i.d(t,{S:()=>k});var n=i(51757),r=i(81285),s=i(71804),o=i(37380),a=i(7861),l=i(37579),c=i(81573),d=i(29029),u=i(81525),h=i(36801),p=i(33812),m=i(21274),v=i(50700),f=i(62166),g=i(26657),y=i(45154),b=i(56898),w=i(7730),S=i(68016),I=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class k{constructor(e,t,i,r,s){this.data=e,this.dialogRef=t,this.twoFactorService=i,this.i18nService=r,this.userVerificationService=s,this.formGroup=new n.gE({secret:new n.MJ(null)}),this.invalidSecret=!1,this.submit=()=>I(this,void 0,void 0,function*(){try{if(!this.formGroup.value.secret)throw new Error("Secret is required");const e=this.formGroup.value.secret;this.formPromise=this.userVerificationService.buildRequest(e).then(e=>this.apiCall(e));const t=yield this.formPromise;this.dialogRef.close({response:t,secret:e.secret,verificationType:e.type})}catch(e){throw e instanceof a._&&400===e.statusCode&&(this.invalidSecret=!0),e}}),this.type=e.type,this.organizationId=e.organizationId}get dialogTitle(){switch(this.type){case-1:return this.i18nService.t("recoveryCodeTitle");case s.R.Duo:case s.R.OrganizationDuo:return"Duo";case s.R.Email:return this.i18nService.t("emailTitle");case s.R.WebAuthn:return this.i18nService.t("webAuthnTitle");case s.R.Authenticator:return this.i18nService.t("authenticatorAppTitle");case s.R.Yubikey:return"Yubikey";default:throw new Error(`Unknown two-factor type: ${this.type}`)}}apiCall(e){switch(this.type){case-1:return this.twoFactorService.getTwoFactorRecover(e);case s.R.Duo:case s.R.OrganizationDuo:return null!=this.organizationId?this.twoFactorService.getTwoFactorOrganizationDuo(this.organizationId,e):this.twoFactorService.getTwoFactorDuo(e);case s.R.Email:return this.twoFactorService.getTwoFactorEmail(e);case s.R.WebAuthn:return this.twoFactorService.getTwoFactorWebAuthn(e);case s.R.Authenticator:return this.twoFactorService.getTwoFactorAuthenticator(e);case s.R.Yubikey:return this.twoFactorService.getTwoFactorYubiKey(e);default:throw new Error(`Unknown two-factor type: ${this.type}`)}}static open(e,t){return e.open(k,t)}}k.ɵfac=function(e){return new(e||k)(p.rXU(u.Qs),p.rXU(m.ce),p.rXU(o.fz),p.rXU(v.W),p.rXU(f.i))},k.ɵcmp=p.VBU({type:k,selectors:[["app-two-factor-verify"]],decls:12,vars:13,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title","subtitle"],["bitDialogContent",""],["formControlName","secret","name","secret",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(p.j41(0,"form",0)(1,"bit-dialog",1),p.nI1(2,"i18n"),p.qex(3,2),p.j41(4,"app-user-verification-form-input",3),p.mxI("invalidSecretChange",function(e){return p.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),p.k0s(),p.bVm(),p.qex(5,4),p.j41(6,"button",5),p.EFF(7),p.nI1(8,"i18n"),p.k0s(),p.j41(9,"button",6),p.EFF(10),p.nI1(11,"i18n"),p.k0s(),p.bVm(),p.k0s()()),2&e&&(p.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),p.R7$(),p.Y8G("title",p.bMT(2,7,"twoStepLogin"))("subtitle",t.dialogTitle),p.R7$(3),p.R50("invalidSecret",t.invalidSecret),p.R7$(3),p.SpI(" ",p.bMT(8,9,"continue")," "),p.R7$(3),p.SpI(" ",p.bMT(11,11,"close")," "))},dependencies:[l.C,g.$,y.L,d.t,b.Q,c.P,w.I,S.m,n.X1,n.qT,n.BC,n.cb,n.j4,n.JD,r.wV,h.$Z],encapsulation:2})},6912:(e,t,i)=>{"use strict";i.d(t,{D:()=>n});class n{constructor(e,t){this.twoFactor=e,this.device=null!=t?t:null}setTwoFactor(e){this.twoFactor=e}setAuthRequestAccessCode(e){this.authRequest=e}toIdentityToken(e){const t={scope:"api offline_access",client_id:e};return this.device&&(t.deviceType=this.device.type,t.deviceIdentifier=this.device.identifier,t.deviceName=this.device.name),this.authRequest&&(t.authRequest=this.authRequest),this.twoFactor&&this.twoFactor.token&&null!=this.twoFactor.provider&&(t.twoFactorToken=this.twoFactor.token,t.twoFactorProvider=this.twoFactor.provider,t.twoFactorRemember=this.twoFactor.remember?"1":"0"),t}}},7248:(e,t,i)=>{"use strict";i.d(t,{V:()=>n});class n{authenticateWith(e){return this.masterPasswordHash=e.masterPasswordAuthenticationHash,this}}},7421:(e,t,i)=>{"use strict";i.d(t,{T:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,hostAttrs:[1,"tw-box-border","tw-block","tw-bg-background","tw-text-main","tw-border","tw-border-solid","tw-border-secondary-100","tw-shadow","tw-rounded-xl"]})},7730:(e,t,i)=>{"use strict";i.d(t,{I:()=>o});var n=i(94573),r=i(33812),s=i(81525);class o{constructor(e){this.dialogRef=e,this.dialogResult=(0,n.hFB)(void 0,{alias:"bitDialogClose"})}get disableClose(){var e;return!!(null===(e=this.dialogRef)||void 0===e?void 0:e.disableClose)||null}close(){this.disableClose||this.dialogRef.close(this.dialogResult())}}o.ɵfac=function(e){return new(e||o)(r.rXU(s.ce,8))},o.ɵdir=r.FsC({type:o,selectors:[["","bitDialogClose",""]],hostVars:1,hostBindings:function(e,t){1&e&&r.bIt("click",function(){return t.close()}),2&e&&r.BMQ("disabled",t.disableClose)},inputs:{dialogResult:[1,"bitDialogClose","dialogResult"]}})},7855:(e,t,i)=>{"use strict";i.d(t,{q:()=>E});var n=i(28846),r=i(51757),s=i(33812),o=i(66046),a=i(14803),l=i(68333),c=i(78781),d=i(22848),u=i(62166),h=i(50700),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class m{get invalidSecret(){return this._invalidSecret}set invalidSecret(e){this._invalidSecret=e,this.invalidSecretChange.emit(e),e&&this.secret.markAsTouched(),this.secret.updateValueAndValidity({emitEvent:!1})}constructor(e,t,i){this.keyService=e,this.userVerificationService=t,this.i18nService=i,this._invalidSecret=!1,this.invalidSecretChange=new s.bkB,this.hasMasterPassword=!0,this.disableRequestOTP=!1,this.sentCode=!1,this.secret=new r.MJ("",[r.k0.required,()=>{if(this.invalidSecret)return{invalidSecret:{message:this.hasMasterPassword?this.i18nService.t("incorrectPassword"):this.i18nService.t("incorrectCode")}}}]),this.destroy$=new o.B,this.requestOTP=()=>p(this,void 0,void 0,function*(){if(!this.hasMasterPassword){this.disableRequestOTP=!0;try{yield this.userVerificationService.requestOTP(),this.sentCode=!0}finally{this.disableRequestOTP=!1}}})}ngOnInit(){return p(this,void 0,void 0,function*(){this.hasMasterPassword=yield this.userVerificationService.hasMasterPasswordAndMasterKeyHash(),this.processChanges(this.secret.value),this.secret.valueChanges.pipe((0,a.Q)(this.destroy$)).subscribe(e=>this.processChanges(e))})}writeValue(e){this.secret.setValue(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disableRequestOTP=e,e?this.secret.disable():this.secret.enable()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}processChanges(e){this.invalidSecret=!1,null!=this.onChange&&this.onChange({type:this.hasMasterPassword?l.k.MasterPassword:l.k.OTP,secret:c.A.isNullOrWhitespace(e)?null:e})}}m.ɵfac=function(e){return new(e||m)(s.rXU(d.Lu),s.rXU(u.i),s.rXU(h.W))},m.ɵdir=s.FsC({type:m,selectors:[["app-user-verification"]],inputs:{invalidSecret:"invalidSecret"},outputs:{invalidSecretChange:"invalidSecretChange"},standalone:!1});var v=i(77468),f=i(49519),g=i(57083),y=i(3892),b=i(56898),w=i(86226),S=i(93199),I=i(97553),k=i(43759),C=i(76356),T=i(69896),F=i(36288),R=i(88016);function P(e,t){if(1&e&&(s.qex(0),s.j41(1,"bit-form-field",1)(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nrm(5,"input",2)(6,"button",3),s.j41(7,"bit-hint"),s.EFF(8),s.nI1(9,"i18n"),s.k0s()(),s.bVm()),2&e){const e=s.XpG();s.R7$(3),s.JRh(s.bMT(4,3,"masterPass")),s.R7$(2),s.Y8G("formControl",e.secret),s.R7$(3),s.JRh(s.bMT(9,5,"confirmIdentity"))}}function x(e,t){1&e&&(s.j41(0,"span",9),s.nrm(1,"i",10),s.EFF(2),s.nI1(3,"i18n"),s.k0s()),2&e&&(s.Y8G("@sent",void 0),s.R7$(2),s.SpI(" ",s.bMT(3,2,"codeSent")," "))}function $(e,t){if(1&e&&(s.qex(0),s.j41(1,"div",4)(2,"label",5),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.j41(5,"button",6),s.EFF(6),s.nI1(7,"i18n"),s.k0s(),s.DNE(8,x,4,4,"span",7),s.k0s(),s.j41(9,"bit-form-field",1)(10,"bit-label"),s.EFF(11),s.nI1(12,"i18n"),s.k0s(),s.nrm(13,"input",8),s.j41(14,"bit-hint"),s.EFF(15),s.nI1(16,"i18n"),s.k0s()(),s.bVm()),2&e){const e=s.XpG();s.R7$(3),s.JRh(s.bMT(4,7,"sendVerificationCode")),s.R7$(2),s.Y8G("bitAction",e.requestOTP),s.R7$(),s.SpI(" ",s.bMT(7,9,"sendCode")," "),s.R7$(2),s.Y8G("ngIf",e.sentCode),s.R7$(3),s.JRh(s.bMT(12,11,"verificationCode")),s.R7$(2),s.Y8G("formControl",e.secret),s.R7$(2),s.JRh(s.bMT(16,13,"confirmIdentity"))}}class E extends m{}E.ɵfac=(()=>{let e;return function(t){return(e||(e=s.xGo(E)))(t||E)}})(),E.ɵcmp=s.VBU({type:E,selectors:[["app-user-verification"]],standalone:!1,features:[s.Jv_([{provide:r.kq,multi:!0,useExisting:E}]),s.Vt3],decls:2,vars:2,consts:[[4,"ngIf"],["disableMargin",""],["bitInput","","id","masterPassword","type","password","name","MasterPasswordHash","appAutofocus","","appInputVerbatim","",3,"formControl"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],[1,"tw-mb-6"],[1,"tw-block"],["type","button","bitButton","","buttonType","secondary","appAutofocus","",3,"bitAction"],["class","tw-ml-2 tw-text-success","role","alert",4,"ngIf"],["bitInput","","type","text","id","verificationCode","name","verificationCode","appInputVerbatim","",3,"formControl"],["role","alert",1,"tw-ml-2","tw-text-success"],["aria-hidden","true",1,"bwi","bwi-check-circle"]],template:function(e,t){1&e&&s.DNE(0,P,10,7,"ng-container",0)(1,$,17,15,"ng-container",0),2&e&&(s.Y8G("ngIf",t.hasMasterPassword),s.R7$(),s.Y8G("ngIf",!t.hasMasterPassword))},dependencies:[v.bT,r.me,r.BC,r.l_,f.B,g.q,y.p,b.Q,w.j,S.I,I.J,k.h,C.e,T.a,F.s,R.$],encapsulation:2,data:{animation:[(0,n.hZ)("sent",[(0,n.kY)(":enter",[(0,n.iF)({opacity:0}),(0,n.i0)("100ms",(0,n.iF)({opacity:1}))])])]}})},7861:(e,t,i)=>{"use strict";i.d(t,{_:()=>r});var n=i(20702);class r extends n.r{constructor(e,t,i){super(e);let n=null;if(null!=e){const t=this.getResponseProperty("ErrorModel");n=t&&i?t:e}429===t?this.message="Rate limit exceeded. Try again later.":n&&(this.message=this.getResponseProperty("Message",n),this.validationErrors=this.getResponseProperty("ValidationErrors",n)),this.statusCode=t}getSingleMessage(){if(null==this.validationErrors)return this.message;for(const e in this.validationErrors)if(this.validationErrors.hasOwnProperty(e)&&this.validationErrors[e].length)return this.validationErrors[e][0];return this.message}getAllMessages(){const e=[];if(null==this.validationErrors)return e;for(const t in this.validationErrors)this.validationErrors.hasOwnProperty(t)&&this.validationErrors[t].forEach(i=>{let n="";if(t.indexOf("[")>-1&&t.indexOf("]")>-1){const e=t.lastIndexOf(".");n=t.substr(0,e>-1?e:t.length)+": "}e.push(n+i)});return e}}},7919:(e,t,i)=>{"use strict";i.d(t,{KN:()=>o,g7:()=>s,gC:()=>n});const n=Object.freeze({Login:1,SecureNote:2,Card:3,Identity:4,SshKey:5}),r=Object.freeze(Object.fromEntries(Object.entries(n).map(([e,t])=>[t,e])));function s(e){return r[e]}const o=e=>Object.values(n).includes(e)},8144:(e,t,i)=>{"use strict";i.d(t,{B:()=>d});var n=i(66046),r=i(33338),s=i(3204),o=i(14803),a=i(30550),l=i(74208),c=i(23649);class d{constructor(e){this.onDestroy=new n.B,this.filter$=(0,r.z)([e.paramMap,e.queryParamMap]).pipe((0,s.T)(([e,t])=>{var i,n,r,s;const o=t.get("type"),l=(0,a.F)(o)?o:void 0;return{collectionId:null!==(i=t.get("collectionId"))&&void 0!==i?i:void 0,folderId:null!==(n=t.get("folderId"))&&void 0!==n?n:void 0,organizationId:null!==(s=null!==(r=e.get("organizationId"))&&void 0!==r?r:t.get("organizationId"))&&void 0!==s?s:void 0,organizationIdParamType:null!=e.get("organizationId")?"path":"query",type:l}}),(0,o.Q)(this.onDestroy))}createRoute(e){var t,i,n,r;return[[],{queryParams:{collectionId:null!==(t=e.collectionId)&&void 0!==t?t:null,folderId:null!==(i=e.folderId)&&void 0!==i?i:null,organizationId:"path"===e.organizationIdParamType?null:null!==(n=e.organizationId)&&void 0!==n?n:null,type:null!==(r=e.type)&&void 0!==r?r:null},queryParamsHandling:"merge"}]}ngOnDestroy(){this.onDestroy.next(),this.onDestroy.complete()}}d.ɵfac=function(e){return new(e||d)(l.KVO(c.nX))},d.ɵprov=l.jDH({token:d,factory:d.ɵfac})},8245:(e,t,i)=>{"use strict";i.d(t,{b:()=>b});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(14803),d=i(8131),u=i(58625),h=i(26411),p=i(29776),m=i(36801),v=i(86226),f=i(97553),g=i(43759),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class b{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account$=new o.m(1),this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({catchallDomain:[""]}),this.saveSettings=new s.B,this.destroyed$=new s.B}ngOnChanges(e){return y(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}ngOnInit(){return y(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(p.qG.catchall,{account$:this.account$});e.pipe((0,c.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,l.i)(1),(0,c.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,d.E)(this.settings.valueChanges),(0,a.T)(([,e])=>e),(0,c.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}ngOnDestroy(){this.account$.complete(),this.destroyed$.next(),this.destroyed$.complete()}}b.ɵfac=function(e){return new(e||b)(n.rXU(r.ok),n.rXU(p.iE))},b.ɵcmp=n.VBU({type:b,selectors:[["tools-catchall-settings"]],inputs:{account:"account"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:6,vars:4,consts:[[1,"tw-container",3,"formGroup"],["bitInput","","formControlName","catchallDomain","type","text",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0)(1,"bit-form-field")(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"input",1),n.bIt("change",function(){return t.save("catchallDomain")}),n.k0s()()()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(3),n.JRh(n.bMT(4,2,"domainName")))},dependencies:[r.X1,r.qT,r.me,r.BC,r.cb,r.j4,r.JD,h.L,v.j,f.J,g.h,u.p,m.$Z],encapsulation:2})},8297:(e,t,i)=>{"use strict";i.d(t,{K:()=>a});var n=i(89033),r=i(24374),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({imports:[n.c,r.d,n.c]})},8433:(e,t,i)=>{"use strict";i.d(t,{p:()=>o});var n=i(33886),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.w]})},8583:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{}},8806:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});class n{}},8936:(e,t,i)=>{"use strict";i.d(t,{B:()=>S,G:()=>w});var n=i(78991),r=i(23549),s=i(25304),o=i(19638);const a={id:o.N.addyio,name:"Addy.io"},l=[{site:s.YY.forwarder,product:{vendor:a},host:{authorization:"bearer",selfHost:"maybe",baseUrl:"https://app.addy.io"},requestedFields:[r.D0.token,r.D0.baseUrl,r.D0.domain]}],c=Object.freeze({id:o.N.bitwarden,name:"Bitwarden"}),d={id:o.N.duckduckgo,name:"DuckDuckGo"},u=[{site:s.YY.forwarder,product:{vendor:d},host:{authorization:"bearer",selfHost:"never",baseUrl:"https://quack.duckduckgo.com/api"},requestedFields:[r.D0.token]}],h={id:o.N.fastmail,name:"Fastmail"},p=[{site:s.YY.forwarder,product:{vendor:h},host:{authorization:"bearer",selfHost:"maybe",baseUrl:"https://api.fastmail.com"},requestedFields:[r.D0.token]}],m={id:o.N.forwardemail,name:"Forward Email"},v=[{site:s.YY.forwarder,product:{vendor:m},host:{authorization:"basic-username",selfHost:"never",baseUrl:"https://api.forwardemail.net"},requestedFields:[r.D0.domain,r.D0.token]}],f={id:o.N.mozilla,name:"Mozilla"},g=[{site:s.YY.forwarder,product:{vendor:f,name:"Firefox Relay"},host:{authorization:"token",selfHost:"never",baseUrl:"https://relay.firefox.com/api"},requestedFields:[r.D0.token]}],y={id:o.N.simplelogin,name:"SimpleLogin"},b=[{site:s.YY.forwarder,product:{vendor:y},host:{authentication:!0,selfHost:"maybe",baseUrl:"https://app.simplelogin.io"},requestedFields:[r.D0.baseUrl,r.D0.token,r.D0.domain]}],w=(0,n.ol)([a,c,d,h,m,f,y]),S=(0,n.ol)([l,u,p,v,g,b].flat())},9045:(e,t,i)=>{"use strict";i.d(t,{E:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 8.33 80 66.67">
    <path class="tw-fill-illustration-bg-primary" d="M8.333 66.667H20L18.333 75H10l-1.667-8.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M8.333 66.667 10 75h8.333L20 66.667H8.333Zm2.033 1.667 1 5h5.601l1-5h-7.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M60 66.667h11.667L70 75h-8.333L60 66.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60 66.667 61.667 75H70l1.667-8.333H60Zm2.033 1.667 1 5h5.6l1-5h-7.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="m10.417 68.334.416 2.5H17.5l.417-2.5h-7.5ZM62.084 68.334l.416 2.5h6.667l.416-2.5h-7.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M0 15a6.667 6.667 0 0 1 6.667-6.666h66.666A6.667 6.667 0 0 1 80 15.001v46.666a6.667 6.667 0 0 1-6.666 6.667H6.666A6.667 6.667 0 0 1 0 61.667V15.001Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M73.334 10H6.666a5 5 0 0 0-5 5v46.667a5 5 0 0 0 5 5h66.666a5 5 0 0 0 5-5V15.001a5 5 0 0 0-5-5ZM6.666 8.335A6.667 6.667 0 0 0 0 15.001v46.666a6.667 6.667 0 0 0 6.667 6.667h66.666A6.667 6.667 0 0 0 80 61.667V15.001a6.667 6.667 0 0 0-6.666-6.667H6.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M6.667 18.333A3.333 3.333 0 0 1 10 15h60a3.333 3.333 0 0 1 3.333 3.333v40A3.333 3.333 0 0 1 70 61.667H10a3.333 3.333 0 0 1-3.333-3.334v-40Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 16.667H10c-.92 0-1.667.746-1.667 1.666v40C8.333 59.253 9.08 60 10 60h60c.92 0 1.667-.746 1.667-1.667v-40c0-.92-.746-1.666-1.667-1.666ZM10 15a3.333 3.333 0 0 0-3.333 3.333v40A3.333 3.333 0 0 0 10 61.667h60a3.333 3.333 0 0 0 3.333-3.334v-40A3.333 3.333 0 0 0 70 15H10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M45 38.333c0 8.745-7.089 15.834-15.833 15.834-8.745 0-15.834-7.09-15.834-15.834S20.423 22.5 29.167 22.5 45 29.589 45 38.333Z"/>
    <path class="tw-fill-illustration-tertiary" d="M36.667 38.334a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M30 25a.833.833 0 0 0-1.666 0v4.204A9.125 9.125 0 0 0 23.3 31.29l-2.973-2.973a.834.834 0 0 0-1.179 1.179l2.973 2.973a9.125 9.125 0 0 0-2.084 5.032h-4.204a.833.833 0 1 0 0 1.667h4.204a9.125 9.125 0 0 0 2.084 5.032l-2.973 2.974a.833.833 0 1 0 1.179 1.178l2.973-2.973a9.127 9.127 0 0 0 5.033 2.085v4.204a.833.833 0 0 0 1.666 0v-4.204a9.127 9.127 0 0 0 5.033-2.085l2.973 2.973a.833.833 0 0 0 1.178-1.178l-2.973-2.974a9.125 9.125 0 0 0 2.085-5.032H42.5a.833.833 0 1 0 0-1.667h-4.204a9.125 9.125 0 0 0-2.085-5.032l2.973-2.973a.833.833 0 1 0-1.178-1.179l-2.973 2.973A9.125 9.125 0 0 0 30 29.204V25Zm4.468 18.64a7.5 7.5 0 1 1 0-10.61h.002l.003.003a7.476 7.476 0 0 1 2.194 5.297v.004c0 2.07-.839 3.944-2.195 5.301l-.002.002-.002.002ZM32.5 38.333a3.333 3.333 0 1 1-6.667 0 3.333 3.333 0 0 1 6.667 0Zm1.667 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M69.167 21.667c0-.92.746-1.667 1.666-1.667h3.334c.92 0 1.666.746 1.666 1.667V30c0 .92-.746 1.667-1.666 1.667h-3.334c-.92 0-1.666-.747-1.666-1.667v-8.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M74.167 21.667h-3.334V30h3.334v-8.333ZM70.833 20c-.92 0-1.666.746-1.666 1.667V30c0 .92.746 1.667 1.666 1.667h3.334c.92 0 1.666-.747 1.666-1.667v-8.333c0-.92-.746-1.667-1.666-1.667h-3.334Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M69.167 46.667c0-.92.746-1.667 1.666-1.667h3.334c.92 0 1.666.746 1.666 1.667V55c0 .92-.746 1.667-1.666 1.667h-3.334c-.92 0-1.666-.747-1.666-1.667v-8.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M74.167 46.667h-3.334V55h3.334v-8.333ZM70.833 45c-.92 0-1.666.746-1.666 1.667V55c0 .92.746 1.667 1.666 1.667h3.334c.92 0 1.666-.747 1.666-1.667v-8.333c0-.92-.746-1.667-1.666-1.667h-3.334Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M70.834 51.667V55h3.333v-3.333h-3.334ZM70.834 26.667V30h3.333v-3.333h-3.334Z" clip-rule="evenodd"/>
  </svg>
`},9083:(e,t,i)=>{"use strict";i.d(t,{Q0:()=>F,vA:()=>T});var n=i(72245),r=i(28202),s=i(3633),o=i(23080),a=i(21274),l=i(81525),c=i(33812),d=i(69855),u=i(5556),h=i(50700),p=i(12012),m=i(35500),v=i(77468),f=i(3892),g=i(56898),y=i(67311),b=i(88016),w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function S(e,t){if(1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.SpI(" ",c.i5U(2,1,"deleteSelectedItemsDesc",e.cipherIds.length+e.unassignedCiphers.length)," ")}}function I(e,t){if(1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.SpI(" ",c.i5U(2,1,"deleteSelectedCollectionsDesc",e.collections.length)," ")}}function k(e,t){if(1&e&&(c.qex(0),c.DNE(1,S,3,4,"span",2)(2,I,3,4,"span",2),c.EFF(3),c.nI1(4,"i18n"),c.bVm()),2&e){const e=c.XpG();c.R7$(),c.Y8G("ngIf",(null==e.cipherIds?null:e.cipherIds.length)||(null==e.unassignedCiphers?null:e.unassignedCiphers.length)),c.R7$(),c.Y8G("ngIf",null==e.collections?null:e.collections.length),c.R7$(),c.SpI(" ",c.bMT(4,3,"deleteSelectedConfirmation")," ")}}function C(e,t){if(1&e&&(c.qex(0),c.EFF(1),c.nI1(2,"i18n"),c.bVm()),2&e){const e=c.XpG();c.R7$(),c.SpI(" ",c.i5U(2,1,"permanentlyDeleteSelectedItemsDesc",e.cipherIds.length+e.unassignedCiphers.length)," ")}}const T={Deleted:"deleted",Canceled:"canceled"},F=(e,t)=>e.open(R,Object.assign({positionStrategy:new a.u3},t));class R{constructor(e,t,i,r,o,a,l,c){var d;this.dialogRef=t,this.cipherService=i,this.i18nService=r,this.apiService=o,this.collectionService=a,this.toastService=l,this.accountService=c,this.permanent=!1,this.submit=()=>w(this,void 0,void 0,function*(){const e=[];if(this.unassignedCiphers.length&&this.organization.canEditUnassignedCiphers&&e.push(this.deleteCiphersAdmin(this.unassignedCiphers)),this.cipherIds.length&&(this.organization&&this.organization.canEditAllCiphers?e.push(this.deleteCiphersAdmin(this.cipherIds)):e.push(this.deleteCiphers())),this.collections.length&&e.push(this.deleteCollections()),yield Promise.all(e),(this.cipherIds.length||this.unassignedCiphers.length)&&this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(this.permanent?"permanentlyDeletedItems":"deletedItems")}),this.collections.length){const e=yield(0,n._)(this.accountService.activeAccount$.pipe(s.F6));yield this.collectionService.delete(this.collections.map(e=>e.id),e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedCollections")})}this.close(T.Deleted)}),this.cipherIds=null!==(d=e.cipherIds)&&void 0!==d?d:[],this.permanent=e.permanent,this.organization=e.organization,this.organizations=e.organizations,this.collections=e.collections,this.unassignedCiphers=e.unassignedCiphers||[]}cancel(){return w(this,void 0,void 0,function*(){this.close(T.Canceled)})}deleteCiphers(){return w(this,void 0,void 0,function*(){var e;const t=null===(e=this.organization)||void 0===e?void 0:e.canEditAllCiphers,i=yield(0,n._)(this.accountService.activeAccount$.pipe(s.F6));this.permanent?yield this.cipherService.deleteManyWithServer(this.cipherIds,i,t):yield this.cipherService.softDeleteManyWithServer(this.cipherIds,i,t)})}deleteCiphersAdmin(e){return w(this,void 0,void 0,function*(){const t=new o.U(e,this.organization.id);return this.permanent?yield this.apiService.deleteManyCiphersAdmin(t):yield this.apiService.putDeleteManyCiphersAdmin(t)})}deleteCollections(){return w(this,void 0,void 0,function*(){if(this.organization)return this.collections.some(e=>!e.canDelete(this.organization))?void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("missingPermissions")}):yield this.apiService.deleteManyCollections(this.organization.id,this.collections.map(e=>e.id));if(this.organizations&&this.collections){const e=[];for(const t of this.organizations){const i=this.collections.filter(e=>e.organizationId===t.id);if(i.some(e=>!e.canDelete(t)))return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("missingPermissions")});const n=i.map(e=>e.id);e.push(this.apiService.deleteManyCollections(t.id,n))}return yield Promise.all(e)}})}close(e){this.dialogRef.close(e)}}R.ɵfac=function(e){return new(e||R)(c.rXU(l.Qs),c.rXU(a.ce),c.rXU(u.p),c.rXU(h.W),c.rXU(p.G),c.rXU(r.YD),c.rXU(d.f),c.rXU(m.Di))},R.ɵcmp=c.VBU({type:R,selectors:[["ng-component"]],standalone:!1,decls:14,vars:12,consts:[["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","danger",3,"bitAction"],["bitButton","","type","button",3,"click"]],template:function(e,t){1&e&&(c.j41(0,"bit-simple-dialog")(1,"span",0),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"span",1),c.DNE(5,k,5,5,"ng-container",2)(6,C,3,4,"ng-container",2),c.k0s(),c.qex(7,3),c.j41(8,"button",4),c.EFF(9),c.nI1(10,"i18n"),c.k0s(),c.j41(11,"button",5),c.bIt("click",function(){return t.cancel()}),c.EFF(12),c.nI1(13,"i18n"),c.k0s(),c.bVm(),c.k0s()),2&e&&(c.R7$(2),c.SpI(" ",c.bMT(3,6,t.permanent?"permanentlyDeleteSelected":"deleteSelected")," "),c.R7$(3),c.Y8G("ngIf",!t.permanent),c.R7$(),c.Y8G("ngIf",t.permanent),c.R7$(2),c.Y8G("bitAction",t.submit),c.R7$(),c.SpI(" ",c.bMT(10,8,t.permanent?"permanentlyDelete":"delete")," "),c.R7$(3),c.JRh(c.bMT(13,10,"cancel")))},dependencies:[v.bT,f.p,g.Q,y.o,b.$],encapsulation:2})},9171:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 1.49 96 94.02">
    <path class="tw-fill-illustration-bg-primary" d="M79 48.5c0 17.12-13.88 31-31 31-17.12 0-31-13.88-31-31 0-17.12 13.88-31 31-31 17.12 0 31 13.88 31 31Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48 18.5c-16.569 0-30 13.431-30 30 0 16.569 13.431 30 30 30 16.569 0 30-13.431 30-30 0-16.569-13.431-30-30-30Zm-32 30c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32-17.673 0-32-14.327-32-32Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M0 48.5c0-6.627 5.373-12 12-12h72c6.627 0 12 5.373 12 12s-5.373 12-12 12H12c-6.627 0-12-5.373-12-12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M84 38.5H12c-5.523 0-10 4.477-10 10s4.477 10 10 10h72c5.523 0 10-4.477 10-10s-4.477-10-10-10Zm-72-2c-6.627 0-12 5.373-12 12s5.373 12 12 12h72c6.627 0 12-5.373 12-12s-5.373-12-12-12H12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20 42.5c.552 0 1 .467 1 1.042v4.175l3.74-1.989c.508-.27 1.13-.094 1.39.394.259.488.057 1.102-.45 1.372l-4.038 2.147 3.228 3.462c.392.42.383 1.067-.02 1.444-.405.376-1.05.34-1.443-.08L20 50.813l-3.408 3.654c-.392.42-1.038.456-1.441.08-.404-.377-.414-1.023-.021-1.444l3.228-3.462-4.038-2.147c-.508-.27-.71-.884-.45-1.372.26-.488.881-.664 1.39-.394l3.74 1.99v-4.176c0-.575.448-1.042 1-1.042Zm16 0c.552 0 1 .467 1 1.042v4.175l3.74-1.989c.508-.27 1.13-.094 1.39.394.259.488.057 1.102-.45 1.372l-4.038 2.147 3.228 3.462c.392.42.383 1.067-.02 1.444-.405.376-1.05.34-1.443-.08L36 50.813l-3.408 3.654c-.392.42-1.038.456-1.441.08-.404-.377-.414-1.023-.021-1.444l3.228-3.462-4.038-2.147c-.508-.27-.71-.884-.45-1.372.26-.488.881-.664 1.39-.394l3.74 1.99v-4.176c0-.575.447-1.042 1-1.042Zm17 1.042c0-.575-.448-1.042-1-1.042-.553 0-1 .467-1 1.042v4.175l-3.74-1.989c-.509-.27-1.13-.094-1.39.394s-.058 1.102.45 1.372l4.038 2.147-3.228 3.462c-.393.42-.383 1.067.02 1.444.404.376 1.05.34 1.442-.08L52 50.813l3.407 3.654c.393.42 1.038.456 1.442.08.404-.377.413-1.023.02-1.444l-3.227-3.462 4.037-2.147c.508-.27.71-.884.45-1.372-.259-.488-.88-.664-1.389-.394L53 47.717v-4.175Zm8 9.958a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2h-8a1 1 0 0 1-1-1Zm13-1a1 1 0 1 0 0 2h8a1 1 0 0 0 0-2h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M58.327 92.299c11.605-2.736 21.09-9.736 27.192-18.952a1 1 0 1 1 1.667 1.104c-6.37 9.624-16.28 16.937-28.4 19.795-19.671 4.637-39.367-3.824-49.937-19.72a1 1 0 1 1 1.666-1.107c10.121 15.221 28.98 23.32 47.812 18.88Zm28.545-68.44a1 1 0 0 1-1.386-.278C75.364 8.359 56.505.26 37.674 4.7 25.348 7.607 15.413 15.322 9.385 25.394a1 1 0 1 1-1.716-1.027C13.963 13.85 24.342 5.79 37.215 2.754c19.67-4.638 39.367 3.824 49.936 19.72a1 1 0 0 1-.279 1.386Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M24 73.5a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v14a1 1 0 1 0 2 0v-13h13a1 1 0 0 0 1-1ZM72 23.5a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-14a1 1 0 1 0-2 0v13H73a1 1 0 0 0-1 1ZM22.618 64.5a29.913 29.913 0 0 1-2.122-4h55.008a29.913 29.913 0 0 1-2.122 4H22.618Z" clip-rule="evenodd"/>
  </svg>
  `},9184:(e,t,i)=>{"use strict";i.d(t,{b:()=>n});class n{constructor(e){null!=e&&(this.cardholderName=e.cardholderName,this.brand=e.brand,this.number=e.number,this.expMonth=e.expMonth,this.expYear=e.expYear,this.code=e.code)}}},9249:(e,t,i)=>{"use strict";i.d(t,{P8:()=>o,fq:()=>a.f,Cc:()=>n});class n{}var r=i(1472),s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class o extends n{constructor(e){super(),this.logService=e,this.taskHandlers=new Map}setTimeout(e,t){this.validateRegisteredTask(e);const i=globalThis.setTimeout(()=>this.triggerTask(e),t);return new r.yU(()=>globalThis.clearTimeout(i))}setInterval(e,t,i){this.validateRegisteredTask(e);const n=globalThis.setInterval(()=>this.triggerTask(e),t);return new r.yU(()=>globalThis.clearInterval(n))}registerTaskHandler(e,t){this.taskHandlers.get(e)&&(this.logService.warning(`Task handler for ${e} already exists. Overwriting.`),this.unregisterTaskHandler(e)),this.taskHandlers.set(e,t)}unregisterTaskHandler(e){this.taskHandlers.delete(e)}triggerTask(e,t){return s(this,void 0,void 0,function*(){const t=this.taskHandlers.get(e);t&&t()})}validateRegisteredTask(e){if(!this.taskHandlers.has(e))throw new Error(`Task handler for ${e} not registered. Unable to schedule task.`)}}var a=i(1580)},9413:(e,t,i)=>{"use strict";i.d(t,{S:()=>a});var n=i(59333),r=i(80755),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({providers:[n.J,r.p]})},9764:(e,t,i)=>{"use strict";i.d(t,{n:()=>o});var n=i(78781);class r{}const s=Object.freeze({padding:"0",divider:"|",hasInvalidPadding:/[^0]/});class o extends r{constructor(e){super(),this.frameSize=e}pack(e){const t=JSON.stringify(e),i=n.A.fromUtf8ToB64(t),r=JSON.stringify(this.frameSize),o=2*s.divider.length,a=i.length+r.length+o,l=this.frameSize-a%this.frameSize;return`${r}|${i}|${s.padding.repeat(l)}`}unpack(e){const t=e.indexOf(s.divider);if(t<1)throw new Error("missing frame size");const i=parseInt(e.slice(0,t),10),r=t+1;if(e.length%i>0)throw new Error("invalid length");const o=e.lastIndexOf(s.divider);if(o==t)throw new Error("missing json object");const a=o+1;if(e.slice(a).match(s.hasInvalidPadding))throw new Error("invalid padding");const l=e.slice(r,o),c=n.A.fromB64ToUtf8(l);return JSON.parse(c)}}},9997:(e,t,i)=>{"use strict";i.d(t,{C:()=>n});class n{constructor(e,t){this.type=t.getDevice(),this.name=t.getDeviceString(),this.identifier=e,this.pushToken=null}static fromJSON(e){return Object.assign(Object.create(n.prototype),e)}}},10010:(e,t,i)=>{"use strict";i.d(t,{X:()=>s});var n=i(51757),r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s{constructor(e,t,i,r,s){this.formBuilder=e,this.i18nService=t,this.platformUtilsService=i,this.toastService=r,this.tokenService=s;if(!this.platformUtilsService.isSelfHost())throw new Error("This component should only be used in self-hosted environments");this.form=this.formBuilder.group({file:[null,[n.k0.required]]}),this.submit=this.submit.bind(this)}get formValue(){return this.form.value}onLicenseFileSelectedChanged(e){const t=e.target;this.form.value.file=t.files.length>0?t.files[0]:null}submit(){return r(this,void 0,void 0,function*(){if(this.form.markAllAsTouched(),this.form.invalid)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFile")});return(yield this.tokenService.getEmailVerified())?void 0:this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("verifyEmailFirst")})})}}},10070:(e,t,i)=>{"use strict";i.d(t,{c:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.type=this.getResponseProperty("Type"))}}},10459:(e,t,i)=>{"use strict";i.d(t,{P:()=>s,k:()=>r});var n=i(22848);class r{constructor(e,t,i){this.salt=e,this.kdf=t,this.masterKeyWrappedUserKey=i}static fromSdk(e){return new r(e.salt,(0,n.E$)(e.kdf),e.masterKeyWrappedUserKey)}toJSON(){return{salt:this.salt,kdf:this.kdf,masterKeyWrappedUserKey:this.masterKeyWrappedUserKey}}static fromJSON(e){return null==e?null:new r(e.salt,e.kdf.kdfType===n.ao.PBKDF2_SHA256?n.n1.fromJSON(e.kdf):n.hU.fromJSON(e.kdf),e.masterKeyWrappedUserKey)}}function s(e){return{salt:e.salt,kdf:(0,n.E$)(e.kdf),masterPasswordAuthenticationHash:e.masterPasswordAuthenticationHash}}},10672:(e,t,i)=>{"use strict";i.d(t,{H:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-container"]],ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"tw-max-w-4xl"]],template:function(e,t){1&e&&(n.NAR(),n.rj2(0,"div",0),n.SdG(1),n.eux())},encapsulation:2})},10760:(e,t,i)=>{"use strict";i.d(t,{D$:()=>n.D$,qk:()=>n.qk});var n=i(5819)},10840:(e,t,i)=>{"use strict";i.d(t,{Y:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},11009:(e,t,i)=>{"use strict";i.d(t,{H:()=>n});class n{}},11224:(e,t,i)=>{"use strict";i.d(t,{X:()=>n});class n{}},11314:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});class n{constructor(e){null!=e&&(this.password=e.password,this.lastUsedDate=e.lastUsedDate)}}},11451:(e,t,i)=>{"use strict";i.d(t,{r:()=>o});var n=i(74208),r=i(12012),s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class o{constructor(){this.apiService=(0,n.WQX)(r.G),this.userId=null,this.profileCreatedDate=null}getProfileCreationDate(e){return s(this,void 0,void 0,function*(){if(this.profileCreatedDate&&e===this.userId)return Promise.resolve(new Date(this.profileCreatedDate));const t=yield this.fetchAndCacheProfile();return new Date(t.creationDate)})}fetchAndCacheProfile(){return s(this,void 0,void 0,function*(){const e=yield this.apiService.getProfile();return this.userId=e.id,this.profileCreatedDate=e.creationDate,e})}}o.ɵfac=function(e){return new(e||o)},o.ɵprov=n.jDH({token:o,factory:o.ɵfac,providedIn:"root"})},11573:(e,t,i)=>{"use strict";i.d(t,{sK:()=>r.s,bq:()=>n,mz:()=>s,p2:()=>o,Bx:()=>a,kG:()=>l,_n:()=>u,Oc:()=>h});var n,r=i(2738);!function(e){e[e.Android=0]="Android",e[e.iOS=1]="iOS",e[e.ChromeExtension=2]="ChromeExtension",e[e.FirefoxExtension=3]="FirefoxExtension",e[e.OperaExtension=4]="OperaExtension",e[e.EdgeExtension=5]="EdgeExtension",e[e.WindowsDesktop=6]="WindowsDesktop",e[e.MacOsDesktop=7]="MacOsDesktop",e[e.LinuxDesktop=8]="LinuxDesktop",e[e.ChromeBrowser=9]="ChromeBrowser",e[e.FirefoxBrowser=10]="FirefoxBrowser",e[e.OperaBrowser=11]="OperaBrowser",e[e.EdgeBrowser=12]="EdgeBrowser",e[e.IEBrowser=13]="IEBrowser",e[e.UnknownBrowser=14]="UnknownBrowser",e[e.AndroidAmazon=15]="AndroidAmazon",e[e.UWP=16]="UWP",e[e.SafariBrowser=17]="SafariBrowser",e[e.VivaldiBrowser=18]="VivaldiBrowser",e[e.VivaldiExtension=19]="VivaldiExtension",e[e.SafariExtension=20]="SafariExtension",e[e.SDK=21]="SDK",e[e.Server=22]="Server",e[e.WindowsCLI=23]="WindowsCLI",e[e.MacOsCLI=24]="MacOsCLI",e[e.LinuxCLI=25]="LinuxCLI",e[e.DuckDuckGoBrowser=26]="DuckDuckGoBrowser"}(n||(n={}));const s={[n.Android]:{category:"mobile",platform:"Android"},[n.iOS]:{category:"mobile",platform:"iOS"},[n.AndroidAmazon]:{category:"mobile",platform:"Amazon"},[n.ChromeExtension]:{category:"extension",platform:"Chrome"},[n.FirefoxExtension]:{category:"extension",platform:"Firefox"},[n.OperaExtension]:{category:"extension",platform:"Opera"},[n.EdgeExtension]:{category:"extension",platform:"Edge"},[n.VivaldiExtension]:{category:"extension",platform:"Vivaldi"},[n.SafariExtension]:{category:"extension",platform:"Safari"},[n.ChromeBrowser]:{category:"webApp",platform:"Chrome"},[n.FirefoxBrowser]:{category:"webApp",platform:"Firefox"},[n.OperaBrowser]:{category:"webApp",platform:"Opera"},[n.EdgeBrowser]:{category:"webApp",platform:"Edge"},[n.IEBrowser]:{category:"webApp",platform:"IE"},[n.SafariBrowser]:{category:"webApp",platform:"Safari"},[n.VivaldiBrowser]:{category:"webApp",platform:"Vivaldi"},[n.DuckDuckGoBrowser]:{category:"webApp",platform:"DuckDuckGo"},[n.UnknownBrowser]:{category:"webApp",platform:"Unknown"},[n.WindowsDesktop]:{category:"desktop",platform:"Windows"},[n.MacOsDesktop]:{category:"desktop",platform:"macOS"},[n.LinuxDesktop]:{category:"desktop",platform:"Linux"},[n.UWP]:{category:"desktop",platform:"Windows UWP"},[n.WindowsCLI]:{category:"cli",platform:"Windows"},[n.MacOsCLI]:{category:"cli",platform:"macOS"},[n.LinuxCLI]:{category:"cli",platform:"Linux"},[n.SDK]:{category:"sdk",platform:""},[n.Server]:{category:"server",platform:""}};var o,a,l,c,d,u;!function(e){e[e.SCIM=1]="SCIM",e[e.DomainVerification=2]="DomainVerification",e[e.PublicApi=3]="PublicApi"}(o||(o={})),function(e){e[e.User_LoggedIn=1e3]="User_LoggedIn",e[e.User_ChangedPassword=1001]="User_ChangedPassword",e[e.User_Updated2fa=1002]="User_Updated2fa",e[e.User_Disabled2fa=1003]="User_Disabled2fa",e[e.User_Recovered2fa=1004]="User_Recovered2fa",e[e.User_FailedLogIn=1005]="User_FailedLogIn",e[e.User_FailedLogIn2fa=1006]="User_FailedLogIn2fa",e[e.User_ClientExportedVault=1007]="User_ClientExportedVault",e[e.User_UpdatedTempPassword=1008]="User_UpdatedTempPassword",e[e.User_MigratedKeyToKeyConnector=1009]="User_MigratedKeyToKeyConnector",e[e.User_RequestedDeviceApproval=1010]="User_RequestedDeviceApproval",e[e.User_TdeOffboardingPasswordSet=1011]="User_TdeOffboardingPasswordSet",e[e.Cipher_Created=1100]="Cipher_Created",e[e.Cipher_Updated=1101]="Cipher_Updated",e[e.Cipher_Deleted=1102]="Cipher_Deleted",e[e.Cipher_AttachmentCreated=1103]="Cipher_AttachmentCreated",e[e.Cipher_AttachmentDeleted=1104]="Cipher_AttachmentDeleted",e[e.Cipher_Shared=1105]="Cipher_Shared",e[e.Cipher_UpdatedCollections=1106]="Cipher_UpdatedCollections",e[e.Cipher_ClientViewed=1107]="Cipher_ClientViewed",e[e.Cipher_ClientToggledPasswordVisible=1108]="Cipher_ClientToggledPasswordVisible",e[e.Cipher_ClientToggledHiddenFieldVisible=1109]="Cipher_ClientToggledHiddenFieldVisible",e[e.Cipher_ClientToggledCardCodeVisible=1110]="Cipher_ClientToggledCardCodeVisible",e[e.Cipher_ClientCopiedPassword=1111]="Cipher_ClientCopiedPassword",e[e.Cipher_ClientCopiedHiddenField=1112]="Cipher_ClientCopiedHiddenField",e[e.Cipher_ClientCopiedCardCode=1113]="Cipher_ClientCopiedCardCode",e[e.Cipher_ClientAutofilled=1114]="Cipher_ClientAutofilled",e[e.Cipher_SoftDeleted=1115]="Cipher_SoftDeleted",e[e.Cipher_Restored=1116]="Cipher_Restored",e[e.Cipher_ClientToggledCardNumberVisible=1117]="Cipher_ClientToggledCardNumberVisible",e[e.Cipher_ClientToggledTOTPSeedVisible=1118]="Cipher_ClientToggledTOTPSeedVisible",e[e.Collection_Created=1300]="Collection_Created",e[e.Collection_Updated=1301]="Collection_Updated",e[e.Collection_Deleted=1302]="Collection_Deleted",e[e.Group_Created=1400]="Group_Created",e[e.Group_Updated=1401]="Group_Updated",e[e.Group_Deleted=1402]="Group_Deleted",e[e.OrganizationUser_Invited=1500]="OrganizationUser_Invited",e[e.OrganizationUser_Confirmed=1501]="OrganizationUser_Confirmed",e[e.OrganizationUser_Updated=1502]="OrganizationUser_Updated",e[e.OrganizationUser_Removed=1503]="OrganizationUser_Removed",e[e.OrganizationUser_UpdatedGroups=1504]="OrganizationUser_UpdatedGroups",e[e.OrganizationUser_UnlinkedSso=1505]="OrganizationUser_UnlinkedSso",e[e.OrganizationUser_ResetPassword_Enroll=1506]="OrganizationUser_ResetPassword_Enroll",e[e.OrganizationUser_ResetPassword_Withdraw=1507]="OrganizationUser_ResetPassword_Withdraw",e[e.OrganizationUser_AdminResetPassword=1508]="OrganizationUser_AdminResetPassword",e[e.OrganizationUser_ResetSsoLink=1509]="OrganizationUser_ResetSsoLink",e[e.OrganizationUser_FirstSsoLogin=1510]="OrganizationUser_FirstSsoLogin",e[e.OrganizationUser_Revoked=1511]="OrganizationUser_Revoked",e[e.OrganizationUser_Restored=1512]="OrganizationUser_Restored",e[e.OrganizationUser_ApprovedAuthRequest=1513]="OrganizationUser_ApprovedAuthRequest",e[e.OrganizationUser_RejectedAuthRequest=1514]="OrganizationUser_RejectedAuthRequest",e[e.OrganizationUser_Deleted=1515]="OrganizationUser_Deleted",e[e.OrganizationUser_Left=1516]="OrganizationUser_Left",e[e.Organization_Updated=1600]="Organization_Updated",e[e.Organization_PurgedVault=1601]="Organization_PurgedVault",e[e.Organization_ClientExportedVault=1602]="Organization_ClientExportedVault",e[e.Organization_VaultAccessed=1603]="Organization_VaultAccessed",e[e.Organization_EnabledSso=1604]="Organization_EnabledSso",e[e.Organization_DisabledSso=1605]="Organization_DisabledSso",e[e.Organization_EnabledKeyConnector=1606]="Organization_EnabledKeyConnector",e[e.Organization_DisabledKeyConnector=1607]="Organization_DisabledKeyConnector",e[e.Organization_SponsorshipsSynced=1608]="Organization_SponsorshipsSynced",e[e.Organization_CollectionManagementUpdated=1609]="Organization_CollectionManagementUpdated",e[e.Organization_CollectionManagement_LimitCollectionCreationEnabled=1610]="Organization_CollectionManagement_LimitCollectionCreationEnabled",e[e.Organization_CollectionManagement_LimitCollectionCreationDisabled=1611]="Organization_CollectionManagement_LimitCollectionCreationDisabled",e[e.Organization_CollectionManagement_LimitCollectionDeletionEnabled=1612]="Organization_CollectionManagement_LimitCollectionDeletionEnabled",e[e.Organization_CollectionManagement_LimitCollectionDeletionDisabled=1613]="Organization_CollectionManagement_LimitCollectionDeletionDisabled",e[e.Organization_CollectionManagement_LimitItemDeletionEnabled=1614]="Organization_CollectionManagement_LimitItemDeletionEnabled",e[e.Organization_CollectionManagement_LimitItemDeletionDisabled=1615]="Organization_CollectionManagement_LimitItemDeletionDisabled",e[e.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled=1616]="Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled",e[e.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled=1617]="Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled",e[e.Policy_Updated=1700]="Policy_Updated",e[e.ProviderUser_Invited=1800]="ProviderUser_Invited",e[e.ProviderUser_Confirmed=1801]="ProviderUser_Confirmed",e[e.ProviderUser_Updated=1802]="ProviderUser_Updated",e[e.ProviderUser_Removed=1803]="ProviderUser_Removed",e[e.ProviderOrganization_Created=1900]="ProviderOrganization_Created",e[e.ProviderOrganization_Added=1901]="ProviderOrganization_Added",e[e.ProviderOrganization_Removed=1902]="ProviderOrganization_Removed",e[e.ProviderOrganization_VaultAccessed=1903]="ProviderOrganization_VaultAccessed",e[e.OrganizationDomain_Added=2e3]="OrganizationDomain_Added",e[e.OrganizationDomain_Removed=2001]="OrganizationDomain_Removed",e[e.OrganizationDomain_Verified=2002]="OrganizationDomain_Verified",e[e.OrganizationDomain_NotVerified=2003]="OrganizationDomain_NotVerified",e[e.Secret_Retrieved=2100]="Secret_Retrieved",e[e.Secret_Created=2101]="Secret_Created",e[e.Secret_Edited=2102]="Secret_Edited",e[e.Secret_Deleted=2103]="Secret_Deleted",e[e.Secret_Permanently_Deleted=2104]="Secret_Permanently_Deleted",e[e.Secret_Restored=2105]="Secret_Restored",e[e.Project_Retrieved=2200]="Project_Retrieved",e[e.Project_Created=2201]="Project_Created",e[e.Project_Edited=2202]="Project_Edited",e[e.Project_Deleted=2203]="Project_Deleted",e[e.ServiceAccount_UserAdded=2300]="ServiceAccount_UserAdded",e[e.ServiceAccount_UserRemoved=2301]="ServiceAccount_UserRemoved",e[e.ServiceAccount_GroupAdded=2302]="ServiceAccount_GroupAdded",e[e.ServiceAccount_GroupRemoved=2303]="ServiceAccount_GroupRemoved",e[e.ServiceAccount_Created=2304]="ServiceAccount_Created",e[e.ServiceAccount_Deleted=2305]="ServiceAccount_Deleted"}(a||(a={})),function(e){e[e.Continue=100]="Continue",e[e.SwitchingProtocols=101]="SwitchingProtocols",e[e.Processing=102]="Processing",e[e.Ok=200]="Ok",e[e.Created=201]="Created",e[e.Accepted=202]="Accepted",e[e.NonAuthoritativeInformation=203]="NonAuthoritativeInformation",e[e.NoContent=204]="NoContent",e[e.ResetContent=205]="ResetContent",e[e.PartialContent=206]="PartialContent",e[e.MultiStatus=207]="MultiStatus",e[e.AlreadyReported=208]="AlreadyReported",e[e.ImUsed=226]="ImUsed",e[e.MultipleChoices=300]="MultipleChoices",e[e.MovedPermanently=301]="MovedPermanently",e[e.Found=302]="Found",e[e.SeeOther=303]="SeeOther",e[e.NotModified=304]="NotModified",e[e.UseProxy=305]="UseProxy",e[e.SwitchProxy=306]="SwitchProxy",e[e.TemporaryRedirect=307]="TemporaryRedirect",e[e.PermanentRedirect=308]="PermanentRedirect",e[e.BadRequest=400]="BadRequest",e[e.Unauthorized=401]="Unauthorized",e[e.PaymentRequired=402]="PaymentRequired",e[e.Forbidden=403]="Forbidden",e[e.NotFound=404]="NotFound",e[e.MethodNotAllowed=405]="MethodNotAllowed",e[e.NotAcceptable=406]="NotAcceptable",e[e.ProxyAuthenticationRequired=407]="ProxyAuthenticationRequired",e[e.RequestTimeout=408]="RequestTimeout",e[e.Conflict=409]="Conflict",e[e.Gone=410]="Gone",e[e.LengthRequired=411]="LengthRequired",e[e.PreconditionFailed=412]="PreconditionFailed",e[e.PayloadTooLarge=413]="PayloadTooLarge",e[e.UriTooLong=414]="UriTooLong",e[e.UnsupportedMediaType=415]="UnsupportedMediaType",e[e.RangeNotSatisfiable=416]="RangeNotSatisfiable",e[e.ExpectationFailed=417]="ExpectationFailed",e[e.IAmATeapot=418]="IAmATeapot",e[e.MisdirectedRequest=421]="MisdirectedRequest",e[e.UnprocessableEntity=422]="UnprocessableEntity",e[e.Locked=423]="Locked",e[e.FailedDependency=424]="FailedDependency",e[e.UpgradeRequired=426]="UpgradeRequired",e[e.PreconditionRequired=428]="PreconditionRequired",e[e.TooManyRequests=429]="TooManyRequests",e[e.RequestHeaderFieldsTooLarge=431]="RequestHeaderFieldsTooLarge",e[e.UnavailableForLegalReasons=451]="UnavailableForLegalReasons",e[e.InternalServerError=500]="InternalServerError",e[e.NotImplemented=501]="NotImplemented",e[e.BadGateway=502]="BadGateway",e[e.ServiceUnavailable=503]="ServiceUnavailable",e[e.GatewayTimeout=504]="GatewayTimeout",e[e.HttpVersionNotSupported=505]="HttpVersionNotSupported",e[e.VariantAlsoNegotiates=506]="VariantAlsoNegotiates",e[e.InsufficientStorage=507]="InsufficientStorage",e[e.LoopDetected=508]="LoopDetected",e[e.NotExtended=510]="NotExtended",e[e.NetworkAuthenticationRequired=511]="NetworkAuthenticationRequired"}(l||(l={})),function(e){e.Integration="integration",e.SDK="sdk",e.SSO="sso",e.SCIM="scim",e.BWDC="bwdc",e.EVENT="event",e.DEVICE="device"}(c||(c={})),function(e){e[e.One=1]="One",e[e.Latest=1]="Latest"}(d||(d={})),function(e){e[e.SyncCipherUpdate=0]="SyncCipherUpdate",e[e.SyncCipherCreate=1]="SyncCipherCreate",e[e.SyncLoginDelete=2]="SyncLoginDelete",e[e.SyncFolderDelete=3]="SyncFolderDelete",e[e.SyncCiphers=4]="SyncCiphers",e[e.SyncVault=5]="SyncVault",e[e.SyncOrgKeys=6]="SyncOrgKeys",e[e.SyncFolderCreate=7]="SyncFolderCreate",e[e.SyncFolderUpdate=8]="SyncFolderUpdate",e[e.SyncCipherDelete=9]="SyncCipherDelete",e[e.SyncSettings=10]="SyncSettings",e[e.LogOut=11]="LogOut",e[e.SyncSendCreate=12]="SyncSendCreate",e[e.SyncSendUpdate=13]="SyncSendUpdate",e[e.SyncSendDelete=14]="SyncSendDelete",e[e.AuthRequest=15]="AuthRequest",e[e.AuthRequestResponse=16]="AuthRequestResponse",e[e.SyncOrganizations=17]="SyncOrganizations",e[e.SyncOrganizationStatusChanged=18]="SyncOrganizationStatusChanged",e[e.SyncOrganizationCollectionSettingChanged=19]="SyncOrganizationCollectionSettingChanged",e[e.Notification=20]="Notification",e[e.NotificationStatus=21]="NotificationStatus",e[e.RefreshSecurityTasks=22]="RefreshSecurityTasks",e[e.OrganizationBankAccountVerified=23]="OrganizationBankAccountVerified",e[e.ProviderBankAccountVerified=24]="ProviderBankAccountVerified",e[e.SyncPolicy=25]="SyncPolicy"}(u||(u={}));const h=Object.freeze({KdfChange:0})},11766:(e,t,i)=>{"use strict";i.d(t,{g:()=>s});var n=i(82781),r=i(31442);class s{constructor(e){this.type=r.PU.Text,this.newField=!1,this.showValue=!1,this.showCount=!1,e&&(this.type=e.type,this.linkedId=e.linkedId)}get maskedValue(){return null!=this.value?"••••••••":void 0}static fromJSON(e){return Object.assign(new s,e)}static fromSdkFieldView(e){if(!e)return;const t=new s;return t.name=e.name,t.value=e.value,t.type=e.type,t.linkedId=e.linkedId,t}toSdkFieldView(){var e,t,i,r;return{name:null!==(e=this.name)&&void 0!==e?e:void 0,value:null!==(t=this.value)&&void 0!==t?t:void 0,type:null!==(i=this.type)&&void 0!==i?i:n.FieldType.Text,linkedId:null!==(r=this.linkedId)&&void 0!==r?r:void 0}}}},11979:(e,t,i)=>{"use strict";i.d(t,{H:()=>h,y:()=>u});var n=i(33338),r=i(93695),s=i(3204),o=i(27442),a=i(44500),l=i(15639),c=i(3633),d=i(66523);class u{}class h{constructor(e,t,i){this.collectionService=e,this.organizationService=t,this.accountService=i,this.organization$=e=>this.accountService.activeAccount$.pipe(c.F6,(0,a.n)(e=>this.organizationService.organizations$(e)),(0,s.T)(t=>t.find(t=>t.id===e.organizationId)))}canDeleteCipher$(e,t){return this.organization$(e).pipe((0,s.T)(i=>{var n;if(t){if(!e.collectionIds||0===e.collectionIds.length)return!0===(null==i?void 0:i.canEditUnassignedCiphers);if(null==i?void 0:i.canEditAllCiphers)return!0}return!!(null===(n=e.permissions)||void 0===n?void 0:n.delete)}))}canRestoreCipher$(e,t){return this.organization$(e).pipe((0,s.T)(i=>{var n;if(t){if(!e.collectionIds||0===e.collectionIds.length)return!0===(null==i?void 0:i.canEditUnassignedCiphers);if(null==i?void 0:i.canEditAllCiphers)return!0}return!!(null===(n=e.permissions)||void 0===n?void 0:n.restore)}))}canCloneCipher$(e,t){return null==e.organizationId?(0,r.of)(!0):(0,n.z)([this.organization$(e),this.accountService.activeAccount$.pipe(c.F6)]).pipe((0,a.n)(([i,n])=>{var o;return t&&i&&(i.isAdmin||(null===(o=i.permissions)||void 0===o?void 0:o.editAnyCollection))?(0,r.of)(!0):this.collectionService.decryptedCollections$(n).pipe((0,l.S)(e.collectionIds.map(d.zw)),(0,s.T)(e=>e.some(e=>e.manage)))}),(0,o.t)({bufferSize:1,refCount:!1}))}}},12012:(e,t,i)=>{"use strict";i.d(t,{G:()=>n});class n{}},12022:(e,t,i)=>{"use strict";i.d(t,{j:()=>n});class n{constructor(e){this.password=null,this.lastUsedDate=null,e&&(this.lastUsedDate=e.lastUsedDate)}static fromJSON(e){const t=null==e.lastUsedDate?null:new Date(e.lastUsedDate);return Object.assign(new n,e,{lastUsedDate:t})}static fromSdkPasswordHistoryView(e){if(!e)return;const t=new n;return t.password=e.password,t.lastUsedDate=null==e.lastUsedDate?null:new Date(e.lastUsedDate),t}toSdkPasswordHistoryView(){var e;return{password:null!==(e=this.password)&&void 0!==e?e:"",lastUsedDate:this.lastUsedDate.toISOString()}}}},12117:(e,t,i)=>{"use strict";i.d(t,{E:()=>n});class n{constructor(e,t){this.options=e,this.token=t}}},12277:(e,t,i)=>{"use strict";i.d(t,{s:()=>r});var n=i(20702);class r extends n.r{constructor(e,t){super(e);const i=this.getResponseProperty("Data");this.data=null==i?[]:i.map(e=>new t(e)),this.continuationToken=this.getResponseProperty("ContinuationToken")}}},12694:(e,t,i)=>{"use strict";i.d(t,{H:()=>a});var n=i(94573),r=i(33277),s=i(33812);let o=0;class a{constructor(){this.id=o++,this.name=`bit-toggle-group-${this.id}`,this.fullWidth=(0,n.hFB)(void 0,{transform:n.L39}),this.selected=(0,n.geq)(),this.classlist=(0,r.EW)(()=>["tw-flex"].concat(this.fullWidth()?["tw-w-full","[&>*]:tw-flex-1"]:[]))}onInputInteraction(e){this.selected.set(e)}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.VBU({type:a,selectors:[["bit-toggle-group"]],hostAttrs:["role","radiogroup"],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.classlist())},inputs:{fullWidth:[1,"fullWidth"],selected:[1,"selected"]},outputs:{selected:"selectedChange"},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(s.NAR(),s.SdG(0))},encapsulation:2,changeDetection:0})},13299:(e,t,i)=>{"use strict";i.d(t,{If:()=>r,Sm:()=>o});class n{constructor(e){this.svg=e}}function r(e){return e instanceof n}class s extends Error{constructor(){super("Dynamic content in icons is not allowed due to risk of user-injected XSS.")}}function o(e,...t){if(t.length>0)throw new s;return new n(e[0])}},13417:(e,t,i)=>{"use strict";i.d(t,{$:()=>n});class n{}},13496:(e,t,i)=>{"use strict";i.d(t,{Z:()=>d});var n=i(60989),r=i(58716),s=i(94573),o=i(33812),a=i(78952),l=i(74208);function c(e,t){if(1&e){const e=o.RV6();o.j41(0,"div",0),o.bIt("click",function(){l.eBV(e);const t=o.XpG();return l.Njj(t.closed.emit())}),o.SdG(1),o.k0s()}if(2&e){const e=o.XpG();o.Y8G("cdkTrapFocusAutoCapture","dialog"===e.ariaRole()),o.BMQ("role",e.ariaRole())("aria-label",e.ariaLabel())}}class d{constructor(){this.templateRef=s.ebz.required(o.C4Q),this.closed=new o.bkB,this.menuItems=(0,s.tEk)(a.S,{descendants:!0}),this.ariaRole=(0,s.hFB)("menu"),this.ariaLabel=(0,s.hFB)()}ngAfterContentInit(){"menu"===this.ariaRole()&&(this.keyManager=new r.B(this.menuItems()).withWrap().skipPredicate(e=>!!e.disabled))}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=o.VBU({type:d,selectors:[["bit-menu"]],contentQueries:function(e,t,i){1&e&&o.C6U(i,t.menuItems,a.S,5),2&e&&o.NyB()},viewQuery:function(e,t){1&e&&o.wEZ(t.templateRef,o.C4Q,5),2&e&&o.NyB()},inputs:{ariaRole:[1,"ariaRole"],ariaLabel:[1,"ariaLabel"]},outputs:{closed:"closed"},exportAs:["menuComponent"],ngContentSelectors:["*"],decls:1,vars:0,consts:[["cdkTrapFocus","",1,"tw-flex","tw-shrink-0","tw-flex-col","tw-rounded-lg","tw-border","tw-border-solid","tw-border-secondary-100","tw-bg-background","tw-shadow-md","tw-bg-clip-padding","tw-py-1","tw-overflow-y-auto",3,"click","cdkTrapFocusAutoCapture"]],template:function(e,t){1&e&&(o.NAR(),o.DNE(0,c,2,3,"ng-template"))},dependencies:[n.kB],encapsulation:2})},14055:(e,t,i)=>{"use strict";i.d(t,{TU:()=>s,cD:()=>l,mv:()=>g,nS:()=>a,i5:()=>p,w$:()=>y,Lx:()=>h,qk:()=>m,x$:()=>b});var n=i(20702);class r extends n.r{constructor(e){super(e),this.code=this.getResponseProperty("Code"),this.value=this.getResponseProperty("Value")}}class s extends n.r{constructor(e){super(e),this.country=this.getResponseProperty("Country"),this.postalCode=this.getResponseProperty("PostalCode"),this.line1=this.getResponseProperty("Line1"),this.line2=this.getResponseProperty("Line2"),this.city=this.getResponseProperty("City"),this.state=this.getResponseProperty("State");const t=this.getResponseProperty("TaxId");this.taxId=t?new r(t):null}}const o={amex:"card-amex",diners:"card-diners-club",discover:"card-discover",jcb:"card-jcb",mastercard:"card-mastercard",unionpay:"card-unionpay",visa:"card-visa"},a=e=>"card"!==(null==e?void 0:e.type)?null:e.brand in o?o[e.brand]:null;class l extends n.r{constructor(e){super(e);const t=this.getResponseProperty("Type");switch(t){case"card":this.value=new d(e);break;case"bankAccount":this.value=new c(e);break;case"payPal":this.value=new u(e);break;default:throw new Error(`Cannot deserialize unsupported payment method type: ${t}`)}}}class c extends n.r{constructor(e){super(e),this.type="bankAccount",this.bankName=this.getResponseProperty("BankName"),this.last4=this.getResponseProperty("Last4"),this.hostedVerificationUrl=this.getResponseProperty("HostedVerificationUrl")}}class d extends n.r{constructor(e){super(e),this.type="card",this.brand=this.getResponseProperty("Brand"),this.last4=this.getResponseProperty("Last4"),this.expiration=this.getResponseProperty("Expiration")}}class u extends n.r{constructor(e){super(e),this.type="payPal",this.email=this.getResponseProperty("Email")}}const h=[{name:"-- Select --",value:"",disabled:!1},{name:"United States",value:"US",disabled:!1},{name:"China",value:"CN",disabled:!1},{name:"France",value:"FR",disabled:!1},{name:"Germany",value:"DE",disabled:!1},{name:"Canada",value:"CA",disabled:!1},{name:"United Kingdom",value:"GB",disabled:!1},{name:"Australia",value:"AU",disabled:!1},{name:"India",value:"IN",disabled:!1},{name:"",value:"-",disabled:!0},{name:"Afghanistan",value:"AF",disabled:!1},{name:"Åland Islands",value:"AX",disabled:!1},{name:"Albania",value:"AL",disabled:!1},{name:"Algeria",value:"DZ",disabled:!1},{name:"American Samoa",value:"AS",disabled:!1},{name:"Andorra",value:"AD",disabled:!1},{name:"Angola",value:"AO",disabled:!1},{name:"Anguilla",value:"AI",disabled:!1},{name:"Antarctica",value:"AQ",disabled:!1},{name:"Antigua and Barbuda",value:"AG",disabled:!1},{name:"Argentina",value:"AR",disabled:!1},{name:"Armenia",value:"AM",disabled:!1},{name:"Aruba",value:"AW",disabled:!1},{name:"Austria",value:"AT",disabled:!1},{name:"Azerbaijan",value:"AZ",disabled:!1},{name:"Bahamas",value:"BS",disabled:!1},{name:"Bahrain",value:"BH",disabled:!1},{name:"Bangladesh",value:"BD",disabled:!1},{name:"Barbados",value:"BB",disabled:!1},{name:"Belarus",value:"BY",disabled:!1},{name:"Belgium",value:"BE",disabled:!1},{name:"Belize",value:"BZ",disabled:!1},{name:"Benin",value:"BJ",disabled:!1},{name:"Bermuda",value:"BM",disabled:!1},{name:"Bhutan",value:"BT",disabled:!1},{name:"Bolivia, Plurinational State of",value:"BO",disabled:!1},{name:"Bonaire, Sint Eustatius and Saba",value:"BQ",disabled:!1},{name:"Bosnia and Herzegovina",value:"BA",disabled:!1},{name:"Botswana",value:"BW",disabled:!1},{name:"Bouvet Island",value:"BV",disabled:!1},{name:"Brazil",value:"BR",disabled:!1},{name:"British Indian Ocean Territory",value:"IO",disabled:!1},{name:"Brunei Darussalam",value:"BN",disabled:!1},{name:"Bulgaria",value:"BG",disabled:!1},{name:"Burkina Faso",value:"BF",disabled:!1},{name:"Burundi",value:"BI",disabled:!1},{name:"Cambodia",value:"KH",disabled:!1},{name:"Cameroon",value:"CM",disabled:!1},{name:"Cape Verde",value:"CV",disabled:!1},{name:"Cayman Islands",value:"KY",disabled:!1},{name:"Central African Republic",value:"CF",disabled:!1},{name:"Chad",value:"TD",disabled:!1},{name:"Chile",value:"CL",disabled:!1},{name:"Christmas Island",value:"CX",disabled:!1},{name:"Cocos (Keeling) Islands",value:"CC",disabled:!1},{name:"Colombia",value:"CO",disabled:!1},{name:"Comoros",value:"KM",disabled:!1},{name:"Congo",value:"CG",disabled:!1},{name:"Congo, the Democratic Republic of the",value:"CD",disabled:!1},{name:"Cook Islands",value:"CK",disabled:!1},{name:"Costa Rica",value:"CR",disabled:!1},{name:"Côte d'Ivoire",value:"CI",disabled:!1},{name:"Croatia",value:"HR",disabled:!1},{name:"Cuba",value:"CU",disabled:!1},{name:"Curaçao",value:"CW",disabled:!1},{name:"Cyprus",value:"CY",disabled:!1},{name:"Czech Republic",value:"CZ",disabled:!1},{name:"Denmark",value:"DK",disabled:!1},{name:"Djibouti",value:"DJ",disabled:!1},{name:"Dominica",value:"DM",disabled:!1},{name:"Dominican Republic",value:"DO",disabled:!1},{name:"Ecuador",value:"EC",disabled:!1},{name:"Egypt",value:"EG",disabled:!1},{name:"El Salvador",value:"SV",disabled:!1},{name:"Equatorial Guinea",value:"GQ",disabled:!1},{name:"Eritrea",value:"ER",disabled:!1},{name:"Estonia",value:"EE",disabled:!1},{name:"Ethiopia",value:"ET",disabled:!1},{name:"Falkland Islands (Malvinas)",value:"FK",disabled:!1},{name:"Faroe Islands",value:"FO",disabled:!1},{name:"Fiji",value:"FJ",disabled:!1},{name:"Finland",value:"FI",disabled:!1},{name:"French Guiana",value:"GF",disabled:!1},{name:"French Polynesia",value:"PF",disabled:!1},{name:"French Southern Territories",value:"TF",disabled:!1},{name:"Gabon",value:"GA",disabled:!1},{name:"Gambia",value:"GM",disabled:!1},{name:"Georgia",value:"GE",disabled:!1},{name:"Ghana",value:"GH",disabled:!1},{name:"Gibraltar",value:"GI",disabled:!1},{name:"Greece",value:"GR",disabled:!1},{name:"Greenland",value:"GL",disabled:!1},{name:"Grenada",value:"GD",disabled:!1},{name:"Guadeloupe",value:"GP",disabled:!1},{name:"Guam",value:"GU",disabled:!1},{name:"Guatemala",value:"GT",disabled:!1},{name:"Guernsey",value:"GG",disabled:!1},{name:"Guinea",value:"GN",disabled:!1},{name:"Guinea-Bissau",value:"GW",disabled:!1},{name:"Guyana",value:"GY",disabled:!1},{name:"Haiti",value:"HT",disabled:!1},{name:"Heard Island and McDonald Islands",value:"HM",disabled:!1},{name:"Holy See (Vatican City State)",value:"VA",disabled:!1},{name:"Honduras",value:"HN",disabled:!1},{name:"Hong Kong",value:"HK",disabled:!1},{name:"Hungary",value:"HU",disabled:!1},{name:"Iceland",value:"IS",disabled:!1},{name:"Indonesia",value:"ID",disabled:!1},{name:"Iran, Islamic Republic of",value:"IR",disabled:!1},{name:"Iraq",value:"IQ",disabled:!1},{name:"Ireland",value:"IE",disabled:!1},{name:"Isle of Man",value:"IM",disabled:!1},{name:"Israel",value:"IL",disabled:!1},{name:"Italy",value:"IT",disabled:!1},{name:"Jamaica",value:"JM",disabled:!1},{name:"Japan",value:"JP",disabled:!1},{name:"Jersey",value:"JE",disabled:!1},{name:"Jordan",value:"JO",disabled:!1},{name:"Kazakhstan",value:"KZ",disabled:!1},{name:"Kenya",value:"KE",disabled:!1},{name:"Kiribati",value:"KI",disabled:!1},{name:"Korea, Democratic People's Republic of",value:"KP",disabled:!1},{name:"Korea, Republic of",value:"KR",disabled:!1},{name:"Kuwait",value:"KW",disabled:!1},{name:"Kyrgyzstan",value:"KG",disabled:!1},{name:"Lao People's Democratic Republic",value:"LA",disabled:!1},{name:"Latvia",value:"LV",disabled:!1},{name:"Lebanon",value:"LB",disabled:!1},{name:"Lesotho",value:"LS",disabled:!1},{name:"Liberia",value:"LR",disabled:!1},{name:"Libya",value:"LY",disabled:!1},{name:"Liechtenstein",value:"LI",disabled:!1},{name:"Lithuania",value:"LT",disabled:!1},{name:"Luxembourg",value:"LU",disabled:!1},{name:"Macao",value:"MO",disabled:!1},{name:"Macedonia, the former Yugoslav Republic of",value:"MK",disabled:!1},{name:"Madagascar",value:"MG",disabled:!1},{name:"Malawi",value:"MW",disabled:!1},{name:"Malaysia",value:"MY",disabled:!1},{name:"Maldives",value:"MV",disabled:!1},{name:"Mali",value:"ML",disabled:!1},{name:"Malta",value:"MT",disabled:!1},{name:"Marshall Islands",value:"MH",disabled:!1},{name:"Martinique",value:"MQ",disabled:!1},{name:"Mauritania",value:"MR",disabled:!1},{name:"Mauritius",value:"MU",disabled:!1},{name:"Mayotte",value:"YT",disabled:!1},{name:"Mexico",value:"MX",disabled:!1},{name:"Micronesia, Federated States of",value:"FM",disabled:!1},{name:"Moldova, Republic of",value:"MD",disabled:!1},{name:"Monaco",value:"MC",disabled:!1},{name:"Mongolia",value:"MN",disabled:!1},{name:"Montenegro",value:"ME",disabled:!1},{name:"Montserrat",value:"MS",disabled:!1},{name:"Morocco",value:"MA",disabled:!1},{name:"Mozambique",value:"MZ",disabled:!1},{name:"Myanmar",value:"MM",disabled:!1},{name:"Namibia",value:"NA",disabled:!1},{name:"Nauru",value:"NR",disabled:!1},{name:"Nepal",value:"NP",disabled:!1},{name:"Netherlands",value:"NL",disabled:!1},{name:"New Caledonia",value:"NC",disabled:!1},{name:"New Zealand",value:"NZ",disabled:!1},{name:"Nicaragua",value:"NI",disabled:!1},{name:"Niger",value:"NE",disabled:!1},{name:"Nigeria",value:"NG",disabled:!1},{name:"Niue",value:"NU",disabled:!1},{name:"Norfolk Island",value:"NF",disabled:!1},{name:"Northern Mariana Islands",value:"MP",disabled:!1},{name:"Norway",value:"NO",disabled:!1},{name:"Oman",value:"OM",disabled:!1},{name:"Pakistan",value:"PK",disabled:!1},{name:"Palau",value:"PW",disabled:!1},{name:"Palestinian Territory, Occupied",value:"PS",disabled:!1},{name:"Panama",value:"PA",disabled:!1},{name:"Papua New Guinea",value:"PG",disabled:!1},{name:"Paraguay",value:"PY",disabled:!1},{name:"Peru",value:"PE",disabled:!1},{name:"Philippines",value:"PH",disabled:!1},{name:"Pitcairn",value:"PN",disabled:!1},{name:"Poland",value:"PL",disabled:!1},{name:"Portugal",value:"PT",disabled:!1},{name:"Puerto Rico",value:"PR",disabled:!1},{name:"Qatar",value:"QA",disabled:!1},{name:"Réunion",value:"RE",disabled:!1},{name:"Romania",value:"RO",disabled:!1},{name:"Russian Federation",value:"RU",disabled:!1},{name:"Rwanda",value:"RW",disabled:!1},{name:"Saint Barthélemy",value:"BL",disabled:!1},{name:"Saint Helena, Ascension and Tristan da Cunha",value:"SH",disabled:!1},{name:"Saint Kitts and Nevis",value:"KN",disabled:!1},{name:"Saint Lucia",value:"LC",disabled:!1},{name:"Saint Martin (French part)",value:"MF",disabled:!1},{name:"Saint Pierre and Miquelon",value:"PM",disabled:!1},{name:"Saint Vincent and the Grenadines",value:"VC",disabled:!1},{name:"Samoa",value:"WS",disabled:!1},{name:"San Marino",value:"SM",disabled:!1},{name:"Sao Tome and Principe",value:"ST",disabled:!1},{name:"Saudi Arabia",value:"SA",disabled:!1},{name:"Senegal",value:"SN",disabled:!1},{name:"Serbia",value:"RS",disabled:!1},{name:"Seychelles",value:"SC",disabled:!1},{name:"Sierra Leone",value:"SL",disabled:!1},{name:"Singapore",value:"SG",disabled:!1},{name:"Sint Maarten (Dutch part)",value:"SX",disabled:!1},{name:"Slovakia",value:"SK",disabled:!1},{name:"Slovenia",value:"SI",disabled:!1},{name:"Solomon Islands",value:"SB",disabled:!1},{name:"Somalia",value:"SO",disabled:!1},{name:"South Africa",value:"ZA",disabled:!1},{name:"South Georgia and the South Sandwich Islands",value:"GS",disabled:!1},{name:"South Sudan",value:"SS",disabled:!1},{name:"Spain",value:"ES",disabled:!1},{name:"Sri Lanka",value:"LK",disabled:!1},{name:"Sudan",value:"SD",disabled:!1},{name:"Suriname",value:"SR",disabled:!1},{name:"Svalbard and Jan Mayen",value:"SJ",disabled:!1},{name:"Swaziland",value:"SZ",disabled:!1},{name:"Sweden",value:"SE",disabled:!1},{name:"Switzerland",value:"CH",disabled:!1},{name:"Syrian Arab Republic",value:"SY",disabled:!1},{name:"Taiwan",value:"TW",disabled:!1},{name:"Tajikistan",value:"TJ",disabled:!1},{name:"Tanzania, United Republic of",value:"TZ",disabled:!1},{name:"Thailand",value:"TH",disabled:!1},{name:"Timor-Leste",value:"TL",disabled:!1},{name:"Togo",value:"TG",disabled:!1},{name:"Tokelau",value:"TK",disabled:!1},{name:"Tonga",value:"TO",disabled:!1},{name:"Trinidad and Tobago",value:"TT",disabled:!1},{name:"Tunisia",value:"TN",disabled:!1},{name:"Turkey",value:"TR",disabled:!1},{name:"Turkmenistan",value:"TM",disabled:!1},{name:"Turks and Caicos Islands",value:"TC",disabled:!1},{name:"Tuvalu",value:"TV",disabled:!1},{name:"Uganda",value:"UG",disabled:!1},{name:"Ukraine",value:"UA",disabled:!1},{name:"United Arab Emirates",value:"AE",disabled:!1},{name:"United States Minor Outlying Islands",value:"UM",disabled:!1},{name:"Uruguay",value:"UY",disabled:!1},{name:"Uzbekistan",value:"UZ",disabled:!1},{name:"Vanuatu",value:"VU",disabled:!1},{name:"Venezuela, Bolivarian Republic of",value:"VE",disabled:!1},{name:"Viet Nam",value:"VN",disabled:!1},{name:"Virgin Islands, British",value:"VG",disabled:!1},{name:"Virgin Islands, U.S.",value:"VI",disabled:!1},{name:"Wallis and Futuna",value:"WF",disabled:!1},{name:"Western Sahara",value:"EH",disabled:!1},{name:"Yemen",value:"YE",disabled:!1},{name:"Zambia",value:"ZM",disabled:!1},{name:"Zimbabwe",value:"ZW",disabled:!1}],p=e=>{const t=m.filter(t=>t.iso===e);if(0===t.length)return null;if(1===t.length)return t[0];{const e=t.find(e=>e.impactsTaxCalculation);return e||t[0]}},m=[{country:"Albania",iso:"AL",code:"al_tin",description:"Albania Tax Identification Number",example:"J12345678N",impactsTaxCalculation:!0},{country:"Andorra",iso:"AD",code:"ad_nrt",description:"Andorran NRT number",example:"A-123456-Z",impactsTaxCalculation:!1},{country:"Angola",iso:"AO",code:"ao_tin",description:"Angola Tax Identification Number",example:"5123456789",impactsTaxCalculation:!1},{country:"Argentina",iso:"AR",code:"ar_cuit",description:"Argentinian tax ID number",example:"12-3456789-01",impactsTaxCalculation:!1},{country:"Armenia",iso:"AM",code:"am_tin",description:"Armenia Tax Identification Number",example:"2538904",impactsTaxCalculation:!0},{country:"Aruba",iso:"AW",code:"aw_tin",description:"Aruba Tax Identification Number",example:"12345678",impactsTaxCalculation:!0},{country:"Australia",iso:"AU",code:"au_abn",description:"Australian Business Number (AU ABN)",example:"12345678912",impactsTaxCalculation:!0},{country:"Australia",iso:"AU",code:"au_arn",description:"Australian Taxation Office Reference Number",example:"123456789123",impactsTaxCalculation:!1},{country:"Austria",iso:"AT",code:"eu_vat",description:"European VAT number",example:"ATU12345678",impactsTaxCalculation:!0},{country:"Azerbaijan",iso:"AZ",code:"az_tin",description:"Azerbaijan Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"Bahamas",iso:"BS",code:"bs_tin",description:"Bahamas Tax Identification Number",example:"123.456.789",impactsTaxCalculation:!1},{country:"Bahrain",iso:"BH",code:"bh_vat",description:"Bahraini VAT Number",example:"123456789012345",impactsTaxCalculation:!0},{country:"Bangladesh",iso:"BD",code:"bd_bin",description:"Bangladesh Business Identification Number",example:"123456789-0123",impactsTaxCalculation:!0},{country:"Barbados",iso:"BB",code:"bb_tin",description:"Barbados Tax Identification Number",example:"1123456789012",impactsTaxCalculation:!1},{country:"Belarus",iso:"BY",code:"by_tin",description:"Belarus TIN Number",example:"123456789",impactsTaxCalculation:!0},{country:"Belgium",iso:"BE",code:"eu_vat",description:"European VAT number",example:"BE0123456789",impactsTaxCalculation:!0},{country:"Benin",iso:"BJ",code:"bj_ifu",description:"Benin Tax Identification Number (Identifiant Fiscal Unique)",example:"1234567890123",impactsTaxCalculation:!0},{country:"Bolivia",iso:"BO",code:"bo_tin",description:"Bolivian tax ID",example:"123456789",impactsTaxCalculation:!1},{country:"Bosnia & Herzegovina",iso:"BA",code:"ba_tin",description:"Bosnia and Herzegovina Tax Identification Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Brazil",iso:"BR",code:"br_cnpj",description:"Brazilian CNPJ number",example:"01.234.456/5432-10",impactsTaxCalculation:!1},{country:"Brazil",iso:"BR",code:"br_cpf",description:"Brazilian CPF number",example:"123.456.789-87",impactsTaxCalculation:!1},{country:"Bulgaria",iso:"BG",code:"bg_uic",description:"Bulgaria Unified Identification Code",example:"123456789",impactsTaxCalculation:!1},{country:"Bulgaria",iso:"BG",code:"eu_vat",description:"European VAT number",example:"BG0123456789",impactsTaxCalculation:!0},{country:"Burkina Faso",iso:"BF",code:"bf_ifu",description:"Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique)",example:"12345678A",impactsTaxCalculation:!0},{country:"Cambodia",iso:"KH",code:"kh_tin",description:"Cambodia Tax Identification Number",example:"1001-123456789",impactsTaxCalculation:!0},{country:"Cameroon",iso:"CM",code:"cm_niu",description:"Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique)",example:"M123456789000L",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_bn",description:"Canadian BN",example:"123456789",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_gst_hst",description:"Canadian GST/HST number",example:"123456789RT0002",impactsTaxCalculation:!0},{country:"Canada",iso:"CA",code:"ca_pst_bc",description:"Canadian PST number (British Columbia)",example:"PST-1234-5678",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_pst_mb",description:"Canadian PST number (Manitoba)",example:"123456-7",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_pst_sk",description:"Canadian PST number (Saskatchewan)",example:"1234567",impactsTaxCalculation:!1},{country:"Canada",iso:"CA",code:"ca_qst",description:"Canadian QST number (Québec)",example:"1234567890TQ1234",impactsTaxCalculation:!0},{country:"Cape Verde",iso:"CV",code:"cv_nif",description:"Cape Verde Tax Identification Number (Número de Identificação Fiscal)",example:"213456789",impactsTaxCalculation:!1},{country:"Chile",iso:"CL",code:"cl_tin",description:"Chilean TIN",example:"12.345.678-K",impactsTaxCalculation:!0},{country:"China",iso:"CN",code:"cn_tin",description:"Chinese tax ID",example:"123456789012345678",impactsTaxCalculation:!1},{country:"Colombia",iso:"CO",code:"co_nit",description:"Colombian NIT number",example:"123.456.789-0",impactsTaxCalculation:!1},{country:"Congo - Kinshasa",iso:"CD",code:"cd_nif",description:"Congo (DR) Tax Identification Number (Número de Identificação Fiscal)",example:"A0123456M",impactsTaxCalculation:!1},{country:"Costa Rica",iso:"CR",code:"cr_tin",description:"Costa Rican tax ID",example:"1-234-567890",impactsTaxCalculation:!1},{country:"Croatia",iso:"HR",code:"eu_vat",description:"European VAT number",example:"HR12345678912",impactsTaxCalculation:!0},{country:"Croatia",iso:"HR",code:"hr_oib",description:"Croatian Personal Identification Number",example:"12345678901",impactsTaxCalculation:!1},{country:"Cyprus",iso:"CY",code:"eu_vat",description:"European VAT number",example:"CY12345678Z",impactsTaxCalculation:!0},{country:"Czech Republic",iso:"CZ",code:"eu_vat",description:"European VAT number",example:"CZ1234567890",impactsTaxCalculation:!0},{country:"Denmark",iso:"DK",code:"eu_vat",description:"European VAT number",example:"DK12345678",impactsTaxCalculation:!0},{country:"Dominican Republic",iso:"DO",code:"do_rcn",description:"Dominican RCN number",example:"123-4567890-1",impactsTaxCalculation:!1},{country:"Ecuador",iso:"EC",code:"ec_ruc",description:"Ecuadorian RUC number",example:"1234567890001",impactsTaxCalculation:!1},{country:"Egypt",iso:"EG",code:"eg_tin",description:"Egyptian Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"El Salvador",iso:"SV",code:"sv_nit",description:"El Salvadorian NIT number",example:"1234-567890-123-4",impactsTaxCalculation:!1},{country:"Estonia",iso:"EE",code:"eu_vat",description:"European VAT number",example:"EE123456789",impactsTaxCalculation:!0},{country:"Ethiopia",iso:"ET",code:"et_tin",description:"Ethiopia Tax Identification Number",example:"1234567890",impactsTaxCalculation:!0},{country:"EU",iso:"EU",code:"eu_oss_vat",description:"European One Stop Shop VAT number for non-Union scheme",example:"EU123456789",impactsTaxCalculation:!1},{country:"Finland",iso:"FI",code:"eu_vat",description:"European VAT number",example:"FI12345678",impactsTaxCalculation:!0},{country:"France",iso:"FR",code:"eu_vat",description:"European VAT number",example:"FRAB123456789",impactsTaxCalculation:!0},{country:"Georgia",iso:"GE",code:"ge_vat",description:"Georgian VAT",example:"123456789",impactsTaxCalculation:!0},{country:"Germany",iso:"DE",code:"de_stn",description:"German Tax Number (Steuernummer)",example:"1234567890",impactsTaxCalculation:!1},{country:"Germany",iso:"DE",code:"eu_vat",description:"European VAT number",example:"DE123456789",impactsTaxCalculation:!0},{country:"Greece",iso:"GR",code:"eu_vat",description:"European VAT number",example:"EL123456789",impactsTaxCalculation:!0},{country:"Guinea",iso:"GN",code:"gn_nif",description:"Guinea Tax Identification Number (Número de Identificação Fiscal)",example:"123456789",impactsTaxCalculation:!0},{country:"Hong Kong",iso:"HK",code:"hk_br",description:"Hong Kong BR number",example:"12345678",impactsTaxCalculation:!1},{country:"Hungary",iso:"HU",code:"eu_vat",description:"European VAT number",example:"HU12345678",impactsTaxCalculation:!0},{country:"Hungary",iso:"HU",code:"hu_tin",description:"Hungary tax number (adószám)",example:"12345678-1-23",impactsTaxCalculation:!1},{country:"Iceland",iso:"IS",code:"is_vat",description:"Icelandic VAT",example:"123456",impactsTaxCalculation:!0},{country:"India",iso:"IN",code:"in_gst",description:"Indian GST number",example:"12ABCDE3456FGZH",impactsTaxCalculation:!0},{country:"Indonesia",iso:"ID",code:"id_npwp",description:"Indonesian NPWP number",example:"012.345.678.9-012.345",impactsTaxCalculation:!1},{country:"Ireland",iso:"IE",code:"eu_vat",description:"European VAT number",example:"IE1234567AB",impactsTaxCalculation:!0},{country:"Israel",iso:"IL",code:"il_vat",description:"Israel VAT",example:"12345",impactsTaxCalculation:!1},{country:"Italy",iso:"IT",code:"eu_vat",description:"European VAT number",example:"IT12345678912",impactsTaxCalculation:!0},{country:"Japan",iso:"JP",code:"jp_cn",description:"Japanese Corporate Number (*Hōjin Bangō*)",example:"1234567891234",impactsTaxCalculation:!1},{country:"Japan",iso:"JP",code:"jp_rn",description:"Japanese Registered Foreign Businesses' Registration Number (*Tōroku Kokugai Jigyōsha no Tōroku Bangō*)",example:"12345",impactsTaxCalculation:!1},{country:"Japan",iso:"JP",code:"jp_trn",description:"Japanese Tax Registration Number (*Tōroku Bangō*)",example:"T1234567891234",impactsTaxCalculation:!0},{country:"Kazakhstan",iso:"KZ",code:"kz_bin",description:"Kazakhstani Business Identification Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Kenya",iso:"KE",code:"ke_pin",description:"Kenya Revenue Authority Personal Identification Number",example:"P000111111A",impactsTaxCalculation:!1},{country:"Kyrgyzstan",iso:"KG",code:"kg_tin",description:"Kyrgyzstan Tax Identification Number",example:"12345678901234",impactsTaxCalculation:!1},{country:"Laos",iso:"LA",code:"la_tin",description:"Laos Tax Identification Number",example:"123456789-000",impactsTaxCalculation:!1},{country:"Latvia",iso:"LV",code:"eu_vat",description:"European VAT number",example:"LV12345678912",impactsTaxCalculation:!0},{country:"Liechtenstein",iso:"LI",code:"li_uid",description:"Liechtensteinian UID number",example:"CHE123456789",impactsTaxCalculation:!1},{country:"Liechtenstein",iso:"LI",code:"li_vat",description:"Liechtensteinian VAT number",example:"12345",impactsTaxCalculation:!0},{country:"Lithuania",iso:"LT",code:"eu_vat",description:"European VAT number",example:"LT123456789123",impactsTaxCalculation:!0},{country:"Luxembourg",iso:"LU",code:"eu_vat",description:"European VAT number",example:"LU12345678",impactsTaxCalculation:!0},{country:"Malaysia",iso:"MY",code:"my_frp",description:"Malaysian FRP number",example:"12345678",impactsTaxCalculation:!1},{country:"Malaysia",iso:"MY",code:"my_itn",description:"Malaysian ITN",example:"C 1234567890",impactsTaxCalculation:!1},{country:"Malaysia",iso:"MY",code:"my_sst",description:"Malaysian SST number",example:"A12-3456-78912345",impactsTaxCalculation:!1},{country:"Malta",iso:"MT",code:"eu_vat",description:"European VAT number",example:"MT12345678",impactsTaxCalculation:!0},{country:"Mauritania",iso:"MR",code:"mr_nif",description:"Mauritania Tax Identification Number (Número de Identificação Fiscal)",example:"12345678",impactsTaxCalculation:!1},{country:"Mexico",iso:"MX",code:"mx_rfc",description:"Mexican RFC number",example:"ABC010203AB9",impactsTaxCalculation:!1},{country:"Moldova",iso:"MD",code:"md_vat",description:"Moldova VAT Number",example:"1234567",impactsTaxCalculation:!0},{country:"Montenegro",iso:"ME",code:"me_pib",description:"Montenegro PIB Number",example:"12345678",impactsTaxCalculation:!1},{country:"Morocco",iso:"MA",code:"ma_vat",description:"Morocco VAT Number",example:"12345678",impactsTaxCalculation:!0},{country:"Nepal",iso:"NP",code:"np_pan",description:"Nepal PAN Number",example:"123456789",impactsTaxCalculation:!0},{country:"Netherlands",iso:"NL",code:"eu_vat",description:"European VAT number",example:"NL123456789B12",impactsTaxCalculation:!0},{country:"New Zealand",iso:"NZ",code:"nz_gst",description:"New Zealand GST number",example:"123456789",impactsTaxCalculation:!0},{country:"Nigeria",iso:"NG",code:"ng_tin",description:"Nigerian Tax Identification Number",example:"12345678-0001",impactsTaxCalculation:!1},{country:"North Macedonia",iso:"MK",code:"mk_vat",description:"North Macedonia VAT Number",example:"MK1234567890123",impactsTaxCalculation:!0},{country:"Norway",iso:"NO",code:"no_vat",description:"Norwegian VAT number",example:"123456789MVA",impactsTaxCalculation:!0},{country:"Norway",iso:"NO",code:"no_voec",description:"Norwegian VAT on e-commerce number",example:"1234567",impactsTaxCalculation:!1},{country:"Oman",iso:"OM",code:"om_vat",description:"Omani VAT Number",example:"OM1234567890",impactsTaxCalculation:!0},{country:"Peru",iso:"PE",code:"pe_ruc",description:"Peruvian RUC number",example:"12345678901",impactsTaxCalculation:!0},{country:"Philippines",iso:"PH",code:"ph_tin",description:"Philippines Tax Identification Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Poland",iso:"PL",code:"eu_vat",description:"European VAT number",example:"PL1234567890",impactsTaxCalculation:!0},{country:"Portugal",iso:"PT",code:"eu_vat",description:"European VAT number",example:"PT123456789",impactsTaxCalculation:!0},{country:"Romania",iso:"RO",code:"eu_vat",description:"European VAT number",example:"RO1234567891",impactsTaxCalculation:!0},{country:"Romania",iso:"RO",code:"ro_tin",description:"Romanian tax ID number",example:"1234567890123",impactsTaxCalculation:!1},{country:"Russia",iso:"RU",code:"ru_inn",description:"Russian INN",example:"1234567891",impactsTaxCalculation:!0},{country:"Russia",iso:"RU",code:"ru_kpp",description:"Russian KPP",example:"123456789",impactsTaxCalculation:!0},{country:"Saudi Arabia",iso:"SA",code:"sa_vat",description:"Saudi Arabia VAT",example:"123456789012345",impactsTaxCalculation:!0},{country:"Senegal",iso:"SN",code:"sn_ninea",description:"Senegal NINEA Number",example:"12345672A2",impactsTaxCalculation:!1},{country:"Serbia",iso:"RS",code:"rs_pib",description:"Serbian PIB number",example:"123456789",impactsTaxCalculation:!1},{country:"Singapore",iso:"SG",code:"sg_gst",description:"Singaporean GST",example:"M12345678X",impactsTaxCalculation:!0},{country:"Singapore",iso:"SG",code:"sg_uen",description:"Singaporean UEN",example:"123456789F",impactsTaxCalculation:!1},{country:"Slovakia",iso:"SK",code:"eu_vat",description:"European VAT number",example:"SK1234567891",impactsTaxCalculation:!0},{country:"Slovenia",iso:"SI",code:"eu_vat",description:"European VAT number",example:"SI12345678",impactsTaxCalculation:!0},{country:"Slovenia",iso:"SI",code:"si_tin",description:"Slovenia tax number (davčna številka)",example:"12345678",impactsTaxCalculation:!1},{country:"South Africa",iso:"ZA",code:"za_vat",description:"South African VAT number",example:"4123456789",impactsTaxCalculation:!0},{country:"South Korea",iso:"KR",code:"kr_brn",description:"Korean BRN",example:"123-45-67890",impactsTaxCalculation:!0},{country:"Spain",iso:"ES",code:"es_cif",description:"Spanish NIF number (previously Spanish CIF number)",example:"A12345678",impactsTaxCalculation:!1},{country:"Spain",iso:"ES",code:"eu_vat",description:"European VAT number",example:"ESA1234567Z",impactsTaxCalculation:!0},{country:"Suriname",iso:"SR",code:"sr_fin",description:"Suriname FIN Number",example:"1234567890",impactsTaxCalculation:!0},{country:"Sweden",iso:"SE",code:"eu_vat",description:"European VAT number",example:"SE123456789123",impactsTaxCalculation:!0},{country:"Switzerland",iso:"CH",code:"ch_uid",description:"Switzerland UID number",example:"CHE-123.456.789 HR",impactsTaxCalculation:!1},{country:"Switzerland",iso:"CH",code:"ch_vat",description:"Switzerland VAT number",example:"CHE-123.456.789 MWST",impactsTaxCalculation:!0},{country:"Taiwan",iso:"TW",code:"tw_vat",description:"Taiwanese VAT",example:"12345678",impactsTaxCalculation:!0},{country:"Tajikistan",iso:"TJ",code:"tj_tin",description:"Tajikistan Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"Tanzania",iso:"TZ",code:"tz_vat",description:"Tanzania VAT Number",example:"12345678A",impactsTaxCalculation:!0},{country:"Thailand",iso:"TH",code:"th_vat",description:"Thai VAT",example:"1234567891234",impactsTaxCalculation:!0},{country:"Turkey",iso:"TR",code:"tr_tin",description:"Turkish Tax Identification Number",example:"123456789",impactsTaxCalculation:!0},{country:"Uganda",iso:"UG",code:"ug_tin",description:"Uganda Tax Identification Number",example:"1014751879",impactsTaxCalculation:!0},{country:"Ukraine",iso:"UA",code:"ua_vat",description:"Ukrainian VAT",example:"123456789",impactsTaxCalculation:!0},{country:"United Arab Emirates",iso:"AE",code:"ae_trn",description:"United Arab Emirates TRN",example:"123456789012345",impactsTaxCalculation:!0},{country:"United Kingdom",iso:"GB",code:"eu_vat",description:"Northern Ireland VAT number",example:"XI123456789",impactsTaxCalculation:!0},{country:"United Kingdom",iso:"GB",code:"gb_vat",description:"United Kingdom VAT number",example:"GB123456789",impactsTaxCalculation:!0},{country:"United States",iso:"US",code:"us_ein",description:"United States EIN",example:"12-3456789",impactsTaxCalculation:!1},{country:"Uruguay",iso:"UY",code:"uy_ruc",description:"Uruguayan RUC number",example:"123456789012",impactsTaxCalculation:!0},{country:"Uzbekistan",iso:"UZ",code:"uz_tin",description:"Uzbekistan TIN Number",example:"123456789",impactsTaxCalculation:!1},{country:"Uzbekistan",iso:"UZ",code:"uz_vat",description:"Uzbekistan VAT Number",example:"123456789012",impactsTaxCalculation:!0},{country:"Venezuela",iso:"VE",code:"ve_rif",description:"Venezuelan RIF number",example:"A-12345678-9",impactsTaxCalculation:!1},{country:"Vietnam",iso:"VN",code:"vn_tin",description:"Vietnamese tax ID number",example:"1234567890",impactsTaxCalculation:!1},{country:"Zambia",iso:"ZM",code:"zm_tin",description:"Zambia Tax Identification Number",example:"1004751879",impactsTaxCalculation:!1},{country:"Zimbabwe",iso:"ZW",code:"zw_tin",description:"Zimbabwe Tax Identification Number",example:"1234567890",impactsTaxCalculation:!1}];var v=i(88083);const f={bankAccount:"bankAccount",card:"card",payPal:"payPal"},g={accountCredit:"accountCredit"},y=e=>Object.values(f).includes(e),b=e=>{switch(e){case"bankAccount":return v.eq.BankAccount;case"card":return v.eq.Card;case"payPal":return v.eq.PayPal}}},14092:(e,t,i)=>{"use strict";i.d(t,{t:()=>o});var n=i(62963),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.G]})},14093:(e,t,i)=>{"use strict";i.d(t,{r:()=>u});var n=i(78781),r=i(31442),s=i(69473),o=i(65918),a=i(8583),l=i(16671),c=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},d=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class u extends a.n{constructor(e){super(),this.uris=[],this.fido2Credentials=[],e&&(this.passwordRevisionDate=e.passwordRevisionDate,this.autofillOnPageLoad=e.autofillOnPageLoad)}get uri(){return this.hasUris?this.uris[0].uri:void 0}get maskedPassword(){return null!=this.password?"••••••••":void 0}get subTitle(){var e;return n.A.isNullOrEmpty(this.username)&&(null===(e=this.fido2Credentials)||void 0===e?void 0:e.length)>0?this.fido2Credentials[0].userName:this.username}get canLaunch(){return this.hasUris&&this.uris.some(e=>e.canLaunch)}get hasTotp(){return!n.A.isNullOrWhitespace(this.totp)}get launchUri(){if(this.hasUris){const e=this.uris.find(e=>e.canLaunch);if(null!=e)return e.launchUri}}get hasUris(){return null!=this.uris&&this.uris.length>0}get hasFido2Credentials(){return null!=this.fido2Credentials&&this.fido2Credentials.length>0}matchesUri(e,t,i,n){return null!=this.uris&&this.uris.some(r=>r.matchesUri(e,t,i,n))}static fromJSON(e){var t,i,n,r;if(null==e)return new u;const s=Object.assign(new u,e);return s.passwordRevisionDate=null==e.passwordRevisionDate?void 0:new Date(e.passwordRevisionDate),s.uris=null!==(i=null===(t=e.uris)||void 0===t?void 0:t.map(e=>l.z.fromJSON(e)))&&void 0!==i?i:[],s.fido2Credentials=null!==(r=null===(n=e.fido2Credentials)||void 0===n?void 0:n.map(e=>o.X.fromJSON(e)))&&void 0!==r?r:[],s}static fromSdkLoginView(e){var t;const i=new u;return i.username=e.username,i.password=e.password,i.passwordRevisionDate=null==e.passwordRevisionDate?void 0:new Date(e.passwordRevisionDate),i.totp=e.totp,i.autofillOnPageLoad=e.autofillOnPageLoad,i.uris=(null===(t=e.uris)||void 0===t?void 0:t.filter(e=>null!=e.uri&&""!==e.uri).map(e=>l.z.fromSdkLoginUriView(e)))||[],i.fido2Credentials=[],i}toSdkLoginView(){var e,t,i;return{username:this.username,password:this.password,passwordRevisionDate:null===(e=this.passwordRevisionDate)||void 0===e?void 0:e.toISOString(),totp:this.totp,autofillOnPageLoad:null!==(t=this.autofillOnPageLoad)&&void 0!==t?t:void 0,uris:null===(i=this.uris)||void 0===i?void 0:i.map(e=>e.toSdkLoginUriView()),fido2Credentials:void 0}}}c([(0,s.V)(r.EU.Username,{sortPosition:0}),d("design:type",String)],u.prototype,"username",void 0),c([(0,s.V)(r.EU.Password,{sortPosition:1}),d("design:type",String)],u.prototype,"password",void 0)},14318:(e,t,i)=>{"use strict";i.d(t,{i:()=>s});var n=i(33812),r=i(7421);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵcmp=n.VBU({type:s,selectors:[["bit-card"]],hostAttrs:[1,"tw-p-4","[@media(min-width:650px)]:tw-p-6"],features:[n.nM4([r.T])],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2,changeDetection:0})},14688:(e,t,i)=>{"use strict";i.d(t,{Sc:()=>b,eM:()=>v});var n=i(38871),r=i(16878),s=i(72245),o=i(3204),a=i(97432),l=i(59777),c=i(66523),d=i(31857),u=i(31442),h=i(7919),p=i(61325),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const v=200,f=new d.Ok(d.s2,"searchIndex",{deserializer:e=>e,clearOn:["lock","logout"]}),g=new d.Ok(d.s2,"searchIndexedEntityId",{deserializer:e=>e,clearOn:["lock","logout"]}),y=new d.Ok(d.s2,"isIndexing",{deserializer:e=>e,clearOn:["lock","logout"]});class b{constructor(e,t,i){this.logService=e,this.i18nService=t,this.stateProvider=i,this.immediateSearchLocales=["zh-CN","zh-TW","ja","ko","vi"],this.defaultSearchableMinLength=2,this.searchableMinLength=this.defaultSearchableMinLength,this._isCipherSearching$=new r.t(!1),this.isCipherSearching$=this._isCipherSearching$.asObservable(),this._isSendSearching$=new r.t(!1),this.isSendSearching$=this._isSendSearching$.asObservable(),this.index$=(0,a.j)(e=>this.searchIndexState(e).state$.pipe((0,o.T)(e=>{let t=null;if(e){const i=performance.now();t=n.Index.load(e),this.logService.measure(i,"Vault","SearchService","index load")}return t}))),this.i18nService.locale$.subscribe(e=>{-1!==this.immediateSearchLocales.indexOf(e)?this.searchableMinLength=1:this.searchableMinLength=this.defaultSearchableMinLength}),b.registeredPipeline||(b.registeredPipeline=!0,n.Pipeline.registerFunction(this.normalizeAccentsPipelineFunction,"normalizeAccents"))}searchIndexState(e){return this.stateProvider.getUser(e,f)}searchIndexEntityIdState(e){return this.stateProvider.getUser(e,g)}indexedEntityId$(e){return this.searchIndexEntityIdState(e).state$.pipe((0,o.T)(e=>e))}searchIsIndexingState(e){return this.stateProvider.getUser(e,y)}searchIsIndexing$(e){return this.searchIsIndexingState(e).state$.pipe((0,o.T)(e=>null!=e&&e))}clearIndex(e){return m(this,void 0,void 0,function*(){yield this.searchIndexEntityIdState(e).update(()=>null),yield this.searchIndexState(e).update(()=>null),yield this.searchIsIndexingState(e).update(()=>null)})}isSearchable(e,t){return m(this,void 0,void 0,function*(){if(null==(t=b.normalizeSearchQuery(t))||""===t)return!1;return 0===t.indexOf(">")?null!=(yield this.getIndexForSearch(e)):t.length>=this.searchableMinLength})}indexCiphers(e,t,i){return m(this,void 0,void 0,function*(){if(yield this.getIsIndexing(e))return;const r=performance.now();yield this.setIsIndexing(e,!0),yield this.setIndexedEntityIdForSearch(e,i);const s=new n.Builder;s.pipeline.add(this.normalizeAccentsPipelineFunction),s.ref("id"),s.field("shortid",{boost:100,extractor:e=>e.id.substr(0,8)}),s.field("name",{boost:10}),s.field("subtitle",{boost:5,extractor:e=>null!=e.subTitle&&e.type===h.gC.Card?e.subTitle.replace(/\*/g,""):e.subTitle}),s.field("notes"),s.field("login.username",{extractor:e=>e.type===h.gC.Login&&null!=e.login?e.login.username:null}),s.field("login.uris",{boost:2,extractor:e=>this.uriExtractor(e)}),s.field("fields",{extractor:e=>this.fieldExtractor(e,!1)}),s.field("fields_joined",{extractor:e=>this.fieldExtractor(e,!0)}),s.field("attachments",{extractor:e=>this.attachmentExtractor(e,!1)}),s.field("attachments_joined",{extractor:e=>this.attachmentExtractor(e,!0)}),s.field("organizationid",{extractor:e=>e.organizationId}),(t=t||[]).forEach(e=>s.add(e));const o=s.build();yield this.setIndexForSearch(e,o.toJSON()),yield this.setIsIndexing(e,!1),this.logService.measure(r,"Vault","SearchService","index complete",[["Items",t.length]])})}searchCiphers(e,t){return m(this,arguments,void 0,function*(e,t,i=null,r){this._isCipherSearching$.next(!0);const s=[],o=performance.now();if(null!=t&&(t=b.normalizeSearchQuery(t.trim().toLowerCase())),""===t&&(t=null),null==r&&(r=[]),null!=i&&Array.isArray(i)&&i.length>0?r=r.filter(e=>i.every(t=>null==t||t(e))):null!=i&&(r=r.filter(i)),!(yield this.isSearchable(e,t)))return this._isCipherSearching$.next(!1),r;(yield this.getIsIndexing(e))&&(yield new Promise(e=>setTimeout(e,250)),(yield this.getIsIndexing(e))&&(yield new Promise(e=>setTimeout(e,500))));const a=yield this.getIndexForSearch(e);if(null==a){const e=this.searchCiphersBasic(r,t);return this.logService.measure(o,"Vault","SearchService","basic search complete"),this._isCipherSearching$.next(!1),e}const l=new Map;r.forEach(e=>l.set((0,c.zw)(e.id),e));let d=null;if(null!=t&&t.length>1&&0===t.indexOf(">"))try{d=a.search(t.substr(1).trim())}catch(u){this.logService.error(u)}else{const e=n.Query.wildcard.LEADING|n.Query.wildcard.TRAILING;d=a.query(i=>{n.tokenizer(t).forEach(t=>{const n=t.toString();i.term(n,{fields:["name"],wildcard:e}),i.term(n,{fields:["subtitle"],wildcard:e}),i.term(n,{fields:["login.uris"],wildcard:e}),i.term(n,{})})})}return null!=d&&d.forEach(e=>{l.has(e.ref)&&s.push(l.get(e.ref))}),this.logService.measure(o,"Vault","SearchService","search complete"),this._isCipherSearching$.next(!1),s})}searchCiphersBasic(e,t,i=!1,n=!1){return t=b.normalizeSearchQuery(t.trim().toLowerCase()),e.filter(e=>{var r,s;if(i!==p.n.isDeleted(e))return!1;if(n!==p.n.isArchived(e))return!1;if(null!=e.name&&e.name.toLowerCase().indexOf(t)>-1)return!0;if(t.length>=8&&(0,c.zw)(e.id).startsWith(t))return!0;const o=p.n.subtitle(e);if(null!=o&&o.toLowerCase().indexOf(t)>-1)return!0;const a=p.n.getLogin(e);return!!(a&&(null===(r=a.uris)||void 0===r?void 0:r.length)&&(null===(s=a.uris)||void 0===s?void 0:s.some(e=>(null==e?void 0:e.uri)&&e.uri.toLowerCase().indexOf(t)>-1)))})}searchSends(e,t){if(this._isSendSearching$.next(!0),null===(t=b.normalizeSearchQuery(t.trim().toLocaleLowerCase())))return this._isSendSearching$.next(!1),e;const i=[],n=[];return e.forEach(e=>{var r,s,o;null!=e.name&&e.name.toLowerCase().indexOf(t)>-1?i.push(e):(t.length>=8&&(e.id.startsWith(t)||e.accessId.toLocaleLowerCase().startsWith(t)||null!=(null===(r=e.file)||void 0===r?void 0:r.id)&&e.file.id.startsWith(t))||null!=e.notes&&e.notes.toLowerCase().indexOf(t)>-1||null!=(null===(s=e.text)||void 0===s?void 0:s.text)&&e.text.text.toLowerCase().indexOf(t)>-1||null!=(null===(o=e.file)||void 0===o?void 0:o.fileName)&&e.file.fileName.toLowerCase().indexOf(t)>-1)&&n.push(e)}),this._isSendSearching$.next(!1),i.concat(n)}getIndexForSearch(e){return m(this,void 0,void 0,function*(){return yield(0,s._)(this.index$(e))})}setIndexForSearch(e,t){return m(this,void 0,void 0,function*(){yield this.searchIndexState(e).update(()=>t)})}setIndexedEntityIdForSearch(e,t){return m(this,void 0,void 0,function*(){yield this.searchIndexEntityIdState(e).update(()=>t)})}setIsIndexing(e,t){return m(this,void 0,void 0,function*(){yield this.searchIsIndexingState(e).update(()=>t)})}getIsIndexing(e){return m(this,void 0,void 0,function*(){return yield(0,s._)(this.searchIsIndexing$(e))})}fieldExtractor(e,t){if(!e.hasFields)return null;let i=[];return e.fields.forEach(e=>{null!=e.name&&i.push(e.name),e.type===u.PU.Text&&null!=e.value&&i.push(e.value)}),i=i.filter(e=>""!==e.trim()),0===i.length?null:t?i.join(" "):i}attachmentExtractor(e,t){if(!e.hasAttachments)return null;let i=[];return e.attachments.forEach(e=>{null!=e&&null!=e.fileName&&(t&&e.fileName.indexOf(".")>-1?i.push(e.fileName.substr(0,e.fileName.lastIndexOf("."))):i.push(e.fileName))}),i=i.filter(e=>""!==e.trim()),0===i.length?null:t?i.join(" "):i}uriExtractor(e){if(e.type!==h.gC.Login||null==e.login||!e.login.hasUris)return null;const t=[];return e.login.uris.forEach(e=>{if(null==e.uri||""===e.uri)return;const i=e.uri.match(/:(\d+)(?:[/?#]|$)/),n=null==i?void 0:i[1];let r=e.uri;if(null!==e.hostname)return t.push(e.hostname),void(n&&(t.push(`${e.hostname}:${n}`),t.push(n)));{const e=r.indexOf("/"),i=e>-1?r.substring(0,e):r;t.push(i),n&&(t.push(`${i}`),t.push(n))}if(e.match!==l.L.RegularExpression){const e=r.indexOf("://");e>-1&&(r=r.substr(e+3));const t=r.search(/\?|&|#/);t>-1&&(r=r.substring(0,t))}t.push(r)}),t.length>0?t:null}normalizeAccentsPipelineFunction(e){const t=["name","login.username","subtitle","notes"];return e.metadata.fields.every(e=>t.includes(e))?b.normalizeSearchQuery(e.toString()):e}static normalizeSearchQuery(e){return null==e?void 0:e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}}b.registeredPipeline=!1},15033:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{}},15055:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{}},15639:(e,t,i)=>{"use strict";i.d(t,{Hc:()=>s,S:()=>o,pn:()=>a});var n=i(48479),r=i(3204);const s=e=>(0,r.T)(t=>t.find(t=>t.id===e)),o=e=>{const t=new Set(e);return(0,r.T)(e=>e.filter(e=>e.id&&t.has(e.id)))};function a(e){return t=>{const i=new Map,r=()=>{for(const[,e]of i.entries())e.unsubscribe();i.clear()};return new n.c(n=>{const s=t.subscribe({next:t=>{var r;for(const e of i.keys())t.has(e)?t.delete(e):(null===(r=i.get(e))||void 0===r||r.unsubscribe(),i.delete(e));for(const s of t.keys())i.set(s,e(s).subscribe({next:e=>{n.next(e)},error:e=>{n.error(e)},complete:()=>{i.delete(s)}}))},error:e=>{n.error(e)},complete:()=>{r(),n.complete()}});return()=>{r(),s.unsubscribe()}})}}},15740:(e,t,i)=>{"use strict";var n;i.d(t,{c:()=>n}),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.RecoveryInitiated=3]="RecoveryInitiated",e[e.RecoveryApproved=4]="RecoveryApproved"}(n||(n={}))},16184:(e,t,i)=>{"use strict";i.d(t,{a6:()=>x,rq:()=>C,W4:()=>r,BF:()=>w,nv:()=>T,ep:()=>n,Lw:()=>b,ft:()=>S});class n{}var r,s=i(43008),o=i(72245),a=i(33338),l=i(44500),c=i(84079),d=i(73276),u=i(75811),h=i(99969),p=i(34040),m=i(27442),v=i(36359),f=i(3204),g=i(43978),y=i(685);!function(e){e.Lock="lock",e.LogOut="logOut"}(r||(r={}));const b={Never:"never",OnRestart:"onRestart",OnLocked:"onLocked",OnSleep:"onSleep",OnIdle:"onIdle",Custom:"custom"},w={Immediately:0,OnMinute:1,EightHours:480};function S(e){return"number"==typeof e}var I=i(78070),k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(e,t,i,n,r,s,o,a,l,c,d){this.accountService=e,this.pinStateService=t,this.userDecryptionOptionsService=i,this.keyService=n,this.tokenService=r,this.policyService=s,this.biometricStateService=o,this.stateProvider=a,this.logService=l,this.defaultVaultTimeout=c,this.sessionTimeoutTypeService=d}setVaultTimeoutOptions(e,t,i){return k(this,void 0,void 0,function*(){if(!e)throw new Error("User id required. Cannot set vault timeout settings.");if(null==t)throw new Error("Vault Timeout cannot be null.");if(null==i)throw new Error("Vault Timeout Action cannot be null.");const n=yield this.tokenService.getAccessToken(e),s=yield this.tokenService.getRefreshToken(e),o=yield this.tokenService.getClientId(e),a=yield this.tokenService.getClientSecret(e);yield this.setVaultTimeout(e,t),t!=b.Never&&i===r.LogOut&&(yield this.tokenService.clearTokens(e)),yield this.setVaultTimeoutAction(e,i),yield this.tokenService.setTokens(n,i,t,s,[o,a]),yield this.keyService.refreshAdditionalKeys(e)})}availableVaultTimeoutActions$(e){return(0,s.v)(()=>this.getAvailableVaultTimeoutActions(e))}canLock(e){return k(this,void 0,void 0,function*(){const t=yield(0,o._)(this.availableVaultTimeoutActions$(e));return(null==t?void 0:t.includes(r.Lock))||!1})}isBiometricLockSet(e){return k(this,void 0,void 0,function*(){const t=null==e?(0,o._)(this.biometricStateService.biometricUnlockEnabled$):this.biometricStateService.getBiometricUnlockEnabled(e);return yield t})}setVaultTimeout(e,t){return k(this,void 0,void 0,function*(){if(!e)throw new Error("User id required. Cannot set vault timeout.");if(null==t)throw new Error("Vault Timeout cannot be null.");yield this.stateProvider.setUserState(I.z,t,e)})}getVaultTimeoutByUserId$(e){if(!e)throw new Error("User id required. Cannot get vault timeout.");return(0,a.z)([this.stateProvider.getUserState$(I.z,e),this.getMaxSessionTimeoutPolicyDataByUserId$(e)]).pipe((0,l.n)(([t,i])=>(this.logService.debug("[VaultTimeoutSettingsService] Current vault timeout is %o for user id %s, max session policy %o",t,e,i),(0,c.H)(this.determineVaultTimeout(t,i)).pipe((0,d.H)(i=>k(this,void 0,void 0,function*(){return this.logService.debug("[VaultTimeoutSettingsService] Determined vault timeout is %o for user id %s",i,e),i!==t&&(yield this.stateProvider.setUserState(I.z,i,e)),i})),(0,u.W)(e=>(this.logService.error(`Error getting vault timeout: ${e}`),h.w))))),(0,p.F)(),(0,m.t)({refCount:!0,bufferSize:1}))}determineVaultTimeout(e,t){return k(this,void 0,void 0,function*(){if(e=null!=e?e:this.defaultVaultTimeout,null==t)return e;switch(t.type){case"immediately":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(w.Immediately);case"custom":case null:case void 0:return e===w.Immediately?e:S(e)?Math.min(e,t.minutes):t.minutes;case"onSystemLock":if(e===b.Never||e===b.OnRestart||e===b.OnLocked||e===b.OnIdle||e===b.OnSleep)return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(b.OnLocked);break;case"onAppRestart":if(e===b.Never||e===b.OnLocked||e===b.OnIdle||e===b.OnSleep)return b.OnRestart;break;case"never":if(e===b.Never)return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(b.Never)}return e})}setVaultTimeoutAction(e,t){return k(this,void 0,void 0,function*(){if(!e)throw new Error("User id required. Cannot set vault timeout action.");if(!t)throw new Error("Vault Timeout Action cannot be null");yield this.stateProvider.setUserState(I.G,t,e)})}getVaultTimeoutActionByUserId$(e){if(!e)throw new Error("User id required. Cannot get vault timeout action.");return(0,a.z)([this.stateProvider.getUserState$(I.G,e),this.getMaxSessionTimeoutPolicyDataByUserId$(e)]).pipe((0,l.n)(([t,i])=>(0,c.H)(this.determineVaultTimeoutAction(e,t,i)).pipe((0,v.M)(i=>{if(i!==t)return this.stateProvider.setUserState(I.G,i,e)}),(0,u.W)(e=>(this.logService.error(`Error getting vault timeout: ${e}`),h.w)))),(0,p.F)(),(0,m.t)({refCount:!0,bufferSize:1}))}determineVaultTimeoutAction(e,t,i){return k(this,void 0,void 0,function*(){const n=yield this.getAvailableVaultTimeoutActions(e);return 1===n.length?n[0]:(null==i?void 0:i.action)&&n.includes(i.action)?i.action:null==t&&n.includes(r.Lock)?r.Lock:t})}getMaxSessionTimeoutPolicyDataByUserId$(e){if(!e)throw new Error("User id required. Cannot get max session timeout policy.");return this.policyService.policiesByType$(g.tt.MaximumVaultTimeout,e).pipe(y.Zc,(0,f.T)(e=>{var t;return null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}))}getAvailableVaultTimeoutActions(e){return k(this,void 0,void 0,function*(){var t;null!=e||(e=null===(t=yield(0,o._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id);const i=[r.LogOut];return((yield this.userHasMasterPassword(e))||(yield this.pinStateService.isPinSet(e))||(yield this.isBiometricLockSet(e)))&&i.push(r.Lock),i})}userHasMasterPassword(e){return k(this,void 0,void 0,function*(){let t;if(e)t=e;else{const e=yield(0,o._)(this.accountService.activeAccount$);if(!e)return!1;t=e.id}return yield(0,o._)(this.userDecryptionOptionsService.hasMasterPasswordById$(t))})}}class T{}var F=i(84110),R=i(9249),P=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class x{constructor(e,t,i,n,r,s,o,a){this.accountService=e,this.platformUtilsService=t,this.authService=i,this.vaultTimeoutSettingsService=n,this.taskSchedulerService=r,this.logService=s,this.lockService=o,this.logoutService=a,this.inited=!1,this.taskSchedulerService.registerTaskHandler(R.fq.vaultTimeoutCheckInterval,()=>this.checkVaultTimeout())}init(e){return P(this,void 0,void 0,function*(){this.inited||(this.inited=!0,e&&this.startCheck())})}startCheck(){this.checkVaultTimeout().catch(e=>this.logService.error(e)),this.taskSchedulerService.setInterval(R.fq.vaultTimeoutCheckInterval,1e4)}checkVaultTimeout(){return P(this,void 0,void 0,function*(){const e=yield this.platformUtilsService.isPopupOpen();yield(0,o._)((0,a.z)([this.accountService.activeAccount$,this.accountService.accountActivity$]).pipe((0,d.H)(t=>P(this,[t],void 0,function*([t,i]){const n=null==t?void 0:t.id;for(const r in i){const t=r;null!=t&&(yield this.shouldLock(t,i[t],n,e))&&(yield this.executeTimeoutAction(t))}}))))})}shouldLock(e,t,i,n){return P(this,void 0,void 0,function*(){if(n&&e===i)return!1;const r=yield this.authService.getAuthStatus(e);if(r===F.J.Locked||r===F.J.LoggedOut)return!1;const s=yield(0,o._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(e));if("string"==typeof s)return!1;if(null==t)return!1;const a=60*s;return((new Date).getTime()-t.getTime())/1e3>=a})}executeTimeoutAction(e){return P(this,void 0,void 0,function*(){(yield(0,o._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(e)))===r.LogOut?yield this.logoutService.logout(e,"vaultTimeout"):yield this.lockService.lock(e)})}}},16436:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{}},16452:(e,t,i)=>{"use strict";i.d(t,{IO:()=>oi,d1:()=>ri});var n=i(33812),r=i(51757),s=i(66046),o=i(72245),a=i(33338),l=i(3204),c=i(44500),d=i(14803),u=i(36006),h=i(67553),p=i(43978),m=i(56953),v=i(79667),f=i(3633),g=i(88083),y=i(82468),b=i(83516),w=i(39488),S=i(14318),I=i(81525),k=i(22848),C=i(98221),T=i(27760),F=i(63734),R=i(14055),P=i(41226),x=i(37806),$=i(74208),E=i(69855),A=i(21274),D=i(12012),O=i(50700),M=i(23649),U=i(18499),G=i(11224),j=i(35500),N=i(1601),V=i(77468),B=i(26657),z=i(45154),L=i(47696),K=i(56898),q=i(44432),_=i(7730),X=i(68016),Y=i(93199),H=i(36288),W=i(12694),J=i(16496),Z=i(58806),Q=i(88016),ee=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const te=(e,t)=>({"tw-py-1":e,"tw-py-0":t}),ie=(e,t)=>({"tw-bg-primary-700 !tw-text-contrast":e,"tw-bg-secondary-100":t}),ne=e=>({type:"checkout",supportsTaxId:e});function re(e,t){if(1&e&&(n.j41(0,"bit-toggle",18),n.EFF(1),n.k0s()),2&e){const e=t.$implicit;n.Y8G("value",e.value),n.R7$(),n.SpI(" ",e.name," ")}}function se(e,t){if(1&e){const e=n.RV6();n.j41(0,"div",15)(1,"bit-toggle-group",16),n.bIt("selectedChange",function(t){$.eBV(e);const i=n.XpG();return $.Njj(i.updateInterval(t))}),n.DNE(2,re,2,2,"bit-toggle",17),n.k0s()()}if(2&e){const e=n.XpG();n.R7$(),n.Y8G("selected",e.selectedInterval),n.R7$(),n.Y8G("ngForOf",e.getPlanIntervals())("ngForTrackBy",e.optimizedNgForRender)}}function oe(e,t){if(1&e&&(n.j41(0,"div",31),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.Y8G("ngClass",n.l_i(4,ie,e===t.selectedPlan,!(e===t.selectedPlan))),n.R7$(),n.SpI(" ",n.bMT(2,2,"recommended")," ")}}function ae(e,t){1&e&&(n.j41(0,"span",32),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"current")))}function le(e,t){if(1&e&&(n.qex(0),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.bVm()),2&e){const e=n.XpG(3).$implicit,t=n.XpG(2);n.R7$(),n.E5c(" ",n.bMT(2,3,"additionalUsers").toLowerCase()," ",n.i5U(3,5,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$")," /",n.bMT(4,8,t.selectedPlanInterval)," ")}}function ce(e,t){if(1&e&&(n.qex(0),n.j41(1,"b",33),n.EFF(2),n.nI1(3,"currency"),n.k0s(),n.j41(4,"span",34),n.EFF(5),n.nI1(6,"i18n"),n.k0s(),n.j41(7,"b",35),n.DNE(8,le,5,10,"ng-container",11),n.k0s(),n.bVm()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(2);n.R7$(2),n.SpI(" ",n.i5U(3,3,e.isAnnual?e.PasswordManager.basePrice/12:e.PasswordManager.basePrice,"$")," "),n.R7$(3),n.SpI(" /",e.productTier===t.productTypes.Families?"month":n.bMT(6,6,"monthPerMember")),n.R7$(3),n.Y8G("ngIf",e.PasswordManager.hasAdditionalSeatsOption)}}function de(e,t){if(1&e&&(n.j41(0,"span"),n.DNE(1,ce,9,8,"ng-container",11),n.k0s()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.PasswordManager.basePrice&&!t.acceptingSponsorship)}}function ue(e,t){if(1&e&&(n.j41(0,"span")(1,"b",33),n.EFF(2),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"span",34),n.EFF(6),n.nI1(7,"i18n"),n.k0s()()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.R7$(2),n.SpI("",n.i5U(4,5,"costPerMember",n.i5U(3,2,((t.sub.useSecretsManager?e.SecretsManager.seatPrice:0)+e.PasswordManager.seatPrice)/(e.isAnnual?12:1),"$"))," "),n.R7$(4),n.SpI(" /",n.bMT(7,8,"monthPerMember"))}}function he(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"freeForever")," "))}function pe(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenPasswordManager")," "))}function me(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenSecretsManager")," "))}function ve(e,t){1&e&&(n.j41(0,"ul",38)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s(),n.j41(13,"li"),n.nrm(14,"i",39),n.EFF(15),n.nI1(16,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,4,"unlimitedSecretsStorage")," "),n.R7$(4),n.SpI(" ",n.bMT(8,6,"unlimitedUsers")," "),n.R7$(4),n.SpI(" ",n.bMT(12,8,"unlimitedProjects")," "),n.R7$(4),n.SpI(" ",n.bMT(16,10,"UpTo50MachineAccounts")," "))}function fe(e,t){if(1&e&&(n.qex(0),n.DNE(1,pe,3,3,"p",36),n.j41(2,"p",37),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"ul",38)(6,"li"),n.nrm(7,"i",39),n.EFF(8),n.nI1(9,"i18n"),n.k0s(),n.j41(10,"li"),n.nrm(11,"i",39),n.EFF(12),n.nI1(13,"i18n"),n.k0s(),n.j41(14,"li"),n.nrm(15,"i",39),n.EFF(16),n.nI1(17,"i18n"),n.k0s(),n.j41(18,"li"),n.nrm(19,"i",39),n.EFF(20),n.nI1(21,"i18n"),n.k0s()(),n.DNE(22,me,3,3,"p",36)(23,ve,17,12,"ul",40),n.bVm()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(2),n.JRh(n.bMT(4,8,"enterprisePlanUpgradeMessage")),n.R7$(5),n.SpI(" ",n.bMT(9,10,"includeEnterprisePolicies")," "),n.R7$(4),n.SpI(" ",n.bMT(13,12,"passwordLessSso")," "),n.R7$(4),n.SpI(" ",n.bMT(17,14,"accountRecovery")," "),n.R7$(4),n.SpI(" ",n.bMT(21,16,"customRoles")," "),n.R7$(2),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager)}}function ge(e,t){1&e&&(n.qex(0),n.j41(1,"ul",42)(2,"li"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"li"),n.EFF(9),n.nI1(10,"i18n"),n.k0s()(),n.bVm()),2&e&&(n.R7$(3),n.JRh(n.bMT(4,3,"includeAllTeamsStarterFeatures")),n.R7$(3),n.JRh(n.bMT(7,5,"chooseMonthlyOrAnnualBilling")),n.R7$(3),n.JRh(n.i5U(10,7,"abilityToAddMoreThanNMembers",10)))}function ye(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenPasswordManager")," "))}function be(e,t){1&e&&(n.j41(0,"p",37),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"teamsPlanUpgradeMessage")," "))}function we(e,t){1&e&&(n.j41(0,"p",37),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"familyPlanUpgradeMessage")," "))}function Se(e,t){1&e&&(n.j41(0,"ul",45)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,3,"premiumAccounts")," "),n.R7$(4),n.SpI(" ",n.bMT(8,5,"unlimitedSharing")," "),n.R7$(4),n.SpI(" ",n.bMT(12,7,"unlimitedCollections")," "))}function Ie(e,t){1&e&&(n.j41(0,"ul",38)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,3,"secureDataSharing")," "),n.R7$(4),n.SpI(" ",n.bMT(8,5,"eventLogMonitoring")," "),n.R7$(4),n.SpI(" ",n.bMT(12,7,"directoryIntegration")," "))}function ke(e,t){1&e&&(n.j41(0,"p",41),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"bitwardenSecretsManager")," "))}function Ce(e,t){1&e&&(n.j41(0,"ul",38)(1,"li"),n.nrm(2,"i",39),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.nrm(6,"i",39),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.j41(9,"li"),n.nrm(10,"i",39),n.EFF(11),n.nI1(12,"i18n"),n.k0s()()),2&e&&(n.R7$(3),n.SpI(" ",n.bMT(4,3,"unlimitedSecretsStorage")," "),n.R7$(4),n.SpI(" ",n.bMT(8,5,"unlimitedProjects")," "),n.R7$(4),n.SpI(" ",n.bMT(12,7,"UpTo20MachineAccounts")," "))}function Te(e,t){if(1&e&&n.DNE(0,ye,3,3,"p",36)(1,be,3,3,"p",43)(2,we,3,3,"p",43)(3,Se,13,9,"ul",44)(4,Ie,13,9,"ul",40)(5,ke,3,3,"p",36)(6,Ce,13,9,"ul",40),2&e){const e=n.XpG(2).$implicit,t=n.XpG(2);n.Y8G("ngIf",t.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.productTier===t.productTypes.Teams),n.R7$(),n.Y8G("ngIf",e.productTier===t.productTypes.Families),n.R7$(),n.Y8G("ngIf",e.productTier==t.productTypes.Families),n.R7$(),n.Y8G("ngIf",e.productTier==t.productTypes.Teams),n.R7$(),n.Y8G("ngIf",t.organization.useSecretsManager&&e.productTier!==t.productTypes.Families),n.R7$(),n.Y8G("ngIf",t.organization.useSecretsManager&&e.productTier==t.productTypes.Teams)}}function Fe(e,t){if(1&e&&n.DNE(0,ge,11,10,"ng-container",30)(1,Te,7,7,"ng-template",null,1,n.C5r),2&e){const e=n.sdS(2),t=n.XpG().$implicit,i=n.XpG(2);n.Y8G("ngIf",t.productTier===i.productTypes.Teams&&i.teamsStarterPlanIsAvailable)("ngIfElse",e)}}function Re(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-card",23),n.bIt("click",function(){const t=$.eBV(e).$implicit,i=n.XpG(2);return $.Njj(i.selectPlan(t))})("keyup",function(t){const i=$.eBV(e).index,r=n.XpG(2);return $.Njj(r.onKeydown(t,i))})("focus",function(){const t=$.eBV(e).index,i=n.XpG(2);return $.Njj(i.onFocus(t))}),n.j41(1,"div",24),n.DNE(2,oe,3,7,"div",25),n.j41(3,"div",26)(4,"h3",27)(5,"span",28),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.DNE(8,ae,3,3,"span",29),n.k0s(),n.DNE(9,de,2,1,"span",11)(10,ue,8,10,"span",11)(11,he,3,3,"span",11),n.k0s()(),n.DNE(12,fe,24,18,"ng-container",30)(13,Fe,3,2,"ng-template",null,0,n.C5r),n.k0s()}if(2&e){const e=t.$implicit,i=t.index,r=n.sdS(14),s=n.XpG(2);n.Y8G("ngClass",s.getPlanCardContainerClasses(e,i))("id",i+"a_plan_card"),n.BMQ("tabindex",s.focusedIndex!==i||s.isCardDisabled(i)?"-1":"0")("aria-disabled",s.isCardDisabled(i)),n.R7$(2),n.Y8G("ngIf",e.productTier===s.productTypes.Enterprise&&!s.isSubscriptionCanceled),n.R7$(),n.Y8G("ngClass",n.l_i(15,te,!(e===s.selectedPlan),e===s.selectedPlan)),n.R7$(3),n.JRh(n.bMT(7,13,e.nameLocalizationKey)),n.R7$(2),n.Y8G("ngIf",e===s.currentPlan),n.R7$(),n.Y8G("ngIf",e.productTier!=s.productTypes.Free),n.R7$(),n.Y8G("ngIf",!e.PasswordManager.basePrice&&e.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.productTier==s.productTypes.Free),n.R7$(),n.Y8G("ngIf",e.productTier===s.productTypes.Enterprise)("ngIfElse",r)}}function Pe(e,t){1&e&&(n.j41(0,"bit-callout",46),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManagerSubscriptionInfo")," "))}function xe(e,t){1&e&&(n.j41(0,"bit-callout",47),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManagerComplimentaryPasswordManager")," "))}function $e(e,t){if(1&e&&(n.qex(0),n.j41(1,"div",19),n.DNE(2,Re,15,18,"bit-card",20),n.k0s(),n.nrm(3,"br"),n.DNE(4,Pe,3,3,"bit-callout",21)(5,xe,3,3,"bit-callout",22),n.nrm(6,"br"),n.bVm()),2&e){const e=n.XpG();n.R7$(),n.HbH("tw-grid-cols-"+e.selectableProducts.length),n.R7$(),n.Y8G("ngForOf",e.selectableProducts)("ngForTrackBy",e.manageSelectableProduct),n.R7$(2),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&e.isSecretsManagerTrial())}}function Ee(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("- ",n.bMT(2,1,"unverified")))}function Ae(e,t){if(1&e){const e=n.RV6();n.nrm(0,"i",56),n.EFF(1),n.nVh(2,Ee,3,3,"span"),n.j41(3,"span",57),n.bIt("click",function(){$.eBV(e);const t=n.XpG(3);return $.Njj(t.toggleShowPayment())}),n.EFF(4),n.nI1(5,"i18n"),n.k0s()}if(2&e){const e=n.XpG(3);n.R7$(),n.Lme(" ",e.paymentMethod.bankName,", *",e.paymentMethod.last4," "),n.R7$(),n.vxM(e.paymentMethod.hostedVerificationUrl?2:-1),n.R7$(2),n.SpI(" ",n.bMT(5,4,"changePaymentMethod")," ")}}function De(e,t){if(1&e&&n.nrm(0,"i"),2&e){n.XpG();const e=n.r8f(1);n.HbH(n.VkB("bwi bwi-fw credit-card-icon ",e))}}function Oe(e,t){1&e&&n.nrm(0,"i",59)}function Me(e,t){if(1&e){const e=n.RV6();n.j41(0,"p",9),n.SS7(1),n.nVh(2,De,1,3,"i",58)(3,Oe,1,0,"i",59),n.EFF(4),n.nI1(5,"titlecase"),n.j41(6,"span",57),n.bIt("click",function(){$.eBV(e);const t=n.XpG(3);return $.Njj(t.toggleShowPayment())}),n.EFF(7),n.nI1(8,"i18n"),n.k0s()()}if(2&e){const e=n.XpG(3);n.R7$();const t=n.bH3(e.getCardBrandIcon());n.R7$(),n.vxM(null!==t?2:3),n.R7$(2),n.E5c(" ",n.bMT(5,6,e.paymentMethod.brand),", *",e.paymentMethod.last4,", ",e.paymentMethod.expiration," "),n.R7$(3),n.SpI(" ",n.bMT(8,8,"changePaymentMethod")," ")}}function Ue(e,t){if(1&e){const e=n.RV6();n.nrm(0,"i",60),n.EFF(1),n.j41(2,"span",57),n.bIt("click",function(){$.eBV(e);const t=n.XpG(3);return $.Njj(t.toggleShowPayment())}),n.EFF(3),n.nI1(4,"i18n"),n.k0s()}if(2&e){const e=n.XpG(3);n.R7$(),n.SpI(" ",e.paymentMethod.email," "),n.R7$(2),n.SpI(" ",n.bMT(4,2,"changePaymentMethod")," ")}}function Ge(e,t){if(1&e&&(n.j41(0,"p"),n.nVh(1,Ae,6,6)(2,Me,9,10,"p",9)(3,Ue,5,4),n.nrm(4,"a"),n.k0s()),2&e){let e;const t=n.XpG(2);n.R7$(),n.vxM("bankAccount"===(e=t.paymentMethod.type)?1:"card"===e?2:"payPal"===e?3:-1)}}function je(e,t){if(1&e&&(n.qex(0),n.nrm(1,"app-enter-payment-method",61)(2,"app-enter-billing-address",62),n.bVm()),2&e){const e=n.XpG(2);n.R7$(),n.Y8G("group",e.billingFormGroup.controls.paymentMethod),n.R7$(),n.Y8G("group",e.billingFormGroup.controls.billingAddress)("scenario",n.eq3(3,ne,e.supportsTaxId))}}function Ne(e,t){1&e&&(n.j41(0,"p",70),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function Ve(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",72),n.EFF(2),n.nI1(3,"currency"),n.k0s(),n.EFF(4),n.nI1(5,"i18n"),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.JRh(n.i5U(3,2,e.selectedPlan.PasswordManager.basePrice,"$")),n.R7$(2),n.SpI(" ",n.bMT(5,5,"freeWithSponsorship")," ")}}function Be(e,t){if(1&e&&(n.EFF(0),n.nI1(1,"currency")),2&e){const e=n.XpG(5);n.SpI(" ",n.i5U(1,1,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function ze(e,t){if(1&e&&(n.j41(0,"p",71)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.DNE(7,Ve,6,7,"ng-container",30)(8,Be,2,4,"ng-template",null,2,n.C5r),n.k0s()()),2&e){const e=n.sdS(9),t=n.XpG(4);n.R7$(2),n.LHq(" ",t.passwordManagerSeats," ",n.bMT(3,6,"members")," × ",n.i5U(4,8,t.selectedPlan.isAnnual?t.selectedPlan.PasswordManager.basePrice/12:t.selectedPlan.PasswordManager.basePrice,"$")," /",n.bMT(5,11,t.selectedPlanInterval)," "),n.R7$(5),n.Y8G("ngIf",t.acceptingSponsorship)("ngIfElse",e)}}function Le(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Ke(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function qe(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Le,3,3,"span",11),n.EFF(3),n.DNE(4,Ke,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",e.passwordManagerSeats||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function _e(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.storageGb," ",n.bMT(3,5,"additionalStorageGbMessage")," × ",n.i5U(4,7,e.additionalStoragePriceMonthly(e.selectedPlan),"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.additionalStorageTotal(e.selectedPlan),"$"))}}function Xe(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.SpI(" ",n.bMT(4,5,n.i5U(3,2,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(4),n.JRh(n.i5U(7,7,e.calculateTotalAppliedDiscount(e.passwordManagerSeatTotal(e.selectedPlan)+e.additionalStorageTotal(e.selectedPlan)),"$"))}}function Ye(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,Xe,8,10,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually&&e.discountPercentageFromSub>0)}}function He(e,t){1&e&&(n.j41(0,"p",76),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function We(e,t){if(1&e&&(n.j41(0,"p",71)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",null==e.sub?null:e.sub.smSeats," ",n.bMT(3,4,"members")," × ",n.i5U(4,6,e.selectedPlan.isAnnual?e.selectedPlan.SecretsManager.basePrice/12:e.selectedPlan.SecretsManager.basePrice,"$")," /",n.bMT(5,9,e.selectedPlanInterval)," ")}}function Je(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Ze(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Qe(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Je,3,3,"span",11),n.EFF(3),n.DNE(4,Ze,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",(null==e.sub?null:e.sub.smSeats)||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,e.sub.smSeats),"$")," ")}}function et(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.nI1(5,"currency"),n.nI1(6,"i18n"),n.k0s(),n.j41(7,"span"),n.EFF(8),n.nI1(9,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(4,7,n.bMT(3,5,"serviceAccounts"))," × ",n.i5U(5,9,null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(6,12,e.selectedPlanInterval)," "),n.R7$(6),n.JRh(n.i5U(9,14,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function tt(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.SpI(" ",n.bMT(4,5,n.i5U(3,2,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(4),n.JRh(n.i5U(7,7,e.calculateTotalAppliedDiscount(e.additionalServiceAccountTotal(e.selectedPlan)+e.secretsManagerSeatTotal(e.selectedPlan,e.sub.smSeats)),"$"))}}function it(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,tt,8,10,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually&&e.discountPercentageFromSub>0)}}function nt(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,Ne,3,3,"p",66)(2,ze,10,13,"p",67)(3,qe,11,14,"p",68)(4,_e,9,15,"p",68)(5,Ye,2,1,"p",68)(6,He,3,3,"p",69)(7,We,6,11,"p",67)(8,Qe,11,14,"p",68)(9,et,10,17,"p",68)(10,it,2,1,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalStorageOption&&e.storageGb>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",(null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.basePrice)&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",(null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.hasAdditionalSeatsOption)&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",(null==e.selectedPlan||null==e.selectedPlan.SecretsManager?null:e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption)&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial())}}function rt(e,t){1&e&&(n.j41(0,"p",70),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function st(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.PasswordManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function ot(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function at(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function lt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,ot,3,3,"span",11),n.EFF(3),n.DNE(4,at,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",e.passwordManagerSeats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function ct(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.storageGb," ",n.bMT(3,5,"additionalStorageGbMessage")," × ",n.i5U(4,7,e.additionalStoragePriceMonthly(e.selectedPlan),"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.storageGb*e.selectedPlan.PasswordManager.additionalStoragePricePerGb,"$"))}}function dt(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.SpI(" ",n.bMT(4,9,n.i5U(3,6,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(3),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.JRh(n.i5U(7,11,e.calculateTotalAppliedDiscount(e.total),"$"))}}function ut(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,dt,8,14,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function ht(e,t){1&e&&(n.j41(0,"p",76),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function pt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.SecretsManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.SecretsManager.basePrice,"$")," ")}}function mt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function vt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function ft(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,mt,3,3,"span",11),n.EFF(3),n.DNE(4,vt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",null==e.sub?null:e.sub.smSeats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,null==e.sub?null:e.sub.smSeats),"$")," ")}}function gt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.nI1(5,"currency"),n.nI1(6,"i18n"),n.k0s(),n.j41(7,"span"),n.EFF(8),n.nI1(9,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(4,7,n.bMT(3,5,"serviceAccounts"))," × ",n.i5U(5,9,e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(6,12,e.selectedPlanInterval)," "),n.R7$(6),n.JRh(n.i5U(9,14,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function yt(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",74),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"lowercase"),n.k0s(),n.j41(5,"span",75),n.EFF(6),n.nI1(7,"currency"),n.k0s(),n.bVm()),2&e){const e=n.XpG(5);n.R7$(),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.SpI(" ",n.bMT(4,9,n.i5U(3,6,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(3),n.xc7("display",e.discountPercentageFromSub>0?"block":"none"),n.R7$(),n.JRh(n.i5U(7,11,e.additionalServiceAccountTotal(e.selectedPlan)+e.secretsManagerSeatTotal(e.selectedPlan,null==e.sub?null:e.sub.smSeats),"$"))}}function bt(e,t){if(1&e&&(n.j41(0,"p",73),n.DNE(1,yt,8,14,"ng-container",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function wt(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,rt,3,3,"p",66)(2,st,9,14,"p",68)(3,lt,11,14,"p",68)(4,ct,9,15,"p",68)(5,ut,2,1,"p",68)(6,ht,3,3,"p",69)(7,pt,9,14,"p",68)(8,ft,11,14,"p",68)(9,gt,10,17,"p",68)(10,bt,2,1,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalStorageOption&&e.storageGb>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.basePrice&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager&&!e.isSecretsManagerTrial())}}function St(e,t){if(1&e&&(n.j41(0,"div",63),n.DNE(1,nt,11,10,"bit-hint",64)(2,wt,11,10,"bit-hint",64),n.k0s()),2&e){const e=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually),n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function It(e,t){1&e&&(n.j41(0,"p",79),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function kt(e,t){if(1&e&&(n.j41(0,"p",71)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",null==e.sub?null:e.sub.smSeats," ",n.bMT(3,4,"members")," × ",n.i5U(4,6,e.selectedPlan.isAnnual?e.selectedPlan.SecretsManager.basePrice/12:e.selectedPlan.SecretsManager.basePrice,"$")," /",n.bMT(5,9,e.selectedPlanInterval)," ")}}function Ct(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Tt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Ft(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Ct,3,3,"span",11),n.EFF(3),n.DNE(4,Tt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",(null==e.sub?null:e.sub.smSeats)||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,e.sub.smSeats),"$")," ")}}function Rt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(3,5,"serviceAccounts")," × ",n.i5U(4,7,e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function Pt(e,t){1&e&&(n.j41(0,"p",80),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function xt(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",72),n.EFF(2),n.nI1(3,"currency"),n.k0s(),n.EFF(4),n.nI1(5,"i18n"),n.bVm()),2&e){const e=n.XpG(5);n.R7$(2),n.JRh(n.i5U(3,2,e.selectedPlan.PasswordManager.basePrice,"$")),n.R7$(2),n.SpI(" ",n.bMT(5,5,"freeWithSponsorship")," ")}}function $t(e,t){if(1&e&&(n.EFF(0),n.nI1(1,"currency")),2&e){const e=n.XpG(5);n.SpI(" ",n.i5U(1,1,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function Et(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.DNE(7,xt,6,7,"ng-container",30)(8,$t,2,4,"ng-template",null,2,n.C5r),n.k0s()()),2&e){const e=n.sdS(9),t=n.XpG(4);n.R7$(2),n.LHq(" ",null==t.sub?null:t.sub.seats," ",n.bMT(3,6,"members")," × ",n.i5U(4,8,t.selectedPlan.isAnnual?t.selectedPlan.PasswordManager.basePrice/12:t.selectedPlan.PasswordManager.basePrice,"$")," /",n.bMT(5,11,t.selectedPlanInterval)," "),n.R7$(5),n.Y8G("ngIf",t.acceptingSponsorship)("ngIfElse",e)}}function At(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Dt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Ot(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"freeForOneYear")," "))}function Mt(e,t){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"currency"),n.k0s()),2&e){const e=n.XpG(5);n.R7$(),n.SpI(" ",n.i5U(2,1,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function Ut(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,At,3,3,"span",11),n.EFF(3),n.DNE(4,Dt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.DNE(8,Ot,3,3,"span",11)(9,Mt,3,4,"span",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",(null==e.sub?null:e.sub.seats)||0,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,7,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,10,e.selectedPlanInterval)," "),n.R7$(3),n.Y8G("ngIf",e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",!e.isSecretsManagerTrial())}}function Gt(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,It,3,3,"p",77)(2,kt,6,11,"p",67)(3,Ft,11,14,"p",68)(4,Rt,9,15,"p",68)(5,Pt,3,3,"p",78)(6,Et,10,13,"p",68)(7,Ut,10,12,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.basePrice&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption)}}function jt(e,t){1&e&&(n.j41(0,"p",79),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"secretsManager")," "))}function Nt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.SecretsManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.SecretsManager.basePrice,"$")," ")}}function Vt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Bt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function zt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,Vt,3,3,"span",11),n.EFF(3),n.DNE(4,Bt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"span"),n.EFF(9),n.nI1(10,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.SpI(" ",null==e.sub?null:e.sub.smSeats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.SecretsManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,6,e.selectedPlan.SecretsManager.seatPrice,"$")," /",n.bMT(7,9,e.selectedPlanInterval)," "),n.R7$(4),n.SpI(" ",n.i5U(10,11,e.secretsManagerSeatTotal(e.selectedPlan,null==e.sub?null:e.sub.smSeats),"$")," ")}}function Lt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.LHq(" ",e.additionalServiceAccount," ",n.bMT(3,5,"serviceAccounts")," × ",n.i5U(4,7,e.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",n.bMT(5,10,e.selectedPlanInterval)," "),n.R7$(5),n.JRh(n.i5U(8,12,e.additionalServiceAccountTotal(e.selectedPlan),"$"))}}function Kt(e,t){1&e&&(n.j41(0,"p",80),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"passwordManager")," "))}function qt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.EFF(2),n.nI1(3,"i18n"),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()),2&e){const e=n.XpG(4);n.R7$(2),n.E5c(" ",n.bMT(3,4,"basePrice"),": ",n.i5U(4,6,e.selectedPlan.PasswordManager.basePrice,"$")," ",n.bMT(5,9,"monthAbbr")," "),n.R7$(5),n.SpI(" ",n.i5U(8,11,e.selectedPlan.PasswordManager.basePrice,"$")," ")}}function _t(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function Xt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"members")))}function Yt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"freeForOneYear")," "))}function Ht(e,t){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"currency"),n.k0s()),2&e){const e=n.XpG(5);n.R7$(),n.SpI(" ",n.i5U(2,1,e.passwordManagerSeatTotal(e.selectedPlan),"$")," ")}}function Wt(e,t){if(1&e&&(n.j41(0,"p",73)(1,"span"),n.DNE(2,_t,3,3,"span",11),n.EFF(3),n.DNE(4,Xt,3,3,"span",11),n.EFF(5),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s(),n.DNE(8,Yt,3,3,"span",11)(9,Ht,3,4,"span",11),n.k0s()),2&e){const e=n.XpG(4);n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.SpI(" ",null==e.sub?null:e.sub.seats,"  "),n.R7$(),n.Y8G("ngIf",!e.selectedPlan.PasswordManager.baseSeats),n.R7$(),n.Lme(" × ",n.i5U(6,7,e.selectedPlan.PasswordManager.seatPrice,"$")," /",n.bMT(7,10,e.selectedPlanInterval)," "),n.R7$(3),n.Y8G("ngIf",e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",!e.isSecretsManagerTrial())}}function Jt(e,t){if(1&e&&(n.j41(0,"bit-hint",65),n.DNE(1,jt,3,3,"p",77)(2,Nt,9,14,"p",68)(3,zt,11,14,"p",68)(4,Lt,9,15,"p",68)(5,Kt,3,3,"p",78)(6,qt,9,14,"p",68)(7,Wt,10,12,"p",68),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.basePrice&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption&&e.additionalServiceAccount>0),n.R7$(),n.Y8G("ngIf",e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption)}}function Zt(e,t){if(1&e&&(n.j41(0,"div",63),n.DNE(1,Gt,8,7,"bit-hint",64)(2,Jt,8,7,"bit-hint",64),n.k0s()),2&e){const e=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Annually),n.R7$(),n.Y8G("ngIf",e.selectedInterval==e.planIntervals.Monthly)}}function Qt(e,t){if(1&e&&(n.j41(0,"p",73),n.qex(1),n.j41(2,"span",74),n.EFF(3),n.nI1(4,"i18n"),n.nI1(5,"lowercase"),n.k0s(),n.j41(6,"span",75),n.EFF(7),n.nI1(8,"currency"),n.k0s(),n.bVm(),n.k0s()),2&e){const e=n.XpG(3);n.R7$(3),n.SpI(" ",n.bMT(5,5,n.i5U(4,2,"providerDiscount",e.discountPercentageFromSub))," "),n.R7$(4),n.JRh(n.i5U(8,7,e.calculateTotalAppliedDiscount(e.total),"$"))}}function ei(e,t){if(1&e&&(n.j41(0,"div",63)(1,"bit-hint",65),n.DNE(2,Qt,9,10,"p",68),n.k0s()()),2&e){const e=n.XpG(2);n.R7$(2),n.Y8G("ngIf",e.discountPercentageFromSub>0)}}function ti(e,t){if(1&e&&(n.j41(0,"div",81)(1,"bit-hint",65)(2,"p",82)(3,"span",51),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.k0s()()()()),2&e){const e=n.XpG(2);n.R7$(4),n.SpI(" ",n.bMT(5,2,"estimatedTax")," "),n.R7$(3),n.SpI(" ",n.brH(8,4,e.estimatedTax,"USD","$")," ")}}function ii(e,t){if(1&e&&(n.j41(0,"div",81)(1,"bit-hint",65)(2,"p",82)(3,"span",51),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.j41(6,"span"),n.EFF(7),n.nI1(8,"currency"),n.j41(9,"span",83),n.EFF(10),n.nI1(11,"i18n"),n.k0s()()()()()),2&e){const e=n.XpG(2);n.R7$(4),n.SpI(" ",n.bMT(5,3,"total")," "),n.R7$(3),n.SpI(" ",n.brH(8,5,e.total-e.calculateTotalAppliedDiscount(e.total),"USD","$")," "),n.R7$(3),n.SpI(" / ",n.bMT(11,9,e.selectedPlanInterval))}}function ni(e,t){if(1&e){const e=n.RV6();n.qex(0),n.j41(1,"h2",48),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.DNE(4,Ge,5,1,"p",11)(5,je,3,5,"ng-container",11),n.j41(6,"div",49)(7,"p",50)(8,"span",51),n.EFF(9),n.nI1(10,"i18n"),n.nI1(11,"currency"),n.k0s(),n.j41(12,"span",52),n.EFF(13),n.nI1(14,"i18n"),n.k0s(),n.j41(15,"button",53),n.nI1(16,"i18n"),n.nI1(17,"i18n"),n.bIt("click",function(){$.eBV(e);const t=n.XpG();return $.Njj(t.toggleTotalOpened())}),n.k0s()()(),n.DNE(18,St,3,2,"div",54)(19,Zt,3,2,"div",54)(20,ei,3,1,"div",54)(21,ti,9,8,"div",55)(22,ii,12,11,"div",55),n.bVm()}if(2&e){const e=n.XpG();n.R7$(2),n.JRh(n.bMT(3,13,"paymentMethod")),n.R7$(2),n.Y8G("ngIf",!e.showPayment&&!!e.paymentMethod&&!e.isSubscriptionCanceled),n.R7$(),n.Y8G("ngIf",e.canUpdatePaymentInformation()),n.R7$(4),n.Lme("",n.bMT(10,15,"total"),": ",n.brH(11,17,e.total-e.calculateTotalAppliedDiscount(e.total),"USD","$")," USD"),n.R7$(4),n.SpI(" / ",n.bMT(14,21,e.selectedPlanInterval)),n.R7$(2),n.Y8G("bitIconButton",e.totalOpened?"bwi-angle-down":"bwi-angle-up")("label",e.totalOpened?n.bMT(16,23,"hidePricingSummary"):n.bMT(17,25,"showPricingSummary")),n.R7$(3),n.Y8G("ngIf",e.totalOpened&&!e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.totalOpened&&e.isSecretsManagerTrial()),n.R7$(),n.Y8G("ngIf",e.totalOpened&&!e.organization.useSecretsManager),n.R7$(),n.Y8G("ngIf",e.totalOpened),n.R7$(),n.Y8G("ngIf",e.totalOpened)}}var ri,si;!function(e){e.Closed="closed",e.Submitted="submitted"}(ri||(ri={})),function(e){e.Selected="selected",e.NotSelected="not_selected",e.Disabled="disabled"}(si||(si={}));const oi=(e,t)=>e.open(ai,t);class ai{get productTier(){return this._productTier}set productTier(e){var t,i,n;this._productTier=e,null===(n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.controls)||void 0===i?void 0:i.productTier)||void 0===n||n.setValue(e)}get plan(){return this._plan}set plan(e){var t,i,n;this._plan=e,null===(n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.controls)||void 0===i?void 0:i.plan)||void 0===n||n.setValue(e)}constructor(e,t,i,o,a,l,c,d,u,h,p,m,v,f,y,b,w,S,I){this.dialogParams=e,this.dialogRef=t,this.toastService=i,this.apiService=o,this.i18nService=a,this.keyService=l,this.router=c,this.syncService=d,this.policyService=u,this.organizationService=h,this.messagingService=p,this.formBuilder=m,this.organizationApiService=v,this.accountService=f,this.billingNotificationService=y,this.subscriberBillingClient=b,this.taxClient=w,this.organizationWarningsService=S,this.configService=I,this.acceptingSponsorship=!1,this.showFree=!1,this.showCancel=!1,this.estimatedTax=0,this._productTier=g.K_.Free,this._plan=g.OL.Free,this.onSuccess=new n.bkB,this.onCanceled=new n.bkB,this.onTrialBillingSuccess=new n.bkB,this.loading=!0,this.ResultType=ri,this.selfHosted=!1,this.productTypes=g.K_,this.singleOrgPolicyAppliesToActiveUser=!1,this.isInTrialFlow=!1,this.discount=0,this.formGroup=this.formBuilder.group({name:[""],billingEmail:["",[r.k0.email]],businessOwned:[!1],premiumAccessAddon:[!1],additionalSeats:[0,[r.k0.min(0),r.k0.max(1e5)]],clientOwnerEmail:["",[r.k0.email]],plan:[this.plan],productTier:[this.productTier]}),this.billingFormGroup=this.formBuilder.group({paymentMethod:F.Pu.getFormGroup(),billingAddress:F.vU.getFormGroup()}),this.selectedInterval=1,this.planIntervals=g.$y,this.showPayment=!1,this.totalOpened=!1,this.isCardStateDisabled=!1,this.focusedIndex=null,this.isSubscriptionCanceled=!1,this.destroy$=new s.B,this.submit=()=>ee(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.billingFormGroup.markAllAsTouched(),this.formGroup.invalid||this.billingFormGroup.invalid&&!this.paymentMethod)return;this.formPromise=(()=>ee(this,void 0,void 0,function*(){var e;let t;const i=null===(e=this.sub)||void 0===e?void 0:e.subscription,n="canceled"===(null==i?void 0:i.status),r=(null==i?void 0:i.cancelled)&&this.organization.productTierType===g.K_.Free;return n||r?(yield this.restartSubscription(),t=this.organizationId):t=yield this.updateOrganization(),this.toastService.showToast({variant:"success",title:null,message:this.isSubscriptionCanceled?this.i18nService.t("restartOrganizationSubscription"):this.i18nService.t("organizationUpgraded")}),yield this.syncService.fullSync(!0),this.acceptingSponsorship||this.isInTrialFlow||(yield this.router.navigate(["/organizations/"+t+"/billing/subscription"])),this.isInTrialFlow&&this.onTrialBillingSuccess.emit({orgId:t,subLabelText:this.billingSubLabelText()}),t}))();const e=yield this.formPromise;this.onSuccess.emit({organizationId:e}),this.messagingService.send("organizationCreated",{organizationId:e}),this.dialogRef.close()}),this.getCardBrandIcon=()=>(0,R.nS)(this.paymentMethod)}ngOnInit(){return ee(this,void 0,void 0,function*(){var e,t,i,n,r,s,m,v;if(this.dialogParams.organizationId){this.currentPlanName=this.resolvePlanName(this.dialogParams.productTierType),this.sub=null!==(e=this.dialogParams.subscription)&&void 0!==e?e:yield this.organizationApiService.getSubscription(this.dialogParams.organizationId),this.dialogHeaderName=this.resolveHeaderName(this.sub),this.organizationId=this.dialogParams.organizationId,this.currentPlan=null===(t=this.sub)||void 0===t?void 0:t.plan,this.selectedPlan=null===(i=this.sub)||void 0===i?void 0:i.plan;const s=yield(0,o._)(this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id)));if(this.organization=yield(0,o._)(this.organizationService.organizations$(s).pipe((0,h.Sw)(this.organizationId))),"canceled"!==(null===(r=null===(n=this.sub)||void 0===n?void 0:n.subscription)||void 0===r?void 0:r.status))try{const e={type:"organization",data:this.organization},[t,i]=yield Promise.all([this.subscriberBillingClient.getPaymentMethod(e),this.subscriberBillingClient.getBillingAddress(e)]);this.paymentMethod=t,this.billingAddress=i}catch(w){this.billingNotificationService.handleError(w)}}this.selfHosted||(this.plans=yield this.apiService.getPlans(),this.passwordManagerPlans=this.plans.data.filter(e=>!!e.PasswordManager),this.secretsManagerPlans=this.plans.data.filter(e=>!!e.SecretsManager),this.productTier!==g.K_.Enterprise&&this.productTier!==g.K_.Teams||this.formGroup.controls.businessOwned.setValue(!0));const b=yield this.configService.getFeatureFlag(y.TO.PM26462_Milestone_3);if(this._familyPlan=b?g.OL.FamiliesAnnually:g.OL.FamiliesAnnually2025,this.currentPlan&&this.currentPlan.productTier!==g.K_.Enterprise){const e=this.passwordManagerPlans.find(e=>this.currentPlan.productTier===g.K_.Free?e.type===this._familyPlan:e.upgradeSortOrder==this.currentPlan.upgradeSortOrder+1);this.plan=e.type,this.productTier=e.productTier}this.upgradeFlowPrefillForm(),this.accountService.activeAccount$.pipe(f.F6,(0,c.n)(e=>this.policyService.policyAppliesToUser$(p.tt.SingleOrg,e)),(0,d.Q)(this.destroy$)).subscribe(e=>{this.singleOrgPolicyAppliesToActiveUser=e}),this.selfHosted||this.changedProduct(),this.planCards=[{name:this.i18nService.t("planNameTeams"),selected:!0},{name:this.i18nService.t("planNameEnterprise"),selected:!1}],this.discountPercentageFromSub=this.isSecretsManagerTrial()?0:null!==(v=null===(m=null===(s=this.sub)||void 0===s?void 0:s.customerDiscount)||void 0===m?void 0:m.percentOff)&&void 0!==v?v:0,yield this.setInitialPlanSelection(),this.isSubscriptionCanceled||(yield this.refreshSalesTax()),(0,a.z)([this.billingFormGroup.controls.billingAddress.controls.country.valueChanges,this.billingFormGroup.controls.billingAddress.controls.postalCode.valueChanges,this.billingFormGroup.controls.billingAddress.controls.taxId.valueChanges]).pipe((0,u.B)(1e3),(0,c.n)(()=>ee(this,void 0,void 0,function*(){return yield this.refreshSalesTax()})),(0,d.Q)(this.destroy$)).subscribe(),this.loading=!1})}resolveHeaderName(e){var t;return null!=e.subscription&&(this.isSubscriptionCanceled=e.subscription.cancelled&&(null===(t=this.sub)||void 0===t?void 0:t.plan.productTier)!==g.K_.Free,this.isSubscriptionCanceled)?this.i18nService.t("restartSubscription"):this.i18nService.t("upgradeFreeOrganization",this.resolvePlanName(this.dialogParams.productTierType))}setInitialPlanSelection(){return ee(this,void 0,void 0,function*(){this.focusedIndex=this.selectableProducts.length-1,this.isSubscriptionCanceled||(yield this.selectPlan(this.getPlanByType(g.K_.Enterprise)))})}getPlanByType(e){return this.selectableProducts.find(t=>t.productTier===e)}isSecretsManagerTrial(){var e,t,i,n;return null!==(n=null===(i=null===(t=null===(e=this.sub)||void 0===e?void 0:e.subscription)||void 0===t?void 0:t.items)||void 0===i?void 0:i.some(e=>{var t,i,n;return null===(n=null===(i=null===(t=this.sub)||void 0===t?void 0:t.customerDiscount)||void 0===i?void 0:i.appliesTo)||void 0===n?void 0:n.includes(e.productId)}))&&void 0!==n&&n}planTypeChanged(){return ee(this,void 0,void 0,function*(){yield this.selectPlan(this.getPlanByType(g.K_.Enterprise))})}updateInterval(e){return ee(this,void 0,void 0,function*(){this.selectedInterval=e,yield this.planTypeChanged()})}getPlanIntervals(){return[{name:g.$y[g.$y.Annually],value:g.$y.Annually},{name:g.$y[g.$y.Monthly],value:g.$y.Monthly}]}optimizedNgForRender(e){return e}getPlanCardContainerClasses(e,t){let i;switch(e==this.currentPlan?(i=si.Disabled,this.isCardStateDisabled=!0,this.focusedIndex=t):e==this.selectedPlan?(i=si.Selected,this.isCardStateDisabled=!1,this.focusedIndex=t):this.selectedInterval===g.$y.Monthly&&e.productTier==g.K_.Families?(i=si.Disabled,this.isCardStateDisabled=!0,this.focusedIndex=this.selectableProducts.length-1):(i=si.NotSelected,this.isCardStateDisabled=!1),i){case si.Selected:return["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-primary-600","hover:tw-border-primary-700","tw-border-2","!tw-border-primary-700","tw-rounded-lg"];case si.NotSelected:return["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","hover:tw-border-text-main","focus:tw-border-2","focus:tw-border-primary-700"];case si.Disabled:return this.isSubscriptionCanceled?["tw-cursor-not-allowed","tw-bg-secondary-100","tw-font-normal","tw-bg-blur","tw-text-muted","tw-block","tw-rounded","tw-w-80"]:["tw-cursor-not-allowed","tw-bg-secondary-100","tw-font-normal","tw-bg-blur","tw-text-muted","tw-block","tw-rounded"]}}selectPlan(e){return ee(this,void 0,void 0,function*(){if((this.selectedInterval!==g.$y.Monthly||e.productTier!=g.K_.Families)&&(e!==this.currentPlan||this.isSubscriptionCanceled)){this.selectedPlan=e,this.formGroup.patchValue({productTier:e.productTier});try{yield this.refreshSalesTax()}catch(t){this.estimatedTax=0}}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get upgradeRequiresPaymentMethod(){var e;const t=(null===(e=this.organization)||void 0===e?void 0:e.productTierType)===g.K_.Free,i=!this.showFree,n=!this.paymentMethod;return t&&i&&n}get selectedPlanInterval(){return this.isSubscriptionCanceled?this.currentPlan.isAnnual?"year":"month":this.selectedPlan.isAnnual?"year":"month"}get selectableProducts(){if(this.isSubscriptionCanceled)return[this.currentPlan];if(this.acceptingSponsorship){const e=this.passwordManagerPlans.find(e=>e.type===this._familyPlan);return this.discount=e.PasswordManager.basePrice,[e]}const e=this.formGroup.controls.businessOwned.value,t=this.passwordManagerPlans.filter(t=>t.type!==g.OL.Custom&&(!e||t.canBeUsedByBusiness)&&(this.showFree||t.productTier!==g.K_.Free)&&(t.productTier===g.K_.Free||t.productTier===g.K_.TeamsStarter||this.selectedInterval===g.$y.Annually&&t.isAnnual||this.selectedInterval===g.$y.Monthly&&!t.isAnnual)&&(t.productTier!==g.K_.Families||t.type===this._familyPlan)&&(!this.currentPlan||this.currentPlan.upgradeSortOrder<t.upgradeSortOrder)&&this.planIsEnabled(t));if(this.currentPlan.productTier===g.K_.Free&&this.selectedInterval===g.$y.Monthly&&!this.organization.useSecretsManager){const e=this.passwordManagerPlans.find(e=>e.productTier==g.K_.Families);t.push(e)}if(this.organization.useSecretsManager&&this.currentPlan.productTier===g.K_.Free){const e=t.findIndex(e=>e.productTier===g.K_.Families);-1!==e&&t.splice(e,1)}return this.currentPlan.productTier!==g.K_.Free&&t.push(this.currentPlan),t.sort((e,t)=>e.displaySortOrder-t.displaySortOrder),t}get selectablePlans(){var e;const t=this.formGroup.controls.productTier.value,i=(null===(e=this.passwordManagerPlans)||void 0===e?void 0:e.filter(e=>e.productTier===t&&this.planIsEnabled(e)))||[];return i.sort((e,t)=>e.displaySortOrder-t.displaySortOrder),i}get storageGb(){var e,t;return Math.max(0,(null!==(t=null===(e=this.sub)||void 0===e?void 0:e.maxStorageGb)&&void 0!==t?t:0)-this.selectedPlan.PasswordManager.baseStorageGb)}passwordManagerSeatTotal(e){var t;return!e.PasswordManager.hasAdditionalSeatsOption||this.isSecretsManagerTrial()?0:e.PasswordManager.seatPrice*Math.abs((null===(t=this.sub)||void 0===t?void 0:t.seats)||0)}secretsManagerSeatTotal(e,t){return e.SecretsManager.hasAdditionalSeatsOption?e.SecretsManager.seatPrice*Math.abs(t||0):0}additionalStorageTotal(e){return e.PasswordManager.hasAdditionalStorageOption?e.PasswordManager.additionalStoragePricePerGb*this.storageGb:0}additionalStoragePriceMonthly(e){return e.PasswordManager.additionalStoragePricePerGb}additionalServiceAccountTotal(e){return e.SecretsManager.hasAdditionalServiceAccountOption&&0!=this.additionalServiceAccount?e.SecretsManager.additionalPricePerServiceAccount*this.additionalServiceAccount:0}get passwordManagerSubtotal(){if(!this.selectedPlan||!this.selectedPlan.PasswordManager)return 0;let e=this.selectedPlan.PasswordManager.basePrice;return this.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&(e+=this.passwordManagerSeatTotal(this.selectedPlan)),this.selectedPlan.PasswordManager.hasPremiumAccessOption&&(e+=this.selectedPlan.PasswordManager.premiumAccessOptionPrice),this.selectedPlan.PasswordManager.hasAdditionalStorageOption&&(e+=this.additionalStorageTotal(this.selectedPlan)),e-this.discount}secretsManagerSubtotal(){var e;const t=this.selectedPlan;return t&&t.SecretsManager?(this.secretsManagerTotal||(this.secretsManagerTotal=t.SecretsManager.basePrice+this.secretsManagerSeatTotal(t,null===(e=this.sub)||void 0===e?void 0:e.smSeats)+this.additionalServiceAccountTotal(t)),this.secretsManagerTotal):this.secretsManagerTotal||0}get passwordManagerSeats(){var e;return this.selectedPlan?this.selectedPlan.productTier===g.K_.Families?this.selectedPlan.PasswordManager.baseSeats:null===(e=this.sub)||void 0===e?void 0:e.seats:0}get total(){return this.organization&&this.selectedPlan?this.organization.useSecretsManager?this.passwordManagerSubtotal+this.secretsManagerSubtotal()+this.estimatedTax:this.passwordManagerSubtotal+this.estimatedTax:0}get teamsStarterPlanIsAvailable(){return this.selectablePlans.some(e=>e.type===g.OL.TeamsStarter)}get additionalServiceAccount(){var e,t;if(!this.currentPlan||!this.currentPlan.SecretsManager)return 0;const i=((null===(e=this.currentPlan.SecretsManager)||void 0===e?void 0:e.baseServiceAccount)||0)-((null===(t=this.sub)||void 0===t?void 0:t.smServiceAccounts)||0);return i<=0?Math.abs(i):0}changedProduct(){const e=this.selectablePlans[0];this.setPlanType(e.type),this.handlePremiumAddonAccess(e.PasswordManager.hasPremiumAccessOption),this.handleAdditionalSeats(e.PasswordManager.hasAdditionalSeatsOption)}setPlanType(e){this.formGroup.controls.plan.setValue(e)}handlePremiumAddonAccess(e){this.formGroup.controls.premiumAccessAddon.setValue(!e)}handleAdditionalSeats(e){e?!this.currentPlan||this.currentPlan.PasswordManager.hasAdditionalSeatsOption?this.organization?this.formGroup.controls.additionalSeats.setValue(this.organization.seats):this.formGroup.controls.additionalSeats.setValue(1):this.formGroup.controls.additionalSeats.setValue(this.currentPlan.PasswordManager.baseSeats):this.formGroup.controls.additionalSeats.setValue(0)}restartSubscription(){return ee(this,void 0,void 0,function*(){const e=yield this.enterPaymentMethodComponent.tokenize(),t=(0,F.c3)(this.billingFormGroup.controls.billingAddress);yield this.subscriberBillingClient.restartSubscription({type:"organization",data:this.organization},e,t),this.organizationWarningsService.refreshInactiveSubscriptionWarning()})}updateOrganization(){return ee(this,void 0,void 0,function*(){var e,t,i;const n=new v.v;if(this.selectedPlan.productTier!==g.K_.Families&&(n.additionalSeats=null===(e=this.sub)||void 0===e?void 0:e.seats),(null===(t=this.sub)||void 0===t?void 0:t.maxStorageGb)>this.selectedPlan.PasswordManager.baseStorageGb&&(n.additionalStorageGb=(null===(i=this.sub)||void 0===i?void 0:i.maxStorageGb)-this.selectedPlan.PasswordManager.baseStorageGb),n.premiumAccessAddon=this.selectedPlan.PasswordManager.hasPremiumAccessOption&&this.formGroup.controls.premiumAccessAddon.value,n.planType=this.selectedPlan.type,this.showPayment&&(n.billingAddressCountry=this.billingFormGroup.controls.billingAddress.value.country,n.billingAddressPostalCode=this.billingFormGroup.controls.billingAddress.value.postalCode),this.buildSecretsManagerRequest(n),this.upgradeRequiresPaymentMethod||this.showPayment||!this.paymentMethod){const e=yield this.enterPaymentMethodComponent.tokenize(),t=(0,F.c3)(this.billingFormGroup.controls.billingAddress),i={type:"organization",data:this.organization};yield this.subscriberBillingClient.updateBillingAddress(i,t),yield this.subscriberBillingClient.updatePaymentMethod(i,e,null)}if(!this.organization.hasPublicAndPrivateKeys){const e=yield(0,o._)(this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id))),t=yield(0,o._)(this.keyService.orgKeys$(e).pipe((0,l.T)(e=>{var t;return null!==(t=null==e?void 0:e[this.organizationId])&&void 0!==t?t:null}))),i=yield this.keyService.makeKeyPair(t);n.keys=new m.B(i[0],i[1].encryptedString)}return yield this.organizationApiService.upgrade(this.organizationId,n),this.organizationId})}billingSubLabelText(){const e=this.selectedPlan,t=0===e.PasswordManager.basePrice?e.PasswordManager.seatPrice:e.PasswordManager.basePrice;let i="";return e.isAnnual?i+=`${this.i18nService.t("annual")} ($${t}/${this.i18nService.t("yr")})`:i+=`${this.i18nService.t("monthly")} ($${t}/${this.i18nService.t("monthAbbr")})`,i}buildSecretsManagerRequest(e){var t;e.useSecretsManager=this.organization.useSecretsManager,this.organization.useSecretsManager&&(this.selectedPlan.SecretsManager.hasAdditionalSeatsOption&&this.currentPlan.productTier===g.K_.Free?e.additionalSmSeats=this.organization.seats:(e.additionalSmSeats=null===(t=this.sub)||void 0===t?void 0:t.smSeats,e.additionalServiceAccounts=this.additionalServiceAccount))}upgradeFlowPrefillForm(){if(this.acceptingSponsorship)return this.formGroup.controls.productTier.setValue(g.K_.Families),void this.changedProduct();if(this.currentPlan&&this.currentPlan.productTier!==g.K_.Enterprise){const e=this.passwordManagerPlans.find(e=>this.currentPlan.productTier===g.K_.Free?e.type===this._familyPlan:this.currentPlan.productTier!==g.K_.Families||this.teamsStarterPlanIsAvailable?e.upgradeSortOrder===this.currentPlan.upgradeSortOrder+1:e.type===g.OL.TeamsAnnually);this.plan=e.type,this.productTier=e.productTier,this.changedProduct()}}planIsEnabled(e){return!e.disabled&&!e.legacyYear}toggleShowPayment(){this.showPayment=!0}toggleTotalOpened(){this.totalOpened=!this.totalOpened}calculateTotalAppliedDiscount(e){return e*(this.discountPercentageFromSub/100)}resolvePlanName(e){switch(e){case g.K_.Enterprise:return this.i18nService.t("planNameEnterprise");case g.K_.Free:return this.i18nService.t("planNameFree");case g.K_.Families:return this.i18nService.t("planNameFamilies");case g.K_.Teams:return this.i18nService.t("planNameTeams");case g.K_.TeamsStarter:return this.i18nService.t("planNameTeamsStarter")}}onKeydown(e,t){const i=Array.from(document.querySelectorAll(".product-card"));let n=t;const r="ArrowRight"===e.key||"ArrowDown"===e.key?1:-1;if(["ArrowRight","ArrowDown","ArrowLeft","ArrowUp"].includes(e.key)){do{n=(n+r+i.length)%i.length}while(this.isCardDisabled(n)&&n!==t);e.preventDefault(),setTimeout(()=>{const e=i[n];e.classList.contains("tw-bg-secondary-100")&&e.classList.contains("tw-text-muted")||null==e||e.focus()},0)}}onFocus(e){return ee(this,void 0,void 0,function*(){this.focusedIndex=e,yield this.selectPlan(this.selectableProducts[e])})}isCardDisabled(e){return this.selectableProducts[e]===(this.currentPlan||this.isCardStateDisabled)}manageSelectableProduct(e){return e}refreshSalesTax(){return ee(this,void 0,void 0,function*(){if(this.billingFormGroup.controls.billingAddress.invalid&&!this.billingAddress)return;const e=this.billingFormGroup.controls.billingAddress.valid?(0,F.c3)(this.billingFormGroup.controls.billingAddress):this.billingAddress,t=yield this.taxClient.previewTaxForOrganizationSubscriptionPlanChange(this.organizationId,(e=>{switch(e){case g.OL.FamiliesAnnually:case g.OL.FamiliesAnnually2025:return{tier:"families",cadence:"annually"};case g.OL.TeamsMonthly:return{tier:"teams",cadence:"monthly"};case g.OL.TeamsAnnually:return{tier:"teams",cadence:"annually"};case g.OL.EnterpriseMonthly:return{tier:"enterprise",cadence:"monthly"};case g.OL.EnterpriseAnnually:return{tier:"enterprise",cadence:"annually"}}})(this.selectedPlan.type),e);this.estimatedTax=t.tax})}canUpdatePaymentInformation(){return this.upgradeRequiresPaymentMethod||this.showPayment||!this.paymentMethod||this.isSubscriptionCanceled}get submitButtonLabel(){var e;return this.organization&&this.sub&&this.organization.productTierType!==g.K_.Free&&"canceled"===(null===(e=this.sub.subscription)||void 0===e?void 0:e.status)?this.i18nService.t("restart"):this.i18nService.t("upgrade")}get supportsTaxId(){return this.formGroup.value.productTier!==g.K_.Families}}ai.ɵfac=function(e){return new(e||ai)(n.rXU(I.Qs),n.rXU(A.ce),n.rXU(E.f),n.rXU(D.G),n.rXU(O.W),n.rXU(k.Lu),n.rXU(M.Ix),n.rXU(w.H),n.rXU(U.m),n.rXU(h.PV),n.rXU(b.U),n.rXU(r.ok),n.rXU(G.X),n.rXU(j.Di),n.rXU(P.g),n.rXU(C.Hd),n.rXU(C.jZ),n.rXU(T.S),n.rXU(N.w))},ai.ɵcmp=n.VBU({type:ai,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&n.GBs(F.Pu,5),2&e){let e;n.mGM(e=n.lsd())&&(t.enterPaymentMethodComponent=e.first)}},inputs:{acceptingSponsorship:"acceptingSponsorship",organizationId:"organizationId",showFree:"showFree",showCancel:"showCancel",productTier:"productTier",plan:"plan",providerId:"providerId"},outputs:{onSuccess:"onSuccess",onCanceled:"onCanceled",onTrialBillingSuccess:"onTrialBillingSuccess"},features:[n.Jv_([C.Hd,C.jZ])],decls:22,vars:19,consts:[["nonEnterprisePlans",""],["fullFeatureList",""],["notAcceptingSponsorship",""],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[1,"tw-mb-3","tw-flex","tw-justify-between"],[1,"tw-text-lg","tw-pr-1","tw-font-medium",3,"hidden"],[1,"tw-flex","tw-items-center","tw-gap-2"],["class","tw-inline-block",4,"ngIf"],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"],[1,"tw-inline-block"],[3,"selectedChange","selected"],[3,"value",4,"ngFor","ngForOf","ngForTrackBy"],[3,"value"],[1,"tw-grid","tw-grid-flow-col","tw-gap-4","tw-mb-4"],[3,"ngClass","id","click","keyup","focus",4,"ngFor","ngForOf","ngForTrackBy"],["type","info","title","SECRETS MANAGER SUBSCRIPTION",4,"ngIf"],["type","info","title","PASSWORD MANAGER SUBSCRIPTION",4,"ngIf"],[3,"click","keyup","focus","ngClass","id"],[1,"tw-relative"],["class","tw-bg-secondary-100 tw-text-center !tw-border-0 tw-text-sm tw-font-medium tw-py-1",3,"ngClass",4,"ngIf"],[1,"tw-px-2","tw-pb-[4px]",3,"ngClass"],[1,"tw-text-[1.25rem]","tw-mt-[6px]","tw-font-medium","tw-mb-0","tw-leading-[2rem]","tw-flex","tw-items-center"],[1,"tw-capitalize","tw-whitespace-nowrap"],["bitBadge","","variant","secondary","class","tw-ml-2 tw-align-middle",4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"tw-bg-secondary-100","tw-text-center","!tw-border-0","tw-text-sm","tw-font-medium","tw-py-1",3,"ngClass"],["bitBadge","","variant","secondary",1,"tw-ml-2","tw-align-middle"],[1,"tw-text-lg","tw-font-medium"],[1,"tw-text-xs","tw-px-0"],[1,"tw-text-sm","tw-font-medium"],["class","tw-text-xs tw-px-2 tw-font-medium tw-mb-1",4,"ngIf"],[1,"tw-text-xs","tw-px-2","tw-mb-1"],[1,"bwi-ul","tw-text-xs"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-success","bwi-li"],["class","bwi-ul tw-text-xs",4,"ngIf"],[1,"tw-text-xs","tw-px-2","tw-font-medium","tw-mb-1"],[1,"tw-px-2","tw-pb-2","tw-list-inside","tw-mb-0","tw-text-xs"],["class","tw-text-xs tw-px-2 tw-mb-1",4,"ngIf"],["class","bwi-ul tw-text-xs tw-mb-1",4,"ngIf"],[1,"bwi-ul","tw-text-xs","tw-mb-1"],["type","info","title","SECRETS MANAGER SUBSCRIPTION"],["type","info","title","PASSWORD MANAGER SUBSCRIPTION"],["bitTypography","h4"],[1,"tw-mt-4"],[1,"tw-text-lg","tw-mb-1"],[1,"tw-font-medium"],[1,"tw-text-xs","tw-font-light"],["type","button","size","small",3,"click","bitIconButton","label"],["class","tw-flex tw-flex-wrap tw-gap-4",4,"ngIf"],["class","tw-flex tw-flex-wrap tw-gap-4 tw-mt-4",4,"ngIf"],[1,"bwi","bwi-fw","bwi-billing"],[1,"tw-ml-2","tw-text-primary-600","tw-cursor-pointer",3,"click"],[3,"class"],[1,"bwi","bwi-fw","bwi-credit-card"],[1,"bwi","bwi-fw","bwi-paypal","tw-text-primary-600"],[3,"group"],[3,"group","scenario"],[1,"tw-flex","tw-flex-wrap","tw-gap-4"],["class","tw-w-1/2",4,"ngIf"],[1,"tw-w-1/2"],["class","tw-font-medium tw-mb-1",4,"ngIf"],["class","tw-mb-1 tw-flex tw-justify-between","bitTypography","body2",4,"ngIf"],["class","tw-mb-0 tw-flex tw-justify-between","bitTypography","body2",4,"ngIf"],["class","tw-font-medium tw-mt-3 tw-mb-1",4,"ngIf"],[1,"tw-font-medium","tw-mb-1"],["bitTypography","body2",1,"tw-mb-1","tw-flex","tw-justify-between"],[1,"tw-line-through"],["bitTypography","body2",1,"tw-mb-0","tw-flex","tw-justify-between"],[1,"tw-text-xs"],[1,"tw-line-through","tw-text-xs"],[1,"tw-font-medium","tw-mt-3","tw-mb-1"],["class","tw-font-medium tw-mt-2 tw-mb-0",4,"ngIf"],["class","tw-font-medium tw-mt-3 tw-mb-0",4,"ngIf"],[1,"tw-font-medium","tw-mt-2","tw-mb-0"],[1,"tw-font-medium","tw-mt-3","tw-mb-0"],[1,"tw-flex","tw-flex-wrap","tw-gap-4","tw-mt-4"],[1,"tw-flex","tw-justify-between","tw-border-0","tw-border-solid","tw-border-t","tw-border-secondary-300","tw-pt-2","tw-mb-0"],[1,"tw-text-xs","tw-font-medium"]],template:function(e,t){1&e&&(n.j41(0,"form",3)(1,"bit-dialog",4)(2,"span",5),n.EFF(3),n.k0s(),n.j41(4,"div",6)(5,"p"),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"div",7)(9,"span",8),n.EFF(10),n.nI1(11,"i18n"),n.k0s(),n.j41(12,"div",9),n.DNE(13,se,3,3,"div",10),n.k0s()(),n.DNE(14,$e,7,6,"ng-container",11)(15,ni,23,27,"ng-container",11),n.k0s(),n.qex(16,12),n.j41(17,"button",13),n.EFF(18),n.k0s(),n.j41(19,"button",14),n.EFF(20),n.nI1(21,"i18n"),n.k0s(),n.bVm(),n.k0s()()),2&e&&(n.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),n.R7$(),n.Y8G("loading",t.loading),n.R7$(2),n.SpI(" ",t.dialogHeaderName," "),n.R7$(3),n.JRh(n.bMT(7,13,"upgradePlans")),n.R7$(3),n.Y8G("hidden",t.isSubscriptionCanceled),n.R7$(),n.JRh(n.bMT(11,15,"selectAPlan")),n.R7$(3),n.Y8G("ngIf",!t.isSubscriptionCanceled),n.R7$(),n.Y8G("ngIf",!t.loading&&!t.selfHosted&&t.passwordManagerPlans),n.R7$(),n.Y8G("ngIf",t.formGroup.value.productTier!==t.productTypes.Free||t.isSubscriptionCanceled),n.R7$(3),n.SpI(" ",t.submitButtonLabel," "),n.R7$(),n.Y8G("bitDialogClose",t.ResultType.Closed),n.R7$(),n.SpI(" ",n.bMT(21,17,"cancel")," "))},dependencies:[x.r,V.YU,V.Sq,V.bT,r.qT,r.cb,r.j4,B.$,z.L,L.n,K.Q,q.G,_.I,X.m,Y.I,H.s,W.H,J.a,Z.r,F.Pu,F.vU,S.i,V.GH,V.PV,V.oe,Q.$],encapsulation:2})},16496:(e,t,i)=>{"use strict";i.d(t,{a:()=>h});var n=i(74208),r=i(94573),s=i(33812),o=i(33277),a=i(47696),l=i(12694);const c=["labelContent"],d=["*",[["","bitBadge",""]]];let u=0;class h{constructor(){this.id="bit-toggle-"+u++,this.groupComponent=(0,n.WQX)(l.H),this.value=r.hFB.required(),this.labelContent=(0,r.ebz)("labelContent"),this.badgeElement=(0,r.sbv)(a.n),this.hasBadge=(0,o.EW)(()=>!!this.badgeElement()),this.labelTitle=(0,n.vPA)(null),this.name=this.groupComponent.name,this.selected=(0,o.EW)(()=>this.groupComponent.selected()===this.value()),this.hostClasses=["tw-group/toggle","tw-flex","tw-min-w-16"],this.inputClasses=["tw-peer/toggle-input","tw-appearance-none","tw-outline-none"],this.labelClasses=["tw-h-full","tw-w-full","tw-flex","tw-items-center","tw-justify-center","tw-gap-1.5","!tw-font-medium","tw-leading-5","tw-transition","tw-text-center","tw-text-sm","tw-border-primary-600","!tw-text-primary-600","tw-border-solid","tw-border-y","tw-border-r","tw-border-l-0","tw-cursor-pointer","hover:tw-bg-hover-default","group-first-of-type/toggle:tw-border-l","group-first-of-type/toggle:tw-rounded-s-full","group-last-of-type/toggle:tw-rounded-e-full","peer-focus-visible/toggle-input:tw-outline-none","peer-focus-visible/toggle-input:tw-ring","peer-focus-visible/toggle-input:tw-ring-offset-2","peer-focus-visible/toggle-input:tw-ring-primary-600","peer-focus-visible/toggle-input:tw-z-10","peer-focus-visible/toggle-input:tw-bg-primary-600","peer-focus-visible/toggle-input:tw-border-primary-600","peer-focus-visible/toggle-input:!tw-text-contrast","peer-checked/toggle-input:tw-bg-primary-600","peer-checked/toggle-input:tw-border-primary-600","peer-checked/toggle-input:!tw-text-contrast","tw-py-1.5","tw-px-3","!tw-mb-0"],(0,s.mal)(()=>{var e;const t=null===(e=this.labelContent())||void 0===e?void 0:e.nativeElement.innerText;t&&this.labelTitle.set(t)})}handleInputChange(){this.groupComponent.onInputInteraction(this.value())}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=s.VBU({type:h,selectors:[["bit-toggle"]],contentQueries:function(e,t,i){1&e&&s.C6U(i,t.badgeElement,a.n,5),2&e&&s.NyB()},viewQuery:function(e,t){1&e&&s.wEZ(t.labelContent,c,5),2&e&&s.NyB()},hostAttrs:["tabindex","-1"],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.hostClasses)},inputs:{value:[1,"value"]},ngContentSelectors:["*","[bitBadge]"],decls:7,vars:10,consts:[["labelContent",""],["type","radio",3,"change","id","name","checked"],[3,"for","title"],[1,"tw-line-clamp-2","tw-break-words"],[1,"tw-shrink-0",3,"hidden"]],template:function(e,t){if(1&e){const e=s.RV6();s.NAR(d),s.rj2(0,"input",1),s.VwU("change",function(){return n.eBV(e),n.Njj(t.handleInputChange())}),s.eux(),s.rj2(1,"label",2)(2,"span",3,0),s.SdG(4),s.eux(),s.rj2(5,"span",4),s.SdG(6,1),s.eux()()}2&e&&(s.HbH(t.inputClasses),s.Avn("id",t.id)("name",t.name)("checked",t.selected()),s.R7$(),s.HbH(t.labelClasses),s.Avn("htmlFor",t.id)("title",t.labelTitle()),s.R7$(4),s.Avn("hidden",!t.hasBadge()))},encapsulation:2,changeDetection:0})},16671:(e,t,i)=>{"use strict";i.d(t,{z:()=>a});var n=i(59777),r=i(78781);const s=["https://","http://","ssh://","ftp://","sftp://","irc://","vnc://","rdp://","ms-rd:","chrome://","iosapp://","androidapp://"];class o{static canLaunch(e){if(r.A.isNullOrWhitespace(e))return!1;for(let t=0;t<s.length;t++)if(0===e.indexOf(s[t]))return!0;return!1}}class a{constructor(e){e&&(this.match=e.match)}get uri(){return this._uri}set uri(e){this._uri=e,this._domain=void 0,this._canLaunch=void 0}get domain(){return null==this._domain&&null!=this.uri&&(this._domain=r.A.getDomain(this.uri),""===this._domain&&(this._domain=void 0)),this._domain}get hostname(){if(this.match!==n.L.RegularExpression)return null==this._hostname&&null!=this.uri&&(this._hostname=r.A.getHostname(this.uri),""===this._hostname&&(this._hostname=void 0)),this._hostname}get host(){if(this.match!==n.L.RegularExpression)return null==this._host&&null!=this.uri&&(this._host=r.A.getHost(this.uri),""===this._host&&(this._host=void 0)),this._host}get hostnameOrUri(){return null!=this.hostname?this.hostname:this.uri}get hostOrUri(){return null!=this.host?this.host:this.uri}get isWebsite(){return null!=this.uri&&(0===this.uri.indexOf("http://")||0===this.uri.indexOf("https://")||this.uri.indexOf("://")<0&&!r.A.isNullOrWhitespace(r.A.getDomain(this.uri)))}get canLaunch(){return null!=this._canLaunch||(null!=this.uri&&this.match!==n.L.RegularExpression?this._canLaunch=o.canLaunch(this.launchUri):this._canLaunch=!1),this._canLaunch}get launchUri(){if(null!=this.uri)return this.uri.indexOf("://")<0&&!r.A.isNullOrWhitespace(r.A.getDomain(this.uri))?"http://"+this.uri:this.uri}static fromJSON(e){return Object.assign(new a,e)}static fromSdkLoginUriView(e){if(null==e)return;const t=new a;return t.uri=e.uri,t.match=e.match,t}toSdkLoginUriView(){var e,t;return{uri:null!==(e=this.uri)&&void 0!==e?e:void 0,match:null!==(t=this.match)&&void 0!==t?t:void 0,uriChecksum:void 0}}matchesUri(e,t,i,s){var o;if(!this.uri||!e)return!1;let a=null!==(o=this.match)&&void 0!==o?o:i;null!=a||(a=n.L.Domain),s&&a===n.L.Never&&(a=n.L.Domain);const l=r.A.getDomain(e),c=t.add(l);switch(a){case n.L.Domain:return this.matchesDomain(e,c);case n.L.Host:{const t=r.A.getHost(e);return null!=t&&t===r.A.getHost(this.uri)}case n.L.Exact:return e===this.uri;case n.L.StartsWith:return e.startsWith(this.uri);case n.L.RegularExpression:try{return new RegExp(this.uri,"i").test(e)}catch(d){return!1}case n.L.Never:return!1}return!1}matchesDomain(e,t){if(null==e||null==this.domain||!t.has(this.domain))return!1;if(r.A.DomainMatchBlacklist.has(this.domain)){const t=r.A.getHost(e);return!r.A.DomainMatchBlacklist.get(this.domain).has(t)}return!0}}},16845:(e,t,i)=>{"use strict";i.d(t,{m:()=>h});var n=i(72737),r=i(33338),s=i(93695),o=i(8029),a=i(73276),l=i(3204),c=i(3097),d=i(39306),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class h{constructor(e,t,i,s){this.key=e,this.$encryptor=t,this.encryptedState=s.getUser(i,e.toEncryptedStateKey()),this.combinedState$=(0,r.z)([this.encryptedState.combinedState$,this.$encryptor]).pipe((0,a.H)(e=>u(this,[e],void 0,function*([[e,t],i]){return[e,yield this.declassifyAll(i,t)]})),(0,c.u)({connector:()=>new n.m(1),resetOnRefCountZero:()=>{var t;return(0,o.O)(null!==(t=e.options.cleanupDelayMs)&&void 0!==t?t:6e4)}})),this.state$=this.combinedState$.pipe((0,l.T)(([,e])=>e))}get userId(){return this.encryptedState.userId}static from(e,t,i,n){return new h(t,n,e,i)}declassifyItem(e,t){return u(this,arguments,void 0,function*(e,{id:t,secret:i,disclosed:n}){const r=d.k.fromJSON(i),s=yield e.decrypt(r),o=this.key.classifier.declassify(n,s);return[t,this.key.options.deserializer(o)]})}declassifyAll(e,t){return u(this,void 0,void 0,function*(){if(null==t)return null;const i=t.map(t=>u(this,void 0,void 0,function*(){return this.declassifyItem(e,t)})),n=yield Promise.all(i);return this.key.reconstruct(n)})}classifyItem(e,t){return u(this,arguments,void 0,function*(e,[t,i]){const n=this.key.classifier.classify(i),r=yield e.encrypt(n.secret);return{id:t,secret:JSON.parse(JSON.stringify(r)),disclosed:n.disclosed}})}classifyAll(e,t){return u(this,void 0,void 0,function*(){if(null==t)return null;const i=this.key.deconstruct(t).map(t=>u(this,void 0,void 0,function*(){return this.classifyItem(e,t)}));return yield Promise.all(i)})}update(e){return u(this,arguments,void 0,function*(e,t=null){var i,n,o;const a=(0,r.z)([null!==(i=null==t?void 0:t.combineLatestWith)&&void 0!==i?i:(0,s.of)(null),this.$encryptor]);let l,c,d;yield this.encryptedState.update(e=>e,{shouldUpdate:(e,t)=>(l=e,[c,d]=t,!1),combineLatestWith:a});const u=yield this.declassifyAll(d,l);if(!(null===(o=null===(n=null==t?void 0:t.shouldUpdate)||void 0===n?void 0:n.call(t,u,c))||void 0===o||o))return u;const h=e(u,c),p=yield this.classifyAll(d,h);return yield this.encryptedState.update(()=>p),h})}}},16888:(e,t,i)=>{"use strict";i.d(t,{G:()=>r});var n=i(7248);class r extends n.V{}},16992:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{}},17197:(e,t,i)=>{"use strict";i.d(t,{t:()=>a});var n=i(98221),r=i(27760),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({providers:[n.cK,r.S,n.Hd]})},17343:(e,t,i)=>{"use strict";i.d(t,{A:()=>_});var n=i(67553),r=i(39488),s=i(31442),o=i(22166),a=i(24593),l=i(62819),c=i(77723),d=i(74208),u=i(33812),h=i(5556),p=i(21274),m=i(35500),v=i(50700),f=i(77468),g=i(26333),y=i(93103),b=i(47428),w=i(47696),S=i(44432),I=i(10672),k=i(59032),C=i(30930),T=i(38410),F=i(12694),R=i(16496),P=i(71944),x=i(93748),$=i(88016),E=i(91975),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function D(e,t){1&e&&(u.j41(0,"div"),u.nrm(1,"i",3),u.nI1(2,"i18n"),u.j41(3,"span",4),u.EFF(4),u.nI1(5,"i18n"),u.k0s()()),2&e&&(u.R7$(),u.Y8G("title",u.mNQ(u.bMT(2,3,"loading"))),u.R7$(3),u.JRh(u.bMT(5,5,"loading")))}function O(e,t){1&e&&(u.j41(0,"bit-callout",7),u.nI1(1,"i18n"),u.EFF(2),u.nI1(3,"i18n"),u.k0s()),2&e&&(u.Y8G("title",u.mNQ(u.bMT(1,3,"goodNews"))),u.R7$(2),u.SpI(" ",u.bMT(3,5,"noReusedPasswords")," "))}function M(e,t){if(1&e&&(u.qex(0),u.j41(1,"bit-toggle",15),u.EFF(2),u.j41(3,"span",16),u.EFF(4),u.k0s()(),u.bVm()),2&e){const e=t.$implicit,i=u.XpG(4);u.R7$(),u.Y8G("value",e),u.R7$(),u.SpI(" ",i.getName(e)," "),u.R7$(2),u.SpI(" ",i.getCount(e)," ")}}function U(e,t){if(1&e){const e=u.RV6();u.j41(0,"bit-toggle-group",13),u.nI1(1,"async"),u.nI1(2,"i18n"),u.bIt("selectedChange",function(t){d.eBV(e);const i=u.XpG(3);return d.Njj(i.filterOrgToggle(t))}),u.DNE(3,M,5,3,"ng-container",14),u.k0s()}if(2&e){const e=u.XpG(3);u.Y8G("selected",u.bMT(1,3,e.filterOrgStatus$)),u.BMQ("aria-label",u.bMT(2,5,"addAccessFilter")),u.R7$(3),u.Y8G("ngForOf",e.filterStatus)}}function G(e,t){1&e&&(u.qex(0,17),u.nrm(1,"th",18),u.j41(2,"th",18),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.j41(5,"th",18),u.EFF(6),u.nI1(7,"i18n"),u.k0s(),u.j41(8,"th",19),u.EFF(9),u.nI1(10,"i18n"),u.k0s(),u.bVm()),2&e&&(u.R7$(3),u.JRh(u.bMT(4,3,"name")),u.R7$(3),u.JRh(u.bMT(7,5,"owner")),u.R7$(3),u.JRh(u.bMT(10,7,"timesReused")))}function j(e,t){if(1&e){const e=u.RV6();u.qex(0),u.j41(1,"a",24),u.nI1(2,"i18n"),u.bIt("click",function(){d.eBV(e);const t=u.XpG().$implicit,i=u.XpG(3);return d.Njj(i.selectCipher(t))}),u.EFF(3),u.k0s(),u.bVm()}if(2&e){const e=u.XpG().$implicit;u.R7$(),u.Y8G("title",u.mNQ(u.i5U(2,3,"editItemWithName",e.name))),u.R7$(2),u.JRh(e.name)}}function N(e,t){if(1&e&&(u.j41(0,"span"),u.EFF(1),u.k0s()),2&e){const e=u.XpG().$implicit;u.R7$(),u.JRh(e.name)}}function V(e,t){1&e&&(u.qex(0),u.nrm(1,"i",25),u.nI1(2,"i18n"),u.j41(3,"span",4),u.EFF(4),u.nI1(5,"i18n"),u.k0s(),u.bVm()),2&e&&(u.R7$(),u.Y8G("title",u.mNQ(u.bMT(2,3,"shared"))),u.R7$(3),u.JRh(u.bMT(5,5,"shared")))}function B(e,t){1&e&&(u.qex(0),u.nrm(1,"i",26),u.nI1(2,"i18n"),u.j41(3,"span",4),u.EFF(4),u.nI1(5,"i18n"),u.k0s(),u.bVm()),2&e&&(u.R7$(),u.Y8G("title",u.mNQ(u.bMT(2,3,"attachments"))),u.R7$(3),u.JRh(u.bMT(5,5,"attachments")))}function z(e,t){if(1&e&&(u.nrm(0,"app-org-badge",27),u.nI1(1,"async"),u.nI1(2,"orgNameFromId")),2&e){const e=u.XpG().$implicit,t=u.XpG(3);u.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",u.i5U(2,5,e.organizationId,u.bMT(1,3,t.organizations$)))}}function L(e,t){if(1&e&&(u.j41(0,"td",18),u.nrm(1,"app-vault-icon",20),u.k0s(),u.j41(2,"td",18),u.DNE(3,j,4,6,"ng-container",21)(4,N,2,1,"ng-template",null,0,u.C5r)(6,V,6,7,"ng-container",1)(7,B,6,7,"ng-container",1),u.nrm(8,"br"),u.j41(9,"small"),u.EFF(10),u.k0s()(),u.j41(11,"td",18),u.DNE(12,z,3,8,"app-org-badge",22),u.k0s(),u.j41(13,"td",19)(14,"span",23),u.EFF(15),u.nI1(16,"i18n"),u.k0s()()),2&e){const e=t.$implicit,i=u.sdS(5),n=u.XpG(3);u.R7$(),u.Y8G("cipher",e),u.R7$(2),u.Y8G("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),u.R7$(3),u.Y8G("ngIf",!n.organization&&e.organizationId),u.R7$(),u.Y8G("ngIf",e.hasAttachments),u.R7$(3),u.JRh(e.subTitle),u.R7$(2),u.Y8G("ngIf",!n.organization),u.R7$(3),u.SpI(" ",u.i5U(16,8,"reusedXTimes",n.passwordUseMap.get(e.login.password))," ")}}function K(e,t){if(1&e&&(u.qex(0),u.j41(1,"bit-callout",8),u.nI1(2,"i18n"),u.EFF(3),u.nI1(4,"number"),u.nI1(5,"i18n"),u.k0s(),u.DNE(6,U,4,7,"bit-toggle-group",9),u.j41(7,"bit-table-scroll",10),u.DNE(8,G,11,9,"ng-container",11)(9,L,17,11,"ng-template",12),u.k0s(),u.bVm()),2&e){const e=u.XpG(2);u.R7$(),u.Y8G("title",u.mNQ(u.bMT(2,7,"reusedPasswordsFound"))),u.R7$(2),u.SpI(" ",u.brH(5,11,"reusedPasswordsFoundReportDesc",u.bMT(4,9,e.ciphers.length),e.vaultMsg)," "),u.R7$(3),u.Y8G("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),u.R7$(),u.Y8G("dataSource",e.dataSource)("rowSize",75),u.R7$(),u.Y8G("ngIf",!e.isAdminConsoleActive)}}function q(e,t){if(1&e&&(u.j41(0,"div",5),u.DNE(1,O,4,7,"bit-callout",6)(2,K,10,15,"ng-container",1),u.k0s()),2&e){const e=u.XpG();u.R7$(),u.Y8G("ngIf",!e.ciphers.length),u.R7$(),u.Y8G("ngIf",e.ciphers.length)}}class _ extends c.n{constructor(e,t,i,n,r,s,o,a,l){super(e,i,r,t,n,s,o,a,l),this.cipherService=e,this.organizationService=t,this.ciphersToCheckForReusedPasswords=[],this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return A(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return A(this,void 0,void 0,function*(){this.ciphersToCheckForReusedPasswords=yield this.getAllCiphers();const e=yield this.checkCiphersForReusedPasswords(this.ciphersToCheckForReusedPasswords);this.filterCiphersByOrg(e)})}checkCiphersForReusedPasswords(e){return A(this,void 0,void 0,function*(){const t=[];this.passwordUseMap=new Map,this.filterStatus=[0],e.forEach(e=>{const{type:i,login:n,isDeleted:r,edit:o,viewPassword:a}=e;i===s.gC.Login&&null!=n.password&&""!==n.password&&!r&&(this.organization||o)&&a&&(t.push(e),this.passwordUseMap.has(n.password)?this.passwordUseMap.set(n.password,this.passwordUseMap.get(n.password)+1):this.passwordUseMap.set(n.password,1))});return t.filter(e=>this.passwordUseMap.has(e.login.password)&&this.passwordUseMap.get(e.login.password)>1)})}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return A(this,void 0,void 0,function*(){if(e===a.r.Deleted)return this.ciphersToCheckForReusedPasswords=this.ciphersToCheckForReusedPasswords.filter(e=>e.id!==t.id),null;const i=this.ciphersToCheckForReusedPasswords.findIndex(e=>e.id===t.id);-1!==i&&(this.ciphersToCheckForReusedPasswords[i]=t);const n=yield this.checkCiphersForReusedPasswords(this.ciphersToCheckForReusedPasswords);return this.filterCiphersByOrg(n),t})}}_.ɵfac=function(e){return new(e||_)(u.rXU(h.p),u.rXU(n.PV),u.rXU(p.o3),u.rXU(m.Di),u.rXU(o.qX),u.rXU(v.W),u.rXU(r.H),u.rXU(o.hI),u.rXU(l.l))},_.ɵcmp=u.VBU({type:_,selectors:[["app-reused-passwords-report"]],standalone:!1,features:[u.Vt3],decls:7,vars:5,consts:[["cantManage",""],[4,"ngIf"],["class","tw-mt-4",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[3,"dataSource","rowSize"],["header","",4,"ngIf"],["bitRowDef",""],[3,"selectedChange","selected"],[4,"ngFor","ngForOf"],[3,"value"],["bitBadge","","variant","info"],["header",""],["bitCell",""],["bitCell","",1,"tw-text-right"],[3,"cipher"],[4,"ngIf","ngIfElse"],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],["bitBadge","","variant","warning"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(u.nrm(0,"app-header"),u.j41(1,"bit-container")(2,"p"),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.DNE(5,D,6,7,"div",1)(6,q,3,2,"div",2),u.k0s()),2&e&&(u.R7$(3),u.JRh(u.bMT(4,3,"reusedPasswordsReportDesc")),u.R7$(2),u.Y8G("ngIf",!t.hasLoaded&&t.loading),u.R7$(),u.Y8G("ngIf",t.hasLoaded))},dependencies:[f.Sq,f.bT,g.R,y.Y,b.x,w.n,S.G,I.H,k.L,C.a,T.Q,C.N,F.H,R.a,P.P,x.f,f.Jj,f.QX,$.$,E.t],encapsulation:2})},17386:(e,t,i)=>{"use strict";i.d(t,{k:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["","bitTabListContainer",""]],hostAttrs:[1,"tw-inline-flex","tw-flex-wrap","tw-leading-5"]})},17721:(e,t,i)=>{"use strict";i.d(t,{Y:()=>g});var n=i(77468),r=i(94573),s=i(51757),o=i(36801),a=i(86226),l=i(33812);const c=[[["bit-label"]],"*",[["bit-hint"]]];function d(e,t){1&e&&(l.j41(0,"span",2),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" (",l.bMT(2,1,"required"),")"))}function u(e,t){1&e&&l.eu8(0)}function h(e,t){if(1&e&&(l.j41(0,"fieldset")(1,"legend",1),l.SdG(2),l.nVh(3,d,3,3,"span",2),l.k0s(),l.DNE(4,u,1,0,"ng-container",3),l.k0s()),2&e){const e=l.XpG(),t=l.sdS(3);l.R7$(3),l.vxM(e.required?3:-1),l.R7$(),l.Y8G("ngTemplateOutlet",t)}}function p(e,t){1&e&&l.eu8(0)}function m(e,t){if(1&e&&l.DNE(0,p,1,0,"ng-container",3),2&e){l.XpG();const e=l.sdS(3);l.Y8G("ngTemplateOutlet",e)}}function v(e,t){1&e&&(l.j41(0,"div"),l.SdG(1,1),l.k0s(),l.SdG(2,2,["ngProjectAs","bit-hint",5,["bit-hint"]]))}let f=0;class g{get name(){var e,t;return null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.name)||void 0===t?void 0:t.toString()}constructor(e){this.ngControl=e,this.disabled=!1,this.block=(0,r.hFB)(!1),this.role="radiogroup",this.id=(0,r.hFB)("bit-radio-group-"+f++),this.classList=["tw-block","tw-mb-4"],this.label=(0,r.sbv)(a.j),null!=e&&(e.valueAccessor=this)}get required(){var e,t,i;return null!==(i=null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.control)||void 0===t?void 0:t.hasValidator(s.k0.required))&&void 0!==i&&i}writeValue(e){this.selected=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled=e}onInputChange(e){var t;this.selected=e,null===(t=this.onChange)||void 0===t||t.call(this,this.selected)}onBlur(){var e;null===(e=this.onTouched)||void 0===e||e.call(this)}}g.ɵfac=function(e){return new(e||g)(l.rXU(s.vO,10))},g.ɵcmp=l.VBU({type:g,selectors:[["bit-radio-group"]],contentQueries:function(e,t,i){1&e&&l.C6U(i,t.label,a.j,5),2&e&&l.NyB()},hostVars:4,hostBindings:function(e,t){2&e&&(l.Avn("id",t.id()),l.BMQ("role",t.role),l.HbH(t.classList))},inputs:{block:[1,"block"],id:[1,"id"]},ngContentSelectors:["bit-label","*","bit-hint"],decls:4,vars:2,consts:[["content",""],[1,"tw-mb-1","tw-block","tw-text-sm","tw-font-medium","tw-text-main"],[1,"tw-text-xs","tw-font-normal"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(l.NAR(c),l.nVh(0,h,5,2,"fieldset"),l.nVh(1,m,1,1,"ng-container"),l.DNE(2,v,3,0,"ng-template",null,0,l.C5r)),2&e&&(l.vxM(t.label()?0:-1),l.R7$(),l.vxM(t.label()?-1:1))},dependencies:[n.T3,o.$Z],encapsulation:2})},17898:(e,t,i)=>{"use strict";i.d(t,{b:()=>n});class n{}},17989:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var n=i(39306),r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s{buildDomainModel(e,t,i,r=[]){for(const s in i){if(!i.hasOwnProperty(s))continue;const o=t[i[s]||s];r.indexOf(s)>-1?e[s]=o||null:e[s]=o?new n.k(o):null}}buildDataModel(e,t,i,n=[]){for(const r in i){if(!i.hasOwnProperty(r))continue;const s=e[i[r]||r];n.indexOf(r)>-1?t[r]=null!=s?s:null:t[r]=null!=s?s.encryptedString:null}}decryptObj(e,t,i){return r(this,arguments,void 0,function*(e,t,i,n=null,r="No Domain Context"){var s,o;for(const a of i)t[a]=null!==(o=yield null===(s=e[a])||void 0===s?void 0:s.decrypt(null,n,`Property: ${a}; ObjectContext: ${r}`))&&void 0!==o?o:null;return t})}}},18030:(e,t,i)=>{"use strict";i.d(t,{Tl:()=>s,VI:()=>r,jo:()=>o});var n=i(78991);function r(e,t){const i={id:e.id,type:e.type,name:s(e.i18nKeys.name,t),generate:s(e.i18nKeys.generateCredential,t),onGeneratedMessage:s(e.i18nKeys.credentialGenerated,t),credentialType:s(e.i18nKeys.credentialType,t),copy:s(e.i18nKeys.copyCredential,t),useGeneratedValue:s(e.i18nKeys.useCredential,t),onlyOnRequest:!e.capabilities.autogenerate,request:e.capabilities.fields};return e.i18nKeys.description&&(i.description=s(e.i18nKeys.description,t)),i}function s(e,t){return(0,n._g)(e)?t.t(e):e.literal}function o(e,t){return(null!=e?e:0)<(null!=t?t:Number.POSITIVE_INFINITY)}},18499:(e,t,i)=>{"use strict";i.d(t,{N:()=>r,m:()=>n});class n{}class r extends n{}},18990:(e,t,i)=>{"use strict";i.d(t,{m:()=>l});var n=i(30675),r=i(60893),s=i(25065),o=i(74208),a=i(33812);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.$C({type:l}),l.ɵinj=o.G2t({imports:[s.G,r.t,n.a,s.G,r.t]})},19488:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var n=i(17989),r=i(24072),s=i(9184),o=i(6528),a=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class l extends n.A{constructor(e){super(),null!=e&&(this.cardholderName=(0,r.e)(e.cardholderName),this.brand=(0,r.e)(e.brand),this.number=(0,r.e)(e.number),this.expMonth=(0,r.e)(e.expMonth),this.expYear=(0,r.e)(e.expYear),this.code=(0,r.e)(e.code))}decrypt(e){return a(this,arguments,void 0,function*(e,t="No Cipher Context"){return this.decryptObj(this,new o.G,["cardholderName","brand","number","expMonth","expYear","code"],e,"DomainType: Card; "+t)})}toCardData(){const e=new s.b;return this.buildDataModel(this,e,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null}),e}static fromJSON(e){if(null==e)return;const t=new l;return t.cardholderName=(0,r.u)(e.cardholderName),t.brand=(0,r.u)(e.brand),t.number=(0,r.u)(e.number),t.expMonth=(0,r.u)(e.expMonth),t.expYear=(0,r.u)(e.expYear),t.code=(0,r.u)(e.code),t}toSdkCard(){var e,t,i,n,r,s;return{cardholderName:null===(e=this.cardholderName)||void 0===e?void 0:e.toSdk(),brand:null===(t=this.brand)||void 0===t?void 0:t.toSdk(),number:null===(i=this.number)||void 0===i?void 0:i.toSdk(),expMonth:null===(n=this.expMonth)||void 0===n?void 0:n.toSdk(),expYear:null===(r=this.expYear)||void 0===r?void 0:r.toSdk(),code:null===(s=this.code)||void 0===s?void 0:s.toSdk()}}static fromSdkCard(e){if(!e)return;const t=new l;return t.cardholderName=(0,r.u)(e.cardholderName),t.brand=(0,r.u)(e.brand),t.number=(0,r.u)(e.number),t.expMonth=(0,r.u)(e.expMonth),t.expYear=(0,r.u)(e.expYear),t.code=(0,r.u)(e.code),t}}},19543:(e,t,i)=>{"use strict";i.d(t,{f:()=>n});class n{}},19638:(e,t,i)=>{"use strict";i.d(t,{N:()=>n});const n=Object.freeze({addyio:"addyio",bitwarden:"bitwarden",duckduckgo:"duckduckgo",fastmail:"fastmail",forwardemail:"forwardemail",mozilla:"mozilla",simplelogin:"simplelogin"})},20136:(e,t,i)=>{"use strict";i.d(t,{S2:()=>l,oR:()=>c,mJ:()=>d});var n=i(68467);class r{constructor(e,t,i=()=>Date.now()){this.logger=e,this.now=i,this.context=t&&"object"==typeof t?t:{}}debug(e,t){this.log(e,n.xk.Debug,t)}info(e,t){this.log(e,n.xk.Info,t)}warn(e,t){this.log(e,n.xk.Warning,t)}error(e,t){this.log(e,n.xk.Error,t)}panic(e,t){this.log(e,n.xk.Error,t);throw new Error(null!=t?t:"string"==typeof e?e:"a fatal error occurred")}log(e,t,i){const n=Object.assign(Object.assign({},this.context),{message:i,content:null!=e?e:void 0,level:s(t),"@timestamp":this.now()});"string"!=typeof e||i||(n.message=e,delete n.content),this.logger.write(t,n)}}function s(e){switch(e){case n.xk.Debug:return"debug";case n.xk.Info:return"information";case n.xk.Warning:return"warning";case n.xk.Error:return"error";default:return`${e}`}}const o=(0,i(78991).ol)({debug(e,t){},info(e,t){},warn(e,t){},error(e,t){},panic(e,t){throw"string"!=typeof e||t?new Error(t):new Error(e)}});function a(e,t,i){e.warning({method:t,context:i,provider:"tools/log",message:"Semantic logging enabled. 🦟 Please report this bug if you see it 🦟"})}function l(e){return o}function c(e,t){return t.length&&a(e,"enableLogForTypes",{types:t}),function(i){const{type:n}=i;if("string"==typeof n&&t.includes(n)){const s=new r(e,i);return a(e,"enableLogForTypes",{targetType:n,available:t,loggerContext:i}),s}return o}}function d(e,t,i){if(e){const e=new r(t,i);return a(t,"ifEnabledSemanticLoggerProvider",i),e}return o}},20183:(e,t,i)=>{"use strict";i.d(t,{A:()=>k});var n=i(16878),r=i(72245),s=i(3204),o=i(28202),a=i(43978),l=i(56953),c=i(56962),d=i(78781),u=i(22848),h=i(74208),p=i(12012),m=i(68455),v=i(89105),f=i(27866),g=i(18499),y=i(11224),b=i(50700),w=i(52717),S=i(35500),I=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class k{constructor(e,t,i,r,o,a,l,c,d,u,h,p){this.apiService=e,this.authService=t,this.keyService=i,this.encryptService=r,this.policyApiService=o,this.policyService=a,this.logService=l,this.organizationApiService=c,this.organizationUserApiService=d,this.i18nService=u,this.organizationInviteService=h,this.accountService=p,this.orgNameSubject=new n.t(null),this.orgName$=this.orgNameSubject.pipe((0,s.T)(e=>e.replace(/\+/g," ")))}validateAndAcceptInvite(e,t){return I(this,void 0,void 0,function*(){if(null==e)throw new Error("Invite cannot be null.");return e.initOrganization?(yield this.acceptAndInitOrganization(e,t),!0):(yield this.masterPasswordPolicyCheckRequired(e))?(yield this.organizationInviteService.setOrganizationInvitation(e),this.authService.logOut(()=>{}),!1):(yield this.accept(e),!0)})}acceptAndInitOrganization(e,t){return I(this,void 0,void 0,function*(){yield this.prepareAcceptAndInitRequest(e,t).then(t=>this.organizationUserApiService.postOrganizationUserAcceptInit(e.organizationId,e.organizationUserId,t)),yield this.apiService.refreshIdentityToken(),yield this.organizationInviteService.clearOrganizationInvitation()})}prepareAcceptAndInitRequest(e,t){return I(this,void 0,void 0,function*(){const i=new o.i0;i.token=e.token;const[n,r]=yield this.keyService.makeOrgKey(t),[s,a]=yield this.keyService.makeKeyPair(r),c=yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),r);return i.key=n.encryptedString,i.keys=new l.B(s,a.encryptedString),i.collectionName=c.encryptedString,i})}accept(e){return I(this,void 0,void 0,function*(){yield this.prepareAcceptRequest(e).then(t=>this.organizationUserApiService.postOrganizationUserAccept(e.organizationId,e.organizationUserId,t)),yield this.apiService.refreshIdentityToken(),yield this.organizationInviteService.clearOrganizationInvitation()})}prepareAcceptRequest(e){return I(this,void 0,void 0,function*(){const t=new o.I;if(t.token=e.token,yield this.resetPasswordEnrollRequired(e)){const i=yield this.organizationApiService.getKeys(e.organizationId);if(null==i)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const n=d.A.fromB64ToArray(i.publicKey),s=(yield(0,r._)(this.accountService.activeAccount$)).id,o=yield(0,r._)(this.keyService.userKey$(s)),a=yield this.encryptService.encapsulateKeyUnsigned(o,n);t.resetPasswordKey=a.encryptedString}return t})}resetPasswordEnrollRequired(e){return I(this,void 0,void 0,function*(){const t=yield this.getPolicies(e);if(null==t||0===t.length)return!1;const i=this.policyService.getResetPasswordPolicyOptions(t,e.organizationId);return i[1]&&i[0].autoEnrollEnabled})}masterPasswordPolicyCheckRequired(e){return I(this,void 0,void 0,function*(){const t=yield this.getPolicies(e);if(null==t||0===t.length)return!1;const i=t.some(e=>e.type===a.tt.MasterPassword&&e.enabled);let n=yield this.organizationInviteService.getOrganizationInvite();(null==n?void 0:n.email)!==e.email&&(yield this.organizationInviteService.clearOrganizationInvitation(),n=null);return i&&null==n})}getPolicies(e){return I(this,void 0,void 0,function*(){if(null==this.policyCache)try{this.policyCache=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId)}catch(t){this.logService.error(t)}return this.policyCache})}}k.ɵfac=function(e){return new(e||k)(h.KVO(p.G),h.KVO(m.u),h.KVO(u.Lu),h.KVO(v.N),h.KVO(f.m),h.KVO(g.m),h.KVO(c.K),h.KVO(y.X),h.KVO(o.uB),h.KVO(b.W),h.KVO(w.i),h.KVO(S.Di))},k.ɵprov=h.jDH({token:k,factory:k.ɵfac})},20246:(e,t,i)=>{"use strict";i.d(t,{B:()=>r});var n=i(20702);class r extends n.r{constructor(e){var t;super(e),this.toDelete=!1,this.sponsoringOrganizationUserId=this.getResponseProperty("SponsoringOrganizationUserId"),this.friendlyName=this.getResponseProperty("FriendlyName"),this.offeredToEmail=this.getResponseProperty("OfferedToEmail"),this.planSponsorshipType=this.getResponseProperty("PlanSponsorshipType"),this.lastSyncDate=this.getResponseProperty("LastSyncDate"),this.validUntil=this.getResponseProperty("ValidUntil"),this.toDelete=null!==(t=this.getResponseProperty("ToDelete"))&&void 0!==t&&t,this.isAdminInitiated=this.getResponseProperty("IsAdminInitiated"),this.notes=this.getResponseProperty("Notes"),this.statusMessage=this.getResponseProperty("StatusMessage"),this.statusClass=this.getResponseProperty("StatusClass")}}},20266:(e,t,i)=>{"use strict";i.d(t,{m:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 66.67">
    <path class="tw-fill-illustration-bg-secondary" d="M13.333 15a5 5 0 0 1 5-5H75a5 5 0 0 1 5 5v40a5 5 0 0 1-5 5H18.333a5 5 0 0 1-5-5V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 11.667H18.333A3.333 3.333 0 0 0 15 15v40a3.333 3.333 0 0 0 3.333 3.333H75A3.333 3.333 0 0 0 78.333 55V15A3.333 3.333 0 0 0 75 11.667ZM18.333 10a5 5 0 0 0-5 5v40a5 5 0 0 0 5 5H75a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5H18.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M79.167 20h-65v-1.667h65V20Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M76.667 15a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0ZM71.667 15a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0ZM66.667 15a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0Z"/>
    <path class="tw-fill-illustration-tertiary" d="M15 37.5a6.667 6.667 0 0 1 6.667-6.667H65a6.667 6.667 0 0 1 6.667 6.667v3.333A6.667 6.667 0 0 1 65 47.5H21.667A6.667 6.667 0 0 1 15 40.833V37.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65 32.5H21.667a5 5 0 0 0-5 5v3.333a5 5 0 0 0 5 5H65a5 5 0 0 0 5-5V37.5a5 5 0 0 0-5-5Zm-43.333-1.667A6.667 6.667 0 0 0 15 37.5v3.333a6.667 6.667 0 0 0 6.667 6.667H65a6.667 6.667 0 0 0 6.667-6.667V37.5A6.667 6.667 0 0 0 65 30.833H21.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M24.167 40.834v-3.137l-2.333 4.665a1.667 1.667 0 0 0 2.332-1.528Zm-3.334-.197 2.333-4.665a1.667 1.667 0 0 0-2.332 1.528v3.137Zm5-3.137a3.333 3.333 0 0 0-6.666 0v3.334a3.333 3.333 0 0 0 6.666 0V37.5Zm6.667.197v3.137a1.667 1.667 0 0 1-2.332 1.528l2.332-4.665Zm-1-1.725-2.333 4.665V37.5a1.667 1.667 0 0 1 2.332-1.528Zm-.667-1.805a3.333 3.333 0 0 1 3.334 3.333v3.334a3.333 3.333 0 1 1-6.667 0V37.5a3.333 3.333 0 0 1 3.333-3.333Zm10 6.667v-3.137l-2.332 4.665a1.667 1.667 0 0 0 2.332-1.528Zm-3.333-.197 2.333-4.665A1.667 1.667 0 0 0 37.5 37.5v3.137Zm5-3.137a3.333 3.333 0 0 0-6.667 0v3.334a3.333 3.333 0 0 0 6.667 0V37.5Zm6.667.197v3.137a1.667 1.667 0 0 1-2.333 1.528l2.333-4.665Zm-1.001-1.725-2.333 4.665V37.5a1.667 1.667 0 0 1 2.333-1.528Zm-.666-1.805a3.333 3.333 0 0 1 3.333 3.333v3.334a3.333 3.333 0 0 1-6.666 0V37.5a3.333 3.333 0 0 1 3.333-3.333Zm10 6.667v-3.137l-2.332 4.665a1.667 1.667 0 0 0 2.333-1.528Zm-3.333-.197 2.332-4.665a1.667 1.667 0 0 0-2.333 1.528v3.137Zm5-3.137a3.333 3.333 0 1 0-6.667 0v3.334a3.333 3.333 0 0 0 6.667 0V37.5Zm6.666 3.334v-3.137l-2.332 4.665a1.667 1.667 0 0 0 2.332-1.528Zm-3.333-.197 2.333-4.665A1.667 1.667 0 0 0 62.5 37.5v3.137Zm5-3.137a3.333 3.333 0 0 0-6.667 0v3.334a3.333 3.333 0 0 0 6.667 0V37.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M0 23.333a5 5 0 0 1 5-5h24.167a5 5 0 0 1 5 5v48.333a5 5 0 0 1-5 5H5a5 5 0 0 1-5-5V23.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.167 20H5a3.333 3.333 0 0 0-3.333 3.333v48.333A3.333 3.333 0 0 0 5 75h24.167a3.333 3.333 0 0 0 3.333-3.334V23.333A3.333 3.333 0 0 0 29.167 20ZM5 18.333a5 5 0 0 0-5 5v48.333a5 5 0 0 0 5 5h24.167a5 5 0 0 0 5-5V23.333a5 5 0 0 0-5-5H5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M6.667 33.75a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM12.083 35a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M6.667 33.75a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0ZM12.083 35a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M6.667 42.917a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm2.083 1.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M6.667 42.917a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm3.333 0a1.25 1.25 0 1 1-2.5 0 1.25 1.25 0 0 1 2.5 0Zm2.083 1.25a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm11.667 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.333 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm-3.334 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M13.333 23.333c0-.46.373-.833.834-.833H20a.833.833 0 1 1 0 1.667h-5.833a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M16.25 54.166a7.083 7.083 0 1 0 7.083 7.084 1.667 1.667 0 1 1 3.334 0c0 5.753-4.664 10.416-10.417 10.416S5.833 67.003 5.833 61.25s4.664-10.417 10.417-10.417a1.667 1.667 0 1 1 0 3.333Z" clip-rule="evenodd"/>
  </svg>
`},20377:(e,t,i)=>{"use strict";i.d(t,{E:()=>T,Gc:()=>F,LA:()=>C,Zm:()=>x,bt:()=>R,eO:()=>I,pP:()=>k,y_:()=>P});var n=i(72737),r=i(45505),s=i(56986),o=i(61687),a=i(88507),l=i(21991),c=i(34040),d=i(11891),u=i(69194),h=i(14928),p=i(43219),m=i(3204),v=i(39444),f=i(21588),g=i(12610),y=i(14803),b=i(8131);function w(e){return e}function S(e,t){return{expectedValue:e,actualValue:t}}function I(e=w,t=S){return(0,r.F)((0,g.Z)(null),(0,v.J)(),(0,m.T)(([i,n],r)=>{if(0===r)return n;const s=e(i),o=e(n);if(s===o)return n;throw t(s,o)}))}function k(e,t){return(0,m.T)(i=>(null!=i?i:[]).reduce(e,structuredClone(t)))}function C(){return(0,c.F)((e,t)=>{let i=!0;for(const n in t)i&&(i=e[n]===t[n]);return i})}function T(e){if(Array.isArray(e)){const t=e.filter(e=>!!e).map(e=>e.pipe((0,p.w)(),(0,d.q)(!0)));return(0,o.O)(t)}return e.pipe((0,p.w)(),(0,d.q)(!0))}function F(e){const t=Array.isArray(e)?e:[e];return(0,r.F)((0,l.N)(e=>{const i=new n.m(1);return e.subscribe(i),(0,s.x)((0,a.y)(t).pipe((0,h.$)(),(0,p.w)()),i).pipe((0,y.Q)(T(i)))}))}function R(...e){return(0,l.N)(t=>{const i=new n.m(1);t.subscribe(i);const r=e.map(e=>{const t=new n.m(1);return e.subscribe(t),t});return(0,s.x)((0,a.y)(r).pipe((0,h.$)(),(0,p.w)()),i).pipe((0,b.E)(...r),(0,y.Q)(T(i)))})}function P(e){return(0,r.F)((null==e?void 0:e.distinct)?(0,c.F)(e.distinct):e=>e,(0,m.T)((t,i)=>{var n,r;if(i>0)throw new Error(`${null!==(r=null===(n=null==e?void 0:e.name)||void 0===n?void 0:n.call(e))&&void 0!==r?r:"unknown"} observable should only emit one value.`);return t}))}function x(e,t){return(0,r.F)((0,f.S)(([i],n)=>{var r,s,o,a;const l=null!==(s=null===(r=null==t?void 0:t.key)||void 0===r?void 0:r.call(t,n))&&void 0!==s?s:n;let c=null==i?void 0:i.get(l);if(c)return[i,c];c=e(n),null==i||i.set(l,c);const d=i.size-(null!==(o=null==t?void 0:t.size)&&void 0!==o?o:1);return d>0&&Array.from(null!==(a=null==i?void 0:i.keys())&&void 0!==a?a:[]).slice(0,d).forEach(e=>null==i?void 0:i.delete(e)),[i,c]},[new Map,null]),(0,m.T)(([,e])=>e),(0,u.p)(e=>!!e))}},20702:(e,t,i)=>{"use strict";i.d(t,{r:()=>n});class n{constructor(e){this.response=e}getResponseProperty(e,t=null,i=!1){if(null==e||""===e)throw new Error("propertyName must not be null/empty.");if(null==t&&null!=this.response&&(t=this.response),null==t)return null;if(!i&&void 0===t[e]){let i=null;i=e.charAt(0)===e.charAt(0).toUpperCase()?e.charAt(0).toLowerCase():e.charAt(0).toUpperCase(),e.length>1&&(i+=e.slice(1)),void 0===t[e=i]&&(e=e.toLowerCase()),void 0===t[e]&&(e=e.toUpperCase())}return t[e]}}},20798:(e,t,i)=>{"use strict";i.d(t,{KW:()=>r.K,eO:()=>n.eO,mw:()=>n.mw,sE:()=>n.sE});var n=i(46128),r=i(86561)},21001:(e,t,i)=>{"use strict";i.d(t,{HQ:()=>r,bg:()=>n});const n=Object.freeze({JIT_PROVISIONED_MP_ORG_USER:"jit_provisioned_mp_org_user",TDE_ORG_USER_RESET_PASSWORD_PERMISSION_REQUIRES_MP:"tde_org_user_reset_password_permission_requires_mp",OFFBOARDED_TDE_ORG_USER:"offboarded_tde_org_user",OFFBOARDED_TDE_ORG_USER_UNTRUSTED_DEVICE:"offboarded_tde_org_user_untrusted_device"});class r{}},21274:(e,t,i)=>{"use strict";i.d(t,{u3:()=>O,ce:()=>A,o3:()=>G});var n=i(81525),r=i(43380),s=i(37831),o=i(74208),a=i(83731),l=i(23649),c=i(66046),d=i(69194),u=i(44500),h=i(72245),p=i(3204),m=i(68455),v=i(84110),f=i(50700),g=i(29400),y=i(30424),b=i(51757),w=i(45154),S=i(26657),I=i(56898),k=i(67311),C=i(33812),T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function F(e,t){if(1&e){const e=C.RV6();C.j41(0,"button",7),C.bIt("click",function(){o.eBV(e);const t=C.XpG();return o.Njj(t.dialogRef.close(!1))}),C.EFF(1),C.k0s()}if(2&e){const e=C.XpG();C.R7$(),C.SpI(" ",e.cancelButtonText," ")}}const R={primary:"bwi-business",success:"bwi-star",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error"},P={primary:"tw-text-primary-600",success:"tw-text-success",info:"tw-text-info",warning:"tw-text-warning",danger:"tw-text-danger"};class x{get iconClasses(){var e;return[null!==(e=this.simpleDialogOpts.icon)&&void 0!==e?e:R[this.simpleDialogOpts.type],P[this.simpleDialogOpts.type]]}constructor(e,t,i){this.dialogRef=e,this.i18nService=t,this.simpleDialogOpts=i,this.formGroup=new b.gE({}),this.showCancelButton=null!==this.simpleDialogOpts.cancelButtonText,this.accept=()=>T(this,void 0,void 0,function*(){this.simpleDialogOpts.acceptAction&&(yield this.simpleDialogOpts.acceptAction()),this.simpleDialogOpts.disableClose||this.dialogRef.close(!0)}),this.localizeText()}localizeText(){var e,t;this.title=this.translate(this.simpleDialogOpts.title),this.content=this.translate(this.simpleDialogOpts.content),this.acceptButtonText=this.translate(null!==(e=this.simpleDialogOpts.acceptButtonText)&&void 0!==e?e:{key:"yes"}),this.showCancelButton&&(this.cancelButtonText=this.translate(null!==(t=this.simpleDialogOpts.cancelButtonText)&&void 0!==t?t:void 0!==this.simpleDialogOpts.acceptButtonText?{key:"cancel"}:{key:"no"}))}translate(e){var t;return"object"==typeof e?this.i18nService.t(e.key,...null!==(t=e.placeholders)&&void 0!==t?t:[]):e}}x.ɵfac=function(e){return new(e||x)(C.rXU(n.ce),C.rXU(f.W),C.rXU(n.Qs))},x.ɵcmp=C.VBU({type:x,selectors:[["ng-component"]],decls:11,vars:8,consts:[[3,"formGroup","bitSubmit"],["bitDialogIcon","","aria-hidden","true",1,"bwi","tw-text-3xl"],["bitDialogTitle",""],["bitDialogContent",""],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(C.j41(0,"form",0)(1,"bit-simple-dialog"),C.nrm(2,"i",1),C.j41(3,"span",2),C.EFF(4),C.k0s(),C.j41(5,"div",3),C.EFF(6),C.k0s(),C.qex(7,4),C.j41(8,"button",5),C.EFF(9),C.k0s(),C.nVh(10,F,2,1,"button",6),C.bVm(),C.k0s()()),2&e&&(C.Y8G("formGroup",t.formGroup)("bitSubmit",t.accept),C.R7$(2),C.HbH(t.iconClasses),C.R7$(2),C.JRh(t.title),C.R7$(2),C.JRh(t.content),C.R7$(3),C.SpI(" ",t.acceptButtonText," "),C.R7$(),C.vxM(t.showCancelButton?10:-1))},dependencies:[b.X1,b.qT,b.cb,b.j4,w.L,k.o,k.L,I.Q,S.$],encapsulation:2});var $=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class E{enable(){document.body.classList.add("tw-overflow-hidden")}disable(){document.body.classList.remove("tw-overflow-hidden")}attach(){}detach(){}}class A{}class D extends r.qC{constructor(){super(),this.abortController=null,this.prevBreakpoint=null,"undefined"!=typeof window&&(this.abortController=new AbortController,this.updatePosition(),window.addEventListener("resize",this.updatePosition.bind(this),{signal:this.abortController.signal}))}dispose(){var e;null===(e=this.abortController)||void 0===e||e.abort(),this.abortController=null,super.dispose()}updatePosition(){const e=!(0,y.a)("md"),t=e?"small":"large";this.prevBreakpoint!==t&&(this.prevBreakpoint=t,e?this.bottom().centerHorizontally():this.centerVertically().centerHorizontally(),this.apply())}}class O extends r.qC{constructor(){super(),this.centerHorizontally().centerVertically()}}class M{constructor(e){this.drawerService=e,this.isDrawer=!0,this._closed=new c.B,this.closed=this._closed.asObservable(),this.disableClose=!1,this.componentInstance=null}close(e,t){this.disableClose||(this.drawerService.close(this.portal),this._closed.next(e),this._closed.complete())}}class U{constructor(){this.isDrawer=!1}close(e,t){this.cdkDialogRefBase.close(e,t)}get closed(){return this.cdkDialogRefBase.closed}get disableClose(){return this.cdkDialogRefBase.disableClose}set disableClose(e){this.cdkDialogRefBase.disableClose=e}get componentInstance(){return this.cdkDialogRefBase.componentInstance}}class G{constructor(){this.dialog=(0,o.WQX)(n.lG),this.drawerService=(0,o.WQX)(g.d),this.injector=(0,o.WQX)(o.zZn),this.router=(0,o.WQX)(l.Ix,{optional:!0}),this.authService=(0,o.WQX)(m.u,{optional:!0}),this.i18nService=(0,o.WQX)(f.W),this.backDropClasses=["tw-fixed","tw-bg-black","tw-bg-opacity-30","tw-inset-0"],this.defaultScrollStrategy=new E,this.activeDrawer=null,this.router&&this.authService&&this.router.events.pipe((0,d.p)(e=>e instanceof l.wF),(0,u.n)(()=>this.authService.getAuthStatus()),(0,d.p)(e=>e!==v.J.Unlocked),(0,a.pQ)()).subscribe(()=>this.closeAll())}open(e,t){var i;const n=new U,r=this.createInjector({data:null==t?void 0:t.data,dialogRef:n}),s=Object.assign({backdropClass:this.backDropClasses,scrollStrategy:this.defaultScrollStrategy,positionStrategy:null!==(i=null==t?void 0:t.positionStrategy)&&void 0!==i?i:new D,injector:r},t);return n.cdkDialogRefBase=this.dialog.open(e,s),n}openDrawer(e,t){var i;null===(i=this.activeDrawer)||void 0===i||i.close(),this.activeDrawer=new M(this.drawerService);const n=new s.A8(e,null,this.createInjector({data:null==t?void 0:t.data,dialogRef:this.activeDrawer}));return this.activeDrawer.portal=n,this.drawerService.open(n),this.activeDrawer}openSimpleDialog(e){return $(this,void 0,void 0,function*(){const t=this.openSimpleDialogRef(e);return(0,h._)(t.closed.pipe((0,p.T)(e=>!!e)))})}openSimpleDialogRef(e){return this.open(x,{data:e,disableClose:e.disableClose,positionStrategy:new O})}closeAll(){return this.dialog.closeAll()}createInjector(e){return o.zZn.create({providers:[{provide:n.Qs,useValue:e.data},{provide:A,useValue:e.dialogRef},{provide:n.ce,useValue:e.dialogRef}],parent:this.injector})}}G.ɵfac=function(e){return new(e||G)},G.ɵprov=o.jDH({token:G,factory:G.ɵfac})},21495:(e,t,i)=>{"use strict";i.d(t,{F:()=>n.F});var n=i(36801)},21551:(e,t,i)=>{"use strict";var n;i.d(t,{zq:()=>s,EO:()=>n,g2:()=>a,Cc:()=>d,Kg:()=>l,wH:()=>u}),function(e){e.Local="local",e.Memory="memory",e.Session="session"}(n||(n={}));var r=i(66046);class s{}var o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a extends s{constructor(){super(...arguments),this.store=new Map,this.updatesSubject=new r.B}get valuesRequireDeserialization(){return!1}get updates$(){return this.updatesSubject.asObservable()}get(e){if(this.store.has(e)){const t=this.store.get(e);return Promise.resolve(t)}return Promise.resolve(null)}has(e){return o(this,void 0,void 0,function*(){return null!=(yield this.get(e))})}save(e,t){if(null==t)return this.remove(e);const i=structuredClone(t);return this.store.set(e,i),this.updatesSubject.next({key:e,updateType:"save"}),Promise.resolve()}remove(e){return this.store.delete(e),this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}}var l,c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d extends s{constructor(){super(...arguments),this.store={},this.updatesSubject=new r.B}get valuesRequireDeserialization(){return!0}get updates$(){return this.updatesSubject.asObservable()}get(e){const t=this.store[e];if(t){const e=JSON.parse(t);return Promise.resolve(e)}return Promise.resolve(null)}has(e){return c(this,void 0,void 0,function*(){return null!=(yield this.get(e))})}save(e,t){return null==t?this.remove(e):(this.store[e]=JSON.stringify(t),this.updatesSubject.next({key:e,updateType:"save"}),Promise.resolve())}remove(e){return delete this.store[e],this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}}!function(e){e.Both="both",e.Disk="disk",e.Memory="memory"}(l||(l={}));class u{constructor(e,t){this.diskStorageService=e,this.memoryStorageService=t}get(e,t){switch(e){case"disk":return[e,this.diskStorageService];case"memory":return[e,this.memoryStorageService];default:throw new Error(`Unexpected location: ${e}`)}}}},21587:(e,t,i)=>{"use strict";i.d(t,{P:()=>X});var n=i(94573),r=i(51757),s=i(66046),o=i(93695),a=i(3204),l=i(12610),c=i(14803),d=i(56962),u=i(78781),h=i(79783),p=i(25065),m=i(45482),v=i(14055),f=i(32287),g=i(33812),y=i(50700),b=i(69855),w=i(85800),S=i(71364),I=i(44432),k=i(86226),C=i(97553),T=i(43759),F=i(24374),R=i(17721),P=i(33886),x=i(68923),$=i(58806),E=i(77468),A=i(88016),D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const O=(e,t)=>t.value;function M(e,t){1&e&&(g.j41(0,"h5",2),g.EFF(1),g.nI1(2,"i18n"),g.k0s()),2&e&&(g.R7$(),g.JRh(g.bMT(2,1,"paymentMethod")))}function U(e,t){1&e&&(g.j41(0,"bit-radio-button",7)(1,"bit-label"),g.nrm(2,"i",11),g.EFF(3),g.nI1(4,"i18n"),g.k0s()()),2&e&&(g.Y8G("value","bankAccount"),g.R7$(3),g.SpI(" ",g.bMT(4,2,"bankAccount")," "))}function G(e,t){1&e&&(g.j41(0,"bit-radio-button",8)(1,"bit-label"),g.nrm(2,"i",12),g.EFF(3),g.nI1(4,"i18n"),g.k0s()()),2&e&&(g.Y8G("value","payPal"),g.R7$(3),g.SpI(" ",g.bMT(4,2,"payPal")," "))}function j(e,t){1&e&&(g.j41(0,"bit-radio-button",9)(1,"bit-label"),g.nrm(2,"i",13),g.EFF(3),g.nI1(4,"i18n"),g.k0s()()),2&e&&(g.Y8G("value","accountCredit"),g.R7$(3),g.SpI(" ",g.bMT(4,2,"accountCredit")," "))}function N(e,t){if(1&e&&(g.j41(0,"div",10)(1,"div",14)(2,"app-payment-label",15),g.EFF(3),g.nI1(4,"i18n"),g.k0s(),g.nrm(5,"div",16),g.k0s(),g.j41(6,"div",17),g.nrm(7,"img",18),g.k0s(),g.j41(8,"div",14)(9,"app-payment-label",15),g.EFF(10),g.nI1(11,"i18n"),g.k0s(),g.nrm(12,"div",16),g.k0s(),g.j41(13,"div",14)(14,"app-payment-label",15),g.EFF(15),g.nI1(16,"i18n"),g.j41(17,"button",19),g.nrm(18,"i",20),g.k0s(),g.j41(19,"bit-popover",21,0),g.nI1(21,"i18n"),g.j41(22,"p",22),g.EFF(23),g.nI1(24,"i18n"),g.k0s()()(),g.nrm(25,"div",16),g.k0s()()),2&e){const e=g.sdS(20),t=g.XpG();g.R7$(2),g.Y8G("for","stripe-card-number-"+t.instanceId),g.R7$(),g.SpI(" ",g.bMT(4,13,"cardNumberLabel")," "),g.R7$(2),g.Y8G("id","stripe-card-number-"+t.instanceId),g.R7$(4),g.Y8G("for","stripe-card-expiry-"+t.instanceId),g.R7$(),g.SpI(" ",g.bMT(11,15,"expiration")," "),g.R7$(2),g.Y8G("id","stripe-card-expiry-"+t.instanceId),g.R7$(2),g.Y8G("for","stripe-card-cvc-"+t.instanceId),g.R7$(),g.SpI(" ",g.bMT(16,17,"securityCodeSlashCVV")," "),g.R7$(2),g.Y8G("bitPopoverTriggerFor",e)("position","above-end"),g.R7$(2),g.Y8G("title",g.bMT(21,19,"cardSecurityCode")),g.R7$(4),g.JRh(g.bMT(24,21,"cardSecurityCodeDescription")),g.R7$(2),g.Y8G("id","stripe-card-cvc-"+t.instanceId)}}function V(e,t){if(1&e&&(g.qex(0),g.j41(1,"bit-callout",23),g.nI1(2,"i18n"),g.EFF(3),g.nI1(4,"i18n"),g.k0s(),g.j41(5,"div",24)(6,"bit-form-field",25)(7,"bit-label"),g.EFF(8),g.nI1(9,"i18n"),g.k0s(),g.nrm(10,"input",26),g.k0s(),g.j41(11,"bit-form-field",25)(12,"bit-label"),g.EFF(13),g.nI1(14,"i18n"),g.k0s(),g.nrm(15,"input",27),g.k0s(),g.j41(16,"bit-form-field",25)(17,"bit-label"),g.EFF(18),g.nI1(19,"i18n"),g.k0s(),g.nrm(20,"input",28),g.k0s(),g.j41(21,"bit-form-field",25)(22,"bit-label"),g.EFF(23),g.nI1(24,"i18n"),g.k0s(),g.j41(25,"bit-select",29),g.nrm(26,"bit-option",30),g.nI1(27,"i18n"),g.nrm(28,"bit-option",30),g.nI1(29,"i18n"),g.nrm(30,"bit-option",30),g.nI1(31,"i18n"),g.k0s()()(),g.bVm()),2&e){const e=g.XpG();g.R7$(),g.Y8G("title",g.mNQ(g.bMT(2,24,"verifyBankAccount"))),g.R7$(2),g.SpI(" ",g.bMT(4,26,"requiredToVerifyBankAccountWithStripe")," "),g.R7$(3),g.Y8G("disableMargin",!0),g.R7$(2),g.JRh(g.bMT(9,28,"routingNumber")),g.R7$(2),g.Y8G("formControl",e.group().controls.bankAccount.controls.routingNumber),g.R7$(),g.Y8G("disableMargin",!0),g.R7$(2),g.JRh(g.bMT(14,30,"accountNumber")),g.R7$(2),g.Y8G("formControl",e.group().controls.bankAccount.controls.accountNumber),g.R7$(),g.Y8G("disableMargin",!0),g.R7$(2),g.JRh(g.bMT(19,32,"accountHolderName")),g.R7$(2),g.Y8G("formControl",e.group().controls.bankAccount.controls.accountHolderName),g.R7$(),g.Y8G("disableMargin",!0),g.R7$(2),g.JRh(g.bMT(24,34,"bankAccountType")),g.R7$(2),g.Y8G("formControl",e.group().controls.bankAccount.controls.accountHolderType),g.R7$(),g.Y8G("label",g.VkB("-- ",g.bMT(27,36,"select")," --"))("value",""),g.R7$(2),g.Y8G("label",g.mNQ(g.bMT(29,38,"bankAccountTypeCompany")))("value","company"),g.R7$(2),g.Y8G("label",g.mNQ(g.bMT(31,40,"bankAccountTypeIndividual")))("value","individual")}}function B(e,t){1&e&&(g.qex(0),g.j41(1,"div",31),g.nrm(2,"div",32),g.j41(3,"small",33),g.EFF(4),g.nI1(5,"i18n"),g.k0s()(),g.bVm()),2&e&&(g.R7$(4),g.JRh(g.bMT(5,1,"paypalClickSubmit")))}function z(e,t){1&e&&(g.j41(0,"bit-callout",34),g.EFF(1),g.nI1(2,"i18n"),g.k0s()),2&e&&(g.R7$(),g.SpI(" ",g.bMT(2,1,"makeSureEnoughCredit")," "))}function L(e,t){1&e&&(g.j41(0,"bit-callout",35),g.EFF(1),g.nI1(2,"i18n"),g.k0s()),2&e&&(g.R7$(),g.SpI(" ",g.bMT(2,1,"notEnoughAccountCredit")," "))}function K(e,t){if(1&e&&(g.qex(0),g.nVh(1,z,3,3,"bit-callout",34)(2,L,3,3,"bit-callout",35),g.bVm()),2&e){const e=g.XpG();g.R7$(),g.vxM(e.hasEnoughAccountCredit()?1:2)}}function q(e,t){if(1&e&&g.nrm(0,"bit-option",40),2&e){const e=t.$implicit;g.Y8G("value",e.value)("disabled",e.disabled)("label",e.name)}}function _(e,t){if(1&e&&(g.j41(0,"h5",36),g.EFF(1),g.nI1(2,"i18n"),g.k0s(),g.j41(3,"div",37)(4,"div",38)(5,"bit-form-field",39)(6,"bit-label"),g.EFF(7),g.nI1(8,"i18n"),g.k0s(),g.j41(9,"bit-select",4),g.Z7z(10,q,1,3,"bit-option",40,O),g.k0s()()(),g.j41(12,"div",38)(13,"bit-form-field",39)(14,"bit-label"),g.EFF(15),g.nI1(16,"i18n"),g.k0s(),g.nrm(17,"input",41),g.k0s()()()),2&e){const e=g.XpG();g.R7$(),g.JRh(g.bMT(2,7,"billingAddress")),g.R7$(4),g.Y8G("disableMargin",!0),g.R7$(2),g.JRh(g.bMT(8,9,"country")),g.R7$(2),g.Y8G("formControl",e.group().controls.billingAddress.controls.country),g.R7$(),g.Dyx(e.selectableCountries),g.R7$(3),g.Y8G("disableMargin",!0),g.R7$(2),g.JRh(g.bMT(16,11,"zipPostalCodeLabel")),g.R7$(2),g.Y8G("formControl",e.group().controls.billingAddress.controls.postalCode)}}class X{constructor(e,t,i,r,o){this.braintreeService=e,this.i18nService=t,this.logService=i,this.stripeService=r,this.toastService=o,this.instanceId=u.A.newGuid(),this.group=n.hFB.required(),this.showBankAccount=(0,n.hFB)(!0),this.showPayPal=(0,n.hFB)(!0),this.showAccountCredit=(0,n.hFB)(!1),this.hasEnoughAccountCredit=(0,n.hFB)(!0),this.includeBillingAddress=(0,n.hFB)(!1),this.selectableCountries=v.Lx,this.destroy$=new s.B,this.select=e=>this.group().controls.type.patchValue(e),this.tokenize=()=>D(this,void 0,void 0,function*(){const e=e=>D(this,void 0,void 0,function*(){switch(e){case"bankAccount":{if(this.group().controls.bankAccount.markAllAsTouched(),!this.group().controls.bankAccount.valid)throw new Error("Attempted to tokenize invalid bank account information.");const e=this.group().controls.bankAccount.getRawValue(),t=yield this.stripeService.createSetupIntent("bankAccount"),i=this.group().controls.billingAddress.enabled?this.group().controls.billingAddress.getRawValue():void 0;return yield this.stripeService.setupBankAccountPaymentMethod(t,e,i)}case"card":{const e=yield this.stripeService.createSetupIntent("card"),t=this.group().controls.billingAddress.enabled?this.group().controls.billingAddress.getRawValue():void 0;return this.stripeService.setupCardPaymentMethod(this.instanceId,e,t)}case"payPal":return this.braintreeService.requestPaymentMethod()}});if(!(0,v.w$)(this.selected))throw new Error(`Attempted to tokenize a non-tokenizable payment method: ${this.selected}`);try{const t=yield e(this.selected);return{type:this.selected,token:t}}catch(t){if(t){switch(this.logService.error(t),this.selected){case"card":return"object"==typeof t&&"message"in t&&"string"==typeof t.message&&this.toastService.showToast({variant:"error",title:"",message:t.message}),null;case"payPal":if("string"==typeof t&&"No payment method is available."===t)return this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("clickPayWithPayPal")}),null}throw t}return null}}),this.validate=()=>"bankAccount"!==this.selected||(this.group().controls.bankAccount.markAllAsTouched(),this.group().controls.bankAccount.valid)}ngOnInit(){this.stripeService.loadStripe(this.instanceId,{cardNumber:`#stripe-card-number-${this.instanceId}`,cardExpiry:`#stripe-card-expiry-${this.instanceId}`,cardCvc:`#stripe-card-cvc-${this.instanceId}`},!0),this.showPayPal()&&this.braintreeService.loadBraintree("#braintree-container",!1),this.includeBillingAddress()?(this.group().controls.billingAddress.patchValue({country:"US"}),this.showBankAccount$=this.group().controls.billingAddress.controls.country.valueChanges.pipe((0,l.Z)(this.group().controls.billingAddress.controls.country.value),(0,a.T)(e=>this.showBankAccount()&&"US"===e))):(this.showBankAccount$=(0,o.of)(this.showBankAccount()),this.group().controls.billingAddress.disable()),this.group().controls.type.valueChanges.pipe((0,l.Z)(this.group().controls.type.value),(0,c.Q)(this.destroy$)).subscribe(e=>{if("bankAccount"===e)this.group().controls.bankAccount.enable(),this.includeBillingAddress()&&this.group().controls.billingAddress.enable();else{switch(e){case"card":this.stripeService.mountElements(this.instanceId),this.includeBillingAddress()&&this.group().controls.billingAddress.enable();break;case"payPal":this.braintreeService.createDropin(),this.includeBillingAddress()&&this.group().controls.billingAddress.disable()}this.group().controls.bankAccount.disable()}}),this.showBankAccount$.pipe((0,c.Q)(this.destroy$)).subscribe(e=>{e||"bankAccount"!==this.selected||this.select("card")})}ngOnDestroy(){this.stripeService.unloadStripe(this.instanceId),this.destroy$.next(),this.destroy$.complete()}get selected(){return this.group().value.type}}X.getFormGroup=()=>new r.gE({type:new r.MJ("card",{nonNullable:!0}),bankAccount:new r.gE({routingNumber:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),accountNumber:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),accountHolderName:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),accountHolderType:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]})}),billingAddress:new r.gE({country:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]}),postalCode:new r.MJ("",{nonNullable:!0,validators:[r.k0.required]})})}),X.ɵfac=function(e){return new(e||X)(g.rXU(m.qb),g.rXU(y.W),g.rXU(d.K),g.rXU(m.d$),g.rXU(b.f))},X.ɵcmp=g.VBU({type:X,selectors:[["app-enter-payment-method"]],inputs:{group:[1,"group"],showBankAccount:[1,"showBankAccount"],showPayPal:[1,"showPayPal"],showAccountCredit:[1,"showAccountCredit"],hasEnoughAccountCredit:[1,"hasEnoughAccountCredit"],includeBillingAddress:[1,"includeBillingAddress"]},decls:18,vars:14,consts:[["cardSecurityCodePopover",""],[3,"formGroup"],["bitTypography","h5"],[1,"tw-mb-4","tw-text-lg"],[3,"formControl"],["id","card-payment-method",3,"value"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-credit-card"],["id","bank-payment-method",3,"value"],["id","paypal-payment-method",3,"value"],["id","credit-payment-method",3,"value"],[1,"tw-grid","tw-grid-cols-2","tw-gap-4","tw-mb-4"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-billing"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paypal"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-dollar"],[1,"tw-col-span-1"],["required","",3,"for"],[1,"tw-stripe-form-control",3,"id"],[1,"tw-col-span-1","tw-flex","tw-items-end"],["src","../../../images/cards.png","alt","Visa, MasterCard, Discover, AmEx, JCB, Diners Club, UnionPay",1,"tw-max-w-full"],["type","button",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-pr-1",3,"bitPopoverTriggerFor","position"],["aria-hidden","true",1,"bwi","bwi-question-circle","tw-text-sm"],[3,"title"],[1,"tw-mb-0"],["type","warning",3,"title"],["formGroupName","bankAccount",1,"tw-grid","tw-grid-cols-2","tw-gap-4","tw-mb-4"],[1,"tw-col-span-1",3,"disableMargin"],["bitInput","","id","routingNumber","type","text","required","",3,"formControl"],["bitInput","","id","accountNumber","type","text","required","",3,"formControl"],["id","accountHolderName","bitInput","","type","text","required","",3,"formControl"],["id","accountHolderType","required","",3,"formControl"],[3,"value","label"],[1,"tw-mb-3"],["id","braintree-container",1,"tw-mb-1","tw-content-center"],[1,"tw-text-muted"],["type","info"],["type","warning"],["bitTypography","h5",1,"tw-pt-4"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],[3,"disableMargin"],[3,"value","disabled","label"],["bitInput","","type","text","autocomplete","postal-code",3,"formControl"]],template:function(e,t){if(1&e&&(g.j41(0,"form",1),g.nVh(1,M,3,3,"h5",2),g.j41(2,"div",3)(3,"bit-radio-group",4)(4,"bit-radio-button",5)(5,"bit-label"),g.nrm(6,"i",6),g.EFF(7),g.nI1(8,"i18n"),g.k0s()(),g.nVh(9,U,5,4,"bit-radio-button",7),g.nI1(10,"async"),g.nVh(11,G,5,4,"bit-radio-button",8),g.nVh(12,j,5,4,"bit-radio-button",9),g.k0s()(),g.nVh(13,N,26,23,"div",10)(14,V,32,42,"ng-container")(15,B,6,3,"ng-container")(16,K,3,1,"ng-container"),g.nVh(17,_,18,13),g.k0s()),2&e){let e;const i=t.includeBillingAddress()&&"payPal"!==t.selected;g.Y8G("formGroup",t.group()),g.R7$(),g.vxM(i?1:-1),g.R7$(2),g.Y8G("formControl",t.group().controls.type),g.R7$(),g.Y8G("value","card"),g.R7$(3),g.SpI(" ",g.bMT(8,10,"creditCard")," "),g.R7$(2),g.vxM(g.bMT(10,12,t.showBankAccount$)?9:-1),g.R7$(2),g.vxM(t.showPayPal()?11:-1),g.R7$(),g.vxM(t.showAccountCredit()?12:-1),g.R7$(),g.vxM("card"===(e=t.selected)?13:"bankAccount"===e?14:"payPal"===e?15:"accountCredit"===e?16:-1),g.R7$(4),g.vxM(i?17:-1)}},dependencies:[m.IJ,f.m,h.k,w.r,S.k,p.G,r.qT,r.me,r.BC,r.cb,r.YS,r.l_,r.j4,r.$R,I.G,k.j,C.J,T.h,F.d,R.Y,P.w,x.P,$.r,E.Jj,A.$],encapsulation:2,changeDetection:0})},21590:(e,t,i)=>{"use strict";i.d(t,{d:()=>u});var n=i(33338),r=i(56986),s=i(83892),o=i(93695),a=i(73276),l=i(69194),c=i(3204),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class u{constructor(e,t,i,u=null){this.key=t,this.output=i,this.bufferedState=e.getUser(i.userId,t.toKeyDefinition());const h=(0,r.x)((0,o.of)(null),this.bufferedState.state$).pipe((0,c.T)(e=>null!==(null!=e?e:null))),p=(null!=u?u:(0,o.of)(!0)).pipe((0,c.T)(e=>[t.shouldOverwrite(e),e])),m=(0,n.z)([h,p]).pipe((0,a.H)(e=>d(this,[e],void 0,function*([e,[t,i]]){return e&&t&&(yield this.overwriteOutput(i)),[!1,null]}))),v=this.output.state$.pipe((0,c.T)(e=>[!0,e]));this.state$=(0,s.h)(m,v).pipe((0,l.p)(([e])=>e),(0,c.T)(([,e])=>e)),this.combinedState$=this.state$.pipe((0,c.T)(e=>[this.output.userId,e])),this.bufferedState$=this.bufferedState.state$}overwriteOutput(e){return d(this,void 0,void 0,function*(){let t;yield this.bufferedState.update(e=>(t=null!=e?e:null,null));if(yield this.key.isValid(t,e)){const i=yield this.key.map(t,e);yield this.output.update(()=>i)}})}get userId(){return this.output.userId}buffer(e){return d(this,void 0,void 0,function*(){const t=null!=e?e:null;null!==t&&(yield this.bufferedState.update(()=>t))})}update(e,t=null){return this.output.update(e,t)}}},21823:(e,t,i)=>{"use strict";i.d(t,{G:()=>u});var n=i(83731),r=i(16878),s=i(33338),o=i(31436),a=i(3204),l=i(12610),c=i(30424),d=i(74208);class u{constructor(){this._open$=new r.t((0,c.a)("md")),this.open$=this._open$.asObservable(),this.isLargeScreen$=h(`(min-width: ${c.L.md}px)`),this._userCollapsePreference$=new r.t(null),this.userCollapsePreference$=this._userCollapsePreference$.asObservable(),this.isOverlay$=(0,s.z)([this.open$,this.isLargeScreen$]).pipe((0,a.T)(([e,t])=>e&&!t)),(0,s.z)([this.isLargeScreen$,this.userCollapsePreference$]).pipe((0,n.pQ)()).subscribe(([e,t])=>{e?"closed"!==t&&this.setOpen():this.setClose()})}get open(){return this._open$.getValue()}setOpen(){this._open$.next(!0)}setClose(){this._open$.next(!1)}toggle(){const e=this._open$.getValue();this._userCollapsePreference$.next(e?"closed":"open"),e?this.setClose():this.setOpen()}}u.ɵfac=function(e){return new(e||u)},u.ɵprov=d.jDH({token:u,factory:u.ɵfac,providedIn:"root"});const h=e=>{const t=window.matchMedia(e);return(0,o.R)(t,"change").pipe((0,l.Z)(t),(0,a.T)(e=>e.matches))}},21925:(e,t,i)=>{"use strict";i.d(t,{a:()=>d});var n=i(17989),r=i(24072),s=i(22203),o=i(14093),a=i(84454),l=i(73386),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d extends n.A{constructor(e){super(),null!=e&&(this.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):void 0,this.autofillOnPageLoad=e.autofillOnPageLoad,this.username=(0,r.e)(e.username),this.password=(0,r.e)(e.password),this.totp=(0,r.e)(e.totp),e.uris&&(this.uris=e.uris.map(e=>new l.m(e))),e.fido2Credentials&&(this.fido2Credentials=e.fido2Credentials.map(e=>new a.U(e))))}decrypt(e,t){return c(this,arguments,void 0,function*(e,t,i="No Cipher Context"){const n=yield this.decryptObj(this,new o.r(this),["username","password","totp"],t,`DomainType: Login; ${i}`);if(null!=this.uris){n.uris=[];for(let r=0;r<this.uris.length;r++){if(null==this.uris[r].uri)continue;const s=yield this.uris[r].decrypt(t,i),o=s.uri;if(null==o)continue;(e||(yield this.uris[r].validateChecksum(o,t)))&&n.uris.push(s)}}return null!=this.fido2Credentials&&(n.fido2Credentials=yield Promise.all(this.fido2Credentials.map(e=>e.decrypt(t)))),n})}toLoginData(){const e=new s.k;return null!=this.passwordRevisionDate&&(e.passwordRevisionDate=this.passwordRevisionDate.toISOString()),null!=this.autofillOnPageLoad&&(e.autofillOnPageLoad=this.autofillOnPageLoad),this.buildDataModel(this,e,{username:null,password:null,totp:null}),null!=this.uris&&this.uris.length>0&&(e.uris=this.uris.map(e=>e.toLoginUriData())),null!=this.fido2Credentials&&this.fido2Credentials.length>0&&(e.fido2Credentials=this.fido2Credentials.map(e=>e.toFido2CredentialData())),e}static fromJSON(e){var t,i,n;if(null==e)return;const s=new d;return s.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):void 0,s.autofillOnPageLoad=e.autofillOnPageLoad,s.username=(0,r.u)(e.username),s.password=(0,r.u)(e.password),s.totp=(0,r.u)(e.totp),s.uris=null===(t=e.uris)||void 0===t?void 0:t.map(e=>l.m.fromJSON(e)).filter(e=>null!=e),s.fido2Credentials=null!==(n=null===(i=e.fido2Credentials)||void 0===i?void 0:i.map(e=>a.U.fromJSON(e)).filter(e=>null!=e))&&void 0!==n?n:void 0,s}toSdkLogin(){var e,t,i,n,r,s,o;return{uris:null===(e=this.uris)||void 0===e?void 0:e.map(e=>e.toSdkLoginUri()),username:null===(t=this.username)||void 0===t?void 0:t.toSdk(),password:null===(i=this.password)||void 0===i?void 0:i.toSdk(),passwordRevisionDate:null===(n=this.passwordRevisionDate)||void 0===n?void 0:n.toISOString(),totp:null===(r=this.totp)||void 0===r?void 0:r.toSdk(),autofillOnPageLoad:null!==(s=this.autofillOnPageLoad)&&void 0!==s?s:void 0,fido2Credentials:null===(o=this.fido2Credentials)||void 0===o?void 0:o.map(e=>e.toSdkFido2Credential())}}static fromSdkLogin(e){var t,i,n,s;if(!e)return;const o=new d;return o.passwordRevisionDate=null!=e.passwordRevisionDate?new Date(e.passwordRevisionDate):void 0,o.autofillOnPageLoad=e.autofillOnPageLoad,o.username=(0,r.u)(e.username),o.password=(0,r.u)(e.password),o.totp=(0,r.u)(e.totp),o.uris=null!==(i=null===(t=e.uris)||void 0===t?void 0:t.filter(e=>null!=e.uri).map(e=>l.m.fromSdkLoginUri(e)).filter(e=>null!=e))&&void 0!==i?i:void 0,o.fido2Credentials=null!==(s=null===(n=e.fido2Credentials)||void 0===n?void 0:n.map(e=>a.U.fromSdkFido2Credential(e)).filter(e=>null!=e))&&void 0!==s?s:void 0,o}}},22166:(e,t,i)=>{"use strict";i.d(t,{px:()=>Cr,np:()=>kr,Gc:()=>lr,NY:()=>Cn,_A:()=>Tn,e3:()=>Mi,zu:()=>Pn.z,hI:()=>Mn,vv:()=>Fn.v,Wg:()=>Xn,QZ:()=>On,k:()=>Zi,f$:()=>or,nR:()=>F,Mr:()=>j,Tp:()=>vr,bj:()=>Os,Ws:()=>Vn,cM:()=>Ss,_8:()=>Rs,eG:()=>as,yk:()=>hr,qX:()=>u.q,tW:()=>us,Vi:()=>Is.V,DL:()=>ks,IN:()=>gr});var n=i(33338),r=i(3204),s=i(31857),o=i(69650),a=i(74208),l=i(5556);const c=new s.Ok(s.gc,"atRiskPasswords",{deserializer:e=>e,clearOn:["lock","logout"]});class d{constructor(e,t,i){this.taskService=e,this.cipherService=t,this.stateProvider=i}pendingTasks$(e){return(0,n.z)([this.taskService.pendingTasks$(e),this.cipherService.cipherViews$(e)]).pipe((0,r.T)(([e,t])=>e.filter(e=>{const i=t.find(t=>t.id===e.cipherId);return e.type===o.Wn.UpdateAtRiskCredential&&i&&i.edit&&i.viewPassword&&!i.isDeleted})))}completedTasks$(e){return this.taskService.completedTasks$(e).pipe((0,r.T)(e=>e.find(e=>e.type===o.Wn.UpdateAtRiskCredential)))}showCompletedTasksBanner$(e){return(0,n.z)([this.pendingTasks$(e),this.completedTasks$(e),this.atRiskPasswordState(e).state$]).pipe((0,r.T)(([e,t,i])=>{var n,r,s;const o=e.length>0,a=null!==(n=null==i?void 0:i.tasksBannerDismissed)&&void 0!==n&&n,l=null!==(r=null==i?void 0:i.hasInteractedWithTasks)&&void 0!==r&&r;return!!(o||l&&!a)&&!(!t||o||null!==(s=null==i?void 0:i.tasksBannerDismissed)&&void 0!==s&&s)}))}atRiskPasswordState(e){return this.stateProvider.getUser(e,c)}updateAtRiskPasswordState(e,t){this.atRiskPasswordState(e).update(()=>t)}}d.ɵfac=function(e){return new(e||d)(a.KVO(o.RB),a.KVO(l.p),a.KVO(s.v2))},d.ɵprov=a.jDH({token:d,factory:d.ɵfac});var u=i(89591),h=i(72245),p=i(11573),m=i(66523),v=i(31442),f=i(61325),g=i(37115),y=i(69855),b=i(81582),w=i(63098),S=i(50700),I=i(58329),k=i(35500),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const T={username:{typeI18nKey:"username",protected:!1},password:{typeI18nKey:"password",protected:!0,event:p.Bx.Cipher_ClientCopiedPassword},totp:{typeI18nKey:"verificationCodeTotp",protected:!0},cardNumber:{typeI18nKey:"number",protected:!0},securityCode:{typeI18nKey:"securityCode",protected:!0,event:p.Bx.Cipher_ClientCopiedCardCode},email:{typeI18nKey:"email",protected:!0},phone:{typeI18nKey:"phone",protected:!0},address:{typeI18nKey:"address",protected:!0},secureNote:{typeI18nKey:"note",protected:!0},privateKey:{typeI18nKey:"sshPrivateKey",protected:!0},publicKey:{typeI18nKey:"sshPublicKey",protected:!0},keyFingerprint:{typeI18nKey:"sshFingerprint",protected:!0},hiddenField:{typeI18nKey:"value",protected:!0,event:p.Bx.Cipher_ClientCopiedHiddenField}};class F{constructor(e,t,i,n,r,s,o,a){this.platformUtilsService=e,this.toastService=t,this.eventCollectionService=i,this.passwordRepromptService=n,this.totpService=r,this.i18nService=s,this.billingAccountProfileStateService=o,this.accountService=a}copy(e,t,i){return C(this,arguments,void 0,function*(e,t,i,n=!1){const r=T[t];if(!n&&i.reprompt!==v.b1.None&&r.protected&&!(yield this.passwordRepromptService.showPasswordPrompt()))return!1;if(null==e)return!1;if("totp"===t){if(!(yield this.totpAllowed(i)))return!1;const t=yield(0,h._)(this.totpService.getCode$(e));if(!(null==t?void 0:t.code))return!1;e=t.code}return this.platformUtilsService.copyToClipboard(e),this.toastService.showToast({variant:"success",message:this.i18nService.t("valueCopied",this.i18nService.t(r.typeI18nKey)),title:""}),void 0!==r.event&&(yield this.eventCollectionService.collect(r.event,i.id?(0,m.zw)(i.id):void 0,!1,i.organizationId?(0,m.zw)(i.organizationId):void 0)),!0})}totpAllowed(e){return C(this,void 0,void 0,function*(){const t=yield(0,h._)(this.accountService.activeAccount$);if(!(null==t?void 0:t.id))return!1;const i=f.n.getLogin(e);return!!(null==i?void 0:i.totp)&&(e.organizationUseTotp||(yield(0,h._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(t.id))))})}}F.ɵfac=function(e){return new(e||F)(a.KVO(g.y),a.KVO(y.f),a.KVO(b.c),a.KVO(u.q),a.KVO(w.R),a.KVO(S.W),a.KVO(I.Q),a.KVO(k.Di))},F.ɵprov=a.jDH({token:F,factory:F.ɵfac,providedIn:"root"});i(69592);var R=i(88083),P=i(33812);class x{constructor(e,t){this.el=e,this.renderer=t,this.size="default",this.renderer.setAttribute(this.el.nativeElement,"aria-hidden","true")}get iconSize(){switch(this.size){case"small":return"bwi-sm";case"large":return"bwi-lg";default:return""}}get orgIcon(){switch(this.tierType){case R.K_.Free:case R.K_.Families:return"bwi-family";case R.K_.Teams:case R.K_.Enterprise:case R.K_.TeamsStarter:return"bwi-business";default:return""}}get classList(){return["bwi",this.iconSize,this.orgIcon]}}x.ɵfac=function(e){return new(e||x)(P.rXU(P.aKT),P.rXU(P.sFG))},x.ɵdir=P.FsC({type:x,selectors:[["","appOrgIcon",""]],hostVars:2,hostBindings:function(e,t){2&e&&P.HbH(t.classList)},inputs:{tierType:"tierType",size:"size"}});var $=i(14803),E=i(66046),A=i(11979);class D{set cipher(e){this.viewContainer.clear(),this.cipherAuthorizationService.canDeleteCipher$(e).pipe((0,$.Q)(this.destroy$)).subscribe(e=>{e?this.viewContainer.createEmbeddedView(this.templateRef):this.viewContainer.clear()})}constructor(e,t,i){this.templateRef=e,this.viewContainer=t,this.cipherAuthorizationService=i,this.destroy$=new E.B}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}D.ɵfac=function(e){return new(e||D)(P.rXU(P.C4Q),P.rXU(P.c1b),P.rXU(A.y))},D.ɵdir=P.FsC({type:D,selectors:[["","appCanDeleteCipher",""]],inputs:{cipher:[0,"appCanDeleteCipher","cipher"]}});var O=i(94573),M=i(83731),U=i(2073),G=i(83234);class j{constructor(){this.themeService=(0,a.WQX)(G.oO),this.systemTheme$=(0,a.WQX)(U.eL),this.el=(0,a.WQX)(P.aKT),this.destroyRef=(0,a.WQX)(a.abz),this.darkImgSrc=O.hFB.required({alias:"appDarkImgSrc"})}ngOnInit(){this.lightImgSrc=this.el.nativeElement.getAttribute("src"),(0,n.z)([this.themeService.selectedTheme$,this.systemTheme$]).pipe((0,M.pQ)(this.destroyRef)).subscribe(([e,t])=>{const i="dark"===("system"===e?t:e);this.src=i?this.darkImgSrc():this.lightImgSrc})}}j.ɵfac=function(e){return new(e||j)},j.ɵdir=P.FsC({type:j,selectors:[["","appDarkImgSrc",""]],hostVars:1,hostBindings:function(e,t){2&e&&P.BMQ("src",t.src,P.n$t)},inputs:{darkImgSrc:[1,"appDarkImgSrc","darkImgSrc"]}});var N=i(77468),V=i(33277),B=i(44500),z=i(93695),L=i(75811),K=i(84079),q=i(12610),_=i(28202),X=i(58625),Y=i(67553),H=i(3633),W=i(39907),J=i(82468),Z=i(56962),Q=i(15639),ee=i(97212),te=i(80351),ie=i(60893),ne=i(59032),re=i(75583),se=i(14318),oe=i(22191),ae=i(89479),le=i(58950),ce=i(26411),de=i(25024);class ue{constructor(){this.data=""}onDragStart(e){var t;null===(t=e.dataTransfer)||void 0===t||t.setData("text",this.data)}}ue.ɵfac=function(e){return new(e||ue)},ue.ɵdir=P.FsC({type:ue,selectors:[["","appTextDrag",""]],hostAttrs:["draggable","true",1,"tw-cursor-move"],hostBindings:function(e,t){1&e&&P.bIt("dragstart",function(e){return t.onDragStart(e)})},inputs:{data:[0,"appTextDrag","data"]}});var he=i(36288),pe=i(97553),me=i(58806),ve=i(86226),fe=i(43759),ge=i(69896),ye=i(88016);class be{constructor(){this.notes=""}}be.ɵfac=function(e){return new(e||be)},be.ɵcmp=P.VBU({type:be,selectors:[["app-additional-options"]],inputs:{notes:"notes"},decls:15,vars:15,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[1,"[&_bit-form-field:last-of-type]:tw-mb-0"],["disableReadOnlyBorder",""],[3,"appTextDrag"],["readonly","","id","notes","bitInput","","rows","5","aria-readonly","true"],["bitSuffix","","bitIconButton","bwi-clone","size","small","type","button","showToast","",3,"appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(P.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"bit-card",2)(6,"bit-form-field",3)(7,"bit-label",4),P.EFF(8),P.nI1(9,"i18n"),P.k0s(),P.j41(10,"textarea",5),P.EFF(11),P.k0s(),P.nrm(12,"button",6),P.nI1(13,"i18n"),P.nI1(14,"i18n"),P.k0s()()()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,7,"additionalOptions")),P.R7$(4),P.Y8G("appTextDrag",t.notes),P.R7$(),P.JRh(P.bMT(9,9,"note")),P.R7$(3),P.JRh(t.notes),P.R7$(),P.Y8G("appCopyClick",t.notes)("valueLabel",P.bMT(13,11,"note"))("label",P.bMT(14,13,"copyNotes")))},dependencies:[N.MD,X.p,de.D,ue,se.i,oe.Q,he.s,ae.x,pe.J,le.U,re.E,me.r,ce.L,ve.j,fe.h,ge.a,ye.$],encapsulation:2});var we=i(81714),Se=(i(75751),i(98403)),Ie=i(22848),ke=i(39306),Ce=i(7861),Te=i(37579),Fe=i(12012),Re=i(53127),Pe=i(3892),xe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function $e(e,t){if(1&e&&(P.nrm(0,"button",0),P.nI1(1,"i18n")),2&e){const e=P.XpG();P.Y8G("bitAction",e.download)("label",P.i5U(1,2,"downloadAttachmentName",e.attachment().fileName))}}class Ee{constructor(e,t,i,n,r,s){this.i18nService=e,this.apiService=t,this.fileDownloadService=i,this.toastService=n,this.stateProvider=r,this.cipherService=s,this.attachment=O.hFB.required(),this.cipher=O.hFB.required(),this.checkPwReprompt=(0,O.hFB)(!1),this.emergencyAccessId=(0,O.hFB)(),this.admin=(0,O.hFB)(!1),this.isDecryptionFailure=(0,V.EW)(()=>this.attachment().fileName===ke.h),this.download=()=>xe(this,void 0,void 0,function*(){const e=this.attachment(),t=this.cipher();let i;if(!e.id)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")});try{i=(this.admin()?yield this.apiService.getAttachmentDataAdmin(t.id,e.id):yield this.apiService.getAttachmentData(t.id,e.id,this.emergencyAccessId())).url}catch(r){if(!(r instanceof Ce._&&404===r.statusCode))throw r instanceof Ce._?new Error(r.getSingleMessage()):r;i=e.url}if(!i)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")});const n=yield fetch(new Request(i,{cache:"no-store"}));if(200===n.status)try{const i=yield(0,h._)(this.stateProvider.activeUserId$);if(!i||!e.fileName)return void this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")});const r=yield this.cipherService.getDecryptedAttachmentBuffer(t.id,e,n,i,Boolean(this.emergencyAccessId()));this.fileDownloadService.download({fileName:e.fileName,blobData:r})}catch(s){this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}else this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})})}}Ee.ɵfac=function(e){return new(e||Ee)(P.rXU(S.W),P.rXU(Fe.G),P.rXU(Re.y),P.rXU(y.f),P.rXU(s.v2),P.rXU(l.p))},Ee.ɵcmp=P.VBU({type:Ee,selectors:[["app-download-attachment"]],inputs:{attachment:[1,"attachment"],cipher:[1,"cipher"],checkPwReprompt:[1,"checkPwReprompt"],emergencyAccessId:[1,"emergencyAccessId"],admin:[1,"admin"]},decls:1,vars:1,consts:[["bitIconButton","bwi-download","buttonType","main","size","small","type","button",3,"bitAction","label"]],template:function(e,t){1&e&&P.nVh(0,$e,2,5,"button",0),2&e&&P.vxM(t.isDecryptionFailure()?-1:0)},dependencies:[Te.C,Pe.p,N.MD,X.p,oe.Q,he.s,ye.$],encapsulation:2,changeDetection:0});var Ae=i(75556),De=i(90300),Oe=i(4017),Me=i(91962);function Ue(e,t){if(1&e&&(P.j41(0,"bit-item")(1,"bit-item-content")(2,"span",3),P.EFF(3),P.k0s(),P.j41(4,"span",4),P.EFF(5),P.k0s()(),P.qex(6,5),P.j41(7,"bit-item-action"),P.nrm(8,"app-download-attachment",6),P.k0s(),P.bVm(),P.k0s()),2&e){const e=t.$implicit,i=P.XpG();P.R7$(2),P.Y8G("title",e.fileName),P.R7$(),P.JRh(e.fileName),P.R7$(2),P.JRh(e.sizeName),P.R7$(3),P.Y8G("admin",i.admin)("cipher",i.cipher)("attachment",e)("checkPwReprompt",!0)("emergencyAccessId",i.emergencyAccessId)}}class Ge{constructor(e,t,i,n){this.keyService=e,this.billingAccountProfileStateService=t,this.stateProvider=i,this.accountService=n,this.admin=!1,this.subscribeToHasPremiumCheck(),this.subscribeToOrgKey()}subscribeToHasPremiumCheck(){this.accountService.activeAccount$.pipe((0,B.n)(e=>this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id)),(0,M.pQ)()).subscribe(e=>{this.canAccessPremium=e})}subscribeToOrgKey(){this.stateProvider.activeUserId$.pipe((0,B.n)(e=>null!=e?this.keyService.orgKeys$(e):we.t),(0,M.pQ)()).subscribe(e=>{e&&(this.orgKey=e[this.cipher.organizationId])})}}Ge.ɵfac=function(e){return new(e||Ge)(P.rXU(Ie.Lu),P.rXU(I.Q),P.rXU(s.v2),P.rXU(k.Di))},Ge.ɵcmp=P.VBU({type:Ge,selectors:[["app-attachments-v2-view"]],inputs:{cipher:"cipher",emergencyAccessId:"emergencyAccessId",admin:"admin"},decls:7,vars:4,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngFor","ngForOf"],["data-testid","file-name",3,"title"],["slot","secondary","data-testid","file-size"],["slot","end"],[3,"admin","cipher","attachment","checkPwReprompt","emergencyAccessId"]],template:function(e,t){1&e&&(P.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"bit-item-group"),P.DNE(6,Ue,9,8,"bit-item",2),P.k0s()()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,2,"attachments")),P.R7$(3),P.Y8G("ngForOf",t.cipher.attachments))},dependencies:[N.MD,N.Sq,X.p,Se.k,Ae.J,De.g,Oe.D,Me._,oe.Q,le.U,re.E,me.r,Ee,ye.$],encapsulation:2});var je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ne(e,t){if(1&e){const e=P.RV6();P.qex(0),P.j41(1,"bit-form-field",3)(2,"bit-label"),P.EFF(3),P.nI1(4,"i18n"),P.k0s(),P.nrm(5,"input",4),P.j41(6,"button",5),P.nI1(7,"i18n"),P.bIt("click",function(){const t=a.eBV(e).$implicit,i=P.XpG();return a.Njj(i.openWebsite(t.launchUri))}),P.k0s(),P.nrm(8,"button",6),P.nI1(9,"i18n"),P.nI1(10,"i18n"),P.k0s(),P.bVm()}if(2&e){const e=t.$implicit,i=t.last;P.R7$(),P.Y8G("disableMargin",i)("disableReadOnlyBorder",i),P.R7$(2),P.SpI(" ",P.bMT(4,8,"website")," "),P.R7$(2),P.Y8G("value",e.hostOrUri),P.R7$(),P.Y8G("label",P.bMT(7,10,"launch")+" "+e.hostOrUri),P.R7$(2),P.Y8G("appCopyClick",e.uri)("valueLabel",P.bMT(9,12,"website"))("label",P.bMT(10,14,"copyWebsite"))}}class Ve{constructor(e,t,i){this.platformUtilsService=e,this.cipherService=t,this.accountService=i}openWebsite(e){return je(this,void 0,void 0,function*(){const t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));yield this.cipherService.updateLastLaunchedDate(this.cipherId,t),this.platformUtilsService.launchUri(e)})}}Ve.ɵfac=function(e){return new(e||Ve)(P.rXU(g.y),P.rXU(l.p),P.rXU(k.Di))},Ve.ɵcmp=P.VBU({type:Ve,selectors:[["app-autofill-options-view"]],inputs:{loginUris:"loginUris",cipherId:"cipherId"},decls:7,vars:4,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngFor","ngForOf"],["data-testid","autofill-view-list",3,"disableMargin","disableReadOnlyBorder"],["readonly","","bitInput","","type","text","aria-readonly","true","data-testid","login-website",3,"value"],["bitIconButton","bwi-external-link","bitSuffix","","type","button","data-testid","launch-website",3,"click","label"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-website",3,"appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(P.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"bit-card"),P.DNE(6,Ne,11,16,"ng-container",2),P.k0s()()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,2,"autofillOptions")),P.R7$(3),P.Y8G("ngForOf",t.loginUris))},dependencies:[N.MD,N.Sq,X.p,de.D,se.i,le.U,re.E,me.r,ce.L,ve.j,pe.J,fe.h,ge.a,oe.Q,he.s,ye.$],encapsulation:2});class Be{ngAfterViewInit(){var e;(null===(e=this.formFields)||void 0===e?void 0:e.last)&&setTimeout(()=>{this.formFields&&(this.formFields.last.disableReadOnlyBorder=!0)})}}Be.ɵfac=function(e){return new(e||Be)},Be.ɵcmp=P.VBU({type:Be,selectors:[["read-only-cipher-card"]],contentQueries:function(e,t,i){if(1&e&&P.wni(i,fe.h,4),2&e){let e;P.mGM(e=P.lsd())&&(t.formFields=e)}},ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"[&_bit-form-field:last-of-type]:tw-mb-0"]],template:function(e,t){1&e&&(P.NAR(),P.j41(0,"bit-card",0),P.SdG(1),P.k0s())},dependencies:[se.i],encapsulation:2});var ze=i(76356),Le=i(45674),Ke=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function qe(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",3),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",4),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",e.card.cardholderName),P.R7$(),P.JRh(P.bMT(3,3,"cardholderName")),P.R7$(2),P.Y8G("value",e.card.cardholderName)}}function _e(e,t){if(1&e){const e=P.RV6();P.j41(0,"bit-form-field")(1,"bit-label",3),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",5),P.nI1(5,"creditCardNumber"),P.j41(6,"button",6),P.bIt("toggledChange",function(t){a.eBV(e);const i=P.XpG();return a.Njj(i.logCardEvent(t,i.EventType.Cipher_ClientToggledCardNumberVisible))}),P.k0s(),P.nrm(7,"button",7),P.nI1(8,"i18n"),P.nI1(9,"i18n"),P.k0s()}if(2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",e.card.number),P.R7$(),P.JRh(P.bMT(3,7,"number")),P.R7$(2),P.Y8G("value",P.i5U(5,9,e.card.number,e.cipher.card.brand)),P.R7$(2),P.Y8G("toggled",e.revealCardNumber),P.R7$(),P.Y8G("appCopyClick",e.card.number)("valueLabel",P.bMT(8,12,"number"))("label",P.bMT(9,14,"copyNumber"))}}function Xe(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",3),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",8),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",e.card.expiration),P.R7$(),P.JRh(P.bMT(3,3,"expiration")),P.R7$(2),P.Y8G("value",e.card.expiration)}}function Ye(e,t){if(1&e){const e=P.RV6();P.j41(0,"bit-form-field")(1,"bit-label",3),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",9),P.j41(5,"button",10),P.bIt("toggledChange",function(t){a.eBV(e);const i=P.XpG();return a.Njj(i.logCardEvent(t,i.EventType.Cipher_ClientToggledCardCodeVisible))}),P.k0s(),P.j41(6,"button",11),P.nI1(7,"i18n"),P.nI1(8,"i18n"),P.bIt("click",function(){a.eBV(e);const t=P.XpG();return a.Njj(t.logCardEvent(!0,t.EventType.Cipher_ClientCopiedCardCode))}),P.k0s()()}if(2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",e.card.code),P.R7$(),P.JRh(P.bMT(3,7,"securityCode")),P.R7$(2),P.Y8G("value",e.card.code),P.R7$(),P.Y8G("toggled",e.revealCardCode),P.R7$(),P.Y8G("appCopyClick",e.card.code)("valueLabel",P.bMT(7,9,"securityCode"))("label",P.bMT(8,11,"copySecurityCode"))}}class He{constructor(e,t){this.i18nService=e,this.eventCollectionService=t,this.EventType=p.Bx,this.revealCardNumber=!1,this.revealCardCode=!1}get card(){return this.cipher.card}ngOnChanges(e){e.cipher&&(this.revealCardNumber=!1,this.revealCardCode=!1)}get setSectionTitle(){return this.card.brand&&"Other"!==this.card.brand?this.i18nService.t("cardBrandDetails",this.card.brand):this.i18nService.t("cardDetails")}logCardEvent(e,t){return Ke(this,void 0,void 0,function*(){t===p.Bx.Cipher_ClientToggledCardNumberVisible?this.revealCardNumber=e:t===p.Bx.Cipher_ClientToggledCardCodeVisible&&(this.revealCardCode=e),e&&(yield this.eventCollectionService.collect(t,this.cipher.id,!1,this.cipher.organizationId))})}}He.ɵfac=function(e){return new(e||He)(P.rXU(S.W),P.rXU(b.c))},He.ɵcmp=P.VBU({type:He,selectors:[["app-card-details-view"]],inputs:{cipher:"cipher"},features:[P.OA$],decls:9,vars:5,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngIf"],[3,"appTextDrag"],["id","cardholderName","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","cardholder-name",3,"value"],["id","cardNumber","readonly","","bitInput","","type","password","aria-readonly","true","data-testid","cardholder-number",1,"tw-font-mono",3,"value"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-number",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-number",3,"appCopyClick","valueLabel","label"],["id","expiration","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","cardholder-expiration",3,"value"],["id","securityCode","readonly","","bitInput","","type","password","aria-readonly","true","data-testid","cardholder-code",1,"tw-font-mono",3,"value"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-code",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-code",3,"click","appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(P.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),P.EFF(3),P.k0s()(),P.j41(4,"read-only-cipher-card"),P.DNE(5,qe,5,5,"bit-form-field",2)(6,_e,10,16,"bit-form-field",2)(7,Xe,5,5,"bit-form-field",2)(8,Ye,9,13,"bit-form-field",2),P.k0s()()),2&e&&(P.R7$(3),P.JRh(t.setSectionTitle),P.R7$(2),P.Y8G("ngIf",t.card.cardholderName),P.R7$(),P.Y8G("ngIf",t.card.number),P.R7$(),P.Y8G("ngIf",t.card.expiration),P.R7$(),P.Y8G("ngIf",t.card.code))},dependencies:[N.MD,N.bT,X.p,de.D,ue,le.U,re.E,me.r,ce.L,ve.j,pe.J,fe.h,ze.e,ge.a,oe.Q,he.s,Be,Le.v,ye.$],encapsulation:2});var We=i(6528),Je=i(67036),Ze=i(14093),Qe=i(47135),et=i(98479),tt=i(40287),it=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class nt{constructor(e,t){this.autosize=e,this.ngZone=t,this.autosize.enabled=!1}ngAfterViewInit(){return it(this,void 0,void 0,function*(){yield(0,h._)(this.ngZone.onStable),this.autosize.enabled=!0})}}nt.ɵfac=function(e){return new(e||nt)(P.rXU(tt.xb,1),P.rXU(P.SKi))},nt.ɵdir=P.FsC({type:nt,selectors:[["textarea","vaultAutosizeReadOnlyTextArea",""]],features:[P.Jv_([tt.EE]),P.nM4([tt.xb])]});var rt=i(93103),st=i(90246),ot=i(50352),at=i(27520),lt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ct=e=>({"tw-mb-4":e}),dt=()=>({"tw-mt-3":!0,"tw-mb-2":!0});function ut(e,t){if(1&e&&(P.j41(0,"bit-form-field",7)(1,"bit-label",8),P.EFF(2),P.k0s(),P.nrm(3,"textarea",9)(4,"button",10),P.nI1(5,"i18n"),P.k0s()),2&e){const e=P.XpG(),t=e.$implicit,i=e.last;P.Y8G("disableReadOnlyBorder",i),P.R7$(),P.Y8G("appTextDrag",t.value),P.R7$(),P.JRh(t.name),P.R7$(),P.Y8G("value",t.value),P.R7$(),P.Y8G("appCopyClick",t.value)("valueLabel",t.name)("label",P.i5U(5,7,"copyCustomField",t.name))}}function ht(e,t){if(1&e&&P.nrm(0,"input",16),2&e){const e=P.XpG(2).$implicit;P.Y8G("value",e.value)}}function pt(e,t){if(1&e&&P.nrm(0,"textarea",17),2&e){const e=P.XpG(2).$implicit;P.Y8G("value",e.value)}}function mt(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",18),P.nI1(1,"i18n"),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2).index,i=P.XpG();return a.Njj(i.toggleCharacterCount(t))}),P.k0s()}if(2&e){const e=P.XpG(2).index,t=P.XpG();P.Y8G("label",P.bMT(1,2,t.showHiddenValueCountFields.includes(e)?"hideCharacterCount":"showCharacterCount")),P.BMQ("aria-expanded",t.showHiddenValueCountFields.includes(e))}}function vt(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",19),P.bIt("toggledChange",function(t){a.eBV(e);const i=P.XpG(2).index,n=P.XpG();return a.Njj(n.toggleHiddenField(t,i))}),P.k0s()}}function ft(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",20),P.nI1(1,"i18n"),P.bIt("click",function(){a.eBV(e);const t=P.XpG(3);return a.Njj(t.logCopyEvent())}),P.k0s()}if(2&e){const e=P.XpG(2).$implicit;P.Y8G("appCopyClick",e.value)("valueLabel",e.name)("label",P.i5U(1,3,"copyCustomField",e.name))}}function gt(e,t){if(1&e&&(P.j41(0,"bit-form-field",7)(1,"bit-label",8),P.EFF(2),P.k0s(),P.DNE(3,ht,1,1,"input",11)(4,pt,1,1,"textarea",12)(5,mt,2,4,"button",13)(6,vt,1,0,"button",14)(7,ft,2,6,"button",15),P.k0s()),2&e){const e=P.XpG(),t=e.$implicit,i=e.last,n=e.index,r=P.XpG();P.Y8G("disableReadOnlyBorder",i),P.R7$(),P.Y8G("appTextDrag",t.value),P.R7$(),P.JRh(t.name),P.R7$(),P.Y8G("ngIf",!r.revealedHiddenFields.includes(n)),P.R7$(),P.Y8G("ngIf",r.revealedHiddenFields.includes(n)),P.R7$(),P.Y8G("ngIf",r.canViewPassword&&r.revealedHiddenFields.includes(n)),P.R7$(),P.Y8G("ngIf",r.canViewPassword),P.R7$(),P.Y8G("ngIf",r.canViewPassword)}}function yt(e,t){if(1&e&&(P.j41(0,"div",21),P.nrm(1,"bit-color-password",22),P.k0s()),2&e){const e=P.XpG().$implicit;P.Y8G("ngClass",P.lJ4(3,dt)),P.R7$(),P.Y8G("password",e.value)("showCount",!0)}}function bt(e,t){if(1&e&&(P.j41(0,"bit-form-control"),P.nrm(1,"input",23),P.j41(2,"bit-label",8),P.EFF(3),P.k0s()()),2&e){const e=P.XpG().$implicit;P.R7$(),P.Y8G("checked","true"===e.value),P.R7$(),P.Y8G("appTextDrag",e.value),P.R7$(),P.SpI(" ",e.name," ")}}function wt(e,t){if(1&e&&(P.j41(0,"bit-form-field",7)(1,"bit-label"),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",24),P.k0s()),2&e){const e=P.XpG(),t=e.$implicit,i=e.last,n=P.XpG();P.Y8G("disableReadOnlyBorder",i),P.R7$(2),P.Lme(" ",P.bMT(3,4,"cfTypeLinked"),": ",t.name," "),P.R7$(2),P.Y8G("value",n.getLinkedType(t.linkedId))}}function St(e,t){if(1&e&&(P.j41(0,"div",3),P.DNE(1,ut,6,10,"bit-form-field",4)(2,gt,8,8,"bit-form-field",4)(3,yt,2,4,"div",5)(4,bt,4,3,"bit-form-control",6)(5,wt,5,6,"bit-form-field",4),P.k0s()),2&e){const e=t.$implicit,i=t.last,n=t.index,r=P.XpG();P.Y8G("ngClass",P.eq3(6,ct,!i)),P.R7$(),P.Y8G("ngIf",e.type===r.fieldType.Text),P.R7$(),P.Y8G("ngIf",e.type===r.fieldType.Hidden),P.R7$(),P.Y8G("ngIf",r.showHiddenValueCountFields.includes(n)&&r.revealedHiddenFields.includes(n)),P.R7$(),P.Y8G("ngIf",e.type===r.fieldType.Boolean),P.R7$(),P.Y8G("ngIf",e.type===r.fieldType.Linked)}}class It{constructor(e,t){this.i18nService=e,this.eventCollectionService=t,this.fieldType=v.PU,this.revealedHiddenFields=[],this.showHiddenValueCountFields=[]}ngOnInit(){this.fieldOptions=this.getLinkedFieldsOptionsForCipher()}ngOnChanges(e){e.cipher&&(this.revealedHiddenFields=[],this.fieldOptions=this.getLinkedFieldsOptionsForCipher())}getLinkedType(e){var t;const i=null===(t=this.fieldOptions)||void 0===t?void 0:t.get(e);return i?this.i18nService.t(i.i18nKey):null}get canViewPassword(){return this.cipher.viewPassword}toggleCharacterCount(e){const t=this.showHiddenValueCountFields.indexOf(e);t>-1?this.showHiddenValueCountFields.splice(t,1):this.showHiddenValueCountFields.push(e)}toggleHiddenField(e,t){return lt(this,void 0,void 0,function*(){e?this.revealedHiddenFields.push(t):this.revealedHiddenFields=this.revealedHiddenFields.filter(e=>e!==t),e&&(yield this.eventCollectionService.collect(p.Bx.Cipher_ClientToggledHiddenFieldVisible,this.cipher.id,!1,this.cipher.organizationId))})}logCopyEvent(){return lt(this,void 0,void 0,function*(){yield this.eventCollectionService.collect(p.Bx.Cipher_ClientCopiedHiddenField,this.cipher.id,!1,this.cipher.organizationId)})}getLinkedFieldsOptionsForCipher(){switch(this.cipher.type){case v.gC.Login:return Ze.r.prototype.linkedFieldOptions;case v.gC.Card:return We.G.prototype.linkedFieldOptions;case v.gC.Identity:return Je.O.prototype.linkedFieldOptions;default:return}}}It.ɵfac=function(e){return new(e||It)(P.rXU(S.W),P.rXU(b.c))},It.ɵcmp=P.VBU({type:It,selectors:[["app-custom-fields-v2"]],inputs:{cipher:"cipher"},features:[P.OA$],decls:7,vars:4,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],["class","tw-border-secondary-300 [&_bit-form-field:last-of-type]:tw-mb-0","data-testid","custom-field",3,"ngClass",4,"ngFor","ngForOf"],["data-testid","custom-field",1,"tw-border-secondary-300","[&_bit-form-field:last-of-type]:tw-mb-0",3,"ngClass"],[3,"disableReadOnlyBorder",4,"ngIf"],[3,"ngClass",4,"ngIf"],[4,"ngIf"],[3,"disableReadOnlyBorder"],[3,"appTextDrag"],["readonly","","bitInput","","aria-readonly","true","vaultAutosizeReadOnlyTextArea","",3,"value"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-custom-field",3,"appCopyClick","valueLabel","label"],["readonly","","bitInput","","type","password","aria-readonly","true","class","tw-font-mono",3,"value",4,"ngIf"],["readonly","","bitInput","","type","password","aria-readonly","true","class","tw-font-mono","vaultAutosizeReadOnlyTextArea","",3,"value",4,"ngIf"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-hidden-field-value-count","appStopClick","",3,"label","click",4,"ngIf"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","",3,"toggledChange",4,"ngIf"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","",3,"appCopyClick","valueLabel","label","click",4,"ngIf"],["readonly","","bitInput","","type","password","aria-readonly","true",1,"tw-font-mono",3,"value"],["readonly","","bitInput","","type","password","aria-readonly","true","vaultAutosizeReadOnlyTextArea","",1,"tw-font-mono",3,"value"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-hidden-field-value-count","appStopClick","",3,"click","label"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","",3,"toggledChange"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","",3,"click","appCopyClick","valueLabel","label"],[3,"ngClass"],[3,"password","showCount"],["bitCheckbox","","type","checkbox","aria-readonly","true","disabled","",3,"checked"],["readonly","","bitInput","","type","text","aria-readonly","true",3,"value"]],template:function(e,t){1&e&&(P.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"bit-card"),P.DNE(6,St,6,8,"div",2),P.k0s()()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,2,"customFields")),P.R7$(3),P.Y8G("ngForOf",t.cipher.fields))},dependencies:[N.MD,N.YU,N.Sq,N.bT,X.p,rt.Y,de.D,ue,se.i,oe.Q,he.s,ce.L,st.f,ve.j,pe.J,fe.h,ze.e,ge.a,ae.x,le.U,re.E,me.r,Qe.q,ot.P,et.p,at.S,nt,ye.$],encapsulation:2});var kt=i(31436),Ct=i(84488),Tt=i(78078),Ft=i(26333);const Rt=e=>({"tw-mb-2":e}),Pt=(e,t)=>t.id;function xt(e,t){if(1&e&&(P.nrm(0,"i",8),P.nI1(1,"i18n")),2&e){const e=P.XpG(2);P.Y8G("tierType",e.organization().productTierType)("size","large")("title",P.bMT(1,3,"owner"))}}function $t(e,t){if(1&e&&P.nrm(0,"i",9),2&e){const e=P.XpG().$implicit,t=P.XpG();P.Y8G("ngClass",t.getIconClass(e))("title",t.getItemTitle(e))}}function Et(e,t){if(1&e&&(P.j41(0,"span",6),P.nVh(1,xt,2,5,"i",8)(2,$t,1,2,"i",9),P.j41(3,"span",10),P.EFF(4),P.k0s()()),2&e){const e=t.$implicit,i=t.$index,n=t.$count,r=P.XpG();P.Y8G("ngClass",P.eq3(4,Rt,i===n-1&&r.hasSmallScreen())),P.BMQ("aria-label",r.getAriaLabel(e)),P.R7$(),P.vxM(r.isOrgIcon(e)?1:2),P.R7$(3),P.SpI(" ",e.name," ")}}function At(e,t){1&e&&(P.j41(0,"span",7),P.nI1(1,"i18n"),P.nrm(2,"i",11),P.nI1(3,"i18n"),P.j41(4,"span",10),P.EFF(5),P.nI1(6,"i18n"),P.k0s()()),2&e&&(P.BMQ("aria-label",P.bMT(1,3,"noneFolder")),P.R7$(2),P.Y8G("title",P.bMT(3,5,"folder")),P.R7$(3),P.SpI(" ",P.bMT(6,7,"noneFolder")," "))}function Dt(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",13),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.toggleShowMore())}),P.EFF(1),P.nI1(2,"i18n"),P.k0s()}2&e&&(P.R7$(),P.SpI(" ",P.bMT(2,1,"showMore")," "))}function Ot(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",13),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.toggleShowMore())}),P.EFF(1),P.nI1(2,"i18n"),P.k0s()}2&e&&(P.R7$(),P.SpI(" ",P.bMT(2,1,"showLess")," "))}function Mt(e,t){if(1&e&&P.DNE(0,Dt,3,3,"button",12)(1,Ot,3,3,"button",12),2&e){const e=P.XpG();P.Y8G("ngIf",!e.showAllDetails()),P.R7$(),P.Y8G("ngIf",e.showAllDetails())}}class Ut{constructor(e){this.i18nService=e,this.hideOwner=(0,O.hFB)(!1),this.cipher=O.hFB.required(),this.organization=(0,O.hFB)(),this.folder=(0,O.hFB)(),this.collections=(0,O.hFB)(),this.showAllDetails=(0,a.vPA)(!1),this.showOwnership=(0,V.EW)(()=>this.cipher().organizationId&&this.organization()&&!this.hideOwner()),this.hasSmallScreen=(0,M.ot)((0,kt.R)(window,"resize").pipe((0,r.T)(()=>window.innerWidth),(0,q.Z)(window.innerWidth),(0,r.T)(e=>e<681))),this.allItems=(0,V.EW)(()=>{var e;let t=[];return this.showOwnership()&&this.organization()&&t.push(this.organization()),(null===(e=this.cipher().collectionIds)||void 0===e?void 0:e.length)>0&&this.collections()&&(t=[...t,...this.collections()]),this.cipher().folderId&&this.folder()&&t.push(this.folder()),t}),this.showItems=(0,V.EW)(()=>{var e;return this.hasSmallScreen()&&this.allItems().length>2&&!this.showAllDetails()&&(null===(e=this.cipher().collectionIds)||void 0===e?void 0:e.length)>1?this.allItems().slice(0,2):this.allItems()})}toggleShowMore(){this.showAllDetails.update(e=>!e)}getAriaLabel(e){return e instanceof Ct.y?this.i18nService.t("owner")+e.name:e instanceof _.iY?this.i18nService.t("collection")+e.name:e instanceof Tt.u?this.i18nService.t("folder")+e.name:""}getIconClass(e){return e instanceof _.iY?e.type===_.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared":e instanceof Tt.u?"bwi-folder":""}getItemTitle(e){return e instanceof _.iY?this.i18nService.t("collection"):e instanceof Tt.u?this.i18nService.t("folder"):""}isOrgIcon(e){return e instanceof Ct.y}}Ut.ɵfac=function(e){return new(e||Ut)(P.rXU(S.W))},Ut.ɵcmp=P.VBU({type:Ut,selectors:[["app-item-details-v2"]],inputs:{hideOwner:[1,"hideOwner"],cipher:[1,"cipher"],organization:[1,"organization"],folder:[1,"folder"],collections:[1,"collections"]},decls:13,vars:8,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],[1,"tw-flex","tw-place-items-center",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-justify-center",2,"width","40px","height","40px"],[3,"cipher","coloredIcon"],["bitTypography","h4","data-testid","item-name",1,"tw-ml-2","tw-mt-2","tw-select-auto"],[1,"tw-flex","tw-flex-col","tw-mt-2","md:tw-flex-row","md:tw-flex-wrap"],["bitTypography","body2","data-testid","item-details-list",1,"tw-flex","tw-items-center","tw-mt-2","tw-mr-4",3,"ngClass"],["bitTypography","body2",1,"tw-flex","tw-items-center","tw-mt-2","tw-mr-4"],["appOrgIcon","",3,"tierType","size","title"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass","title"],["aria-hidden","true",1,"tw-pl-1.5"],["aria-hidden","true",1,"bwi","bwi-folder","bwi-lg",3,"title"],["bitTypography","body2","type","button","bitLink","","linkType","primary","class","tw-mt-1.5",3,"click",4,"ngIf"],["bitTypography","body2","type","button","bitLink","","linkType","primary",1,"tw-mt-1.5",3,"click"]],template:function(e,t){1&e&&(P.j41(0,"section",0)(1,"bit-card")(2,"div",1)(3,"div",2),P.nrm(4,"app-vault-icon",3),P.k0s(),P.j41(5,"h2",4),P.EFF(6),P.k0s()(),P.qex(7),P.j41(8,"div",5),P.Z7z(9,Et,5,6,"span",6,Pt),P.nVh(11,At,7,9,"span",7),P.nVh(12,Mt,2,2),P.k0s(),P.bVm(),P.k0s()()),2&e&&(P.R7$(2),P.Y8G("ngClass",P.eq3(6,Rt,t.allItems.length>0)),P.R7$(2),P.Y8G("cipher",t.cipher())("coloredIcon",!0),P.R7$(2),P.SpI(" ",t.cipher().name," "),P.R7$(3),P.Dyx(t.showItems()),P.R7$(2),P.vxM(0===t.allItems().length?11:-1),P.R7$(),P.vxM(t.hasSmallScreen()&&t.allItems().length>2&&t.cipher().collectionIds.length>1?12:-1))},dependencies:[N.MD,N.YU,N.bT,X.p,Ft.R,se.i,re.E,me.r,x,ce.L,ne.o,ye.$],encapsulation:2});var Gt=i(6056),jt=i(88832),Nt=i(26477),Vt=i(75421),Bt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const zt=(e,t)=>({"tw-mb-1 ":e,"tw-mb-0":t}),Lt=e=>({"tw-mb-3":e});function Kt(e,t){if(1&e&&(P.j41(0,"p",4)(1,"span",3),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.EFF(4),P.nI1(5,"date"),P.k0s()),2&e){const e=P.XpG();P.Y8G("ngClass",P.eq3(8,Lt,e.cipher.hasPasswordHistory)),P.R7$(2),P.SpI("",P.bMT(3,3,"datePasswordUpdated"),":"),P.R7$(2),P.SpI(" ",P.i5U(5,5,e.cipher.passwordRevisionDisplayDate,"medium")," ")}}function qt(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",7),P.bIt("click",function(){a.eBV(e);const t=P.XpG();return a.Njj(t.viewPasswordHistory())}),P.EFF(1),P.nI1(2,"i18n"),P.k0s()}2&e&&(P.R7$(),P.SpI(" ",P.bMT(2,1,"passwordHistory")," "))}class _t{constructor(e){this.viewPasswordHistoryService=e}get isLogin(){return this.cipher.type===v.gC.Login}viewPasswordHistory(){return Bt(this,void 0,void 0,function*(){yield this.viewPasswordHistoryService.viewPasswordHistory(this.cipher)})}}_t.ɵfac=function(e){return new(e||_t)(P.rXU(Vt.Q))},_t.ɵcmp=P.VBU({type:_t,selectors:[["app-item-history-v2"]],inputs:{cipher:"cipher"},decls:20,vars:23,consts:[["disableMargin",""],["bitTypography","h6"],[1,"tw-mb-1","tw-text-xs","tw-text-muted","tw-select-all"],[1,"tw-font-medium"],[1,"tw-text-xs","tw-text-muted","tw-select-all",3,"ngClass"],["class","tw-text-xs tw-text-muted tw-select-all",3,"ngClass",4,"ngIf"],["bitTypography","body2","bitLink","","type","button",3,"click",4,"ngIf"],["bitTypography","body2","bitLink","","type","button",3,"click"]],template:function(e,t){1&e&&(P.j41(0,"bit-section",0)(1,"bit-section-header")(2,"h2",1),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"bit-card")(6,"p",2)(7,"span",3),P.EFF(8),P.nI1(9,"i18n"),P.k0s(),P.EFF(10),P.nI1(11,"date"),P.k0s(),P.j41(12,"p",4)(13,"span",3),P.EFF(14),P.nI1(15,"i18n"),P.k0s(),P.EFF(16),P.nI1(17,"date"),P.k0s(),P.DNE(18,Kt,6,10,"p",5)(19,qt,3,3,"button",6),P.k0s()()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,8,"itemHistory")),P.R7$(5),P.SpI("",P.bMT(9,10,"lastEdited"),":"),P.R7$(2),P.SpI(" ",P.i5U(11,12,t.cipher.revisionDate,"medium")," "),P.R7$(2),P.Y8G("ngClass",P.l_i(20,zt,t.cipher.hasPasswordHistory,!t.cipher.hasPasswordHistory)),P.R7$(2),P.SpI("",P.bMT(15,15,"dateCreated"),":"),P.R7$(2),P.SpI(" ",P.i5U(17,17,t.cipher.creationDate,"medium")," "),P.R7$(2),P.Y8G("ngIf",t.cipher.passwordRevisionDisplayDate),P.R7$(),P.Y8G("ngIf",t.cipher.hasPasswordHistory))},dependencies:[N.MD,N.YU,N.bT,X.p,Gt.iI,se.i,jt.n,le.U,re.E,me.r,Nt.V,ne.o,N.vh,ye.$],encapsulation:2});var Xt=i(30675),Yt=i(639),Ht=i(36359),Wt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Jt=(e,t)=>({"tw-text-main":e,"tw-text-danger":t}),Zt=(e,t)=>({"tw-stroke-text-main":e,"tw-stroke-danger-600":t}),Qt=e=>({"stroke-dashoffset.px":e});function ei(e,t){if(1&e&&(P.qex(0),P.j41(1,"div",1)(2,"span",2)(3,"span",3),P.EFF(4),P.k0s(),a.qSk(),P.j41(5,"svg",4)(6,"g"),P.nrm(7,"circle",5)(8,"circle",6),P.k0s()()()(),P.bVm()),2&e){const e=t.ngIf;P.R7$(3),P.Y8G("ngClass",P.l_i(5,Jt,!e.totpLow,e.totpLow)),P.R7$(),P.JRh(e.totpSec),P.R7$(3),P.Y8G("ngClass",P.l_i(8,Zt,!e.totpLow,e.totpLow))("ngStyle",P.eq3(11,Qt,e.totpDash)),P.R7$(),P.Y8G("ngClass",P.l_i(13,Zt,!e.totpLow,e.totpLow))}}class ti{constructor(e){this.totpService=e,this.sendCopyCode=new P.bkB}ngOnInit(){return Wt(this,void 0,void 0,function*(){this.setTotpInfo()})}ngOnChanges(e){e.cipher&&this.setTotpInfo()}setTotpInfo(){var e,t;this.totpInfo$=(null===(t=null===(e=this.cipher)||void 0===e?void 0:e.login)||void 0===t?void 0:t.totp)?this.totpService.getCode$(this.cipher.login.totp).pipe((0,r.T)(e=>{const t=Math.round((new Date).getTime()/1e3)%e.period;return{totpCode:e.code,totpCodeFormatted:this.formatTotpCode(e.code),totpSec:e.period-t,totpDash:+(Math.round(60/e.period*t+"e+2")+"e-2"),totpLow:e.period-t<=7}}),(0,Ht.M)(e=>{e.totpCode&&e.totpCode.length>4&&this.sendCopyCode.emit({totpCode:e.totpCode,totpCodeFormatted:e.totpCodeFormatted})})):void 0}formatTotpCode(e){if(e.length>4){const t=Math.floor(e.length/2);return e.substring(0,t)+" "+e.substring(t)}return e}}ti.ɵfac=function(e){return new(e||ti)(P.rXU(w.R))},ti.ɵcmp=P.VBU({type:ti,selectors:[["","bitTotpCountdown",""]],inputs:{cipher:"cipher"},outputs:{sendCopyCode:"sendCopyCode"},features:[P.OA$],attrs:["bitTotpCountdown",""],decls:2,vars:3,consts:[[4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"tw-relative","tw-flex","tw-justify-center","tw-items-center"],["bitTypography","helper",1,"tw-absolute",3,"ngClass"],["transform","rotate(-90)","viewBox","0 0 28 28",1,"tw-size-7"],["r","9.5","cy","14","cx","14","stroke-width","2","stroke-dasharray","60",1,"tw-fill-none",3,"ngClass","ngStyle"],["r","11","cy","14","cx","14","stroke-width","1","stroke-dasharray","71","stroke-dashoffset","0",1,"tw-fill-none",3,"ngClass"]],template:function(e,t){1&e&&(P.DNE(0,ei,9,16,"ng-container",0),P.nI1(1,"async")),2&e&&P.Y8G("ngIf",P.bMT(1,1,t.totpInfo$))},dependencies:[N.MD,N.YU,N.bT,N.B3,re.E,me.r,N.Jj],encapsulation:2});var ii=i(43090),ni=i(93199),ri=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const si=["passwordInput"],oi=e=>({"tw-hidden":e}),ai=e=>({"tw-mt-3":e,"tw-mb-2":!0});function li(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",5),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",6)(5,"button",7),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",e.cipher.login.username),P.R7$(),P.SpI(" ",P.bMT(3,6,"username")," "),P.R7$(2),P.Y8G("value",e.cipher.login.username),P.R7$(),P.Y8G("appCopyClick",e.cipher.login.username)("valueLabel",P.bMT(6,8,"username"))("label",P.bMT(7,10,"copyUsername"))}}function ci(e,t){if(1&e&&(P.j41(0,"span",14),P.nrm(1,"bit-color-password",15),P.k0s()),2&e){const e=P.XpG(2);P.BMQ("aria-label",e.cipher.login.password),P.R7$(),P.Y8G("password",e.cipher.login.password)}}function di(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",16),P.nI1(1,"i18n"),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.togglePasswordCount())}),P.k0s()}if(2&e){const e=P.XpG(2);P.Y8G("label",P.bMT(1,2,e.showPasswordCount?"hideCharacterCount":"showCharacterCount")),P.BMQ("aria-expanded",e.showPasswordCount)}}function ui(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",17),P.bIt("toggledChange",function(t){a.eBV(e);const i=P.XpG(2);return a.Njj(i.pwToggleValue(t))}),P.k0s()}if(2&e){const e=P.XpG(2);P.Y8G("toggled",e.passwordRevealed)}}function hi(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",18),P.nI1(1,"i18n"),P.nI1(2,"i18n"),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.logCopyEvent())}),P.k0s()}if(2&e){const e=P.XpG(2);P.Y8G("appCopyClick",e.cipher.login.password)("valueLabel",P.bMT(1,3,"password"))("label",P.bMT(2,5,"copyPassword"))}}function pi(e,t){if(1&e){const e=P.RV6();P.j41(0,"bit-hint")(1,"a",19),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.launchChangePasswordEvent())}),P.EFF(2),P.nI1(3,"i18n"),P.nrm(4,"i",20),P.k0s()()}2&e&&(P.R7$(2),P.SpI(" ",P.bMT(3,1,"changeAtRiskPassword")," "))}function mi(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",8),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",9,0),P.DNE(6,ci,2,2,"span",10)(7,di,2,4,"button",11)(8,ui,1,1,"button",12)(9,hi,3,7,"button",13)(10,pi,5,3,"bit-hint",3),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",e.cipher.login.password),P.R7$(),P.SpI(" ",P.bMT(3,9,"password")," "),P.R7$(2),P.Y8G("ngClass",P.eq3(11,oi,e.passwordRevealed))("value",e.cipher.login.password),P.R7$(2),P.Y8G("ngIf",e.passwordRevealed),P.R7$(),P.Y8G("ngIf",e.cipher.viewPassword&&e.passwordRevealed),P.R7$(),P.Y8G("ngIf",e.cipher.viewPassword),P.R7$(),P.Y8G("ngIf",e.cipher.viewPassword),P.R7$(),P.Y8G("ngIf",e.showChangePasswordLink)}}function vi(e,t){if(1&e&&(P.j41(0,"div",21),P.nrm(1,"bit-color-password",22),P.k0s()),2&e){const e=P.XpG();P.Y8G("ngClass",P.eq3(3,ai,!e.cipher.login.totp)),P.R7$(),P.Y8G("password",e.cipher.login.password)("showCount",!0)}}function fi(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",5),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",23),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",e.fido2CredentialCreationDateValue),P.R7$(),P.SpI("",P.bMT(3,3,"typePasskey")," "),P.R7$(2),P.Y8G("value",e.fido2CredentialCreationDateValue)}}function gi(e,t){if(1&e){const e=P.RV6();P.j41(0,"div",29),P.bIt("sendCopyCode",function(t){a.eBV(e);const i=P.XpG(2);return a.Njj(i.setTotpCopyCode(t))}),P.k0s()}if(2&e){const e=P.XpG(2);P.Y8G("cipher",e.cipher)}}function yi(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",5)(2,"div",24),P.EFF(3),P.nI1(4,"i18n"),P.nrm(5,"app-premium-badge",25),P.k0s()(),P.nrm(6,"input",26),P.nI1(7,"async"),P.DNE(8,gi,1,1,"div",27),P.nI1(9,"async"),P.nrm(10,"button",28),P.nI1(11,"i18n"),P.nI1(12,"i18n"),P.nI1(13,"async"),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.Y8G("appTextDrag",null==e.totpCodeCopyObj?null:e.totpCodeCopyObj.totpCode),P.R7$(2),P.SpI(" ",P.bMT(4,10,"verificationCodeTotp")," "),P.R7$(2),P.Y8G("organizationId",e.cipher.organizationId),P.R7$(),P.Y8G("type",P.bMT(7,12,e.isPremium$)?"text":"password")("value",(null==e.totpCodeCopyObj?null:e.totpCodeCopyObj.totpCodeFormatted)||"*** ***"),P.R7$(2),P.Y8G("ngIf",P.bMT(9,14,e.isPremium$)),P.R7$(2),P.Y8G("appCopyClick",null==e.totpCodeCopyObj?null:e.totpCodeCopyObj.totpCode)("valueLabel",P.bMT(11,16,"verificationCodeTotp"))("label",P.bMT(12,18,"copyVerificationCode"))("disabled",!P.bMT(13,20,e.isPremium$))}}class bi{constructor(e,t,i,n,r){this.billingAccountProfileStateService=e,this.i18nService=t,this.premiumUpgradeService=i,this.eventCollectionService=n,this.accountService=r,this.handleChangePassword=new P.bkB,this.isPremium$=this.accountService.activeAccount$.pipe((0,B.n)(e=>this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id))),this.showPasswordCount=!1,this.passwordRevealed=!1,this.datePipe=(0,a.WQX)(N.vh)}get fido2CredentialCreationDateValue(){var e;return`${this.i18nService.t("dateCreated")} ${this.datePipe.transform(null===(e=this.cipher.login.fido2Credentials[0])||void 0===e?void 0:e.creationDate,"short")}`}ngOnChanges(e){var t;e.cipher&&((null===(t=this.passwordInput)||void 0===t?void 0:t.nativeElement)&&(this.passwordInput.nativeElement.type="password"),this.passwordRevealed=!1,this.showPasswordCount=!1)}pwToggleValue(e){return ri(this,void 0,void 0,function*(){this.passwordRevealed=e,e&&(yield this.eventCollectionService.collect(p.Bx.Cipher_ClientToggledPasswordVisible,this.cipher.id,!1,this.cipher.organizationId))})}togglePasswordCount(){this.showPasswordCount=!this.showPasswordCount}setTotpCopyCode(e){this.totpCodeCopyObj=e}logCopyEvent(){return ri(this,void 0,void 0,function*(){yield this.eventCollectionService.collect(p.Bx.Cipher_ClientCopiedPassword,this.cipher.id,!1,this.cipher.organizationId)})}launchChangePasswordEvent(){this.handleChangePassword.emit()}}bi.ɵfac=function(e){return new(e||bi)(P.rXU(I.Q),P.rXU(S.W),P.rXU(ii.l),P.rXU(b.c),P.rXU(k.Di))},bi.ɵcmp=P.VBU({type:bi,selectors:[["app-login-credentials-view"]],viewQuery:function(e,t){if(1&e&&P.GBs(si,5),2&e){let e;P.mGM(e=P.lsd())&&(t.passwordInput=e.first)}},inputs:{cipher:"cipher",activeUserId:"activeUserId",showChangePasswordLink:"showChangePasswordLink"},outputs:{handleChangePassword:"handleChangePassword"},features:[P.OA$],decls:11,vars:8,consts:[["passwordInput",""],[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngIf"],[3,"ngClass",4,"ngIf"],[3,"appTextDrag"],["id","userName","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","login-username",3,"value"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-username",3,"appCopyClick","valueLabel","label"],["id","password-label",3,"appTextDrag"],["id","password","readonly","","bitInput","","type","password","aria-readonly","true","data-testid","login-password",3,"ngClass","value"],["role","textbox","tabindex","0","data-testid","login-password-color","aria-readonly","true","aria-labelledby","password-label",4,"ngIf"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-password-count","appStopClick","",3,"label","click",4,"ngIf"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-password",3,"toggled","toggledChange",4,"ngIf"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-password",3,"appCopyClick","valueLabel","label","click",4,"ngIf"],["role","textbox","tabindex","0","data-testid","login-password-color","aria-readonly","true","aria-labelledby","password-label"],[1,"tw-font-mono",3,"password"],["bitIconButton","bwi-numbered-list","bitSuffix","","type","button","data-testid","toggle-password-count","appStopClick","",3,"click","label"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-password",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-password",3,"click","appCopyClick","valueLabel","label"],["bitLink","","href","#","appStopClick","",3,"click"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-1"],[3,"ngClass"],[3,"password","showCount"],["id","fido","readonly","","bitInput","","type","text","aria-readonly","true","data-testid","login-passkey",3,"value"],[1,"tw-flex","tw-items-center","tw-gap-2"],[3,"organizationId"],["id","totp","readonly","","bitInput","","aria-readonly","true","data-testid","login-totp",1,"tw-font-mono",3,"type","value"],["bitTotpCountdown","","bitSuffix","",3,"cipher","sendCopyCode",4,"ngIf"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","","data-testid","copy-totp",1,"disabled:tw-cursor-default",3,"appCopyClick","valueLabel","label","disabled"],["bitTotpCountdown","","bitSuffix","",3,"sendCopyCode","cipher"]],template:function(e,t){1&e&&(P.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"read-only-cipher-card"),P.DNE(6,li,8,12,"bit-form-field",3)(7,mi,11,13,"bit-form-field",3)(8,vi,2,5,"div",4)(9,fi,5,5,"bit-form-field",3)(10,yi,14,22,"bit-form-field",3),P.k0s()()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,6,"loginCredentials")),P.R7$(3),P.Y8G("ngIf",t.cipher.login.username),P.R7$(),P.Y8G("ngIf",t.cipher.login.password),P.R7$(),P.Y8G("ngIf",t.showPasswordCount&&t.passwordRevealed),P.R7$(),P.Y8G("ngIf",(null==t.cipher.login||null==t.cipher.login.fido2Credentials?null:t.cipher.login.fido2Credentials.length)>0),P.R7$(),P.Y8G("ngIf",t.cipher.login.totp))},dependencies:[N.MD,N.YU,N.bT,X.p,rt.Y,de.D,ue,le.U,re.E,me.r,ce.L,ve.j,ni.I,pe.J,fe.h,ze.e,ge.a,oe.Q,he.s,Yt.E,et.p,at.S,ti,Be,Nt.V,ne.L,Xt.a,N.Jj,ye.$],encapsulation:2});class wi{constructor(){this.revealSshKey=!1}ngOnChanges(e){e.sshKey&&(this.revealSshKey=!1)}}function Si(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",5)(5,"button",6),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.fullName),P.R7$(),P.JRh(P.bMT(3,6,"name")),P.R7$(2),P.Y8G("value",e.cipher.identity.fullName),P.R7$(),P.Y8G("label",P.bMT(6,8,"copyName"))("appCopyClick",e.cipher.identity.fullName)("valueLabel",P.bMT(7,10,"name"))}}function Ii(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",7)(5,"button",8),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.username),P.R7$(),P.JRh(P.bMT(3,6,"username")),P.R7$(2),P.Y8G("value",e.cipher.identity.username),P.R7$(),P.Y8G("label",P.bMT(6,8,"copyUsername"))("appCopyClick",e.cipher.identity.username)("valueLabel",P.bMT(7,10,"username"))}}function ki(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",9)(5,"button",10),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.company),P.R7$(),P.JRh(P.bMT(3,6,"company")),P.R7$(2),P.Y8G("value",e.cipher.identity.company),P.R7$(),P.Y8G("label",P.bMT(6,8,"copyCompany"))("appCopyClick",e.cipher.identity.company)("valueLabel",P.bMT(7,10,"company"))}}function Ci(e,t){if(1&e&&(P.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"read-only-cipher-card"),P.DNE(6,Si,8,12,"bit-form-field",3)(7,Ii,8,12,"bit-form-field",3)(8,ki,8,12,"bit-form-field",3),P.k0s()()),2&e){const e=P.XpG();P.R7$(3),P.JRh(P.bMT(4,4,"personalDetails")),P.R7$(3),P.Y8G("ngIf",e.cipher.identity.fullName),P.R7$(),P.Y8G("ngIf",e.cipher.identity.username),P.R7$(),P.Y8G("ngIf",e.cipher.identity.company)}}function Ti(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",11)(5,"button",12)(6,"button",13),P.nI1(7,"i18n"),P.nI1(8,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.ssn),P.R7$(),P.JRh(P.bMT(3,6,"ssn")),P.R7$(2),P.Y8G("value",e.cipher.identity.ssn),P.R7$(2),P.Y8G("label",P.bMT(7,8,"copySSN"))("appCopyClick",e.cipher.identity.ssn)("valueLabel",P.bMT(8,10,"ssn"))}}function Fi(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",14)(5,"button",15)(6,"button",16),P.nI1(7,"i18n"),P.nI1(8,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.passportNumber),P.R7$(),P.JRh(P.bMT(3,6,"passportNumber")),P.R7$(2),P.Y8G("value",e.cipher.identity.passportNumber),P.R7$(2),P.Y8G("label",P.bMT(7,8,"copyPassportNumber"))("appCopyClick",e.cipher.identity.passportNumber)("valueLabel",P.bMT(8,10,"passportNumber"))}}function Ri(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",17)(5,"button",18),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.licenseNumber),P.R7$(),P.JRh(P.bMT(3,6,"licenseNumber")),P.R7$(2),P.Y8G("value",e.cipher.identity.licenseNumber),P.R7$(),P.Y8G("label",P.bMT(6,8,"copyLicenseNumber"))("appCopyClick",e.cipher.identity.licenseNumber)("valueLabel",P.bMT(7,10,"licenseNumber"))}}function Pi(e,t){if(1&e&&(P.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"read-only-cipher-card"),P.DNE(6,Ti,9,12,"bit-form-field",3)(7,Fi,9,12,"bit-form-field",3)(8,Ri,8,12,"bit-form-field",3),P.k0s()()),2&e){const e=P.XpG();P.R7$(3),P.JRh(P.bMT(4,4,"identification")),P.R7$(3),P.Y8G("ngIf",e.cipher.identity.ssn),P.R7$(),P.Y8G("ngIf",e.cipher.identity.passportNumber),P.R7$(),P.Y8G("ngIf",e.cipher.identity.licenseNumber)}}function xi(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",19)(5,"button",20),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.email),P.R7$(),P.JRh(P.bMT(3,6,"email")),P.R7$(2),P.Y8G("value",e.cipher.identity.email),P.R7$(),P.Y8G("label",P.bMT(6,8,"copyEmail"))("appCopyClick",e.cipher.identity.email)("valueLabel",P.bMT(7,10,"email"))}}function $i(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"input",21)(5,"button",22),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.cipher.identity.phone),P.R7$(),P.JRh(P.bMT(3,6,"phone")),P.R7$(2),P.Y8G("value",e.cipher.identity.phone),P.R7$(),P.Y8G("label",P.bMT(6,8,"copyPhone"))("appCopyClick",e.cipher.identity.phone)("valueLabel",P.bMT(7,10,"phone"))}}function Ei(e,t){if(1&e&&(P.j41(0,"bit-form-field")(1,"bit-label",4),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.nrm(4,"textarea",23)(5,"button",24),P.nI1(6,"i18n"),P.nI1(7,"i18n"),P.k0s()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("appTextDrag",e.addressFields),P.R7$(),P.JRh(P.bMT(3,7,"address")),P.R7$(2),P.Y8G("value",e.addressFields)("rows",e.addressRows),P.R7$(),P.Y8G("label",P.bMT(6,9,"copyAddress"))("appCopyClick",e.addressFields)("valueLabel",P.bMT(7,11,"address"))}}function Ai(e,t){if(1&e&&(P.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"read-only-cipher-card"),P.DNE(6,xi,8,12,"bit-form-field",3)(7,$i,8,12,"bit-form-field",3)(8,Ei,8,13,"bit-form-field",3),P.k0s()()),2&e){const e=P.XpG();P.R7$(3),P.JRh(P.bMT(4,4,"contactInfo")),P.R7$(3),P.Y8G("ngIf",e.cipher.identity.email),P.R7$(),P.Y8G("ngIf",e.cipher.identity.phone),P.R7$(),P.Y8G("ngIf",e.addressFields)}}wi.ɵfac=function(e){return new(e||wi)},wi.ɵcmp=P.VBU({type:wi,selectors:[["app-sshkey-view"]],inputs:{sshKey:"sshKey"},features:[P.OA$],decls:31,vars:37,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],["readonly","","bitInput","","aria-readonly","true","type","password","data-testid","private-key",3,"value"],["bitSuffix","","type","button","bitIconButton","","bitPasswordInputToggle","","data-testid","toggle-privateKey",3,"toggledChange","toggled"],["bitIconButton","bwi-clone","bitSuffix","","type","button","showToast","",3,"label","appCopyClick","valueLabel"],["readonly","","bitInput","","aria-readonly","true","data-testid","public-key",3,"value"],["readonly","","bitInput","","aria-readonly","true","data-testid","fingerprint",3,"value"]],template:function(e,t){1&e&&(P.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),P.EFF(3),P.nI1(4,"i18n"),P.k0s()(),P.j41(5,"read-only-cipher-card")(6,"bit-form-field")(7,"bit-label"),P.EFF(8),P.nI1(9,"i18n"),P.k0s(),P.nrm(10,"input",2),P.j41(11,"button",3),P.mxI("toggledChange",function(e){return P.DH7(t.revealSshKey,e)||(t.revealSshKey=e),e}),P.k0s(),P.nrm(12,"button",4),P.nI1(13,"i18n"),P.nI1(14,"i18n"),P.k0s(),P.j41(15,"bit-form-field")(16,"bit-label"),P.EFF(17),P.nI1(18,"i18n"),P.k0s(),P.nrm(19,"input",5)(20,"button",4),P.nI1(21,"i18n"),P.nI1(22,"i18n"),P.k0s(),P.j41(23,"bit-form-field")(24,"bit-label"),P.EFF(25),P.nI1(26,"i18n"),P.k0s(),P.nrm(27,"input",6)(28,"button",4),P.nI1(29,"i18n"),P.nI1(30,"i18n"),P.k0s()()()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,17,"typeSshKey")),P.R7$(5),P.JRh(P.bMT(9,19,"sshPrivateKey")),P.R7$(2),P.Y8G("value",t.sshKey.privateKey),P.R7$(),P.R50("toggled",t.revealSshKey),P.R7$(),P.Y8G("label",P.bMT(13,21,"copyPrivateKey"))("appCopyClick",t.sshKey.privateKey)("valueLabel",P.bMT(14,23,"sshPrivateKey")),P.R7$(5),P.JRh(P.bMT(18,25,"sshPublicKey")),P.R7$(2),P.Y8G("value",t.sshKey.publicKey),P.R7$(),P.Y8G("label",P.bMT(21,27,"copyPublicKey"))("appCopyClick",t.sshKey.publicKey)("valueLabel",P.bMT(22,29,"sshPublicKey")),P.R7$(5),P.JRh(P.bMT(26,31,"sshFingerprint")),P.R7$(2),P.Y8G("value",t.sshKey.keyFingerprint),P.R7$(),P.Y8G("label",P.bMT(29,33,"copyFingerprint"))("appCopyClick",t.sshKey.keyFingerprint)("valueLabel",P.bMT(30,35,"sshFingerprint")))},dependencies:[N.MD,X.p,de.D,le.U,Be,re.E,me.r,ce.L,ve.j,pe.J,fe.h,ze.e,ge.a,oe.Q,he.s,ye.$],encapsulation:2});class Di{constructor(){this.cipher=null}get addressFields(){if(!this.cipher)return"";const{address1:e,address2:t,address3:i,fullAddressPart2:n,country:r}=this.cipher.identity;return[e,t,i,n,r].filter(Boolean).join("\n")}get addressRows(){return this.addressFields.split("\n").length}get hasPersonalDetails(){if(!this.cipher)return!1;const{username:e,company:t,fullName:i}=this.cipher.identity;return Boolean(i||e||t)}get hasIdentificationDetails(){if(!this.cipher)return!1;const{ssn:e,passportNumber:t,licenseNumber:i}=this.cipher.identity;return Boolean(e||t||i)}get hasContactDetails(){if(!this.cipher)return!1;const{email:e,phone:t}=this.cipher.identity;return Boolean(e||t||this.addressFields)}}Di.ɵfac=function(e){return new(e||Di)},Di.ɵcmp=P.VBU({type:Di,selectors:[["app-view-identity-sections"]],inputs:{cipher:"cipher"},decls:3,vars:3,consts:[["class","tw-mb-5 bit-compact:tw-mb-4",4,"ngIf"],[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],[4,"ngIf"],[3,"appTextDrag"],["bitInput","","id","fullName","readonly","","data-testid","name",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-name",3,"label","appCopyClick","valueLabel"],["bitInput","","id","username","readonly","","data-testid","username",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","",3,"label","appCopyClick","valueLabel"],["bitInput","","id","company","readonly","","data-testid","company",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-company",3,"label","appCopyClick","valueLabel"],["bitInput","","id","ssn","type","password","readonly","","data-testid","ssn",3,"value"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","ssn-toggle"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-ssn",3,"label","appCopyClick","valueLabel"],["id","passportNumber","bitInput","","type","password","readonly","","data-testid","passport",3,"value"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","passport-toggle"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-passport",3,"label","appCopyClick","valueLabel"],["bitInput","","id","licenseNumber","readonly","","data-testid","license",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-license",3,"label","appCopyClick","valueLabel"],["bitInput","","id","email","readonly","","data-testid","email",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-email",3,"label","appCopyClick","valueLabel"],["bitInput","","id","phone","readonly","","data-testid","phone",3,"value"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-phone",3,"label","appCopyClick","valueLabel"],["bitInput","","id","address","readonly","","data-testid","address",1,"tw-resize-none",3,"value","rows"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","","data-testid","copy-address",3,"label","appCopyClick","valueLabel"]],template:function(e,t){1&e&&P.DNE(0,Ci,9,6,"section",0)(1,Pi,9,6,"section",0)(2,Ai,9,6,"section",0),2&e&&(P.Y8G("ngIf",t.hasPersonalDetails),P.R7$(),P.Y8G("ngIf",t.hasIdentificationDetails),P.R7$(),P.Y8G("ngIf",t.hasContactDetails))},dependencies:[N.bT,X.p,de.D,ue,le.U,re.E,me.r,ce.L,ve.j,pe.J,fe.h,ze.e,ge.a,oe.Q,he.s,Be,ye.$],encapsulation:2});var Oi=i(74526);class Mi{}var Ui=i(1601),Gi=i(44432),ji=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ni(e,t){1&e&&(P.j41(0,"bit-callout",10),P.nI1(1,"i18n"),P.EFF(2),P.nI1(3,"i18n"),P.k0s()),2&e&&(P.Y8G("title",P.bMT(1,2,"cardExpiredTitle")),P.R7$(2),P.SpI(" ",P.bMT(3,4,"cardExpiredMessage")," "))}function Vi(e,t){1&e&&(P.j41(0,"bit-callout",11),P.nI1(1,"i18n"),P.EFF(2),P.nI1(3,"i18n"),P.k0s()),2&e&&(P.Y8G("title",P.bMT(1,2,"missingWebsite")),P.R7$(2),P.SpI(" ",P.bMT(3,4,"changeAtRiskPasswordAndAddWebsite")," "))}function Bi(e,t){if(1&e){const e=P.RV6();P.j41(0,"bit-callout",11)(1,"a",12),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.launchChangePassword())}),P.EFF(2),P.nI1(3,"i18n"),P.nrm(4,"i",13),P.k0s()()}2&e&&(P.Y8G("title",""),P.R7$(2),P.SpI(" ",P.bMT(3,2,"changeAtRiskPassword")," "))}function zi(e,t){1&e&&(P.j41(0,"p",14),P.EFF(1),P.nI1(2,"i18n"),P.k0s()),2&e&&(P.R7$(),P.SpI(" ",P.bMT(2,1,"noEditPermissions")," "))}function Li(e,t){if(1&e){const e=P.RV6();P.j41(0,"app-login-credentials-view",15),P.nI1(1,"async"),P.bIt("handleChangePassword",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.launchChangePassword())}),P.k0s()}if(2&e){const e=P.XpG(2);P.Y8G("cipher",e.cipher())("activeUserId",P.bMT(1,3,e.activeUserId$))("showChangePasswordLink",e.showChangePasswordLink())}}function Ki(e,t){if(1&e&&P.nrm(0,"app-autofill-options-view",16),2&e){const e=P.XpG(2);P.Y8G("loginUris",e.cipher().login.uris)("cipherId",e.cipher().id)}}function qi(e,t){if(1&e&&P.nrm(0,"app-card-details-view",9),2&e){const e=P.XpG(2);P.Y8G("cipher",e.cipher())}}function _i(e,t){if(1&e&&P.nrm(0,"app-view-identity-sections",9),2&e){const e=P.XpG(2);P.Y8G("cipher",e.cipher())}}function Xi(e,t){if(1&e&&P.nrm(0,"app-sshkey-view",17),2&e){const e=P.XpG(2);P.Y8G("sshKey",e.cipher().sshKey)}}function Yi(e,t){if(1&e&&(P.qex(0),P.nrm(1,"app-additional-options",18),P.bVm()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("notes",e.cipher().notes)}}function Hi(e,t){if(1&e&&(P.qex(0),P.nrm(1,"app-custom-fields-v2",9),P.bVm()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("cipher",e.cipher())}}function Wi(e,t){if(1&e&&(P.qex(0),P.nrm(1,"app-attachments-v2-view",19),P.bVm()),2&e){const e=P.XpG(2);P.R7$(),P.Y8G("emergencyAccessId",e.emergencyAccessId())("cipher",e.cipher())("admin",e.isAdminConsole())}}function Ji(e,t){if(1&e&&(P.qex(0),P.DNE(1,Ni,4,6,"bit-callout",1)(2,Vi,4,6,"bit-callout",2)(3,Bi,5,4,"bit-callout",2)(4,zi,3,3,"p",3),P.nrm(5,"app-item-details-v2",4),P.DNE(6,Li,2,5,"app-login-credentials-view",5)(7,Ki,1,2,"app-autofill-options-view",6)(8,qi,1,1,"app-card-details-view",7)(9,_i,1,1,"app-view-identity-sections",7)(10,Xi,1,1,"app-sshkey-view",8)(11,Yi,2,1,"ng-container",0)(12,Hi,2,1,"ng-container",0)(13,Wi,2,3,"ng-container",0),P.nrm(14,"app-item-history-v2",9),P.bVm()),2&e){let e,t,i,n,r;const s=P.XpG();P.R7$(),P.Y8G("ngIf",s.cardIsExpired()),P.R7$(),P.Y8G("ngIf",!s.hasLoginUri()&&s.hadPendingChangePasswordTask()),P.R7$(),P.Y8G("ngIf",s.showChangePasswordLink()),P.R7$(),P.Y8G("ngIf",(null==(e=s.cipher())?null:e.isDeleted)&&!(null!=(e=s.cipher())&&e.edit)),P.R7$(),P.Y8G("cipher",s.cipher())("organization",s.organization())("collections",s.resolvedCollections())("folder",s.folder())("hideOwner",s.isAdminConsole()),P.R7$(),P.Y8G("ngIf",s.hasLogin()),P.R7$(),P.Y8G("ngIf",s.hasAutofill()),P.R7$(),P.Y8G("ngIf",s.hasCard()),P.R7$(),P.Y8G("ngIf",null==(t=s.cipher())?null:t.identity),P.R7$(),P.Y8G("ngIf",s.hasSshKey()),P.R7$(),P.Y8G("ngIf",null==(i=s.cipher())?null:i.notes),P.R7$(),P.Y8G("ngIf",null==(n=s.cipher())?null:n.hasFields),P.R7$(),P.Y8G("ngIf",null==(r=s.cipher())?null:r.hasAttachments),P.R7$(),P.Y8G("cipher",s.cipher())}}class Zi{constructor(e,t,i,s,a,l,c,d,u,h,p,m){this.organizationService=e,this.collectionService=t,this.folderService=i,this.accountService=s,this.defaultTaskService=a,this.platformUtilsService=l,this.changeLoginPasswordService=c,this.cipherService=d,this.logService=u,this.cipherRiskService=h,this.billingAccountService=p,this.configService=m,this.cipher=O.hFB.required(),this.cipher$=(0,M.br)(this.cipher),this.emergencyAccessId=(0,O.hFB)(),this.collections=(0,O.hFB)(void 0),this.isAdminConsole=(0,O.hFB)(!1),this.activeUserId$=(0,H.F6)(this.accountService.activeAccount$),this.resolvedCollections=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$,(0,M.br)(this.collections)]).pipe((0,B.n)(([e,t,i])=>i&&i.length>0?(0,z.of)(i):t.collectionIds&&t.collectionIds.length>0?this.collectionService.decryptedCollections$(e).pipe((0,Q.S)(t.collectionIds)):(0,z.of)(void 0)))),this.organization=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$]).pipe((0,B.n)(([e,t])=>e&&(null==t?void 0:t.organizationId)?this.organizationService.organizations$(e).pipe((0,r.T)(e=>e.find(e=>e.id===t.organizationId))):(0,z.of)(void 0)))),this.folder=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$]).pipe((0,B.n)(([e,t])=>e&&(null==t?void 0:t.folderId)?this.folderService.getDecrypted$(t.folderId,e):(0,z.of)(void 0)))),this.hadPendingChangePasswordTask=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$]).pipe((0,B.n)(([e,t])=>(null==t?void 0:t.type)===v.gC.Login&&(null==t?void 0:t.organizationId)?(0,n.z)([this.cipherService.ciphers$(e),this.defaultTaskService.pendingTasks$(e)]).pipe((0,r.T)(([e,i])=>{var n;const r=e[null==t?void 0:t.id];return!(!(null==r?void 0:r.edit)||!(null==r?void 0:r.viewPassword))&&(null!==(n=null==i?void 0:i.some(e=>e.cipherId===(null==t?void 0:t.id)&&e.type===o.Wn.UpdateAtRiskCredential))&&void 0!==n&&n)}),(0,L.W)(e=>(this.logService.error("Failed to retrieve change password tasks for cipher",e),(0,z.of)(!1)))):(0,z.of)(!1))),{initialValue:!1}),this.hasCard=(0,V.EW)(()=>{const e=this.cipher();if(!e)return!1;const{cardholderName:t,code:i,expMonth:n,expYear:r,number:s}=e.card;return t||i||n||r||s}),this.cardIsExpired=(0,V.EW)(()=>{const e=this.cipher();return null!=e&&(0,W.ov)(e.card)}),this.hasLogin=(0,V.EW)(()=>{const e=this.cipher();if(!e)return!1;const{username:t,password:i,totp:n,fido2Credentials:r}=e.login;return t||i||n||(null==r?void 0:r.length)>0}),this.hasAutofill=(0,V.EW)(()=>{var e,t;const i=this.cipher();return(null!==(t=null===(e=null==i?void 0:i.login)||void 0===e?void 0:e.uris.length)&&void 0!==t?t:0)>0}),this.hasSshKey=(0,V.EW)(()=>{var e;const t=this.cipher();return!!(null===(e=null==t?void 0:t.sshKey)||void 0===e?void 0:e.privateKey)}),this.hasLoginUri=(0,V.EW)(()=>{var e;const t=this.cipher();return null===(e=null==t?void 0:t.login)||void 0===e?void 0:e.hasUris}),this.passwordIsAtRisk=(0,M.ot)((0,n.z)([this.activeUserId$,this.cipher$,this.configService.getFeatureFlag$(J.TO.RiskInsightsForPremium)]).pipe((0,B.n)(([e,t,i])=>i&&t.hasLoginPassword&&t.edit&&!t.organizationId&&!t.isDeleted?this.switchPremium$(e,()=>(0,K.H)(this.checkIfPasswordIsAtRisk(t.id,e)).pipe((0,q.Z)(!1)),()=>(0,z.of)(!1)):(0,z.of)(!1))),{initialValue:!1}),this.showChangePasswordLink=(0,V.EW)(()=>this.hasLoginUri()&&(this.hadPendingChangePasswordTask()||this.passwordIsAtRisk())),this.launchChangePassword=()=>ji(this,void 0,void 0,function*(){const e=this.cipher();if(null!=e){const t=yield this.changeLoginPasswordService.getChangePasswordUrl(e);if(null==t)return;this.platformUtilsService.launchUri(t)}})}switchPremium$(e,t,i){return this.billingAccountService.hasPremiumFromAnySource$(e).pipe((0,B.n)(e=>e?t():i()))}checkIfPasswordIsAtRisk(e,t){return ji(this,void 0,void 0,function*(){try{const i=yield this.cipherRiskService.computeCipherRiskForUser(e,t,!0);return(0,ee.i)(i)}catch(i){return this.logService.error("Failed to check if password is at risk",i),!1}})}}Zi.ɵfac=function(e){return new(e||Zi)(P.rXU(Y.PV),P.rXU(_.YD),P.rXU(Oi.k),P.rXU(k.Di),P.rXU(o.RB),P.rXU(g.y),P.rXU(Mi),P.rXU(l.p),P.rXU(Z.K),P.rXU(ee.A),P.rXU(I.Q),P.rXU(Ui.w))},Zi.ɵcmp=P.VBU({type:Zi,selectors:[["app-cipher-view"]],inputs:{cipher:[1,"cipher"],emergencyAccessId:[1,"emergencyAccessId"],collections:[1,"collections"],isAdminConsole:[1,"isAdminConsole"]},decls:1,vars:1,consts:[[4,"ngIf"],["type","info",3,"title",4,"ngIf"],["type","warning",3,"title",4,"ngIf"],["class","tw-text-muted","bitTypography","helper",4,"ngIf"],[3,"cipher","organization","collections","folder","hideOwner"],[3,"cipher","activeUserId","showChangePasswordLink","handleChangePassword",4,"ngIf"],[3,"loginUris","cipherId",4,"ngIf"],[3,"cipher",4,"ngIf"],[3,"sshKey",4,"ngIf"],[3,"cipher"],["type","info",3,"title"],["type","warning",3,"title"],["bitLink","","href","#","appStopClick","","linkType","secondary",3,"click"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-1"],["bitTypography","helper",1,"tw-text-muted"],[3,"handleChangePassword","cipher","activeUserId","showChangePasswordLink"],[3,"loginUris","cipherId"],[3,"sshKey"],[3,"notes"],[3,"emergencyAccessId","cipher","admin"]],template:function(e,t){1&e&&P.DNE(0,Ji,15,18,"ng-container",0),2&e&&P.Y8G("ngIf",!!t.cipher())},dependencies:[te.j,Gi.G,N.MD,N.bT,ie.t,X.p,rt.Y,Ut,be,Ge,_t,It,He,wi,Di,bi,Ve,ne.L,re.E,me.r,N.Jj,ye.$],encapsulation:2});var Qi=i(81525),en=i(29029),tn=i(81573),nn=i(36801),rn=i(51757),sn=i(50451),on=i(23293),an=i(45154),ln=(i(34461),i(21274)),cn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class dn{constructor(e,t,i,n,r,s){this.toastService=e,this.i18nService=t,this.cipherService=i,this.logService=n,this.dialogService=r,this.accountService=s,this.admin=!1,this.onDeletionSuccess=new P.bkB,this.delete=()=>cn(this,void 0,void 0,function*(){if(yield this.dialogService.openSimpleDialog({title:{key:"deleteAttachment"},content:{key:"permanentlyDeleteAttachmentConfirmation"},type:"warning"}))try{const e=yield(0,h._)(this.accountService.activeAccount$.pipe(H.bB));if(null==e)throw new Error("An active user is expected while deleting an attachment.");yield this.cipherService.deleteAttachmentWithServer(this.cipherId,this.attachment.id,e,this.admin),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("deletedAttachment")}),this.onDeletionSuccess.emit()}catch(e){this.logService.error(e)}})}}dn.ɵfac=function(e){return new(e||dn)(P.rXU(y.f),P.rXU(S.W),P.rXU(l.p),P.rXU(Z.K),P.rXU(ln.o3),P.rXU(k.Di))},dn.ɵcmp=P.VBU({type:dn,selectors:[["app-delete-attachment"]],inputs:{cipherId:"cipherId",attachment:"attachment",admin:"admin"},outputs:{onDeletionSuccess:"onDeletionSuccess"},decls:2,vars:5,consts:[["bitIconButton","bwi-trash","buttonType","danger","size","small","type","button",1,"tw-border-transparent",3,"label","bitAction"]],template:function(e,t){1&e&&(P.nrm(0,"button",0),P.nI1(1,"i18n")),2&e&&P.Y8G("label",P.i5U(1,2,"deleteAttachmentName",t.attachment.fileName))("bitAction",t.delete)},dependencies:[Te.C,Pe.p,N.MD,X.p,en.t,oe.Q,he.s,ye.$],encapsulation:2});var un=i(56898),hn=i(54471),pn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const mn=["fileInput"],vn=(e,t)=>t.id;function fn(e,t){1&e&&(P.nrm(0,"i",18),P.nI1(1,"i18n")),2&e&&P.Y8G("appA11yTitle",P.bMT(1,1,"fixEncryptionTooltip"))}function gn(e,t){if(1&e&&P.nrm(0,"app-download-attachment",15),2&e){let e;const t=P.XpG().$implicit,i=P.XpG(2);P.Y8G("admin",i.admin()&&(null==(e=i.organization())?null:e.canEditAllCiphers))("cipher",i.cipher())("attachment",t)}}function yn(e,t){if(1&e&&(P.j41(0,"button",16),P.EFF(1),P.nI1(2,"i18n"),P.k0s()),2&e){const e=P.XpG().$implicit,t=P.XpG(2);P.Y8G("bitAction",t.fixOldAttachment(e)),P.R7$(),P.SpI(" ",P.bMT(2,2,"fixEncryption")," ")}}function bn(e,t){if(1&e){const e=P.RV6();P.j41(0,"li")(1,"bit-item")(2,"bit-item-content")(3,"span",11),P.EFF(4),P.k0s(),P.j41(5,"span",12),P.EFF(6),P.k0s(),P.DNE(7,fn,2,3,"i",13),P.k0s(),P.qex(8,14),P.j41(9,"bit-item-action"),P.nVh(10,gn,1,3,"app-download-attachment",15)(11,yn,3,4,"button",16),P.k0s(),P.j41(12,"bit-item-action")(13,"app-delete-attachment",17),P.bIt("onDeletionSuccess",function(){const t=a.eBV(e).$implicit,i=P.XpG(2);return a.Njj(i.removeAttachment(t))}),P.k0s()(),P.bVm(),P.k0s()()}if(2&e){let e;const i=t.$implicit,n=P.XpG(2);P.R7$(3),P.Y8G("title",i.fileName),P.R7$(),P.JRh(i.fileName),P.R7$(2),P.JRh(i.sizeName),P.R7$(),P.Y8G("ngIf",null==i.key),P.R7$(3),P.vxM(null!=i.key?10:11),P.R7$(3),P.Y8G("admin",n.admin()&&(null==(e=n.organization())?null:e.canEditAllCiphers))("cipherId",n.cipher().id)("attachment",i)}}function wn(e,t){1&e&&(P.j41(0,"ul",2),P.Z7z(1,bn,14,8,"li",null,vn),P.k0s()),2&e&&(P.R7$(),P.Dyx(t))}class Sn{constructor(e,t,i,n,r,s,o,l){this.cipherService=e,this.i18nService=t,this.formBuilder=i,this.logService=n,this.toastService=r,this.accountService=s,this.apiService=o,this.organizationService=l,this.fileInput=(0,O.ebz)("fileInput",{read:P.aKT}),this.bitSubmit=(0,O.ebz)(an.L),this.cipherId=O.hFB.required(),this.organizationId=(0,O.hFB)(),this.admin=(0,O.hFB)(!1),this.submitBtn=(0,O.hFB)(),this.onUploadStarted=(0,O.CGW)(),this.onUploadSuccess=(0,O.CGW)(),this.onUploadFailed=(0,O.CGW)(),this.onRemoveSuccess=(0,O.CGW)(),this.organization=(0,a.vPA)(null),this.cipher=(0,a.vPA)(null),this.attachmentForm=this.formBuilder.group({file:new rn.MJ(null,[rn.k0.required])}),this.cipherDomain=null,this.activeUserId=null,this.destroyRef=(0,a.WQX)(a.abz),this.submit=()=>pn(this,void 0,void 0,function*(){var e;this.onUploadStarted.emit();const t=this.attachmentForm.value.file;if(null!=t){if(t.size>524288e3)this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("maxFileSize")});else if(this.cipherDomain&&this.activeUserId)try{this.cipherDomain=yield this.cipherService.saveAttachmentWithServer(this.cipherDomain,t,this.activeUserId,null===(e=this.organization())||void 0===e?void 0:e.canEditAllCiphers),this.cipher.set(yield this.cipherService.decrypt(this.cipherDomain,this.activeUserId));const i=this.fileInput();i&&(i.nativeElement.value=""),this.attachmentForm.controls.file.setValue(null),this.toastService.showToast({variant:"success",message:this.i18nService.t("attachmentSaved")}),this.onUploadSuccess.emit()}catch(i){this.logService.error(i);let e=this.i18nService.t("unexpectedError");"string"==typeof i?e=i:i instanceof Error&&(null==i?void 0:i.message)&&(e=i.message),this.toastService.showToast({variant:"error",message:e}),this.onUploadFailed.emit()}}else this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFile")})}),this.fixOldAttachment=e=>()=>pn(this,void 0,void 0,function*(){const t=this.cipher(),i=this.activeUserId;if(e.id&&i&&t)try{const n=yield this.cipherService.upgradeOldCipherAttachments(t,i,e.id);this.cipher.set(n),this.toastService.showToast({variant:"success",message:this.i18nService.t("attachmentUpdated")}),this.onUploadSuccess.emit()}catch(n){this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}else this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}),this.attachmentForm.statusChanges.pipe((0,M.pQ)()).subscribe(e=>{const t=this.submitBtn();t&&t.disabled.set("VALID"!==e)}),(0,V.QZ)(()=>pn(this,void 0,void 0,function*(){const e=this.cipherId();if(!e)return;this.activeUserId=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6)),this.organization.set(yield this.getOrganization()),this.cipherDomain=yield this.getCipher(e),this.cipherDomain&&this.activeUserId&&this.cipher.set(yield this.cipherService.decrypt(this.cipherDomain,this.activeUserId));const t=this.submitBtn();t&&t.disabled.set(!this.attachmentForm.valid)})),(0,V.QZ)(()=>{const e=this.bitSubmit(),t=this.submitBtn();e&&t&&(e.loading$.pipe((0,M.pQ)(this.destroyRef)).subscribe(e=>{t.loading.set(e)}),e.disabled$.pipe((0,M.pQ)(this.destroyRef)).subscribe(e=>{t.disabled.set(e)}))})}get attachmentFormId(){return Sn.attachmentFormID}onFileChange(e){const t=e.target;t.files&&t.files.length>0&&this.attachmentForm.controls.file.setValue(t.files[0])}removeAttachment(e){const t=this.cipher();if(!(null==t?void 0:t.attachments))return;const i=t.attachments.indexOf(e);i>-1&&(t.attachments.splice(i,1),this.cipher.set(Object.assign(Object.create(Object.getPrototypeOf(t)),t))),this.onRemoveSuccess.emit()}getCipher(e){return pn(this,void 0,void 0,function*(){if(null==e||!this.activeUserId)return null;const t=yield this.cipherService.get(e,this.activeUserId);if(null!=t||!this.organizationId())return t;const i=this.organization();if(null!=i&&i.canEditAllCiphers){const t=yield this.apiService.getCipherAdmin(e),i=new sn.A(t);return new on.o(i)}return null})}getOrganization(){return pn(this,void 0,void 0,function*(){const e=this.organizationId();if(!e||!this.activeUserId)return null;return(yield(0,h._)(this.organizationService.organizations$(this.activeUserId))).find(t=>t.id===e)||null})}}Sn.attachmentFormID="attachmentForm",Sn.ɵfac=function(e){return new(e||Sn)(P.rXU(l.p),P.rXU(S.W),P.rXU(rn.ok),P.rXU(Z.K),P.rXU(y.f),P.rXU(k.Di),P.rXU(Fe.G),P.rXU(Y.PV))},Sn.ɵcmp=P.VBU({type:Sn,selectors:[["app-cipher-attachments"]],viewQuery:function(e,t){1&e&&(P.wEZ(t.fileInput,mn,5,P.aKT),P.wEZ(t.bitSubmit,an.L,5)),2&e&&P.NyB(2)},inputs:{cipherId:[1,"cipherId"],organizationId:[1,"organizationId"],admin:[1,"admin"],submitBtn:[1,"submitBtn"]},outputs:{onUploadStarted:"onUploadStarted",onUploadSuccess:"onUploadSuccess",onUploadFailed:"onUploadFailed",onRemoveSuccess:"onRemoveSuccess"},decls:22,vars:19,consts:[["fileInput",""],["id","attachments",1,"tw-sr-only"],["aria-labelledby","attachments",1,"tw-list-none","tw-pl-0"],[3,"id","formGroup","bitSubmit"],["for","file","bitTypography","body2",1,"tw-block","tw-text-muted","tw-px-1","tw-pb-1.5"],[1,"tw-relative"],["type","file","id","file","name","file","aria-describedby","fileHelp","tabindex","-1","required","",1,"tw-sr-only",3,"change"],["aria-hidden","true",1,"tw-flex","tw-gap-2","tw-items-center"],["bitButton","","buttonType","secondary","type","button",1,"tw-whitespace-nowrap",3,"click"],["bitTypography","body2",1,"tw-text-muted","tw-mb-0"],["id","fileHelp","bitTypography","helper",1,"tw-text-muted","tw-px-1","tw-pt-1","tw-mb-0"],["data-testid","file-name",3,"title"],["slot","secondary","data-testid","file-size"],["slot","default-trailing","class","bwi bwi-exclamation-triangle bwi-sm tw-text-muted",3,"appA11yTitle",4,"ngIf"],["slot","end"],[3,"admin","cipher","attachment"],["bitButton","","buttonType","primary","size","small","type","button",3,"bitAction"],[3,"onDeletionSuccess","admin","cipherId","attachment"],["slot","default-trailing",1,"bwi","bwi-exclamation-triangle","bwi-sm","tw-text-muted",3,"appA11yTitle"]],template:function(e,t){if(1&e){const e=P.RV6();P.j41(0,"h2",1),P.EFF(1),P.nI1(2,"i18n"),P.k0s(),P.nVh(3,wn,3,0,"ul",2),P.j41(4,"form",3)(5,"bit-card")(6,"label",4),P.EFF(7),P.nI1(8,"i18n"),P.k0s(),P.j41(9,"div",5)(10,"input",6,0),P.bIt("change",function(i){return a.eBV(e),a.Njj(t.onFileChange(i))}),P.k0s(),P.j41(12,"div",7)(13,"button",8),P.bIt("click",function(){a.eBV(e);const t=P.sdS(11);return a.Njj(t.click())}),P.EFF(14),P.nI1(15,"i18n"),P.k0s(),P.j41(16,"p",9),P.EFF(17),P.nI1(18,"i18n"),P.k0s()()(),P.j41(19,"p",10),P.EFF(20),P.nI1(21,"i18n"),P.k0s()()()}if(2&e){let e;P.R7$(),P.JRh(P.bMT(2,9,"attachments")),P.R7$(2),P.vxM((e=null==(e=t.cipher())?null:e.attachments)?3:-1,e),P.R7$(),P.Y8G("id",t.attachmentFormId)("formGroup",t.attachmentForm)("bitSubmit",t.submit),P.R7$(3),P.SpI(" ",P.bMT(8,11,"addAttachment")," "),P.R7$(7),P.SpI(" ",P.bMT(15,13,"chooseFile")," "),P.R7$(3),P.SpI(" ",null!=t.attachmentForm.controls.file&&t.attachmentForm.controls.file.value?t.attachmentForm.controls.file.value.name:P.bMT(18,15,"noFileChosen")," "),P.R7$(3),P.SpI(" ",P.bMT(21,17,"maxFileSizeSansPunctuation")," ")}},dependencies:[Te.C,Pe.p,an.L,en.t,un.Q,N.MD,N.bT,Se.k,Ae.J,De.g,Oe.D,X.p,hn.C,rn.X1,rn.qT,rn.cb,rn.j4,re.E,me.r,se.i,dn,Ee,ye.$],encapsulation:2,changeDetection:0});var In=i(68016);function kn(e,t){if(1&e){const e=P.RV6();P.j41(0,"app-cipher-attachments",7),P.bIt("onUploadStarted",function(){a.eBV(e);const t=P.XpG();return a.Njj(t.uploadStarted())})("onUploadSuccess",function(){a.eBV(e);const t=P.XpG();return a.Njj(t.uploadSuccessful())})("onUploadFailed",function(){a.eBV(e);const t=P.XpG();return a.Njj(t.uploadFailed())})("onRemoveSuccess",function(){a.eBV(e);const t=P.XpG();return a.Njj(t.removalSuccessful())}),P.k0s()}if(2&e){const e=P.XpG(),t=P.sdS(8);P.Y8G("cipherId",e.cipherId)("organizationId",e.organizationId)("admin",e.admin)("submitBtn",t)}}const Cn={Uploaded:"uploaded",Removed:"removed",Closed:"closed"};class Tn{constructor(e,t){var i;this.dialogRef=e,this.params=t,this.admin=!1,this.attachmentFormId=Sn.attachmentFormID,this.isUploading=!1,this.handleBeforeUnloadEvent=e=>{if(this.isUploading){e.preventDefault();const t="Upload in progress. Are you sure you want to leave?";return e.returnValue=t,t}},this.cipherId=t.cipherId,this.organizationId=t.organizationId,this.admin=null!==(i=t.admin)&&void 0!==i&&i}static open(e,t){return e.open(Tn,{data:t})}uploadStarted(){this.isUploading=!0,this.dialogRef.disableClose=!0}uploadSuccessful(){this.isUploading=!1,this.dialogRef.disableClose=!1,this.dialogRef.close({action:Cn.Uploaded})}uploadFailed(){this.isUploading=!1,this.dialogRef.disableClose=!1}removalSuccessful(){this.dialogRef.close({action:Cn.Removed})}}Tn.ɵfac=function(e){return new(e||Tn)(P.rXU(ln.ce),P.rXU(Qi.Qs))},Tn.ɵcmp=P.VBU({type:Tn,selectors:[["app-vault-attachments-v2"]],hostBindings:function(e,t){1&e&&P.bIt("beforeunload",function(e){return t.handleBeforeUnloadEvent(e)},P.tSv)},decls:11,vars:8,consts:[["submitBtn",""],["dialogSize","default","background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[3,"cipherId","organizationId","admin","submitBtn","onUploadStarted","onUploadSuccess","onUploadFailed","onRemoveSuccess",4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","primary"],[3,"onUploadStarted","onUploadSuccess","onUploadFailed","onRemoveSuccess","cipherId","organizationId","admin","submitBtn"]],template:function(e,t){1&e&&(P.j41(0,"bit-dialog",1)(1,"span",2),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.qex(4,3),P.DNE(5,kn,1,4,"app-cipher-attachments",4),P.bVm(),P.qex(6,5),P.j41(7,"button",6,0),P.EFF(9),P.nI1(10,"i18n"),P.k0s(),P.bVm(),P.k0s()),2&e&&(P.R7$(2),P.SpI(" ",P.bMT(3,4,"attachments")," "),P.R7$(3),P.Y8G("ngIf",t.cipherId),P.R7$(2),P.BMQ("form",t.attachmentFormId),P.R7$(2),P.SpI(" ",P.bMT(10,6,"upload")," "))},dependencies:[en.t,un.Q,N.MD,N.bT,tn.P,In.m,Sn,nn.$Z],encapsulation:2});var Fn=i(86157),Rn=i(69588),Pn=i(86639),xn=i(71373),$n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class En{constructor(e,t){this.passwordGenerationService=e,this.usernameGenerationService=t}generatePassword(){return $n(this,void 0,void 0,function*(){const[e]=yield this.passwordGenerationService.getOptions();return yield this.passwordGenerationService.generatePassword(e)})}generateUsername(){return $n(this,void 0,void 0,function*(){const e=yield this.usernameGenerationService.getOptions();return yield this.usernameGenerationService.generateUsername(e)})}}En.ɵfac=function(e){return new(e||En)(a.KVO(xn.JJ),a.KVO(xn.GL))},En.ɵprov=a.jDH({token:En,factory:En.ɵfac});var An=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Dn{constructor(){this.cipherService=(0,a.WQX)(l.p),this.accountService=(0,a.WQX)(k.Di),this.taskService=(0,a.WQX)(o.RB)}decryptCipher(e){return An(this,void 0,void 0,function*(){const t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));return yield this.cipherService.decrypt(e,t)})}saveCipher(e,t){return An(this,void 0,void 0,function*(){var i,n;const r=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));let s;if(null==e.id||""===e.id){const i=yield this.cipherService.encrypt(e,r);return s=yield this.cipherService.createWithServer(i,t.admin),yield this.cipherService.decrypt(s,r)}if(null==t.originalCipher)throw new Error("Original cipher is required for updating an existing cipher");const o=new Set(null!==(i=t.originalCipher.collectionIds)&&void 0!==i?i:[]),a=new Set(null!==(n=e.collectionIds)&&void 0!==n?n:[]);if(null===t.originalCipher.organizationId&&null!=e.organizationId){const i=e.organizationId;e.organizationId=null,s=yield this.cipherService.shareWithServer(e,i,e.collectionIds,r,t.originalCipher)}else if(c=a,(l=o).size===c.size&&[...l].every(e=>c.has(e))){const i=yield this.cipherService.encrypt(e,r,null,null,t.originalCipher);s=yield this.cipherService.updateWithServer(i,t.admin)}else{const i=yield this.cipherService.encrypt(e,r,null,null,t.originalCipher),n=i.cipher;n.collectionIds=t.originalCipher.collectionIds,yield this.cipherService.updateWithServer(i,t.admin||0===o.size),n.collectionIds=e.collectionIds,s=t.admin||0===o.size?yield this.cipherService.saveCollectionsWithServerAdmin(n):yield this.cipherService.saveCollectionsWithServer(n,r)}var l,c;return yield this.markAssociatedTaskAsComplete(r,e,t),null==s?null:yield this.cipherService.decrypt(s,r)})}markAssociatedTaskAsComplete(e,t,i){return An(this,void 0,void 0,function*(){var n;const s=yield this.cipherService.decrypt(i.originalCipher,e),a=yield(0,h._)(this.taskService.pendingTasks$(e).pipe((0,r.T)(e=>e.find(e=>e.type===o.Wn.UpdateAtRiskCredential&&e.cipherId===t.id)))),l=t.type===v.gC.Login&&t.login.password&&t.login.password!==(null===(n=null==s?void 0:s.login)||void 0===n?void 0:n.password);a&&l&&(yield this.taskService.markAsComplete(a.id,e))})}}Dn.ɵfac=function(e){return new(e||Dn)},Dn.ɵprov=a.jDH({token:Dn,factory:Dn.ɵfac});class On{}On.ɵfac=function(e){return new(e||On)},On.ɵmod=P.$C({type:On}),On.ɵinj=a.G2t({providers:[{provide:Rn.L,useClass:Dn},{provide:Fn.v,useClass:En}],imports:[Pn.z]});class Mn{}var Un=i(69194),Gn=i(18499),jn=i(43978),Nn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Vn{constructor(){this.policyService=(0,a.WQX)(Gn.m),this.organizationService=(0,a.WQX)(Y.PV),this.cipherService=(0,a.WQX)(l.p),this.folderService=(0,a.WQX)(Oi.k),this.collectionService=(0,a.WQX)(_.YD),this.accountService=(0,a.WQX)(k.Di),this.organizationDataOwnershipDisabled$=this.accountService.activeAccount$.pipe(H.F6,(0,B.n)(e=>this.policyService.policyAppliesToUser$(jn.tt.OrganizationDataOwnership,e)),(0,r.T)(e=>!e))}buildConfig(e,t,i){return Nn(this,void 0,void 0,function*(){var s,o;const a=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6)),[l,c,d,u,p]=yield(0,h._)((0,n.z)([this.organizations$(a),this.collectionService.encryptedCollections$(a).pipe((0,r.T)(e=>null!=e?e:[]),(0,B.n)(e=>this.collectionService.decryptedCollections$(a).pipe((0,Un.p)(t=>t.length===e.length)))),this.organizationDataOwnershipDisabled$,this.folderService.folders$(a).pipe((0,B.n)(e=>this.folderService.folderViews$(a).pipe((0,Un.p)(t=>t.length>0||0===e.length)))),this.getCipher(a,t)]));return{mode:e,cipherType:null!==(o=null!==(s=null==p?void 0:p.type)&&void 0!==s?s:i)&&void 0!==o?o:v.gC.Login,admin:!1,organizationDataOwnershipDisabled:d,originalCipher:p,collections:c,organizations:l,folders:u}})}organizations$(e){return this.organizationService.organizations$(e).pipe((0,r.T)(e=>e.filter(e=>e.isMember&&e.enabled&&e.status===jn.Zx.Confirmed)))}getCipher(e,t){return null==t?Promise.resolve(null):this.cipherService.get(t,e)}}Vn.ɵfac=function(e){return new(e||Vn)},Vn.ɵprov=a.jDH({token:Vn,factory:Vn.ɵfac});var Bn=i(93161),zn=i(27545),Ln=i(4162),Kn=i(99327);function qn(e,t){if(1&e){const e=P.RV6();P.j41(0,"tools-password-generator",2),P.bIt("onGenerated",function(t){a.eBV(e);const i=P.XpG();return a.Njj(i.onCredentialGenerated(t))})("onAlgorithm",function(t){a.eBV(e);const i=P.XpG();return a.Njj(i.onAlgorithmSelected(t))}),P.k0s()}if(2&e){const e=P.XpG();P.Y8G("disableMargin",e.disableMargin)}}function _n(e,t){if(1&e){const e=P.RV6();P.j41(0,"tools-username-generator",3),P.bIt("onGenerated",function(t){a.eBV(e);const i=P.XpG();return a.Njj(i.onCredentialGenerated(t))})("onAlgorithm",function(t){a.eBV(e);const i=P.XpG();return a.Njj(i.onAlgorithmSelected(t))}),P.k0s()}if(2&e){const e=P.XpG();P.Y8G("website",e.uri)("disableMargin",e.disableMargin)}}class Xn{constructor(){this.uri="",this.type="password",this.disableMargin=!1,this.algorithmSelected=new P.bkB,this.valueGenerated=new P.bkB,this.onAlgorithmSelected=e=>{this.algorithmSelected.emit(e)},this.onCredentialGenerated=e=>{this.valueGenerated.emit(e.credential)}}}Xn.ɵfac=function(e){return new(e||Xn)},Xn.ɵcmp=P.VBU({type:Xn,selectors:[["vault-cipher-form-generator"]],inputs:{uri:"uri",type:"type",disableMargin:[2,"disableMargin","disableMargin",Bn.he]},outputs:{algorithmSelected:"algorithmSelected",valueGenerated:"valueGenerated"},decls:2,vars:2,consts:[[3,"disableMargin","onGenerated","onAlgorithm",4,"ngIf"],[3,"website","disableMargin","onGenerated","onAlgorithm",4,"ngIf"],[3,"onGenerated","onAlgorithm","disableMargin"],[3,"onGenerated","onAlgorithm","website","disableMargin"]],template:function(e,t){1&e&&P.DNE(0,qn,1,1,"tools-password-generator",0)(1,_n,1,2,"tools-username-generator",1),2&e&&(P.Y8G("ngIf","password"===t.type),P.R7$(),P.Y8G("ngIf","username"===t.type))},dependencies:[N.MD,N.bT,zn.Im,Ln.M,Kn.d],encapsulation:2});i(30623);var Yn=i(27442),Hn=i(61465),Wn=i(8433),Jn=i(406),Zn=i(33886),Qn=i(68923),er=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function tr(e,t){if(1&e&&(P.j41(0,"li")(1,"p"),P.EFF(2),P.nI1(3,"i18n"),P.k0s()()),2&e){const e=P.XpG();P.R7$(2),P.SpI(" ",P.brH(3,1,"bulkCollectionAssignmentWarning",e.totalItemCount,e.readonlyItemCount)," ")}}function ir(e,t){if(1&e&&(P.j41(0,"li")(1,"p"),P.EFF(2),P.k0s()()),2&e){const e=P.XpG();P.R7$(2),P.SpI(" ",e.transferWarningText(e.orgName,e.personalItemsCount)," ")}}function nr(e,t){if(1&e&&P.nrm(0,"bit-option",11),2&e){const e=t.$implicit;P.Y8G("value",e.id)("label",e.name)}}function rr(e,t){if(1&e&&(P.j41(0,"div",4)(1,"bit-form-field",8)(2,"bit-label"),P.EFF(3),P.nI1(4,"i18n"),P.k0s(),P.j41(5,"bit-select",9),P.DNE(6,nr,1,2,"bit-option",10),P.nI1(7,"async"),P.k0s()()()),2&e){const e=P.XpG();P.R7$(3),P.JRh(P.bMT(4,2,"moveToOrganization")),P.R7$(3),P.Y8G("ngForOf",P.bMT(7,4,e.organizations$))}}function sr(e,t){if(1&e&&(P.j41(0,"bit-hint",12),P.EFF(1),P.nI1(2,"i18n"),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.SpI(" ",P.i5U(2,1,"cannotRemoveViewOnlyCollections",e.readOnlyCollectionNames.join(", "))," ")}}const or={Saved:"saved",Canceled:"canceled"},ar="MyVault";class lr{get selectedOrgId(){return this.formGroup.getRawValue().selectedOrg||this.params.organizationId}constructor(e,t,i,n,s,o,a){this.cipherService=e,this.i18nService=t,this.organizationService=i,this.collectionService=n,this.formBuilder=s,this.toastService=o,this.accountService=a,this.editableItemCountChange=new P.bkB,this.onCollectionAssign=new P.bkB,this.formGroup=this.formBuilder.group({selectedOrg:[null],collections:[[],[rn.k0.required]]}),this.readOnlyCollectionNames=[],this.availableCollections=[],this.showOrgSelector=!1,this.organizations$=this.accountService.activeAccount$.pipe((0,B.n)(e=>this.organizationService.organizations$(null==e?void 0:e.id).pipe((0,r.T)(e=>e.filter(e=>e.enabled&&e.status===jn.Zx.Confirmed).sort((e,t)=>e.name.localeCompare(t.name))),(0,Ht.M)(e=>{e.length>0&&this.showOrgSelector&&setTimeout(()=>{this.formGroup.patchValue({selectedOrg:e[0].id}),this.setFormValidators(),1===e.length&&this.formGroup.controls.selectedOrg.disable()})})))),this.transferWarningText=(e,t)=>{const i=!!e;return t>1&&i?this.i18nService.t("personalItemsWithOrgTransferWarningPlural",t,e):t>1&&!i?this.i18nService.t("personalItemsTransferWarningPlural",t):1===t&&i?this.i18nService.t("personalItemWithOrgTransferWarningSingular",e):this.i18nService.t("personalItemTransferWarningSingular")},this.editableItems=[],this.destroy$=new E.B,this.submit=()=>er(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=this.editableItems.filter(e=>e.organizationId).map(e=>e.id),t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));if(this.personalItemsCount>0&&(yield this.moveToOrganization(this.selectedOrgId,this.params.ciphers.filter(e=>null==e.organizationId),this.formGroup.controls.collections.value.map(e=>e.id),t)),e.length>0){const i=1===e.length&&0===this.personalItemsCount;yield i?this.updateAssignedCollections(this.editableItems[0],t):this.bulkUpdateCollections(e,t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("successfullyAssignedCollections")})}this.onCollectionAssign.emit(or.Saved)}),this.sortItems=(e,t)=>this.i18nService.collator.compare(e.labelName,t.labelName)}ngOnInit(){return er(this,void 0,void 0,function*(){const e=this.params.ciphers.every(e=>null==e.organizationId);(this.selectedOrgId===ar||e)&&(this.showOrgSelector=!0),yield this.initializeItems(this.selectedOrgId),this.selectedOrgId&&this.selectedOrgId!==ar&&(yield this.handleOrganizationCiphers(this.selectedOrgId)),this.setupFormSubscriptions()})}ngAfterViewInit(){this.bitSubmit.loading$.pipe((0,$.Q)(this.destroy$)).subscribe(e=>{this.submitBtn&&this.submitBtn.loading.set(e)}),this.bitSubmit.disabled$.pipe((0,$.Q)(this.destroy$)).subscribe(e=>{this.submitBtn&&this.submitBtn.disabled.set(e)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}selectCollections(e){const t=[...this.formGroup.controls.collections.value,...e].sort(this.sortItems);this.formGroup.patchValue({collections:t})}handleOrganizationCiphers(e){return er(this,void 0,void 0,function*(){if(0==this.editableItemCount)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("nothingSelected")}),void this.onCollectionAssign.emit(or.Canceled);const t=yield(0,h._)((0,H.F6)(this.accountService.activeAccount$)),i=yield(0,h._)(this.organizationService.organizations$(t).pipe((0,Y.Sw)(e)));yield this.setReadOnlyCollectionNames();const n=this.canAccessDefaultCollection(this.params.availableCollections);this.availableCollections=this.params.availableCollections.filter(e=>n?e.canEditItems(i):e.canEditItems(i)&&e.type!==_.it.DefaultUserCollection).map(e=>({icon:e.type===_.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared",id:e.id,labelName:e.name,listName:e.name})),this.selectCollectionsAssignedToSingleCipher(),this.params.activeCollection&&this.selectCollections([{icon:"bwi-collection-shared",id:this.params.activeCollection.id,labelName:this.params.activeCollection.name,listName:this.params.activeCollection.name}])})}selectCollectionsAssignedToSingleCipher(){if(1!==this.params.ciphers.length)return;const e=this.params.ciphers[0].collectionIds,t=this.availableCollections.filter(t=>{var i;return e.includes(t.id)&&t.id!==(null===(i=this.params.activeCollection)||void 0===i?void 0:i.id)}).map(e=>({icon:e.icon,id:e.id,labelName:e.labelName,listName:e.listName}));t.length>0&&this.selectCollections(t)}initializeItems(e){return er(this,void 0,void 0,function*(){if(this.totalItemCount=this.params.ciphers.length,!e||e===ar)return this.editableItems=this.params.ciphers,this.editableItemCount=this.params.ciphers.length,this.personalItemsCount=this.params.ciphers.length,void this.editableItemCountChange.emit(this.editableItemCount);const t=yield(0,h._)((0,H.F6)(this.accountService.activeAccount$)),i=yield(0,h._)(this.organizationService.organizations$(t).pipe((0,Y.Sw)(e)));this.orgName=i.name,this.editableItems=i.canEditAllCiphers?this.params.ciphers:this.params.ciphers.filter(e=>e.edit),this.editableItemCount=this.editableItems.length,this.editableItemCountChange.emit(this.editableItemCount),this.personalItemsCount=this.params.ciphers.filter(e=>null==e.organizationId).length,this.readonlyItemCount=this.totalItemCount-this.editableItemCount})}setFormValidators(){const e=this.formGroup.get("selectedOrg");null==e||e.setValidators([rn.k0.required]),null==e||e.updateValueAndValidity()}setupFormSubscriptions(){this.formGroup.controls.selectedOrg.valueChanges.pipe((0,Ht.M)(()=>{this.formGroup.controls.collections.setValue([],{emitEvent:!1})}),(0,B.n)(e=>this.getCollectionsForOrganization(e)),(0,$.Q)(this.destroy$)).subscribe(e=>{this.availableCollections=e.map(e=>({icon:e.type===_.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared",id:e.id,labelName:e.name,listName:e.name}))})}getCollectionsForOrganization(e){return this.accountService.activeAccount$.pipe(H.F6,(0,B.n)(e=>(0,n.z)([this.collectionService.decryptedCollections$(e),this.organizationService.organizations$(e)])),(0,r.T)(([t,i])=>{const n=i.find(t=>t.id===e);this.orgName=n.name;const r=t.filter(t=>t.organizationId===e),s=this.canAccessDefaultCollection(t);return r.filter(e=>s?!e.readOnly:!e.readOnly&&e.type!==_.it.DefaultUserCollection)}),(0,Yn.t)({refCount:!0,bufferSize:1}))}moveToOrganization(e,t,i,n){return er(this,void 0,void 0,function*(){var r;yield this.cipherService.shareManyWithServer(t,e,i,n),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(1===t.length?"itemMovedToOrg":"itemsMovedToOrg",null!==(r=this.orgName)&&void 0!==r?r:this.i18nService.t("organization"))})})}bulkUpdateCollections(e,t){return er(this,void 0,void 0,function*(){this.formGroup.controls.collections.value.length>0&&(yield this.cipherService.bulkUpdateCollectionsWithServer(this.selectedOrgId,t,e,this.formGroup.controls.collections.value.map(e=>e.id),!1)),null!=this.params.activeCollection&&null==this.formGroup.controls.collections.value.find(e=>e.id===this.params.activeCollection.id)&&(yield this.cipherService.bulkUpdateCollectionsWithServer(this.selectedOrgId,t,e,[this.params.activeCollection.id],!0))})}updateAssignedCollections(e,t){return er(this,void 0,void 0,function*(){const{collections:i}=this.formGroup.getRawValue();e.collectionIds=i.map(e=>e.id);const{cipher:n}=yield this.cipherService.encrypt(e,t);this.params.isSingleCipherAdmin?yield this.cipherService.saveCollectionsWithServerAdmin(n):yield this.cipherService.saveCollectionsWithServer(n,t)})}setReadOnlyCollectionNames(){return er(this,void 0,void 0,function*(){const{availableCollections:e,ciphers:t}=this.params,i=yield(0,h._)(this.organizations$.pipe((0,r.T)(e=>e.find(e=>e.id===this.selectedOrgId))));this.readOnlyCollectionNames=e.filter(e=>e.readOnly&&t.some(t=>t.collectionIds.includes(e.id))&&!e.canEditItems(i)).map(e=>e.name)})}canAccessDefaultCollection(e){const t=Object.fromEntries(e.map(e=>[e.id,e])),i=this.params.ciphers.every(e=>!e.collectionIds.length||e.collectionIds.some(e=>{var i;return(null===(i=t[e])||void 0===i?void 0:i.type)===_.it.DefaultUserCollection}));return i}}function cr(e,t){if(1&e&&(P.j41(0,"bit-item")(1,"div",3),P.nrm(2,"bit-color-password",4),P.j41(3,"div",5),P.EFF(4),P.nI1(5,"date"),P.k0s()(),P.qex(6,6),P.j41(7,"bit-item-action"),P.nrm(8,"button",7),P.nI1(9,"i18n"),P.nI1(10,"i18n"),P.k0s(),P.bVm(),P.k0s()),2&e){const e=t.$implicit;P.R7$(2),P.Y8G("password",e.password)("showCount",!1),P.R7$(2),P.JRh(P.i5U(5,6,e.lastUsedDate,"medium")),P.R7$(4),P.Y8G("label",P.bMT(9,9,"copyPassword"))("appCopyClick",e.password)("valueLabel",P.bMT(10,11,"password"))}}function dr(e,t){if(1&e&&(P.j41(0,"div"),P.DNE(1,cr,11,13,"bit-item",2),P.k0s()),2&e){const e=P.XpG();P.R7$(),P.Y8G("ngForOf",e.history)}}function ur(e,t){1&e&&(P.j41(0,"div",8)(1,"p"),P.EFF(2),P.nI1(3,"i18n"),P.k0s()()),2&e&&(P.R7$(2),P.JRh(P.bMT(3,1,"noPasswordsInList")))}lr.ɵfac=function(e){return new(e||lr)(P.rXU(l.p),P.rXU(S.W),P.rXU(Y.PV),P.rXU(_.YD),P.rXU(rn.ok),P.rXU(y.f),P.rXU(k.Di))},lr.ɵcmp=P.VBU({type:lr,selectors:[["assign-collections"]],viewQuery:function(e,t){if(1&e&&P.GBs(an.L,5),2&e){let e;P.mGM(e=P.lsd())&&(t.bitSubmit=e.first)}},inputs:{params:"params",submitBtn:"submitBtn"},outputs:{editableItemCountChange:"editableItemCountChange",onCollectionAssign:"onCollectionAssign"},decls:15,vars:13,consts:[["id","assign_collections_form",3,"formGroup","bitSubmit"],[1,"tw-list-disc","tw-pl-5","tw-space-y-2","tw-break-words"],[4,"ngIf"],["class","tw-flex",4,"ngIf"],[1,"tw-flex"],["disableMargin","",1,"tw-grow","tw-max-w-full"],["formControlName","collections",1,"tw-w-full",3,"baseItems"],["data-testid","view-only-hint",4,"ngIf"],[1,"tw-grow","tw-max-w-full"],["formControlName","selectedOrg"],["icon","bwi-business",3,"value","label",4,"ngFor","ngForOf"],["icon","bwi-business",3,"value","label"],["data-testid","view-only-hint"]],template:function(e,t){1&e&&(P.j41(0,"form",0)(1,"p"),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.j41(4,"ul",1),P.DNE(5,tr,4,5,"li",2)(6,ir,3,1,"li",2),P.k0s(),P.DNE(7,rr,8,6,"div",3),P.j41(8,"div",4)(9,"bit-form-field",5)(10,"bit-label"),P.EFF(11),P.nI1(12,"i18n"),P.k0s(),P.nrm(13,"bit-multi-select",6),P.DNE(14,sr,3,4,"bit-hint",7),P.k0s()()()),2&e&&(P.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),P.R7$(2),P.SpI(" ",P.bMT(3,9,1===t.personalItemsCount?"bulkCollectionAssignmentDialogDescriptionSingular":"bulkCollectionAssignmentDialogDescriptionPlural")," "),P.R7$(3),P.Y8G("ngIf",t.readonlyItemCount>0),P.R7$(),P.Y8G("ngIf",t.personalItemsCount>0),P.R7$(),P.Y8G("ngIf",t.showOrgSelector),P.R7$(4),P.JRh(P.bMT(12,11,"selectCollectionsToAssign")),P.R7$(2),P.Y8G("baseItems",t.availableCollections),P.R7$(),P.Y8G("ngIf",t.readOnlyCollectionNames.length>0))},dependencies:[N.MD,N.Sq,N.bT,X.p,ce.L,ve.j,ni.I,Jn.b,fe.h,Te.C,an.L,Hn.i,Wn.p,Zn.w,Qn.P,rn.X1,rn.qT,rn.BC,rn.cb,rn.j4,rn.JD,en.t,tn.P,N.Jj,ye.$],encapsulation:2});class hr{constructor(){this.history=[]}ngOnInit(){this.history=null==this.cipher.passwordHistory?[]:this.cipher.passwordHistory}}hr.ɵfac=function(e){return new(e||hr)},hr.ɵcmp=P.VBU({type:hr,selectors:[["vault-password-history-view"]],inputs:{cipher:"cipher"},decls:2,vars:2,consts:[[4,"ngIf"],["class","tw-absolute tw-top-1/2 tw-left-1/2 tw-transform tw--translate-x-1/2 tw--translate-y-1/2 tw-text-center",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"tw-pl-3","tw-py-2"],[1,"tw-text-base",3,"password","showCount"],[1,"tw-text-sm","tw-text-muted"],["slot","end"],["type","button","bitIconButton","bwi-clone","appStopClick","","showToast","",3,"label","appCopyClick","valueLabel"],[1,"tw-absolute","tw-top-1/2","tw-left-1/2","tw-transform","tw--translate-x-1/2","tw--translate-y-1/2","tw-text-center"]],template:function(e,t){1&e&&P.DNE(0,dr,2,1,"div",0)(1,ur,4,3,"div",1),2&e&&(P.Y8G("ngIf",t.history&&t.history.length),P.R7$(),P.Y8G("ngIf",!(null!=t.history&&t.history.length)))},dependencies:[N.MD,N.Sq,N.bT,Se.k,Ae.J,Oe.D,et.p,at.S,oe.Q,he.s,X.p,rt.Y,de.D,N.vh,ye.$],encapsulation:2});var pr=i(67311);function mr(e,t){if(1&e){const e=P.RV6();P.j41(0,"li",9,0),P.bIt("click",function(){a.eBV(e);const t=P.sdS(1),i=P.XpG();return a.Njj(i.selectText(t))}),P.EFF(2),P.k0s()}if(2&e){const e=t.$implicit;P.R7$(2),P.SpI(" ",e," ")}}class vr{constructor(){this.dialogRef=(0,a.WQX)(ln.ce),this.params=(0,a.WQX)(Qi.Qs),this.platformUtilsService=(0,a.WQX)(g.y)}selectText(e){const t=window.getSelection();if(null==t)return;t.removeAllRanges();const i=document.createRange();i.selectNodeContents(e),t.addRange(i)}openContactSupport(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/contact")}static open(e,t){return e.open(vr,{data:t,positionStrategy:new ln.u3})}}vr.ɵfac=function(e){return new(e||vr)},vr.ɵcmp=P.VBU({type:vr,selectors:[["vault-decryption-failure-dialog"]],decls:20,vars:16,consts:[["listItem",""],["bitDialogIcon","","aria-hidden","true",1,"bwi","tw-text-3xl","bwi-exclamation-triangle","tw-text-warning"],["bitDialogTitle",""],["bitDialogContent",""],["bitLink","","href","#",3,"click"],[1,"tw-list-none","tw-pl-0"],["class","tw-text-code tw-font-mono tw-py-0.5",3,"click",4,"ngFor","ngForOf"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary",3,"click"],[1,"tw-text-code","tw-font-mono","tw-py-0.5",3,"click"]],template:function(e,t){1&e&&(P.j41(0,"bit-simple-dialog"),P.nrm(1,"i",1),P.j41(2,"span",2),P.EFF(3),P.nI1(4,"i18n"),P.k0s(),P.j41(5,"div",3)(6,"p"),P.EFF(7),P.nI1(8,"i18n"),P.j41(9,"a",4),P.bIt("click",function(e){return t.openContactSupport(e)}),P.EFF(10),P.nI1(11,"i18n"),P.k0s(),P.EFF(12),P.nI1(13,"i18n"),P.k0s(),P.j41(14,"ul",5),P.DNE(15,mr,3,1,"li",6),P.k0s()(),P.qex(16,7),P.j41(17,"button",8),P.bIt("click",function(){return t.dialogRef.close(!1)}),P.EFF(18),P.nI1(19,"i18n"),P.k0s(),P.bVm(),P.k0s()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,6,"decryptionError")),P.R7$(4),P.SpI(" ",P.bMT(8,8,"couldNotDecryptVaultItemsBelow")," "),P.R7$(3),P.JRh(P.bMT(11,10,"contactCSToAvoidDataLossPart1")),P.R7$(2),P.SpI(" ",P.bMT(13,12,"contactCSToAvoidDataLossPart2")," "),P.R7$(3),P.Y8G("ngForOf",t.params.cipherIds),P.R7$(3),P.SpI(" ",P.bMT(19,14,"close")," "))},dependencies:[tn.P,pr.L,pr.o,N.MD,N.Sq,re.E,X.p,Te.C,en.t,un.Q,ne.L,ye.$],encapsulation:2});class fr{constructor(e,t){this.params=e,this.dialogRef=t,this.cipher=e.cipher}close(){this.dialogRef.close()}}function gr(e,t){return e.open(fr,t)}fr.ɵfac=function(e){return new(e||fr)(P.rXU(Qi.Qs),P.rXU(ln.ce))},fr.ɵcmp=P.VBU({type:fr,selectors:[["app-vault-password-history"]],decls:10,vars:7,consts:[["background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[3,"cipher"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","button",3,"click"]],template:function(e,t){1&e&&(P.j41(0,"bit-dialog",0)(1,"span",1),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.qex(4,2),P.nrm(5,"vault-password-history-view",3),P.bVm(),P.qex(6,4),P.j41(7,"button",5),P.bIt("click",function(){return t.close()}),P.EFF(8),P.nI1(9,"i18n"),P.k0s(),P.bVm(),P.k0s()),2&e&&(P.R7$(2),P.SpI(" ",P.bMT(3,3,"passwordHistory")," "),P.R7$(3),P.Y8G("cipher",t.cipher),P.R7$(3),P.SpI(" ",P.bMT(9,5,"close")," "))},dependencies:[en.t,un.Q,N.MD,Te.C,tn.P,In.m,hr,nn.$Z],encapsulation:2});var yr=i(41103),br=i(7730),wr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Sr=["submitBtn"];function Ir(e,t){if(1&e&&(P.nrm(0,"button",10),P.nI1(1,"i18n")),2&e){const e=P.XpG();P.Y8G("label",P.bMT(1,2,"deleteFolder"))("bitAction",e.deleteFolder)}}const kr={Created:"created",Deleted:"deleted"};class Cr{constructor(e,t,i,n,s,o,l,c,d,u,p){this.formBuilder=e,this.folderService=t,this.folderApiService=i,this.accountService=n,this.keyService=s,this.toastService=o,this.i18nService=l,this.logService=c,this.dialogService=d,this.dialogRef=u,this.data=p,this.folder=new Tt.u,this.variant="add",this.folderForm=this.formBuilder.group({name:["",rn.k0.required]}),this.activeUserId$=this.accountService.activeAccount$.pipe((0,r.T)(e=>null==e?void 0:e.id)),this.destroyRef=(0,a.WQX)(a.abz),this.submit=()=>wr(this,void 0,void 0,function*(){var e;if(!this.folderForm.invalid){this.folder.name=null!==(e=this.folderForm.controls.name.value)&&void 0!==e?e:"";try{const e=yield(0,h._)(this.activeUserId$),t=yield this.keyService.getUserKey(e),i=yield this.folderService.encrypt(this.folder,t);yield this.folderApiService.save(i,e),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("editedFolder")}),this.close(kr.Created)}catch(t){this.logService.error(t)}}}),this.deleteFolder=()=>wr(this,void 0,void 0,function*(){if(yield this.dialogService.openSimpleDialog({title:{key:"deleteFolder"},content:{key:"deleteFolderPermanently"},type:"warning"})){try{const e=yield(0,h._)(this.activeUserId$);yield this.folderApiService.delete(this.folder.id,e),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("deletedFolder")})}catch(e){this.logService.error(e)}this.close(kr.Deleted)}})}ngOnInit(){var e;(null===(e=this.data)||void 0===e?void 0:e.editFolderConfig)?(this.variant="edit",this.folderForm.controls.name.setValue(this.data.editFolderConfig.folder.name),this.folder=this.data.editFolderConfig.folder):this.folder=new Tt.u}ngAfterViewInit(){var e;null===(e=this.bitSubmit)||void 0===e||e.loading$.pipe((0,M.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn&&this.submitBtn.loading.set(e)})}close(e){this.dialogRef.close(e)}static open(e,t){return e.open(Cr,{data:t})}}Cr.ɵfac=function(e){return new(e||Cr)(P.rXU(rn.ok),P.rXU(Oi.k),P.rXU(yr.w),P.rXU(k.Di),P.rXU(Ie.Lu),P.rXU(y.f),P.rXU(S.W),P.rXU(Z.K),P.rXU(ln.o3),P.rXU(ln.ce),P.rXU(Qi.Qs))},Cr.ɵcmp=P.VBU({type:Cr,selectors:[["vault-add-edit-folder-dialog"]],viewQuery:function(e,t){if(1&e&&(P.GBs(an.L,5),P.GBs(Sr,5)),2&e){let e;P.mGM(e=P.lsd())&&(t.bitSubmit=e.first),P.mGM(e=P.lsd())&&(t.submitBtn=e.first)}},decls:23,vars:19,consts:[["submitBtn",""],["id","add-edit-folder",3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["disableMargin",""],["bitInput","","id","folderName","formControlName","name","type","text"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","form","add-edit-folder",3,"disabled"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"],["type","button","buttonType","danger","class","tw-ml-auto","bitIconButton","bwi-trash",3,"label","bitAction",4,"ngIf"],["type","button","buttonType","danger","bitIconButton","bwi-trash",1,"tw-ml-auto",3,"label","bitAction"]],template:function(e,t){1&e&&(P.j41(0,"form",1)(1,"bit-dialog")(2,"span",2),P.EFF(3),P.nI1(4,"i18n"),P.k0s(),P.j41(5,"div",3)(6,"bit-form-field",4)(7,"bit-label"),P.EFF(8),P.nI1(9,"i18n"),P.k0s(),P.nrm(10,"input",5),P.j41(11,"bit-hint"),P.EFF(12),P.nI1(13,"i18n"),P.k0s()()(),P.qex(14,6),P.j41(15,"button",7,0),P.EFF(17),P.nI1(18,"i18n"),P.k0s(),P.j41(19,"button",8),P.EFF(20),P.nI1(21,"i18n"),P.k0s(),P.DNE(22,Ir,2,4,"button",9),P.bVm(),P.k0s()()),2&e&&(P.Y8G("formGroup",t.folderForm)("bitSubmit",t.submit),P.R7$(3),P.SpI(" ",P.bMT(4,9,"add"===t.variant?"newFolder":"editFolder")," "),P.R7$(5),P.JRh(P.bMT(9,11,"folderName")),P.R7$(4),P.SpI(" ",P.bMT(13,13,"folderHintText")," "),P.R7$(3),P.Y8G("disabled",t.folderForm.invalid),P.R7$(2),P.SpI(" ",P.bMT(18,15,"save")," "),P.R7$(3),P.SpI(" ",P.bMT(21,17,"cancel")," "),P.R7$(2),P.Y8G("ngIf","edit"===t.variant))},dependencies:[N.MD,N.bT,X.p,tn.P,br.I,In.m,en.t,un.Q,ce.L,ve.j,ni.I,pe.J,fe.h,rn.X1,rn.qT,rn.me,rn.BC,rn.cb,rn.j4,rn.JD,oe.Q,he.s,Te.C,Pe.p,an.L,ye.$],encapsulation:2});var Tr=i(37831);const Fr=e=>({"tw-px-4 tw-py-5":e});function Rr(e,t){if(1&e&&(P.j41(0,"div",0),P.SdG(1),P.k0s()),2&e){const e=P.XpG();P.Y8G("ngClass",P.eq3(2,Fr,!e.disablePadding)),P.BMQ("tabIndex",e.noFocusableChildren?0:void 0)}}class Pr{get content(){return this._contentPortal}constructor(e){this.viewContainerRef=e,this.disablePadding=!1,this._contentPortal=null}ngOnInit(){this._contentPortal=new Tr.VA(this.implicitContent,this.viewContainerRef)}}Pr.ɵfac=function(e){return new(e||Pr)(P.rXU(P.c1b))},Pr.ɵcmp=P.VBU({type:Pr,selectors:[["vault-carousel-slide"]],viewQuery:function(e,t){if(1&e&&P.GBs(P.C4Q,7),2&e){let e;P.mGM(e=P.lsd())&&(t.implicitContent=e.first)}},inputs:{label:"label",disablePadding:[2,"disablePadding","disablePadding",O.L39],noFocusableChildren:[2,"noFocusableChildren","noFocusableChildren",Bn.he]},ngContentSelectors:["*"],decls:1,vars:0,consts:[["role","tabpanel",3,"ngClass"]],template:function(e,t){1&e&&(P.NAR(),P.DNE(0,Rr,2,4,"ng-template"))},dependencies:[N.MD,N.YU],encapsulation:2});var xr=i(58716),$r=i(58363);const Er=i(13299).Sm`
  <svg class="tw-block" width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" data-testid="inactive-carousel-icon">
    <rect class="tw-stroke-current" x="0.5" y="0.5" width="11" height="11" rx="5.5" />
  </svg>
`;var Ar=i(55807),Dr=i(58384);const Or=["btn"];class Mr{constructor(){this.CarouselIcon=Er,this.onClick=new P.bkB}focus(){this.button.nativeElement.focus()}get dynamicClasses(){return this.isActive?["[&_rect]:tw-fill-primary-600","tw-text-primary-600"]:["tw-text-muted","[&_rect]:hover:tw-fill-text-muted","focus-visible:tw-text-info-700"]}}function Ur(e,t){}Mr.ɵfac=function(e){return new(e||Mr)},Mr.ɵcmp=P.VBU({type:Mr,selectors:[["vault-carousel-button"]],viewQuery:function(e,t){if(1&e&&P.GBs(Or,7),2&e){let e;P.mGM(e=P.lsd())&&(t.button=e.first)}},inputs:{slide:"slide",isActive:"isActive"},outputs:{onClick:"onClick"},decls:3,vars:5,consts:[["btn",""],["type","button","role","tab",1,"tw-size-6","tw-p-0","tw-flex","tw-items-center","tw-justify-center","tw-border-2","tw-border-solid","tw-rounded-full","tw-transition","tw-bg-transparent","tw-border-transparent","focus-visible:tw-outline-none","focus-visible:tw-border-primary-600",3,"click","ngClass"],[3,"icon"]],template:function(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",1,0),P.bIt("click",function(){return a.eBV(e),a.Njj(t.onClick.emit())}),P.nrm(2,"bit-icon",2),P.k0s()}2&e&&(P.Y8G("ngClass",t.dynamicClasses),P.BMQ("aria-selected",t.isActive)("tabindex",t.isActive?0:-1)("aria-label",t.slide.label),P.R7$(2),P.Y8G("icon",t.CarouselIcon))},dependencies:[N.MD,N.YU,Ar.o,Dr.i],encapsulation:2});class Gr{}Gr.ɵfac=function(e){return new(e||Gr)},Gr.ɵcmp=P.VBU({type:Gr,selectors:[["vault-carousel-content"]],inputs:{content:"content"},decls:2,vars:1,consts:[["aria-live","polite","aria-atomic","false",1,"tw-m-auto","tw-text-main"],[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&(P.j41(0,"div",0),P.DNE(1,Ur,0,0,"ng-template",1),P.k0s()),2&e&&(P.R7$(),P.Y8G("cdkPortalOutlet",t.content))},dependencies:[Tr.I3],encapsulation:2});var jr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Nr=["container"],Vr=["carouselButtonWrapper"],Br=["tempSlideContainer"],zr=e=>({minHeight:e});function Lr(e,t){if(1&e){const e=P.RV6();P.j41(0,"vault-carousel-button",11),P.bIt("onClick",function(){const t=a.eBV(e).index,i=P.XpG();return a.Njj(i.selectSlide(t))}),P.k0s()}if(2&e){const e=t.$implicit,i=t.index,n=P.XpG();P.Y8G("slide",e)("isActive",i===n.selectedIndex)}}function Kr(e,t){}function qr(e,t){1&e&&(P.j41(0,"div",12,2),P.DNE(2,Kr,0,0,"ng-template",13),P.k0s())}class _r{constructor(e,t){this.ngZone=e,this.destroyRef=t,this.changeDetectorRef=(0,a.WQX)(O.gRc),this.label="",this.slideChange=new P.bkB,this.selectedIndex=0,this.minHeight=null,this.keyManager=null}selectSlide(e){this.selectedIndex=e,this.slideChange.emit(e)}nextSlide(){this.selectedIndex<this.slides.length-1&&this.selectSlide(this.selectedIndex+1)}prevSlide(){this.selectedIndex>0&&this.selectSlide(this.selectedIndex-1)}ngAfterViewInit(){return jr(this,void 0,void 0,function*(){this.keyManager=new xr.B(this.carouselButtons).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd(),this.keyManager.setFirstItemActive(),this.ngZone.onStable.pipe((0,$r.s)(1),(0,M.pQ)(this.destroyRef)).subscribe(()=>{this.setMinHeightOfCarousel()})})}setMinHeightOfCarousel(){return jr(this,void 0,void 0,function*(){const e=this.carouselButtonWrapper.nativeElement.offsetHeight,t=this.carouselContainer.nativeElement.offsetWidth,i=this.carouselContainer.nativeElement.offsetHeight;this.tempSlideContainer.nativeElement.style.width=`${t}px`;let n=i-e;for(let r=0;r<this.slides.length;r++)r!==this.selectedIndex&&(this.tempSlideOutlet.attach(this.slides.get(r).content),yield new Promise(requestAnimationFrame),this.tempSlideContainer.nativeElement.offsetHeight>n&&(n=this.tempSlideContainer.nativeElement.offsetHeight),this.tempSlideOutlet.detach());this.minHeight=`${n+e}px`,this.changeDetectorRef.detectChanges()})}}_r.ɵfac=function(e){return new(e||_r)(P.rXU(P.SKi),P.rXU(a.abz))},_r.ɵcmp=P.VBU({type:_r,selectors:[["vault-carousel"]],contentQueries:function(e,t,i){if(1&e&&P.wni(i,Pr,4),2&e){let e;P.mGM(e=P.lsd())&&(t.slides=e)}},viewQuery:function(e,t){if(1&e&&(P.GBs(Nr,5),P.GBs(Vr,5),P.GBs(Br,5),P.GBs(Tr.I3,5),P.GBs(Mr,5)),2&e){let e;P.mGM(e=P.lsd())&&(t.carouselContainer=e.first),P.mGM(e=P.lsd())&&(t.carouselButtonWrapper=e.first),P.mGM(e=P.lsd())&&(t.tempSlideContainer=e.first),P.mGM(e=P.lsd())&&(t.tempSlideOutlet=e.first),P.mGM(e=P.lsd())&&(t.carouselButtons=e)}},inputs:{label:"label"},outputs:{slideChange:"slideChange"},decls:12,vars:17,consts:[["container",""],["carouselButtonWrapper",""],["tempSlideContainer",""],["aria-roledescription","carousel",1,"tw-flex","tw-flex-col",3,"ngStyle"],[3,"content"],[1,"tw-w-full","tw-flex","tw-justify-between","tw-mt-auto","tw-px-4","tw-pb-2","tw-pt-4"],["type","button","bitIconButton","bwi-angle-left","size","small",1,"tw-size-6","tw-p-0","tw-flex","tw-items-center","tw-justify-center",3,"click","disabled","label"],["role","tablist",1,"tw-w-full","tw-flex","tw-gap-2","tw-justify-center","tw-mt-auto",3,"keydown"],[3,"slide","isActive","onClick",4,"ngFor","ngForOf"],["type","button","bitIconButton","bwi-angle-right","size","small",1,"tw-size-6","tw-p-0","tw-flex","tw-items-center","tw-justify-center",3,"click","disabled","label"],["class","tw-absolute tw-invisible",4,"ngIf"],[3,"onClick","slide","isActive"],[1,"tw-absolute","tw-invisible"],["cdkPortalOutlet",""]],template:function(e,t){var i;if(1&e){const e=P.RV6();P.j41(0,"section",3,0),P.nrm(2,"vault-carousel-content",4),P.j41(3,"div",5)(4,"button",6),P.nI1(5,"i18n"),P.bIt("click",function(){return a.eBV(e),a.Njj(t.prevSlide())}),P.k0s(),P.j41(6,"div",7,1),P.bIt("keydown",function(i){return a.eBV(e),a.Njj(t.keyManager.onKeydown(i))}),P.DNE(8,Lr,1,2,"vault-carousel-button",8),P.k0s(),P.j41(9,"button",9),P.nI1(10,"i18n"),P.bIt("click",function(){return a.eBV(e),a.Njj(t.nextSlide())}),P.k0s()(),P.DNE(11,qr,3,0,"div",10),P.k0s()}if(2&e){let e;P.Y8G("ngStyle",P.eq3(15,zr,null!==(i=t.minHeight)&&void 0!==i?i:void 0)),P.BMQ("aria-label",t.label),P.R7$(2),P.Y8G("content",null==(e=t.slides.get(t.selectedIndex))?null:e.content),P.R7$(2),P.Y8G("label",P.mNQ(P.bMT(5,11,"back")))("disabled",t.selectedIndex<=0),P.R7$(4),P.Y8G("ngForOf",t.slides),P.R7$(),P.Y8G("label",P.mNQ(P.bMT(10,13,"next")))("disabled",t.selectedIndex>=t.slides.length-1),P.R7$(2),P.Y8G("ngIf",null===t.minHeight)}},dependencies:[Tr.I3,N.MD,N.Sq,N.bT,N.B3,X.p,oe.Q,he.s,en.t,Gr,Mr,nn.$Z],encapsulation:2});class Xr{}Xr.ɵfac=function(e){return new(e||Xr)},Xr.ɵmod=P.$C({type:Xr}),Xr.ɵinj=a.G2t({imports:[_r,Pr]});var Yr=i(66983);const Hr=Object.freeze([{type:v.gC.Login,icon:"bwi-globe",labelKey:"typeLogin"},{type:v.gC.Card,icon:"bwi-credit-card",labelKey:"typeCard"},{type:v.gC.Identity,icon:"bwi-id-card",labelKey:"typeIdentity"},{type:v.gC.SecureNote,icon:"bwi-sticky-note",labelKey:"typeNote"},{type:v.gC.SshKey,icon:"bwi-key",labelKey:"typeSshKey"}]);var Wr=i(90647),Jr=i(13496),Zr=i(53997),Qr=i(78952),es=i(32924);const ts=(e,t)=>t.type;function is(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",7),P.bIt("click",function(){const t=a.eBV(e).$implicit,i=P.XpG(2);return a.Njj(i.cipherAdded.emit(t.type))}),P.nrm(1,"i",8),P.EFF(2),P.nI1(3,"i18n"),P.k0s()}if(2&e){const e=t.$implicit;P.R7$(),P.HbH(P.VkB("bwi ",e.icon)),P.R7$(),P.SpI(" ",P.bMT(3,4,e.labelKey)," ")}}function ns(e,t){1&e&&P.nrm(0,"bit-menu-divider")}function rs(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",7),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.folderAdded.emit())}),P.nrm(1,"i",9),P.EFF(2),P.nI1(3,"i18n"),P.k0s()}2&e&&(P.R7$(2),P.SpI(" ",P.bMT(3,1,"folder")," "))}function ss(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",7),P.bIt("click",function(){a.eBV(e);const t=P.XpG(2);return a.Njj(t.collectionAdded.emit())}),P.nrm(1,"i",10),P.EFF(2),P.nI1(3,"i18n"),P.k0s()}2&e&&(P.R7$(2),P.SpI(" ",P.bMT(3,1,"collection")," "))}function os(e,t){if(1&e&&(P.qex(0),P.j41(1,"div")(2,"button",2),P.nI1(3,"i18n"),P.nrm(4,"i",3),P.EFF(5),P.nI1(6,"i18n"),P.k0s(),P.j41(7,"bit-menu",4,0),P.Z7z(9,is,4,6,"button",5,ts),P.nI1(11,"async"),P.DNE(12,ns,1,0,"bit-menu-divider",1)(13,rs,4,3,"button",6)(14,ss,4,3,"button",6),P.k0s()(),P.bVm()),2&e){const e=P.sdS(8),t=P.XpG();P.R7$(2),P.Y8G("bitMenuTriggerFor",e)("appA11yTitle",P.bMT(3,6,"new")),P.R7$(3),P.SpI(" ",P.bMT(6,8,"new")," "),P.R7$(4),P.Dyx(P.bMT(11,10,t.cipherMenuItems$)),P.R7$(3),P.Y8G("ngIf",t.canCreateCipher()),P.R7$(),P.Y8G("ngIf",t.canCreateFolder()),P.R7$(),P.Y8G("ngIf",t.canCreateCollection())}}class as{constructor(e){this.restrictedItemTypesService=e,this.canCreateCipher=(0,O.hFB)(!1),this.canCreateFolder=(0,O.hFB)(!1),this.canCreateCollection=(0,O.hFB)(!1),this.canCreateSshKey=(0,O.hFB)(!1),this.folderAdded=(0,O.CGW)(),this.collectionAdded=(0,O.CGW)(),this.cipherAdded=(0,O.CGW)(),this.cipherMenuItems$=this.restrictedItemTypesService.restricted$.pipe((0,r.T)(e=>Hr.filter(t=>!(!this.canCreateSshKey()&&t.type===v.gC.SshKey)&&!e.some(e=>e.cipherType===t.type))),(0,Yn.t)({bufferSize:1,refCount:!0}))}}as.ɵfac=function(e){return new(e||as)(P.rXU(Yr.b))},as.ɵcmp=P.VBU({type:as,selectors:[["vault-new-cipher-menu"]],inputs:{canCreateCipher:[1,"canCreateCipher"],canCreateFolder:[1,"canCreateFolder"],canCreateCollection:[1,"canCreateCollection"],canCreateSshKey:[1,"canCreateSshKey"]},outputs:{folderAdded:"folderAdded",collectionAdded:"collectionAdded",cipherAdded:"cipherAdded"},decls:1,vars:1,consts:[["addOptions",""],[4,"ngIf"],["bitButton","","buttonType","primary","type","button","id","newItemDropdown",3,"bitMenuTriggerFor","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-plus"],["aria-labelledby","newItemDropdown"],["type","button","bitMenuItem",""],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["slot","start","aria-hidden","true"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-folder"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection-shared"]],template:function(e,t){1&e&&P.DNE(0,os,15,12,"ng-container",1),2&e&&P.Y8G("ngIf",t.canCreateCipher()||t.canCreateCollection()||t.canCreateFolder())},dependencies:[en.t,un.Q,N.MD,N.bT,Wr.M,Jr.Z,Zr.O,Qr.S,es.M,X.p,hn.C,N.Jj,ye.$],encapsulation:2});var ls=i(79783),cs=i(85800),ds=i(71364);class us{constructor(){this.platformUtilService=(0,a.WQX)(g.y)}openLearnMore(e){e.preventDefault(),this.platformUtilService.launchUri("https://bitwarden.com/help/website-icons/")}}us.ɵfac=function(e){return new(e||us)},us.ɵcmp=P.VBU({type:us,selectors:[["vault-permit-cipher-details-popover"]],decls:14,vars:13,consts:[["permitDetailsPopover",""],["type","button","position","above-center","bitLink","",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-p-0",3,"bitPopoverTriggerFor","appA11yTitle"],[1,"bwi","bwi-question-circle"],[3,"title"],[1,"tw-flex","tw-gap-1.5","tw-items-center"],["bitLink","","href","#",1,"tw-flex",3,"click"],["slot","end","aria-hidden","true",1,"bwi","bwi-external-link","tw-text-primary-600"]],template:function(e,t){if(1&e){const e=P.RV6();P.j41(0,"button",1),P.nI1(1,"i18n"),P.nrm(2,"i",2),P.k0s(),P.j41(3,"bit-popover",3,0),P.nI1(5,"i18n"),P.j41(6,"p"),P.EFF(7),P.nI1(8,"i18n"),P.k0s(),P.j41(9,"div",4)(10,"a",5),P.bIt("click",function(i){return a.eBV(e),a.Njj(t.openLearnMore(i))}),P.EFF(11),P.nI1(12,"i18n"),P.k0s(),P.nrm(13,"i",6),P.k0s()()}if(2&e){const e=P.sdS(4);P.Y8G("bitPopoverTriggerFor",e)("appA11yTitle",P.bMT(1,5,"aboutThisSetting")),P.R7$(3),P.Y8G("title",P.bMT(5,7,"aboutThisSetting")),P.R7$(4),P.SpI(" ",P.bMT(8,9,"permitCipherDetailsDescription")," "),P.R7$(4),P.SpI(" ",P.bMT(12,11,"learnMore")," ")}},dependencies:[ls.k,cs.r,ds.k,X.p,hn.C,Nt.V,ne.L,ne.o,ye.$],encapsulation:2});const hs=Object.freeze({Accepted:"accepted",Declined:"declined"});class ps{constructor(){this.params=(0,a.WQX)(Qi.Qs),this.dialogRef=(0,a.WQX)(ln.ce),this.platformUtilsService=(0,a.WQX)(g.y),this.organizationName=this.params.organizationName}acceptTransfer(){this.dialogRef.close(hs.Accepted)}decline(){this.dialogRef.close(hs.Declined)}openLearnMore(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/help/transfer-ownership/")}static open(e,t){return e.open(ps,Object.assign({},t))}}ps.ɵfac=function(e){return new(e||ps)},ps.ɵcmp=P.VBU({type:ps,selectors:[["ng-component"]],decls:18,vars:17,consts:[["hideIcon",""],["bitDialogTitle",""],["bitDialogContent",""],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"click"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitLink","","href","#",1,"tw-w-full","tw-text-center",3,"click"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-1"]],template:function(e,t){1&e&&(P.j41(0,"bit-simple-dialog",0)(1,"span",1),P.EFF(2),P.nI1(3,"i18n"),P.k0s(),P.j41(4,"span",2),P.EFF(5),P.nI1(6,"i18n"),P.k0s(),P.qex(7,3),P.j41(8,"button",4),P.bIt("click",function(){return t.acceptTransfer()}),P.EFF(9),P.nI1(10,"i18n"),P.k0s(),P.j41(11,"button",5),P.bIt("click",function(){return t.decline()}),P.EFF(12),P.nI1(13,"i18n"),P.k0s(),P.j41(14,"a",6),P.bIt("click",function(e){return t.openLearnMore(e)}),P.EFF(15),P.nI1(16,"i18n"),P.nrm(17,"i",7),P.k0s(),P.bVm(),P.k0s()),2&e&&(P.R7$(2),P.JRh(P.i5U(3,5,"transferItemsToOrganizationTitle",t.organizationName)),P.R7$(3),P.SpI(" ",P.i5U(6,8,"transferItemsToOrganizationContent",t.organizationName)," "),P.R7$(4),P.SpI(" ",P.bMT(10,11,"acceptTransfer")," "),P.R7$(3),P.SpI(" ",P.bMT(13,13,"declineAndLeave")," "),P.R7$(3),P.SpI(" ",P.bMT(16,15,"whyAmISeeingThis")," "))},dependencies:[en.t,un.Q,tn.P,pr.o,Nt.V,ne.L,re.E,X.p,ye.$],encapsulation:2,changeDetection:0});const ms=Object.freeze({Confirmed:"confirmed",Back:"back"});class vs{constructor(){this.params=(0,a.WQX)(Qi.Qs),this.dialogRef=(0,a.WQX)(ln.ce),this.platformUtilsService=(0,a.WQX)(g.y),this.organizationName=this.params.organizationName}confirmLeave(){this.dialogRef.close(ms.Confirmed)}goBack(){this.dialogRef.close(ms.Back)}openLearnMore(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/help/transfer-ownership/")}static open(e,t){return e.open(vs,Object.assign({},t))}}vs.ɵfac=function(e){return new(e||vs)},vs.ɵcmp=P.VBU({type:vs,selectors:[["ng-component"]],decls:23,vars:19,consts:[["bitDialogIcon","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-text-warning","tw-text-3xl"],["bitDialogTitle",""],["bitDialogContent",""],["bitTypography","body1"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","dangerPrimary",3,"click"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitLink","","href","#",1,"tw-w-full","tw-text-center",3,"click"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-1"]],template:function(e,t){1&e&&(P.j41(0,"bit-simple-dialog"),P.nrm(1,"i",0),P.j41(2,"span",1),P.EFF(3),P.nI1(4,"i18n"),P.k0s(),P.qex(5,2),P.j41(6,"p",3),P.EFF(7),P.nI1(8,"i18n"),P.k0s(),P.j41(9,"p",3),P.EFF(10),P.nI1(11,"i18n"),P.k0s(),P.bVm(),P.qex(12,4),P.j41(13,"button",5),P.bIt("click",function(){return t.confirmLeave()}),P.EFF(14),P.nI1(15,"i18n"),P.k0s(),P.j41(16,"button",6),P.bIt("click",function(){return t.goBack()}),P.EFF(17),P.nI1(18,"i18n"),P.k0s(),P.j41(19,"a",7),P.bIt("click",function(e){return t.openLearnMore(e)}),P.EFF(20),P.nI1(21,"i18n"),P.nrm(22,"i",8),P.k0s(),P.bVm(),P.k0s()),2&e&&(P.R7$(3),P.JRh(P.bMT(4,6,"leaveConfirmationDialogTitle")),P.R7$(4),P.SpI(" ",P.bMT(8,8,"leaveConfirmationDialogContentOne")," "),P.R7$(3),P.SpI(" ",P.bMT(11,10,"leaveConfirmationDialogContentTwo")," "),P.R7$(4),P.SpI(" ",P.i5U(15,12,"leaveConfirmationDialogConfirmButton",t.organizationName)," "),P.R7$(3),P.SpI(" ",P.bMT(18,15,"goBack")," "),P.R7$(3),P.SpI(" ",P.bMT(21,17,"howToManageMyVault")," "))},dependencies:[en.t,un.Q,tn.P,pr.L,pr.o,Nt.V,ne.L,re.E,me.r,X.p,ye.$],encapsulation:2,changeDetection:0});var fs=i(36890),gs=i(96540),ys=i(43215),bs=i(82781),ws=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ss{constructor(e,t,i,n){this.dialogService=e,this.toastService=t,this.platformUtilsService=i,this.i18nService=n}importSshKeyFromClipboard(){return ws(this,void 0,void 0,function*(){const e=yield this.platformUtilsService.readFromClipboard();let t=!1,i=null;try{i=(0,bs.import_ssh_key)(e)}catch(n){const e=n;if("PasswordRequired"!==e.variant&&"WrongPassword"!==e.variant)return this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t(this.sshImportErrorVariantToI18nKey(e.variant))}),null;t=!0}if(t)for(;;){const t=yield this.getSshKeyPassword();if(""===t||null==t)return null;try{i=(0,bs.import_ssh_key)(e,t);break}catch(n){const e=n;if("WrongPassword"!==e.variant)return this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t(this.sshImportErrorVariantToI18nKey(e.variant))}),null}}return this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("sshKeyImported")}),new gs.E(new fs.m({privateKey:i.privateKey,publicKey:i.publicKey,keyFingerprint:i.fingerprint}))})}sshImportErrorVariantToI18nKey(e){switch(e){case"ParsingError":return"invalidSshKey";case"UnsupportedKeyType":return"sshKeyTypeUnsupported";case"PasswordRequired":case"WrongPassword":return"sshKeyWrongPassword";default:return"errorOccurred"}}getSshKeyPassword(){return ws(this,void 0,void 0,function*(){const e=this.dialogService.open(ys.AM,{ariaModal:!0});return yield(0,h._)(e.closed)})}}Ss.ɵfac=function(e){return new(e||Ss)(a.KVO(ln.o3),a.KVO(y.f),a.KVO(g.y),a.KVO(S.W))},Ss.ɵprov=a.jDH({token:Ss,factory:Ss.ɵfac});var Is=i(22869);class ks{}var Cs=i(97432),Ts=i(90107),Fs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Rs{constructor(e,t,i,n,r,s,o,a,l){this.cipherService=e,this.policyService=t,this.organizationService=i,this.collectionService=n,this.logService=r,this.i18nService=s,this.dialogService=o,this.toastService=a,this.configService=l}enforcingOrganization$(e){return this.policyService.policiesByType$(jn.tt.OrganizationDataOwnership,e).pipe((0,r.T)(e=>{var t;return null===(t=e.sort((e,t)=>e.revisionDate.getTime()-t.revisionDate.getTime()))||void 0===t?void 0:t[0]}),(0,B.n)(t=>null==t?(0,z.of)(void 0):this.organizationService.organizations$(e).pipe((0,Q.Hc)(t.organizationId))))}personalCiphers$(e){return this.cipherService.cipherViews$(e).pipe((0,Cs.w)(),(0,r.T)(e=>e.filter(e=>null==e.organizationId)))}defaultUserCollection$(e,t){return this.collectionService.decryptedCollections$(e).pipe((0,r.T)(e=>{var i;return null===(i=e.find(e=>e.isDefaultCollection&&e.organizationId===t))||void 0===i?void 0:i.id}))}userMigrationInfo$(e){return this.enforcingOrganization$(e).pipe((0,B.n)(t=>null==t?(0,z.of)({requiresMigration:!1}):(0,n.z)([this.personalCiphers$(e),this.defaultUserCollection$(e,t.id)]).pipe((0,r.T)(([e,i])=>({requiresMigration:e.length>0,enforcingOrganization:t,defaultCollectionId:i})))))}enforceOrganizationDataOwnership(e){return Fs(this,void 0,void 0,function*(){if(!(yield this.configService.getFeatureFlag(J.TO.MigrateMyVaultToMyItems)))return;const t=yield(0,h._)(this.userMigrationInfo$(e));if(!t.requiresMigration)return;if(null==t.defaultCollectionId)return void this.logService.warning("Default collection is missing for user during organization data ownership enforcement");if(yield this.dialogService.openSimpleDialog({title:"Requires migration",content:"Your vault requires migration of personal items to your organization.",type:"warning"}))try{yield this.transferPersonalItems(e,t.enforcingOrganization.id,t.defaultCollectionId),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemsTransferred")})}catch(i){this.logService.error("Error transferring personal items to organization",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}transferPersonalItems(e,t,i){return Fs(this,void 0,void 0,function*(){let n=yield(0,h._)(this.personalCiphers$(e));if(0===n.length)return;const r=n.filter(e=>e.hasOldAttachments);if(r.length>0){yield this.upgradeOldAttachments(r,e,t),n=yield(0,h._)(this.personalCiphers$(e));const i=n.filter(e=>e.hasOldAttachments);if(i.length>0)throw new Error(`Failed to upgrade all old attachments. ${i.length} ciphers still have old attachments.`)}this.logService.info(`Starting transfer of ${n.length} personal ciphers to organization ${t} for user ${e}`),yield this.cipherService.shareManyWithServer(n,t,[i],e)})}upgradeOldAttachments(e,t,i){return Fs(this,void 0,void 0,function*(){this.logService.info(`Found ${e.length} ciphers with old attachments needing upgrade during transfer to organization ${i} for user ${t}`);for(const r of e)try{if(!r.hasOldAttachments)continue;if((yield this.cipherService.upgradeOldCipherAttachments(r,t)).hasOldAttachments)throw this.logService.error(`Attachment upgrade did not complete successfully for cipher ${r.id} during transfer to organization ${i} for user ${t}`),new Error(`Failed to upgrade old attachments for cipher ${r.id}`)}catch(n){throw this.logService.error(`Failed to upgrade old attachments for cipher ${r.id} during transfer to organization ${i} for user ${t}: ${n}`),new Error(`Failed to upgrade old attachments for cipher ${r.id}`)}this.logService.info(`Successfully upgraded ${e.length} ciphers with old attachments during transfer to organization ${i} for user ${t}`)})}}Rs.ɵfac=function(e){return new(e||Rs)(a.KVO(l.p),a.KVO(Gn.m),a.KVO(Y.PV),a.KVO(_.YD),a.KVO(Ts.Kc),a.KVO(S.W),a.KVO(ln.o3),a.KVO(y.f),a.KVO(Ui.w))},Rs.ɵprov=a.jDH({token:Rs,factory:Rs.ɵfac});var Ps=i(60276),xs=i(29377),$s=i(78781),Es=i(20702);class As extends Es.r{constructor(e){super(e),this.uri=this.getResponseProperty("uri")}}var Ds=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Os{constructor(e,t,i){this.apiService=e,this.environmentService=t,this.domainSettingsService=i}getChangePasswordUrl(e){return Ds(this,void 0,void 0,function*(){if(e.type!==v.gC.Login||null==e.login||!e.login.hasUris)return null;const t=e.login.uris.map(e=>$s.A.getUrl(e.uri)).filter(e=>null!=e&&("http:"===e.protocol||"https:"===e.protocol));if(0===t.length)return null;if(!(yield(0,h._)(this.domainSettingsService.showFavicons$)))return t[0].href;for(const e of t){const t=yield this.fetchWellKnownChangePasswordUri(e.href);if(t)return t}return t[0].href})}fetchWellKnownChangePasswordUri(e){return Ds(this,void 0,void 0,function*(){const t=yield this.buildChangePasswordUriRequest(e),i=yield this.apiService.fetch(t);if(!i.ok)return null;const n=yield i.json(),{uri:r}=new As(n);return r})}buildChangePasswordUriRequest(e){return Ds(this,void 0,void 0,function*(){const t=new URLSearchParams;t.set("uri",e);const i=(yield(0,h._)(this.environmentService.environment$)).getIconsUrl(),n=new URL(`${i}/change-password-uri?${t.toString()}`);return new Request(n,{method:"GET"})})}}Os.ɵfac=function(e){return new(e||Os)(a.KVO(Fe.G),a.KVO(xs.v),a.KVO(Ps.V))},Os.ɵprov=a.jDH({token:Os,factory:Os.ɵfac});var Ms=i(92411),Us=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Gs{constructor(e,t,i,n,r,s){this.cipherArchiveService=e,this.dialogService=t,this.passwordRepromptService=i,this.toastService=n,this.i18nService=r,this.accountService=s}archiveCipher(e){return Us(this,void 0,void 0,function*(){if(!(yield this.passwordRepromptService.passwordRepromptCheck(e)))return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"archiveItem"},content:{key:"archiveItemConfirmDesc"},type:"info"})))return;const t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));yield this.cipherArchiveService.archiveWithServer(e.id,t).then(()=>{this.toastService.showToast({variant:"success",message:this.i18nService.t("itemWasSentToArchive")})}).catch(()=>{this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})})})}unarchiveCipher(e){return Us(this,void 0,void 0,function*(){const t=yield(0,h._)(this.accountService.activeAccount$.pipe(H.F6));yield this.cipherArchiveService.unarchiveWithServer(e.id,t).then(()=>{this.toastService.showToast({variant:"success",message:this.i18nService.t("itemWasUnarchived")})}).catch(()=>{this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})})})}}Gs.ɵfac=function(e){return new(e||Gs)(a.KVO(Ms.J),a.KVO(ln.o3),a.KVO(u.q),a.KVO(y.f),a.KVO(S.W),a.KVO(k.Di))},Gs.ɵprov=a.jDH({token:Gs,factory:Gs.ɵfac,providedIn:"root"})},22191:(e,t,i)=>{"use strict";i.d(t,{Q:()=>o});var n=i(36288),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.s]})},22203:(e,t,i)=>{"use strict";i.d(t,{k:()=>s});var n=i(69886),r=i(76506);class s{constructor(e){var t;null!=e&&(this.username=e.username,this.password=e.password,this.passwordRevisionDate=e.passwordRevisionDate,this.totp=e.totp,this.autofillOnPageLoad=e.autofillOnPageLoad,e.uris&&(this.uris=e.uris.map(e=>new r.S(e))),e.fido2Credentials&&(this.fido2Credentials=null===(t=e.fido2Credentials)||void 0===t?void 0:t.map(e=>new n.w(e))))}}},22327:(e,t,i)=>{"use strict";i.d(t,{f:()=>s});class n{}var r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s extends n{constructor(e,t,i,n){super(),this.userId=e,this.encryptService=t,this.key=i,this.dataPacker=n,this.assertHasValue("userId",e),this.assertHasValue("key",i),this.assertHasValue("dataPacker",n),this.assertHasValue("encryptService",t)}encrypt(e){return r(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=this.dataPacker.pack(e);const i=yield this.encryptService.encryptString(t,this.key);return t=null,i})}decrypt(e){return r(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=yield this.encryptService.decryptString(e,this.key);const i=this.dataPacker.unpack(t);return t=null,i})}assertHasValue(e,t){if(null==t)throw new Error(`${e} cannot be null or undefined`)}}},22397:(e,t,i)=>{"use strict";i.d(t,{T:()=>r});var n=i(7248);class r extends n.V{static newConstructor(e,t){const i=new r;return i.newMasterPasswordHash=e.masterPasswordAuthenticationHash,i.key=t.masterKeyWrappedUserKey,i.authenticationData=e,i.unlockData=t,i}}},22466:(e,t,i)=>{"use strict";i.d(t,{Y:()=>s});var n=i(94573),r=i(33812);class s{constructor(){this.alignContent=(0,n.hFB)("middle")}get alignmentClass(){switch(this.alignContent()){case"top":return"tw-align-top";case"middle":return"tw-align-middle";case"bottom":return"tw-align-bottom";default:return"tw-align-baseline"}}get classList(){return["tw-border-0","tw-border-b","tw-border-secondary-300","tw-border-solid","hover:tw-bg-hover-default","last:tw-border-0",this.alignmentClass]}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=r.FsC({type:s,selectors:[["tr","bitRow",""]],hostVars:2,hostBindings:function(e,t){2&e&&r.HbH(t.classList)},inputs:{alignContent:[1,"alignContent"]}})},22690:(e,t,i)=>{"use strict";i.d(t,{D:()=>l});var n=i(94573),r=i(78510),s=i(58384),o=i(33812);const a=[[["","slot","title"]],[["","slot","description"]],[["","slot","button"]]];class l{constructor(){this.icon=(0,n.hFB)(r.a)}}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["bit-no-items"]],inputs:{icon:[1,"icon"]},ngContentSelectors:["[slot=title]","[slot=description]","[slot=button]"],decls:10,vars:1,consts:[[1,"tw-mx-auto","tw-flex","tw-flex-col","tw-items-center","tw-justify-center","tw-pt-6"],[1,"tw-max-w-sm","tw-flex","tw-flex-col","tw-items-center"],[1,"tw-size-24","tw-content-center"],["aria-hidden","true",3,"icon"],[1,"tw-font-medium","tw-text-center","tw-mt-4"],[1,"tw-text-center"],[1,"tw-space-x-2"]],template:function(e,t){1&e&&(o.NAR(a),o.j41(0,"div",0)(1,"div",1)(2,"div",2),o.nrm(3,"bit-icon",3),o.k0s(),o.j41(4,"h3",4),o.SdG(5),o.k0s(),o.j41(6,"p",5),o.SdG(7,1),o.k0s()(),o.j41(8,"div",6),o.SdG(9,2),o.k0s()()),2&e&&(o.R7$(3),o.Y8G("icon",t.icon()))},dependencies:[s.i],encapsulation:2})},22848:(e,t,i)=>{"use strict";i.d(t,{hU:()=>ee,vB:()=>g,Zm:()=>w,cR:()=>m,fX:()=>ie,QH:()=>y,aT:()=>oe,gX:()=>J,PA:()=>pe,xP:()=>de,zZ:()=>ne,ao:()=>H,Lu:()=>I,n1:()=>Q,ox:()=>ue,wM:()=>ae,E$:()=>te});var n=i(3204),r=i(33338),s=i(72245),o=i(39306),a=i(31857);const l=new a.Ok(a.rB,"biometricUnlockEnabled",{deserializer:e=>e,clearOn:[]}),c=new a.Ok(a.rB,"clientKeyHalf",{deserializer:e=>e,clearOn:["logout"]}),d=a.Zs.record(a.rB,"promptCancelled",{deserializer:e=>e}),u=new a.Ok(a.rB,"promptAutomatically",{deserializer:e=>e,clearOn:[]}),h=new a.Zs(a.rB,"fingerprintValidated",{deserializer:e=>e}),p=new a.Zs(a.rB,"lastProcessReload",{deserializer:e=>new Date(e)});var m,v,f=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class g{}class y{constructor(e){this.stateProvider=e,this.biometricUnlockEnabledState=this.stateProvider.getActive(l),this.biometricUnlockEnabled$=this.biometricUnlockEnabledState.state$.pipe((0,n.T)(Boolean)),this.encryptedClientKeyHalfState=this.stateProvider.getActive(c),this.encryptedClientKeyHalf$=this.encryptedClientKeyHalfState.state$.pipe((0,n.T)(b)),this.promptCancelledState=this.stateProvider.getGlobal(d),this.promptCancelled$=(0,r.z)([this.stateProvider.activeUserId$,this.promptCancelledState.state$]).pipe((0,n.T)(([e,t])=>{var i;return null!=e&&(null!==(i=null==t?void 0:t[e])&&void 0!==i&&i)})),this.promptAutomaticallyState=this.stateProvider.getActive(u),this.promptAutomatically$=this.promptAutomaticallyState.state$.pipe((0,n.T)(Boolean)),this.fingerprintValidatedState=this.stateProvider.getGlobal(h),this.fingerprintValidated$=this.fingerprintValidatedState.state$.pipe((0,n.T)(Boolean)),this.lastProcessReloadState=this.stateProvider.getGlobal(p),this.lastProcessReload$=this.lastProcessReloadState.state$}setBiometricUnlockEnabled(e){return f(this,void 0,void 0,function*(){yield this.biometricUnlockEnabledState.update(()=>e)})}getBiometricUnlockEnabled(e){return f(this,void 0,void 0,function*(){return yield(0,s._)(this.stateProvider.getUser(e,l).state$.pipe((0,n.T)(Boolean)))})}setEncryptedClientKeyHalf(e,t){return f(this,void 0,void 0,function*(){var i;const n=null!==(i=null==e?void 0:e.encryptedString)&&void 0!==i?i:null;t?yield this.stateProvider.getUser(t,c).update(()=>n):yield this.encryptedClientKeyHalfState.update(()=>n)})}getEncryptedClientKeyHalf(e){return f(this,void 0,void 0,function*(){return yield(0,s._)(this.stateProvider.getUser(e,c).state$.pipe((0,n.T)(b)))})}logout(e){return f(this,void 0,void 0,function*(){yield this.stateProvider.getUser(e,c).update(()=>null),yield this.resetUserPromptCancelled(e)})}resetUserPromptCancelled(e){return f(this,void 0,void 0,function*(){yield this.stateProvider.getGlobal(d).update((t,i)=>(null!=t&&delete t[null!=e?e:i],t),{combineLatestWith:this.stateProvider.activeUserId$,shouldUpdate:(t,i)=>null!=(null==t?void 0:t[null!=e?e:i])})})}setUserPromptCancelled(){return f(this,void 0,void 0,function*(){yield this.promptCancelledState.update((e,t)=>(null!=t&&(null!=e||(e={}),e[t]=!0),e),{combineLatestWith:this.stateProvider.activeUserId$,shouldUpdate:(e,t)=>{if(null==t)throw new Error("Cannot update biometric prompt cancelled state without an active user");return!0}})})}resetAllPromptCancelled(){return f(this,void 0,void 0,function*(){yield this.promptCancelledState.update(()=>null)})}setPromptAutomatically(e){return f(this,void 0,void 0,function*(){yield this.promptAutomaticallyState.update(()=>e)})}setFingerprintValidated(e){return f(this,void 0,void 0,function*(){yield this.fingerprintValidatedState.update(()=>e)})}updateLastProcessReload(){return f(this,void 0,void 0,function*(){yield this.lastProcessReloadState.update(()=>new Date)})}getLastProcessReload(){return f(this,void 0,void 0,function*(){return yield(0,s._)(this.lastProcessReload$)})}}function b(e){return null==e?null:new o.k(e)}!function(e){e[e.Available=0]="Available",e[e.UnlockNeeded=1]="UnlockNeeded",e[e.HardwareUnavailable=2]="HardwareUnavailable",e[e.AutoSetupNeeded=3]="AutoSetupNeeded",e[e.ManualSetupNeeded=4]="ManualSetupNeeded",e[e.PlatformUnsupported=5]="PlatformUnsupported",e[e.DesktopDisconnected=6]="DesktopDisconnected",e[e.NotEnabledLocally=7]="NotEnabledLocally",e[e.NotEnabledInConnectedDesktopApp=8]="NotEnabledInConnectedDesktopApp",e[e.NativeMessagingPermissionMissing=9]="NativeMessagingPermissionMissing"}(m||(m={})),function(e){e.AuthenticateWithBiometrics="authenticateWithBiometrics",e.GetBiometricsStatus="getBiometricsStatus",e.UnlockWithBiometricsForUser="unlockWithBiometricsForUser",e.GetBiometricsStatusForUser="getBiometricsStatusForUser",e.CanEnableBiometricUnlock="canEnableBiometricUnlock"}(v||(v={}));class w{supportsBiometric(){throw new Error("Method not implemented.")}}class S extends Error{constructor(){super("Failed to decrypt the user's private key.")}}class I{}var k=i(69636),C=i(44500),T=i(81714),F=i(69194),R=i(34040),P=i(27442),x=i(93695),$=i(96718),E=i(75811),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class D{static fromData(e){switch(e.type){case"organization":return new O(e.key);case"provider":return new M(e.key,e.providerId);default:return null}}static isProviderEncrypted(e){return"provider"===e.toData().type}}class O{constructor(e){this.key=e}decrypt(e,t){return A(this,void 0,void 0,function*(){return yield e.decapsulateKeyUnsigned(this.encryptedOrganizationKey,t)})}get encryptedOrganizationKey(){return new o.k(this.key)}toData(){return{type:"organization",key:this.key}}}class M{constructor(e,t){this.key=e,this.providerId=t}decrypt(e,t){return A(this,void 0,void 0,function*(){const i=yield e.unwrapSymmetricKey(new o.k(this.key),t[this.providerId]);if(null==i)throw new Error("Failed to decrypt organization key");return i})}get encryptedOrganizationKey(){return new o.k(this.key)}toData(){return{type:"provider",key:this.key,providerId:this.providerId}}}var U=i(16184),G=i(78070),j=i(68467);var N=i(78781),V=i(30126),B=i(43890);const z=a.Ok.record(a.Gg,"organizationKeys",{deserializer:e=>e,clearOn:["logout"]}),L=a.Ok.record(a.Gg,"providerKeys",{deserializer:e=>e,clearOn:["logout"]}),K=new a.Ok(a.Gg,"everHadUserKey",{deserializer:e=>e,clearOn:["logout"]}),q=new a.Ok(a.Gg,"privateKey",{deserializer:e=>e,clearOn:["logout"]}),_=new a.Ok(a.Gd,"userKey",{deserializer:e=>B.e.fromJSON(e),clearOn:["logout","lock"]}),X=new a.Ok(a.Gg,"userSigningKey",{deserializer:e=>e,clearOn:["logout"]}),Y=new a.Ok(a.Gg,"userSignedPublicKey",{deserializer:e=>e,clearOn:["logout"]});var H,W=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class J{constructor(e,t,i,n,r,s,o,a,l,c){this.masterPasswordService=e,this.keyGenerationService=t,this.cryptoFunctionService=i,this.encryptService=n,this.platformUtilService=r,this.logService=s,this.stateService=o,this.accountService=a,this.stateProvider=l,this.kdfConfigService=c,this.activeUserOrgKeys$=this.stateProvider.activeUserId$.pipe((0,C.n)(e=>null!=e?this.orgKeys$(e):T.t),(0,F.p)(e=>null!=e),(0,R.F)(),(0,P.t)({bufferSize:1,refCount:!1}))}setUserKey(e,t){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("No key provided. Lock the user to clear the key");if(null==t)throw new Error("No userId provided.");yield this.stateProvider.setUserState(_,e,t),yield this.stateProvider.setUserState(K,!0,t),yield this.storeAdditionalKeys(e,t);if(null==(yield(0,s._)(this.userKey$(t).pipe((0,F.p)(e=>null!=e)))))throw new Error("Failed to set user key")})}setUserKeys(e,t,i){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("No userKey provided. Lock the user to clear the key");if(null==t)throw new Error("No encPrivateKey provided.");if(null==i)throw new Error("No userId provided.");if(null==(yield this.decryptPrivateKey(t,e)))throw new S;yield this.setUserKey(e,i),yield this.setPrivateKey(t,i)})}refreshAdditionalKeys(e){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required.");const t=yield(0,s._)(this.userKey$(e));if(null==t)throw new Error("No user key found for: "+e);yield this.setUserKey(t,e)})}everHadUserKey$(e){return this.stateProvider.getUser(e,K).state$.pipe((0,n.T)(e=>null!=e&&e))}getInMemoryUserKeyFor$(e){return this.stateProvider.getUserState$(_,e)}getUserKey(e){return W(this,void 0,void 0,function*(){return yield(0,s._)(this.stateProvider.getUserState$(_,e))})}getUserKeyFromStorage(e,t){return W(this,void 0,void 0,function*(){if(null==t)throw new Error("UserId is required");const i=yield this.getKeyFromStorage(e,t);return null==i?null:((yield this.validateUserKey(i,t))||(this.logService.warning("Invalid key, throwing away stored keys"),yield this.clearAllStoredUserKeys(t)),i)})}hasUserKey(e){return W(this,void 0,void 0,function*(){return null!=e&&null!=(yield(0,s._)(this.stateProvider.getUserState$(_,e)))})}makeUserKey(e){return W(this,void 0,void 0,function*(){if(null==e){const t=yield(0,s._)(this.stateProvider.activeUserId$);if(null==t)throw new Error("No active user id found.");e=yield(0,s._)(this.masterPasswordService.masterKey$(t))}if(null==e)throw new Error("No Master Key found.");const t=yield this.keyGenerationService.createKey(512);return this.buildProtectedSymmetricKey(e,t)})}makeUserKeyV1(){return W(this,void 0,void 0,function*(){return yield this.keyGenerationService.createKey(512)})}clearUserKey(e){return W(this,void 0,void 0,function*(){null!=e&&(yield this.stateProvider.setUserState(_,null,e),yield this.clearAllStoredUserKeys(e))})}clearStoredUserKey(e){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required");yield this.stateService.setUserKeyAutoUnlock(null,{userId:e})})}getOrDeriveMasterKey(e,t){return W(this,void 0,void 0,function*(){if(null==t)throw new Error("User ID is required.");const i=yield(0,s._)(this.masterPasswordService.masterKey$(t));if(null!=i)return i;const r=yield(0,s._)(this.accountService.accounts$.pipe((0,n.T)(e=>{var i;return null===(i=e[t])||void 0===i?void 0:i.email})));if(null==r)throw new Error("No email found for user "+t);const o=yield(0,s._)(this.kdfConfigService.getKdfConfig$(t));if(null==o)throw new Error("No kdf found for user "+t);return yield this.makeMasterKey(e,r,o)})}makeMasterKey(e,t,i){return W(this,void 0,void 0,function*(){const n=(new Date).getTime();t=t.trim().toLowerCase();const r=yield this.keyGenerationService.deriveKeyFromPassword(e,t,i),s=(new Date).getTime();return this.logService.info(`[KeyService] Deriving master key took ${s-n}ms`),r})}encryptUserKeyWithMasterKey(e,t){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("masterKey is required.");if(null==t)throw new Error("userKey is required.");return yield this.buildProtectedSymmetricKey(e,t)})}hashMasterKey(e,t,i){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("password is required.");if(null==t)throw new Error("key is required.");const n=i===j.VK.LocalAuthorization?2:1,r=yield this.cryptoFunctionService.pbkdf2(t.inner().encryptionKey,e,"sha256",n);return N.A.fromBufferToB64(r)})}compareKeyHash(e,t,i){return W(this,void 0,void 0,function*(){if(null==t)throw new Error("'masterKey' is required to be non-null.");if(null==e)return!1;const n=yield(0,s._)(this.masterPasswordService.masterKeyHash$(i));if(null==n)return!1;const r=yield this.hashMasterKey(e,t,j.VK.LocalAuthorization);return null!=r&&n===r})}setOrgKeys(e,t,i){return W(this,void 0,void 0,function*(){yield this.stateProvider.getUser(i,z).update(()=>{const i={};for(const t of e)i[t.id]={type:"organization",key:t.key};for(const e of t)i[e.id]={type:"provider",providerId:e.providerId,key:e.key};return i})})}getOrgKey(e){return W(this,void 0,void 0,function*(){return yield(0,s._)(this.activeUserOrgKeys$.pipe((0,n.T)(t=>{var i;return null!==(i=t[e])&&void 0!==i?i:null})))})}makeDataEncKey(e){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("No key provided");const t=yield this.keyGenerationService.createKey(512);return[t,yield this.encryptService.wrapSymmetricKey(t,e)]})}clearOrgKeys(e){return W(this,void 0,void 0,function*(){null!=e&&(yield this.stateProvider.setUserState(z,null,e))})}setProviderKeys(e,t){return W(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,L).update(()=>{const t={};return e.forEach(e=>{t[e.id]=e.key}),t})})}providerKeys$(e){return this.userPrivateKey$(e).pipe((0,C.n)(t=>null==t?(0,x.of)(null):this.providerKeysHelper$(e,t)))}clearProviderKeys(e){return W(this,void 0,void 0,function*(){null!=e&&(yield this.stateProvider.setUserState(L,null,e))})}makeOrgKey(e){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required");const t=yield(0,s._)(this.userPublicKey$(e));if(null==t)throw new Error("No public key found for user "+e);const i=yield this.keyGenerationService.createKey(512);return[yield this.encryptService.encapsulateKeyUnsigned(i,t),i]})}setPrivateKey(e,t){return W(this,void 0,void 0,function*(){null!=e&&(yield this.stateProvider.getUser(t,q).update(()=>e))})}getFingerprint(e,t){return W(this,void 0,void 0,function*(){if(null==t)throw new Error("Public key is required to generate a fingerprint.");const i=yield this.cryptoFunctionService.hash(t,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(i,e,32,"sha256");return this.hashPhrase(n)})}makeKeyPair(e){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("'key' is a required parameter and must be non-null.");const t=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048);return[N.A.fromBufferToB64(t[0]),yield this.encryptService.wrapDecapsulationKey(t[1],e)]})}clearKeyPair(e){return W(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(q,null,e)})}clearSigningKey(e){return W(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(X,null,e)})}makeSendKey(e){return W(this,void 0,void 0,function*(){return yield this.keyGenerationService.deriveKeyFromMaterial(e,"bitwarden-send","send")})}makeCipherKey(){return W(this,void 0,void 0,function*(){return yield this.keyGenerationService.createKey(512)})}clearKeys(e){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required");yield this.masterPasswordService.clearMasterKeyHash(e),yield this.clearUserKey(e),yield this.clearOrgKeys(e),yield this.clearProviderKeys(e),yield this.clearKeyPair(e),yield this.clearSigningKey(e),yield this.stateProvider.setUserState(K,null,e)})}randomNumber(e,t){return W(this,void 0,void 0,function*(){let i=0;const n=t-e+1,r=Math.ceil(Math.log2(n));if(r>53)throw new Error("We cannot generate numbers larger than 53 bits.");const s=Math.ceil(r/8),o=Math.pow(2,r)-1,a=new Uint8Array(yield this.cryptoFunctionService.randomBytes(s));let l=8*(s-1);for(let e=0;e<s;e++)i+=a[e]*Math.pow(2,l),l-=8;return i&=o,i>=n?this.randomNumber(e,t):e+i})}validateUserKey(e,t){return W(this,void 0,void 0,function*(){if(null==e)return!1;try{const i=yield(0,s._)(this.stateProvider.getUser(t,q).state$);if(null==i)return!1;const n=yield this.decryptPrivateKey(i,e);if(null==n)return!1;if(null==(yield this.derivePublicKey(n)))return!1}catch(i){return!1}return!0})}initAccount(e){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("UserId is required.");if(null!=(yield(0,s._)(this.userKey$(e))))throw this.logService.error("Tried to initialize account with existing user key."),new Error("Cannot initialize account, keys already exist.");const t=yield this.keyGenerationService.createKey(512),[i,n]=yield this.makeKeyPair(t);if(null==n.encryptedString)throw new Error("Failed to create valid private key.");return yield this.setUserKey(t,e),yield this.stateProvider.getUser(e,q).update(()=>n.encryptedString),{userKey:t,publicKey:i,privateKey:n}})}storeAdditionalKeys(e,t){return W(this,void 0,void 0,function*(){(yield this.shouldStoreKey(j.hq.Auto,t))?yield this.stateService.setUserKeyAutoUnlock(e.keyB64,{userId:t}):yield this.stateService.setUserKeyAutoUnlock(null,{userId:t})})}shouldStoreKey(e,t){return W(this,void 0,void 0,function*(){let i=!1;switch(e){case j.hq.Auto:i=(yield(0,s._)(this.stateProvider.getUserState$(G.z,t).pipe((0,F.p)(e=>null!=e))))==U.Lw.Never;break}return i})}getKeyFromStorage(e,t){return W(this,void 0,void 0,function*(){if(e===j.hq.Auto){const e=yield this.stateService.getUserKeyAutoUnlock({userId:t});if(e)return new B.e(N.A.fromB64ToArray(e))}return null})}clearAllStoredUserKeys(e){return W(this,void 0,void 0,function*(){yield this.stateService.setUserKeyAutoUnlock(null,{userId:e})})}hashPhrase(e){return W(this,arguments,void 0,function*(e,t=64){const i=Math.log(V.o.length)/Math.log(2);let n=Math.ceil(t/i);const r=Array.from(new Uint8Array(e));if(n*i>4*r.length)throw new Error("Output entropy of hash function is too small");const s=[];let o=k.fromArray(r,256);for(;n--;){const e=o.mod(V.o.length);o=o.divide(V.o.length),s.push(V.o[e])}return s})}buildProtectedSymmetricKey(e,t){return W(this,void 0,void 0,function*(){let i;if(e.inner().type===j.Qd.AesCbc256_B64){const n=yield this.keyGenerationService.stretchKey(e);i=yield this.encryptService.wrapSymmetricKey(t,n)}else{if(e.inner().type!==j.Qd.AesCbc256_HmacSha256_B64)throw new Error("Invalid key size.");i=yield this.encryptService.wrapSymmetricKey(t,e)}return[t,i]})}userKey$(e){return this.stateProvider.getUser(e,_).state$}userPublicKey$(e){return this.userPrivateKey$(e).pipe((0,C.n)(e=>W(this,void 0,void 0,function*(){return yield this.derivePublicKey(e)})))}derivePublicKey(e){return W(this,void 0,void 0,function*(){return null==e?null:yield this.cryptoFunctionService.rsaExtractPublicKey(e)})}userPrivateKey$(e){return this.userPrivateKeyHelper$(e).pipe((0,n.T)(e=>{var t;return null!==(t=null==e?void 0:e.userPrivateKey)&&void 0!==t?t:null}))}userEncryptionKeyPair$(e){return this.userPrivateKey$(e).pipe((0,C.n)(e=>W(this,void 0,void 0,function*(){if(null==e)return null;const t=yield this.derivePublicKey(e);return{privateKey:e,publicKey:t}})))}userEncryptedPrivateKey$(e){return this.stateProvider.getUser(e,q).state$}userPrivateKeyHelper$(e){return this.userKey$(e).pipe((0,C.n)(t=>null==t?(0,x.of)(null):this.stateProvider.getUser(e,q).state$.pipe((0,C.n)(i=>W(this,void 0,void 0,function*(){try{return yield this.decryptPrivateKey(i,t)}catch(n){throw this.logService.error("Failed to decrypt private key for user ",e,n),n}})),(0,n.T)(e=>({userKey:t,userPrivateKey:e})))))}decryptPrivateKey(e,t){return W(this,void 0,void 0,function*(){return null==e?null:yield this.encryptService.unwrapDecapsulationKey(new o.k(e),t)})}providerKeysHelper$(e,t){return this.stateProvider.getUser(e,L).state$.pipe((i=(e,i)=>W(this,void 0,void 0,function*(){return yield this.encryptService.decapsulateKeyUnsigned(new o.k(i),t)}),(0,n.T)(e=>{if(null==e)return null;const t={};for(const[n,r]of Object.entries(e))t[n]=i(n,r);return t})),(0,C.n)(e=>null==e?(0,x.of)(null):0===Object.keys(e).length?(0,x.of)({}):(0,$.p)(e)));var i}setUserSigningKey(e,t){return W(this,void 0,void 0,function*(){if(null==e)throw new Error("No user signing key provided.");if(null==t)throw new Error("No userId provided.");yield this.stateProvider.setUserState(X,e,t)})}userSigningKey$(e){return this.stateProvider.getUser(e,X).state$.pipe((0,n.T)(e=>null==e?null:e))}orgKeys$(e){return this.cipherDecryptionKeys$(e).pipe((0,n.T)(e=>{var t;return null!==(t=null==e?void 0:e.orgKeys)&&void 0!==t?t:null}))}encryptedOrgKeys$(e){var t;return null===(t=this.userPrivateKey$(e))||void 0===t?void 0:t.pipe((0,C.n)(t=>null==t?(0,x.of)({}):(0,r.z)([this.stateProvider.getUser(e,z).state$,this.providerKeysHelper$(e,t)]).pipe((0,C.n)(e=>W(this,[e],void 0,function*([e,i]){const n=yield this.derivePublicKey(t),r={};e=null!=e?e:{};for(const t of Object.keys(e)){if(null!=r[t])continue;const s=D.fromData(e[t]);if(null==s)continue;let o;if(D.isProviderEncrypted(s)){if(null==i)continue;o=yield this.encryptService.encapsulateKeyUnsigned(yield s.decrypt(this.encryptService,i),n)}else o=s.encryptedOrganizationKey;r[t]=o}return r})),(0,E.W)(t=>(this.logService.error(`Failed to get encrypted organization keys for user ${e}`,t),(0,x.of)({}))))))}cipherDecryptionKeys$(e){var t;return null===(t=this.userPrivateKeyHelper$(e))||void 0===t?void 0:t.pipe((0,C.n)(t=>{if(null==t)return(0,x.of)(null);const i=t.userPrivateKey;return null==i?(0,x.of)({userKey:t.userKey,orgKeys:null}):(0,r.z)([this.stateProvider.getUser(e,z).state$,this.providerKeysHelper$(e,i)]).pipe((0,C.n)(e=>W(this,[e],void 0,function*([e,t]){const n={};e=null!=e?e:{};for(const r of Object.keys(e)){if(null!=n[r])continue;const s=D.fromData(e[r]);if(null==s)continue;let o;if(D.isProviderEncrypted(s)){if(null==t)continue;o=yield s.decrypt(this.encryptService,t)}else o=yield s.decrypt(this.encryptService,i);n[r]=o}return n})),(0,n.T)(e=>({userKey:t.userKey,orgKeys:e})))}))}setSignedPublicKey(e,t){return W(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Y,e,t)})}userSignedPublicKey$(e){return this.stateProvider.getUserState$(Y,e)}}class Z{constructor(e,t,i){if(this.min=e,this.max=t,this.defaultValue=i,e>t)throw new Error(`${e} is greater than ${t}.`);if(!1===this.inRange(i))throw new Error("Default value is not in range.")}inRange(e){return e>=this.min&&e<=this.max}}!function(e){e[e.PBKDF2_SHA256=0]="PBKDF2_SHA256",e[e.Argon2id=1]="Argon2id"}(H||(H={}));class Q{constructor(e){this.kdfType=H.PBKDF2_SHA256,this.iterations=null!=e?e:Q.ITERATIONS.defaultValue}validateKdfConfigForSetting(){if(!Q.ITERATIONS.inRange(this.iterations))throw new Error(`PBKDF2 iterations must be between ${Q.ITERATIONS.min} and ${Q.ITERATIONS.max}`)}validateKdfConfigForPrelogin(){if(Q.PRELOGIN_ITERATIONS_MIN>this.iterations)throw new Error(`PBKDF2 iterations must be at least ${Q.PRELOGIN_ITERATIONS_MIN}, but was ${this.iterations}; possible pre-login downgrade attack detected.`)}static fromJSON(e){return new Q(e.iterations)}toSdkConfig(){return{pBKDF2:{iterations:this.iterations}}}}Q.ITERATIONS=new Z(6e5,2e6,6e5),Q.PRELOGIN_ITERATIONS_MIN=5e3;class ee{constructor(e,t,i){this.kdfType=H.Argon2id,this.iterations=null!=e?e:ee.ITERATIONS.defaultValue,this.memory=null!=t?t:ee.MEMORY.defaultValue,this.parallelism=null!=i?i:ee.PARALLELISM.defaultValue}validateKdfConfigForSetting(){if(!ee.ITERATIONS.inRange(this.iterations))throw new Error(`Argon2 iterations must be between ${ee.ITERATIONS.min} and ${ee.ITERATIONS.max}`);if(!ee.MEMORY.inRange(this.memory))throw new Error(`Argon2 memory must be between ${ee.MEMORY.min} MiB and ${ee.MEMORY.max} MiB`);if(!ee.PARALLELISM.inRange(this.parallelism))throw new Error(`Argon2 parallelism must be between ${ee.PARALLELISM.min} and ${ee.PARALLELISM.max}.`)}validateKdfConfigForPrelogin(){if(ee.PRELOGIN_ITERATIONS_MIN>this.iterations)throw new Error(`Argon2 iterations must be at least ${ee.PRELOGIN_ITERATIONS_MIN}, but was ${this.iterations}; possible pre-login downgrade attack detected.`);if(ee.PRELOGIN_MEMORY_MIN>this.memory)throw new Error(`Argon2 memory must be at least ${ee.PRELOGIN_MEMORY_MIN} MiB, but was ${this.memory} MiB; possible pre-login downgrade attack detected.`);if(ee.PRELOGIN_PARALLELISM_MIN>this.parallelism)throw new Error(`Argon2 parallelism must be at least ${ee.PRELOGIN_PARALLELISM_MIN}, but was ${this.parallelism}; possible pre-login downgrade attack detected.`)}static fromJSON(e){return new ee(e.iterations,e.memory,e.parallelism)}toSdkConfig(){return{argon2id:{iterations:this.iterations,memory:this.memory,parallelism:this.parallelism}}}}function te(e){if("pBKDF2"in e)return new Q(e.pBKDF2.iterations);if("argon2id"in e)return new ee(e.argon2id.iterations,e.argon2id.memory,e.argon2id.parallelism);throw new Error("Unsupported KDF type")}ee.MEMORY=new Z(16,1024,64),ee.PARALLELISM=new Z(1,16,4),ee.ITERATIONS=new Z(2,10,3),ee.PRELOGIN_MEMORY_MIN=16,ee.PRELOGIN_PARALLELISM_MIN=1,ee.PRELOGIN_ITERATIONS_MIN=2;const ie=new Q(Q.ITERATIONS.defaultValue);class ne{}var re=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const se=new a.Ok(a.P7,"kdfConfig",{deserializer:e=>null==e?null:e.kdfType===H.PBKDF2_SHA256?Q.fromJSON(e):ee.fromJSON(e),clearOn:["logout"]});class oe{constructor(e){this.stateProvider=e}setKdfConfig(e,t){return re(this,void 0,void 0,function*(){if(null==e)throw new Error("userId cannot be null");if(null==t)throw new Error("kdfConfig cannot be null");yield this.stateProvider.setUserState(se,t,e)})}getKdfConfig(e){return re(this,void 0,void 0,function*(){if(null==e)throw new Error("userId cannot be null");const t=yield(0,s._)(this.stateProvider.getUser(e,se).state$);if(null==t)throw new Error("KdfConfig for user "+e+" is null");return t})}getKdfConfig$(e){if(null==e)throw new Error("userId cannot be null");return this.stateProvider.getUser(e,se).state$}}class ae{}var le=i(82468),ce=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class de{constructor(e,t,i,n,r,s,o){this.keyService=e,this.cipherService=t,this.userAsymmetricKeysRegenerationApiService=i,this.logService=n,this.sdkService=r,this.apiService=s,this.configService=o}regenerateIfNeeded(e){return ce(this,void 0,void 0,function*(){try{if(yield this.configService.getFeatureFlag(le.TO.PrivateKeyRegeneration)){(yield this.shouldRegenerate(e))&&(yield this.regenerateUserPublicKeyEncryptionKeyPair(e))}}catch(t){this.logService.error("[UserAsymmetricKeyRegeneration] An error occurred: "+t+" Skipping regeneration for the user.")}})}shouldRegenerate(e){return ce(this,void 0,void 0,function*(){const t=yield(0,s._)(this.keyService.userKey$(e));if(!t)return this.logService.info("[UserAsymmetricKeyRegeneration] User symmetric key unavailable, skipping regeneration for the user."),!1;if(t.inner().type===j.Qd.CoseEncrypt0)return this.logService.error("[UserAsymmetricKeyRegeneration] Cannot regenerate asymmetric keys for accounts on V2 encryption."),!1;const[i,o]=yield(0,s._)((0,r.z)([this.keyService.userEncryptedPrivateKey$(e),this.apiService.getUserPublicKey(e)]));if(!i||!o)return this.logService.warning("[UserAsymmetricKeyRegeneration] User's asymmetric key initialization data is unavailable, skipping regeneration."),!1;const a=yield(0,s._)(this.sdkService.client$.pipe((0,n.T)(e=>{if(void 0===e)throw new Error("SDK is undefined");return e.crypto().verify_asymmetric_keys({userKey:t.keyB64,userPublicKey:o.publicKey,userKeyEncryptedPrivateKey:i})})));if(a.privateKeyDecryptable)return!a.validPrivateKey&&(this.logService.info("[UserAsymmetricKeyRegeneration] User's private key is decryptable but not a valid key, attempting regeneration."),!0);return(yield this.userKeyCanDecrypt(t,e))?(this.logService.info("[UserAsymmetricKeyRegeneration] User Asymmetric Key decryption failure detected, attempting regeneration."),!0):(this.logService.warning("[UserAsymmetricKeyRegeneration] User Asymmetric Key decryption failure detected, but unable to determine User Symmetric Key validity, skipping regeneration."),!1)})}regenerateUserPublicKeyEncryptionKeyPair(e){return ce(this,void 0,void 0,function*(){const t=yield(0,s._)(this.keyService.userKey$(e));if(null==t)throw new Error("User key not found");if(t.inner().type!==j.Qd.AesCbc256_HmacSha256_B64)throw new Error("User key is not V1 encryption type");const i=yield(0,s._)(this.sdkService.client$.pipe((0,n.T)(e=>{if(void 0===e)throw new Error("SDK is undefined");return e.crypto().make_key_pair(t.keyB64)})));try{yield this.userAsymmetricKeysRegenerationApiService.regenerateUserAsymmetricKeys(i.userPublicKey,new o.k(i.userKeyEncryptedPrivateKey))}catch(r){return void("Key regeneration not supported for this user."===(null==r?void 0:r.message)?this.logService.info("[UserAsymmetricKeyRegeneration] Regeneration not supported for this user at this time."):this.logService.error("[UserAsymmetricKeyRegeneration] Regeneration error when submitting the request to the server: "+r))}yield this.keyService.setPrivateKey(i.userKeyEncryptedPrivateKey,e),this.logService.info("[UserAsymmetricKeyRegeneration] User's asymmetric keys successfully regenerated.")})}userKeyCanDecrypt(e,t){return ce(this,void 0,void 0,function*(){const i=(yield this.cipherService.getAll(t)).find(e=>null==e.organizationId);if(!i)return!1;try{return!(yield i.decrypt(e)).decryptionFailure||(this.logService.error("[UserAsymmetricKeyRegeneration] User Symmetric Key validation error: Cipher decryption failed"),!1)}catch(n){return this.logService.error("[UserAsymmetricKeyRegeneration] User Symmetric Key validation error: "+n),!1}})}}class ue{}var he=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class pe{constructor(e){this.apiService=e}regenerateUserAsymmetricKeys(e,t){return he(this,void 0,void 0,function*(){const i={userPublicKey:e,userKeyEncryptedUserPrivateKey:t};yield this.apiService.send("POST","/accounts/key-management/regenerate-keys",i,!0,!0)})}}},22869:(e,t,i)=>{"use strict";i.d(t,{V:()=>n});class n{}},22949:(e,t,i)=>{"use strict";i.d(t,{p:()=>n});class n{}},22976:(e,t,i)=>{"use strict";i.d(t,{l:()=>u});var n=i(22848),r=i(62963),s=i(33812),o=i(77468),a=i(54471),l=i(88016),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function d(e,t){if(1&e&&(s.j41(0,"p"),s.EFF(1),s.j41(2,"a",1),s.nI1(3,"i18n"),s.nrm(4,"i",2),s.k0s(),s.nrm(5,"br"),s.j41(6,"code",3),s.EFF(7),s.k0s()()),2&e){const e=s.XpG();s.R7$(),s.SpI(" ",e.fingerprintLabel,": "),s.R7$(),s.Y8G("appA11yTitle",s.mNQ(s.bMT(3,4,"learnMoreAboutYourAccountFingerprintPhrase"))),s.R7$(5),s.JRh(e.fingerprint)}}class u{constructor(e){this.keyService=e}ngOnInit(){return c(this,void 0,void 0,function*(){var e;const t=yield this.keyService.getFingerprint(this.fingerprintMaterial,this.publicKeyBuffer);this.fingerprint=null!==(e=null==t?void 0:t.join("-"))&&void 0!==e?e:null})}}u.ɵfac=function(e){return new(e||u)(s.rXU(n.Lu))},u.ɵcmp=s.VBU({type:u,selectors:[["app-account-fingerprint"]],inputs:{fingerprintMaterial:"fingerprintMaterial",publicKeyBuffer:"publicKeyBuffer",fingerprintLabel:"fingerprintLabel"},decls:3,vars:1,consts:[[4,"ngIf"],["href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[1,"tw-text-code"]],template:function(e,t){1&e&&(s.qex(0),s.nrm(1,"hr"),s.DNE(2,d,8,6,"p",0),s.bVm()),2&e&&(s.R7$(2),s.Y8G("ngIf",t.fingerprint))},dependencies:[r.G,o.bT,a.C,l.$],encapsulation:2})},23080:(e,t,i)=>{"use strict";i.d(t,{U:()=>n});class n{constructor(e,t){this.ids=null==e?[]:e,this.organizationId=t}}},23166:(e,t,i)=>{"use strict";i.d(t,{G:()=>d,$:()=>n});class n{}var r=i(82781),s=i(62870),o=i(68467),a=i(78781),l=i(43890),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d{constructor(e){this.cryptoFunctionService=e}createKey(e){return c(this,void 0,void 0,function*(){const t=yield this.cryptoFunctionService.aesGenerateKey(e);return new l.e(t)})}createKeyWithPurpose(e,t,i){return c(this,void 0,void 0,function*(){if(null==i){const e=yield this.cryptoFunctionService.randomBytes(32);i=a.A.fromBufferToUtf8(e)}const n=yield this.cryptoFunctionService.aesGenerateKey(e),r=yield this.cryptoFunctionService.hkdf(n,i,t,64,"sha256");return{salt:i,material:n,derivedKey:new l.e(r)}})}deriveKeyFromMaterial(e,t,i){return c(this,void 0,void 0,function*(){const n=yield this.cryptoFunctionService.hkdf(e,t,i,64,"sha256");return new l.e(n)})}deriveKeyFromPassword(e,t,i){return c(this,void 0,void 0,function*(){return"string"==typeof e&&(e=(new TextEncoder).encode(e)),"string"==typeof t&&(t=(new TextEncoder).encode(t)),yield s.B.Ready,new l.e(r.PureCrypto.derive_kdf_material(e,t,i.toSdkConfig()))})}stretchKey(e){return c(this,void 0,void 0,function*(){if(e.inner().type!=o.Qd.AesCbc256_B64)throw new Error("Key passed into stretchKey is not a 256-bit key.");const t=new Uint8Array(64),i=yield this.cryptoFunctionService.hkdfExpand(e.inner().encryptionKey,"enc",32,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(e.inner().encryptionKey,"mac",32,"sha256");return t.set(new Uint8Array(i)),t.set(new Uint8Array(n),32),new l.e(t)})}deriveVaultExportKey(e,t,i){return c(this,void 0,void 0,function*(){return yield this.stretchKey(yield this.deriveKeyFromPassword(e,t,i))})}}},23293:(e,t,i)=>{"use strict";i.d(t,{o:()=>T});var n=i(60512),r=i(39306),s=i(66523),o=i(78781),a=i(17989),l=i(34693),c=i(36501),d=i(7919),u=i(24072),h=i(42234),p=i(50451),m=i(38453),v=i(75751),f=i(5571),g=i(19488),y=i(77720),b=i(32072),w=i(21925),S=i(50751),I=i(47328),k=i(67756),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T extends a.A{constructor(e,t){var i;if(super(),this.initializerKey=l.M.Cipher,this.id="",this.name=new r.k(""),this.type=d.gC.Login,this.favorite=!1,this.organizationUseTotp=!1,this.edit=!1,this.viewPassword=!0,this.collectionIds=[],this.reprompt=c.b.None,null!=e){switch(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.name=new r.k(e.name),this.notes=(0,u.e)(e.notes),this.type=e.type,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,this.viewPassword=e.viewPassword,this.permissions=e.permissions,this.revisionDate=new Date(e.revisionDate),this.localData=t,this.collectionIds=null!==(i=e.collectionIds)&&void 0!==i?i:[],this.creationDate=new Date(e.creationDate),this.deletedDate=null!=e.deletedDate?new Date(e.deletedDate):void 0,this.archivedDate=null!=e.archivedDate?new Date(e.archivedDate):void 0,this.reprompt=e.reprompt,this.key=(0,u.e)(e.key),this.type){case d.gC.Login:this.login=new w.a(e.login);break;case d.gC.SecureNote:this.secureNote=new I.S(e.secureNote);break;case d.gC.Card:this.card=new g.Z(e.card);break;case d.gC.Identity:this.identity=new b.l(e.identity);break;case d.gC.SshKey:this.sshKey=new k.M(e.sshKey)}null!=e.attachments&&(this.attachments=e.attachments.map(e=>new f.o(e))),null!=e.fields&&(this.fields=e.fields.map(e=>new y.D(e))),null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map(e=>new S._(e)))}else this.creationDate=this.revisionDate=new Date}decrypt(e){return C(this,void 0,void 0,function*(){(0,n.x)(e,"userKeyOrOrgKey","Cipher decryption");const t=new v.f(this);let i=!0,r=e;if(null!=this.key){const n=o.A.getContainerService().getEncryptService();try{r=yield n.unwrapSymmetricKey(this.key,e),i=!1}catch(s){return t.name="[error: cannot decrypt]",t.decryptionFailure=!0,t}}switch(yield this.decryptObj(this,t,["name","notes"],r),this.type){case d.gC.Login:null!=this.login&&(t.login=yield this.login.decrypt(i,r,`Cipher Id: ${this.id}`));break;case d.gC.SecureNote:null!=this.secureNote&&(t.secureNote=yield this.secureNote.decrypt());break;case d.gC.Card:null!=this.card&&(t.card=yield this.card.decrypt(r,`Cipher Id: ${this.id}`));break;case d.gC.Identity:null!=this.identity&&(t.identity=yield this.identity.decrypt(r,`Cipher Id: ${this.id}`));break;case d.gC.SshKey:null!=this.sshKey&&(t.sshKey=yield this.sshKey.decrypt(r,`Cipher Id: ${this.id}`))}if(null!=this.attachments&&this.attachments.length>0){const e=[];for(const t of this.attachments){const i=yield t.decrypt(r,`Cipher Id: ${this.id}`);e.push(i)}t.attachments=e}if(null!=this.fields&&this.fields.length>0){const e=[];for(const t of this.fields){const i=yield t.decrypt(r);e.push(i)}t.fields=e}if(null!=this.passwordHistory&&this.passwordHistory.length>0){const e=[];for(const t of this.passwordHistory){const i=yield t.decrypt(r);e.push(i)}t.passwordHistory=e}return t})}toCipherData(){const e=new p.A;switch(e.id=this.id,null!=this.organizationId&&(e.organizationId=this.organizationId),null!=this.folderId&&(e.folderId=this.folderId),e.edit=this.edit,e.viewPassword=this.viewPassword,e.organizationUseTotp=this.organizationUseTotp,e.favorite=this.favorite,e.revisionDate=this.revisionDate.toISOString(),e.type=this.type,e.collectionIds=this.collectionIds,e.creationDate=this.creationDate.toISOString(),e.deletedDate=null!=this.deletedDate?this.deletedDate.toISOString():void 0,e.reprompt=this.reprompt,null!=this.key&&null!=this.key.encryptedString&&(e.key=this.key.encryptedString),null!=this.permissions&&(e.permissions=this.permissions),e.archivedDate=null!=this.archivedDate?this.archivedDate.toISOString():void 0,this.buildDataModel(this,e,{name:null,notes:null}),e.type){case d.gC.Login:null!=this.login&&(e.login=this.login.toLoginData());break;case d.gC.SecureNote:null!=this.secureNote&&(e.secureNote=this.secureNote.toSecureNoteData());break;case d.gC.Card:null!=this.card&&(e.card=this.card.toCardData());break;case d.gC.Identity:null!=this.identity&&(e.identity=this.identity.toIdentityData());break;case d.gC.SshKey:null!=this.sshKey&&(e.sshKey=this.sshKey.toSshKeyData())}return null!=this.fields&&(e.fields=this.fields.map(e=>e.toFieldData())),null!=this.attachments&&(e.attachments=this.attachments.map(e=>e.toAttachmentData())),null!=this.passwordHistory&&(e.passwordHistory=this.passwordHistory.map(e=>e.toPasswordHistoryData())),e}static fromJSON(e){var t,i,n;if(null==e)return;const s=new T;switch(s.id=e.id,s.organizationId=e.organizationId,s.folderId=e.folderId,s.type=e.type,s.favorite=e.favorite,s.organizationUseTotp=e.organizationUseTotp,s.edit=e.edit,s.viewPassword=e.viewPassword,null!=e.permissions&&(s.permissions=new h.a(e.permissions)),s.collectionIds=e.collectionIds,s.localData=e.localData,s.reprompt=e.reprompt,s.creationDate=new Date(e.creationDate),s.revisionDate=new Date(e.revisionDate),s.deletedDate=null!=e.deletedDate?new Date(e.deletedDate):void 0,s.archivedDate=null!=e.archivedDate?new Date(e.archivedDate):void 0,s.name=r.k.fromJSON(e.name),s.notes=(0,u.u)(e.notes),s.key=(0,u.u)(e.key),s.attachments=null===(t=e.attachments)||void 0===t?void 0:t.map(e=>f.o.fromJSON(e)).filter(e=>null!=e),s.fields=null===(i=e.fields)||void 0===i?void 0:i.map(e=>y.D.fromJSON(e)).filter(e=>null!=e),s.passwordHistory=null===(n=e.passwordHistory)||void 0===n?void 0:n.map(e=>S._.fromJSON(e)).filter(e=>null!=e),e.type){case d.gC.Card:null!=e.card&&(s.card=g.Z.fromJSON(e.card));break;case d.gC.Identity:null!=e.identity&&(s.identity=b.l.fromJSON(e.identity));break;case d.gC.Login:null!=e.login&&(s.login=w.a.fromJSON(e.login));break;case d.gC.SecureNote:null!=e.secureNote&&(s.secureNote=I.S.fromJSON(e.secureNote));break;case d.gC.SshKey:null!=e.sshKey&&(s.sshKey=k.M.fromJSON(e.sshKey))}return s}toSdkCipher(){var e,t,i,n,r,o,a;const l={id:this.id?(0,s.WD)(this.id):void 0,organizationId:this.organizationId?(0,s.WD)(this.organizationId):void 0,folderId:this.folderId?(0,s.WD)(this.folderId):void 0,collectionIds:this.collectionIds?this.collectionIds.map(s.WD):[],key:null===(e=this.key)||void 0===e?void 0:e.toSdk(),name:this.name.toSdk(),notes:null===(t=this.notes)||void 0===t?void 0:t.toSdk(),type:this.type,favorite:this.favorite,organizationUseTotp:this.organizationUseTotp,edit:this.edit,permissions:this.permissions?{delete:this.permissions.delete,restore:this.permissions.restore}:void 0,viewPassword:this.viewPassword,localData:(0,m.H)(this.localData),attachments:null===(i=this.attachments)||void 0===i?void 0:i.map(e=>e.toSdkAttachment()),fields:null===(n=this.fields)||void 0===n?void 0:n.map(e=>e.toSdkField()),passwordHistory:null===(r=this.passwordHistory)||void 0===r?void 0:r.map(e=>e.toSdkPasswordHistory()),revisionDate:this.revisionDate.toISOString(),creationDate:this.creationDate.toISOString(),deletedDate:null===(o=this.deletedDate)||void 0===o?void 0:o.toISOString(),archivedDate:null===(a=this.archivedDate)||void 0===a?void 0:a.toISOString(),reprompt:(0,c.x)(this.reprompt),login:void 0,identity:void 0,card:void 0,secureNote:void 0,sshKey:void 0,data:void 0};switch(this.type){case d.gC.Login:null!=this.login&&(l.login=this.login.toSdkLogin());break;case d.gC.SecureNote:null!=this.secureNote&&(l.secureNote=this.secureNote.toSdkSecureNote());break;case d.gC.Card:null!=this.card&&(l.card=this.card.toSdkCard());break;case d.gC.Identity:null!=this.identity&&(l.identity=this.identity.toSdkIdentity());break;case d.gC.SshKey:null!=this.sshKey&&(l.sshKey=this.sshKey.toSdkSshKey())}return l}static fromSdkCipher(e){var t,i,n;if(null==e)return;const o=new T;return o.id=e.id?(0,s.zw)(e.id):"",o.organizationId=e.organizationId?(0,s.zw)(e.organizationId):void 0,o.folderId=e.folderId?(0,s.zw)(e.folderId):void 0,o.collectionIds=e.collectionIds?e.collectionIds.map(s.zw):[],o.key=(0,u.u)(e.key),o.name=r.k.fromJSON(e.name),o.notes=(0,u.u)(e.notes),o.type=e.type,o.favorite=e.favorite,o.organizationUseTotp=e.organizationUseTotp,o.edit=e.edit,o.permissions=h.a.fromSdkCipherPermissions(e.permissions),o.viewPassword=e.viewPassword,o.localData=(0,m.e)(e.localData),o.attachments=null===(t=e.attachments)||void 0===t?void 0:t.map(e=>f.o.fromSdkAttachment(e)).filter(e=>null!=e),o.fields=null===(i=e.fields)||void 0===i?void 0:i.map(e=>y.D.fromSdkField(e)).filter(e=>null!=e),o.passwordHistory=null===(n=e.passwordHistory)||void 0===n?void 0:n.map(e=>S._.fromSdkPasswordHistory(e)).filter(e=>null!=e),o.creationDate=new Date(e.creationDate),o.revisionDate=new Date(e.revisionDate),o.deletedDate=e.deletedDate?new Date(e.deletedDate):void 0,o.archivedDate=e.archivedDate?new Date(e.archivedDate):void 0,o.reprompt=e.reprompt,o.login=w.a.fromSdkLogin(e.login),o.secureNote=I.S.fromSdkSecureNote(e.secureNote),o.card=g.Z.fromSdkCard(e.card),o.identity=b.l.fromSdkIdentity(e.identity),o.sshKey=k.M.fromSdkSshKey(e.sshKey),o}}},23327:(e,t,i)=>{"use strict";i.d(t,{U:()=>u});var n=i(20266),r=i(36951),s=i(87895),o=i(33812),a=i(77468),l=i(58384);function c(e,t){if(1&e&&(o.j41(0,"div",2),o.nrm(1,"bit-icon",3),o.k0s()),2&e){const e=o.XpG();o.R7$(),o.Y8G("icon",e.IconProviderMap[e.provider])}}function d(e,t){if(1&e&&o.nrm(0,"img",4),2&e){const e=o.XpG();o.HbH("mfaType"+e.provider),o.Y8G("alt",e.name)}}class u{constructor(){this.IconProviderMap={0:n.m,1:r.f,7:s.R}}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=o.VBU({type:u,selectors:[["auth-two-factor-icon"]],inputs:{provider:"provider",name:"name"},standalone:!1,decls:3,vars:2,consts:[["class","tw-size-[70px] tw-content-center",4,"ngIf"],[3,"class","alt",4,"ngIf"],[1,"tw-size-[70px]","tw-content-center"],[3,"icon"],[3,"alt"]],template:function(e,t){1&e&&(o.qex(0),o.DNE(1,c,2,1,"div",0)(2,d,1,3,"img",1),o.bVm()),2&e&&(o.R7$(),o.Y8G("ngIf",!!t.IconProviderMap[t.provider]),o.R7$(),o.Y8G("ngIf",2==t.provider||3==t.provider||4==t.provider||5==t.provider||6==t.provider))},dependencies:[a.bT,l.i],encapsulation:2})},23385:(e,t,i)=>{"use strict";i.d(t,{l:()=>a});var n=i(39306),r=i(17989),s=i(58389),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a extends r.A{constructor(e){super(),null!=e&&(this.size=e.size,this.buildDomainModel(this,e,{id:null,sizeName:null,fileName:null},["id","sizeName"]))}decrypt(e){return o(this,void 0,void 0,function*(){return yield this.decryptObj(this,new s.Q(this),["fileName"],e)})}static fromJSON(e){return null==e?null:Object.assign(new a,e,{fileName:n.k.fromJSON(e.fileName)})}}},23490:(e,t,i)=>{"use strict";i.d(t,{O:()=>u});var n=i(66046),r=i(25065),s=i(33812),o=i(86388),a=i(93103),l=i(57144),c=i(77468),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class u{constructor(e){this.avatarService=e,this.border=!1,this.size="default",this.destroy$=new n.B,this.color$=this.avatarService.avatarColor$,this.text&&(this.text=this.text.toUpperCase())}ngOnDestroy(){return d(this,void 0,void 0,function*(){this.destroy$.next(),this.destroy$.complete()})}}u.ɵfac=function(e){return new(e||u)(s.rXU(o.v))},u.ɵcmp=s.VBU({type:u,selectors:[["dynamic-avatar"]],inputs:{border:"border",id:"id",text:"text",title:"title",size:"size"},decls:3,vars:9,consts:[[3,"title"],["appStopClick","",3,"text","size","color","border","id","title"]],template:function(e,t){1&e&&(s.j41(0,"span",0),s.nrm(1,"bit-avatar",1),s.nI1(2,"async"),s.k0s()),2&e&&(s.Y8G("title",t.title),s.R7$(),s.Y8G("text",t.text)("size",t.size)("color",s.bMT(2,7,t.color$))("border",t.border)("id",t.id)("title",t.title))},dependencies:[r.G,a.Y,l.f,c.Jj],encapsulation:2})},23542:(e,t,i)=>{"use strict";i.d(t,{v:()=>o});var n=i(74208),r=i(33812);class s{constructor(e,t){this.document=e,this.ngZone=t,this.ngZone.runOutsideAngular(()=>{this.listener=e=>{if(e.target.closest('[aria-disabled="true"][bit-aria-disable="true"]'))return e.stopPropagation(),e.preventDefault(),!1},this.document.addEventListener("click",this.listener,!0)})}ngOnDestroy(){this.document.removeEventListener("click",this.listener,!0)}}s.ɵfac=function(e){return new(e||s)(n.KVO(n.qQL),n.KVO(r.SKi))},s.ɵprov=n.jDH({token:s,factory:s.ɵfac,providedIn:"root"});class o{constructor(){this.ariaDisabledClickCaptureService=(0,n.WQX)(s)}}o.ɵfac=function(e){return new(e||o)},o.ɵdir=r.FsC({type:o,hostVars:1,hostBindings:function(e,t){2&e&&r.BMQ("bit-aria-disable",!0)}})},23549:(e,t,i)=>{"use strict";i.d(t,{D0:()=>r,_z:()=>n,aX:()=>s});const n=Object.freeze({forwarder:"forwarder"}),r=Object.freeze({token:"token",baseUrl:"baseUrl",domain:"domain",prefix:"prefix"}),s=Object.freeze({default:"default",none:"none",allow:"allow",deny:"deny"})},23567:(e,t,i)=>{"use strict";i.d(t,{F:()=>r});var n=i(84175);class r{static nestedTraverse(e,t,i,s,o,a){if(i.length<=t)return;const l=t===i.length-1,c=i[t];if(l)return void e.push(new n.n(s,o,c));const d=e.filter(e=>e.node.name===c);if(0===d.length){const n=c+a+i[t+1];r.nestedTraverse(e,0,[n,...i.slice(t+2)],s,o,a)}else r.nestedTraverse(d[0].children,t+1,i,s,d[0],a)}static getTreeNodeObject(e,t){if(e.node.id===t)return e;for(let i=0;i<e.children.length;i++)if(null!=e.children[i].children){const n=r.getTreeNodeObject(e.children[i],t);if(null!==n)return n}return null}static getTreeNodeObjectFromList(e,t){for(let i=0;i<e.length;i++){if(e[i].node.id===t)return e[i];if(null!=e[i].children){const n=r.getTreeNodeObjectFromList(e[i].children,t);if(null!==n)return n}}return null}}},23979:(e,t,i)=>{"use strict";i.d(t,{h:()=>x});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(96141),d=i(14803),u=i(8131),h=i(58625),p=i(26411),m=i(36288),v=i(29776),f=i(36801),g=i(74208),y=i(86226),b=i(93199),w=i(97553),S=i(43759),I=i(76356),k=i(69896),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function T(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-form-field")(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"input",2),n.bIt("change",function(){g.eBV(e);const t=n.XpG();return g.Njj(t.save("domain"))}),n.k0s(),n.j41(5,"bit-hint"),n.EFF(6),n.nI1(7,"i18n"),n.k0s()()}2&e&&(n.R7$(2),n.JRh(n.bMT(3,2,"forwarderDomainName")),n.R7$(4),n.JRh(n.bMT(7,4,"forwarderDomainNameHint")))}function F(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-form-field")(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"input",3),n.bIt("change",function(){g.eBV(e);const t=n.XpG();return g.Njj(t.save("password"))}),n.k0s(),n.j41(5,"button",4),n.bIt("change",function(){g.eBV(e);const t=n.XpG();return g.Njj(t.save("token"))}),n.k0s()()}2&e&&(n.R7$(2),n.JRh(n.bMT(3,1,"apiKey")))}function R(e,t){if(1&e){const e=n.RV6();n.j41(0,"bit-form-field",1)(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"input",5),n.bIt("change",function(){g.eBV(e);const t=n.XpG();return g.Njj(t.save("baseUrl"))}),n.k0s()()}2&e&&(n.R7$(2),n.JRh(n.bMT(3,1,"selfHostBaseUrl")))}const P=Object.freeze({domain:"domain",token:"token",baseUrl:"baseUrl"});class x{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account=null,this.account$=new o.m(1),this.forwarder=null,this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({[P.domain]:[""],[P.token]:[""],[P.baseUrl]:[""]}),this.vendor=new o.m(1),this.saveSettings=new s.B,this.displayDomain=!1,this.displayToken=!1,this.displayBaseUrl=!1,this.refresh$=new s.B,this.destroyed$=new s.B}ngOnInit(){return C(this,void 0,void 0,function*(){const e=new o.m(1);this.vendor.pipe((0,a.T)(e=>this.generatorService.forwarder(e)),(0,d.Q)(this.destroyed$)).subscribe(t=>{this.displayDomain=t.capabilities.fields.includes("domain"),this.displayToken=t.capabilities.fields.includes("token"),this.displayBaseUrl=t.capabilities.fields.includes("baseUrl"),e.next(t)});const t=e.pipe((0,a.T)(e=>this.generatorService.settings(e,{account$:this.account$})));t.pipe((0,c.w)(),(0,d.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,d.Q)(this.destroyed$)).subscribe(e=>{for(const t in P){const i=this.settings.get(t);e.capabilities.fields.includes(t)?null==i||i.enable({emitEvent:!1}):null==i||i.disable({emitEvent:!1})}}),t.pipe((0,a.T)(e=>e.pipe((0,l.i)(1))),(0,c.w)(),(0,d.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,u.E)(this.settings.valueChanges,t),(0,d.Q)(this.destroyed$)).subscribe(([,e,t])=>{t.next(e)})})}save(e="component api call"){this.saveSettings.next(e)}ngOnChanges(e){return C(this,void 0,void 0,function*(){this.refresh$.complete(),"forwarder"in e&&this.vendor.next(this.forwarder),"account"in e&&this.account$.next(this.account)})}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}x.ɵfac=function(e){return new(e||x)(n.rXU(r.ok),n.rXU(v.iE))},x.ɵcmp=n.VBU({type:x,selectors:[["tools-forwarder-settings"]],inputs:{account:"account",forwarder:"forwarder"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:4,vars:4,consts:[[1,"tw-container",3,"formGroup"],["disableMargin",""],["bitInput","","formControlName","domain","type","text","placeholder","example.com",3,"change"],["bitInput","","formControlName","token","type","password",3,"change"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"change"],["bitInput","","formControlName","baseUrl","type","text",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0),n.nVh(1,T,8,6,"bit-form-field"),n.nVh(2,F,6,3,"bit-form-field"),n.nVh(3,R,5,3,"bit-form-field",1),n.k0s()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(),n.vxM(t.displayDomain?1:-1),n.R7$(),n.vxM(t.displayToken?2:-1),n.R7$(),n.vxM(t.displayBaseUrl?3:-1))},dependencies:[r.X1,r.qT,r.me,r.BC,r.cb,r.j4,r.JD,p.L,y.j,b.I,w.J,S.h,I.e,k.a,m.s,h.p,f.$Z],encapsulation:2})},24072:(e,t,i)=>{"use strict";i.d(t,{e:()=>r,u:()=>s});var n=i(39306);const r=e=>null!=e?new n.k(e):void 0,s=e=>null!=e?n.k.fromJSON(e):void 0},24137:(e,t,i)=>{"use strict";i.d(t,{f:()=>d});var n=i(74269),r=i(44087),s=i(65067),o=i(59557),a=i(42503),l=i(74208),c=i(33812);class d{}d.ɵfac=function(e){return new(e||d)},d.ɵmod=c.$C({type:d}),d.ɵinj=l.G2t({imports:[n.K,r.O,s.u,o.K,a.K]})},24374:(e,t,i)=>{"use strict";i.d(t,{d:()=>m});var n=i(94573),r=i(89033),s=i(51757),o=i(15033),a=i(33812);let l=0;class c{constructor(e){this.ngControl=e,this.id=(0,n.hFB)("bit-radio-input-"+l++),this.inputClasses=["tw-appearance-none","tw-outline-none","tw-relative","tw-transition","tw-cursor-pointer","tw-inline-block","tw-rounded-full","tw-border","tw-border-solid","tw-border-secondary-600","tw-w-[1.12rem]","tw-h-[1.12rem]","!tw-p-[.125rem]","tw-flex-none","hover:tw-border-2","[&>label:hover]:tw-border-2","[&:not(bit-form-control_*)]:focus-visible:tw-ring-2","[&:not(bit-form-control_*)]:focus-visible:tw-ring-offset-2","[&:not(bit-form-control_*)]:focus-visible:tw-ring-primary-600","before:tw-content-['']","before:tw-transition","before:tw-block","before:tw-rounded-full","before:tw-size-full","disabled:tw-cursor-auto","disabled:tw-bg-secondary-100","disabled:hover:tw-border","checked:tw-bg-text-contrast","checked:tw-border-primary-600","checked:tw-border-2","checked:hover:tw-border-2","checked:hover:tw-border-primary-700","checked:hover:before:tw-bg-primary-700","[&>label:hover]:checked:tw-bg-primary-700","[&>label:hover]:checked:tw-border-primary-700","checked:before:tw-bg-primary-600","checked:disabled:tw-border-secondary-600","checked:disabled:hover:tw-border-secondary-600","checked:disabled:hover:tw-border-2","checked:disabled:tw-bg-background","checked:disabled:hover:before:tw-bg-secondary-600","checked:disabled:before:tw-bg-secondary-600"],this.disabledInput=(0,n.hFB)(!1,{transform:n.L39,alias:"disabled"})}get disabled(){var e;return this.disabledInput()||(null===(e=this.ngControl)||void 0===e?void 0:e.disabled)||!1}get required(){var e,t,i;return null!==(i=null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.control)||void 0===t?void 0:t.hasValidator(s.k0.requiredTrue))&&void 0!==i&&i}get hasError(){var e,t;return!("INVALID"!==(null===(e=this.ngControl)||void 0===e?void 0:e.status)||!(null===(t=this.ngControl)||void 0===t?void 0:t.touched))}get error(){var e,t;const i=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}}c.ɵfac=function(e){return new(e||c)(a.rXU(s.vO,10))},c.ɵcmp=a.VBU({type:c,selectors:[["input","type","radio","bitRadio",""]],hostVars:4,hostBindings:function(e,t){2&e&&(a.Avn("id",t.id())("disabled",t.disabled),a.HbH(t.inputClasses))},inputs:{id:[1,"id"],disabledInput:[1,"disabled","disabledInput"]},features:[a.Jv_([{provide:o.J,useExisting:c}])],attrs:["type","radio","bitRadio",""],decls:0,vars:0,template:function(e,t){},encapsulation:2});var d=i(17721),u=i(90246);const h=[[["bit-label"]],[["bit-hint"]]];let p=0;class m{get classList(){return[this.block?"tw-block":"tw-inline-block","tw-mb-1","[&_bit-hint]:tw-mt-0"]}constructor(e){this.groupComponent=e,this.id=(0,n.hFB)("bit-radio-button-"+p++),this.value=(0,n.hFB)(),this.disabled=(0,n.hFB)(!1)}get inputId(){return`${this.id()}-input`}get name(){return this.groupComponent.name}get selected(){return this.groupComponent.selected===this.value()}get groupDisabled(){return this.groupComponent.disabled}get block(){return this.groupComponent.block()}onInputChange(){this.groupComponent.onInputChange(this.value())}onBlur(){this.groupComponent.onBlur()}}m.ɵfac=function(e){return new(e||m)(a.rXU(d.Y))},m.ɵcmp=a.VBU({type:m,selectors:[["bit-radio-button"]],hostVars:3,hostBindings:function(e,t){2&e&&(a.Avn("id",t.id()),a.HbH(t.classList))},inputs:{id:[1,"id"],value:[1,"value"],disabled:[1,"disabled"]},ngContentSelectors:["bit-label","bit-hint"],decls:4,vars:5,consts:[["disableMargin","",3,"inline"],["type","radio","bitRadio","",3,"change","blur","id","disabled","value","checked"]],template:function(e,t){1&e&&(a.NAR(h),a.j41(0,"bit-form-control",0)(1,"input",1),a.bIt("change",function(){return t.onInputChange()})("blur",function(){return t.onBlur()}),a.k0s(),a.SdG(2,0,["ngProjectAs","bit-label",5,["bit-label"]]),a.SdG(3,1,["ngProjectAs","bit-hint",5,["bit-hint"]]),a.k0s()),2&e&&(a.Y8G("inline",!t.block),a.R7$(),a.Y8G("id",t.inputId)("disabled",t.groupDisabled||t.disabled())("value",t.value())("checked",t.selected))},dependencies:[r.c,u.f,c],encapsulation:2})},24558:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 60">
    <path class="tw-fill-illustration-bg-primary" d="M0 14.8A4.8 4.8 0 0 1 4.8 10h45.4a4.8 4.8 0 0 1 4.8 4.8v32.067a4.8 4.8 0 0 1-4.8 4.8H4.8a4.8 4.8 0 0 1-4.8-4.8V14.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50.2 11.6H4.8a3.2 3.2 0 0 0-3.2 3.2v32.067a3.2 3.2 0 0 0 3.2 3.2h45.4a3.2 3.2 0 0 0 3.2-3.2V14.8a3.2 3.2 0 0 0-3.2-3.2ZM4.8 10A4.8 4.8 0 0 0 0 14.8v32.067a4.8 4.8 0 0 0 4.8 4.8h45.4a4.8 4.8 0 0 0 4.8-4.8V14.8a4.8 4.8 0 0 0-4.8-4.8H4.8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M54.167 19.966H.834v-1.6h53.333v1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M51.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM46.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM41.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M33.6 50.4c0 7.29-5.91 13.2-13.2 13.2-7.29 0-13.2-5.91-13.2-13.2 0-7.29 5.91-13.2 13.2-13.2 7.29 0 13.2 5.91 13.2 13.2Z"/>
    <path class="tw-fill-illustration-tertiary" d="M30.3 50.4c0 5.468-4.432 9.9-9.9 9.9-5.467 0-9.9-4.432-9.9-9.9s4.433-9.9 9.9-9.9c5.468 0 9.9 4.432 9.9 9.9Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20.4 58.716a8.316 8.316 0 1 0 0-16.632 8.316 8.316 0 0 0 0 16.632Zm0 1.584c5.468 0 9.9-4.432 9.9-9.9s-4.432-9.9-9.9-9.9c-5.467 0-9.9 4.432-9.9 9.9s4.433 9.9 9.9 9.9Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M19.575 46.275a.825.825 0 1 1 1.65 0v8.25a.825.825 0 0 1-1.65 0v-8.25Z"/>
    <path class="tw-fill-illustration-outline" d="M24.525 49.575a.825.825 0 1 1 0 1.65h-8.25a.825.825 0 0 1 0-1.65h8.25Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M68.333 35c0 6.443-5.223 11.666-11.666 11.666C50.223 46.666 45 41.443 45 35c0-6.444 5.223-11.667 11.667-11.667 6.443 0 11.666 5.223 11.666 11.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M56.667 45.066c5.56 0 10.066-4.507 10.066-10.066 0-5.56-4.507-10.067-10.066-10.067C51.107 24.933 46.6 29.44 46.6 35c0 5.56 4.507 10.066 10.067 10.066Zm0 1.6c6.443 0 11.666-5.223 11.666-11.666 0-6.444-5.223-11.667-11.666-11.667C50.223 23.333 45 28.556 45 35c0 6.443 5.223 11.666 11.667 11.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M78.255 59.98A22.916 22.916 0 0 1 80 68.75c0 .69-.56 1.25-1.25 1.25H35.417c-.69 0-1.25-.56-1.25-1.25a22.916 22.916 0 0 1 44.088-8.77Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M78.397 68.4a21.317 21.317 0 0 0-42.628 0h42.628Zm1.603.35a22.916 22.916 0 0 0-45.833 0c0 .69.56 1.25 1.25 1.25H78.75c.69 0 1.25-.56 1.25-1.25Z" clip-rule="evenodd"/>
  </svg>
`},24593:(e,t,i)=>{"use strict";i.d(t,{V:()=>ue,r:()=>de});var n=i(77468),r=i(74208),s=i(83731),o=i(66046),a=i(44500),l=i(72245),c=i(3204),d=i(30675),u=i(50790),h=i(3633),p=i(11573),m=i(56962),v=i(83516),f=i(43090),g=i(75421),y=i(31442),b=i(50451),w=i(23293),S=i(11979),I=i(21274),k=i(81525),C=i(29029),T=i(81573),F=i(37579),R=i(98403),P=i(22166),x=i(62963),$=i(8144),E=i(36801),A=i(33812),D=i(50700),O=i(56898),M=i(68016);const U="selected",G="canceled";class j{get isPassword(){return"password"===this.params.type}constructor(e,t,i){this.params=e,this.dialogRef=t,this.i18nService=i,this.titleKey=this.isPassword?"passwordGenerator":"usernameGenerator",this.generatedValue="",this.close=()=>{this.dialogRef.close({action:G})},this.selectValue=()=>{this.dialogRef.close({action:U,generatedValue:this.generatedValue})},this.onAlgorithmSelected=e=>{this.buttonLabel=e?e.useGeneratedValue:this.i18nService.t("useThisEmail"),this.generatedValue=void 0},this.uri=e.uri}onValueGenerated(e){this.generatedValue=e}static open(e,t){return e.open(j,Object.assign({},t))}}j.ɵfac=function(e){return new(e||j)(A.rXU(k.Qs),A.rXU(I.ce),A.rXU(D.W))},j.ɵcmp=A.VBU({type:j,selectors:[["web-vault-generator-dialog"]],decls:9,vars:7,consts:[["dialogSize","default","background","alt"],["bitDialogTitle",""],["bitDialogContent",""],["disableMargin","",3,"valueGenerated","algorithmSelected","type","uri"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary","data-testid","select-button",3,"click","disabled"]],template:function(e,t){1&e&&(A.j41(0,"bit-dialog",0)(1,"span",1),A.EFF(2),A.nI1(3,"i18n"),A.k0s(),A.qex(4,2),A.j41(5,"vault-cipher-form-generator",3),A.bIt("valueGenerated",function(e){return t.onValueGenerated(e)})("algorithmSelected",function(e){return t.onAlgorithmSelected(e)}),A.k0s(),A.bVm(),A.qex(6,4),A.j41(7,"button",5),A.bIt("click",function(){return t.selectValue()}),A.EFF(8),A.k0s(),A.bVm(),A.k0s()),2&e&&(A.R7$(2),A.SpI(" ",A.bMT(3,5,t.titleKey)," "),A.R7$(3),A.Y8G("type",t.params.type)("uri",t.uri),A.R7$(2),A.Y8G("disabled",!(t.buttonLabel&&t.generatedValue)),A.R7$(),A.SpI(" ",t.buttonLabel," "))},dependencies:[n.MD,P.Wg,C.t,O.Q,T.P,M.m,E.$Z],encapsulation:2});var N=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class V{constructor(){this.dialogService=(0,r.WQX)(I.o3)}generatePassword(){return N(this,void 0,void 0,function*(){const e=j.open(this.dialogService,{data:{type:"password"}}),t=yield(0,l._)(e.closed);return null==t||"canceled"===t.action?null:t.generatedValue})}generateUsername(e){return N(this,void 0,void 0,function*(){const t=j.open(this.dialogService,{data:{type:"username",uri:e}}),i=yield(0,l._)(t.closed);return null==i||"canceled"===i.action?null:i.generatedValue})}}V.ɵfac=function(e){return new(e||V)},V.ɵprov=r.jDH({token:V,factory:V.ɵfac});var B=i(39960),z=i(69855),L=i(5556),K=i(35500),q=i(23649),_=i(58329),X=i(12012),Y=i(81582),H=i(3892),W=i(36288),J=i(86639),Z=i(75556),Q=i(90300),ee=i(88016),te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ie=["dialogContent"];function ne(e,t){if(1&e&&A.nrm(0,"app-cipher-view",13),2&e){const e=A.XpG();A.Y8G("cipher",e.cipher)("collections",e.collections)("isAdminConsole",e.formConfig.isAdminConsole)}}function re(e,t){if(1&e){const e=A.RV6();A.j41(0,"vault-cipher-form",14),A.bIt("formReady",function(){r.eBV(e);const t=A.XpG();return r.Njj(t.onFormReady())})("cipherSaved",function(t){r.eBV(e);const i=A.XpG();return r.Njj(i.onCipherSaved(t))})("formStatusChange$",function(t){r.eBV(e);const i=A.XpG();return r.Njj(i.formStatusChanged(t))}),A.j41(1,"bit-item",15)(2,"button",16),A.bIt("click",function(){r.eBV(e);const t=A.XpG();return r.Njj(t.openAttachmentsDialog())}),A.j41(3,"div",17),A.EFF(4),A.nI1(5,"i18n"),A.nrm(6,"app-premium-badge"),A.k0s(),A.nrm(7,"i",18),A.k0s()()()}if(2&e){const e=A.XpG(),t=A.sdS(11);A.Y8G("config",e.formConfig)("submitBtn",t),A.R7$(2),A.Y8G("disabled",e.attachmentsButtonDisabled),A.R7$(2),A.SpI(" ",A.bMT(5,4,"attachments")," ")}}function se(e,t){if(1&e&&(A.j41(0,"button",19),A.EFF(1),A.nI1(2,"i18n"),A.k0s()),2&e){const e=A.XpG();A.Y8G("bitAction",e.restore),A.R7$(),A.SpI(" ",A.bMT(2,2,"restore")," ")}}function oe(e,t){if(1&e&&(A.qex(0),A.j41(1,"button",20),A.EFF(2),A.nI1(3,"i18n"),A.k0s(),A.bVm()),2&e){const e=A.XpG();A.R7$(),A.Y8G("bitAction",e.switchToEdit)("disabled",e.disableEdit),A.R7$(),A.SpI(" ",A.bMT(3,3,"edit")," ")}}function ae(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",21),A.bIt("click",function(){r.eBV(e);const t=A.XpG();return r.Njj(t.cancel())}),A.EFF(1),A.nI1(2,"i18n"),A.k0s()}2&e&&(A.R7$(),A.SpI(" ",A.bMT(2,1,"cancel")," "))}function le(e,t){if(1&e){const e=A.RV6();A.j41(0,"button",21),A.bIt("click",function(){r.eBV(e);const t=A.XpG();return r.Njj(t.cancel())}),A.EFF(1),A.nI1(2,"i18n"),A.k0s()}2&e&&(A.R7$(),A.SpI(" ",A.bMT(2,1,"close")," "))}function ce(e,t){if(1&e&&(A.j41(0,"div",22),A.nrm(1,"button",23),A.nI1(2,"i18n"),A.k0s()),2&e){const e=A.XpG();A.R7$(),A.Y8G("label",A.bMT(2,3,"delete"))("bitAction",e.delete)("disabled",!e.canDelete)}}const de={Saved:"saved",Deleted:"deleted",PremiumUpgrade:"premiumUpgrade",Restored:"restored"};class ue{get isTrashFilter(){var e;return"trash"===(null===(e=this.filter)||void 0===e?void 0:e.type)}get showCancel(){return!this.isTrashFilter&&!this.showCipherView}get showClose(){return this.isTrashFilter&&!this.showRestore}canUserRestore(){return te(this,void 0,void 0,function*(){var e,t;return this.isTrashFilter&&(null===(e=this.cipher)||void 0===e?void 0:e.isDeleted)&&(null===(t=this.cipher)||void 0===t?void 0:t.permissions.restore)})}get loadingForm(){return this.loadForm&&!this.formReady}get disableEdit(){return this.params.disableForm}get showEdit(){return this.showCipherView&&!this.isTrashFilter&&!this.showRestore}get showDelete(){return("form"!=this.params.mode||"clone"!==this.formConfig.mode)&&null!=this.cipher}get showCipherView(){return null!=this.cipher&&("view"===this.params.mode||this.loadingForm)}constructor(e,t,i,n,r,d,u,h,p,m,v,f,g,y,S,I){this.params=e,this.dialogRef=t,this.dialogService=i,this.i18nService=n,this.toastService=r,this.messagingService=d,this.logService=u,this.cipherService=h,this.accountService=p,this.router=m,this.billingAccountProfileStateService=v,this.premiumUpgradeService=f,this.cipherAuthorizationService=g,this.apiService=y,this.eventCollectionService=S,this.routedVaultFilterService=I,this._cipherModified=!1,this._originalFormMode=this.params.formConfig.mode,this._formReadySubject=new o.B,this.performingInitialLoad=!0,this.canAccessAttachments$=this.accountService.activeAccount$.pipe((0,a.n)(e=>this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id))),this.loadForm="form"===this.params.mode,this.formReady=!1,this.formConfig=this.params.formConfig,this.canDelete=!1,this.attachmentsButtonDisabled=!1,this.confirmedPremiumUpgrade=!1,this.restore=()=>te(this,void 0,void 0,function*(){var e,t;yield null===(t=(e=this.params).restore)||void 0===t?void 0:t.call(e,this.cipher),this.dialogRef.close(de.Restored)}),this.delete=()=>te(this,void 0,void 0,function*(){if(!this.cipher)return;if(yield this.dialogService.openSimpleDialog({title:{key:"deleteItem"},content:{key:this.cipher.isDeleted?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"},type:"warning"})){try{yield this.deleteCipher(),this.toastService.showToast({variant:"success",title:this.i18nService.t("success"),message:this.i18nService.t(this.cipher.isDeleted?"permanentlyDeletedItem":"deletedItem")}),this.messagingService.send(this.cipher.isDeleted?"permanentlyDeletedCipher":"deletedCipher")}catch(e){this.logService.error(e)}this._cipherModified=!1,this.dialogRef.close(de.Deleted)}}),this.openAttachmentsDialog=()=>te(this,void 0,void 0,function*(){var e,t,i,n,r;if(!(yield(0,l._)(this.canAccessAttachments$)))return void(yield this.premiumUpgradeService.promptForPremium(null===(e=this.cipher)||void 0===e?void 0:e.organizationId));const s=this.dialogService.open(P._A,{data:{cipherId:null===(t=this.formConfig.originalCipher)||void 0===t?void 0:t.id,organizationId:null===(i=this.formConfig.originalCipher)||void 0===i?void 0:i.organizationId}}),o=yield(0,l._)(s.closed);if(o.action===P.NY.Removed||o.action===P.NY.Uploaded){const e=yield(0,l._)(this.accountService.activeAccount$.pipe((0,c.T)(e=>null==e?void 0:e.id)));let t;if(this.formConfig.admin){const i=yield this.apiService.getCipherAdmin(null===(n=this.formConfig.originalCipher)||void 0===n?void 0:n.id),r=new b.A(i),s=new w.o(r);t=yield s.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(s,e))}else{const i=yield this.cipherService.get(null===(r=this.formConfig.originalCipher)||void 0===r?void 0:r.id,e);t=yield this.cipherService.decrypt(i,e)}this.cipherFormComponent.patchCipher(e=>(e.attachments=t.attachments,e.revisionDate=t.revisionDate,e)),this._cipherModified=!0}}),this.switchToEdit=()=>te(this,void 0,void 0,function*(){this.cipher&&(yield this.changeMode("form"))}),this.cancel=()=>te(this,void 0,void 0,function*(){"view"!==this.params.mode&&null!=this.cipher&&"clone"!==this.formConfig.mode?yield this.changeMode("view"):this.dialogRef.close(this._cipherModified?de.Saved:void 0)}),this.updateTitle(),this.premiumUpgradeService.upgradeConfirmed$.pipe((0,c.T)(e=>e&&(this.confirmedPremiumUpgrade=!0)),(0,s.pQ)()).subscribe()}ngOnInit(){return te(this,void 0,void 0,function*(){if(this.cipher=yield this.getDecryptedCipherView(this.formConfig),this.cipher){if(this.cipher.decryptionFailure)return this.dialogService.open(P.Tp,{data:{cipherIds:[this.cipher.id]},positionStrategy:new I.u3}),void this.dialogRef.close();this.collections=this.formConfig.collections.filter(e=>{var t;return null===(t=this.cipher.collectionIds)||void 0===t?void 0:t.includes(e.id)}),this.organization=this.formConfig.organizations.find(e=>e.id===this.cipher.organizationId),this.canDelete=yield(0,l._)(this.cipherAuthorizationService.canDeleteCipher$(this.cipher,this.params.isAdminConsoleAction)),yield this.eventCollectionService.collect(p.Bx.Cipher_ClientViewed,this.cipher.id,!1,this.cipher.organizationId)}this.filter=yield(0,l._)(this.routedVaultFilterService.filter$),this.showRestore=yield this.canUserRestore(),this.performingInitialLoad=!1})}ngOnDestroy(){this.confirmedPremiumUpgrade||this._cipherModified&&this.dialogRef.close(de.Saved)}formStatusChanged(e){this.attachmentsButtonDisabled="disabled"===e}onCipherSaved(e){return te(this,void 0,void 0,function*(){this.cipher=e,this.collections=this.formConfig.collections.filter(t=>{var i;return null===(i=e.collectionIds)||void 0===i?void 0:i.includes(t.id)}),"add"!==this._originalFormMode&&"clone"!==this._originalFormMode||(this.formConfig.mode="edit",this.formConfig.initialValues=null);const t=yield(0,l._)(this.accountService.activeAccount$.pipe(h.F6));let i=yield this.cipherService.get(e.id,t);if(this.formConfig.isAdminConsole&&(null==i||this.formConfig.admin)){const t=yield this.apiService.getCipherAdmin(e.id);t.edit=!0,t.viewPassword=!0;const n=new b.A(t);i=new w.o(n),this.cipher.organizationUseTotp=i.organizationUseTotp}this.formConfig.originalCipher=i,this._cipherModified=!0,yield this.changeMode("view")})}onFormReady(){this.formReady=!0,this._formReadySubject.next()}getDecryptedCipherView(e){return te(this,void 0,void 0,function*(){if(null==e.originalCipher)return;const t=yield(0,l._)(this.accountService.activeAccount$.pipe(h.F6));return yield this.cipherService.decrypt(e.originalCipher,t)})}updateTitle(){var e,t;const i={view:{[y.gC.Login]:"viewItemHeaderLogin",[y.gC.Card]:"viewItemHeaderCard",[y.gC.Identity]:"viewItemHeaderIdentity",[y.gC.SecureNote]:"viewItemHeaderNote",[y.gC.SshKey]:"viewItemHeaderSshKey"},new:{[y.gC.Login]:"newItemHeaderLogin",[y.gC.Card]:"newItemHeaderCard",[y.gC.Identity]:"newItemHeaderIdentity",[y.gC.SecureNote]:"newItemHeaderNote",[y.gC.SshKey]:"newItemHeaderSshKey"},edit:{[y.gC.Login]:"editItemHeaderLogin",[y.gC.Card]:"editItemHeaderCard",[y.gC.Identity]:"editItemHeaderIdentity",[y.gC.SecureNote]:"editItemHeaderNote",[y.gC.SshKey]:"editItemHeaderSshKey"}},n=null!==(t=null===(e=this.cipher)||void 0===e?void 0:e.type)&&void 0!==t?t:this.formConfig.cipherType;let r="view";"form"===this.params.mode&&(r="edit"===this.formConfig.mode||"partial-edit"===this.formConfig.mode?"edit":"new");const s=i[r][n];this.title=this.i18nService.t(s)}changeMode(e){return te(this,void 0,void 0,function*(){var t;this.formReady=!1,"form"==e?(this.loadForm=!0,yield(0,l._)(this._formReadySubject)):this.loadForm=!1,this.params.mode=e,this.updateTitle(),this.dialogContent.nativeElement.parentElement.scrollTop=0,yield this.router.navigate([],{queryParams:{action:"form"===e?"edit":"view",itemId:null===(t=this.cipher)||void 0===t?void 0:t.id},queryParamsHandling:"merge",replaceUrl:!0})})}deleteCipher(){return te(this,void 0,void 0,function*(){var e;const t=this.cipher.isUnassigned,i=(null===(e=this.organization)||void 0===e?void 0:e.canEditAllCiphers)||t,n=yield(0,l._)(this.accountService.activeAccount$.pipe((0,c.T)(e=>null==e?void 0:e.id)));this.cipher.isDeleted?yield this.cipherService.deleteWithServer(this.cipher.id,n,i):yield this.cipherService.softDeleteWithServer(this.cipher.id,n,i)})}static open(e,t){return e.open(ue,{data:t})}}ue.ɵfac=function(e){return new(e||ue)(A.rXU(k.Qs),A.rXU(I.ce),A.rXU(I.o3),A.rXU(D.W),A.rXU(z.f),A.rXU(v.U),A.rXU(m.K),A.rXU(L.p),A.rXU(K.Di),A.rXU(q.Ix),A.rXU(_.Q),A.rXU(f.l),A.rXU(S.y),A.rXU(X.G),A.rXU(Y.c),A.rXU($.B))},ue.ɵcmp=A.VBU({type:ue,selectors:[["app-vault-item-dialog"]],viewQuery:function(e,t){if(1&e&&(A.GBs(ie,5),A.GBs(P.zu,5)),2&e){let e;A.mGM(e=A.lsd())&&(t.dialogContent=e.first),A.mGM(e=A.lsd())&&(t.cipherFormComponent=e.first)}},features:[A.Jv_([{provide:f.l,useClass:(0,r.Rfq)(()=>B.x)},{provide:g.Q,useClass:u.I},{provide:P.vv,useClass:V},$.B,{provide:P.e3,useClass:P.bj}])],decls:17,vars:13,consts:[["dialogContent",""],["submitBtn",""],["dialogSize","large","background","alt",3,"loading"],["bitDialogTitle","","aria-live","polite"],["bitDialogContent",""],[3,"cipher","collections","isAdminConsole",4,"ngIf"],["formId","cipherForm",3,"config","submitBtn","formReady","cipherSaved","formStatusChange$",4,"ngIf"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","button",3,"bitAction",4,"ngIf"],[4,"ngIf"],["bitButton","","type","submit","form","cipherForm","buttonType","primary",3,"hidden"],["bitButton","","type","button","buttonType","secondary",3,"click",4,"ngIf"],["class","tw-ml-auto",4,"ngIf"],[3,"cipher","collections","isAdminConsole"],["formId","cipherForm",3,"formReady","cipherSaved","formStatusChange$","config","submitBtn"],["slot","attachment-button"],["bit-item-content","","type","button",3,"click","disabled"],[1,"tw-flex","tw-items-center","tw-gap-2"],["slot","end","aria-hidden","true",1,"bwi","bwi-angle-right"],["bitButton","","buttonType","primary","type","button",3,"bitAction"],["bitButton","","buttonType","primary","type","button",3,"bitAction","disabled"],["bitButton","","type","button","buttonType","secondary",3,"click"],[1,"tw-ml-auto"],["bitIconButton","bwi-trash","type","button","buttonType","danger","data-testid","delete-cipher-btn",3,"label","bitAction","disabled"]],template:function(e,t){1&e&&(A.j41(0,"bit-dialog",2)(1,"span",3),A.EFF(2),A.k0s(),A.j41(3,"div",4,0),A.DNE(5,ne,1,3,"app-cipher-view",5)(6,re,8,6,"vault-cipher-form",6),A.k0s(),A.qex(7,7),A.DNE(8,se,3,4,"button",8)(9,oe,4,5,"ng-container",9),A.j41(10,"button",10,1),A.EFF(12),A.nI1(13,"i18n"),A.k0s(),A.DNE(14,ae,3,3,"button",11)(15,le,3,3,"button",11)(16,ce,3,5,"div",12),A.bVm(),A.k0s()),2&e&&(A.Y8G("loading",t.performingInitialLoad),A.R7$(2),A.SpI(" ",t.title," "),A.R7$(3),A.Y8G("ngIf",t.showCipherView),A.R7$(),A.Y8G("ngIf",t.loadForm),A.R7$(2),A.Y8G("ngIf",t.showRestore),A.R7$(),A.Y8G("ngIf",t.showEdit),A.R7$(),A.Y8G("hidden",t.showCipherView||t.showRestore),A.R7$(2),A.SpI(" ",A.bMT(13,11,"save")," "),A.R7$(2),A.Y8G("ngIf",t.showCancel),A.R7$(),A.Y8G("ngIf",t.showClose),A.R7$(),A.Y8G("ngIf",t.showDelete))},dependencies:[C.t,O.Q,P.k,T.P,M.m,n.MD,n.bT,x.G,H.p,W.s,P.QZ,J.z,F.C,R.k,Z.J,Q.g,d.a,ee.$],encapsulation:2})},25024:(e,t,i)=>{"use strict";i.d(t,{D:()=>u});var n=i(74208),r=i(33277),s=i(94573),o=i(33812),a=i(37115),l=i(69855),c=i(50700);const d=new n.nKC("CopyClickListener");class u{constructor(e,t,i,n){this.platformUtilsService=e,this.toastService=t,this.i18nService=i,this.copyListener=n,this._showToast=(0,r.EW)(()=>void 0!==this.showToast()),this.toastVariant=(0,r.EW)(()=>{const e=this.showToast();return""===e||void 0===e?"success":e}),this.valueToCopy=(0,s.hFB)("",{alias:"appCopyClick"}),this.valueLabel=(0,s.hFB)(),this.showToast=(0,s.hFB)()}onClick(){const e=this.valueToCopy();if(this.platformUtilsService.copyToClipboard(e),this.copyListener&&this.copyListener.onCopy(e),this._showToast()){const e=this.valueLabel(),t=e?this.i18nService.t("valueCopied",e):this.i18nService.t("copySuccessful");this.toastService.showToast({variant:this.toastVariant(),message:t})}}}u.ɵfac=function(e){return new(e||u)(o.rXU(a.y),o.rXU(l.f),o.rXU(c.W),o.rXU(d,8))},u.ɵdir=o.FsC({type:u,selectors:[["","appCopyClick",""]],hostBindings:function(e,t){1&e&&o.bIt("click",function(){return t.onClick()})},inputs:{valueToCopy:[1,"appCopyClick","valueToCopy"],valueLabel:[1,"valueLabel"],showToast:[1,"showToast"]}})},25065:(e,t,i)=>{"use strict";i.d(t,{G:()=>n.G});var n=i(62963)},25156:()=>{},25219:(e,t,i)=>{"use strict";i.d(t,{i:()=>y});var n=i(33812),r=i(77468),s=i(80378),o=i(6056),a=i(47696),l=i(58384),c=i(67379);class d{}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=n.VBU({type:d,selectors:[["bit-card-content"]],ngContentSelectors:["*"],decls:2,vars:0,consts:[[1,"tw-p-4","[@media(min-width:650px)]:tw-p-6"]],template:function(e,t){1&e&&(n.NAR(),n.rj2(0,"div",0),n.SdG(1),n.eux())},encapsulation:2});var u=i(37856),h=i(88016);const p=e=>({"tw-grayscale":e});function m(e,t){1&e&&n.nrm(0,"app-premium-badge",8)}function v(e,t){1&e&&(n.j41(0,"span",9),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"upgrade")," "))}class f{get disabled(){return this.variant!=s.C.Enabled}get requiresPremium(){return this.variant==s.C.RequiresPremium}get requiresUpgrade(){return this.variant==s.C.RequiresUpgrade}}function g(e,t){if(1&e&&(n.j41(0,"div"),n.nrm(1,"app-report-card",2),n.nI1(2,"i18n"),n.nI1(3,"i18n"),n.k0s()),2&e){const e=t.$implicit;n.R7$(),n.Y8G("title",n.bMT(2,5,e.title))("description",n.bMT(3,7,e.description))("route",e.route)("variant",e.variant)("icon",e.icon)}}f.ɵfac=function(e){return new(e||f)},f.ɵcmp=n.VBU({type:f,selectors:[["app-report-card"]],inputs:{title:"title",description:"description",route:"route",icon:"icon",variant:"variant"},standalone:!1,decls:12,vars:11,consts:[[1,"tw-block","tw-h-full","tw-max-w-72","tw-rounded-xl","!tw-text-main","tw-transition-all","hover:tw-scale-105","hover:tw-no-underline","focus:tw-outline-none","focus:tw-ring","focus:tw-ring-primary-700","focus:tw-ring-offset-2",3,"routerLink"],[1,"tw-relative","tw-overflow-hidden","tw-h-full"],[1,"tw-flex","tw-h-28","tw-bg-background-alt2","tw-text-center","tw-text-primary-300",3,"ngClass"],[1,"tw-m-auto","tw-size-20","tw-content-center"],["aria-hidden","true",3,"icon"],[3,"ngClass"],[1,"tw-mb-4","tw-text-xl","tw-font-medium"],[1,"tw-mb-0"],[1,"tw-absolute","tw-left-2","tw-top-2"],["bitBadge","","variant","primary",1,"tw-absolute","tw-left-2","tw-top-2"]],template:function(e,t){1&e&&(n.j41(0,"a",0)(1,"bit-base-card",1)(2,"div",2)(3,"div",3),n.nrm(4,"bit-icon",4),n.k0s()(),n.j41(5,"bit-card-content",5)(6,"h3",6),n.EFF(7),n.k0s(),n.j41(8,"p",7),n.EFF(9),n.k0s()(),n.nVh(10,m,1,0,"app-premium-badge",8)(11,v,3,3,"span",9),n.k0s()()),2&e&&(n.Y8G("routerLink",t.route),n.R7$(2),n.Y8G("ngClass",n.eq3(7,p,t.disabled)),n.R7$(2),n.Y8G("icon",t.icon),n.R7$(),n.Y8G("ngClass",n.eq3(9,p,t.disabled)),n.R7$(2),n.JRh(t.title),n.R7$(2),n.JRh(t.description),n.R7$(),n.vxM(t.requiresPremium?10:t.requiresUpgrade?11:-1))},dependencies:[r.YU,o.Wk,a.n,l.i,c.f,d,u.a,h.$],encapsulation:2});class y{}y.ɵfac=function(e){return new(e||y)},y.ɵcmp=n.VBU({type:y,selectors:[["app-report-list"]],inputs:{reports:"reports"},standalone:!1,decls:2,vars:1,consts:[[1,"tw-inline-grid","tw-place-items-stretch","tw-place-content-center","tw-grid-cols-1","@xl:tw-grid-cols-2","@4xl:tw-grid-cols-3","tw-gap-4","[&_a]:tw-max-w-none","@5xl:[&_a]:tw-max-w-72"],[4,"ngFor","ngForOf"],[3,"title","description","route","variant","icon"]],template:function(e,t){1&e&&(n.j41(0,"div",0),n.DNE(1,g,4,9,"div",1),n.k0s()),2&e&&(n.R7$(),n.Y8G("ngForOf",t.reports))},dependencies:[r.Sq,f,h.$],encapsulation:2})},25279:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{}},25304:(e,t,i)=>{"use strict";i.d(t,{FG:()=>a,YY:()=>o,iP:()=>r,xN:()=>s});var n=i(23549);const r=Object.freeze(Object.keys(n._z)),s=Object.freeze(Object.keys(n.D0)),o={[n._z.forwarder]:{id:n._z.forwarder,availableFields:[n.D0.baseUrl,n.D0.domain,n.D0.prefix,n.D0.token]}},a=Object.freeze(Object.values(n.aX))},25607:(e,t,i)=>{"use strict";i.d(t,{i:()=>r});var n=i(20702);class r extends n.r{constructor(e){var t;super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.type=this.getResponseProperty("Type"),this.data=this.getResponseProperty("Data"),this.enabled=this.getResponseProperty("Enabled"),this.canToggleState=null===(t=this.getResponseProperty("CanToggleState"))||void 0===t||t,this.revisionDate=this.getResponseProperty("RevisionDate")}}},25740:(e,t,i)=>{"use strict";i.d(t,{$:()=>s});var n=i(33812),r=i(50700);class s{constructor(e){this.i18nService=e}transform(e,t,i,n){return this.i18nService.t(e,t,i,n)}}s.ɵfac=function(e){return new(e||s)(n.rXU(r.W,16))},s.ɵpipe=n.EJ8({name:"i18n",type:s,pure:!0})},26038:(e,t,i)=>{"use strict";i.d(t,{Z:()=>l});var n=i(48479),r=i(84079),s=i(93695),o=i(37567),a=i(78781);function l(e){let t;try{t=e()}catch(i){return(0,o.$)(()=>i)}return a.A.isPromise(t)?(0,r.H)(t):t instanceof n.c?t:(0,s.of)(t)}},26061:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 10 71.27 66.67">
    <path class="tw-fill-illustration-bg-primary" d="M19.6 14.8a4.8 4.8 0 0 1 4.8-4.8h45.4a4.8 4.8 0 0 1 4.8 4.8v32.067a4.8 4.8 0 0 1-4.8 4.8H24.4a4.8 4.8 0 0 1-4.8-4.8V14.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M69.8 11.6H24.4a3.2 3.2 0 0 0-3.2 3.2v32.067a3.2 3.2 0 0 0 3.2 3.2h45.4a3.2 3.2 0 0 0 3.2-3.2V14.8a3.2 3.2 0 0 0-3.2-3.2ZM24.4 10a4.8 4.8 0 0 0-4.8 4.8v32.067a4.8 4.8 0 0 0 4.8 4.8h45.4a4.8 4.8 0 0 0 4.8-4.8V14.8a4.8 4.8 0 0 0-4.8-4.8H24.4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M73.767 19.966H20.434v-1.6h53.333v1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M71.267 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM66.267 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM61.267 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M67.2 50.4c0 7.29-5.91 13.2-13.2 13.2-7.29 0-13.2-5.91-13.2-13.2 0-7.29 5.91-13.2 13.2-13.2 7.29 0 13.2 5.91 13.2 13.2Z"/>
    <path class="tw-fill-illustration-tertiary" d="M46.235 47.977a2.236 2.236 0 0 1 2.236-2.236h11.057a2.236 2.236 0 0 1 2.236 2.236v7.952a2.236 2.236 0 0 1-2.236 2.236H48.471a2.236 2.236 0 0 1-2.236-2.236v-7.952Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.528 47.232H48.471a.745.745 0 0 0-.745.745v7.952c0 .411.334.745.745.745h11.057a.745.745 0 0 0 .746-.745v-7.952a.745.745 0 0 0-.746-.745Zm-11.057-1.49a2.236 2.236 0 0 0-2.236 2.235v7.952a2.236 2.236 0 0 0 2.236 2.236h11.057a2.236 2.236 0 0 0 2.236-2.236v-7.952a2.236 2.236 0 0 0-2.236-2.236H48.471Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M53.223 50.4a.776.776 0 1 1 1.553 0v3.105a.776.776 0 1 1-1.553 0V50.4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50.148 44.965a3.851 3.851 0 0 1 7.703 0v.776h-1.49v-.776a2.36 2.36 0 1 0-4.722 0v.776h-1.49v-.776Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M7.5 25.767a1.6 1.6 0 0 1 1.6-1.6h12.633a1.6 1.6 0 0 1 1.6 1.6v12.567H7.5V25.767Z"/>
    <path class="tw-fill-illustration-tertiary" d="M10 26.667h2.5v9.167H10v-9.167ZM14.167 28.333h2.5v7.5h-2.5v-7.5ZM18.333 26.667h2.5v9.167h-2.5v-9.167Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M6.533 36.667a3.2 3.2 0 0 0-3.2 3.2v33.6a3.2 3.2 0 0 0 3.2 3.2H24.3a3.2 3.2 0 0 0 3.2-3.2v-33.6a3.2 3.2 0 0 0-3.2-3.2H6.533Zm8.884 30a2.083 2.083 0 1 1 0 4.167 2.083 2.083 0 0 1 0-4.167Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M6.533 38.267a1.6 1.6 0 0 0-1.6 1.6v33.6a1.6 1.6 0 0 0 1.6 1.6H24.3a1.6 1.6 0 0 0 1.6-1.6v-33.6a1.6 1.6 0 0 0-1.6-1.6H6.533Zm8.884 26.8a3.683 3.683 0 1 1 0 7.367 3.683 3.683 0 0 1 0-7.367Zm-12.084-25.2a3.2 3.2 0 0 1 3.2-3.2H24.3a3.2 3.2 0 0 1 3.2 3.2v33.6a3.2 3.2 0 0 1-3.2 3.2H6.533a3.2 3.2 0 0 1-3.2-3.2v-33.6ZM17.5 68.75a2.083 2.083 0 1 0-4.167 0 2.083 2.083 0 0 0 4.167 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M15.417 60.066a6.317 6.317 0 1 0 0-12.633 6.317 6.317 0 0 0 0 12.633Zm0 1.6a7.917 7.917 0 1 0 0-15.833 7.917 7.917 0 0 0 0 15.833Z" clip-rule="evenodd"/>
  </svg>
`},26076:(e,t,i)=>{"use strict";i.d(t,{q:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){if(super(e),this.match=null,null==e)return;this.uri=this.getResponseProperty("Uri"),this.uriChecksum=this.getResponseProperty("UriChecksum");const t=this.getResponseProperty("Match");this.match=null!=t?t:null}}},26333:(e,t,i)=>{"use strict";i.d(t,{R:()=>F});var n=i(94573),r=i(74208),s=i(33277),o=i(83731),a=i(33338),l=i(3204),c=i(34040),d=i(12610),u=i(39444),h=i(36359),p=i(60276),m=i(29377),v=i(78781),f=i(7919),g=i(61325);var y=i(33812),b=i(77468);const w=(e,t)=>({"tw-invisible tw-absolute":e,"tw-size-6":t}),S=(e,t)=>({"tw-flex tw-items-center tw-justify-center":e,"tw-bg-illustration-bg-primary tw-rounded-full":t}),I=(e,t,i,n)=>({color:e,width:t,height:i,fontSize:n});function k(e,t){if(1&e){const e=y.RV6();y.j41(0,"img",4),y.bIt("load",function(){r.eBV(e);const t=y.XpG(2);return r.Njj(t.imageLoaded.set(!0))})("error",function(){r.eBV(e);const t=y.XpG(2);return r.Njj(t.imageLoaded.set(!1))}),y.k0s()}if(2&e){const e=y.XpG().ngIf,t=y.XpG();y.Y8G("src",e.image,y.B4B)("ngClass",y.l_i(3,w,!t.imageLoaded(),!t.coloredIcon()))("ngStyle",t.iconStyle())}}function C(e,t){if(1&e&&(y.j41(0,"div",3),y.nrm(1,"i",5),y.k0s()),2&e){const e=y.XpG().ngIf,t=y.XpG();y.Y8G("ngClass",y.l_i(6,S,t.coloredIcon(),(null==e.icon?null:e.icon.startsWith("bwi-"))&&t.coloredIcon()))("ngStyle",t.iconStyle()),y.R7$(),y.HbH(y.VkB("tw-text-muted bwi bwi-lg ",e.icon)),y.Y8G("ngStyle",y.ziG(9,I,t.coloredIcon()?"rgb(var(--color-illustration-outline))":null,null!=e.icon&&e.icon.startsWith("credit-card")&&t.coloredIcon()?"36px":null,null!=e.icon&&e.icon.startsWith("credit-card")&&t.coloredIcon()?"30px":null,t.size()?t.size()+"px":null))}}function T(e,t){if(1&e&&(y.qex(0),y.nVh(1,k,1,6,"img",2),y.nVh(2,C,2,14,"div",3),y.bVm()),2&e){const e=t.ngIf,i=y.XpG();y.R7$(),y.vxM(e.imageEnabled&&e.image?1:-1),y.R7$(),y.vxM(e.imageEnabled&&e.image&&i.imageLoaded()?-1:2)}}class F{constructor(e,t){this.environmentService=e,this.domainSettingsService=t,this.cipher=n.hFB.required(),this.coloredIcon=(0,n.hFB)(!1),this.size=(0,n.hFB)(),this.imageLoaded=(0,r.vPA)(!1),this.iconStyle=(0,s.EW)(()=>{if(this.coloredIcon())return{width:"36px",height:"36px"};const e=this.size();return e?{width:e+"px",height:e+"px"}:{}});const i=(0,a.z)([this.environmentService.environment$.pipe((0,l.T)(e=>e.getIconsUrl())),this.domainSettingsService.showFavicons$.pipe((0,c.F)())]).pipe((0,l.T)(([e,t])=>({iconsUrl:e,showFavicon:t})),(0,d.Z)({iconsUrl:null,showFavicon:!1}),(0,c.F)());this.data$=(0,a.z)([i,(0,o.br)(this.cipher)]).pipe((0,l.T)(([{iconsUrl:e,showFavicon:t},i])=>function(e,t,i){let n="bwi-globe",r=null,s="";const o={Visa:"card-visa",Mastercard:"card-mastercard",Amex:"card-amex",Discover:"card-discover","Diners Club":"card-diners-club",JCB:"card-jcb",Maestro:"card-maestro",UnionPay:"card-union-pay",RuPay:"card-ru-pay"};null==e&&(i=!1);const a=g.n.getType(t),l=g.n.uri(t),c=g.n.getCard(t);switch(a){case f.gC.Login:if(n="bwi-globe",l){let t=l,n=!1;if(0===t.indexOf("androidapp://")||0===t.indexOf("iosapp://")?r=null:i&&-1===t.indexOf("://")&&t.indexOf(".")>-1?(t=`http://${t}`,n=!0):i&&(n=0===t.indexOf("http")&&t.indexOf(".")>-1),n&&(t.endsWith(".onion")||t.endsWith(".i2p"))){r=null,s="images/bwi-globe.png";break}if(i&&n)try{r=`${e}/${v.A.getHostname(t)}/icon.png`,s="images/bwi-globe.png"}catch(d){}}else r=null;break;case f.gC.SecureNote:n="bwi-sticky-note";break;case f.gC.Card:n="bwi-credit-card",i&&(null==c?void 0:c.brand)&&c.brand in o&&(n=`credit-card-icon ${o[c.brand]}`);break;case f.gC.Identity:n="bwi-id-card";break;case f.gC.SshKey:n="bwi-key"}return{imageEnabled:i,image:r,fallbackImage:s,icon:n}}(e,i,t)),(0,d.Z)(null),(0,u.J)(),(0,h.M)(([e,t])=>{(null==e?void 0:e.image)!==(null==t?void 0:t.image)&&this.imageLoaded.set(!1)}),(0,l.T)(([e,t])=>t))}}F.ɵfac=function(e){return new(e||F)(y.rXU(m.v),y.rXU(p.V))},F.ɵcmp=y.VBU({type:F,selectors:[["app-vault-icon"]],inputs:{cipher:[1,"cipher"],coloredIcon:[1,"coloredIcon"],size:[1,"size"]},standalone:!1,decls:3,vars:4,consts:[["aria-hidden","true",1,"tw-flex","tw-justify-center","tw-items-center",3,"ngStyle"],[4,"ngIf"],["alt","","decoding","async","loading","lazy",1,"tw-rounded-md",3,"src","ngClass","ngStyle"],[3,"ngClass","ngStyle"],["alt","","decoding","async","loading","lazy",1,"tw-rounded-md",3,"load","error","src","ngClass","ngStyle"],[3,"ngStyle"]],template:function(e,t){1&e&&(y.j41(0,"div",0),y.DNE(1,T,3,2,"ng-container",1),y.nI1(2,"async"),y.k0s()),2&e&&(y.Y8G("ngStyle",t.iconStyle()),y.R7$(),y.Y8G("ngIf",y.bMT(2,2,t.data$)))},dependencies:[b.YU,b.bT,b.B3,b.Jj],encapsulation:2,changeDetection:0})},26411:(e,t,i)=>{"use strict";i.d(t,{L:()=>c});var n=i(89033),r=i(89479),s=i(61465),o=i(43759),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[n.c,r.x,s.i,o.h,n.c,r.x,s.i]})},26477:(e,t,i)=>{"use strict";i.d(t,{V:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},26657:(e,t,i)=>{"use strict";i.d(t,{$:()=>c});var n=i(94573),r=i(83731),s=i(33812),o=i(53100),a=i(45154),l=i(3892);class c{constructor(e,t,i){this.type=(0,n.hFB)(),this.disabled=(0,n.hFB)(),t&&e&&(t.loading$.pipe((0,r.pQ)()).subscribe(t=>{"submit"===this.type()?e.loading.set(t):e.disabled.set(this.disabled()||t)}),t.disabled$.pipe((0,r.pQ)()).subscribe(t=>{const i=this.disabled();!1!==i&&e.disabled.set(i||t)})),t&&i&&(i.loading$.pipe((0,r.pQ)()).subscribe(e=>{t.disabled=e}),t.disabled$.pipe((0,r.pQ)()).subscribe(e=>{i.disabled=e}))}}c.ɵfac=function(e){return new(e||c)(s.rXU(o.E),s.rXU(a.L,8),s.rXU(l.p,8))},c.ɵdir=s.FsC({type:c,selectors:[["button","bitFormButton",""]],inputs:{type:[1,"type"],disabled:[1,"disabled"]}})},27197:(e,t,i)=>{"use strict";i.d(t,{fA:()=>N,L0:()=>s,aI:()=>I,oE:()=>C,Ew:()=>E,hV:()=>P,u3:()=>U,yB:()=>T.y});var n=i(347),r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s extends n.kg{constructor(e,t,i,n,r){super(e,t,i),this.keyService=e,this.masterPasswordApiService=t,this.masterPasswordService=i,this.userKeyRotationService=n,this.routerService=r}rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n){return r(this,void 0,void 0,function*(){yield this.userKeyRotationService.rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n)})}clearDeeplinkState(){return r(this,void 0,void 0,function*(){yield this.routerService.getAndClearLoginRedirectUrl()})}}var o=i(81285),a=i(29377),l=i(56962),c=i(71373),d=i(51971),u=i(74208),h=i(52717),p=i(27866),m=i(18499),v=i(45872),f=i(37115),g=i(86214),y=i(23649),b=i(35500),w=i(1601),S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class I extends o.nF{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h){super(s,o,a,l,c),this.organizationInviteService=e,this.logService=t,this.policyApiService=i,this.policyService=n,this.routerService=r,this.router=d,this.accountService=u,this.configService=h}redirectToSso(e,t,i,n){return S(this,void 0,void 0,function*(){yield this.router.navigate(["/sso"],{queryParams:{identifier:n}})})}getOrgPoliciesFromOrgInvite(e){return S(this,void 0,void 0,function*(){const t=yield this.organizationInviteService.getOrganizationInvite();if(null!=t){if(t.email!==e.toLowerCase())return yield this.routerService.getAndClearLoginRedirectUrl(),yield this.organizationInviteService.clearOrganizationInvitation(),void this.logService.error(`WebLoginComponentService.getOrgPoliciesFromOrgInvite: Email mismatch. Expected: ${t.email}, Received: ${e}`);let n;try{n=yield this.policyApiService.getPoliciesByToken(t.organizationId,t.token,t.email,t.organizationUserId)}catch(i){this.logService.error(i)}if(null==n)return;const r=this.policyService.getResetPasswordPolicyOptions(n,t.organizationId);return{policies:n,isPolicyAndAutoEnrollEnabled:r[1]&&r[0].autoEnrollEnabled,enforcedPasswordPolicyOptions:this.policyService.combinePoliciesIntoMasterPasswordPolicyOptions(n)}}})}}I.ɵfac=function(e){return new(e||I)(u.KVO(h.i),u.KVO(l.K),u.KVO(p.m),u.KVO(m.N),u.KVO(d.H),u.KVO(v.R),u.KVO(a.v),u.KVO(c.JJ),u.KVO(f.y),u.KVO(g._),u.KVO(y.Ix),u.KVO(b.Di),u.KVO(w.w))},I.ɵprov=u.jDH({token:I,factory:I.ɵfac});var k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C extends o.dl{constructor(e,t,i){super(e),this.messagingService=e,this.routerService=t,this.organizationInviteService=i}handleCreateUserSuccess(){return k(this,void 0,void 0,function*(){try{yield this.routerService.getAndClearLoginRedirectUrl(),yield this.organizationInviteService.clearOrganizationInvitation()}catch(e){throw new Error(e)}})}}var T=i(29096),F=i(35185),R=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class P extends F.K{constructor(e,t,i,n,r,s,o,a,l,c,d,u){super(e,t,i,n,r,s,o,a,l,c),this.apiService=e,this.encryptService=t,this.i18nService=i,this.kdfConfigService=n,this.keyService=r,this.masterPasswordApiService=s,this.masterPasswordService=o,this.organizationApiService=a,this.organizationUserApiService=l,this.userDecryptionOptionsService=c,this.organizationInviteService=d,this.routerService=u}setInitialPassword(e,t,i){const n=Object.create(null,{setInitialPassword:{get:()=>super.setInitialPassword}});return R(this,void 0,void 0,function*(){yield n.setInitialPassword.call(this,e,t,i),yield this.routerService.getAndClearLoginRedirectUrl(),yield this.organizationInviteService.clearOrganizationInvitation()})}}var x=i(72245),$=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class E extends o.v2{constructor(e,t,i,n,r,s){super(e,t),this.keyService=e,this.accountApiService=t,this.organizationInviteService=i,this.policyApiService=n,this.logService=r,this.policyService=s}getOrgNameFromOrgInvite(){return $(this,void 0,void 0,function*(){const e=yield this.organizationInviteService.getOrganizationInvite();return null==e?null:e.organizationName})}getMasterPasswordPolicyOptsFromOrgInvite(){return $(this,void 0,void 0,function*(){const e=yield this.organizationInviteService.getOrganizationInvite();if(null==e)return null;let t=null;try{t=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId)}catch(i){this.logService.error(i)}if(null==t)return null;return yield(0,x._)(this.policyService.masterPasswordPolicyOptions$(null,t))})}buildRegisterRequest(e,t,i,n,r,s,o,a,l,c){const d=Object.create(null,{buildRegisterRequest:{get:()=>super.buildRegisterRequest}});return $(this,void 0,void 0,function*(){const u=yield d.buildRegisterRequest.call(this,e,t,i,n,r),h=yield this.organizationInviteService.getOrganizationInvite();return null!=h&&(u.organizationUserId=h.organizationUserId,u.orgInviteToken=h.token),s&&(u.orgSponsoredFreeFamilyPlanToken=s),o&&a&&(u.acceptEmergencyAccessInviteToken=o,u.acceptEmergencyAccessId=a),l&&c&&(u.providerInviteToken=l,u.providerUserId=c),u})}}var A=i(31436),D=i(3204),O=i(3097),M=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class U{constructor(e){this.platformUtilsService=e;const t=new BroadcastChannel("duoResult");this.duo2faResult$=(0,A.R)(t,"message").pipe((0,D.T)(e=>({code:e.data.code,state:e.data.state,token:`${e.data.code}|${e.data.state}`})),(0,O.u)())}listenForDuo2faResult$(){return this.duo2faResult$}launchDuoFrameless(e){return M(this,void 0,void 0,function*(){this.platformUtilsService.launchUri(e)})}}var G=i(78781),j=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class N{constructor(e,t,i,n,r,s){this.ssoLoginService=e,this.apiService=t,this.cryptoFunctionService=i,this.environmentService=n,this.passwordGenerationService=r,this.platformUtilsService=s}linkSso(e){return j(this,void 0,void 0,function*(){if(null==e||""===e)throw new Error("SSO identifier is required");const t=window.location.origin+"/sso-connector.html",i=yield this.apiService.preValidateSso(e),n={type:"password",length:64,uppercase:!0,lowercase:!0,number:!0,special:!1},r=yield this.passwordGenerationService.generatePassword(n),s=yield this.cryptoFunctionService.hash(r,"sha256"),o=G.A.fromBufferToUrlB64(s);yield this.ssoLoginService.setCodeVerifier(r);let a=yield this.passwordGenerationService.generatePassword(n);a+="_returnUri='/settings/organizations'",a+=`_identifier=${e}`,yield this.ssoLoginService.setSsoState(a);let l=(yield(0,x._)(this.environmentService.environment$)).getIdentityUrl()+"/connect/authorize?client_id=web&redirect_uri="+encodeURIComponent(t)+"&response_type=code&scope=api offline_access&state="+a+"&code_challenge="+o+"&code_challenge_method=S256&response_mode=query&domain_hint="+encodeURIComponent(e)+"&ssoToken="+encodeURIComponent(i.token);const c=yield this.apiService.getSsoUserIdentifier();l+=`&user_identifier=${encodeURIComponent(c)}`,this.platformUtilsService.launchUri(l,{sameWindow:!0})})}}},27280:(e,t,i)=>{"use strict";i.d(t,{e:()=>r});var n=i(31442);class r{constructor(e){this.type=n.ak.Generic,null!=e&&(this.type=e.type)}}},27485:(e,t,i)=>{"use strict";i.d(t,{gY:()=>Ae,PD:()=>$e,TT:()=>Ee});var n=i(81525),r=i(77468),s=i(74208),o=i(81573),a=i(29029),l=i(98221),c=i(45482),d=i(60989),u=i(94573),h=i(33277),p=i(83731),m=i(75811),v=i(93695),f=i(58412),g=i(65731),y=i(25065),b=i(33812),w=i(50700),S=i(3160),I=i(69855),k=i(36288),C=i(59032),T=i(58806),F=i(88016);function R(e,t){if(1&e){const e=b.RV6();b.j41(0,"billing-pricing-card",12),b.bIt("buttonClick",function(){s.eBV(e);const t=b.XpG(2);return s.Njj(t.planSelected.emit(t.premiumPlanType))}),b.j41(1,"h3",13),b.EFF(2),b.k0s()()}if(2&e){const e=b.XpG(2);b.Y8G("tagline",e.premiumCardDetails.tagline)("price",e.premiumCardDetails.price)("button",e.premiumCardDetails.button)("features",e.premiumCardDetails.features),b.R7$(2),b.SpI(" ",e.premiumCardDetails.title," ")}}function P(e,t){if(1&e){const e=b.RV6();b.j41(0,"billing-pricing-card",12),b.bIt("buttonClick",function(){s.eBV(e);const t=b.XpG(2);return s.Njj(t.planSelected.emit(t.familiesPlanType))}),b.j41(1,"h3",13),b.EFF(2),b.k0s()()}if(2&e){const e=b.XpG(2);b.Y8G("tagline",e.familiesCardDetails.tagline)("price",e.familiesCardDetails.price)("button",e.familiesCardDetails.button)("features",e.familiesCardDetails.features),b.R7$(2),b.SpI(" ",e.familiesCardDetails.title," ")}}function x(e,t){if(1&e){const e=b.RV6();b.j41(0,"button",14),b.bIt("click",function(){s.eBV(e);const t=b.XpG(2);return s.Njj(t.closeClicked.emit(t.closeStatus))}),b.EFF(1),b.nI1(2,"i18n"),b.k0s()}2&e&&(b.R7$(),b.SpI(" ",b.bMT(2,1,"continueWithoutUpgrading")," "))}function $(e,t){if(1&e){const e=b.RV6();b.j41(0,"section",0)(1,"header",1)(2,"button",2),b.nI1(3,"i18n"),b.bIt("click",function(){s.eBV(e);const t=b.XpG();return s.Njj(t.closeClicked.emit(t.closeStatus))}),b.k0s()(),b.j41(4,"div",3)(5,"div",4)(6,"h1",5),b.EFF(7),b.nI1(8,"i18n"),b.k0s(),b.j41(9,"p",6),b.EFF(10),b.nI1(11,"i18n"),b.k0s()(),b.j41(12,"div",7),b.nVh(13,R,3,5,"billing-pricing-card",8),b.nVh(14,P,3,5,"billing-pricing-card",8),b.k0s(),b.j41(15,"div",9)(16,"p",10),b.EFF(17),b.nI1(18,"i18n"),b.k0s(),b.nVh(19,x,3,3,"button",11),b.k0s()()()}if(2&e){const e=b.XpG();b.R7$(2),b.Y8G("label",b.bMT(3,7,"close")),b.R7$(5),b.SpI(" ",b.bMT(8,9,e.dialogTitle())," "),b.R7$(3),b.SpI(" ",b.bMT(11,11,"individualUpgradeDescriptionMessage")," "),b.R7$(3),b.vxM(e.premiumCardDetails?13:-1),b.R7$(),b.vxM(e.familiesCardDetails?14:-1),b.R7$(3),b.SpI(" ",b.bMT(18,13,"individualUpgradeTaxInformationMessage")," "),b.R7$(2),b.vxM(e.hideContinueWithoutUpgradingButton()?-1:19)}}const E="closed";class A{constructor(e,t,i,n){this.i18nService=e,this.subscriptionPricingService=t,this.toastService=i,this.destroyRef=n,this.dialogTitleMessageOverride=(0,u.hFB)(null),this.hideContinueWithoutUpgradingButton=(0,u.hFB)(!1),this.planSelected=(0,u.CGW)(),this.closeClicked=(0,u.CGW)(),this.loading=(0,s.vPA)(!0),this.familiesPlanType=f.OU.Families,this.premiumPlanType=f.OU.Premium,this.closeStatus=E,this.dialogTitle=(0,h.EW)(()=>this.dialogTitleMessageOverride()||"individualUpgradeWelcomeMessage")}ngOnInit(){this.subscriptionPricingService.getPersonalSubscriptionPricingTiers$().pipe((0,m.W)(e=>(this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("unexpectedError")}),this.loading.set(!1),(0,v.of)([]))),(0,p.pQ)(this.destroyRef)).subscribe(e=>{this.setupCardDetails(e),this.loading.set(!1)})}setupCardDetails(e){const t=e.find(e=>e.id===f.OU.Premium),i=e.find(e=>e.id===f.OU.Families);t&&(this.premiumCardDetails=this.createCardDetails(t,"primary")),i&&(this.familiesCardDetails=this.createCardDetails(i,"secondary"))}createCardDetails(e,t){return{title:e.name,tagline:e.description,price:e.passwordManager.annualPrice?{amount:e.passwordManager.annualPrice/12,cadence:f.fQ.Monthly}:void 0,button:{text:this.i18nService.t(this.isFamiliesPlan(e.id)?"startFreeFamiliesTrial":"upgradeToPremium"),type:t},features:e.passwordManager.features.map(e=>e.value)}}isFamiliesPlan(e){return e===f.OU.Families}}A.ɵfac=function(e){return new(e||A)(b.rXU(w.W),b.rXU(S.z),b.rXU(I.f),b.rXU(s.abz))},A.ɵcmp=b.VBU({type:A,selectors:[["app-upgrade-account"]],inputs:{dialogTitleMessageOverride:[1,"dialogTitleMessageOverride"],hideContinueWithoutUpgradingButton:[1,"hideContinueWithoutUpgradingButton"]},outputs:{planSelected:"planSelected",closeClicked:"closeClicked"},decls:1,vars:1,consts:[["cdkTrapFocus","","cdkTrapFocusAutoCapture","",1,"tw-w-screen","tw-max-h-screen","tw-min-w-[332px]","md:tw-max-w-4xl","tw-overflow-y-auto","tw-self-center","tw-bg-background","tw-rounded-xl","tw-shadow-lg","tw-border-secondary-100","tw-border-solid","tw-border"],[1,"tw-flex","tw-items-center","tw-justify-end","tw-pl-6","tw-pt-3","tw-pr-2"],["type","button","bitIconButton","bwi-close","buttonType","main","size","default",3,"click","label"],[1,"tw-px-14","tw-pb-8"],[1,"tw-flex","tw-text-center","tw-flex-col","tw-pb-4"],[1,"tw-font-medium","tw-text-[32px]"],["bitTypography","body1",1,"tw-text-muted"],[1,"tw-grid","tw-grid-cols-1","sm:tw-grid-cols-2","tw-gap-5","tw-mb-4"],[1,"tw-w-full","tw-min-w-[216px]","tw-max-w-[456px]",3,"tagline","price","button","features"],[1,"tw-text-center","tw-w-full"],["bitTypography","helper",1,"tw-text-muted","tw-italic"],["bitLink","","linkType","primary","type","button"],[1,"tw-w-full","tw-min-w-[216px]","tw-max-w-[456px]",3,"buttonClick","tagline","price","button","features"],["slot","title","bitTypography","h3",1,"tw-m-0"],["bitLink","","linkType","primary","type","button",3,"click"]],template:function(e,t){1&e&&b.nVh(0,$,20,15,"section",0),2&e&&b.vxM(t.loading()?-1:0)},dependencies:[r.MD,o.P,y.G,k.s,C.o,T.r,c.IJ,g.Y2,d.kB,F.$],encapsulation:2});var D=i(44500),O=i(55159),M=i(1035),U=i(68395),G=i(3204),j=i(67553),N=i(84488),V=i(3633),B=i(88083),z=i(82468),L=i(39488),K=i(90107),q=i(14055),_=i(31925),X=i(58605),Y=i(35500),H=i(1601),W=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class J{constructor(e,t,i,n,r,s,o,a,l){this.organizationBillingService=e,this.accountBillingClient=t,this.taxClient=i,this.logService=n,this.syncService=r,this.organizationService=s,this.accountService=o,this.subscriberBillingClient=a,this.configService=l,this.userIsOwnerOfFreeOrg$=this.accountService.activeAccount$.pipe(V.F6,(0,D.n)(e=>this.organizationService.organizations$(e)),(0,O.Z)(e=>e),(0,M.I)(e=>e.isFreeOrg&&e.isOwner),(0,U.U)(!1),(0,G.T)(e=>e instanceof N.y)),this.adminConsoleRouteForOwnedOrganization$=this.accountService.activeAccount$.pipe(V.F6,(0,D.n)(e=>this.organizationService.organizations$(e)),(0,O.Z)(e=>e),(0,M.I)(e=>e.isFreeOrg&&e.isOwner),(0,G.T)(e=>`/organizations/${e.id}/billing/subscription`)),this.accountCredit$=this.accountService.activeAccount$.pipe(_.$i,(0,D.n)(e=>this.subscriberBillingClient.getCredit(e)))}calculateEstimatedTax(e,t){return W(this,void 0,void 0,function*(){const i=e.tier===f.OU.Families,n=e.tier===f.OU.Premium;let r=null;if(i){const e={tier:"families",cadence:"annually",passwordManager:{seats:1,additionalStorage:0,sponsored:!1}};r=this.taxClient.previewTaxForOrganizationSubscriptionPurchase(e,t)}if(n&&(r=this.taxClient.previewTaxForPremiumSubscriptionPurchase(0,t)),null===r)throw new Error("Tax client call is not defined");try{return(yield r).tax}catch(s){throw this.logService.error("Tax calculation failed:",s),s}})}upgradeToPremium(e,t){return W(this,void 0,void 0,function*(){this.validatePaymentAndBillingInfo(e,t),yield this.accountBillingClient.purchasePremiumSubscription(e,t),yield this.refreshAndSync()})}upgradeToFamilies(e,t,i,n){return W(this,void 0,void 0,function*(){const r=n.billingAddress;if(!n.organizationName)throw new Error("Organization name is required for families upgrade");this.validatePaymentAndBillingInfo(i,r);const s=this.getPasswordManagerSeats(t),o=(yield this.configService.getFeatureFlag(z.TO.PM26462_Milestone_3))?B.OL.FamiliesAnnually:B.OL.FamiliesAnnually2025,a={organization:{name:n.organizationName,billingEmail:e.email},plan:{type:o,passwordManagerSeats:s},payment:{paymentMethod:[i.token,this.getPaymentMethodType(i)],billing:{country:r.country,postalCode:r.postalCode}}},l=yield this.organizationBillingService.purchaseSubscription(a,e.id);return yield this.refreshAndSync(),l})}getPasswordManagerSeats(e){return"users"in e.details.passwordManager&&e.details.passwordManager.users?e.details.passwordManager.users:0}validatePaymentAndBillingInfo(e,t){if(!(null==e?void 0:e.type))throw new Error("Payment method type is missing");if(e.type!==q.mv.accountCredit&&!(null==e?void 0:e.token))throw new Error("Payment method token is missing");if(!(null==t?void 0:t.country)||!(null==t?void 0:t.postalCode))throw new Error("Billing address information is incomplete")}refreshAndSync(){return W(this,void 0,void 0,function*(){yield this.syncService.fullSync(!0)})}getPaymentMethodType(e){return e.type===q.mv.accountCredit?B.eq.Credit:(0,q.x$)(e.type)}}J.ɵfac=function(e){return new(e||J)(s.KVO(X.Y),s.KVO(l.cH),s.KVO(l.jZ),s.KVO(K.Kc),s.KVO(L.H),s.KVO(j.PV),s.KVO(Y.Di),s.KVO(l.Hd),s.KVO(H.w))},J.ɵprov=s.jDH({token:J,factory:J.ɵfac});var Z=i(51757),Q=i(12610),ee=i(36006),te=i(33338),ie=i(27442),ne=i(84079),re=i(63734),se=i(7730),oe=i(68016),ae=i(6056),le=i(26657),ce=i(45154),de=i(56898),ue=i(44432),he=i(86226),pe=i(97553),me=i(43759),ve=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const fe=()=>({type:"checkout",supportsTaxId:!1});function ge(e,t){if(1&e&&(b.j41(0,"div",16)(1,"bit-callout",21),b.EFF(2),b.nI1(3,"i18n"),b.j41(4,"a",22),b.nI1(5,"async"),b.EFF(6),b.nI1(7,"i18n"),b.nrm(8,"i",23),b.k0s()()()),2&e){const e=b.XpG(2);b.R7$(2),b.SpI(" ",b.bMT(3,3,"formWillCreateNewFamiliesOrgMessage")," "),b.R7$(2),b.Y8G("routerLink",b.bMT(5,5,e.adminConsoleRouteForOwnedOrganization$)),b.R7$(2),b.SpI(" ",b.bMT(7,7,"upgradeNow")," ")}}function ye(e,t){if(1&e&&(b.nVh(0,ge,9,9,"div",16),b.nI1(1,"async"),b.j41(2,"div",17)(3,"bit-form-field",18)(4,"bit-label"),b.EFF(5),b.nI1(6,"i18n"),b.k0s(),b.nrm(7,"input",19),b.k0s(),b.j41(8,"p",20),b.EFF(9),b.nI1(10,"i18n"),b.k0s()()),2&e){const e=b.XpG();b.vxM(b.bMT(1,3,e.userIsOwnerOfFreeOrg$)?0:-1),b.R7$(5),b.JRh(b.bMT(6,5,"organizationName")),b.R7$(4),b.SpI(" ",b.bMT(10,7,"organizationNameDescription")," ")}}function be(e,t){1&e&&(b.j41(0,"p",12),b.EFF(1),b.nI1(2,"i18n"),b.k0s()),2&e&&(b.R7$(),b.SpI(" ",b.bMT(2,1,"paymentChargedWithTrial")," "))}const we="closed",Se="upgradedToPremium",Ie="upgradedToFamilies";class ke{constructor(e,t,i,n,r,o){this.i18nService=e,this.subscriptionPricingService=t,this.toastService=i,this.logService=n,this.destroyRef=r,this.upgradePaymentService=o,this.INITIAL_TAX_VALUE=0,this.selectedPlanId=u.hFB.required(),this.account=u.hFB.required(),this.goBack=(0,u.CGW)(),this.complete=(0,u.CGW)(),this.paymentComponent=u.ebz.required(re.Pu),this.cartSummaryComponent=u.ebz.required(g.Oo),this.formGroup=new Z.gE({organizationName:new Z.MJ("",[Z.k0.required]),paymentForm:re.Pu.getFormGroup(),billingAddress:re.vU.getFormGroup()}),this.selectedPlan=(0,s.vPA)(null),this.loading=(0,s.vPA)(!0),this.upgradeToMessage=(0,s.vPA)(""),this.passwordManager=(0,h.EW)(()=>this.selectedPlan()?{name:this.isFamiliesPlan?"familiesMembership":"premiumMembership",cost:this.selectedPlan().details.passwordManager.annualPrice,quantity:1,cadence:"year"}:{name:"",cost:0,quantity:0,cadence:"year"}),this.userIsOwnerOfFreeOrg$=this.upgradePaymentService.userIsOwnerOfFreeOrg$,this.adminConsoleRouteForOwnedOrganization$=this.upgradePaymentService.adminConsoleRouteForOwnedOrganization$,this.submit=()=>ve(this,void 0,void 0,function*(){if(this.isFormValid()){if(!this.selectedPlan())throw new Error("No plan selected");try{const e=yield this.processUpgrade();e.status===Ie?this.toastService.showToast({variant:"success",message:this.i18nService.t("familiesUpdated")}):e.status===Se&&this.toastService.showToast({variant:"success",message:this.i18nService.t("premiumUpdated")}),this.complete.emit(e)}catch(e){this.logService.error("Upgrade failed:",e),this.toastService.showToast({variant:"error",message:this.i18nService.t("upgradeErrorMessage")})}}else this.formGroup.markAllAsTouched()})}ngOnInit(){return ve(this,void 0,void 0,function*(){this.isFamiliesPlan||this.formGroup.controls.organizationName.disable(),this.pricingTiers$=this.subscriptionPricingService.getPersonalSubscriptionPricingTiers$(),this.pricingTiers$.pipe((0,m.W)(e=>(this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:this.i18nService.t("unexpectedError")}),this.loading.set(!1),(0,v.of)([]))),(0,p.pQ)(this.destroyRef)).subscribe(e=>{const t=e.find(e=>e.id===this.selectedPlanId());t?(this.selectedPlan.set({tier:this.selectedPlanId(),details:t}),this.upgradeToMessage.set(this.i18nService.t(this.isFamiliesPlan?"startFreeFamiliesTrial":"upgradeToPremium"))):this.complete.emit({status:we,organizationId:null})}),this.estimatedTax$=this.formGroup.controls.billingAddress.valueChanges.pipe((0,Q.Z)(this.formGroup.controls.billingAddress.value),(0,ee.B)(1e3),(0,D.n)(()=>this.refreshSalesTax$())),this.loading.set(!1)})}ngAfterViewInit(){const e=this.cartSummaryComponent();e.isExpanded.set(!1),this.hasEnoughAccountCredit$=(0,te.z)([e.total$,this.upgradePaymentService.accountCredit$,this.formGroup.controls.paymentForm.valueChanges.pipe((0,Q.Z)(this.formGroup.controls.paymentForm.value))]).pipe((0,G.T)(([e,t,i])=>(null==i?void 0:i.type)!==q.mv.accountCredit||!!t&&t>=e),(0,ie.t)({bufferSize:1,refCount:!0}))}get isPremiumPlan(){return this.selectedPlanId()===f.OU.Premium}get isFamiliesPlan(){return this.selectedPlanId()===f.OU.Families}isFormValid(){return this.formGroup.valid&&this.paymentComponent().validate()}processUpgrade(){return ve(this,void 0,void 0,function*(){var e;if(!this.selectedPlan())throw new Error("No plan selected");const t=(0,re.c3)(this.formGroup.controls.billingAddress),i=null===(e=this.formGroup.value)||void 0===e?void 0:e.organizationName;if(!t.country||!t.postalCode)throw new Error("Billing address is incomplete");if(this.isFamiliesPlan&&!i)throw new Error("Organization name is required");const n=yield this.getPaymentMethod();if(!n)throw new Error("Payment method is required");if(!("token"in n)&&this.isFamiliesPlan)throw new Error("Tokenized payment is required for families plan");return this.isFamiliesPlan?this.processFamiliesUpgrade(i,t,n):this.processPremiumUpgrade(n,t)})}processFamiliesUpgrade(e,t,i){return ve(this,void 0,void 0,function*(){const n={organizationName:e,billingAddress:t},r=yield this.upgradePaymentService.upgradeToFamilies(this.account(),this.selectedPlan(),i,n);return{status:Ie,organizationId:r.id}})}processPremiumUpgrade(e,t){return ve(this,void 0,void 0,function*(){return yield this.upgradePaymentService.upgradeToPremium(e,t),{status:Se,organizationId:null}})}getPaymentMethod(){return ve(this,void 0,void 0,function*(){var e,t;return(null===(t=null===(e=this.formGroup.value)||void 0===e?void 0:e.paymentForm)||void 0===t?void 0:t.type)===q.mv.accountCredit?{type:q.mv.accountCredit}:yield this.paymentComponent().tokenize()})}refreshSalesTax$(){if(this.formGroup.invalid||!this.selectedPlan())return(0,v.of)(this.INITIAL_TAX_VALUE);const e=(0,re.c3)(this.formGroup.controls.billingAddress);return e.country&&e.postalCode?(0,ne.H)(this.upgradePaymentService.calculateEstimatedTax(this.selectedPlan(),e)).pipe((0,m.W)(e=>(this.logService.error("Tax calculation failed:",e),this.toastService.showToast({variant:"error",message:this.i18nService.t("taxCalculationError")}),(0,v.of)(this.INITIAL_TAX_VALUE)))):(0,v.of)(this.INITIAL_TAX_VALUE)}}ke.ɵfac=function(e){return new(e||ke)(b.rXU(w.W),b.rXU(S.z),b.rXU(I.f),b.rXU(K.Kc),b.rXU(s.abz),b.rXU(J))},ke.ɵcmp=b.VBU({type:ke,selectors:[["app-upgrade-payment"]],viewQuery:function(e,t){1&e&&(b.wEZ(t.paymentComponent,re.Pu,5),b.wEZ(t.cartSummaryComponent,g.Oo,5)),2&e&&b.NyB(2)},inputs:{selectedPlanId:[1,"selectedPlanId"],account:[1,"account"]},outputs:{goBack:"goBack",complete:"complete"},features:[b.Jv_([J])],decls:31,vars:36,consts:[["paymentComponent",""],["cartSummaryComponent",""],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[1,"tw-pb-8","!tw-mx-0"],["bitTypography","h5"],[3,"showBankAccount","showAccountCredit","group","includeBillingAddress","hasEnoughAccountCredit"],["bitTypography","h5",1,"tw-pt-4","tw-pb-2"],[3,"group","scenario"],[3,"passwordManager","estimatedTax"],["bitTypography","helper",1,"tw-italic","tw-text-muted","!tw-mb-0"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit",3,"disabled"],["bitButton","","type","button","buttonType","secondary",3,"click","disabled"],[1,"tw-pb-2"],[1,"tw-pb-4"],[1,"!tw-mb-0"],["bitInput","","type","text","formControlName","organizationName","required",""],["bitTypography","helper",1,"tw-text-muted","tw-pt-1","tw-pl-1"],["type","info"],["bitLink","","bitDialogClose","","linkType","primary",3,"routerLink"],["slot","end","aria-hidden","true",1,"bwi","bwi-angle-right"]],template:function(e,t){if(1&e){const e=b.RV6();b.j41(0,"form",2)(1,"bit-dialog",3)(2,"span",4),b.EFF(3),b.k0s(),b.qex(4,5),b.j41(5,"section"),b.nVh(6,ye,11,9),b.j41(7,"div",6)(8,"h5",7),b.EFF(9),b.nI1(10,"i18n"),b.k0s(),b.nrm(11,"app-enter-payment-method",8,0),b.nI1(13,"async"),b.j41(14,"h5",9),b.EFF(15),b.nI1(16,"i18n"),b.k0s(),b.nrm(17,"app-enter-billing-address",10),b.k0s()(),b.j41(18,"section"),b.nrm(19,"billing-cart-summary",11,1),b.nI1(21,"async"),b.nVh(22,be,3,3,"p",12),b.k0s(),b.bVm(),b.qex(23,13),b.j41(24,"button",14),b.nI1(25,"async"),b.EFF(26),b.nI1(27,"i18n"),b.k0s(),b.j41(28,"button",15),b.bIt("click",function(){return s.eBV(e),s.Njj(t.goBack.emit())}),b.EFF(29),b.nI1(30,"i18n"),b.k0s(),b.bVm(),b.k0s()()}2&e&&(b.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),b.R7$(),b.Y8G("loading",t.loading()),b.R7$(2),b.JRh(t.upgradeToMessage()),b.R7$(3),b.vxM(t.isFamiliesPlan?6:-1),b.R7$(3),b.JRh(b.bMT(10,21,"paymentMethod")),b.R7$(2),b.Y8G("showBankAccount",t.isFamiliesPlan)("showAccountCredit",!t.isFamiliesPlan)("group",t.formGroup.controls.paymentForm)("includeBillingAddress",!1)("hasEnoughAccountCredit",b.bMT(13,23,t.hasEnoughAccountCredit$)),b.R7$(4),b.JRh(b.bMT(16,25,"billingAddress")),b.R7$(2),b.Y8G("group",t.formGroup.controls.billingAddress)("scenario",b.lJ4(35,fe)),b.R7$(2),b.Y8G("passwordManager",t.passwordManager())("estimatedTax",b.bMT(21,27,t.estimatedTax$)),b.R7$(3),b.vxM(t.isFamiliesPlan?22:-1),b.R7$(2),b.Y8G("disabled",t.loading()||!t.isFormValid()||!b.bMT(25,29,t.hasEnoughAccountCredit$)),b.R7$(2),b.SpI(" ",b.bMT(27,31,"upgrade")," "),b.R7$(2),b.Y8G("disabled",t.loading()),b.R7$(),b.SpI(" ",b.bMT(30,33,"back")," "))},dependencies:[o.P,se.I,oe.m,y.G,Z.qT,Z.me,Z.BC,Z.cb,Z.YS,Z.j4,Z.JD,ae.Wk,le.$,ce.L,de.Q,ue.G,he.j,pe.J,me.h,C.L,T.r,g.Oo,a.t,re.Pu,re.vU,c.IJ,r.Jj,F.$],encapsulation:2});var Ce=i(21274),Te=i(23649),Fe=i(71613),Re=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Pe(e,t){if(1&e){const e=b.RV6();b.j41(0,"app-upgrade-account",2),b.bIt("planSelected",function(t){s.eBV(e);const i=b.XpG();return s.Njj(i.onPlanSelected(t))})("closeClicked",function(){s.eBV(e);const t=b.XpG();return s.Njj(t.onCloseClicked())}),b.k0s()}if(2&e){const e=b.XpG();b.Y8G("dialogTitleMessageOverride",e.planSelectionStepTitleOverride())("hideContinueWithoutUpgradingButton",e.hideContinueWithoutUpgradingButton())}}function xe(e,t){if(1&e){const e=b.RV6();b.j41(0,"app-upgrade-payment",3),b.bIt("goBack",function(){s.eBV(e);const t=b.XpG();return s.Njj(t.previousStep())})("complete",function(t){s.eBV(e);const i=b.XpG();return s.Njj(i.onComplete(t))}),b.k0s()}if(2&e){const e=b.XpG();b.Y8G("selectedPlanId",e.selectedPlan())("account",e.account())}}const $e={Closed:"closed",UpgradedToPremium:"upgradedToPremium",UpgradedToFamilies:"upgradedToFamilies"},Ee={PlanSelection:"planSelection",Payment:"payment"};class Ae{constructor(e,t,i,n){this.dialogRef=e,this.params=t,this.router=i,this.premiumInterestStateService=n,this.step=(0,s.vPA)(Ee.PlanSelection),this.selectedPlan=(0,s.vPA)(null),this.account=(0,s.vPA)(null),this.planSelectionStepTitleOverride=(0,s.vPA)(null),this.hideContinueWithoutUpgradingButton=(0,s.vPA)(!1),this.hasPremiumInterest=(0,s.vPA)(!1),this.PaymentStep=Ee.Payment,this.PlanSelectionStep=Ee.PlanSelection}ngOnInit(){return Re(this,void 0,void 0,function*(){var e,t,i,n;this.account.set(this.params.account),this.step.set(null!==(e=this.params.initialStep)&&void 0!==e?e:Ee.PlanSelection),this.selectedPlan.set(null!==(t=this.params.selectedPlan)&&void 0!==t?t:null),this.planSelectionStepTitleOverride.set(null!==(i=this.params.planSelectionStepTitleOverride)&&void 0!==i?i:null),this.hideContinueWithoutUpgradingButton.set(null!==(n=this.params.hideContinueWithoutUpgradingButton)&&void 0!==n&&n);(yield this.premiumInterestStateService.getPremiumInterest(this.params.account.id))&&(this.hasPremiumInterest.set(!0),yield this.premiumInterestStateService.clearPremiumInterest(this.params.account.id))})}onPlanSelected(e){this.selectedPlan.set(e),this.nextStep()}onCloseClicked(){return Re(this,void 0,void 0,function*(){this.close({status:$e.Closed})})}close(e){this.dialogRef.close(e)}nextStep(){this.step()===Ee.PlanSelection&&this.step.set(Ee.Payment)}previousStep(){return Re(this,void 0,void 0,function*(){var e;this.step()===Ee.Payment&&null==(null===(e=this.params)||void 0===e?void 0:e.initialStep)?(this.step.set(Ee.PlanSelection),this.selectedPlan.set(null)):this.close({status:$e.Closed})})}onComplete(e){return Re(this,void 0,void 0,function*(){let t;switch(e.status){case"upgradedToPremium":t=$e.UpgradedToPremium;break;case"upgradedToFamilies":t=$e.UpgradedToFamilies;break;default:t=$e.Closed}if(this.close({status:t,organizationId:e.organizationId}),t===$e.UpgradedToPremium&&this.hasPremiumInterest())yield this.router.navigate(["/vault"]);else if(this.params.redirectOnCompletion&&(t===$e.UpgradedToPremium||t===$e.UpgradedToFamilies)){const i=t===$e.UpgradedToFamilies?`/organizations/${e.organizationId}/vault`:"/settings/subscription/user-subscription";yield this.router.navigate([i])}})}static open(e,t){return e.open(Ae,{data:t.data})}}Ae.ɵfac=function(e){return new(e||Ae)(b.rXU(Ce.ce),b.rXU(n.Qs),b.rXU(Te.Ix),b.rXU(Fe.a))},Ae.ɵcmp=b.VBU({type:Ae,selectors:[["app-unified-upgrade-dialog"]],features:[b.Jv_([J,l.cH,l.jZ])],decls:2,vars:1,consts:[[3,"dialogTitleMessageOverride","hideContinueWithoutUpgradingButton"],[3,"selectedPlanId","account"],[3,"planSelected","closeClicked","dialogTitleMessageOverride","hideContinueWithoutUpgradingButton"],[3,"goBack","complete","selectedPlanId","account"]],template:function(e,t){1&e&&b.nVh(0,Pe,1,2,"app-upgrade-account",0)(1,xe,1,2,"app-upgrade-payment",1),2&e&&b.vxM(t.step()==t.PlanSelectionStep?0:t.step()==t.PaymentStep&&null!==t.selectedPlan()&&null!==t.account()?1:-1)},dependencies:[r.MD,o.P,a.t,A,ke,c.IJ],encapsulation:2,changeDetection:0})},27520:(e,t,i)=>{"use strict";i.d(t,{S:()=>c});var n=i(94573),r=i(33277),s=i(78781),o=i(33812);function a(e,t){if(1&e&&(o.rj2(0,"span",2),o.EFF(1),o.eux()),2&e){const e=o.XpG().$index;o.R7$(),o.JRh(e+1)}}function l(e,t){if(1&e&&(o.rj2(0,"span",1)(1,"span"),o.EFF(2),o.eux(),o.nVh(3,a,2,1,"span",2),o.eux()),2&e){const e=t.$implicit,i=o.XpG();o.HbH(i.getCharacterClass(e)),o.R7$(2),o.JRh(e),o.R7$(),o.vxM(i.showCount()?3:-1)}}class c{constructor(){this.password=(0,n.hFB)(""),this.showCount=(0,n.hFB)(!1),this.passwordCharArray=(0,r.EW)(()=>{var e;return Array.from(null!==(e=this.password())&&void 0!==e?e:"")}),this.characterStyles={emoji:[],letter:["tw-text-main"],special:["tw-text-danger"],number:["tw-text-primary-600"]}}get classList(){return["tw-min-w-0","tw-whitespace-pre-wrap","tw-break-words"]}getCharacterClass(e){const t=this.getCharacterType(e),i=this.characterStyles[t];return this.showCount()?i.concat(["tw-inline-flex","tw-flex-col","tw-items-center","tw-w-7","tw-py-1","odd:tw-bg-secondary-100","even:tw-bg-background"]):i}getCharacterType(e){if(e.match(s.A.regexpEmojiPresentation))return"emoji";if(e.match(/\d/))return"number";return["&","<",">"," "].includes(e)||e.match(/[^\w ]/)?"special":"letter"}}c.ɵfac=function(e){return new(e||c)},c.ɵcmp=o.VBU({type:c,selectors:[["bit-color-password"]],hostVars:2,hostBindings:function(e,t){2&e&&o.HbH(t.classList)},inputs:{password:[1,"password"],showCount:[1,"showCount"]},decls:2,vars:0,consts:[[1,"tw-font-mono",3,"class"],[1,"tw-font-mono"],[1,"tw-whitespace-nowrap","tw-text-xs","tw-leading-5","tw-text-main"]],template:function(e,t){1&e&&o.Z7z(0,l,4,4,"span",0,o.Vm6),2&e&&o.Dyx(t.passwordCharArray())},encapsulation:2})},27545:(e,t,i)=>{"use strict";i.d(t,{gA:()=>Y,Im:()=>J,_h:()=>Ie,Uz:()=>Se});var n=i(286),r=i(77468),s=i(66046),o=i(16878),a=i(72737),l=i(36359),c=i(44500),d=i(3204),u=i(14803),h=i(58625),p=i(56962),m=i(20136),v=i(98479),f=i(22191),g=i(59525),y=i(98403),b=i(29776),w=i(192),S=i(18030),I=i(33812),k=i(50700),C=i(27520),T=i(36288),F=i(25024),R=i(75556),P=i(90300),x=i(4017),$=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function E(e,t){if(1&e&&(I.j41(0,"bit-item")(1,"bit-item-content"),I.nrm(2,"bit-color-password",0),I.j41(3,"div",1),I.EFF(4),I.nI1(5,"date"),I.k0s()(),I.qex(6,2),I.j41(7,"bit-item-action")(8,"button",3),I.EFF(9),I.k0s()(),I.bVm(),I.k0s()),2&e){const e=t.$implicit,i=I.XpG();I.R7$(2),I.Y8G("password",e.credential),I.R7$(2),I.SpI(" ",I.i5U(5,6,e.generationDate,"medium")," "),I.R7$(4),I.Y8G("appCopyClick",e.credential)("valueLabel",i.getGeneratedValueText(e))("label",i.getCopyText(e)),I.R7$(),I.SpI(" ",i.getCopyText(e)," ")}}class A{constructor(e,t,i,n){this.generatorService=e,this.history=t,this.i18nService=i,this.logService=n,this.destroyed=new s.B,this.credentials$=new o.t([]),this.account$=new a.m(1),this.debug=!1,this.log=(0,m.S2)({})}ngOnChanges(e){return $(this,void 0,void 0,function*(){var t,i,n,r,s;const o=null==e?void 0:e.account;(null===(t=null==o?void 0:o.previousValue)||void 0===t?void 0:t.id)!==(null===(i=null==o?void 0:o.currentValue)||void 0===i?void 0:i.id)&&(this.log.debug({previousUserId:null===(n=null==o?void 0:o.previousValue)||void 0===n?void 0:n.id,currentUserId:null===(r=null==o?void 0:o.currentValue)||void 0===r?void 0:r.id},"account input change detected"),this.account$.next(null!==(s=o.currentValue)&&void 0!==s?s:this.account))})}ngOnInit(){this.log=(0,m.mJ)(this.debug,this.logService,{type:"CredentialGeneratorComponent"}),this.account$.pipe((0,l.M)(e=>this.log.info({accountId:e.id},"loading credential history")),(0,c.n)(e=>this.history.credentials$(e.id)),(0,d.T)(e=>e.filter(e=>{var t;return""!==(null!==(t=e.credential)&&void 0!==t?t:"")})),(0,u.Q)(this.destroyed)).subscribe(this.credentials$)}getCopyText(e){const[t]=b.I4[e.category],i=this.generatorService.algorithm(t);return(0,S.Tl)(i.i18nKeys.copyCredential,this.i18nService)}getGeneratedValueText(e){const[t]=b.I4[e.category],i=this.generatorService.algorithm(t);return(0,S.Tl)(i.i18nKeys.credentialType,this.i18nService)}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.log.debug("component destroyed")}}A.ɵfac=function(e){return new(e||A)(I.rXU(b.iE),I.rXU(w.ZS),I.rXU(k.W),I.rXU(p.K))},A.ɵcmp=I.VBU({type:A,selectors:[["bit-credential-generator-history"]],inputs:{account:"account",debug:"debug"},features:[I.OA$],decls:3,vars:2,consts:[[1,"tw-font-mono",3,"password"],["slot","secondary"],["slot","end"],["type","button","bitIconButton","bwi-clone","showToast","",3,"appCopyClick","valueLabel","label"]],template:function(e,t){1&e&&(I.Z7z(0,E,10,9,"bit-item",null,I.fX1),I.nI1(2,"async")),2&e&&I.Dyx(I.bMT(2,0,t.credentials$))},dependencies:[r.MD,v.p,C.S,f.Q,T.s,g.s,h.p,F.D,y.k,R.J,P.g,x.D,r.Jj,r.vh],encapsulation:2});var D=i(72245),O=i(29029),M=i(81573),U=i(9171),G=i(22690),j=i(88016);class N{constructor(){this.noCredentialsIcon=U.R}}N.ɵfac=function(e){return new(e||N)},N.ɵcmp=I.VBU({type:N,selectors:[["bit-empty-credential-history"]],decls:7,vars:7,consts:[[3,"icon"],["slot","title"],["slot","description"]],template:function(e,t){1&e&&(I.j41(0,"bit-no-items",0),I.qex(1,1),I.EFF(2),I.nI1(3,"i18n"),I.bVm(),I.qex(4,2),I.EFF(5),I.nI1(6,"i18n"),I.bVm(),I.k0s()),2&e&&(I.Y8G("icon",t.noCredentialsIcon),I.R7$(2),I.JRh(I.bMT(3,3,"nothingToShow")),I.R7$(3),I.JRh(I.bMT(6,5,"nothingGeneratedRecently")))},dependencies:[h.p,g.s,G.D,j.$],encapsulation:2});var V=i(74208),B=i(35500),z=i(21274),L=i(56898),K=i(68016),q=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function _(e,t){if(1&e&&(I.nrm(0,"bit-credential-generator-history",4),I.nI1(1,"async")),2&e){const e=I.XpG();I.Y8G("account",I.bMT(1,1,e.account$))}}function X(e,t){1&e&&I.nrm(0,"bit-empty-credential-history",5)}class Y{constructor(e,t,i,n){this.accountService=e,this.history=t,this.dialogService=i,this.logService=n,this.destroyed=new s.B,this.hasHistory$=new o.t(!1),this.account$=new a.m(1),this.debug=!1,this.log=(0,m.S2)({})}ngOnChanges(e){var t,i,n,r,s;const o=null==e?void 0:e.account;(null===(t=null==o?void 0:o.previousValue)||void 0===t?void 0:t.id)!==(null===(i=null==o?void 0:o.currentValue)||void 0===i?void 0:i.id)&&(this.log.debug({previousUserId:null===(n=null==o?void 0:o.previousValue)||void 0===n?void 0:n.id,currentUserId:null===(r=null==o?void 0:o.currentValue)||void 0===r?void 0:r.id},"account input change detected"),this.account$.next(null!==(s=o.currentValue)&&void 0!==s?s:this.account))}ngOnInit(){return q(this,void 0,void 0,function*(){this.log=(0,m.mJ)(this.debug,this.logService,{type:"CredentialGeneratorComponent"}),this.account||(this.account=yield(0,D._)(this.accountService.activeAccount$),this.log.info({userId:this.account.id},"account not specified; using active account settings"),this.account$.next(this.account)),this.account$.pipe((0,c.n)(e=>e.id&&this.history.credentials$(e.id)),(0,d.T)(e=>e.length>0),(0,u.Q)(this.destroyed)).subscribe(this.hasHistory$)})}clear(){return q(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:{key:"clearGeneratorHistoryTitle"},content:{key:"cleargGeneratorHistoryDescription"},type:"warning",acceptButtonText:{key:"clearHistory"},cancelButtonText:{key:"cancel"}}))&&(yield this.history.clear((yield(0,D._)(this.account$)).id))})}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.log.debug("component destroyed")}}Y.ɵfac=function(e){return new(e||Y)(I.rXU(B.Di),I.rXU(w.ZS),I.rXU(z.o3),I.rXU(p.K))},Y.ɵcmp=I.VBU({type:Y,selectors:[["ng-component"]],inputs:{account:"account",debug:"debug"},features:[I.OA$],decls:14,vars:12,consts:[["dialog",""],["background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[3,"account"],[2,"display","contents"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","primary",3,"click","disabled"]],template:function(e,t){if(1&e){const e=I.RV6();I.j41(0,"bit-dialog",1,0)(2,"span",2),I.EFF(3),I.nI1(4,"i18n"),I.k0s(),I.qex(5,3),I.nVh(6,_,2,3,"bit-credential-generator-history",4),I.nI1(7,"async"),I.vZN(8,X,1,0,"bit-empty-credential-history",5),I.bVm(),I.qex(9,6),I.j41(10,"button",7),I.nI1(11,"async"),I.bIt("click",function(){return V.eBV(e),V.Njj(t.clear())}),I.EFF(12),I.nI1(13,"i18n"),I.k0s(),I.bVm(),I.k0s()}2&e&&(I.R7$(3),I.JRh(I.bMT(4,4,"generatorHistory")),I.R7$(3),I.vxM(I.bMT(7,6,t.hasHistory$)?6:8),I.R7$(4),I.Y8G("disabled",!I.bMT(11,8,t.hasHistory$)),I.R7$(2),I.SpI(" ",I.bMT(13,10,"clearHistory")," "))},dependencies:[O.t,L.Q,r.MD,h.p,M.P,K.m,A,N,r.Jj,j.$],encapsulation:2});var H=i(4162),W=i(99327);class J{constructor(){}}J.ɵfac=function(e){return new(e||J)},J.ɵmod=I.$C({type:J}),J.ɵinj=V.G2t({imports:[n.y,H.M,W.d]});var Z=i(84079),Q=i(58363),ee=i(21495),te=i(2073),ie=i(12012),ne=i(18499),re=i(82468),se=i(89105),oe=i(1601),ae=i(37115),le=i(31857),ce=i(97445),de=i(43946),ue=i(23549),he=i(43348),pe=i(63344),me=i(25304),ve=i(48856),fe=i(8936),ge=i(39307);var ye=i(22848);const be=new te.aZ("Randomizer"),we=new te.aZ("CredentialGeneratorProviders"),Se=new te.aZ("SystemServices");class Ie{constructor(){}}Ie.ɵfac=function(e){return new(e||Ie)},Ie.ɵmod=I.$C({type:Ie}),Ie.ɵinj=V.G2t({providers:[(0,ee.F)({provide:be,useFactory:b.WX,deps:[ye.Lu]}),(0,ee.F)({provide:de.p,useClass:ce.p,deps:[se.N,ye.Lu]}),(0,ee.F)({provide:he.F,useFactory:()=>{const e=new ve.T(me.iP,me.xN);e.registerSite(me.YY[ue._z.forwarder]);for(const t of fe.G)e.registerVendor(t);for(const t of fe.B)e.registerExtension(t);return e.setPermission({all:!0},"default"),e},deps:[]}),(0,ee.F)({provide:Se,useFactory:(e,t,i,n,r,s,o)=>{let a;a=s.isDev()?(0,m.oR)(r,[]):m.S2;return{policy:i,extension:new pe.r(n,{encryptor:e,state:t,log:a,now:Date.now}),log:a,configService:o}},deps:[de.p,le.v2,ne.m,he.F,p.K,ae.y,oe.w]}),(0,ee.F)({provide:we,useFactory:(e,t,i,n,r,s)=>{const o={encryptor:i,state:n,log:e.log,now:Date.now},a=(0,Z.H)(e.configService.getFeatureFlag(re.TO.UseSdkPasswordGenerators));let l=!1;a.pipe((0,Q.s)(1)).subscribe(e=>l=e);const c=new b.r5.i(o,e,Object.values(b.qG)),d=l?e.sdk:void 0,u=new b.r5.O(o,e.policy),h={randomizer:t,client:new ge.e(s,r),i18nService:r,sdk:d,now:Date.now};return{userState:{encryptor:i,state:n,log:e.log,now:Date.now},generator:h,profile:u,metadata:c}},deps:[Se,be,de.p,le.v2,k.W,ie.G]}),(0,ee.F)({provide:class{},useFactory:(e,t)=>Object.freeze({encryptor:e,state:t,log:m.S2,now:Date.now}),deps:[de.p,le.v2]}),(0,ee.F)({provide:b.iE,useClass:b.PG,deps:[we,Se]})],imports:[h.p]})},27650:(e,t,i)=>{"use strict";i.d(t,{G:()=>n});class n{}},27760:(e,t,i)=>{"use strict";i.d(t,{S:()=>tt});var n=i(66046),r=i(16878),s=i(83892),o=i(44500),a=i(3204),l=i(36359),c=i(88565),d=i(69194),u=i(84079),h=i(93695),p=i(58363),m=i(98221),v=i(74208),f=i(33812),g=i(51757),y=i(72245),b=i(33338),w=i(14803),S=i(12610),I=i(36006),k=i(67553),C=i(88083);class T{constructor(e){this.newPlanType=e}}var F=i(81525),R=i(63734),P=i(12012),x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ${constructor(e){this.apiService=e}getCadenceCards(e,t,i){return x(this,void 0,void 0,function*(){const n=(yield this.apiService.getPlans()).data.filter(e=>!!e.PasswordManager);return((null==n?void 0:n.filter(t=>t.productTier===e.productTier&&!t.disabled&&!t.legacyYear))||[]).map(e=>{var n,r;let s=0;if(e.PasswordManager.basePrice)s=e.isAnnual?e.PasswordManager.basePrice/12:e.PasswordManager.basePrice;else if(!e.PasswordManager.basePrice&&e.PasswordManager.hasAdditionalSeatsOption){s=((t.useSecretsManager?e.SecretsManager.seatPrice:0)+(i?0:e.PasswordManager.seatPrice))/(e.isAnnual?12:1)}const o=null!==(r=null===(n=t.customerDiscount)||void 0===n?void 0:n.percentOff)&&void 0!==r?r:0,a=0===o&&e.isAnnual||i?20:o;return{title:e.isAnnual?"Annually":"Monthly",costPerMember:s,discount:a,isDisabled:!1,isSelected:e.isAnnual,isAnnual:e.isAnnual,productTier:e.productTier}}).reverse()})}}$.ɵfac=function(e){return new(e||$)(v.KVO(P.G))},$.ɵprov=v.jDH({token:$,factory:$.ɵfac,providedIn:"root"});var E=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class A{getPricingSummaryData(e,t,i,n,r,s){return E(this,void 0,void 0,function*(){var o,a,l,c,d,u,h,p,m,v,f,g;const y=(null===(o=e.PasswordManager)||void 0===o?void 0:o.hasAdditionalSeatsOption)&&!r?e.PasswordManager.seatPrice*Math.abs((null==t?void 0:t.seats)||0):0,b=(null===(a=e.SecretsManager)||void 0===a?void 0:a.hasAdditionalSeatsOption)?e.SecretsManager.seatPrice*Math.abs((null==t?void 0:t.smSeats)||0):0,w=this.getAdditionalServiceAccount(e,t),S=Math.max(0,(null!==(l=null==t?void 0:t.maxStorageGb)&&void 0!==l?l:0)-e.PasswordManager.baseStorageGb),I=(null===(c=e.PasswordManager)||void 0===c?void 0:c.hasAdditionalStorageOption)?e.PasswordManager.additionalStoragePricePerGb*S:0,k=(null===(d=e.PasswordManager)||void 0===d?void 0:d.additionalStoragePricePerGb)||0,T=(null===(u=e.SecretsManager)||void 0===u?void 0:u.hasAdditionalServiceAccountOption)&&w>0?e.SecretsManager.additionalPricePerServiceAccount*w:0;let F=(null===(h=e.PasswordManager)||void 0===h?void 0:h.basePrice)||0;(null===(p=e.PasswordManager)||void 0===p?void 0:p.hasAdditionalSeatsOption)&&(F+=y),(null===(m=e.PasswordManager)||void 0===m?void 0:m.hasPremiumAccessOption)&&(F+=e.PasswordManager.premiumAccessOptionPrice),(null===(v=e.PasswordManager)||void 0===v?void 0:v.hasAdditionalStorageOption)&&(F+=I);const R=e.SecretsManager?(e.SecretsManager.basePrice||0)+b+T:0,P=r?0:null!==(g=null===(f=null==t?void 0:t.customerDiscount)||void 0===f?void 0:f.percentOff)&&void 0!==g?g:0,x=(null==i?void 0:i.useSecretsManager)?F+R+s:F+s;return{selectedPlanInterval:n===C.$y.Annually?"year":"month",passwordManagerSeats:e.productTier===C.K_.Families?e.PasswordManager.baseSeats:null==t?void 0:t.seats,passwordManagerSeatTotal:y,secretsManagerSeatTotal:b,additionalStorageTotal:I,additionalStoragePriceMonthly:k,additionalServiceAccountTotal:T,totalAppliedDiscount:0,secretsManagerSubtotal:R,passwordManagerSubtotal:F,total:x,organization:i,sub:t,selectedPlan:e,selectedInterval:n,discountPercentageFromSub:P,discountPercentage:20,acceptingSponsorship:!1,additionalServiceAccount:w,storageGb:S,isSecretsManagerTrial:r,estimatedTax:s}})}getAdditionalServiceAccount(e,t){var i;if(!e||!e.SecretsManager)return 0;const n=((null===(i=e.SecretsManager)||void 0===i?void 0:i.baseServiceAccount)||0)-((null==t?void 0:t.smServiceAccounts)||0);return n<=0?Math.abs(n):0}}A.ɵfac=function(e){return new(e||A)},A.ɵprov=v.jDH({token:A,factory:A.ɵfac,providedIn:"root"});var D=i(21274),O=i(69855),M=i(50700),U=i(11224),G=i(35500),j=i(49247),N=i(77468),V=i(3892),B=i(56898),z=i(7730),L=i(68016),K=i(58806),q=i(21587),_=i(34923),X=i(94573),Y=i(88016);const H=(e,t)=>({"tw-py-1":e,"tw-py-0":t}),W=(e,t)=>({"tw-bg-primary-700 !tw-text-contrast":e,"tw-bg-secondary-100":t});function J(e,t){if(1&e&&(f.j41(0,"div",2),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e){const e=f.XpG();f.Y8G("ngClass",f.l_i(4,W,e.plan().isSelected,!e.plan().isSelected)),f.R7$(),f.SpI(" ",f.bMT(2,2,"recommended")," ")}}class Z{constructor(){this.plan=X.hFB.required(),this.productTiers=C.K_,this.cardClicked=(0,X.CGW)()}getPlanCardContainerClasses(){const e=this.plan().isSelected;return this.plan().isDisabled?["tw-cursor-not-allowed","tw-bg-secondary-100","tw-font-normal","tw-bg-blur","tw-text-muted","tw-block","tw-rounded"]:e?["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-primary-600","tw-border-2","tw-rounded-lg","hover:tw-border-primary-700","focus:tw-border-3","focus:tw-border-primary-700","focus:tw-rounded-lg"]:["tw-cursor-pointer","tw-block","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","hover:tw-border-text-main","focus:tw-border-2","focus:tw-border-primary-700"]}}Z.ɵfac=function(e){return new(e||Z)},Z.ɵcmp=f.VBU({type:Z,selectors:[["app-plan-card"]],inputs:{plan:[1,"plan"]},outputs:{cardClicked:"cardClicked"},standalone:!1,decls:14,vars:16,consts:[[1,"tw-h-full",3,"click","ngClass"],[1,"tw-relative"],[1,"tw-bg-secondary-100","tw-text-center","!tw-border-0","tw-text-sm","tw-font-medium","tw-py-1",3,"ngClass"],[1,"tw-px-2","tw-pb-[4px]",3,"ngClass"],[1,"tw-text-[1.25rem]","tw-mt-[6px]","tw-font-medium","tw-mb-0","tw-leading-[2rem]","tw-flex","tw-items-center"],[1,"tw-capitalize","tw-whitespace-nowrap"],[1,"tw-text-lg","tw-font-medium"],[1,"tw-text-xs","tw-px-0"]],template:function(e,t){if(1&e){const e=f.RV6();f.j41(0,"bit-card",0),f.bIt("click",function(){return v.eBV(e),v.Njj(t.cardClicked.emit())}),f.j41(1,"div",1),f.nVh(2,J,3,7,"div",2),f.j41(3,"div",3)(4,"h3",4)(5,"span",5),f.EFF(6),f.k0s()(),f.j41(7,"span")(8,"b",6),f.EFF(9),f.nI1(10,"currency"),f.k0s(),f.j41(11,"span",7),f.EFF(12),f.nI1(13,"i18n"),f.k0s()()()()()}if(2&e){let e;const i=t.plan().isSelected,n=t.plan().isAnnual;f.Y8G("ngClass",t.getPlanCardContainerClasses()),f.BMQ("tabindex",!i||t.plan().isDisabled?"-1":"0")("data-selected",null==(e=t.plan())?null:e.isSelected),f.R7$(2),f.vxM(n?2:-1),f.R7$(),f.Y8G("ngClass",f.l_i(13,H,!t.plan().isSelected,t.plan().isSelected)),f.R7$(3),f.JRh(t.plan().title),f.R7$(3),f.SpI("",f.i5U(10,8,t.plan().costPerMember,"$")," "),f.R7$(3),f.SpI(" /",f.bMT(13,11,"monthPerMember"))}},dependencies:[N.YU,N.oe,Y.$],encapsulation:2});var Q=i(93199),ee=i(36288);function te(e,t){1&e&&f.eu8(0)}function ie(e,t){1&e&&f.eu8(0)}function ne(e,t){if(1&e&&(f.qex(0),f.DNE(1,te,1,0,"ng-container",16)(2,ie,1,0,"ng-container",16),f.bVm()),2&e){f.XpG();const e=f.sdS(7),t=f.sdS(9);f.R7$(),f.Y8G("ngTemplateOutlet",t),f.R7$(),f.Y8G("ngTemplateOutlet",e)}}function re(e,t){1&e&&f.eu8(0)}function se(e,t){1&e&&f.eu8(0)}function oe(e,t){if(1&e&&f.DNE(0,re,1,0,"ng-container",16)(1,se,1,0,"ng-container",16),2&e){f.XpG();const e=f.sdS(7),t=f.sdS(9);f.Y8G("ngTemplateOutlet",e),f.R7$(),f.Y8G("ngTemplateOutlet",t)}}function ae(e,t){if(1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"i18n"),f.nI1(3,"currency"),f.nI1(4,"i18n"),f.bVm()),2&e){const e=f.XpG(5);f.R7$(),f.LHq(" ",e.summaryData.passwordManagerSeats," ",f.bMT(2,4,"members")," × ",f.i5U(3,6,e.summaryData.selectedPlan.isAnnual?e.summaryData.selectedPlan.PasswordManager.basePrice/12:e.summaryData.selectedPlan.PasswordManager.basePrice,"$")," /",f.bMT(4,9,e.summaryData.selectedPlanInterval)," ")}}function le(e,t){if(1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"i18n"),f.nI1(3,"currency"),f.nI1(4,"i18n"),f.bVm()),2&e){const e=f.XpG(5);f.R7$(),f.E5c(" ",f.bMT(2,3,"basePrice"),": ",f.i5U(3,5,e.summaryData.selectedPlan.PasswordManager.basePrice,"$")," ",f.bMT(4,8,"monthAbbr")," ")}}function ce(e,t){if(1&e&&(f.qex(0),f.j41(1,"span",22),f.EFF(2),f.nI1(3,"currency"),f.k0s(),f.EFF(4),f.nI1(5,"i18n"),f.bVm()),2&e){const e=f.XpG(5);f.R7$(2),f.JRh(f.i5U(3,2,e.summaryData.selectedPlan.PasswordManager.basePrice,"$")),f.R7$(2),f.SpI(" ",f.bMT(5,5,"freeWithSponsorship")," ")}}function de(e,t){if(1&e&&(f.EFF(0),f.nI1(1,"currency")),2&e){const e=f.XpG(5);f.SpI(" ",f.i5U(1,1,e.summaryData.selectedPlan.PasswordManager.basePrice,"$")," ")}}function ue(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",18)(2,"span"),f.qex(3,19),f.DNE(4,ae,5,11,"ng-container",20)(5,le,5,10,"ng-container",21),f.bVm(),f.k0s(),f.j41(6,"span"),f.DNE(7,ce,6,7,"ng-container",12)(8,de,2,4,"ng-template",null,3,f.C5r),f.k0s()(),f.bVm()),2&e){const e=f.sdS(9),t=f.XpG(4);f.R7$(3),f.Y8G("ngSwitch",t.summaryData.selectedInterval),f.R7$(),f.Y8G("ngSwitchCase",t.planIntervals.Annually),f.R7$(3),f.Y8G("ngIf",t.summaryData.acceptingSponsorship)("ngIfElse",e)}}function he(e,t){1&e&&(f.j41(0,"span"),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.SpI("",f.bMT(2,1,"additionalUsers"),":"))}function pe(e,t){1&e&&(f.j41(0,"span"),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.JRh(f.bMT(2,1,"members")))}function me(e,t){if(1&e&&(f.j41(0,"span"),f.EFF(1),f.nI1(2,"currency"),f.k0s()),2&e){const e=f.XpG(5);f.R7$(),f.SpI(" ",f.i5U(2,1,e.summaryData.passwordManagerSeatTotal,"$")," ")}}function ve(e,t){1&e&&(f.j41(0,"span"),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.SpI(" ",f.bMT(2,1,"freeForOneYear")," "))}function fe(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",23)(2,"span"),f.DNE(3,he,3,3,"span",9),f.EFF(4),f.DNE(5,pe,3,3,"span",9),f.EFF(6),f.nI1(7,"currency"),f.nI1(8,"i18n"),f.k0s(),f.DNE(9,me,3,4,"span",9)(10,ve,3,3,"span",9),f.k0s(),f.bVm()),2&e){const e=f.XpG(4);f.R7$(3),f.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.baseSeats),f.R7$(),f.SpI(" ",e.summaryData.passwordManagerSeats||0,"  "),f.R7$(),f.Y8G("ngIf",!e.summaryData.selectedPlan.PasswordManager.baseSeats),f.R7$(),f.Lme(" × ",f.i5U(7,7,e.summaryData.selectedPlan.PasswordManager.seatPrice,"$")," /",f.bMT(8,10,e.summaryData.selectedPlanInterval)," "),f.R7$(3),f.Y8G("ngIf",!e.summaryData.isSecretsManagerTrial),f.R7$(),f.Y8G("ngIf",e.summaryData.isSecretsManagerTrial)}}function ge(e,t){if(1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"currency"),f.bVm()),2&e){const e=f.XpG(5);f.R7$(),f.SpI(" ",f.i5U(2,1,e.summaryData.additionalStorageTotal,"$")," ")}}function ye(e,t){if(1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"currency"),f.bVm()),2&e){const e=f.XpG(5);f.R7$(),f.SpI(" ",f.i5U(2,1,e.summaryData.storageGb*e.summaryData.selectedPlan.PasswordManager.additionalStoragePricePerGb,"$")," ")}}function be(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",23)(2,"span"),f.EFF(3),f.nI1(4,"i18n"),f.nI1(5,"currency"),f.nI1(6,"i18n"),f.k0s(),f.j41(7,"span"),f.qex(8,19),f.DNE(9,ge,3,4,"ng-container",20)(10,ye,3,4,"ng-container",21),f.bVm(),f.k0s()(),f.bVm()),2&e){const e=f.XpG(4);f.R7$(3),f.LHq(" ",e.summaryData.storageGb," ",f.bMT(4,6,"additionalStorageGbMessage")," × ",f.i5U(5,8,e.summaryData.additionalStoragePriceMonthly,"$")," /",f.bMT(6,11,e.summaryData.selectedPlanInterval)," "),f.R7$(5),f.Y8G("ngSwitch",e.summaryData.selectedInterval),f.R7$(),f.Y8G("ngSwitchCase",e.planIntervals.Annually)}}function we(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",17),f.EFF(2),f.nI1(3,"i18n"),f.k0s(),f.DNE(4,ue,10,4,"ng-container",9)(5,fe,11,12,"ng-container",9)(6,be,11,13,"ng-container",9),f.bVm()),2&e){const e=f.XpG(3);f.R7$(2),f.JRh(f.bMT(3,4,"passwordManager")),f.R7$(2),f.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.basePrice),f.R7$(),f.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.hasAdditionalSeatsOption),f.R7$(),f.Y8G("ngIf",e.summaryData.selectedPlan.PasswordManager.hasAdditionalStorageOption&&e.summaryData.storageGb>0)}}function Se(e,t){if(1&e&&f.DNE(0,we,7,6,"ng-container",9),2&e){const e=f.XpG(2);f.Y8G("ngIf",!e.summaryData.isSecretsManagerTrial||e.summaryData.organization.useSecretsManager)}}function Ie(e,t){if(1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"i18n"),f.nI1(3,"currency"),f.nI1(4,"i18n"),f.bVm()),2&e){const e=f.XpG(5);f.R7$(),f.LHq(" ",null==e.summaryData.sub?null:e.summaryData.sub.smSeats," ",f.bMT(2,4,"members")," × ",f.i5U(3,6,e.summaryData.selectedPlan.isAnnual?e.summaryData.selectedPlan.SecretsManager.basePrice/12:e.summaryData.selectedPlan.SecretsManager.basePrice,"$")," /",f.bMT(4,9,e.summaryData.selectedPlanInterval)," ")}}function ke(e,t){if(1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"i18n"),f.nI1(3,"currency"),f.nI1(4,"i18n"),f.bVm()),2&e){const e=f.XpG(5);f.R7$(),f.E5c(" ",f.bMT(2,3,"basePrice"),": ",f.i5U(3,5,e.summaryData.selectedPlan.SecretsManager.basePrice,"$")," ",f.bMT(4,8,"monthAbbr")," ")}}function Ce(e,t){if(1&e&&(f.j41(0,"span"),f.EFF(1),f.nI1(2,"currency"),f.k0s()),2&e){const e=f.XpG(5);f.R7$(),f.SpI(" ",f.i5U(2,1,e.summaryData.selectedPlan.SecretsManager.basePrice,"$")," ")}}function Te(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",18)(2,"span"),f.qex(3,19),f.DNE(4,Ie,5,11,"ng-container",20)(5,ke,5,10,"ng-container",21),f.bVm(),f.k0s(),f.DNE(6,Ce,3,4,"span",9),f.k0s(),f.bVm()),2&e){const e=f.XpG(4);f.R7$(3),f.Y8G("ngSwitch",e.summaryData.selectedInterval),f.R7$(),f.Y8G("ngSwitchCase",e.planIntervals.Annually),f.R7$(2),f.Y8G("ngIf",e.summaryData.selectedInterval===e.planIntervals.Monthly)}}function Fe(e,t){1&e&&(f.j41(0,"span"),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.SpI("",f.bMT(2,1,"additionalUsers"),":"))}function Re(e,t){1&e&&(f.j41(0,"span"),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e&&(f.R7$(),f.JRh(f.bMT(2,1,"members")))}function Pe(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",23)(2,"span"),f.DNE(3,Fe,3,3,"span",9),f.EFF(4),f.DNE(5,Re,3,3,"span",9),f.EFF(6),f.nI1(7,"currency"),f.nI1(8,"i18n"),f.k0s(),f.j41(9,"span"),f.EFF(10),f.nI1(11,"currency"),f.k0s()(),f.bVm()),2&e){const e=f.XpG(4);f.R7$(3),f.Y8G("ngIf",e.summaryData.selectedPlan.SecretsManager.baseSeats),f.R7$(),f.SpI(" ",(null==e.summaryData.sub?null:e.summaryData.sub.smSeats)||0,"  "),f.R7$(),f.Y8G("ngIf",!e.summaryData.selectedPlan.SecretsManager.baseSeats),f.R7$(),f.Lme(" × ",f.i5U(7,6,e.summaryData.selectedPlan.SecretsManager.seatPrice,"$")," /",f.bMT(8,9,e.summaryData.selectedPlanInterval)," "),f.R7$(4),f.SpI(" ",f.i5U(11,11,e.summaryData.secretsManagerSeatTotal,"$")," ")}}function xe(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",23)(2,"span"),f.EFF(3),f.nI1(4,"i18n"),f.nI1(5,"lowercase"),f.nI1(6,"currency"),f.nI1(7,"i18n"),f.k0s(),f.j41(8,"span"),f.EFF(9),f.nI1(10,"currency"),f.k0s()(),f.bVm()),2&e){const e=f.XpG(4);f.R7$(3),f.LHq(" ",e.summaryData.additionalServiceAccount," ",f.bMT(5,7,f.bMT(4,5,"serviceAccounts"))," × ",f.i5U(6,9,null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.additionalPricePerServiceAccount,"$")," /",f.bMT(7,12,e.summaryData.selectedPlanInterval)," "),f.R7$(6),f.JRh(f.i5U(10,14,e.summaryData.additionalServiceAccountTotal,"$"))}}function $e(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",17),f.EFF(2),f.nI1(3,"i18n"),f.k0s(),f.DNE(4,Te,7,3,"ng-container",9)(5,Pe,12,14,"ng-container",9)(6,xe,11,17,"ng-container",9),f.bVm()),2&e){const e=f.XpG(3);f.R7$(2),f.JRh(f.bMT(3,4,"secretsManager")),f.R7$(2),f.Y8G("ngIf",null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.basePrice),f.R7$(),f.Y8G("ngIf",null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.hasAdditionalSeatsOption),f.R7$(),f.Y8G("ngIf",(null==e.summaryData.selectedPlan||null==e.summaryData.selectedPlan.SecretsManager?null:e.summaryData.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption)&&e.summaryData.additionalServiceAccount>0)}}function Ee(e,t){if(1&e&&f.DNE(0,$e,7,6,"ng-container",9),2&e){const e=f.XpG(2);f.Y8G("ngIf",e.summaryData.organization.useSecretsManager)}}function Ae(e,t){if(1&e&&(f.qex(0),f.j41(1,"p",23)(2,"span",24),f.EFF(3),f.nI1(4,"i18n"),f.nI1(5,"lowercase"),f.k0s(),f.j41(6,"span",25),f.EFF(7),f.nI1(8,"currency"),f.k0s()(),f.bVm()),2&e){const e=f.XpG(2);f.R7$(3),f.SpI(" ",f.bMT(5,5,f.i5U(4,2,"providerDiscount",e.summaryData.discountPercentageFromSub))," "),f.R7$(4),f.SpI(" ",f.i5U(8,7,e.summaryData.totalAppliedDiscount,"$")," ")}}function De(e,t){if(1&e&&(f.qex(0),f.j41(1,"div",10)(2,"bit-hint",11),f.DNE(3,ne,3,2,"ng-container",12)(4,oe,2,2,"ng-template",null,0,f.C5r)(6,Se,1,1,"ng-template",null,1,f.C5r)(8,Ee,1,1,"ng-template",null,2,f.C5r)(10,Ae,9,10,"ng-container",9),f.k0s()(),f.j41(11,"div",13)(12,"bit-hint",11)(13,"p",14)(14,"span",6),f.EFF(15),f.nI1(16,"i18n"),f.k0s(),f.j41(17,"span"),f.EFF(18),f.nI1(19,"currency"),f.k0s()()()(),f.j41(20,"div",13)(21,"bit-hint",11)(22,"p",14)(23,"span",6),f.EFF(24),f.nI1(25,"i18n"),f.k0s(),f.j41(26,"span"),f.EFF(27),f.nI1(28,"currency"),f.j41(29,"span",15),f.EFF(30),f.nI1(31,"i18n"),f.k0s()()()()(),f.bVm()),2&e){const e=f.sdS(5),t=f.XpG();f.R7$(3),f.Y8G("ngIf",t.summaryData.isSecretsManagerTrial)("ngIfElse",e),f.R7$(7),f.Y8G("ngIf",t.summaryData.discountPercentageFromSub>0),f.R7$(5),f.JRh(f.bMT(16,8,"estimatedTax")),f.R7$(3),f.JRh(f.brH(19,10,t.summaryData.estimatedTax,"USD","$")),f.R7$(6),f.JRh(f.bMT(25,14,"total")),f.R7$(3),f.SpI(" ",f.brH(28,16,t.summaryData.total-t.summaryData.totalAppliedDiscount,"USD","$")," "),f.R7$(3),f.SpI("/ ",f.bMT(31,20,t.summaryData.selectedPlanInterval))}}class Oe{constructor(){this.planIntervals=C.$y}toggleTotalOpened(){this.summaryData&&(this.summaryData.totalOpened=!this.summaryData.totalOpened)}}Oe.ɵfac=function(e){return new(e||Oe)},Oe.ɵcmp=f.VBU({type:Oe,selectors:[["app-pricing-summary"]],inputs:{summaryData:"summaryData"},standalone:!1,decls:14,vars:18,consts:[["showPasswordManagerFirst",""],["passwordManagerSection",""],["secretsManagerSection",""],["notAcceptingSponsorship",""],[1,"tw-mt-4"],[1,"tw-text-lg","tw-mb-1"],[1,"tw-font-medium"],[1,"tw-text-xs","tw-font-light"],["type","button","size","small",3,"click","bitIconButton","label"],[4,"ngIf"],[1,"tw-flex","tw-flex-wrap","tw-gap-4"],[1,"tw-w-full"],[4,"ngIf","ngIfElse"],[1,"tw-flex","tw-flex-wrap","tw-gap-4","tw-mt-4"],[1,"tw-flex","tw-justify-between","tw-border-0","tw-border-solid","tw-border-t","tw-border-secondary-300","tw-pt-2","tw-mb-0"],[1,"tw-text-xs","tw-font-medium"],[4,"ngTemplateOutlet"],[1,"tw-font-medium","tw-mt-3","tw-mb-1"],["bitTypography","body2",1,"tw-mb-1","tw-flex","tw-justify-between"],[3,"ngSwitch"],[4,"ngSwitchCase"],[4,"ngSwitchDefault"],[1,"tw-line-through"],["bitTypography","body2",1,"tw-mb-0","tw-flex","tw-justify-between"],[1,"tw-text-xs"],[1,"tw-line-through","tw-text-xs"]],template:function(e,t){1&e&&(f.qex(0),f.j41(1,"div",4)(2,"p",5)(3,"span",6),f.EFF(4),f.nI1(5,"i18n"),f.nI1(6,"currency"),f.k0s(),f.j41(7,"span",7),f.EFF(8),f.nI1(9,"i18n"),f.k0s(),f.j41(10,"button",8),f.nI1(11,"i18n"),f.nI1(12,"i18n"),f.bIt("click",function(){return t.toggleTotalOpened()}),f.k0s()()(),f.DNE(13,De,32,22,"ng-container",9),f.bVm()),2&e&&(f.R7$(4),f.Lme("",f.bMT(5,6,"total"),": ",f.brH(6,8,t.summaryData.total-t.summaryData.totalAppliedDiscount,"USD","$")," USD"),f.R7$(4),f.SpI(" / ",f.bMT(9,12,t.summaryData.selectedPlanInterval)),f.R7$(2),f.Y8G("bitIconButton",t.summaryData.totalOpened?"bwi-angle-down":"bwi-angle-up")("label",t.summaryData.totalOpened?f.bMT(11,14,"hidePricingSummary"):f.bMT(12,16,"showPricingSummary")),f.R7$(3),f.Y8G("ngIf",t.summaryData.totalOpened))},dependencies:[N.bT,N.T3,N.ux,N.e1,N.fG,Q.I,ee.s,K.r,N.GH,N.oe,Y.$],encapsulation:2});var Me=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Ue=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};const Ge=e=>({type:"checkout",supportsTaxId:e});function je(e,t){1&e&&(f.j41(0,"li"),f.nrm(1,"i",14),f.EFF(2),f.nI1(3,"i18n"),f.k0s()),2&e&&(f.R7$(2),f.SpI(" ",f.bMT(3,1,"customRoles")," "))}function Ne(e,t){1&e&&(f.j41(0,"li"),f.nrm(1,"i",14),f.EFF(2),f.nI1(3,"i18n"),f.k0s()),2&e&&(f.R7$(2),f.SpI(" ",f.bMT(3,1,"unlimitedSecretsAndProjects")," "))}function Ve(e,t){if(1&e&&(f.j41(0,"ul",13)(1,"li"),f.nrm(2,"i",14),f.EFF(3),f.nI1(4,"i18n"),f.k0s(),f.j41(5,"li"),f.nrm(6,"i",14),f.EFF(7),f.nI1(8,"i18n"),f.k0s(),f.j41(9,"li"),f.nrm(10,"i",14),f.EFF(11),f.nI1(12,"i18n"),f.k0s(),f.DNE(13,je,4,3,"li",5)(14,Ne,4,3,"li",5),f.k0s()),2&e){const e=f.XpG();f.R7$(3),f.SpI(" ",f.bMT(4,5,"includeEnterprisePolicies")," "),f.R7$(4),f.SpI(" ",f.bMT(8,7,"passwordLessSso")," "),f.R7$(4),f.SpI(" ",f.bMT(12,9,"accountRecovery")," "),f.R7$(2),f.Y8G("ngIf",!(null!=e.organization&&e.organization.canAccessSecretsManager)),f.R7$(),f.Y8G("ngIf",null==e.organization?null:e.organization.canAccessSecretsManager)}}function Be(e,t){1&e&&(f.j41(0,"li"),f.nrm(1,"i",14),f.EFF(2),f.nI1(3,"i18n"),f.k0s()),2&e&&(f.R7$(2),f.SpI(" ",f.bMT(3,1,"unlimitedSecretsAndProjects")," "))}function ze(e,t){if(1&e&&(f.j41(0,"ul",13)(1,"li"),f.nrm(2,"i",14),f.EFF(3),f.nI1(4,"i18n"),f.k0s(),f.j41(5,"li"),f.nrm(6,"i",14),f.EFF(7),f.nI1(8,"i18n"),f.k0s(),f.j41(9,"li"),f.nrm(10,"i",14),f.EFF(11),f.nI1(12,"i18n"),f.k0s(),f.DNE(13,Be,4,3,"li",5),f.k0s()),2&e){const e=f.XpG();f.R7$(3),f.SpI(" ",f.bMT(4,4,"secureDataSharing")," "),f.R7$(4),f.SpI(" ",f.bMT(8,6,"eventLogMonitoring")," "),f.R7$(4),f.SpI(" ",f.bMT(12,8,"directoryIntegration")," "),f.R7$(2),f.Y8G("ngIf",null==e.organization?null:e.organization.canAccessSecretsManager)}}function Le(e,t){1&e&&(f.j41(0,"ul",13)(1,"li"),f.nrm(2,"i",14),f.EFF(3),f.nI1(4,"i18n"),f.k0s(),f.j41(5,"li"),f.nrm(6,"i",14),f.EFF(7),f.nI1(8,"i18n"),f.k0s(),f.j41(9,"li"),f.nrm(10,"i",14),f.EFF(11),f.nI1(12,"i18n"),f.k0s()()),2&e&&(f.R7$(3),f.SpI(" ",f.bMT(4,3,"premiumAccounts")," "),f.R7$(4),f.SpI(" ",f.bMT(8,5,"unlimitedSharing")," "),f.R7$(4),f.SpI(" ",f.bMT(12,7,"createUnlimitedCollections")," "))}function Ke(e,t){if(1&e){const e=f.RV6();f.j41(0,"app-plan-card",19),f.bIt("cardClicked",function(){const t=v.eBV(e).$implicit,i=f.XpG(3);return v.Njj(i.setSelected(t))}),f.k0s()}if(2&e){const e=t.$implicit;f.Y8G("plan",e)}}function qe(e,t){if(1&e&&(f.qex(0),f.j41(1,"div",17),f.Z7z(2,Ke,1,1,"app-plan-card",18,f.Vm6),f.k0s(),f.bVm()),2&e){const e=f.XpG(2);f.R7$(),f.HbH("tw-grid-cols-"+e.planCards().length),f.R7$(),f.Dyx(e.planCards())}}function _e(e,t){if(1&e&&(f.j41(0,"div")(1,"div",15)(2,"h4",16),f.EFF(3),f.nI1(4,"i18n"),f.k0s()(),f.DNE(5,qe,4,2,"ng-container",5),f.k0s()),2&e){const e=f.XpG();f.R7$(3),f.JRh(f.bMT(4,2,"selectAPlan")),f.R7$(2),f.Y8G("ngIf",e.planCards().length>0)}}function Xe(e,t){if(1&e&&f.nrm(0,"app-pricing-summary",20),2&e){const e=f.XpG();f.Y8G("summaryData",e.pricingSummaryData)}}const Ye={CLOSED:"closed",SUBMITTED:"submitted"};class He{constructor(e,t,i,r,s,o,a,l,c,d,u,h,p){var m;this.dialogParams=e,this.dialogRef=t,this.organizationService=i,this.i18nService=r,this.organizationApiService=s,this.accountService=o,this.planCardService=a,this.pricingSummaryService=l,this.apiService=c,this.toastService=d,this.organizationBillingApiServiceAbstraction=u,this.subscriberBillingClient=h,this.taxClient=p,this.productTypes=C.K_,this.selectedInterval=C.$y.Annually,this.planCards=(0,v.vPA)([]),this.onSuccess=new f.bkB,this.ResultType=Ye,this.formGroup=new g.gE({paymentMethod:R.Pu.getFormGroup(),billingAddress:R.vU.getFormGroup()}),this.destroy$=new n.B,this.refreshPricingSummary=()=>Me(this,void 0,void 0,function*(){const e=yield this.getEstimatedTax();this.pricingSummaryData=yield this.pricingSummaryService.getPricingSummaryData(this.currentPlan,this.sub,this.organization,this.selectedInterval,this.isSecretsManagerTrial(),e)}),this.getEstimatedTax=()=>Me(this,void 0,void 0,function*(){if(this.formGroup.controls.billingAddress.invalid)return 0;const e=this.currentPlan.productTier!==C.K_.Families?this.currentPlan.isAnnual?"annually":"monthly":null,t=(0,R.c3)(this.formGroup.controls.billingAddress),i=(e=>{switch(e.productTierType){case C.K_.Families:return"families";case C.K_.Teams:return"teams";case C.K_.Enterprise:return"enterprise"}})(this.organization);if(i&&e){return(yield this.taxClient.previewTaxForOrganizationSubscriptionPlanChange(this.organization.id,{tier:i,cadence:e},t)).tax}return 0}),this.initialPaymentMethod=null!==(m=this.dialogParams.initialPaymentMethod)&&void 0!==m?m:C.eq.Card}ngOnInit(){return Me(this,void 0,void 0,function*(){var e,t,i;this.currentPlanName=this.resolvePlanName(this.dialogParams.productTierType),this.sub=null!==(e=this.dialogParams.subscription)&&void 0!==e?e:yield this.organizationApiService.getSubscription(this.dialogParams.organizationId),this.organizationId=this.dialogParams.organizationId,this.currentPlan=null===(t=this.sub)||void 0===t?void 0:t.plan;const n=yield(0,y._)(this.accountService.activeAccount$.pipe((0,a.T)(e=>null==e?void 0:e.id)));if(!n)throw new Error("User ID is required");const r=yield(0,y._)(this.organizationService.organizations$(n).pipe((0,k.Sw)(this.organizationId)));if(!r)throw new Error("Organization not found");this.organization=r;const s=yield this.planCardService.getCadenceCards(this.currentPlan,this.sub,this.isSecretsManagerTrial());this.planCards.set(s),this.selectedInterval||(this.selectedInterval=(null===(i=s.find(e=>e.isSelected))||void 0===i?void 0:i.isAnnual)?C.$y.Annually:C.$y.Monthly);const l=yield this.subscriberBillingClient.getBillingAddress({type:"organization",data:this.organization});if(l){const{taxId:e}=l,t=Ue(l,["taxId"]);this.formGroup.controls.billingAddress.patchValue(Object.assign(Object.assign({},t),{taxId:e?e.value:null}))}yield this.refreshPricingSummary(),this.plans=yield this.apiService.getPlans(),(0,b.z)([this.formGroup.controls.billingAddress.controls.country.valueChanges.pipe((0,S.Z)(this.formGroup.controls.billingAddress.controls.country.value)),this.formGroup.controls.billingAddress.controls.postalCode.valueChanges.pipe((0,S.Z)(this.formGroup.controls.billingAddress.controls.postalCode.value)),this.formGroup.controls.billingAddress.controls.taxId.valueChanges.pipe((0,S.Z)(this.formGroup.controls.billingAddress.controls.taxId.value))]).pipe((0,I.B)(500),(0,o.n)(()=>this.refreshPricingSummary()),(0,w.Q)(this.destroy$)).subscribe()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}setSelected(e){return Me(this,void 0,void 0,function*(){this.selectedInterval=e.isAnnual?C.$y.Annually:C.$y.Monthly,this.planCards.update(e=>e.map(e=>e.isSelected?Object.assign(Object.assign({},e),{isSelected:!1}):Object.assign(Object.assign({},e),{isSelected:!0}))),yield this.selectPlan(),yield this.refreshPricingSummary()})}selectPlan(){return Me(this,void 0,void 0,function*(){if(this.selectedInterval===C.$y.Monthly&&this.currentPlan.productTier==C.K_.Families)return;const e=this.plans.data.filter(e=>e.productTier===this.currentPlan.productTier&&e.isAnnual===(this.selectedInterval===C.$y.Annually));e.length>0&&(this.currentPlan=e[0]);try{yield this.refreshPricingSummary()}catch(t){const e=t instanceof Error?t.message:String(t),i=this.i18nService.t(e);this.toastService.showToast({title:"",variant:"error",message:i&&""!==i?i:e})}})}isSecretsManagerTrial(){var e,t,i,n;return null!==(n=null===(i=null===(t=null===(e=this.sub)||void 0===e?void 0:e.subscription)||void 0===t?void 0:t.items)||void 0===i?void 0:i.some(e=>{var t,i,n;return null===(n=null===(i=null===(t=this.sub)||void 0===t?void 0:t.customerDiscount)||void 0===i?void 0:i.appliesTo)||void 0===n?void 0:n.includes(e.productId)}))&&void 0!==n&&n}onSubscribe(){return Me(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.invalid)try{const e=yield this.enterPaymentMethodComponent.tokenize();if(!e)return;const t=(0,R.c3)(this.formGroup.controls.billingAddress),i={type:"organization",data:this.organization};if(yield Promise.all([this.subscriberBillingClient.updatePaymentMethod(i,e,null),this.subscriberBillingClient.updateBillingAddress(i,t)]),this.currentPlan.type!==this.sub.planType){const e=new T;e.newPlanType=this.currentPlan.type,yield this.organizationBillingApiServiceAbstraction.changeSubscriptionFrequency(this.organizationId,e)}this.toastService.showToast({variant:"success",title:void 0,message:this.i18nService.t("updatedPaymentMethod")}),this.onSuccess.emit({organizationId:this.organizationId}),this.dialogRef.close(Ye.SUBMITTED)}catch(e){const t="object"==typeof e&&null!==e&&"message"in e?e.message:String(e);this.toastService.showToast({variant:"error",title:void 0,message:this.i18nService.t(t)||t})}})}resolvePlanName(e){switch(e){case C.K_.Enterprise:return this.i18nService.t("planNameEnterprise");case C.K_.Free:return this.i18nService.t("planNameFree");case C.K_.Families:return this.i18nService.t("planNameFamilies");case C.K_.Teams:return this.i18nService.t("planNameTeams");case C.K_.TeamsStarter:return this.i18nService.t("planNameTeamsStarter");default:return this.i18nService.t("planNameFree")}}get supportsTaxId(){return!!this.organization&&this.organization.productTierType!==C.K_.Families}}He.open=(e,t)=>e.open(He,t),He.ɵfac=function(e){return new(e||He)(f.rXU(F.Qs),f.rXU(D.ce),f.rXU(k.PV),f.rXU(M.W),f.rXU(U.X),f.rXU(G.Di),f.rXU($),f.rXU(A),f.rXU(P.G),f.rXU(O.f),f.rXU(j.C),f.rXU(m.Hd),f.rXU(m.jZ))},He.ɵcmp=f.VBU({type:He,selectors:[["app-trial-payment-dialog"]],viewQuery:function(e,t){if(1&e&&f.GBs(R.Pu,5),2&e){let e;f.mGM(e=f.lsd())&&(t.enterPaymentMethodComponent=e.first)}},outputs:{onSuccess:"onSuccess"},standalone:!1,features:[f.Jv_([m.Hd,m.jZ])],decls:28,vars:30,consts:[["dialogSize","default"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"ngSwitch"],["class","bwi-ul tw-text-xs",4,"ngSwitchCase"],[4,"ngIf"],["bitTypography","h4"],[3,"group"],[3,"group","scenario"],[3,"summaryData",4,"ngIf"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","button",3,"bitAction"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"],[1,"bwi-ul","tw-text-xs"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-muted","bwi-li"],[1,"tw-mb-3","tw-flex","tw-justify-between"],[1,"tw-text-lg","tw-text-main"],[1,"tw-grid","tw-grid-flow-col","tw-gap-4","tw-mb-2"],[3,"plan"],[3,"cardClicked","plan"],[3,"summaryData"]],template:function(e,t){1&e&&(f.j41(0,"bit-dialog",0)(1,"span",1),f.EFF(2),f.nI1(3,"i18n"),f.k0s(),f.j41(4,"div",2)(5,"p"),f.EFF(6),f.nI1(7,"i18n"),f.k0s(),f.qex(8,3),f.DNE(9,Ve,15,11,"ul",4)(10,ze,14,10,"ul",4)(11,Le,13,9,"ul",4),f.bVm(),f.DNE(12,_e,6,4,"div",5),f.qex(13),f.j41(14,"h2",6),f.EFF(15),f.nI1(16,"i18n"),f.k0s(),f.qex(17,2),f.nrm(18,"app-enter-payment-method",7)(19,"app-enter-billing-address",8),f.bVm(),f.DNE(20,Xe,1,1,"app-pricing-summary",9),f.bVm(),f.k0s(),f.qex(21,10),f.j41(22,"button",11),f.EFF(23),f.nI1(24,"i18n"),f.k0s(),f.j41(25,"button",12),f.EFF(26),f.nI1(27,"i18n"),f.k0s(),f.bVm(),f.k0s()),2&e&&(f.R7$(2),f.SpI(" ",f.i5U(3,16,"subscribetoEnterprise",t.currentPlanName)," "),f.R7$(4),f.JRh(f.i5U(7,19,"subscribeEnterpriseSubtitle",t.currentPlanName)),f.R7$(2),f.Y8G("ngSwitch",null==t.currentPlan?null:t.currentPlan.productTier),f.R7$(),f.Y8G("ngSwitchCase",t.productTypes.Enterprise),f.R7$(),f.Y8G("ngSwitchCase",t.productTypes.Teams),f.R7$(),f.Y8G("ngSwitchCase",t.productTypes.Families),f.R7$(),f.Y8G("ngIf",!((null==t.currentPlan?null:t.currentPlan.productTier)===t.productTypes.Families)),f.R7$(3),f.JRh(f.bMT(16,22,"paymentMethod")),f.R7$(3),f.Y8G("group",t.formGroup.controls.paymentMethod),f.R7$(),f.Y8G("group",t.formGroup.controls.billingAddress)("scenario",f.eq3(28,Ge,t.supportsTaxId)),f.R7$(),f.Y8G("ngIf",t.pricingSummaryData),f.R7$(2),f.Y8G("bitAction",t.onSubscribe.bind(t)),f.R7$(),f.SpI(" ",f.bMT(24,24,"subscribe")," "),f.R7$(2),f.Y8G("bitDialogClose",t.ResultType.CLOSED),f.R7$(),f.SpI(" ",f.bMT(27,26,"later")," "))},dependencies:[N.bT,N.ux,N.e1,V.p,B.Q,z.I,L.m,K.r,q.P,_.vU,Z,Oe,Y.$],encapsulation:2});var We=i(16452),Je=i(37115),Ze=i(23649),Qe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const et=e=>e.toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"});class tt{constructor(e,t,i,m,v,f){this.dialogService=e,this.i18nService=t,this.organizationApiService=i,this.organizationBillingClient=m,this.platformUtilsService=v,this.router=f,this.cache$=new Map,this.refreshFreeTrialWarningTrigger=new n.B,this.refreshTaxIdWarningTrigger=new n.B,this.refreshInactiveSubscriptionWarningTrigger=new n.B,this.taxIdWarningRefreshedSubject=new r.t(null),this.taxIdWarningRefreshed$=this.taxIdWarningRefreshedSubject.asObservable(),this.getFreeTrialWarning$=(e,t=!1)=>(0,s.h)(this.getWarning$(e,e=>e.freeTrial),this.refreshFreeTrialWarningTrigger.pipe((0,o.n)(()=>this.getWarning$(e,e=>e.freeTrial,!0)))).pipe((0,a.T)(i=>{if(!i)return null;const{remainingTrialDays:n}=i;return n>=2?{organization:e,message:t?this.i18nService.t("freeTrialEndPromptMultipleDays",e.name,n):this.i18nService.t("freeTrialEndPromptCount",n)}:1==n?{organization:e,message:t?this.i18nService.t("freeTrialEndPromptTomorrow",e.name):this.i18nService.t("freeTrialEndPromptTomorrowNoOrgName")}:{organization:e,message:t?this.i18nService.t("freeTrialEndPromptToday",e.name):this.i18nService.t("freeTrialEndingTodayWithoutOrgName")}})),this.getResellerRenewalWarning$=e=>this.getWarning$(e,e=>e.resellerRenewal).pipe((0,a.T)(t=>{if(!t)return null;switch(t.type){case"upcoming":return{type:"info",message:this.i18nService.t("resellerRenewalWarningMsg",e.providerName,et(t.upcoming.renewalDate))};case"issued":return{type:"info",message:this.i18nService.t("resellerOpenInvoiceWarningMgs",e.providerName,et(t.issued.issuedDate),et(t.issued.dueDate))};case"past_due":return{type:"warning",message:this.i18nService.t("resellerPastDueWarningMsg",e.providerName,et(t.pastDue.suspensionDate))}}})),this.getTaxIdWarning$=e=>(0,s.h)(this.getWarning$(e,e=>e.taxId),this.refreshTaxIdWarningTrigger.pipe((0,o.n)(()=>this.getWarning$(e,e=>e.taxId,!0).pipe((0,l.M)(e=>this.taxIdWarningRefreshedSubject.next(e?e.type:null)))))).pipe((0,a.T)(e=>e?e.type:null)),this.refreshFreeTrialWarning=()=>this.refreshFreeTrialWarningTrigger.next(),this.refreshInactiveSubscriptionWarning=()=>this.refreshInactiveSubscriptionWarningTrigger.next(),this.refreshTaxIdWarning=()=>this.refreshTaxIdWarningTrigger.next(),this.showInactiveSubscriptionDialog$=e=>(0,s.h)(this.getWarning$(e,e=>e.inactiveSubscription),this.refreshInactiveSubscriptionWarningTrigger.pipe((0,o.n)(()=>this.getWarning$(e,e=>e.inactiveSubscription,!0)))).pipe((0,o.n)(t=>Qe(this,void 0,void 0,function*(){if(t)switch(t.resolution){case"contact_provider":yield this.dialogService.openSimpleDialog({title:this.i18nService.t("suspendedOrganizationTitle",e.name),content:{key:"suspendedManagedOrgMessage",placeholders:[e.providerName]},type:"danger",acceptButtonText:this.i18nService.t("close"),cancelButtonText:null});break;case"add_payment_method":(yield this.dialogService.openSimpleDialog({title:this.i18nService.t("suspendedOrganizationTitle",e.name),content:{key:"suspendedOwnerOrgMessage"},type:"danger",acceptButtonText:this.i18nService.t("continue"),cancelButtonText:this.i18nService.t("close")}))&&(yield this.router.navigate(["organizations",`${e.id}`,"billing","payment-details"],{state:{launchPaymentModalAutomatically:!0}}));break;case"resubscribe":{const t=yield this.organizationApiService.getSubscription(e.id),i=(0,We.IO)(this.dialogService,{data:{organizationId:e.id,subscription:t,productTierType:e.productTierType}});yield(0,c.s)(i.closed);break}case"contact_owner":yield this.dialogService.openSimpleDialog({title:this.i18nService.t("suspendedOrganizationTitle",e.name),content:{key:"suspendedUserOrgMessage"},type:"danger",acceptButtonText:this.i18nService.t("close"),cancelButtonText:null})}}))),this.showSubscribeBeforeFreeTrialEndsDialog$=e=>this.getWarning$(e,e=>e.freeTrial).pipe((0,d.p)(e=>null!==e),(0,o.n)(()=>Qe(this,void 0,void 0,function*(){const t=yield this.organizationApiService.getSubscription(e.id),i=He.open(this.dialogService,{data:{organizationId:e.id,subscription:t,productTierType:null==e?void 0:e.productTierType}});(yield(0,c.s)(i.closed))===Ye.SUBMITTED&&this.refreshFreeTrialWarningTrigger.next()}))),this.readThroughWarnings$=(e,t=!1)=>{const i=e.id,n=this.cache$.get(i);if(n&&!t)return n;const r=(0,u.H)(this.organizationBillingClient.getWarnings(i));return this.cache$.set(i,r),r},this.getWarning$=(e,t,i=!1)=>this.platformUtilsService.isSelfHost()?(0,h.of)(null):this.readThroughWarnings$(e,i).pipe((0,a.T)(e=>{const i=t(e);return i||null}),(0,p.s)(1))}}tt.ɵfac=function(e){return new(e||tt)(v.KVO(D.o3),v.KVO(M.W),v.KVO(U.X),v.KVO(m.cK),v.KVO(Je.y),v.KVO(Ze.Ix))},tt.ɵprov=v.jDH({token:tt,factory:tt.ɵfac})},27790:(e,t,i)=>{"use strict";i.d(t,{u:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.ssoOrganizationIdentifier=this.getResponseProperty("SsoOrganizationIdentifier")}}},27866:(e,t,i)=>{"use strict";i.d(t,{m:()=>n});class n{}},28202:(e,t,i)=>{"use strict";i.d(t,{zh:()=>n,pM:()=>T,MH:()=>U,sK:()=>w,vE:()=>f,nb:()=>E,Fw:()=>G,yv:()=>M,uF:()=>O,YD:()=>g,it:()=>C,iY:()=>P,hQ:()=>B,wG:()=>v,Qd:()=>X,dw:()=>ne,Lf:()=>ge,tc:()=>be,Kt:()=>R,i0:()=>we,I:()=>Se,uB:()=>re,Kc:()=>Ie,IZ:()=>me,ME:()=>pe,u2:()=>ke,JS:()=>Ce,Wt:()=>Re,W7:()=>Te,YT:()=>Pe,Ki:()=>se,$3:()=>xe,I_:()=>$});class n{}var r=i(91968);class s{constructor(){this.enabled=!1,this.showSetupDialog=!0}}const o=r.Ok.record(r.vZ,"autoConfirm",{deserializer:e=>e,clearOn:[]});var a=i(3204),l=i(33338),c=i(72245),d=i(44500),u=i(82468),h=i(15639),p=i(78781),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class v{constructor(e,t,i,n,r,s){this.configService=e,this.apiService=t,this.organizationUserService=i,this.stateProvider=n,this.organizationService=r,this.organizationUserApiService=s}autoConfirmState(e){return this.stateProvider.getUser(e,o)}configuration$(e){return this.autoConfirmState(e).state$.pipe((0,a.T)(t=>{var i;return null!==(i=null==t?void 0:t[e])&&void 0!==i?i:new s}))}upsert(e,t){return m(this,void 0,void 0,function*(){yield this.autoConfirmState(e).update(i=>Object.assign(Object.assign({},i),{[e]:t}))})}canManageAutoConfirm$(e,t){return(0,l.z)([this.configService.getFeatureFlag$(u.TO.AutoConfirm),this.organizationService.organizations$(e).pipe((0,h.Hc)(t))]).pipe((0,a.T)(([e,t])=>{var i;return null!==(i=e&&(null==t?void 0:t.canManageUsers)&&(null==t?void 0:t.useAutomaticUserConfirmation))&&void 0!==i&&i}))}autoConfirmUser(e,t,i){return m(this,void 0,void 0,function*(){yield(0,c._)(this.canManageAutoConfirm$(e,i.id).pipe((0,a.T)(e=>{if(!e)throw new Error("Cannot automatically confirm user (insufficient permissions)");return e}),(0,d.n)(()=>this.apiService.getUserPublicKey(e)),(0,a.T)(e=>p.A.fromB64ToArray(e.publicKey)),(0,d.n)(e=>this.organizationUserService.buildConfirmRequest(i,e)),(0,d.n)(e=>this.organizationUserApiService.postOrganizationUserConfirm(i.id,t,e))))})}}class f{}class g{}class y{}class b{}class w extends b{constructor(e){super(),e&&(this.id=e.id,this.readOnly=e.readOnly,this.hidePasswords=e.hidePasswords,this.manage=e.manage)}}var S=i(39306),I=i(17989),k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const C={SharedCollection:0,DefaultUserCollection:1};class T extends I.A{constructor(e){super(),this.readOnly=!1,this.hidePasswords=!1,this.manage=!1,this.type=C.SharedCollection,this.id=e.id,this.name=e.name,this.organizationId=e.organizationId}static fromCollectionData(e){if(null==e||null==e.name||null==e.organizationId)throw new Error("CollectionData must contain name and organizationId.");const t=new T(Object.assign(Object.assign({},e),{name:new S.k(e.name)}));return t.externalId=e.externalId,t.readOnly=e.readOnly,t.hidePasswords=e.hidePasswords,t.manage=e.manage,t.type=e.type,t.defaultUserCollectionEmail=e.defaultUserCollectionEmail,t}static fromCollectionView(e,t,i){return k(this,void 0,void 0,function*(){const n=new T({name:yield t.encryptString(e.name,i),id:e.id,organizationId:e.organizationId});return n.externalId=e.externalId,n.readOnly=e.readOnly,n.hidePasswords=e.hidePasswords,n.manage=e.manage,n.type=e.type,n})}decrypt(e,t){return P.fromCollection(this,t,e)}static isCollectionId(e){return"string"==typeof e&&null!=e}}var F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const R="/";class P{constructor(e){this.readOnly=!1,this.hidePasswords=!1,this.manage=!1,this.assigned=!1,this.type=C.SharedCollection,this.id=e.id,this.organizationId=e.organizationId,this._name=e.name}set name(e){this._name=e}get name(){var e;return null!==(e=this.defaultUserCollectionEmail)&&void 0!==e?e:this._name}canEditItems(e){if(null!=e&&e.id!==this.organizationId)throw new Error("Id of the organization provided does not match the org id of the collection.");return(null==e?void 0:e.canEditAllCiphers)||this.manage||this.assigned&&!this.readOnly}canEdit(e){if(this.isDefaultCollection)return!1;if(null!=e&&e.id!==this.organizationId)throw new Error("Id of the organization provided does not match the org id of the collection.");return this.manage}canDelete(e){if(null!=e&&e.id!==this.organizationId)throw new Error("Id of the organization provided does not match the org id of the collection.");return(!(null==e?void 0:e.limitCollectionDeletion)||e.isAdmin)&&this.manage&&!this.isDefaultCollection}canViewCollectionInfo(e){return!1}canEditName(e){return this.canEdit(e)&&!this.defaultUserCollectionEmail}get isDefaultCollection(){return this.type==C.DefaultUserCollection}static vaultFilterHead(){return new P({id:"",organizationId:"",name:""})}static fromCollection(e,t,i){return F(this,void 0,void 0,function*(){const n=new P(Object.assign(Object.assign({},e),{name:""}));return n.name=yield t.decryptString(e.name,i),n.assigned=!0,n.externalId=e.externalId,n.readOnly=e.readOnly,n.hidePasswords=e.hidePasswords,n.manage=e.manage,n.type=e.type,n.defaultUserCollectionEmail=e.defaultUserCollectionEmail,n})}static fromCollectionAccessDetails(e,t,i){return F(this,void 0,void 0,function*(){const n=new P(Object.assign({},e));try{n.name=yield t.decryptString(new S.k(e.name),i)}catch(r){throw console.error("[CollectionView] Error decrypting collection name",r),r}return n.externalId=e.externalId,n.type=e.type,n.assigned=e.assigned,n.defaultUserCollectionEmail=e.defaultUserCollectionEmail,n})}static fromJSON(e){return Object.assign(new P(Object.assign({},e)),e)}encrypt(e,t){return T.fromCollectionView(this,t,e)}}var x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const $="unassigned";class E extends P{constructor(){super(...arguments),this.groups=[],this.users=[],this.unmanaged=!1,this.assigned=!1}canEdit(e){return!this.isDefaultCollection&&((null==e?void 0:e.canEditAnyCollection)||this.unmanaged&&(null==e?void 0:e.canEditUnmanagedCollections)||super.canEdit(e))}canDelete(e){return!this.isDefaultCollection&&((null==e?void 0:e.canDeleteAnyCollection)||super.canDelete(e))}canEditUserAccess(e){return!this.isDefaultCollection&&(e.permissions.manageUsers&&e.allowAdminAccessToAllCollectionItems||this.canEdit(e))}canEditGroupAccess(e){return!this.isDefaultCollection&&(e.permissions.manageGroups&&e.allowAdminAccessToAllCollectionItems||this.canEdit(e))}canViewCollectionInfo(e){var t,i;if(this.isUnassignedCollection||this.isDefaultCollection)return!1;const n=null!==(t=null==e?void 0:e.isAdmin)&&void 0!==t&&t,r=null!==(i=null==e?void 0:e.permissions.editAnyCollection)&&void 0!==i&&i;return this.manage||n||r}get isUnassignedCollection(){return this.id===$}canEditName(e){return this.canEdit(e)&&!this.defaultUserCollectionEmail||super.canEditName(e)}static fromCollectionAccessDetails(e,t,i){return x(this,void 0,void 0,function*(){const n=new E(Object.assign({},e));try{n.name=yield t.decryptString(new S.k(n.name),i)}catch(r){throw console.error("[CollectionAdminView/fromCollectionAccessDetails] Error decrypting collection name",r),r}return n.assigned=e.assigned,n.readOnly=e.readOnly,n.hidePasswords=e.hidePasswords,n.manage=e.manage,n.unmanaged=e.unmanaged,n.type=e.type,n.externalId=e.externalId,n.defaultUserCollectionEmail=e.defaultUserCollectionEmail,n.groups=e.groups?e.groups.map(e=>new w(e)):[],n.users=e.users?e.users.map(e=>new w(e)):[],n})}static fromCollectionResponse(e,t,i){return x(this,void 0,void 0,function*(){let n;try{n=yield t.decryptString(new S.k(e.name),i)}catch(s){throw console.error("[CollectionAdminView/fromCollectionResponse] Failed to decrypt the collection name",s),s}const r=new E({id:e.id,name:n,organizationId:e.organizationId});return r.externalId=e.externalId,r})}}var A=i(73409),D=i(20702);class O extends D.r{constructor(e){var t;super(e),this.type=C.SharedCollection,this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.name=this.getResponseProperty("Name"),this.externalId=this.getResponseProperty("ExternalId"),this.defaultUserCollectionEmail=this.getResponseProperty("DefaultUserCollectionEmail"),this.type=null!==(t=this.getResponseProperty("Type"))&&void 0!==t?t:C.SharedCollection}}class M extends O{constructor(e){super(e),this.readOnly=this.getResponseProperty("ReadOnly")||!1,this.manage=this.getResponseProperty("Manage")||!1,this.hidePasswords=this.getResponseProperty("HidePasswords")||!1,this.assigned="collectionDetails"==this.getResponseProperty("object")}}class U extends M{constructor(e){super(e),this.groups=[],this.users=[],this.assigned=this.getResponseProperty("Assigned")||!1,this.unmanaged=this.getResponseProperty("Unmanaged")||!1;const t=this.getResponseProperty("Groups");null!=t&&(this.groups=t.map(e=>new A.U(e)));const i=this.getResponseProperty("Users");null!=i&&(this.users=i.map(e=>new A.U(e)))}}class G{constructor(e){this.readOnly=!1,this.manage=!1,this.hidePasswords=!1,this.type=C.SharedCollection,this.id=e.id,this.organizationId=e.organizationId,this.name=e.name,this.externalId=e.externalId,this.readOnly=e.readOnly,this.manage=e.manage,this.hidePasswords=e.hidePasswords,this.type=e.type,this.defaultUserCollectionEmail=e.defaultUserCollectionEmail}static fromJSON(e){return null==e?null:Object.assign(new G(new M({})),e)}}class j{constructor(e){this.groups=[],this.users=[],this.externalId=e.externalId,e.groups&&(this.groups=e.groups),e.users&&(this.users=e.users)}}j.isUpdate=e=>e instanceof V;class N extends j{constructor(e){if(super(e),!e.name||!e.name.encryptedString)throw new Error("Name not provided for CollectionRequest.");this.name=e.name.encryptedString}}class V extends j{constructor(e){var t,i;super(e),this.name=null!==(i=null===(t=e.name)||void 0===t?void 0:t.encryptedString)&&void 0!==i?i:null}}class B extends j{constructor(e){if(null==e||null==e.name||null==e.name.encryptedString)throw new Error("CollectionWithIdRequest must contain name.");super({externalId:e.externalId}),this.name=e.name.encryptedString,this.id=e.id}}var z=i(84079),L=i(93695),K=i(67553),q=i(50545),_=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class X{constructor(e,t,i,n,r){this.apiService=e,this.keyService=t,this.encryptService=i,this.collectionService=n,this.organizationService=r}collectionAdminViews$(e,t){return(0,l.z)([this.keyService.orgKeys$(t),(0,z.H)(this.apiService.getManyCollectionsWithAccessDetails(e))]).pipe((0,d.n)(([t,i])=>{if(null==(null==i?void 0:i.data)||0===i.data.length)return(0,L.of)([]);if(null==t)throw new Error("No org keys found.");return this.decryptMany(e,i.data,t)}))}update(e,t){return _(this,void 0,void 0,function*(){const i=yield this.encrypt(e,t,!0);if(!j.isUpdate(i))throw new Error("Cannot update collection with CreateCollectionRequest.");const n=yield this.apiService.putCollection(e.organizationId,e.id,i);return yield this.updateLocalCollections(n,e,t),n})}create(e,t){return _(this,void 0,void 0,function*(){const i=yield this.encrypt(e,t,!1);if(j.isUpdate(i))throw new Error("Cannot create collection with UpdateCollectionRequest.");const n=yield this.apiService.postCollection(e.organizationId,i);return e.id=n.id,yield this.updateLocalCollections(n,e,t),n})}delete(e,t){return _(this,void 0,void 0,function*(){yield this.apiService.deleteCollection(e,t)})}updateLocalCollections(e,t,i){return _(this,void 0,void 0,function*(){e.assigned?yield this.collectionService.upsert(new G(e),i):yield this.collectionService.delete([t.id],i)})}bulkAssignAccess(e,t,i,n){return _(this,void 0,void 0,function*(){const r=new y;r.collectionIds=t,r.users=i.map(e=>new q.I(e.id,e.readOnly,e.hidePasswords,e.manage)),r.groups=n.map(e=>new q.I(e.id,e.readOnly,e.hidePasswords,e.manage)),yield this.apiService.send("POST",`/organizations/${e}/collections/bulk-access`,r,!0,!1)})}decryptMany(e,t,i){return _(this,void 0,void 0,function*(){const n=t.map(t=>_(this,void 0,void 0,function*(){return function(e){const t=e;return(null==t?void 0:t.groups)instanceof Array&&(null==t?void 0:t.users)instanceof Array}(t)?E.fromCollectionAccessDetails(t,this.encryptService,i[e]):yield E.fromCollectionResponse(t,this.encryptService,i[e])}));return yield Promise.all(n)})}encrypt(e,t,i){return _(this,void 0,void 0,function*(){if(!e.organizationId)throw new Error("Collection has no organization id.");const n=yield(0,c._)(this.keyService.orgKeys$(t).pipe((0,a.T)(t=>{if(!t)throw new Error("No keys for the provided userId.");const i=t[e.organizationId];if(null==i)throw new Error("No key for this collection's organization.");return i}))),r=e.groups.map(e=>new q.I(e.id,e.readOnly,e.hidePasswords,e.manage)),s=e.users.map(e=>new q.I(e.id,e.readOnly,e.hidePasswords,e.manage));if(i){const i=yield(0,c._)(this.organizationService.organizations$(t).pipe((0,K.Sw)(e.organizationId)));if(null==i)throw new Error("No Organization found.");return new V({name:e.canEditName(i)?yield this.encryptService.encryptString(e.name,n):null,externalId:e.externalId,users:s,groups:r})}return new N({name:yield this.encryptService.encryptString(e.name,n),externalId:e.externalId,users:s,groups:r})})}}var Y=i(81714),H=i(27442),W=i(69194),J=i(84679),Z=i(23567),Q=i(31857);const ee=Q.Ok.record(Q.PM,"collections",{deserializer:e=>G.fromJSON(e),clearOn:["logout"]}),te=new Q.Ok(Q.xS,"decryptedCollections",{deserializer:e=>{var t;return null!==(t=null==e?void 0:e.map(e=>P.fromJSON(e)))&&void 0!==t?t:null},clearOn:["logout","lock"]});var ie=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ne{constructor(e,t,i,n){this.keyService=e,this.encryptService=t,this.i18nService=i,this.stateProvider=n,this.collectionViewCache=new Map}encryptedState(e){return this.stateProvider.getUser(e,ee)}decryptedState(e){return this.stateProvider.getUser(e,te)}encryptedCollections$(e){return this.encryptedState(e).state$.pipe((0,a.T)(e=>null==e?null:Object.values(e).map(e=>T.fromCollectionData(e))))}decryptedCollections$(e){const t=this.collectionViewCache.get(e);if(t)return t;const i=this.decryptedState(e).state$.pipe((0,d.n)(t=>null!==t?(0,L.of)(null!=t?t:[]):this.initializeDecryptedState(e).pipe((0,d.n)(()=>Y.t))),(0,H.t)({bufferSize:1,refCount:!0}));return this.collectionViewCache.set(e,i),i}initializeDecryptedState(e){return(0,l.z)([this.encryptedCollections$(e),this.keyService.orgKeys$(e).pipe((0,W.p)(e=>!!e))]).pipe((0,d.n)(([t,i])=>this.decryptMany$(t,i).pipe((0,J.o)(t=>this.setDecryptedCollections(t,e)))))}upsert(e,t){return ie(this,void 0,void 0,function*(){if(null==e)return;yield this.encryptedState(t).update(t=>(null==t&&(t={}),t[e.id]=e,t));const i=yield(0,c._)(this.keyService.orgKeys$(t).pipe((0,d.n)(t=>{if(!t)throw new Error("No key for this collection's organization.");return this.decryptMany$([T.fromCollectionData(e)],t)})));yield this.decryptedState(t).update(t=>{if(null==t&&(t=[]),!(null==i?void 0:i.length))return t;const n=i[0],r=t.findIndex(t=>t.id==e.id);return r>=0?t[r]=n:t.push(n),t})})}replace(e,t){return ie(this,void 0,void 0,function*(){yield this.encryptedState(t).update(()=>e),yield this.decryptedState(t).update(()=>null)})}delete(e,t){return ie(this,void 0,void 0,function*(){yield this.encryptedState(t).update(t=>(null==t&&(t={}),e.forEach(e=>{delete t[e]}),t)),yield this.decryptedState(t).update(t=>(null==t&&(t=[]),e.forEach(e=>{var i;(null==t?void 0:t.length)&&(t=null!==(i=t.filter(t=>t.id!=e))&&void 0!==i?i:[])}),t))})}encrypt(e,t){return ie(this,void 0,void 0,function*(){const i=yield(0,c._)(this.keyService.orgKeys$(t).pipe((0,W.p)(e=>!!e),(0,a.T)(t=>t[e.organizationId])));return yield e.encrypt(i,this.encryptService)})}decryptMany$(e,t){if(null===e||0==e.length||null===t)return(0,L.of)([]);const i=[];return e.forEach(e=>{i.push((0,z.H)(e.decrypt(t[e.organizationId],this.encryptService)))}),(0,l.z)(i).pipe((0,a.T)(e=>e.sort(p.A.getSortFunction(this.i18nService,"name"))))}getAllNested(e){const t=this.groupByOrganization(e),i=[];for(const n of t.values()){const e=[];for(const t of n){const i=Object.assign(new P(Object.assign(Object.assign({},t),{name:t.name})),t),n=t.name?t.name.replace(/^\/+|\/+$/g,"").split("/"):[];Z.F.nestedTraverse(e,0,n,i,void 0,"/")}i.push(...e)}return i}groupByOrganization(e){const t=new Map;return e.map(e=>{var i;const n=e.organizationId;(null!==(i=t.get(n))&&void 0!==i?i:t.set(n,[]).get(n)).push(e)}),t}getNested(e,t){const i=this.getAllNested(e);return Z.F.getTreeNodeObjectFromList(i,t)}setDecryptedCollections(e,t){return ie(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(te,e,t)})}}class re{}class se{}var oe=i(12277);class ae{constructor(e){this.ids=null==e?[]:e}}var le=i(95919);class ce extends D.r{constructor(e){super(e),this.collections=[],this.groups=[],this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.permissions=new le.n(this.getResponseProperty("Permissions")),this.externalId=this.getResponseProperty("ExternalId"),this.accessSecretsManager=this.getResponseProperty("AccessSecretsManager"),this.resetPasswordEnrolled=this.getResponseProperty("ResetPasswordEnrolled"),this.hasMasterPassword=this.getResponseProperty("HasMasterPassword");const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map(e=>new A.U(e)));const i=this.getResponseProperty("Groups");null!=i&&(this.groups=i)}}class de extends ce{constructor(e){var t,i;super(e),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.avatarColor=this.getResponseProperty("AvatarColor"),this.twoFactorEnabled=this.getResponseProperty("TwoFactorEnabled"),this.usesKeyConnector=null!==(t=this.getResponseProperty("UsesKeyConnector"))&&void 0!==t&&t,this.managedByOrganization=null!==(i=this.getResponseProperty("ManagedByOrganization"))&&void 0!==i&&i}}class ue extends ce{constructor(e){var t;super(e),this.managedByOrganization=null!==(t=this.getResponseProperty("ManagedByOrganization"))&&void 0!==t&&t,this.ssoExternalId=this.getResponseProperty("SsoExternalId")}}class he extends D.r{constructor(e){super(e),this.organizationUserId=this.getResponseProperty("OrganizationUserId"),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism"),this.resetPasswordKey=this.getResponseProperty("ResetPasswordKey"),this.encryptedPrivateKey=this.getResponseProperty("EncryptedPrivateKey")}}class pe extends D.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}class me extends D.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.key=this.getResponseProperty("Key")}}class ve extends D.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.email=this.getResponseProperty("Email"),this.name=this.getResponseProperty("Name"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status")}}var fe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ge{constructor(e){this.apiService=e}getOrganizationUser(e,t,i){return fe(this,void 0,void 0,function*(){const n=new URLSearchParams;(null==i?void 0:i.includeGroups)&&n.set("includeGroups","true");const r=yield this.apiService.send("GET",`/organizations/${e}/users/${t}?${n.toString()}`,null,!0,!0);return new ue(r)})}getAllUsers(e,t){return fe(this,void 0,void 0,function*(){const i=new URLSearchParams;(null==t?void 0:t.includeCollections)&&i.set("includeCollections","true"),(null==t?void 0:t.includeGroups)&&i.set("includeGroups","true");const n=yield this.apiService.send("GET",`/organizations/${e}/users?${i.toString()}`,null,!0,!0);return new oe.s(n,de)})}getAllMiniUserDetails(e){return fe(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/organizations/${e}/users/mini-details`,null,!0,!0);return new oe.s(t,ve)})}getOrganizationUserResetPasswordDetails(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/users/"+t+"/reset-password-details",null,!0,!0);return new he(i)})}getManyOrganizationUserAccountRecoveryDetails(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/account-recovery-details",new ae(t),!0,!0);return new oe.s(i,he)})}postOrganizationUserInvite(e,t){return this.apiService.send("POST","/organizations/"+e+"/users/invite",t,!0,!1)}postOrganizationUserReinvite(e,t){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/reinvite",null,!0,!1)}postManyOrganizationUserReinvite(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/reinvite",new ae(t),!0,!0);return new oe.s(i,pe)})}postOrganizationUserAcceptInit(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/accept-init",i,!0,!1)}postOrganizationUserAccept(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/accept",i,!0,!1)}postOrganizationUserConfirm(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/confirm",i,!0,!1)}postOrganizationUserAutoConfirm(e,t,i){return this.apiService.send("POST","/organizations/"+e+"/users/"+t+"/auto-confirm",i,!0,!1)}postOrganizationUsersPublicKey(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/public-keys",new ae(t),!0,!0);return new oe.s(i,me)})}postOrganizationUserBulkConfirm(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/users/confirm",t,!0,!0);return new oe.s(i,pe)})}putOrganizationUserBulkEnableSecretsManager(e,t){return fe(this,void 0,void 0,function*(){yield this.apiService.send("PUT","/organizations/"+e+"/users/enable-secrets-manager",new ae(t),!0,!1)})}putOrganizationUser(e,t,i){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t,i,!0,!1)}putOrganizationUserResetPasswordEnrollment(e,t,i){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/reset-password-enrollment",i,!0,!1)}putOrganizationUserResetPassword(e,t,i){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/reset-password",i,!0,!1)}removeOrganizationUser(e,t){return this.apiService.send("DELETE","/organizations/"+e+"/users/"+t,null,!0,!1)}removeManyOrganizationUsers(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("DELETE","/organizations/"+e+"/users",new ae(t),!0,!0);return new oe.s(i,pe)})}revokeOrganizationUser(e,t){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/revoke",null,!0,!1)}revokeManyOrganizationUsers(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/users/revoke",new ae(t),!0,!0);return new oe.s(i,pe)})}restoreOrganizationUser(e,t){return this.apiService.send("PUT","/organizations/"+e+"/users/"+t+"/restore",null,!0,!1)}restoreManyOrganizationUsers(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/users/restore",new ae(t),!0,!0);return new oe.s(i,pe)})}deleteOrganizationUser(e,t){return this.apiService.send("DELETE","/organizations/"+e+"/users/"+t+"/delete-account",null,!0,!1)}deleteManyOrganizationUsers(e,t){return fe(this,void 0,void 0,function*(){const i=yield this.apiService.send("DELETE","/organizations/"+e+"/users/delete-account",new ae(t),!0,!0);return new oe.s(i,pe)})}}var ye=i(3633);class be{constructor(e,t,i,n,r){this.keyService=e,this.encryptService=t,this.organizationUserApiService=i,this.accountService=n,this.i18nService=r}orgKey$(e){return this.accountService.activeAccount$.pipe(ye.F6,(0,d.n)(e=>this.keyService.orgKeys$(e)),(0,W.p)(e=>!!e),(0,a.T)(t=>t[e.id]))}buildConfirmRequest(e,t){const i=this.getEncryptedDefaultCollectionName$(e),n=this.orgKey$(e).pipe((0,d.n)(e=>this.encryptService.encapsulateKeyUnsigned(e,t)));return(0,l.z)([n,i]).pipe((0,a.T)(([e,t])=>({key:e.encryptedString,defaultUserCollectionName:t.encryptedString})))}confirmUser(e,t,i){return this.buildConfirmRequest(e,i).pipe((0,d.n)(i=>this.organizationUserApiService.postOrganizationUserConfirm(e.id,t,i)))}bulkConfirmUsers(e,t){return this.getEncryptedDefaultCollectionName$(e).pipe((0,d.n)(i=>{const n=new Ie(t,i.encryptedString);return this.organizationUserApiService.postOrganizationUserBulkConfirm(e.id,n)}))}getEncryptedDefaultCollectionName$(e){return this.orgKey$(e).pipe((0,d.n)(e=>this.encryptService.encryptString(this.i18nService.t("myItems"),e)))}}class we{}class Se{}class Ie{constructor(e,t){this.keys=e,this.defaultUserCollectionName=t}}class ke{}class Ce{constructor(){this.emails=[],this.collections=[]}}class Te{static newConstructor(e,t){const i=new Te;return i.newMasterPasswordHash=e.masterPasswordAuthenticationHash,i.key=t.masterKeyWrappedUserKey,i}}var Fe=i(7248);class Re extends Fe.V{}class Pe extends Re{}class xe{constructor(){this.collections=[],this.groups=[]}}},28778:(e,t,i)=>{"use strict";i.d(t,{x:()=>n});class n{}},29029:(e,t,i)=>{"use strict";i.d(t,{t:()=>o});var n=i(56898),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.Q]})},29096:(e,t,i)=>{"use strict";i.d(t,{y:()=>V});var n=i(16878),r=i(36359),s=i(44500),o=i(27442),a=i(72245),l=i(3204),c=i(69194),d=i(84079);class u{constructor(e,t,i){this.id=e,this.encryptedPublicKey=t,this.encryptedUserKey=i}static fromRotateableKeyset(e,t){return new u(e,t.encryptedPublicKey,t.encryptedPrivateKey)}}var h=i(12117),p=i(56962),m=i(22848);class v{constructor(e,t){this.options=e,this.token=t}}class f{constructor(e,t,i){this.createOptions=e,this.deviceResponse=t,this.supportsPrf=i}}class g{constructor(e,t,i){this.id=e,this.name=t,this.prfStatus=i}}class y{}class b{}var w=i(78781);class S{constructor(e){this.id=e.id,this.rawId=w.A.fromBufferToB64(e.rawId),this.type=e.type,this.extensions={}}}class I extends S{constructor(e){if(super(e),!(e.response instanceof AuthenticatorAttestationResponse))throw new Error("Invalid authenticator response");this.response={attestationObject:w.A.fromBufferToUrlB64(e.response.attestationObject),clientDataJson:w.A.fromBufferToUrlB64(e.response.clientDataJSON)}}}var k=i(93824),C=i(12277),T=i(73556),F=i(20702);class R extends F.r{constructor(e){super(e),this.options=new T.Jq(this.getResponseProperty("options")),this.token=this.getResponseProperty("token")}}var P=i(39306),x=i(67529),$=i(40640);class E extends F.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.prfStatus=this.getResponseProperty("PrfStatus"),this.encryptedPublicKey=this.getResponseProperty("EncryptedPublicKey"),this.encryptedUserKey=this.getResponseProperty("EncryptedUserKey")}getRotateableKeyset(){if(!P.k.isSerializedEncString(this.encryptedUserKey))throw new Error("Invalid encrypted user key");if(!P.k.isSerializedEncString(this.encryptedPublicKey))throw new Error("Invalid encrypted public key");return new x.B(new P.k(this.encryptedUserKey),new P.k(this.encryptedPublicKey))}hasPrfKeyset(){return this.prfStatus===$.j.Enabled}}var A=i(74208),D=i(12012),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class M{constructor(e){this.apiService=e}getCredentialCreateOptions(e){return O(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/webauthn/attestation-options",e,!0,!0);return new R(t)})}getCredentialAssertionOptions(e){return O(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/webauthn/assertion-options",e,!0,!0);return new k.x(t)})}saveCredential(e){return O(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/webauthn",e,!0,!0),!0})}getCredentials(){return O(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/webauthn",null,!0,!0);return new C.s(e,E)})}deleteCredential(e,t){return O(this,void 0,void 0,function*(){yield this.apiService.send("POST",`/webauthn/${e}/delete`,t,!0,!0)})}updateCredential(e){return O(this,void 0,void 0,function*(){yield this.apiService.send("PUT","/webauthn",e,!0,!0)})}}M.ɵfac=function(e){return new(e||M)(A.KVO(D.G))},M.ɵprov=A.jDH({token:M,factory:M.ɵfac,providedIn:"root"});var U=i(62166),G=i(66827),j=i(25279),N=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class V{constructor(e,t,i,a,l,c,d){this.apiService=e,this.userVerificationService=t,this.rotateableKeySetService=i,this.webAuthnLoginPrfKeyService=a,this.keyService=l,this.logService=d,this._refresh$=new n.t(void 0),this._loading$=new n.t(!0),this.credentials$=this._refresh$.pipe((0,r.M)(()=>this._loading$.next(!0)),(0,s.n)(()=>this.fetchCredentials$()),(0,r.M)(()=>this._loading$.next(!1)),(0,o.t)({bufferSize:1,refCount:!0})),this.loading$=this._loading$.asObservable(),this.navigatorCredentials=null!=c?c:navigator.credentials}getCredentialAssertOptions(e){return N(this,void 0,void 0,function*(){const t=yield this.userVerificationService.buildRequest(e),i=yield this.apiService.getCredentialAssertionOptions(t);return new h.E(i.options,i.token)})}getCredentialAttestationOptions(e){return N(this,void 0,void 0,function*(){const t=yield this.userVerificationService.buildRequest(e),i=yield this.apiService.getCredentialCreateOptions(t);return new v(i.options,i.token)})}createCredential(e){return N(this,void 0,void 0,function*(){var t,i;const n={publicKey:e.options};n.publicKey.extensions={prf:{}};try{const i=yield this.navigatorCredentials.create(n);if(!(i instanceof PublicKeyCredential))return;const r=Boolean(null===(t=i.getClientExtensionResults().prf)||void 0===t?void 0:t.enabled);return new f(e,i,r)}catch(r){return void(null===(i=this.logService)||void 0===i||i.error(r))}})}createKeySet(e,t){return N(this,void 0,void 0,function*(){var i,n,r;const s={publicKey:{challenge:e.createOptions.options.challenge,allowCredentials:[{id:e.deviceResponse.rawId,type:"public-key"}],rpId:e.createOptions.options.rp.id,timeout:e.createOptions.options.timeout,userVerification:e.createOptions.options.authenticatorSelection.userVerification,extensions:{prf:{eval:{first:yield this.webAuthnLoginPrfKeyService.getLoginWithPrfSalt()}}}}};try{const e=yield this.navigatorCredentials.get(s);if(!(e instanceof PublicKeyCredential))return;const r=null===(n=null===(i=e.getClientExtensionResults().prf)||void 0===i?void 0:i.results)||void 0===n?void 0:n.first;if(void 0===r)return;const o=yield this.webAuthnLoginPrfKeyService.createSymmetricKeyFromPrf(r),l=yield(0,a._)(this.keyService.userKey$(t));return yield this.rotateableKeySetService.createKeySet(o,l)}catch(o){return void(null===(r=this.logService)||void 0===r||r.error(o))}})}saveCredential(e,t,i){return N(this,void 0,void 0,function*(){const n=new b;n.deviceResponse=new I(t.deviceResponse),n.token=t.createOptions.token,n.name=e,n.supportsPrf=t.supportsPrf,n.encryptedUserKey=null==i?void 0:i.encapsulatedDownstreamKey.encryptedString,n.encryptedPublicKey=null==i?void 0:i.encryptedPublicKey.encryptedString,n.encryptedPrivateKey=null==i?void 0:i.encryptedPrivateKey.encryptedString,yield this.apiService.saveCredential(n),this.refresh()})}enableCredentialEncryption(e,t){return N(this,void 0,void 0,function*(){if(void 0===e||void 0===(null==e?void 0:e.prfKey))throw new Error("invalid credential");if(!t)throw new Error("userId is required");const i=yield(0,a._)(this.keyService.userKey$(t)),n=yield this.rotateableKeySetService.createKeySet(e.prfKey,i),r=new y;r.token=e.token,r.deviceResponse=e.deviceResponse,r.encryptedUserKey=n.encapsulatedDownstreamKey.encryptedString,r.encryptedPublicKey=n.encryptedPublicKey.encryptedString,r.encryptedPrivateKey=n.encryptedPrivateKey.encryptedString,yield this.apiService.updateCredential(r),this.refresh()})}getCredentials$(){return this.credentials$}getCredential$(e){return this.credentials$.pipe((0,l.T)(t=>t.find(t=>t.id===e)),(0,c.p)(e=>void 0!==e))}deleteCredential(e,t){return N(this,void 0,void 0,function*(){const i=yield this.userVerificationService.buildRequest(t);yield this.apiService.deleteCredential(e,i),this.refresh()})}fetchCredentials$(){return(0,d.H)(this.apiService.getCredentials()).pipe((0,l.T)(e=>e.data.map(e=>new g(e.id,e.name,e.prfStatus))))}refresh(){this._refresh$.next()}getRotatedData(e,t,i){return N(this,void 0,void 0,function*(){if(!e)throw new Error("oldUserKey is required");if(!t)throw new Error("newUserKey is required");return Promise.all((yield this.apiService.getCredentials()).data.filter(e=>e.hasPrfKeyset()).map(i=>N(this,void 0,void 0,function*(){const n=i.getRotateableKeyset(),r=yield this.rotateableKeySetService.rotateKeySet(n,e,t);return new u(i.id,r.encryptedPublicKey,r.encapsulatedDownstreamKey)})))})}}V.MaxCredentialCount=5,V.ɵfac=function(e){return new(e||V)(A.KVO(M),A.KVO(U.i),A.KVO(G.y),A.KVO(j.u),A.KVO(m.Lu),A.KVO(CredentialsContainer,8),A.KVO(p.K,8))},V.ɵprov=A.jDH({token:V,factory:V.ɵfac,providedIn:"root"})},29377:(e,t,i)=>{"use strict";var n;i.d(t,{T:()=>n,v:()=>r}),function(e){e.US="US",e.EU="EU",e.SelfHosted="Self-hosted"}(n||(n={}));class r{}},29400:(e,t,i)=>{"use strict";i.d(t,{d:()=>r});var n=i(74208);class r{constructor(){this._portal=(0,n.vPA)(void 0),this.portal=this._portal.asReadonly()}open(e){this._portal.set(e)}close(e){e===this.portal()&&this._portal.set(void 0)}}r.ɵfac=function(e){return new(e||r)},r.ɵprov=n.jDH({token:r,factory:r.ɵfac,providedIn:"root"})},29730:(e,t,i)=>{"use strict";i.d(t,{y:()=>_});var n=i(72245),r=i(93241),s=i(82468),o=i(39306),a=i(56962),l=i(62870),c=i(66523),d=i(68467),u=i(43890),h=i(39488),p=i(22848),m=i(78212),v=i(82781),f=i(45151),g=i(38420),y=i(65071);class b{constructor(e,t){this.securityState=e,this.securityVersion=t}}var w=i(78781);class S{constructor(e,t,i){this.wrappedPrivateKey=e,this.publicKey=w.A.fromBufferToB64(t),this.signedPublicKey=i}}class I{constructor(e,t,i){this.signatureAlgorithm=i,this.wrappedSigningKey=e,this.verifyingKey=t}}var k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(){this.userKeyEncryptedAccountPrivateKey=null,this.accountPublicKey=null,this.publicKeyEncryptionKeyPair=null,this.signatureKeyPair=null,this.securityState=null}static fromV1CryptographicState(e){const t=new C;return t.userKeyEncryptedAccountPrivateKey=e.publicKeyEncryptionKeyPair.wrappedPrivateKey,t.accountPublicKey=w.A.fromBufferToB64(e.publicKeyEncryptionKeyPair.publicKey),t.publicKeyEncryptionKeyPair=new S(e.publicKeyEncryptionKeyPair.wrappedPrivateKey,e.publicKeyEncryptionKeyPair.publicKey,null),t}static fromV2CryptographicState(e){return k(this,void 0,void 0,function*(){yield l.B.Ready;const t=new C;return t.userKeyEncryptedAccountPrivateKey=e.publicKeyEncryptionKeyPair.wrappedPrivateKey,t.accountPublicKey=w.A.fromBufferToB64(e.publicKeyEncryptionKeyPair.publicKey),t.publicKeyEncryptionKeyPair=new S(e.publicKeyEncryptionKeyPair.wrappedPrivateKey,e.publicKeyEncryptionKeyPair.publicKey,e.publicKeyEncryptionKeyPair.signedPublicKey),t.signatureKeyPair=new I(e.signatureKeyPair.wrappedSigningKey,e.signatureKeyPair.verifyingKey,v.PureCrypto.key_algorithm_for_verifying_key(w.A.fromB64ToArray(e.signatureKeyPair.verifyingKey))),t.securityState=new b(e.securityState.securityState,e.securityState.securityStateVersion),t})}}class T{constructor(e,t,i,n,r){this.kdfType=p.ao.PBKDF2_SHA256,this.kdfIterations=0,this.kdfType=e.kdfType,this.kdfIterations=e.iterations,e.kdfType===p.ao.Argon2id&&(this.kdfMemory=e.memory,this.kdfParallelism=e.parallelism),this.email=t,this.masterKeyAuthenticationHash=i,this.masterKeyEncryptedUserKey=n,this.masterPasswordHint=r}}class F{constructor(e,t,i,n){this.accountUnlockData=e,this.accountKeys=t,this.accountData=i,this.oldMasterKeyAuthenticationHash=n}}class R{constructor(e,t,i,n,r){this.masterPasswordUnlockData=e,this.emergencyAccessUnlockData=t,this.organizationAccountRecoveryUnlockData=i,this.passkeyUnlockData=n,this.deviceKeyUnlockData=r}}class P{constructor(e,t,i){this.ciphers=e,this.folders=t,this.sends=i}}function x(e){return{userKey:u.e.fromString(e.userKey),publicKeyEncryptionKeyPair:{wrappedPrivateKey:e.privateKey,publicKey:w.A.fromB64ToArray(e.publicKey),signedPublicKey:e.signedPublicKey},signatureKeyPair:{wrappedSigningKey:e.signingKey,verifyingKey:e.verifyingKey},securityState:{securityState:e.securityState,securityStateVersion:e.securityVersion}}}var $=i(5864),E=i(74208),A=i(5556),D=i(74526),O=i(60954),M=i(39935),U=i(89105),G=i(69855),j=i(21274),N=i(50700),V=i(1601),B=i(45872),z=i(74683),L=i(75633),K=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class q{constructor(){}get_access_token(){return K(this,void 0,void 0,function*(){})}}class _{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g,y,b,w){this.apiService=e,this.cipherService=t,this.folderService=i,this.sendService=n,this.emergencyAccessService=r,this.resetPasswordService=s,this.deviceTrustService=o,this.keyService=a,this.encryptService=l,this.syncService=c,this.webauthnLoginAdminService=d,this.logService=u,this.logoutService=h,this.toastService=p,this.i18nService=m,this.dialogService=v,this.configService=f,this.cryptoFunctionService=g,this.kdfConfigService=y,this.sdkClientFactory=b,this.securityStateService=w}rotateUserKeyMasterPasswordAndEncryptedData(e,t,i,n){return K(this,void 0,void 0,function*(){yield l.B.Ready;const r=yield this.configService.getFeatureFlag(s.TO.EnrollAeadOnKeyRotation);this.logService.info("[UserKey Rotation] Starting user key rotation..."),yield this.ensureIsAllowedToRotateUserKey();const{wasTrustDenied:o,trustedOrganizationPublicKeys:a,trustedEmergencyAccessUserPublicKeys:c}=yield this.verifyTrust(i);if(o)return void this.logService.info("[Userkey rotation] Trust was denied by user. Aborting!");const{masterKeyKdfConfig:d,masterKeySalt:u,cryptographicStateParameters:h}=yield this.getCryptographicStateForUser(i),{userKey:p,accountKeysRequest:m}=yield this.getRotatedAccountKeysFlagged(i.id,d,i.email,h,r),v=new F(yield this.getAccountUnlockDataRequest(i.id,h.userKey,p,{masterPassword:t,masterKeyKdfConfig:d,masterKeySalt:u,masterPasswordHint:n},c,a),m,yield this.getAccountDataRequest(h.userKey,p,i),yield this.makeServerMasterKeyAuthenticationHash(e,d,u));this.logService.info("[Userkey rotation] Posting user key rotation request to server"),yield this.apiService.postUserKeyUpdate(v),this.logService.info("[Userkey rotation] Userkey rotation request posted to server"),this.toastService.showToast({variant:"success",title:this.i18nService.t("rotationCompletedTitle"),message:this.i18nService.t("rotationCompletedDesc"),timeout:15e3}),yield this.logoutService.logout(i.id)})}ensureIsAllowedToRotateUserKey(){return K(this,void 0,void 0,function*(){if(null===(yield this.syncService.getLastSync()))throw this.logService.info("[Userkey rotation] Client was never synced. Aborting!"),new Error("The local vault is de-synced and the keys cannot be rotated. Please log out and log back in to resolve this issue.")})}getRotatedAccountKeysFlagged(e,t,i,n,r){return K(this,void 0,void 0,function*(){if(r||2===n.version){const r=yield this.getNewAccountKeysV2(e,t,i,n);return{userKey:r.userKey,accountKeysRequest:yield C.fromV2CryptographicState(r)}}{const e=yield this.getNewAccountKeysV1(n);return{userKey:e.userKey,accountKeysRequest:C.fromV1CryptographicState(e)}}})}getNewAccountKeysV1(e){return K(this,void 0,void 0,function*(){const t=new u.e(v.PureCrypto.make_user_key_aes256_cbc_hmac()),i=yield this.encryptService.unwrapDecapsulationKey(new o.k(e.publicKeyEncryptionKeyPair.wrappedPrivateKey),e.userKey);return{userKey:t,publicKeyEncryptionKeyPair:{wrappedPrivateKey:(yield this.encryptService.wrapDecapsulationKey(i,t)).encryptedString,publicKey:yield this.cryptoFunctionService.rsaExtractPublicKey(i)}}})}getNewAccountKeysV2(e,t,i,n){return K(this,void 0,void 0,function*(){return 1===n.version?this.upgradeV1UserToV2UserAccountKeys(e,t,i,n):this.rotateV2UserAccountKeys(e,t,i,n)})}upgradeV1UserToV2UserAccountKeys(e,t,i,n){return K(this,void 0,void 0,function*(){const r=yield this.sdkClientFactory.createSdkClient(new q);return yield r.crypto().initialize_user_crypto({userId:(0,c.WD)(e),kdfParams:t.toSdkConfig(),email:i,accountCryptographicState:{V1:{private_key:n.publicKeyEncryptionKeyPair.wrappedPrivateKey}},method:{decryptedKey:{decrypted_user_key:n.userKey.toBase64()}}}),x(r.crypto().make_keys_for_user_crypto_v2())})}rotateV2UserAccountKeys(e,t,i,n){return K(this,void 0,void 0,function*(){const r=yield this.sdkClientFactory.createSdkClient(new q);return yield r.crypto().initialize_user_crypto({userId:(0,c.WD)(e),kdfParams:t.toSdkConfig(),email:i,accountCryptographicState:{V2:{private_key:n.publicKeyEncryptionKeyPair.wrappedPrivateKey,signing_key:n.signingKey,security_state:n.securityState,signed_public_key:n.publicKeyEncryptionKeyPair.signedPublicKey}},method:{decryptedKey:{decrypted_user_key:n.userKey.toBase64()}}}),x(r.crypto().get_v2_rotated_account_keys())})}createMasterPasswordUnlockDataRequest(e,t){return K(this,void 0,void 0,function*(){const i=new o.k(v.PureCrypto.encrypt_user_key_with_master_password(e.toEncoded(),t.masterPassword,t.masterKeySalt,t.masterKeyKdfConfig.toSdkConfig())),n=yield this.makeServerMasterKeyAuthenticationHash(t.masterPassword,t.masterKeyKdfConfig,t.masterKeySalt);return new T(t.masterKeyKdfConfig,t.masterKeySalt,n,i.encryptedString,t.masterPasswordHint)})}getAccountUnlockDataRequest(e,t,i,n,r,s){return K(this,void 0,void 0,function*(){let o;this.isUserWithMasterPassword(e)&&(o=yield this.createMasterPasswordUnlockDataRequest(i,n));const a=yield this.webauthnLoginAdminService.getRotatedData(t,i,e),l=yield this.deviceTrustService.getRotatedData(t,i,e),c=yield this.emergencyAccessService.getRotatedData(i,r,e),d=yield this.resetPasswordService.getRotatedData(i,s,e);return new R(o,c,d,a,l)})}verifyTrust(e){return K(this,void 0,void 0,function*(){this.logService.info("[Userkey rotation] Verifying trust...");const t=yield this.emergencyAccessService.getPublicKeys(),i=yield this.resetPasswordService.getPublicKeys(e.id);if(i.length>0||t.length>0){const e=m.Fh.open(this.dialogService,{numberOfEmergencyAccessUsers:t.length,orgName:i.length>0?i[0].orgName:void 0});if(!(yield(0,n._)(e.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}for(const e of i){const t=m.QY.open(this.dialogService,{name:e.orgName,orgId:e.orgId,publicKey:e.publicKey});if(!(yield(0,n._)(t.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}for(const e of t){const t=m.$t.open(this.dialogService,{name:e.name,userId:e.granteeId,publicKey:e.publicKey});if(!(yield(0,n._)(t.closed)))return{wasTrustDenied:!0,trustedOrganizationPublicKeys:[],trustedEmergencyAccessUserPublicKeys:[]}}return this.logService.info("[Userkey rotation] Trust verified for all organizations and emergency access users"),{wasTrustDenied:!1,trustedOrganizationPublicKeys:i.map(e=>e.publicKey),trustedEmergencyAccessUserPublicKeys:t.map(e=>e.publicKey)}})}getAccountDataRequest(e,t,i){return K(this,void 0,void 0,function*(){const n=yield this.cipherService.getRotatedData(e,t,i.id),r=yield this.folderService.getRotatedData(e,t,i.id),s=yield this.sendService.getRotatedData(e,t,i.id);if(null==n||null==r||null==s)throw this.logService.info("[Userkey rotation] ciphers, folders, or sends are null. Aborting!"),new Error("ciphers, folders, or sends are null");return new P(n,r,s)})}isV1User(e){return e.inner().type===d.Qd.AesCbc256_HmacSha256_B64}isUserWithMasterPassword(e){return!0}makeServerMasterKeyAuthenticationHash(e,t,i){return K(this,void 0,void 0,function*(){const n=yield this.keyService.makeMasterKey(e,i,t);return this.keyService.hashMasterKey(e,n,d.VK.ServerAuthorization)})}getCryptographicStateForUser(e){return K(this,void 0,void 0,function*(){const t=yield this.firstValueFromOrThrow(this.kdfConfigService.getKdfConfig$(e.id),"KDF config"),i=e.email.trim().toLowerCase(),n=yield this.firstValueFromOrThrow(this.keyService.userKey$(e.id),"User key"),r=new o.k(yield this.firstValueFromOrThrow(this.keyService.userEncryptedPrivateKey$(e.id),"Private key")).encryptedString,s=yield this.cryptoFunctionService.rsaExtractPublicKey(yield this.encryptService.unwrapDecapsulationKey(new o.k(r),n));if(this.isV1User(n))return{masterKeyKdfConfig:t,masterKeySalt:i,cryptographicStateParameters:{version:1,userKey:n,publicKeyEncryptionKeyPair:{wrappedPrivateKey:r,publicKey:s}}};if(n.inner().type===d.Qd.CoseEncrypt0){const o=yield this.firstValueFromOrThrow(this.keyService.userSigningKey$(e.id),"User signing key"),a=yield this.firstValueFromOrThrow(this.securityStateService.accountSecurityState$(e.id),"User security state");return{masterKeyKdfConfig:t,masterKeySalt:i,cryptographicStateParameters:{version:2,userKey:n,publicKeyEncryptionKeyPair:{wrappedPrivateKey:r,publicKey:s,signedPublicKey:yield this.firstValueFromOrThrow(this.keyService.userSignedPublicKey$(e.id),"User signed public key")},signingKey:o,securityState:a}}}throw new Error(`Unsupported user key type: ${n.inner().type}. Expected AesCbc256_HmacSha256_B64 or XChaCha20_Poly1305_B64.`)})}firstValueFromOrThrow(e,t){return K(this,void 0,void 0,function*(){const i=yield(0,n._)(e);if(null==i)throw new Error(`Failed to get ${t}`);return i})}}_.ɵfac=function(e){return new(e||_)(E.KVO($.Q),E.KVO(A.p),E.KVO(D.k),E.KVO(O.u),E.KVO(y.p),E.KVO(f.w),E.KVO(M.M),E.KVO(p.Lu),E.KVO(U.N),E.KVO(h.H),E.KVO(g.yB),E.KVO(a.K),E.KVO(r.k4),E.KVO(G.f),E.KVO(N.W),E.KVO(j.o3),E.KVO(V.w),E.KVO(B.R),E.KVO(p.zZ),E.KVO(z.k),E.KVO(L.p))},_.ɵprov=E.jDH({token:_,factory:_.ɵfac,providedIn:"root"})},29744:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});class n{}},29776:(e,t,i)=>{"use strict";i.d(t,{oG:()=>ve,I4:()=>Et,qG:()=>$t,iE:()=>a,PG:()=>Gt,IQ:()=>q,WV:()=>ge,ZU:()=>fe,WX:()=>H,Hi:()=>n,MP:()=>Pt,$S:()=>Rt,xu:()=>Tt,W0:()=>xt,yJ:()=>Ft,r5:()=>s,$p:()=>r,Wy:()=>o});var n={};i.r(n),i.d(n,{Lq:()=>$e,Mt:()=>xe,sF:()=>Se,q4:()=>Y,Zx:()=>je,zT:()=>Ve,QS:()=>ze});var r={};i.r(r),i.d(r,{P:()=>Gt,q:()=>Z});var s={};i.r(s),i.d(s,{i:()=>Bt,O:()=>zt});var o={};i.r(o),i.d(o,{B:()=>ui,KQ:()=>fi,ji:()=>ei,jK:()=>ai,gb:()=>ci,Vm:()=>pi});class a{}const l=Object.freeze({catchallType:"random",catchallDomain:"",website:null});const c=function(){const e=Object.freeze({min:3,max:20});return Object.freeze({numWords:e})}();const d=function(){const e=Object.freeze({min:5,max:128}),t=Object.freeze({min:0,max:9}),i=Object.freeze({min:0,max:9});return Object.freeze({length:e,minDigits:t,minSpecialCharacters:i})}(),u=Object.freeze({wordCapitalize:!1,wordIncludeNumber:!1,website:null}),h=Object.freeze({numWords:6,wordSeparator:"-",capitalize:!1,includeNumber:!1}),p=Object.freeze({length:14,minLength:d.length.min,ambiguous:!0,uppercase:!0,minUppercase:1,lowercase:!0,minLowercase:1,number:!0,minNumber:1,special:!1,minSpecial:0}),m=Object.freeze({subaddressType:"random",subaddressEmail:"",website:null});var v=i(31857),f=i(19638),g=i(48312);class y{constructor(e){this.keys=e}classify(e){const t=JSON.parse(JSON.stringify(e)),i={};for(const n of this.keys)i[n]=t[n];return{disclosed:i,secret:null}}declassify(e,t){const i={};for(const n of this.keys)i[n]=e[n];return i}}var b=i(4132);const w=Object.freeze({token:"",domain:"",baseUrl:""}),S=Object.freeze({url:(e,t)=>t.baseUrl()+"/api/v1/aliases",body:(e,t)=>({domain:t.emailDomain(),description:t.generatedBy(e,{extractHostname:!0,maxLength:200})}),hasJsonPayload:e=>200===e.status||201===e.status,processJson(e){var t;return[null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.email]}}),I=Object.freeze({defaultSettings:w,createForwardingEmail:S,request:["token","baseUrl","domain"],settingsConstraints:{token:{required:!0},domain:{required:!0},baseUrl:{}},local:{settings:{key:"addyIoForwarder",target:"object",format:"secret-state",frame:512,classifier:new g.r,state:v.qd,initial:w,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.AddyIo.local.import",target:"object",format:"plain",classifier:new y(["token","baseUrl","domain"]),state:v.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new v.Ok(v.qd,"addyIoForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new b.A(v.qd,"addyIoBuffer",{deserializer:e=>e,clearOn:["logout"]})}),k=Object.freeze({id:f.N.addyio,name:"Addy.io",extends:["forwarder"],selfHost:"maybe",baseUrl:"https://app.addy.io",authenticate:(e,t)=>({Authorization:"Bearer "+t.authenticationToken()}),forwarder:I}),C=Object.freeze({token:""}),T=Object.freeze({url:(e,t)=>t.baseUrl()+"/email/addresses",body(e,t){},hasJsonPayload:e=>200===e.status||201===e.status,processJson:e=>[`${e.address}@duck.com`]}),F=Object.freeze({defaultSettings:C,createForwardingEmail:T,request:["token"],settingsConstraints:{token:{required:!0}},local:{settings:{key:"duckDuckGoForwarder",target:"object",format:"secret-state",frame:512,classifier:new g.r,state:v.qd,initial:C,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.DuckDuckGo.local.import",target:"object",format:"plain",classifier:new y(["token"]),state:v.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new v.Ok(v.qd,"duckDuckGoForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new b.A(v.qd,"duckDuckGoBuffer",{deserializer:e=>e,clearOn:["logout"]})}),R=Object.freeze({id:f.N.duckduckgo,name:"DuckDuckGo",baseUrl:"https://quack.duckduckgo.com/api",selfHost:"never",extends:["forwarder"],authenticate:(e,t)=>({Authorization:"Bearer "+t.authenticationToken()}),forwarder:F}),P=Object.freeze({domain:"",prefix:"",token:""}),x=Object.freeze({url:(e,t)=>t.baseUrl()+"/jmap/session",hasJsonPayload:e=>200===e.status,processJson(e,t){var i,n;const r=null!==(n=null===(i=e.primaryAccounts)||void 0===i?void 0:i["https://www.fastmail.com/dev/maskedemail"])&&void 0!==n?n:void 0;return[r,r?void 0:t.missingAccountIdCause()]}}),$=Object.freeze({url:(e,t)=>t.baseUrl()+"/jmap/api/",body:(e,t)=>({using:["https://www.fastmail.com/dev/maskedemail","urn:ietf:params:jmap:core"],methodCalls:[["MaskedEmail/set",{accountId:e.accountId,create:{"new-masked-email":{state:"enabled",description:"",forDomain:t.website(e),emailPrefix:""}}},"0"]]}),hasJsonPayload:e=>200===e.status,processJson(e){var t,i,n,r,s,o,a,l,c,d,u;if(null!=e.methodResponses&&e.methodResponses.length>0&&e.methodResponses[0].length>0)if("MaskedEmail/set"===e.methodResponses[0][0]){if(null!=(null===(i=null===(t=e.methodResponses[0][1])||void 0===t?void 0:t.created)||void 0===i?void 0:i["new-masked-email"])){return[null===(s=null===(r=null===(n=e.methodResponses[0][1])||void 0===n?void 0:n.created)||void 0===r?void 0:r["new-masked-email"])||void 0===s?void 0:s.email]}if(null!=(null===(a=null===(o=e.methodResponses[0][1])||void 0===o?void 0:o.notCreated)||void 0===a?void 0:a["new-masked-email"])){return[void 0,null===(d=null===(c=null===(l=e.methodResponses[0][1])||void 0===l?void 0:l.notCreated)||void 0===c?void 0:c["new-masked-email"])||void 0===d?void 0:d.description]}}else if("error"===e.methodResponses[0][0]){return[void 0,null===(u=e.methodResponses[0][1])||void 0===u?void 0:u.description]}}}),E=Object.freeze({defaultSettings:P,createForwardingEmail:$,getAccountId:x,request:["token"],settingsConstraints:{token:{required:!0},domain:{required:!0},prefix:{}},local:{settings:{key:"fastmailForwarder",target:"object",format:"secret-state",frame:512,classifier:new g.r,state:v.qd,initial:P,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.Fastmail.local.import",target:"object",format:"plain",classifier:new y(["token"]),state:v.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new v.Ok(v.qd,"fastmailForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new b.A(v.qd,"fastmailBuffer",{deserializer:e=>e,clearOn:["logout"]})}),A=Object.freeze({id:f.N.fastmail,name:"Fastmail",baseUrl:"https://api.fastmail.com",selfHost:"maybe",extends:["forwarder"],authenticate:(e,t)=>({Authorization:"Bearer "+t.authenticationToken()}),forwarder:E}),D=Object.freeze({token:""}),O=Object.freeze({url:(e,t)=>t.baseUrl()+"/v1/relayaddresses/",body:(e,t)=>({enabled:!0,generated_for:t.website(e,{maxLength:255}),description:t.generatedBy(e,{extractHostname:!0,maxLength:64})}),hasJsonPayload:e=>200===e.status||201===e.status,processJson:e=>[e.full_address]}),M=Object.freeze({defaultSettings:D,createForwardingEmail:O,request:["token"],settingsConstraints:{token:{required:!0}},local:{settings:{key:"firefoxRelayForwarder",target:"object",format:"secret-state",frame:512,classifier:new g.r,state:v.qd,initial:D,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.Firefox.local.import",target:"object",format:"plain",classifier:new y(["token"]),state:v.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new v.Ok(v.qd,"firefoxRelayForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new b.A(v.qd,"firefoxRelayBuffer",{deserializer:e=>e,clearOn:["logout"]})}),U=Object.freeze({id:f.N.mozilla,name:"Firefox Relay",baseUrl:"https://relay.firefox.com/api",selfHost:"never",extends:["forwarder"],authenticate:(e,t)=>({Authorization:"Token "+t.authenticationToken()}),forwarder:M}),G=Object.freeze({token:"",domain:""}),j=Object.freeze({url(e,t){const i=t.emailDomain();return t.baseUrl()+`/v1/domains/${i}/aliases`},body:(e,t)=>({labels:t.website(e),description:t.generatedBy(e)}),hasJsonPayload:e=>200===e.status||201===e.status,processJson(e,t){var i;const{name:n,domain:r}=e;return[`${n}@${null!==(i=null==r?void 0:r.name)&&void 0!==i?i:t.emailDomain()}`]}}),N=Object.freeze({defaultSettings:G,request:["token","domain"],settingsConstraints:{token:{required:!0},domain:{required:!0}},local:{settings:{key:"forwardEmailForwarder",target:"object",format:"secret-state",frame:512,classifier:new g.r,state:v.qd,initial:G,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.ForwardEmail.local.import",target:"object",format:"plain",classifier:new y(["token","domain"]),state:v.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new v.Ok(v.qd,"forwardEmailForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new b.A(v.qd,"forwardEmailBuffer",{deserializer:e=>e,clearOn:["logout"]}),createForwardingEmail:j}),V=Object.freeze({id:f.N.forwardemail,name:"Forward Email",extends:["forwarder"],selfHost:"never",baseUrl:"https://api.forwardemail.net",authenticate:(e,t)=>({Authorization:"Basic "+t.authenticationToken({base64:!0,suffix:":"})}),forwarder:N}),B=Object.freeze({token:"",domain:"",baseUrl:""}),z=Object.freeze({url(e,t){const i=t.baseUrl()+"/api/alias/random/new",n=t.website(e);return""!==n?`${i}?hostname=${n}`:i},body:(e,t)=>({note:t.generatedBy(e)}),hasJsonPayload:e=>200===e.status||201===e.status,processJson:e=>[null==e?void 0:e.alias]}),L=Object.freeze({defaultSettings:B,createForwardingEmail:z,request:["token","baseUrl"],settingsConstraints:{token:{required:!0}},local:{settings:{key:"simpleLoginForwarder",target:"object",format:"secret-state",frame:512,classifier:new g.r,state:v.qd,initial:B,options:{deserializer:e=>e,clearOn:["logout"]}},import:{key:"forwarder.SimpleLogin.local.import",target:"object",format:"plain",classifier:new y(["token","baseUrl"]),state:v.kj,options:{deserializer:e=>e,clearOn:["logout","lock"]}}},settings:new v.Ok(v.qd,"simpleLoginForwarder",{deserializer:e=>e,clearOn:[]}),importBuffer:new b.A(v.qd,"simpleLoginBuffer",{deserializer:e=>e,clearOn:["logout"]})}),K=Object.freeze({id:f.N.simplelogin,name:"SimpleLogin",selfHost:"maybe",extends:["forwarder"],baseUrl:"https://app.simplelogin.io",authenticate:(e,t)=>({Authentication:t.authenticationToken()}),forwarder:L}),q=Object.freeze({AddyIo:k,DuckDuckGo:R,Fastmail:A,FirefoxRelay:U,ForwardEmail:V,SimpleLogin:K}),_=new Map(Object.values(q).map(e=>[e.id,e]));var X=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Y{constructor(e){this.keyService=e}pick(e){return X(this,void 0,void 0,function*(){var t;if((null!==(t=null==e?void 0:e.length)&&void 0!==t?t:0)<=0)throw new Error("list must have at least one entry.");const i=yield this.uniform(0,e.length-1);return e[i]})}pickWord(e,t){return X(this,void 0,void 0,function*(){var i,n;let r=yield this.pick(e);if(null!==(i=null==t?void 0:t.titleCase)&&void 0!==i&&i&&(r=r.charAt(0).toUpperCase()+r.slice(1)),null!==(n=null==t?void 0:t.number)&&void 0!==n&&n){r+=(yield this.keyService.randomNumber(1,9)).toString()}return r})}shuffle(e,t){return X(this,void 0,void 0,function*(){var i,n;if((null!==(i=null==e?void 0:e.length)&&void 0!==i?i:0)<=0)throw new Error("items must have at least one entry.");const r=null===(n=null==t?void 0:t.copy)||void 0===n||n?[...e]:e;for(let e=r.length-1;e>0;e--){const t=yield this.uniform(0,e);[r[e],r[t]]=[r[t],r[e]]}return r})}chars(e){return X(this,void 0,void 0,function*(){let t="";const i="abcdefghijklmnopqrstuvwxyz1234567890";for(let n=0;n<e;n++){const e=yield this.uniform(0,35);t+=i.charAt(e)}return t})}uniform(e,t){return X(this,void 0,void 0,function*(){return this.keyService.randomNumber(e,t)})}}function H(e){return new Y(e)}var W=i(72245),J=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Z{constructor(e,t){this.strategy=e,this.policy=t,this._evaluators$=new Map}options$(e){return this.strategy.durableState(e).state$}defaults$(e){return this.strategy.defaults$(e)}saveOptions(e,t){return J(this,void 0,void 0,function*(){yield this.strategy.durableState(e).update(()=>t)})}evaluator$(e){let t=this._evaluators$.get(e);return t||(t=this.createEvaluator(e),this._evaluators$.set(e,t)),t}createEvaluator(e){return this.policy.policiesByType$(this.strategy.policy,e).pipe(this.strategy.toEvaluator())}enforcePolicy(e,t){return J(this,void 0,void 0,function*(){const i=yield(0,W._)(this.evaluator$(e)),n=i.applyPolicy(t);return i.sanitize(n)})}generate(e){return J(this,void 0,void 0,function*(){return yield this.strategy.generate(e)})}}var Q=i(27442),ee=i(44500),te=i(93695),ie=i(14928),ne=i(69194),re=i(88507),se=i(3204),oe=i(36359),ae=i(3097),le=i(72737),ce=i(8029),de=i(96141),ue=i(73276),he=i(14803),pe=i(20377),me=i(78991);const ve=Object.freeze({password:"password",passphrase:"passphrase",username:"username",catchall:"catchall",plusAddress:"subaddress"}),fe=Object.freeze({password:"password",username:"username",email:"email"}),ge=Object.freeze({account:"account"}),ye=(0,me.ol)({[fe.password]:[ve.password,ve.passphrase],[fe.username]:[ve.username],[fe.email]:[ve.catchall,ve.plusAddress]});var be=i(78781);class we{constructor(e,t,i){this.metadata=e,this.settings=t,this.i18n=i}baseUrl(){var e,t;const i=null!==(e=this.settings&&"baseUrl"in this.settings?this.settings.baseUrl:void 0)&&void 0!==e?e:"";let n="";if(n="always"===this.metadata.selfHost?i:"never"===this.metadata.selfHost||i.length<=0?null!==(t=this.metadata.baseUrl)&&void 0!==t?t:"":i,""===n){throw this.i18n.t("forwarderNoUrl",this.metadata.name)}return n}authenticationToken(e=null){var t,i;let n="token"in this.settings&&null!==(t=this.settings.token)&&void 0!==t?t:"";if(""===n){throw this.i18n.t("forwaderInvalidToken",this.metadata.name)}return n+=null!==(i=null==e?void 0:e.suffix)&&void 0!==i?i:"",(null==e?void 0:e.base64)&&(n=be.A.fromUtf8ToB64(n)),n}website(e,t){var i,n;let r=null!==(i=e.website)&&void 0!==i?i:"";return(null==t?void 0:t.extractHostname)&&(r=null!==(n=be.A.getHost(r))&&void 0!==n?n:r),r.slice(0,null==t?void 0:t.maxLength)}generatedBy(e,t){var i;const n=this.website(e,{extractHostname:null!==(i=null==t?void 0:t.extractHostname)&&void 0!==i&&i}),r=""===n?"forwarderGeneratedBy":"forwarderGeneratedByWithWebsite";return this.i18n.t(r,n).slice(0,null==t?void 0:t.maxLength)}}class Se extends we{constructor(e,t,i){super(e,t,i),this.configuration=e}emailDomain(){var e;const t="domain"in this.settings&&null!==(e=this.settings.domain)&&void 0!==e?e:"";if(""===t){throw this.i18n.t("forwarderNoDomain",this.configuration.name)}return t}emailPrefix(){var e;const t="prefix"in this.settings&&null!==(e=this.settings.prefix)&&void 0!==e?e:"";if(""===t){throw this.i18n.t("forwarderNoPrefix",this.configuration.name)}return t}missingAccountIdCause(){return this.i18n.t("forwarderNoAccountId",this.configuration.name)}}var Ie=i(30126);class ke{constructor(e,t,i,n,r){this.credential=e,this.category=t,this.source=n,this.website=r,this.generationDate="number"==typeof i?new Date(i):i}static fromJSON(e){return new ke(e.credential,e.category,e.generationDate)}toJSON(){return{credential:this.credential,category:this.category,generationDate:this.generationDate.valueOf()}}}function Ce(e){const t=e.split("");return Object.freeze(t)}const Te=Ce("!@#$%^&*"),Fe=Object.freeze({Full:Object.freeze({Uppercase:Ce("ABCDEFGHIJKLMNOPQRSTUVWXYZ"),Lowercase:Ce("abcdefghijklmnopqrstuvwxyz"),Digit:Ce("0123456789"),Special:Te}),Unmistakable:Object.freeze({Uppercase:Ce("ABCDEFGHJKLMNPQRSTUVWXYZ"),Lowercase:Ce("abcdefghijkmnopqrstuvwxyz"),Digit:Ce("23456789"),Special:Te})}),Re=new RegExp("(?<username>[^@+]+)(?<subaddress>\\+.+)?(?<domain>@.+)");var Pe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class xe{constructor(e){this.random=e}randomAsciiSubaddress(e,t){return Pe(this,void 0,void 0,function*(){var i,n;let r=null!=e?e:"";const s=null!==(i=null==t?void 0:t.length)&&void 0!==i?i:8;if(s<1)return r;const o=Re.exec(r);if(!o)return r;let a=null!==(n=o.groups.subaddress)&&void 0!==n?n:"+";return a+=(yield this.random.chars(s)),r=`${o.groups.username}${a}${o.groups.domain}`,r})}randomAsciiCatchall(e,t){return Pe(this,void 0,void 0,function*(){var i;if(((null==e?void 0:e.startsWith("@"))?e.substring(1,1/0):null!=e?e:"").length<1)return null;const n=null!==(i=null==t?void 0:t.length)&&void 0!==i?i:8;if(n<1)return null;return`${yield this.random.chars(n)}@${e}`})}randomWordsCatchall(e,t){return Pe(this,void 0,void 0,function*(){var i,n;if(((null==e?void 0:e.startsWith("@"))?e.substring(1,1/0):null!=e?e:"").length<1)return null;const r=null!==(i=null==t?void 0:t.numberOfWords)&&void 0!==i?i:1;if(r<1)return null;const s=null!==(n=null==t?void 0:t.words)&&void 0!==n?n:Ie.o,o=[];for(let e=0;e<r;e++)o[e]=yield this.random.pickWord(s,{titleCase:0!==e});return`${o.join("")}@${e}`})}generate(e,t){return Pe(this,void 0,void 0,function*(){if(function(e){return"catchallDomain"in(null!=e?e:{})}(t)){const i=yield this.randomAsciiCatchall(t.catchallDomain);return new ke(i,fe.email,Date.now(),e.source,e.website)}if(function(e){return"subaddressEmail"in(null!=e?e:{})}(t)){const i=yield this.randomAsciiSubaddress(t.subaddressEmail);return new ke(i,fe.email,Date.now(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}class $e{appendToSubaddress(e,t){var i;let n=(null!=t?t:"").trim();const r=(null!=e?e:"").trim();if(r.length<1)return n;const s=Re.exec(n);if(!s)return n;const o=(null!==(i=s.groups.subaddress)&&void 0!==i?i:"+")+r;return n=`${s.groups.username}${o}${s.groups.domain}`,n}concatenate(e,t){const i=(null==t?void 0:t.startsWith("@"))?t.substring(1,1/0):null!=t?t:"";if(i.length<1)return null;const n=null!=e?e:"";if(n.length<1)return null;return`${n}@${i}`}}var Ee=i(16878);function Ae(e){const t=new Map;return i=>{let n=t.get(i);if(void 0===n){const r=e();n=new Ee.t(Object.assign({},r)),t.set(i,n)}return n.asObservable()}}function De(e,t){return i=>t.getUser(i,e)}const Oe=(...e)=>(null!=e?e:[]).reduce((e,t)=>e+(null!=t?t:0),0);function Me(e){var t,i;function n(e,t,i,n){return(null!=e?e:i)?null!=t?t:n:void 0}const r={uppercase:n(e.uppercase,e.minUppercase,p.uppercase,p.minUppercase),lowercase:n(e.lowercase,e.minLowercase,p.lowercase,p.minLowercase),digits:n(e.number,e.minNumber,p.number,p.minNumber),special:n(e.special,e.minSpecial,p.special,p.minSpecial),ambiguous:null!==(t=e.ambiguous)&&void 0!==t?t:p.ambiguous,all:0},s=Oe(r.uppercase,r.lowercase,r.digits,r.special),o=(null!==(i=e.length)&&void 0!==i?i:0)-s;return r.all=Math.max(o,0),r}function Ue(e){var t,i,n,r;const s=null!==(t=e.numWords)&&void 0!==t?t:h.numWords;return{numberOfWords:Math.max(s,c.numWords.min),capitalize:null!==(i=e.capitalize)&&void 0!==i?i:h.capitalize,number:null!==(n=e.includeNumber)&&void 0!==n?n:h.includeNumber,separator:null!==(r=e.wordSeparator)&&void 0!==r?r:h.wordSeparator}}var Ge=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class je{constructor(e,t){this.randomizer=e,this.currentTime=t}randomAscii(e){return Ge(this,void 0,void 0,function*(){const t=function(e){function t(e,t){const i=new Array(e>0?e:0);return i.fill(t,0,e),i}const i=[],n=e.ambiguous?Fe.Full:Fe.Unmistakable,r=[];void 0!==e.uppercase&&(r.push(...t(e.uppercase,n.Uppercase)),i.push(...n.Uppercase));void 0!==e.lowercase&&(r.push(...t(e.lowercase,n.Lowercase)),i.push(...n.Lowercase));void 0!==e.digits&&(r.push(...t(e.digits,n.Digit)),i.push(...n.Digit));void 0!==e.special&&(r.push(...t(e.special,n.Special)),i.push(...n.Special));return r.push(...t(e.all,i)),r}(e),i=(yield this.randomizer.shuffle(t)).flatMap(e=>this.randomizer.pick(e));return(yield Promise.all(i)).join("")})}randomEffLongWords(e){return Ge(this,void 0,void 0,function*(){let t=-1;e.number&&(t=yield this.randomizer.uniform(0,e.numberOfWords-1));const i=new Array(e.numberOfWords);for(let n=0;n<e.numberOfWords;n++){const r=yield this.randomizer.pickWord(Ie.o,{titleCase:e.capitalize,number:n===t});i[n]=r}return i.join(e.separator)})}generate(e,t){return Ge(this,void 0,void 0,function*(){if(function(e){return"length"in(null!=e?e:{})}(t)){const i=Me(t),n=yield this.randomAscii(i);return new ke(n,fe.password,this.currentTime(),e.source,e.website)}if(function(e){return"numWords"in(null!=e?e:{})}(t)){const i=Ue(t),n=yield this.randomEffLongWords(i);return new ke(n,fe.password,this.currentTime(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}var Ne=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ve{constructor(e,t){this.client=e,this.currentTime=t}generate(e,t){return Ne(this,void 0,void 0,function*(){if(function(e){return"length"in(null!=e?e:{})}(t)){const i=yield this.client.generator().password(function(e){return{lowercase:e.lowercase,uppercase:e.uppercase,numbers:e.number,special:e.special,length:e.length,avoidAmbiguous:e.ambiguous,minLowercase:e.minLowercase,minUppercase:e.minUppercase,minNumber:e.minNumber,minSpecial:e.minSpecial}}(t));return new ke(i,fe.password,this.currentTime(),e.source,e.website)}if(function(e){return"numWords"in(null!=e?e:{})}(t)){const i=yield this.client.generator().passphrase(function(e){return{numWords:e.numWords,wordSeparator:e.wordSeparator,capitalize:e.capitalize,includeNumber:e.includeNumber}}(t));return new ke(i,fe.password,this.currentTime(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}var Be=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ze{constructor(e){this.random=e}randomWords(e){return Be(this,void 0,void 0,function*(){var t,i,n;const r=null!==(t=null==e?void 0:e.numberOfWords)&&void 0!==t?t:1;if(r<1)return"";const s=Math.max(null!==(i=null==e?void 0:e.digits)&&void 0!==i?i:0,0);let o=e=>!1;"camelCase"===(null==e?void 0:e.casing)?o=e=>0!==e:"TitleCase"===(null==e?void 0:e.casing)&&(o=e=>!0);const a=null!==(n=null==e?void 0:e.words)&&void 0!==n?n:Ie.o,l=[];for(let e=0;e<r;e++){const t=yield this.random.pickWord(a,{titleCase:o(e)});l.push(t)}for(let e=0;e<s;e++){const e=yield this.random.uniform(0,9);l.push(e.toString())}return l.join("")})}generate(e,t){return Be(this,void 0,void 0,function*(){if(function(e){return"wordIncludeNumber"in(null!=e?e:{})}(t)){const i=yield this.randomWords({digits:t.wordIncludeNumber?4:0,casing:t.wordCapitalize?"TitleCase":"lowercase"});return new ke(i,"username",Date.now(),e.source,e.website)}throw new Error("Invalid settings received by generator.")})}}const Le=new RegExp("[^@]+@(?<domain>.+)");class Ke{constructor(e){var t;if(this.constraints={},!e)return void(this.domain="");const i=Le.exec(e);i&&(null===(t=i.groups)||void 0===t?void 0:t.domain)&&(this.domain=i.groups.domain)}adjust(e){var t;if(""!==(null!==(t=e.catchallDomain)&&void 0!==t?t:"").trim())return e;const i=Object.assign({},e);return i.catchallDomain=this.domain,i}fix(e){return e}}const qe=(0,me.ol)({id:ve.catchall,type:fe.email,weight:210,i18nKeys:{name:"catchallEmail",description:"catchallEmailDesc",credentialType:"email",generateCredential:"generateEmail",credentialGenerated:"emailGenerated",copyCredential:"copyEmail",useCredential:"useThisEmail"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>new xe(e.randomizer)},profiles:{[ge.account]:{type:"core",storage:{key:"catchallGeneratorSettings",target:"object",format:"plain",classifier:new y(["catchallType","catchallDomain"]),state:v.qd,initial:{catchallType:"random",catchallDomain:""},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{catchallDomain:{minLength:1}},create(e,t){var i;return new Ke(null!==(i=t.email)&&void 0!==i?i:"")}}}}});class _e{constructor(e){this.email=e,this.constraints={},e||(this.email="")}adjust(e){var t;if(""!==(null!==(t=e.subaddressEmail)&&void 0!==t?t:"").trim())return e;const i=Object.assign({},e);return i.subaddressEmail=this.email,i}fix(e){return e}}const Xe=(0,me.ol)({id:ve.plusAddress,type:fe.email,weight:200,i18nKeys:{name:"plusAddressedEmail",description:"plusAddressedEmailDesc",credentialType:"email",generateCredential:"generateEmail",credentialGenerated:"emailGenerated",copyCredential:"copyEmail",useCredential:"useThisEmail"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>new xe(e.randomizer)},profiles:{[ge.account]:{type:"core",storage:{key:"subaddressGeneratorSettings",target:"object",format:"plain",classifier:new y(["subaddressType","subaddressEmail"]),state:v.qd,initial:{subaddressType:"random",subaddressEmail:""},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{},create(e,t){var i;return new _e(null!==(i=t.email)&&void 0!==i?i:"")}}}}});var Ye=i(43978);class He{get policy(){return{}}get policyInEffect(){return!1}applyPolicy(e){return e}sanitize(e){return e}}const We={min:0,max:0},Je={min:1},Ze={requiredValue:!0};function Qe(e,t){var i;const n=Oe(...t.map(e=>null==e?void 0:e.min));return tt(Math.max(null!==(i=null==e?void 0:e.min)&&void 0!==i?i:0,n),e)}function et(e,t){return e?t:void 0}function tt(e,t){var i;if(null==e)return t;const n=Object.assign({},null!=t?t:{});return n.min=Math.max(null!==(i=n.min)&&void 0!==i?i:-1/0,e),"max"in n&&(n.max=Math.max(n.max,e)),n}function it(e,t){if(!t)return e;const{min:i,max:n}=t,r=Math.min(null!=e?e:0,null!=n?n:1/0);return Math.max(r,null!=i?i:-1/0)}function nt(e,t,i){if(!t)return e;const{minLength:n,maxLength:r}=t,{fillString:s}=null!=i?i:{fillString:" "},o=(null!=e?e:"").slice(0,null!=r?r:1/0);return o.padEnd(null!=n?n:o.length,s)}function rt(e,t){return(null==t?void 0:t.readonly)?t.requiredValue:e}function st(e){return et(e,function(e,t){if(!e)return t;const i=Object.assign({},null!=t?t:{});return i.readonly=!0,i}(e,Ze))}class ot{constructor(e){this.constraints=e}adjust(e){const t=Object.assign(Object.assign({},null!=e?e:p),{length:it(e.length,this.constraints.length),lowercase:rt(e.lowercase,this.constraints.lowercase),uppercase:rt(e.uppercase,this.constraints.uppercase),number:rt(e.number,this.constraints.number),special:rt(e.special,this.constraints.special),minLowercase:it(e.minLowercase,this.constraints.minLowercase),minUppercase:it(e.minUppercase,this.constraints.minUppercase),minNumber:it(e.minNumber,this.constraints.minNumber),minSpecial:it(e.minSpecial,this.constraints.minSpecial)});t.lowercase||(t.lowercase=e.minLowercase>0),t.uppercase||(t.uppercase=e.minUppercase>0),t.number||(t.number=e.minNumber>0),t.special||(t.special=e.minSpecial>0);return[t.lowercase,t.uppercase,t.number,t.special].some(e=>e)||(t.lowercase=!0,t.uppercase=!0),t}fix(e){return e}}class at{constructor(e,t){this.defaults=t;const i=et(e.useLowercase,Je),n=et(e.useUppercase,Je),r=tt(e.numberCount||e.useNumbers&&Je.min,t.minNumber),s=tt(e.specialCount||e.useSpecial&&Je.min,t.minSpecial),o=Qe(tt(e.minLength,t.length),[i,n,r,s]);this.constraints=Object.freeze({policyInEffect:lt(e,t),lowercase:st(e.useLowercase),uppercase:st(e.useUppercase),number:st(e.useNumbers),special:st(e.useSpecial),length:o,minLowercase:i,minUppercase:n,minNumber:r,minSpecial:s})}calibrate(e){var t,i,n,r,s,o,a,l;const c=e.lowercase||(null===(t=this.constraints.lowercase)||void 0===t?void 0:t.requiredValue)||!1,d=e.uppercase||(null===(i=this.constraints.uppercase)||void 0===i?void 0:i.requiredValue)||!1,u=e.number||(null===(n=this.constraints.number)||void 0===n?void 0:n.requiredValue)||!1,h=e.special||(null===(r=this.constraints.special)||void 0===r?void 0:r.requiredValue)||!1,p=Object.assign(Object.assign({},this.constraints),{minLowercase:et(c,null!==(s=this.constraints.minLowercase)&&void 0!==s?s:Je),minUppercase:et(d,null!==(o=this.constraints.minUppercase)&&void 0!==o?o:Je),minNumber:null!==(a=et(u,this.constraints.minNumber))&&void 0!==a?a:We,minSpecial:null!==(l=et(h,this.constraints.minSpecial))&&void 0!==l?l:We});p.length=Qe(this.constraints.length,[tt(e.minNumber,p.minNumber),tt(e.minSpecial,p.minSpecial),tt(e.minLowercase,p.minLowercase),tt(e.minUppercase,p.minUppercase)]);return new ot(p)}}function lt(e,t){return[e.useUppercase,e.useLowercase,e.useNumbers,e.useSpecial,e.minLength>t.length.min,e.numberCount>t.minNumber.min,e.specialCount>t.minSpecial.min].includes(!0)}class ct{constructor(e){var t,i;this.policy=structuredClone(e),this.numWords=(t=e.minNumberWords,i=c.numWords,{min:Math.max(i.min,t),max:Math.max(i.max,t)})}get policyInEffect(){return[this.policy.capitalize,this.policy.includeNumber,this.policy.minNumberWords>c.numWords.min].includes(!0)}applyPolicy(e){const t=this.policy.capitalize||e.capitalize||!1,i=this.policy.includeNumber||e.includeNumber||!1,n=function(e,t){const{min:i,max:n}=t,r=Math.min(null!=e?e:t.min,n);return Math.max(r,i)}(e.numWords,this.numWords);return Object.assign(Object.assign({},e),{numWords:n,capitalize:t,includeNumber:i})}sanitize(e){var t,i;const n=""===e.wordSeparator?"":null!==(i=null===(t=e.wordSeparator)||void 0===t?void 0:t[0])&&void 0!==i?i:h.wordSeparator;return Object.assign(Object.assign({},e),{wordSeparator:n})}}class dt{constructor(e,t){this.policy=e,this.defaults=t,this.constraints={policyInEffect:ut(e,t),wordSeparator:{minLength:0,maxLength:1},capitalize:st(e.capitalize),includeNumber:st(e.includeNumber),numWords:tt(e.minNumberWords,t.numWords)}}adjust(e){return{wordSeparator:nt(e.wordSeparator,this.constraints.wordSeparator,{fillString:h.wordSeparator}),capitalize:rt(e.capitalize,this.constraints.capitalize),includeNumber:rt(e.includeNumber,this.constraints.includeNumber),numWords:it(e.numWords,this.constraints.numWords)}}fix(e){return e}}function ut(e,t){return[e.capitalize,e.includeNumber,e.minNumberWords>t.numWords.min].includes(!0)}class ht{get minNumber(){return this.minDigits}get minSpecial(){return this.minSpecialCharacters}constructor(e){function t(e,t){return{min:Math.max(t.min,e),max:Math.max(t.max,e)}}this.policy=structuredClone(e),this.minDigits=t(e.numberCount,d.minDigits),this.minSpecialCharacters=t(e.specialCount,d.minSpecialCharacters);const i=this.minDigits.min+this.minSpecialCharacters.min,n=e.minLength>0?e.minLength:d.length.min,r=Math.max(n,i,d.length.min);this.length={min:r,max:Math.max(d.length.max,r)}}get policyInEffect(){return[this.policy.useUppercase,this.policy.useLowercase,this.policy.useNumbers,this.policy.useSpecial,this.policy.minLength>d.length.min,this.policy.numberCount>d.minDigits.min,this.policy.specialCount>d.minSpecialCharacters.min].includes(!0)}applyPolicy(e){function t(e,t){const{min:i,max:n}=t,r=Math.min(e||0,n);return Math.max(r,i)}const i=this.policy.useUppercase||e.uppercase||!1,n=this.policy.useLowercase||e.lowercase||!1,r=this.policy.useNumbers||e.number||e.minNumber>0,s=this.policy.useSpecial||e.special||e.minSpecial>0,o=t(e.length,this.length),a=t(e.minNumber,this.minDigits),l=t(e.minSpecial,this.minSpecialCharacters);return Object.assign(Object.assign({},e),{length:o,uppercase:i,lowercase:n,number:r,minNumber:a,special:s,minSpecial:l})}sanitize(e){var t;function i(e,t){const i=null!=e?e:t>0;return[i,i?t||1:0]}const[n,r]=i(e.lowercase,e.minLowercase),[s,o]=i(e.uppercase,e.minUppercase),[a,l]=i(e.number,e.minNumber),[c,d]=i(e.special,e.minSpecial),u=r+o+l+d,h=Math.max(u,this.length.min),p=Math.max(null!==(t=e.length)&&void 0!==t?t:h,h);return Object.assign(Object.assign({},e),{length:p,minLength:h,lowercase:n,minLowercase:r,uppercase:s,minUppercase:o,number:a,minNumber:l,special:c,minSpecial:d})}}function pt(e,t){var i;return t.type!==Ye.tt.PasswordGenerator?e:{minNumberWords:Math.max(e.minNumberWords,null!==(i=t.data.minNumberWords)&&void 0!==i?i:e.minNumberWords),capitalize:t.data.capitalize||e.capitalize,includeNumber:t.data.includeNumber||e.includeNumber}}function mt(e,t){var i,n,r;return t.type===Ye.tt.PasswordGenerator&&t.enabled?{minLength:Math.max(e.minLength,null!==(i=t.data.minLength)&&void 0!==i?i:e.minLength),useUppercase:t.data.useUpper||e.useUppercase,useLowercase:t.data.useLower||e.useLowercase,useNumbers:t.data.useNumbers||e.useNumbers,numberCount:Math.max(e.numberCount,null!==(n=t.data.minNumbers)&&void 0!==n?n:e.numberCount),useSpecial:t.data.useSpecial||e.useSpecial,specialCount:Math.max(e.specialCount,null!==(r=t.data.minSpecial)&&void 0!==r?r:e.specialCount)}:e}class vt{constructor(e,t,i){this.algorithms=e,this.isAvailable=t,this.system=i,this.constraints={},this.log=i.log({type:"AvailableAlgorithmsConstraint"})}adjust(e){const t={},i=Object.keys(e);for(const n of i)t[n]=this.adjustPreference(n,e[n]);return t}adjustPreference(e,t){var i;if(this.isAvailable(t.algorithm))return this.log.debug({preference:t,type:e},"using preferred algorithm"),t;const n=null!==(i=(e?this.algorithms({type:e}):[]).find(this.isAvailable))&&void 0!==i?i:null;let r;return n?(r=Object.assign(Object.assign({},t),{algorithm:n,updated:this.system.now()}),this.log.debug({preference:t,defaultAlgorithm:n,type:e},"preference not available; defaulting the algorithm")):(this.log.warn({preference:t,type:e},"preference not available and default algorithm not found; continuing with preference"),r=t),r}fix(e){return e}}const ft={id:ve.passphrase,type:fe.password,weight:110,i18nKeys:{name:"passphrase",credentialType:"passphrase",generateCredential:"generatePassphrase",credentialGenerated:"passphraseGenerated",copyCredential:"copyPassphrase",useCredential:"useThisPassphrase"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>null==e.sdk?new je(e.randomizer,e.now):new Ve(e.sdk,e.now)},profiles:{[ge.account]:{type:"core",storage:{key:"passphraseGeneratorSettings",target:"object",format:"plain",classifier:new y(["numWords","wordSeparator","capitalize","includeNumber"]),state:v.qd,initial:{numWords:6,wordSeparator:"-",capitalize:!1,includeNumber:!1},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{type:Ye.tt.PasswordGenerator,default:{wordSeparator:{maxLength:1},numWords:{min:3,max:20,recommendation:6}},create(e,t){const i=e.reduce(pt,{minNumberWords:0,capitalize:!1,includeNumber:!1});return new dt(i,t.defaultConstraints)}}}}},gt=(0,me.ol)({id:ve.password,type:fe.password,weight:100,i18nKeys:{name:"password",generateCredential:"generatePassword",credentialGenerated:"passwordGenerated",credentialType:"password",copyCredential:"copyPassword",useCredential:"useThisPassword"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>null==e.sdk?new je(e.randomizer,e.now):new Ve(e.sdk,e.now)},profiles:{[ge.account]:{type:"core",storage:{key:"passwordGeneratorSettings",target:"object",format:"plain",classifier:new y(["length","ambiguous","uppercase","minUppercase","lowercase","minLowercase","number","minNumber","special","minSpecial"]),state:v.qd,initial:{length:14,ambiguous:!0,uppercase:!0,minUppercase:1,lowercase:!0,minLowercase:1,number:!0,minNumber:1,special:!1,minSpecial:0},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{type:Ye.tt.PasswordGenerator,default:{length:{min:5,max:128,recommendation:14},minNumber:{min:0,max:9},minSpecial:{min:0,max:9}},create(e,t){const i=e.reduce(mt,{minLength:0,useUppercase:!1,useLowercase:!1,useNumbers:!1,numberCount:0,useSpecial:!1,specialCount:0});return new at(i,t.defaultConstraints)}}}}});var yt=i(59303);const bt=(0,me.ol)({id:ve.username,type:fe.username,weight:400,i18nKeys:{name:"randomWord",credentialType:"username",generateCredential:"generateUsername",credentialGenerated:"usernameGenerated",copyCredential:"copyUsername",useCredential:"useThisUsername"},capabilities:{autogenerate:!0,fields:[]},engine:{create:e=>new ze(e.randomizer)},profiles:{[ge.account]:{type:"core",storage:{key:"effUsernameGeneratorSettings",target:"object",format:"plain",classifier:new y(["wordCapitalize","wordIncludeNumber"]),state:v.qd,initial:{wordCapitalize:!1,wordIncludeNumber:!1,website:null},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{},create:(e,t)=>new yt.e}}}});class wt{constructor(e,t){this.requestor=e,this.context=t}get createForwardingEmail(){return this.requestor.forwarder.createForwardingEmail}toRequest(e){const t=this.createForwardingEmail.url(e,this.context),i=this.requestor.authenticate(e,this.context),n=this.body(e);return new Request(t,{redirect:"manual",cache:"no-store",method:"POST",headers:new Headers(Object.assign(Object.assign({},i),{"Content-Type":"application/json",Accept:"application/json"})),body:n})}body(e){const t=this.createForwardingEmail.body;if(!t)return;const i=t(e,this.context);return i?JSON.stringify(i):void 0}hasJsonPayload(e){return this.createForwardingEmail.hasJsonPayload(e,this.context)}processJson(e){return this.createForwardingEmail.processJson(e,this.context)}}class St{constructor(e,t){this.requestor=e,this.context=t}hasJsonPayload(e){return this.requestor.forwarder.getAccountId.hasJsonPayload(e,this.context)}processJson(e){return this.requestor.forwarder.getAccountId.processJson(e,this.context)}toRequest(e){const t=this.requestor.forwarder.getAccountId.url(e,this.context),i=this.requestor.authenticate(e,this.context);return new Request(t,{redirect:"manual",cache:"no-store",method:"GET",headers:new Headers(Object.assign(Object.assign({},i),{"Content-Type":"application/json",Accept:"application/json"}))})}}var It=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class kt{constructor(e,t,i){this.configuration=e,this.client=t,this.i18nService=i}generate(e,t){return It(this,void 0,void 0,function*(){const i={website:e.website},n=yield this.getAccountId(this.configuration,t);n&&(i.accountId=yield this.client.fetchJson(n,i));const r=this.createForwardingAddress(this.configuration,t),s=yield this.client.fetchJson(r,i);return new ke(s,fe.email,Date.now())})}createContext(e,t){return new Se(e,t,this.i18nService)}createForwardingAddress(e,t){const i=this.createContext(e,t);return new wt(e,i)}getAccountId(e,t){if(!e.forwarder.getAccountId)return null;const i=this.createContext(e,t);return new St(e,i)}}function Ct(e){var t;if("forwarder"!==e.site.id)throw new Error(`expected forwarder extension; received ${e.site.id} (${e.product.vendor.id})`);const i={literal:null!==(t=e.product.name)&&void 0!==t?t:e.product.vendor.name};return{id:{forwarder:e.product.vendor.id},type:fe.email,weight:300,i18nKeys:{name:i,description:"forwardedEmailDesc",generateCredential:"generateEmail",credentialGenerated:"emailGenerated",useCredential:"useThisEmail",credentialType:"email",copyCredential:"copyEmail"},capabilities:{autogenerate:!1,fields:[...e.requestedFields]},engine:{create(t){const i=function(e){const t=_.get(e);return t&&"forwarder"in t?t:null}(e.product.vendor.id);return new kt(i,t.client,t.i18nService)}},profiles:{[ge.account]:{type:"extension",site:"forwarder",storage:{key:"forwarder",frame:512,initial:{token:"",baseUrl:"",domain:"",prefix:""},options:{deserializer:e=>e,clearOn:["logout"]}},constraints:{default:{},create:()=>new yt.e}}}}}function Tt(e){return ye.password.includes(e)}function Ft(e){return ye.username.includes(e)}function Rt(e){return!(!e||"object"!=typeof e||!("forwarder"in e))}function Pt(e){return ye.email.includes(e)||Rt(e)}function xt(e,t){return e===t||!(!Rt(e)||!Rt(t))&&e.forwarder===t.forwarder}const $t=Object.freeze({catchall:qe,plusAddress:Xe,passphrase:ft,password:gt,effWordList:bt}),Et=ye,At=Object.freeze(Object.values(ve)),Dt=Object.freeze(Object.values(fe));function Ot(e){return!!e.algorithm}function Mt(e){return!!e.type}const Ut=18e4;class Gt{constructor(e,t){this.provide=e,this.system=t,this.log=t.log({type:"DefaultCredentialGeneratorService"})}generate$(e){const t=e.on$.pipe((0,Q.t)({refCount:!0,bufferSize:1})),i=e.account$.pipe((0,Q.t)({refCount:!0,bufferSize:1})),n=t.pipe((0,ee.n)(e=>Ot(e)?(0,te.of)(e.algorithm):Mt(e)?this.provide.metadata.preference$(e.type,{account$:i}).pipe((0,ie.$)()):void this.log.panic(e,"algorithm or category required")),(0,ne.p)(e=>!!e),(0,pe.Zm)(e=>this.provide.metadata.metadata(e),{size:10}),(0,Q.t)({refCount:!0,bufferSize:1})),r=(0,re.y)(t,n).pipe((0,se.T)(([e,t])=>{var i;return[Object.assign(Object.assign({},e),{profile:null!==(i=e.profile)&&void 0!==i?i:ge.account}),t]}),(0,pe.Zm)(([e,t])=>{const[n,r]=[e.profile,t.id],s=this.settings(t,{account$:i},n).pipe((0,oe.M)(()=>this.log.debug({algorithm:r,profile:n},"settings update received")),(0,ae.u)({connector:()=>new le.m(1,Ut),resetOnRefCountZero:()=>(0,ce.O)(Ut)}),(0,oe.M)({subscribe:()=>this.log.debug({algorithm:r,profile:n},"settings hot"),complete:()=>this.log.debug({algorithm:r,profile:n},"settings cold")}),(0,ie.$)());return this.log.debug({algorithm:r,profile:n},"settings cached"),s},{key:([e,t])=>`${t.id}:${e.profile}`}),(0,de.w)()),s=n.pipe((0,pe.Zm)(e=>{const t=e.engine.create(this.provide.generator);return this.log.debug({algorithm:e.id},"engine cached"),t},{size:10}));return(0,re.y)([t,r,s]).pipe((0,oe.M)(([e])=>this.log.debug(e,"generating credential")),(0,ue.H)(([e,t,i])=>i.generate(e,t)),(0,he.Q)((0,pe.E)([r])))}algorithms$(e,t){return this.provide.metadata.algorithms$({type:e},t).pipe((0,se.T)(e=>e.map(e=>this.algorithm(e))))}algorithms(e){return(Array.isArray(e)?e:[e]).flatMap(e=>this.provide.metadata.algorithms({type:e})).map(e=>this.algorithm(e))}algorithm(e){const t=this.provide.metadata.metadata(e);return t||this.log.panic({algorithm:e},"invalid credential algorithm"),t}forwarder(e){const t=this.provide.metadata.metadata({forwarder:e});return t||this.log.panic({algorithm:e},"invalid vendor"),t}preferences(e){return this.provide.metadata.preferences(e)}settings(e,t,i=ge.account){const n=e.profiles[i];let r;if(n||this.log.panic({algorithm:e.id,profile:i},"failed to load settings; profile metadata not found"),"extension"===(s=n).type&&"forwarder"===s.site){const s=function(e){if(Rt(e))return e.forwarder}(e.id);s||this.log.panic({algorithm:e.id,profile:i},"failed to load extension profile; vendor not specified"),this.log.info({profile:i,vendor:s,site:n.site},"loading extension profile"),r=this.system.extension.settings(n,s,t)}else this.log.info({profile:i,algorithm:e.id},"loading generator profile"),r=this.provide.profile.settings(n,t);var s;return r}policy$(e,t,i=ge.account){const n=e.profiles[i];return n||this.log.panic({algorithm:e.id,profile:i},"failed to load policy; profile metadata not found"),this.provide.profile.constraints$(n,t)}}var jt=i(34040),Nt=i(89222);const Vt=new v.Ok(v.qd,"credentialPreferences",{deserializer:e=>{var t;const i=null!==(t=e)&&void 0!==t?t:{};for(const n in Et){const e=n;if(i[e])i[e].updated=new Date(i[e].updated);else{const[t]=Et[e];i[e]={algorithm:t,updated:new Date}}}return i},clearOn:["logout"]});class Bt{constructor(e,t,i){this.system=e,this.application=t,this.log=e.log({type:"GeneratorMetadataProvider"});const n=t.extension.site("forwarder");n||this.log.panic("forwarder extension site not found"),this.site=n,this._metadata=new Map(i.map(e=>[e.id,e]))}metadata(e){let t=null;if(Rt(e)){const i=this.site.extensions.get(e.forwarder);i||this.log.panic(e,"extension not found"),t=Ct(i)}else t=this._metadata.get(e);return t||this.log.panic({algorithm:e},"metadata not found"),t}types(){return Dt}algorithms(e){let t;if(Mt(e)){let i=[];e.type===fe.email&&(i=Array.from(this.site.extensions.keys()).map(e=>({forwarder:e}))),t=Et[e.type].concat(i)}else Ot(e)&&Rt(e.algorithm)?t=this.site.extensions.has(e.algorithm.forwarder)?[e.algorithm]:[]:Ot(e)?t=At.includes(e.algorithm)?[e.algorithm]:[]:this.log.panic(e,"algorithm or type required");return t}isAvailable$(e){const t=e.account$.pipe((0,se.T)(e=>e.id),(0,pe.y_)(),(0,Q.t)({bufferSize:1,refCount:!0}));return t.pipe((0,ee.n)(e=>this.application.policy.policiesByType$(Ye.tt.PasswordGenerator,e).pipe((0,se.T)(e=>function(e){const t=e.filter(e=>e.type===Ye.tt.PasswordGenerator&&e.enabled).reduce((e,t)=>{var i;return"password"===e?e:null!==(i=t.data.overridePasswordType)&&void 0!==i?i:e},null),i=[...Et[fe.email],...Et[fe.username]];return t?i.push(t):i.push(...Et[fe.password]),i}(e).filter(e=>this._metadata.has(e)).sort()),(0,pe.Zm)(e=>new Set(e),{key:e=>e.join(":")}),(0,jt.F)(),(0,he.Q)((0,pe.E)(t)))),(0,se.T)(e=>function(t){return Rt(t)||e.has(t)}))}algorithms$(e,t){if(Mt(e)){const{type:i}=e;return this.isAvailable$(t).pipe((0,se.T)(e=>this.algorithms({type:i}).filter(e)))}if(Ot(e)){const{algorithm:i}=e;return this.isAvailable$(t).pipe((0,se.T)(e=>e(i)?[i]:[]))}this.log.panic(e,"algorithm or type required")}preference$(e,t){const i=t.account$.pipe((0,Q.t)({bufferSize:1,refCount:!0}));return this.preferences({account$:i}).pipe((0,se.T)(t=>t[e].algorithm),(0,jt.F)())}preferences(e){const t=e.account$.pipe((0,Q.t)({bufferSize:1,refCount:!0})),i=this.isAvailable$({account$:t}).pipe((0,se.T)(e=>new vt(this.algorithms.bind(this),e,this.system)));return new Nt.p(Vt,this.system,{account$:t,constraints$:i})}}class zt{constructor(e,t){this.providers=e,this.policyService=t,this.log=e.log({type:"GeneratorProfileProvider"})}settings(e,t){const i=t.account$.pipe((0,Q.t)({bufferSize:1,refCount:!0})),n=this.constraints$(e,{account$:i});return new Nt.p(e.storage,this.providers,{constraints$:n,account$:i})}constraints$(e,t){const i=t.account$.pipe((0,Q.t)({bufferSize:1,refCount:!0}));return i.pipe((0,jt.F)((e,t)=>e.email===t.email&&e.emailVerified===t.emailVerified),(0,ee.n)(t=>{var i;this.log.debug({accountId:t.id,profileType:e.type,policyType:null!==(i=e.constraints.type)&&void 0!==i?i:"N/A",defaultConstraints:e.constraints.default},"initializing constraints$");const n=e.constraints.type?this.policyService.policiesByType$(e.constraints.type,t.id):(0,te.of)([]),r={defaultConstraints:e.constraints.default};t.emailVerified&&(this.log.debug({email:t.email},"verified email detected; including in context"),r.email=t.email);const s=n.pipe((0,se.T)(t=>e.constraints.create(t,r)),(0,jt.F)((e,t)=>function(e,t){var i,n;if(e.constraints.policyInEffect!==t.constraints.policyInEffect)return!1;const r=Object.keys(e.constraints);for(const s of r){if(!(s in t.constraints))return!1;const r=null!==(i=e.constraints[s])&&void 0!==i?i:{},o=null!==(n=t.constraints[s])&&void 0!==n?n:{};if(Object.keys(r).some(e=>r[e]!==o[e]))return!1}return!0}(e,t)),(0,oe.M)(e=>this.log.debug(e,"constraints updated")));return s}),(0,he.Q)((0,pe.E)(i)))}}var Lt=i(45505);function Kt(e){return(0,Lt.F)((0,pe.pP)(e.combine,e.disabledValue),(0,pe.LA)(),(0,se.T)(e.createEvaluator))}function qt(){return()=>(0,Lt.F)((0,se.T)(e=>new He))}var _t=i(22327),Xt=i(21590),Yt=i(9764),Ht=i(89097),Wt=i(16845);class Jt{}class Zt{classify(e){const t=JSON.parse(JSON.stringify(e));delete t.website;return{disclosed:{},secret:t}}declassify(e,t){return Object.assign(Object.assign({},t),{website:null})}}var Qt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ei extends Jt{constructor(e,t,i,n,r,s){super(),this.configuration=e,this.client=t,this.i18nService=i,this.encryptService=n,this.keyService=r,this.stateProvider=s,this.policy=Ye.tt.PasswordGenerator,this.defaults$=Ae(()=>this.configuration.forwarder.defaultSettings),this.toEvaluator=qt(),this.durableState=function(e){const t=new Map;return i=>{let n=t.get(i);return void 0===n&&(n=e(i),t.set(i,n)),n}}(e=>this.getUserSecrets(e)),this.generate=e=>Qt(this,void 0,void 0,function*(){const t={website:e.website},i=yield this.getAccountId(this.configuration,e);i&&(t.accountId=yield this.client.fetchJson(i,t));const n=this.createForwardingAddress(this.configuration,e);return yield this.client.fetchJson(n,t)})}get key(){return this.configuration.forwarder.settings}get rolloverKey(){return this.configuration.forwarder.importBuffer}getUserSecrets(e){const t=new Yt.n(512),i=this.keyService.userKey$(e).pipe((0,se.T)(i=>i?new _t.f(e,this.encryptService,i,t):null),(0,ne.p)(e=>!!e)),n=new Zt,r=Ht.l.value(this.key.stateDefinition,this.key.key,n,{deserializer:e=>this.key.deserializer(e),cleanupDelayMs:this.key.cleanupDelayMs,clearOn:this.key.clearOn}),s=Wt.m.from(e,r,this.stateProvider,i),o=this.keyService.userKey$(e).pipe((0,se.T)(e=>null!==e));return new Xt.d(this.stateProvider,this.rolloverKey,s,o)}createContext(e,t){return new Se(e,t,this.i18nService)}createForwardingAddress(e,t){const i=this.createContext(e,t);return new wt(e,i)}getAccountId(e,t){if(!e.forwarder.getAccountId)return null;const i=this.createContext(e,t);return new St(e,i)}}const ti=new v.Ok(v.qd,"passwordGeneratorSettings",{deserializer:e=>e,clearOn:[]}),ii=new v.Ok(v.qd,"passphraseGeneratorSettings",{deserializer:e=>e,clearOn:[]}),ni=new v.Ok(v.qd,"effUsernameGeneratorSettings",{deserializer:e=>e,clearOn:[]}),ri=new v.Ok(v.qd,"catchallGeneratorSettings",{deserializer:e=>e,clearOn:[]}),si=new v.Ok(v.qd,"subaddressGeneratorSettings",{deserializer:e=>e,clearOn:[]});var oi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ai{constructor(e,t){this.randomizer=e,this.stateProvider=t,this.durableState=De(ii,this.stateProvider),this.defaults$=Ae(()=>h),this.policy=Ye.tt.PasswordGenerator}toEvaluator(){return Kt({type:Ye.tt.PasswordGenerator,disabledValue:Object.freeze({minNumberWords:0,capitalize:!1,includeNumber:!1}),combine:pt,createEvaluator:e=>new ct(e)})}generate(e){return oi(this,void 0,void 0,function*(){const t=Ue(e);return this.randomizer.randomEffLongWords(t)})}}var li=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ci{constructor(e,t){this.randomizer=e,this.stateProvider=t,this.durableState=De(ti,this.stateProvider),this.defaults$=Ae(()=>p),this.policy=Ye.tt.PasswordGenerator}toEvaluator(){return Kt({type:Ye.tt.PasswordGenerator,disabledValue:{minLength:0,useUppercase:!1,useLowercase:!1,useNumbers:!1,numberCount:0,useSpecial:!1,specialCount:0},combine:mt,createEvaluator:e=>new ht(e)})}generate(e){return li(this,void 0,void 0,function*(){const t=Me(e);return yield this.randomizer.randomAscii(t)})}}var di=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ui{constructor(e,t,i,n=l){this.emailCalculator=e,this.emailRandomizer=t,this.stateProvider=i,this.defaultOptions=n,this.durableState=De(ri,this.stateProvider),this.defaults$=Ae(()=>this.defaultOptions),this.toEvaluator=qt(),this.policy=Ye.tt.PasswordGenerator}generate(e){return di(this,void 0,void 0,function*(){return null==e.catchallType&&(e.catchallType="random"),"website-name"===e.catchallType?yield this.emailCalculator.concatenate(e.website,e.catchallDomain):this.emailRandomizer.randomAsciiCatchall(e.catchallDomain)})}}var hi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class pi{constructor(e,t,i,n=m){this.emailCalculator=e,this.emailRandomizer=t,this.stateProvider=i,this.defaultOptions=n,this.durableState=De(si,this.stateProvider),this.defaults$=Ae(()=>this.defaultOptions),this.toEvaluator=qt(),this.policy=Ye.tt.PasswordGenerator}generate(e){return hi(this,void 0,void 0,function*(){return null==e.subaddressType&&(e.subaddressType="random"),"website-name"===e.subaddressType?this.emailCalculator.appendToSubaddress(e.website,e.subaddressEmail):this.emailRandomizer.randomAsciiSubaddress(e.subaddressEmail)})}}var mi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const vi=Object.freeze({enabled:4,disabled:0});class fi{constructor(e,t,i=u){this.randomizer=e,this.stateProvider=t,this.defaultOptions=i,this.durableState=De(ni,this.stateProvider),this.defaults$=Ae(()=>this.defaultOptions),this.toEvaluator=qt(),this.policy=Ye.tt.PasswordGenerator}generate(e){return mi(this,void 0,void 0,function*(){var t,i;const n=(null!==(t=e.wordCapitalize)&&void 0!==t?t:u.wordCapitalize)?"TitleCase":"lowercase",r=(null!==(i=e.wordIncludeNumber)&&void 0!==i?i:u.wordIncludeNumber)?vi.enabled:vi.disabled;return yield this.randomizer.randomWords({numberOfWords:1,casing:n,digits:r})})}}},30126:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});const n=["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]},30414:(e,t,i)=>{"use strict";i.d(t,{O:()=>Z});var n=i(67553),r=i(56962),s=i(78781),o=i(39488),a=i(31442),l=i(22166),c=i(24593),d=i(62819),u=i(77723),h=i(74208),p=i(33812),m=i(94573),v=i(5556),f=i(21274),g=i(35500),y=i(50700),b=i(77468),w=i(26333),S=i(93103),I=i(47428),k=i(47696),C=i(44432),T=i(10672),F=i(59032),R=i(38410),P=i(22466),x=i(36572),$=i(12694),E=i(16496),A=i(71944),D=i(93748),O=i(88016),M=i(91975),U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function G(e,t){1&e&&(p.j41(0,"div"),p.nrm(1,"i",3),p.nI1(2,"i18n"),p.j41(3,"span",4),p.EFF(4),p.nI1(5,"i18n"),p.k0s()()),2&e&&(p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,3,"loading"))),p.R7$(3),p.JRh(p.bMT(5,5,"loading")))}function j(e,t){1&e&&(p.j41(0,"bit-callout",7),p.nI1(1,"i18n"),p.EFF(2),p.nI1(3,"i18n"),p.k0s()),2&e&&(p.Y8G("title",p.mNQ(p.bMT(1,3,"goodNews"))),p.R7$(2),p.SpI(" ",p.bMT(3,5,"noInactive2fa")," "))}function N(e,t){if(1&e&&(p.qex(0),p.j41(1,"bit-toggle",15),p.EFF(2),p.j41(3,"span",16),p.EFF(4),p.k0s()(),p.bVm()),2&e){const e=t.$implicit,i=p.XpG(4);p.R7$(),p.Y8G("value",e),p.R7$(),p.SpI(" ",i.getName(e)," "),p.R7$(2),p.SpI(" ",i.getCount(e)," ")}}function V(e,t){if(1&e){const e=p.RV6();p.j41(0,"bit-toggle-group",13),p.nI1(1,"async"),p.nI1(2,"i18n"),p.bIt("selectedChange",function(t){h.eBV(e);const i=p.XpG(3);return h.Njj(i.filterOrgToggle(t))}),p.DNE(3,N,5,3,"ng-container",14),p.k0s()}if(2&e){const e=p.XpG(3);p.Y8G("selected",p.bMT(1,3,e.filterOrgStatus$)),p.BMQ("aria-label",p.bMT(2,5,"addAccessFilter")),p.R7$(3),p.Y8G("ngForOf",e.filterStatus)}}function B(e,t){1&e&&(p.qex(0,17),p.j41(1,"tr",18),p.nrm(2,"th",19),p.j41(3,"th",19),p.EFF(4),p.nI1(5,"i18n"),p.k0s(),p.j41(6,"th",19),p.EFF(7),p.nI1(8,"i18n"),p.k0s(),p.nrm(9,"th",19),p.k0s(),p.bVm()),2&e&&(p.R7$(4),p.JRh(p.bMT(5,2,"name")),p.R7$(3),p.JRh(p.bMT(8,4,"owner")))}function z(e,t){if(1&e){const e=p.RV6();p.qex(0),p.j41(1,"a",26),p.nI1(2,"i18n"),p.bIt("click",function(){h.eBV(e);const t=p.XpG().$implicit,i=p.XpG(4);return h.Njj(i.selectCipher(t))}),p.EFF(3),p.k0s(),p.bVm()}if(2&e){const e=p.XpG().$implicit;p.R7$(),p.Y8G("title",p.mNQ(p.i5U(2,3,"editItemWithName",e.name))),p.R7$(2),p.JRh(e.name)}}function L(e,t){if(1&e&&(p.j41(0,"span"),p.EFF(1),p.k0s()),2&e){const e=p.XpG().$implicit;p.R7$(),p.JRh(e.name)}}function K(e,t){1&e&&(p.qex(0),p.nrm(1,"i",27),p.nI1(2,"i18n"),p.j41(3,"span",4),p.EFF(4),p.nI1(5,"i18n"),p.k0s(),p.bVm()),2&e&&(p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,3,"shared"))),p.R7$(3),p.JRh(p.bMT(5,5,"shared")))}function q(e,t){1&e&&(p.qex(0),p.nrm(1,"i",28),p.nI1(2,"i18n"),p.j41(3,"span",4),p.EFF(4),p.nI1(5,"i18n"),p.k0s(),p.bVm()),2&e&&(p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,3,"attachments"))),p.R7$(3),p.JRh(p.bMT(5,5,"attachments")))}function _(e,t){if(1&e&&(p.nrm(0,"app-org-badge",29),p.nI1(1,"async"),p.nI1(2,"orgNameFromId")),2&e){const e=p.XpG().$implicit,t=p.XpG(4);p.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",p.i5U(2,5,e.organizationId,p.bMT(1,3,t.organizations$)))}}function X(e,t){if(1&e&&(p.j41(0,"a",30),p.EFF(1),p.nI1(2,"i18n"),p.k0s()),2&e){const e=p.XpG().$implicit,t=p.XpG(4);p.Y8G("href",p.mNQ(t.cipherDocs.get(e.id)),p.B4B),p.R7$(),p.SpI(" ",p.bMT(2,3,"instructions"))}}function Y(e,t){if(1&e&&(p.j41(0,"tr",18)(1,"td",19),p.nrm(2,"app-vault-icon",21),p.k0s(),p.j41(3,"td",19),p.DNE(4,z,4,6,"ng-container",22)(5,L,2,1,"ng-template",null,0,p.C5r)(7,K,6,7,"ng-container",1)(8,q,6,7,"ng-container",1),p.nrm(9,"br"),p.j41(10,"small"),p.EFF(11),p.k0s()(),p.j41(12,"td",19),p.DNE(13,_,3,8,"app-org-badge",23),p.k0s(),p.j41(14,"td",24),p.DNE(15,X,3,5,"a",25),p.k0s()()),2&e){const e=t.$implicit,i=p.sdS(6),n=p.XpG(4);p.R7$(2),p.Y8G("cipher",e),p.R7$(2),p.Y8G("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),p.R7$(3),p.Y8G("ngIf",!n.organization&&e.organizationId),p.R7$(),p.Y8G("ngIf",e.hasAttachments),p.R7$(3),p.JRh(e.subTitle),p.R7$(2),p.Y8G("ngIf",!n.organization),p.R7$(2),p.Y8G("ngIf",n.cipherDocs.has(e.id))}}function H(e,t){if(1&e&&(p.DNE(0,Y,16,8,"tr",20),p.nI1(1,"async")),2&e){const e=t.$implicit;p.Y8G("ngForOf",p.bMT(1,1,e))}}function W(e,t){if(1&e&&(p.qex(0),p.j41(1,"bit-callout",8),p.nI1(2,"i18n"),p.EFF(3),p.nI1(4,"number"),p.nI1(5,"i18n"),p.k0s(),p.DNE(6,V,4,7,"bit-toggle-group",9),p.j41(7,"bit-table",10),p.DNE(8,B,10,6,"ng-container",11),p.j41(9,"tbody"),p.DNE(10,H,2,3,"ng-template",12),p.k0s()(),p.bVm()),2&e){const e=p.XpG(2);p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,6,"inactive2faFound"))),p.R7$(2),p.SpI(" ",p.brH(5,10,"inactive2faFoundReportDesc",p.bMT(4,8,e.ciphers.length),e.vaultMsg)," "),p.R7$(3),p.Y8G("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),p.R7$(),p.Y8G("dataSource",e.dataSource),p.R7$(),p.Y8G("ngIf",!e.isAdminConsoleActive)}}function J(e,t){if(1&e&&(p.j41(0,"div",5),p.DNE(1,j,4,7,"bit-callout",6)(2,W,11,14,"ng-container",1),p.k0s()),2&e){const e=p.XpG();p.R7$(),p.Y8G("ngIf",!e.ciphers.length),p.R7$(),p.Y8G("ngIf",e.ciphers.length)}}class Z extends u.n{constructor(e,t,i,n,r,s,o,a,l,c,d){super(e,i,s,t,n,o,a,l,c),this.cipherService=e,this.organizationService=t,this.logService=r,this.changeDetectorRef=d,this.services=new Map,this.cipherDocs=new Map,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return U(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return U(this,void 0,void 0,function*(){try{yield this.load2fa()}catch(e){this.logService.error(e)}if(this.services.size>0){const e=yield this.getAllCiphers(),t=[],i=new Map;this.filterStatus=[0],e.forEach(e=>{const[n,r]=this.isInactive2faCipher(e);r&&(t.push(e),""!==n&&i.set(e.id,n))}),this.filterCiphersByOrg(t),this.cipherDocs=i,this.changeDetectorRef.markForCheck()}})}isInactive2faCipher(e){let t="",i=!1;const{type:n,login:r,isDeleted:o,edit:l,viewPassword:c}=e;if(n!==a.gC.Login||null!=r.totp&&""!==r.totp||!r.hasUris||o||!this.organization&&!l||!c)return[t,i];for(let a=0;a<r.uris.length;a++){const e=r.uris[a];if(null!=e.uri&&""!==e.uri){const n=e.uri.replace("www.",""),r=s.A.getHost(n),o=s.A.getDomain(n);if(null!=r&&this.services.has(r)){null!=this.services.get(r)&&(t=this.services.get(r)||""),i=!0;break}if(null!=o&&this.services.has(o)){null!=this.services.get(o)&&(t=this.services.get(o)||""),i=!0;break}}}return[t,i]}load2fa(){return U(this,void 0,void 0,function*(){if(this.services.size>0)return;const e=yield fetch(new Request("https://api.2fa.directory/v3/totp.json"));if(200!==e.status)throw new Error;const t=yield e.json();for(const i of t){const e=i[1];if(null!=e.domain&&null!=e.documentation){if(null!=e["additional-domains"])for(const t of e["additional-domains"])this.services.set(t,e.documentation);this.services.set(e.domain,e.documentation)}}this.changeDetectorRef.markForCheck()})}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return U(this,void 0,void 0,function*(){if(e===c.r.Deleted)return null;const[i,n]=this.isInactive2faCipher(t);return n?(this.cipherDocs.set(t.id,i),t):null})}}Z.ɵfac=function(e){return new(e||Z)(p.rXU(v.p),p.rXU(n.PV),p.rXU(f.o3),p.rXU(g.Di),p.rXU(r.K),p.rXU(l.qX),p.rXU(y.W),p.rXU(o.H),p.rXU(l.hI),p.rXU(d.l),p.rXU(m.gRc))},Z.ɵcmp=p.VBU({type:Z,selectors:[["app-inactive-two-factor-report"]],standalone:!1,features:[p.Vt3],decls:7,vars:5,consts:[["cantManage",""],[4,"ngIf"],["class","tw-mt-4",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[3,"dataSource"],["header","",4,"ngIf"],["body",""],[3,"selectedChange","selected"],[4,"ngFor","ngForOf"],[3,"value"],["bitBadge","","variant","info"],["header",""],["bitRow",""],["bitCell",""],["bitRow","",4,"ngFor","ngForOf"],[3,"cipher"],[4,"ngIf","ngIfElse"],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],["bitCell","",1,"tw-text-right"],["bitBadge","","target","_blank","rel","noreferrer",3,"href",4,"ngIf"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"],["bitBadge","","target","_blank","rel","noreferrer",3,"href"]],template:function(e,t){1&e&&(p.nrm(0,"app-header"),p.j41(1,"bit-container")(2,"p"),p.EFF(3),p.nI1(4,"i18n"),p.k0s(),p.DNE(5,G,6,7,"div",1)(6,J,3,2,"div",2),p.k0s()),2&e&&(p.R7$(3),p.JRh(p.bMT(4,3,"inactive2faReportDesc")),p.R7$(2),p.Y8G("ngIf",!t.hasLoaded&&t.loading),p.R7$(),p.Y8G("ngIf",t.hasLoaded))},dependencies:[b.Sq,b.bT,w.R,S.Y,I.x,k.n,C.G,T.H,F.L,R.Q,P.Y,x._,x.O,$.H,E.a,A.P,D.f,b.Jj,b.QX,O.$,M.t],encapsulation:2,changeDetection:0})},30424:(e,t,i)=>{"use strict";i.d(t,{L:()=>n,a:()=>r});const n={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},r=e=>{if("undefined"==typeof window||!window.matchMedia)return!1;const t=`(min-width: ${n[e]}px)`;return window.matchMedia(t).matches}},30550:(e,t,i)=>{"use strict";i.d(t,{F:()=>s,u:()=>n});const n="all",r=["favorites","login","card","identity","note","sshKey","archive","trash",n];function s(e){return r.includes(e)}},30623:(e,t,i)=>{"use strict";i.d(t,{r:()=>v});var n=i(74208),r=i(58625),s=i(37115),o=i(59032),a=i(81573),l=i(29029),c=i(21274),d=i(81525),u=i(33812),h=i(56898),p=i(67311),m=i(88016);class v{constructor(e){this.dialogRef=e,this.platformUtilsService=(0,n.WQX)(s.y),this.params=(0,n.WQX)(d.Qs)}get contentKey(){return this.params.contentKey}onCancel(){var e,t;null===(t=(e=this.params).onCancel)||void 0===t||t.call(e),this.dialogRef.close(!1)}onContinue(){var e,t;null===(t=(e=this.params).onContinue)||void 0===t||t.call(e),this.dialogRef.close(!0)}openLink(e){e.preventDefault(),this.platformUtilsService.launchUri("https://bitwarden.com/help/uri-match-detection/")}static open(e,t){return e.open(v,{data:t,disableClose:!0,positionStrategy:new c.u3})}}v.ɵfac=function(e){return new(e||v)(u.rXU(c.ce))},v.ɵcmp=u.VBU({type:v,selectors:[["ng-component"]],decls:20,vars:15,consts:[["bitDialogIcon","","aria-hidden","true",1,"bwi","tw-text-3xl","bwi-exclamation-triangle","tw-text-warning"],["bitDialogTitle",""],["bitDialogContent","",1,"tw-mb-1"],[1,"tw-mb-1","tw-hyphens-none"],["bitLink","","type","button","linkType","primary",3,"click"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"click"],["bitButton","","type","button","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(u.j41(0,"bit-simple-dialog"),u.nrm(1,"i",0),u.j41(2,"span",1),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.j41(5,"div",2)(6,"p",3),u.EFF(7),u.nI1(8,"i18n"),u.nrm(9,"br"),u.j41(10,"button",4),u.bIt("click",function(e){return t.openLink(e)}),u.EFF(11),u.nI1(12,"i18n"),u.k0s()()(),u.qex(13,5),u.j41(14,"button",6),u.bIt("click",function(){return t.onContinue()}),u.EFF(15),u.nI1(16,"i18n"),u.k0s(),u.j41(17,"button",7),u.bIt("click",function(){return t.onCancel()}),u.EFF(18),u.nI1(19,"i18n"),u.k0s(),u.bVm(),u.k0s()),2&e&&(u.R7$(3),u.SpI(" ",u.bMT(4,5,"warningCapitalized")," "),u.R7$(4),u.SpI(" ",u.bMT(8,7,t.contentKey)," "),u.R7$(4),u.SpI(" ",u.bMT(12,9,"uriMatchWarningDialogLink")," "),u.R7$(4),u.SpI(" ",u.bMT(16,11,"continue")," "),u.R7$(3),u.SpI(" ",u.bMT(19,13,"cancel")," "))},dependencies:[o.o,l.t,h.Q,a.P,p.L,p.o,r.p,m.$],encapsulation:2})},30634:(e,t,i)=>{"use strict";function n({element:e,title:t,label:i}){t&&e.setAttribute("title",t),i&&e.setAttribute("aria-label",i)}i.d(t,{J:()=>n})},30675:(e,t,i)=>{"use strict";i.d(t,{a:()=>n.a});var n=i(37856)},30930:(e,t,i)=>{"use strict";i.d(t,{N:()=>f,a:()=>v});var n=i(94251),r=i(77468),s=i(94573),o=i(69672),a=i(22466),l=i(36572),c=i(33812);const d=[[["","header",""]]],u=e=>({paddingBottom:e}),h=e=>({$implicit:e});function p(e,t){1&e&&c.eu8(0)}function m(e,t){if(1&e&&(c.j41(0,"tr",4),c.DNE(1,p,1,0,"ng-container",5),c.k0s()),2&e){const e=t.$implicit,i=c.XpG();c.R7$(),c.Y8G("ngTemplateOutlet",i.rowDef().template)("ngTemplateOutletContext",c.eq3(2,h,e))}}class v{constructor(e){this.template=e}}v.ɵfac=function(e){return new(e||v)(c.rXU(c.C4Q))},v.ɵdir=c.FsC({type:v,selectors:[["","bitRowDef",""]]});class f extends l.O{constructor(e,t){super(),this.zone=e,this.el=t,this.rowSize=s.hFB.required(),this.trackBy=(0,s.hFB)(),this.rowDef=(0,s.sbv)(v),this.headerHeight=0}ngAfterViewInit(){this.headerObserver=new ResizeObserver(e=>{this.zone.run(()=>{this.headerHeight=e[0].contentRect.height})}),this.headerObserver.observe(this.el.nativeElement.querySelector("thead"))}ngOnDestroy(){super.ngOnDestroy(),this.headerObserver&&this.headerObserver.disconnect()}}f.ɵfac=function(e){return new(e||f)(c.rXU(c.SKi),c.rXU(c.aKT))},f.ɵcmp=c.VBU({type:f,selectors:[["bit-table-scroll"]],contentQueries:function(e,t,i){1&e&&c.C6U(i,t.rowDef,v,5),2&e&&c.NyB()},inputs:{rowSize:[1,"rowSize"],trackBy:[1,"trackBy"]},features:[c.Jv_([{provide:l.O,useExisting:f}]),c.Vt3],ngContentSelectors:["[header]"],decls:7,vars:8,consts:[["bitScrollLayout","",3,"itemSize","ngStyle"],[3,"ngClass"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-medium","tw-text-muted"],["bitRow","",4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTrackBy","cdkVirtualForTemplateCacheSize"],["bitRow",""],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(c.NAR(d),c.j41(0,"cdk-virtual-scroll-viewport",0)(1,"table",1)(2,"thead",2)(3,"tr"),c.SdG(4),c.k0s()(),c.j41(5,"tbody"),c.DNE(6,m,2,4,"tr",3),c.k0s()()()),2&e&&(c.Y8G("itemSize",t.rowSize())("ngStyle",c.eq3(6,u,t.headerHeight+"px")),c.R7$(),c.Y8G("ngClass",t.tableClass),c.R7$(5),c.Y8G("cdkVirtualForOf",t.rows$)("cdkVirtualForTrackBy",t.trackBy())("cdkVirtualForTemplateCacheSize",0))},dependencies:[r.MD,r.YU,r.T3,r.B3,n.d6,n.yg,n.E$,a.Y,o.lp],encapsulation:2})},31176:(e,t,i)=>{"use strict";i.d(t,{c:()=>w});var n=i(77468),r=i(94573),s=i(22191),o=i(75583),a=i(29029),l=i(36801),c=i(74208),d=i(33812),u=i(56898),h=i(36288),p=i(58806);function m(e,t){if(1&e&&(d.j41(0,"h2",7),d.EFF(1),d.k0s()),2&e){const e=d.XpG();d.R7$(),d.JRh(e.title())}}function v(e,t){if(1&e&&d.nrm(0,"p",8),2&e){const e=d.XpG();d.Y8G("innerHTML",e.subtitle(),d.npT)}}function f(e,t){1&e&&d.SdG(0,0,["*ngIf","!subtitle()"])}function g(e,t){if(1&e){const e=d.RV6();d.j41(0,"button",9),d.nI1(1,"i18n"),d.bIt("click",function(){c.eBV(e);const t=d.XpG();return c.Njj(t.handleDismiss())}),d.k0s()}2&e&&d.Y8G("label",d.bMT(1,1,"close"))}function y(e,t){if(1&e&&d.nrm(0,"i",12),2&e){const e=d.XpG(2);d.Y8G("ngClass",e.buttonIcon())}}function b(e,t){if(1&e){const e=d.RV6();d.j41(0,"button",10),d.bIt("click",function(t){c.eBV(e);const i=d.XpG();return c.Njj(i.handleButtonClick(t))}),d.EFF(1),d.DNE(2,y,1,1,"i",11),d.k0s()}if(2&e){const e=d.XpG();d.R7$(),d.SpI(" ",e.buttonText()," "),d.R7$(),d.Y8G("ngIf",e.buttonIcon())}}class w{constructor(){this.title=(0,r.hFB)(),this.subtitle=(0,r.hFB)(),this.buttonText=(0,r.hFB)(),this.persistent=(0,r.hFB)(!1,{transform:r.L39}),this.buttonIcon=(0,r.hFB)(),this.onDismiss=(0,r.CGW)(),this.onButtonClick=(0,r.CGW)()}handleButtonClick(e){this.onButtonClick.emit(e)}handleDismiss(){this.onDismiss.emit()}}w.ɵfac=function(e){return new(e||w)},w.ɵcmp=d.VBU({type:w,selectors:[["bit-spotlight"]],inputs:{title:[1,"title"],subtitle:[1,"subtitle"],buttonText:[1,"buttonText"],persistent:[1,"persistent"],buttonIcon:[1,"buttonIcon"]},outputs:{onDismiss:"onDismiss",onButtonClick:"onButtonClick"},ngContentSelectors:["*"],decls:8,vars:5,consts:[[1,"tw-rounded-2xl","tw-bg-primary-100","tw-border-primary-600","tw-border-solid","tw-border","tw-p-4","tw-pt-2","tw-flex","tw-flex-col","tw-gap-2","tw-mb-4"],[1,"tw-flex","tw-justify-between","tw-items-start","tw-flex-grow"],["bitTypography","h4","class","tw-font-medium !tw-mb-1",4,"ngIf"],["class","tw-text-main tw-mb-0","bitTypography","body2",3,"innerHTML",4,"ngIf"],[4,"ngIf"],["type","button","bitIconButton","bwi-close","size","small","class","-tw-me-2",3,"label","click",4,"ngIf"],["class","tw-w-full","bitButton","","type","button","buttonType","primary",3,"click",4,"ngIf"],["bitTypography","h4",1,"tw-font-medium","!tw-mb-1"],["bitTypography","body2",1,"tw-text-main","tw-mb-0",3,"innerHTML"],["type","button","bitIconButton","bwi-close","size","small",1,"-tw-me-2",3,"click","label"],["bitButton","","type","button","buttonType","primary",1,"tw-w-full",3,"click"],["class","bwi tw-ml-1","aria-hidden","true",3,"ngClass",4,"ngIf"],["aria-hidden","true",1,"bwi","tw-ml-1",3,"ngClass"]],template:function(e,t){1&e&&(d.NAR(),d.j41(0,"div",0)(1,"div",1)(2,"div"),d.DNE(3,m,2,1,"h2",2)(4,v,1,1,"p",3)(5,f,1,0,"ng-content",4),d.k0s(),d.DNE(6,g,2,3,"button",5),d.k0s(),d.DNE(7,b,3,2,"button",6),d.k0s()),2&e&&(d.R7$(3),d.Y8G("ngIf",t.title()),d.R7$(),d.Y8G("ngIf",t.subtitle()),d.R7$(),d.Y8G("ngIf",!t.subtitle()),d.R7$(),d.Y8G("ngIf",!t.persistent()),d.R7$(),d.Y8G("ngIf",t.buttonText()))},dependencies:[a.t,u.Q,n.MD,n.YU,n.bT,s.Q,h.s,o.E,p.r,l.$Z],encapsulation:2,changeDetection:0})},31442:(e,t,i)=>{"use strict";i.d(t,{xP:()=>l,b1:()=>n.b,gC:()=>r.gC,XS:()=>p,PU:()=>s,ZX:()=>c,EU:()=>a,ak:()=>u,KN:()=>r.KN,D1:()=>o,NI:()=>d,aw:()=>h,g7:()=>r.g7});var n=i(36501),r=i(7919);const s=Object.freeze({Text:0,Hidden:1,Boolean:2,Linked:3});function o(e){switch(e){case s.Text:case s.Hidden:case s.Boolean:case s.Linked:return e;default:return s.Text}}const a={Username:100,Password:101},l={CardholderName:300,ExpMonth:301,ExpYear:302,Code:303,Brand:304,Number:305},c={Title:400,MiddleName:401,Address1:402,Address2:403,Address3:404,City:405,State:406,PostalCode:407,Country:408,Company:409,Email:410,Phone:411,Ssn:412,Username:413,PassportNumber:414,LicenseNumber:415,FirstName:416,LastName:417,FullName:418};function d(e){if(null==e)return;return[...Object.values(a),...Object.values(l),...Object.values(c)].includes(e)?e:void 0}const u={Generic:0};function h(e){return u.Generic}const p={Index:"popup/index.html#/",AtRiskPasswords:"popup/index.html#/at-risk-passwords"}},31857:(e,t,i)=>{"use strict";i.d(t,{$g:()=>n.$g,BA:()=>n.BA,Bh:()=>n.Bh,Br:()=>n.Br,Cg:()=>n.Cg,EF:()=>n.EF,Gd:()=>n.Gd,Gg:()=>n.Gg,Gm:()=>n.Gm,HR:()=>n.HR,Iw:()=>n.Iw,Jb:()=>n.Jb,K8:()=>n.K8,L_:()=>n.L_,MC:()=>n.MC,O2:()=>n.O2,OB:()=>n.OB,Ok:()=>n.Ok,P7:()=>n.P7,PM:()=>n.PM,Qb:()=>n.Qb,Rv:()=>n.Rv,Sc:()=>n.Sc,Tf:()=>n.Tf,Ud:()=>n.Ud,Vl:()=>n.Vl,W$:()=>n.W$,Wm:()=>n.Wm,XH:()=>n.XH,Xk:()=>n.Xk,Y2:()=>n.Y2,Z6:()=>n.Z6,Zs:()=>n.Zs,_Q:()=>n._Q,aC:()=>n.aC,aL:()=>n.aL,bI:()=>n.bI,bh:()=>n.bh,bj:()=>n.bj,d1:()=>n.d1,dD:()=>n.dD,dn:()=>n.dn,dp:()=>n.dp,dr:()=>n.dr,eP:()=>n.eP,fK:()=>n.fK,fn:()=>n.fn,g4:()=>n.g4,gc:()=>n.gc,hs:()=>n.hs,i9:()=>n.i9,iK:()=>n.iK,ie:()=>n.ie,iy:()=>n.iy,jB:()=>n.jB,jb:()=>n.jb,jx:()=>n.jx,k2:()=>n.k2,kj:()=>n.kj,km:()=>n.km,lR:()=>n.lR,ll:()=>n.ll,nr:()=>n.nr,oR:()=>n.oR,q9:()=>n.q9,qd:()=>n.qd,rB:()=>n.rB,s2:()=>n.s2,uv:()=>n.uv,v2:()=>n.v2,wt:()=>n.wt,ww:()=>n.ww,xS:()=>n.xS,xu:()=>n.xu,y7:()=>n.y7});var n=i(91968);i(93173)},31925:(e,t,i)=>{"use strict";i.d(t,{$i:()=>r,bL:()=>s});var n=i(3204);const r=(0,n.T)(e=>{if(!e)throw new Error("Account not found");return{type:"account",data:e}}),s=(0,n.T)(e=>{if(!e)throw new Error("Organization not found");return{type:"organization",data:e}});(0,n.T)(e=>{if(!e)throw new Error("Organization not found");return{type:"provider",data:e}})},31944:(e,t,i)=>{"use strict";i.d(t,{E:()=>n});class n{}},32072:(e,t,i)=>{"use strict";i.d(t,{l:()=>a});var n=i(17989),r=i(24072),s=i(82696),o=i(67036);class a extends n.A{constructor(e){super(),null!=e&&(this.title=(0,r.e)(e.title),this.firstName=(0,r.e)(e.firstName),this.middleName=(0,r.e)(e.middleName),this.lastName=(0,r.e)(e.lastName),this.address1=(0,r.e)(e.address1),this.address2=(0,r.e)(e.address2),this.address3=(0,r.e)(e.address3),this.city=(0,r.e)(e.city),this.state=(0,r.e)(e.state),this.postalCode=(0,r.e)(e.postalCode),this.country=(0,r.e)(e.country),this.company=(0,r.e)(e.company),this.email=(0,r.e)(e.email),this.phone=(0,r.e)(e.phone),this.ssn=(0,r.e)(e.ssn),this.username=(0,r.e)(e.username),this.passportNumber=(0,r.e)(e.passportNumber),this.licenseNumber=(0,r.e)(e.licenseNumber))}decrypt(e,t="No Cipher Context"){return this.decryptObj(this,new o.O,["title","firstName","middleName","lastName","address1","address2","address3","city","state","postalCode","country","company","email","phone","ssn","username","passportNumber","licenseNumber"],e,"DomainType: Identity; "+t)}toIdentityData(){const e=new s.j;return this.buildDataModel(this,e,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null}),e}static fromJSON(e){if(null==e)return;const t=new a;return t.title=(0,r.u)(e.title),t.firstName=(0,r.u)(e.firstName),t.middleName=(0,r.u)(e.middleName),t.lastName=(0,r.u)(e.lastName),t.address1=(0,r.u)(e.address1),t.address2=(0,r.u)(e.address2),t.address3=(0,r.u)(e.address3),t.city=(0,r.u)(e.city),t.state=(0,r.u)(e.state),t.postalCode=(0,r.u)(e.postalCode),t.country=(0,r.u)(e.country),t.company=(0,r.u)(e.company),t.email=(0,r.u)(e.email),t.phone=(0,r.u)(e.phone),t.ssn=(0,r.u)(e.ssn),t.username=(0,r.u)(e.username),t.passportNumber=(0,r.u)(e.passportNumber),t.licenseNumber=(0,r.u)(e.licenseNumber),t}toSdkIdentity(){var e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g;return{title:null===(e=this.title)||void 0===e?void 0:e.toSdk(),firstName:null===(t=this.firstName)||void 0===t?void 0:t.toSdk(),middleName:null===(i=this.middleName)||void 0===i?void 0:i.toSdk(),lastName:null===(n=this.lastName)||void 0===n?void 0:n.toSdk(),address1:null===(r=this.address1)||void 0===r?void 0:r.toSdk(),address2:null===(s=this.address2)||void 0===s?void 0:s.toSdk(),address3:null===(o=this.address3)||void 0===o?void 0:o.toSdk(),city:null===(a=this.city)||void 0===a?void 0:a.toSdk(),state:null===(l=this.state)||void 0===l?void 0:l.toSdk(),postalCode:null===(c=this.postalCode)||void 0===c?void 0:c.toSdk(),country:null===(d=this.country)||void 0===d?void 0:d.toSdk(),company:null===(u=this.company)||void 0===u?void 0:u.toSdk(),email:null===(h=this.email)||void 0===h?void 0:h.toSdk(),phone:null===(p=this.phone)||void 0===p?void 0:p.toSdk(),ssn:null===(m=this.ssn)||void 0===m?void 0:m.toSdk(),username:null===(v=this.username)||void 0===v?void 0:v.toSdk(),passportNumber:null===(f=this.passportNumber)||void 0===f?void 0:f.toSdk(),licenseNumber:null===(g=this.licenseNumber)||void 0===g?void 0:g.toSdk()}}static fromSdkIdentity(e){if(null==e)return;const t=new a;return t.title=(0,r.u)(e.title),t.firstName=(0,r.u)(e.firstName),t.middleName=(0,r.u)(e.middleName),t.lastName=(0,r.u)(e.lastName),t.address1=(0,r.u)(e.address1),t.address2=(0,r.u)(e.address2),t.address3=(0,r.u)(e.address3),t.city=(0,r.u)(e.city),t.state=(0,r.u)(e.state),t.postalCode=(0,r.u)(e.postalCode),t.country=(0,r.u)(e.country),t.company=(0,r.u)(e.company),t.email=(0,r.u)(e.email),t.phone=(0,r.u)(e.phone),t.ssn=(0,r.u)(e.ssn),t.username=(0,r.u)(e.username),t.passportNumber=(0,r.u)(e.passportNumber),t.licenseNumber=(0,r.u)(e.licenseNumber),t}}},32287:(e,t,i)=>{"use strict";i.d(t,{m:()=>h});var n=i(94573),r=i(26411),s=i(25065),o=i(33812),a=i(86226),l=i(77468),c=i(88016);function d(e,t){1&e&&o.SdG(0)}function u(e,t){1&e&&o.eu8(0)}class h{constructor(){this.required=!1}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=o.VBU({type:h,selectors:[["app-payment-label"]],inputs:{for:"for",required:[2,"required","required",n.L39]},ngContentSelectors:["*"],decls:8,vars:5,consts:[["defaultContent",""],[1,"tw-relative","tw-mt-2"],[1,"tw-absolute","tw-bg-background","tw-px-1","tw-text-sm","tw-text-muted","-tw-top-2.5","tw-left-3","tw-mb-0","tw-max-w-full","tw-pointer-events-auto"],[4,"ngTemplateOutlet"],[1,"tw-text-[0.625rem]","tw-font-normal"]],template:function(e,t){if(1&e&&(o.NAR(),o.DNE(0,d,1,0,"ng-template",null,0,o.C5r),o.j41(2,"div",1)(3,"bit-label",2),o.DNE(4,u,1,0,"ng-container",3),o.j41(5,"span",4),o.EFF(6),o.nI1(7,"i18n"),o.k0s()()()),2&e){const e=o.sdS(1);o.R7$(3),o.BMQ("for",t.for),o.R7$(),o.Y8G("ngTemplateOutlet",e),o.R7$(2),o.SpI("(",o.bMT(7,3,"required"),")")}},dependencies:[r.L,a.j,s.G,l.T3,c.$],encapsulation:2})},32316:(e,t,i)=>{"use strict";i.d(t,{O:()=>l});var n=i(93161),r=i(77468),s=i(94573),o=i(33812),a=i(36572);class l{constructor(e){this.table=e,this.bitSortable=s.hFB.required(),this.default=(0,s.hFB)(!1,{transform:e=>"desc"===e||"asc"===e?e:!!(0,n.he)(e)&&"asc"}),this.fn=(0,s.hFB)()}ngOnInit(){this.default()&&!this.isActive&&this.setActive()}get ariaSort(){var e;if(this.isActive)return"asc"===(null===(e=this.sort)||void 0===e?void 0:e.direction)?"ascending":"descending"}setActive(){const e=this.table.dataSource();if(e){const t="desc"===this.default()?"desc":"asc",i=this.isActive?"asc"===this.direction?"desc":"asc":t;e.sort={column:this.bitSortable(),direction:i,fn:this.fn()}}}get sort(){var e;return null===(e=this.table.dataSource())||void 0===e?void 0:e.sort}get isActive(){var e;return(null===(e=this.sort)||void 0===e?void 0:e.column)===this.bitSortable()}get direction(){var e;return null===(e=this.sort)||void 0===e?void 0:e.direction}get icon(){return this.isActive?"asc"===this.direction?"bwi-up-solid":"bwi-down-solid":"bwi-up-down-btn"}get classList(){return["tw-min-w-max","tw-font-medium","tw-border","tw-border-solid","tw-rounded","tw-transition","hover:tw-no-underline","focus:tw-outline-none","tw-bg-transparent","!tw-text-muted","tw-border-transparent","hover:tw-bg-transparent-hover","hover:tw-border-primary-700","focus-visible:before:tw-ring-primary-700","disabled:tw-opacity-60","disabled:hover:tw-border-transparent","disabled:hover:tw-bg-transparent","tw-relative","before:tw-content-['']","before:tw-block","before:tw-absolute","before:-tw-inset-[3px]","before:tw-rounded-md","before:tw-transition","before:tw-ring","before:tw-ring-transparent","focus-visible:tw-z-10"]}}l.ɵfac=function(e){return new(e||l)(o.rXU(a.O))},l.ɵcmp=o.VBU({type:l,selectors:[["th","bitSortable",""]],hostVars:1,hostBindings:function(e,t){2&e&&o.BMQ("aria-sort",t.ariaSort)},inputs:{bitSortable:[1,"bitSortable"],default:[1,"default"],fn:[1,"fn"]},attrs:["bitSortable",""],ngContentSelectors:["*"],decls:3,vars:3,consts:[["type","button",3,"click","ngClass"],[1,"bwi","tw-ms-2",3,"ngClass"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"button",0),o.bIt("click",function(){return t.setActive()}),o.SdG(1),o.nrm(2,"i",1),o.k0s()),2&e&&(o.Y8G("ngClass",t.classList),o.BMQ("aria-pressed",t.isActive),o.R7$(2),o.Y8G("ngClass",t.icon))},dependencies:[r.YU],encapsulation:2})},32415:(e,t,i)=>{"use strict";i.d(t,{c:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="5 4 87 87">
    <circle cx="48" cy="48" r="42" class="tw-fill-illustration-bg-primary tw-stroke-illustration-outline" stroke-width="2"/>
    <rect width="18" height="14" x="12" y="70" class="tw-fill-illustration-bg-secondary tw-stroke-illustration-outline" stroke-width="2" rx="2"/>
    <rect width="2" height="6" x="20" y="74" class="tw-fill-illustration-outline" rx="1"/>
    <path class="tw-stroke-illustration-outline" stroke-width="2" d="M25 69v-1a4 4 0 0 0-8 0v1"/>
    <circle cx="80" cy="16" r="11" class="tw-fill-illustration-tertiary tw-stroke-illustration-outline" stroke-width="2"/>
    <path class="tw-stroke-illustration-outline" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m76.673 19.495 3.5-3.5m3.5-3.5-3.5 3.5m0 0-3.5-3.5 7 7"/>
    <circle cx="48" cy="48" r="15.5" class="tw-fill-illustration-bg-tertiary tw-stroke-illustration-outline" stroke-width="2"/>
    <path class="tw-stroke-illustration-outline" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M52.95 52.243 48 48.707v-9.9"/>
  </svg>
`},32501:(e,t,i)=>{"use strict";i.d(t,{Y:()=>o});var n=i(25065),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.G]})},32924:(e,t,i)=>{"use strict";i.d(t,{M:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-menu-divider"]],decls:1,vars:0,consts:[["role","separator","aria-hidden","true",1,"tw-my-2","tw-border-0","tw-border-t","tw-border-solid","tw-border-t-secondary-100"]],template:function(e,t){1&e&&n.Hgh(0,"div",0)},encapsulation:2})},33189:(e,t,i)=>{"use strict";i.d(t,{A:()=>v});var n=i(33338),r=i(93695),s=i(69194),o=i(3204),a=i(44500),l=i(67553),c=i(43978),d=i(3633),u=i(88083),h=i(74208),p=i(18499),m=i(35500);class v{constructor(e,t,i){this.policyService=e,this.organizationService=t,this.accountService=i,this.organizations$=this.accountService.activeAccount$.pipe((0,a.n)(e=>(null==e?void 0:e.id)?this.organizationService.organizations$(null==e?void 0:e.id):(0,r.of)()))}get showFreeFamilies$(){return this.getFreeFamiliesVisibility$()}showSponsoredFamiliesDropdown$(e){const t=e.pipe((0,o.T)(e=>e.productTierType===u.K_.Enterprise));return this.accountService.activeAccount$.pipe(d.F6,(0,a.n)(i=>{const r=this.policyService.policiesByType$(c.tt.FreeFamiliesSponsorshipPolicy,i);return(0,n.z)([t,e,r]).pipe((0,o.T)(([e,t,i])=>{const n=i.some(e=>e.organizationId===t.id&&e.enabled);return e&&!n&&t.useAdminSponsoredFamilies&&(t.isAdmin||t.isOwner||t.canManageUsers)}))}))}getFreeFamiliesVisibility$(){return(0,n.z)([this.checkEnterpriseOrganizationsAndFetchPolicy(),this.organizations$]).pipe((0,o.T)(([e,t])=>this.shouldShowFreeFamilyLink(e,t)))}shouldShowFreeFamilyLink(e,t){if(!e)return!1;const{isFreeFamilyPolicyEnabled:i}=e;return t.some(e=>e.canManageSponsorships)&&!i}checkEnterpriseOrganizationsAndFetchPolicy(){return this.organizations$.pipe((0,s.p)(e=>Array.isArray(e)&&e.length>0),(0,a.n)(e=>this.fetchEnterpriseOrganizationPolicy(e)))}fetchEnterpriseOrganizationPolicy(e){const{belongToOneEnterpriseOrgs:t,belongToMultipleEnterpriseOrgs:i}=this.evaluateEnterpriseOrganizations(e),n=e.filter(e=>e.canManageSponsorships).map(e=>e.id);return 0===n.length?(0,r.of)({isFreeFamilyPolicyEnabled:!1,belongToOneEnterpriseOrgs:t,belongToMultipleEnterpriseOrgs:i}):this.accountService.activeAccount$.pipe(d.F6,(0,a.n)(e=>this.policyService.policiesByType$(c.tt.FreeFamiliesSponsorshipPolicy,e)),(0,o.T)(e=>({isFreeFamilyPolicyEnabled:n.every(t=>e.some(e=>e.organizationId===t&&e.enabled)),belongToOneEnterpriseOrgs:t,belongToMultipleEnterpriseOrgs:i})))}evaluateEnterpriseOrganizations(e){const t=e.filter(e=>e.canManageSponsorships).length;return{belongToOneEnterpriseOrgs:1===t,belongToMultipleEnterpriseOrgs:t>1}}}v.ɵfac=function(e){return new(e||v)(h.KVO(p.m),h.KVO(l.PV),h.KVO(m.Di))},v.ɵprov=h.jDH({token:v,factory:v.ɵfac,providedIn:"root"})},33818:(e,t,i)=>{"use strict";i.d(t,{U:()=>L});var n=i(77468),r=i(33812),s=i(51757),o=i(71804),a=i(7248);class l extends a.V{}var c=i(37380),d=i(56962),u=i(81525),h=i(81573),p=i(26411),m=i(89479),v=i(75583),f=i(29029),g=i(55807),y=i(37579),b=i(80351),w=i(36801),S=i(89294),I=i(50700),k=i(37115),C=i(62166),T=i(21274),F=i(69855),R=i(7730),P=i(68016),x=i(86226),$=i(97553),E=i(43759),A=i(58806),D=i(56898),O=i(26657),M=i(45154),U=i(44432),G=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function j(e,t){if(1&e&&(r.qex(0),r.j41(1,"bit-callout",8),r.nI1(2,"i18n"),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.nrm(5,"img",9),r.j41(6,"strong"),r.EFF(7),r.nI1(8,"i18n"),r.k0s(),r.EFF(9),r.nrm(10,"br"),r.j41(11,"strong"),r.EFF(12),r.nI1(13,"i18n"),r.k0s(),r.EFF(14),r.nrm(15,"br"),r.j41(16,"strong"),r.EFF(17),r.nI1(18,"i18n"),r.k0s(),r.EFF(19),r.bVm()),2&e){const e=r.XpG(2);r.R7$(),r.Y8G("title",r.bMT(2,8,"enabled")),r.R7$(2),r.SpI(" ",r.bMT(4,10,"twoStepLoginProviderEnabled")," "),r.R7$(4),r.SpI("",r.bMT(8,12,"twoFactorDuoClientId"),":"),r.R7$(2),r.SpI(" ",e.clientId," "),r.R7$(3),r.SpI("",r.bMT(13,14,"twoFactorDuoClientSecret"),":"),r.R7$(2),r.SpI(" ",e.clientSecret," "),r.R7$(3),r.SpI("",r.bMT(18,16,"twoFactorDuoApiHostname"),":"),r.R7$(2),r.SpI(" ",e.host," ")}}function N(e,t){1&e&&(r.qex(0),r.nrm(1,"img",9),r.j41(2,"p",10),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"bit-form-field")(6,"bit-label"),r.EFF(7),r.nI1(8,"i18n"),r.k0s(),r.nrm(9,"input",11),r.k0s(),r.j41(10,"bit-form-field")(11,"bit-label"),r.EFF(12),r.nI1(13,"i18n"),r.k0s(),r.nrm(14,"input",12),r.k0s(),r.j41(15,"bit-form-field")(16,"bit-label"),r.EFF(17),r.nI1(18,"i18n"),r.k0s(),r.nrm(19,"input",13),r.nI1(20,"i18n"),r.k0s(),r.bVm()),2&e&&(r.R7$(3),r.JRh(r.bMT(4,6,"twoFactorDuoDesc")),r.R7$(4),r.JRh(r.bMT(8,8,"twoFactorDuoClientId")),r.R7$(5),r.JRh(r.bMT(13,10,"twoFactorDuoClientSecret")),r.R7$(5),r.JRh(r.bMT(18,12,"twoFactorDuoApiHostname")),r.R7$(2),r.Y8G("placeholder",r.VkB("",r.bMT(20,14,"ex")," api-xxxxxxxx.duosecurity.com")))}function V(e,t){1&e&&(r.j41(0,"span"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"enable")))}function B(e,t){1&e&&(r.j41(0,"span"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"disable")))}function z(e,t){if(1&e&&(r.j41(0,"form",1)(1,"bit-dialog",2),r.nI1(2,"i18n"),r.qex(3,3),r.DNE(4,j,20,18,"ng-container",4)(5,N,21,16,"ng-container",4),r.bVm(),r.qex(6,5),r.j41(7,"button",6),r.DNE(8,V,3,3,"span",4)(9,B,3,3,"span",4),r.k0s(),r.j41(10,"button",7),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e){const e=r.XpG();r.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),r.R7$(),r.Y8G("title",r.bMT(2,9,"twoStepLogin"))("subtitle","Duo"),r.R7$(3),r.Y8G("ngIf",e.enabled),r.R7$(),r.Y8G("ngIf",!e.enabled),r.R7$(3),r.Y8G("ngIf",!e.enabled),r.R7$(),r.Y8G("ngIf",e.enabled),r.R7$(2),r.SpI(" ",r.bMT(12,11,"close")," ")}}class L extends S.g{constructor(e,t,i,n,a,l,c,d,u,h){super(t,i,n,a,l,c,h),this.data=e,this.formBuilder=d,this.dialogRef=u,this.toastService=h,this.onChangeStatus=new r.bkB,this.type=o.R.Duo,this.formGroup=this.formBuilder.group({clientId:["",[s.k0.required]],clientSecret:["",[s.k0.required]],host:["",[s.k0.required]]}),this.componentName="app-two-factor-duo",this.submit=()=>G(this,void 0,void 0,function*(){this.formGroup.markAllAsTouched(),this.formGroup.invalid||(this.enabled?yield this.disableMethod():yield this.enable(),this.onChangeStatus.emit(this.enabled))}),this.onClose=()=>{this.dialogRef.close(this.enabled)}}get clientId(){var e;return(null===(e=this.formGroup.get("clientId"))||void 0===e?void 0:e.value)||""}get clientSecret(){var e;return(null===(e=this.formGroup.get("clientSecret"))||void 0===e?void 0:e.value)||""}get host(){var e;return(null===(e=this.formGroup.get("host"))||void 0===e?void 0:e.value)||""}set clientId(e){var t;null===(t=this.formGroup.get("clientId"))||void 0===t||t.setValue(e)}set clientSecret(e){var t;null===(t=this.formGroup.get("clientSecret"))||void 0===t||t.setValue(e)}set host(e){var t;null===(t=this.formGroup.get("host"))||void 0===t||t.setValue(e)}ngOnInit(){const e=Object.create(null,{auth:{get:()=>super.auth}});return G(this,void 0,void 0,function*(){var t;if(!(null===(t=this.data)||void 0===t?void 0:t.authResponse))throw Error("TwoFactorDuoComponent requires a TwoFactorDuoResponse to initialize");e.auth.call(this,this.data.authResponse),this.processResponse(this.data.authResponse.response),this.data.organizationId&&(this.type=o.R.OrganizationDuo,this.organizationId=this.data.organizationId)})}enable(){return G(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(l);let t;e.clientId=this.clientId,e.clientSecret=this.clientSecret,e.host=this.host,t=null!=this.organizationId?yield this.twoFactorService.putTwoFactorOrganizationDuo(this.organizationId,e):yield this.twoFactorService.putTwoFactorDuo(e),this.processResponse(t),this.onUpdated.emit(!0)})}processResponse(e){this.clientId=e.clientId,this.clientSecret=e.clientSecret,this.host=e.host,this.enabled=e.enabled}}L.open=(e,t)=>e.open(L,t),L.ɵfac=function(e){return new(e||L)(r.rXU(u.Qs),r.rXU(c.fz),r.rXU(I.W),r.rXU(k.y),r.rXU(d.K),r.rXU(C.i),r.rXU(T.o3),r.rXU(s.ok),r.rXU(T.ce),r.rXU(F.f))},L.ɵcmp=r.VBU({type:L,selectors:[["app-two-factor-setup-duo"]],outputs:{onChangeStatus:"onChangeStatus"},features:[r.Vt3],decls:1,vars:1,consts:[["autocomplete","off",3,"formGroup","bitSubmit",4,"ngIf"],["autocomplete","off",3,"formGroup","bitSubmit"],[3,"title","subtitle"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi bwi-check-circle",3,"title"],["alt","Duo logo",1,"tw-float-right","tw-ml-3","mfaType2"],["bitTypography","body1"],["bitInput","","type","text","formControlName","clientId","appInputVerbatim",""],["bitInput","","type","password","formControlName","clientSecret","appInputVerbatim",""],["bitInput","","type","text","formControlName","host","appInputVerbatim","",3,"placeholder"]],template:function(e,t){1&e&&r.DNE(0,z,13,13,"form",0),2&e&&r.Y8G("ngIf",t.authed)},dependencies:[n.MD,n.bT,h.P,R.I,P.m,p.L,x.j,$.J,E.h,m.x,v.E,A.r,f.t,D.Q,g.o,s.X1,s.qT,s.me,s.BC,s.cb,s.j4,s.JD,y.C,O.$,M.L,b.j,U.G,w.$Z],encapsulation:2})},33886:(e,t,i)=>{"use strict";i.d(t,{w:()=>f});var n=i(39180),r=i(94573),s=i(74208),o=i(33812),a=i(33277),l=i(51757),c=i(97658),d=i(22949),u=i(68923),h=i(50700);function p(e,t){if(1&e&&o.nrm(0,"i",6),2&e){const e=o.XpG().item;o.HbH(o.VkB("bwi bwi-fw ",e.icon))}}function m(e,t){if(1&e&&(o.j41(0,"div",2)(1,"div",3),o.nVh(2,p,1,3,"i",4),o.k0s(),o.j41(3,"div",5),o.EFF(4),o.k0s()()),2&e){const e=t.item;o.Y8G("title",e.label),o.R7$(2),o.vxM(null!=e.icon?2:-1),o.R7$(2),o.SpI(" ",e.label," ")}}let v=0;class f{constructor(e,t){this.i18nService=e,this.ngControl=t,this.select=r.ebz.required(c.vr),this.items=(0,r.geq)(),this.placeholder=(0,r.hFB)(this.i18nService.t("selectPlaceholder")),this.closed=new o.bkB,this.selectedValue=(0,s.vPA)(void 0),this.selectedOption=(0,a.EW)(()=>this.findSelectedOption(this.items(),this.selectedValue())),this.searchInputId="bit-select-search-input-"+v++,this.classes=["tw-block","tw-w-full","tw-h-full"],this.id=(0,r.hFB)("bit-multi-select-"+v++),this.onKeyDown=e=>(this.select().isOpen()&&"Escape"===e.key&&!(0,n.rp)(e)&&e.stopPropagation(),!0),null!=t&&(t.valueAccessor=this)}set options(e){null!=e&&0!=e.length&&this.items.set(e.toArray().map(e=>({icon:e.icon(),value:e.value(),label:e.label(),disabled:e.disabled()})))}get disabledAttr(){return this.disabled||null}get disabled(){var e,t,i;return null!==(i=null!==(e=this._disabled)&&void 0!==e?e:null===(t=this.ngControl)||void 0===t?void 0:t.disabled)&&void 0!==i&&i}set disabled(e){this._disabled=null!=e&&!1!==e}writeValue(e){this.selectedValue.set(e)}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouched=e}setDisabledState(e){this.disabled=e}onChange(e){this.selectedValue.set(null==e?void 0:e.value),this.notifyOnChange&&this.notifyOnChange(null==e?void 0:e.value)}onBlur(){this.notifyOnTouched&&this.notifyOnTouched()}get ariaDescribedBy(){return this._ariaDescribedBy}set ariaDescribedBy(e){var t;this._ariaDescribedBy=e,null===(t=this.select())||void 0===t||t.searchInput().nativeElement.setAttribute("aria-describedby",null!=e?e:"")}get labelForId(){return this.searchInputId}get required(){var e,t,i,n;return null!==(n=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(l.k0.required))&&void 0!==n&&n}set required(e){this._required=null!=e&&!1!==e}get hasError(){var e,t;return!("INVALID"!==(null===(e=this.ngControl)||void 0===e?void 0:e.status)||!(null===(t=this.ngControl)||void 0===t?void 0:t.touched))}get error(){var e,t;const i=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}findSelectedOption(e,t){return null==e?void 0:e.find(e=>e.value===t)}onClose(){this.closed.emit()}}f.ɵfac=function(e){return new(e||f)(o.rXU(h.W),o.rXU(l.vO,10))},f.ɵcmp=o.VBU({type:f,selectors:[["bit-select"]],contentQueries:function(e,t,i){if(1&e&&o.wni(i,u.P,4),2&e){let e;o.mGM(e=o.lsd())&&(t.options=e)}},viewQuery:function(e,t){1&e&&o.wEZ(t.select,c.vr,5),2&e&&o.NyB()},hostVars:6,hostBindings:function(e,t){2&e&&(o.Avn("id",t.id()),o.BMQ("disabled",t.disabledAttr)("aria-describedby",t.ariaDescribedBy)("required",t.required),o.HbH(t.classes))},inputs:{items:[1,"items"],placeholder:[1,"placeholder"],disabled:"disabled",id:[1,"id"],required:"required"},outputs:{items:"itemsChange",closed:"closed"},features:[o.Jv_([{provide:d.p,useExisting:f}])],decls:2,vars:8,consts:[["appendTo","body",3,"ngModelChange","blur","close","ngModel","disabled","placeholder","items","labelForId","clearable","keyDownFn"],["ng-option-tmp",""],[1,"tw-flex",3,"title"],[1,"tw-me-2","tw-flex-initial"],["aria-hidden","true",3,"class"],[1,"tw-flex-1","tw-text-ellipsis","tw-overflow-hidden"],["aria-hidden","true"]],template:function(e,t){var i;if(1&e&&(o.j41(0,"ng-select",0),o.bIt("ngModelChange",function(e){return t.onChange(e)})("blur",function(){return t.onBlur()})("close",function(){return t.onClose()}),o.DNE(1,m,5,3,"ng-template",1),o.k0s()),2&e){let e;o.Y8G("ngModel",t.selectedOption())("disabled",t.disabled)("placeholder",t.placeholder())("items",t.items())("labelForId",t.labelForId)("clearable",!1)("keyDownFn",t.onKeyDown),o.BMQ("aria-label",null!==(i=null==(e=t.selectedOption())?null:e.label)&&void 0!==i?i:t.placeholder())}},dependencies:[c.MQ,c.vr,c.Uq,l.X1,l.BC,l.YN,l.vS],encapsulation:2})},34461:(e,t,i)=>{"use strict";i.d(t,{$:()=>s});var n=i(39306),r=i(43890);class s{constructor(e){e&&(this.id=e.id,this.url=e.url,this.size=e.size,this.sizeName=e.sizeName)}get fileSize(){try{if(null!=this.size)return parseInt(this.size)}catch(e){}return 0}static fromJSON(e){const t=null==e.key?null:r.e.fromJSON(e.key);let i;return null!=e.encryptedKey&&("string"==typeof e.encryptedKey?i=n.k.fromJSON(e.encryptedKey):e.encryptedKey instanceof n.k&&(i=e.encryptedKey)),Object.assign(new s,e,{key:t,encryptedKey:i})}toSdkAttachmentView(){var e;return{id:this.id,url:this.url,size:this.size,sizeName:this.sizeName,fileName:this.fileName,key:null===(e=this.encryptedKey)||void 0===e?void 0:e.toSdk(),decryptedKey:this.key?this.key.toBase64():void 0}}static fromSdkAttachmentView(e){if(!e)return;const t=new s;return t.id=e.id,t.url=e.url,t.size=e.size,t.sizeName=e.sizeName,t.fileName=e.fileName,t.key=e.decryptedKey?r.e.fromString(e.decryptedKey):void 0,t.encryptedKey=e.key?new n.k(e.key):void 0,t}}},34465:(e,t,i)=>{"use strict";i.d(t,{S:()=>s});var n=i(94573),r=i(33812);class s{constructor(){this.text=(0,n.hFB)(),this.ariaLabel=(0,n.hFB)(),this.icon=(0,n.hFB)(),this.variant=(0,n.hFB)("default"),this.treeDepth=(0,n.geq)(0),this.route=(0,n.hFB)(),this.relativeTo=(0,n.hFB)(),this.routerLinkActiveOptions=(0,n.hFB)({paths:"subset",queryParams:"ignored",fragment:"ignored",matrixParams:"ignored"}),this.hideActiveStyles=(0,n.hFB)(!1),this.mainContentClicked=new r.bkB}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=r.FsC({type:s,inputs:{text:[1,"text"],ariaLabel:[1,"ariaLabel"],icon:[1,"icon"],variant:[1,"variant"],treeDepth:[1,"treeDepth"],route:[1,"route"],relativeTo:[1,"relativeTo"],routerLinkActiveOptions:[1,"routerLinkActiveOptions"],hideActiveStyles:[1,"hideActiveStyles"]},outputs:{treeDepth:"treeDepthChange",mainContentClicked:"mainContentClicked"}})},34530:(e,t,i)=>{"use strict";i.d(t,{R:()=>r});var n=i(33812);class r{transform(e,t,i,n,r){return null==e||0===e.length?[]:null==t||t.length<2?e:(t=t.trim().toLowerCase(),e.filter(e=>{if(null!=i){const n="function"==typeof i?i(e):e[i];if((null==n?void 0:n.toString().toLowerCase().indexOf(t))>-1)return!0}if(null!=n){const i="function"==typeof n?n(e):e[n];if((null==i?void 0:i.toString().toLowerCase().indexOf(t))>-1)return!0}if(null!=r){const i="function"==typeof r?r(e):e[r];if((null==i?void 0:i.toString().toLowerCase().indexOf(t))>-1)return!0}return!1}))}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"search",type:r,pure:!0,standalone:!1})},34693:(e,t,i)=>{"use strict";var n;i.d(t,{M:()=>n}),function(e){e[e.Cipher=0]="Cipher",e[e.CipherView=1]="CipherView"}(n||(n={}))},34923:(e,t,i)=>{"use strict";i.d(t,{c3:()=>R,kx:()=>P,vU:()=>x});var n=i(51757),r=i(66046),s=i(3204),o=i(12610),a=i(14803),l=i(47438),c=i(25065),d=i(14055),u=i(33812),h=i(50700),p=i(86226),m=i(93199),v=i(97553),f=i(43759),g=i(33886),y=i(68923),b=i(77468),w=i(88016),S=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};const I=(e,t)=>t.value;function k(e,t){if(1&e&&u.nrm(0,"bit-option",5),2&e){const e=t.$implicit;u.Y8G("value",e.value)("disabled",e.disabled)("label",e.name)}}function C(e,t){if(1&e&&(u.j41(0,"div",2)(1,"bit-form-field",3)(2,"bit-label"),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.nrm(5,"input",8),u.k0s()(),u.j41(6,"div",2)(7,"bit-form-field",3)(8,"bit-label"),u.EFF(9),u.nI1(10,"i18n"),u.k0s(),u.nrm(11,"input",9),u.k0s()(),u.j41(12,"div",2)(13,"bit-form-field",3)(14,"bit-label"),u.EFF(15),u.nI1(16,"i18n"),u.k0s(),u.nrm(17,"input",10),u.k0s()(),u.j41(18,"div",2)(19,"bit-form-field",3)(20,"bit-label"),u.EFF(21),u.nI1(22,"i18n"),u.k0s(),u.nrm(23,"input",11),u.k0s()()),2&e){const e=u.XpG();u.R7$(),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(4,12,"address1")),u.R7$(2),u.Y8G("formControl",e.group.controls.line1),u.R7$(2),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(10,14,"address2")),u.R7$(2),u.Y8G("formControl",e.group.controls.line2),u.R7$(2),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(16,16,"cityTown")),u.R7$(2),u.Y8G("formControl",e.group.controls.city),u.R7$(2),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(22,18,"stateProvince")),u.R7$(2),u.Y8G("formControl",e.group.controls.state)}}function T(e,t){if(1&e&&(u.j41(0,"bit-hint"),u.nrm(1,"i",13),u.EFF(2),u.k0s()),2&e){u.XpG();const e=u.r8f(6);u.R7$(),u.Y8G("title",u.mNQ(e)),u.R7$(),u.JRh(e)}}function F(e,t){if(1&e&&(u.j41(0,"div",7)(1,"bit-form-field",3)(2,"bit-label"),u.EFF(3),u.nI1(4,"i18n"),u.k0s(),u.nrm(5,"input",12),u.SS7(6),u.nVh(7,T,3,3,"bit-hint"),u.k0s()()),2&e){const e=u.XpG();u.R7$(),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(4,4,"taxIdNumber")),u.R7$(2),u.Y8G("formControl",e.group.controls.taxId),u.R7$();const t=u.bH3(e.taxIdWarningHint);u.R7$(),u.vxM(t?7:-1)}}const R=e=>P(e.getRawValue()),P=e=>{const{taxId:t}=e,i=S(e,["taxId"]),n=t?(0,d.i5)(i.country):null;return n?Object.assign(Object.assign({},i),{taxId:{code:n.code,value:t}}):Object.assign(Object.assign({},i),{taxId:null})};class x{constructor(e){this.i18nService=e,this.selectableCountries=d.Lx,this.destroy$=new r.B,this.disableAddressControls=()=>{this.group.controls.line1.disable(),this.group.controls.line2.disable(),this.group.controls.city.disable(),this.group.controls.state.disable()}}ngOnInit(){var e,t;switch(this.scenario.type){case"checkout":this.disableAddressControls();break;case"update":this.scenario.existing&&this.group.patchValue(Object.assign(Object.assign({},this.scenario.existing),{taxId:null===(e=this.scenario.existing.taxId)||void 0===e?void 0:e.value}))}this.supportsTaxId$=this.group.controls.country.valueChanges.pipe((0,o.Z)(null!==(t=this.group.value.country)&&void 0!==t?t:this.selectableCountries[0].value),(0,s.T)(e=>!(!this.scenario.supportsTaxId||"US"===e)&&d.qk.filter(t=>t.iso===e).length>0)),this.supportsTaxId$.pipe((0,a.Q)(this.destroy$)).subscribe(e=>{e?this.group.controls.taxId.enable():this.group.controls.taxId.disable()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get taxIdWarningHint(){if("checkout"===this.scenario.type||!this.scenario.supportsTaxId||!this.group.value.country||this.scenario.taxIdWarning!==l.e.FailedVerification)return null;const e=(0,d.i5)(this.group.value.country);if(!e)return null;const t=this.i18nService.t("checkInputFormat");switch(e.code){case"au_abn":return`${t} ${this.i18nService.t("exampleTaxIdFormat","ABN",e.example)}`;case"eu_vat":return`${t} ${this.i18nService.t("exampleTaxIdFormat","EU VAT",e.example)}`;case"gb_vat":return`${t} ${this.i18nService.t("exampleTaxIdFormat","GB VAT",e.example)}`}}}x.getFormGroup=()=>new n.gE({country:new n.MJ("",{nonNullable:!0,validators:[n.k0.required]}),postalCode:new n.MJ("",{nonNullable:!0,validators:[n.k0.required]}),line1:new n.MJ(null),line2:new n.MJ(null),city:new n.MJ(null),state:new n.MJ(null),taxId:new n.MJ(null)}),x.ɵfac=function(e){return new(e||x)(u.rXU(h.W))},x.ɵcmp=u.VBU({type:x,selectors:[["app-enter-billing-address"]],inputs:{scenario:"scenario",group:"group"},decls:19,vars:15,consts:[[3,"formGroup"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],[3,"disableMargin"],["data-testid","country",3,"formControl"],[3,"value","disabled","label"],["bitInput","","type","text","autocomplete","postal-code","data-testid","postal-code",3,"formControl"],[1,"tw-col-span-12"],["bitInput","","type","text","autocomplete","address-line1","data-testid","address-line1",3,"formControl"],["bitInput","","type","text","autocomplete","address-line2","data-testid","address-line2",3,"formControl"],["bitInput","","type","text","autocomplete","address-level2","data-testid","city",3,"formControl"],["bitInput","","type","text","autocomplete","address-level1","data-testid","state",3,"formControl"],["bitInput","","type","text","data-testid","tax-id",3,"formControl"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-mr-1",3,"title"]],template:function(e,t){1&e&&(u.j41(0,"form",0)(1,"div",1)(2,"div",2)(3,"bit-form-field",3)(4,"bit-label"),u.EFF(5),u.nI1(6,"i18n"),u.k0s(),u.j41(7,"bit-select",4),u.Z7z(8,k,1,3,"bit-option",5,I),u.k0s()()(),u.j41(10,"div",2)(11,"bit-form-field",3)(12,"bit-label"),u.EFF(13),u.nI1(14,"i18n"),u.k0s(),u.nrm(15,"input",6),u.k0s()(),u.nVh(16,C,24,20),u.nVh(17,F,8,7,"div",7),u.nI1(18,"async"),u.k0s()()),2&e&&(u.Y8G("formGroup",t.group),u.R7$(3),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(6,9,"country")),u.R7$(2),u.Y8G("formControl",t.group.controls.country),u.R7$(),u.Dyx(t.selectableCountries),u.R7$(3),u.Y8G("disableMargin",!0),u.R7$(2),u.JRh(u.bMT(14,11,"zipPostalCodeLabel")),u.R7$(2),u.Y8G("formControl",t.group.controls.postalCode),u.R7$(),u.vxM("update"===t.scenario.type?16:-1),u.R7$(),u.vxM(u.bMT(18,13,t.supportsTaxId$)?17:-1))},dependencies:[c.G,n.qT,n.me,n.BC,n.cb,n.l_,n.j4,p.j,m.I,v.J,f.h,g.w,y.P,b.Jj,w.$],encapsulation:2})},35004:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});const n=1e5},35042:(e,t,i)=>{"use strict";i.d(t,{h:()=>a});var n=i(94573),r=i(33812),s=i(81525);let o=0;class a{constructor(e){this.dialogRef=e,this.id="bit-dialog-title-"+o++,this.simple=(0,n.hFB)(!1)}ngOnInit(){this.dialogRef&&Promise.resolve().then(()=>{const e=this.dialogRef.containerInstance;e&&0===e._ariaLabelledByQueue.length&&e._ariaLabelledByQueue.push(this.id)})}}a.ɵfac=function(e){return new(e||a)(r.rXU(s.ce,8))},a.ɵdir=r.FsC({type:a,selectors:[["","bitDialogTitleContainer",""]],hostVars:1,hostBindings:function(e,t){2&e&&r.Avn("id",t.id)},inputs:{simple:[1,"simple"]}})},35185:(e,t,i)=>{"use strict";i.d(t,{K:()=>p});var n=i(72245),r=i(28202),s=i(81441),o=i(22848);class a{constructor(e,t,i,n,r,s){if(this.masterPasswordHash=e,this.key=t,this.masterPasswordHint=i,this.orgIdentifier=n,this.keys=r,s.kdfType===o.ao.PBKDF2_SHA256)this.kdf=o.ao.PBKDF2_SHA256,this.kdfIterations=s.iterations;else{if(s.kdfType!==o.ao.Argon2id)throw new Error(`Unsupported KDF type: ${s}`);this.kdf=o.ao.Argon2id,this.kdfIterations=s.iterations,this.kdfMemory=s.memory,this.kdfParallelism=s.parallelism}}static newConstructor(e,t,i,n,r){return new a(e.masterPasswordAuthenticationHash,t.masterKeyWrappedUserKey,i,n,r,t.kdf)}}class l extends r.W7{}var c=i(48541),d=i(78781),u=i(21001),h=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class p{constructor(e,t,i,n,r,s,o,a,l,c){this.apiService=e,this.encryptService=t,this.i18nService=i,this.kdfConfigService=n,this.keyService=r,this.masterPasswordApiService=s,this.masterPasswordService=o,this.organizationApiService=a,this.organizationUserApiService=l,this.userDecryptionOptionsService=c}setInitialPassword(e,t,i){return h(this,void 0,void 0,function*(){const{newMasterKey:r,newServerMasterKeyHash:o,newLocalMasterKeyHash:l,newPasswordHint:h,kdfConfig:p,orgSsoIdentifier:m,orgId:v,resetPasswordAutoEnroll:f}=e;for(const[t,i]of Object.entries(e))if(null==i)throw new Error(`${t} not found. Could not set password.`);if(null==i)throw new Error("userId not found. Could not set password.");if(null==t)throw new Error("userType not found. Could not set password.");const g=yield this.makeMasterKeyEncryptedUserKey(r,i);if(null==g||!g[1].encryptedString)throw new Error("masterKeyEncryptedUserKey not found. Could not set password.");let y=null,b=null;if(t===u.bg.JIT_PROVISIONED_MP_ORG_USER){const e=yield(0,n._)(this.keyService.userPrivateKey$(i)),t=yield(0,n._)(this.keyService.userPublicKey$(i));if(null!=e&&null!=t){y=[d.A.fromBufferToB64(t),yield this.encryptService.wrapDecapsulationKey(e,g[0])]}else y=yield this.keyService.makeKeyPair(g[0]);if(null==y)throw new Error("keyPair not found. Could not set password.");if(!y[1].encryptedString)throw new Error("encrypted private key not found. Could not set password.");b=new c.G(y[0],y[1].encryptedString)}const w=new a(o,g[1].encryptedString,h,m,b,p);if(yield this.masterPasswordApiService.setPassword(w),yield this.masterPasswordService.setForceSetPasswordReason(s.n.None,i),yield this.updateAccountDecryptionProperties(r,p,g,i),null!=y&&t===u.bg.JIT_PROVISIONED_MP_ORG_USER){if(!y[1].encryptedString)throw new Error("encrypted private key not found. Could not set private key in state.");yield this.keyService.setPrivateKey(y[1].encryptedString,i)}yield this.masterPasswordService.setMasterKeyHash(l,i),f&&(yield this.handleResetPasswordAutoEnroll(o,v,i))})}makeMasterKeyEncryptedUserKey(e,t){return h(this,void 0,void 0,function*(){let i=null;const r=yield(0,n._)(this.keyService.userKey$(t));return i=null==r?yield this.keyService.makeUserKey(e):yield this.keyService.encryptUserKeyWithMasterKey(e,r),i})}updateAccountDecryptionProperties(e,t,i,r){return h(this,void 0,void 0,function*(){const s=yield(0,n._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(r));s.hasMasterPassword=!0,yield this.userDecryptionOptionsService.setUserDecryptionOptionsById(r,s),yield this.kdfConfigService.setKdfConfig(r,t),yield this.masterPasswordService.setMasterKey(e,r),yield this.keyService.setUserKey(i[0],r)})}handleResetPasswordAutoEnroll(e,t,i){return h(this,void 0,void 0,function*(){const s=yield this.organizationApiService.getKeys(t);if(null==s)throw new Error("Organization keys response is null. Could not handle reset password auto enroll.");const o=d.A.fromB64ToArray(s.publicKey),a=yield(0,n._)(this.keyService.userKey$(i));if(null==a)throw new Error("userKey not found. Could not handle reset password auto enroll.");const l=yield this.encryptService.encapsulateKeyUnsigned(a,o);if(null==l||!l.encryptedString)throw new Error("orgPublicKeyEncryptedUserKey not found. Could not handle reset password auto enroll.");const c=new r.Wt;c.masterPasswordHash=e,c.resetPasswordKey=l.encryptedString,yield this.organizationUserApiService.putOrganizationUserResetPasswordEnrollment(t,i,c)})}setInitialPasswordTdeOffboarding(e,t){return h(this,void 0,void 0,function*(){const{newMasterKey:i,newServerMasterKeyHash:r,newPasswordHint:o}=e;for(const[t,n]of Object.entries(e))if(null==n)throw new Error(`${t} not found. Could not set password.`);if(null==t)throw new Error("userId not found. Could not set password.");const a=yield(0,n._)(this.keyService.userKey$(t));if(null==a)throw new Error("userKey not found. Could not set password.");const c=yield this.keyService.encryptUserKeyWithMasterKey(i,a);if(!c[1].encryptedString)throw new Error("newMasterKeyEncryptedUserKey not found. Could not set password.");const d=new l;d.key=c[1].encryptedString,d.newMasterPasswordHash=r,d.masterPasswordHint=o,yield this.masterPasswordApiService.putUpdateTdeOffboardingPassword(d),yield this.masterPasswordService.setForceSetPasswordReason(s.n.None,t)})}}},35500:(e,t,i)=>{"use strict";function n(e,t){if(null==e&&null==t)return!0;if(null==e||null==t)return!1;const i=new Set([...Object.keys(e),...Object.keys(t)]);for(const n of i)if(e[n]!==t[n])return!1;return!0}i.d(t,{A6:()=>s,Di:()=>r,Wm:()=>n});class r{}class s extends r{}},35631:(e,t,i)=>{"use strict";i.d(t,{i:()=>n,y:()=>r});class n{constructor(e,t){this.state$=e,this.set=t}}class r{}},36107:(e,t,i)=>{"use strict";i.d(t,{a:()=>o});var n=i(20702),r=i(36304),s=i(26076);class o extends n.r{constructor(e=null){if(super(e),null==e)return;this.username=this.getResponseProperty("Username"),this.password=this.getResponseProperty("Password"),this.passwordRevisionDate=this.getResponseProperty("PasswordRevisionDate"),this.totp=this.getResponseProperty("Totp"),this.autofillOnPageLoad=this.getResponseProperty("AutofillOnPageLoad");const t=this.getResponseProperty("Uris");null!=t&&(this.uris=t.map(e=>new s.q(e)));const i=this.getResponseProperty("Fido2Credentials");null!=i&&(this.fido2Credentials=i.map(e=>new r.K(e)))}}},36288:(e,t,i)=>{"use strict";i.d(t,{s:()=>I});var n=i(77468),r=i(94573),s=i(74208),o=i(33812),a=i(33277),l=i(83731),c=i(25479),d=i(50147),u=i(30634),h=i(53100),p=i(70171),m=i(83632),v=i(5513),f=i(6307),g=i(23542);const y=e=>({"tw-invisible":e}),b=["tw-relative","before:tw-content-['']","before:tw-block","before:tw-absolute","before:-tw-inset-[1px]","before:tw-rounded-lg","before:tw-transition","before:tw-ring-2","before:tw-ring-transparent","focus-visible:tw-z-10"],w={contrast:["!tw-text-contrast","tw-border-transparent","hover:!tw-bg-hover-contrast","focus-visible:before:tw-ring-text-contrast",...b],main:["!tw-text-main","focus-visible:before:tw-ring-primary-600",...b],muted:["!tw-text-muted","tw-border-transparent","aria-expanded:tw-bg-text-muted","aria-expanded:!tw-text-contrast","focus-visible:before:tw-ring-primary-600","aria-expanded:hover:tw-bg-secondary-700","aria-expanded:hover:tw-border-secondary-700",...b],primary:["!tw-text-primary-600","focus-visible:before:tw-ring-primary-600",...b],danger:["!tw-text-danger-600","focus-visible:before:tw-ring-primary-600",...b],"nav-contrast":["!tw-text-alt2","hover:!tw-bg-hover-contrast","focus-visible:before:tw-ring-text-alt2",...b]},S={default:["tw-text-xl","tw-p-2.5","tw-rounded-md"],small:["tw-text-base","tw-p-2","tw-rounded"]};class I{get classList(){return["tw-font-medium","tw-leading-[0px]","tw-border-none","tw-transition","tw-bg-transparent","hover:tw-no-underline","hover:tw-bg-hover-default","focus:tw-outline-none"].concat(w[this.buttonType()]).concat(S[this.size()]).concat(this.showDisabledStyles()||this.disabled()?["aria-disabled:tw-opacity-60","aria-disabled:hover:!tw-bg-transparent","tw-cursor-default"]:[])}getFocusTarget(){return this.elementRef.nativeElement}constructor(){this.icon=r.geq.required({alias:"bitIconButton"}),this.buttonType=(0,r.hFB)("main"),this.size=(0,r.geq)("default"),this.elementRef=(0,s.WQX)(o.aKT),this.tooltip=(0,s.WQX)(v.d,{host:!0,optional:!0}),this.label=(0,r.hFB)(),this.iconClass=(0,a.EW)(()=>[this.icon(),"!tw-m-0"]),this.disabledAttr=(0,a.EW)(()=>null!=this.disabled()&&!1!==this.disabled()||this.loading()),this.showDisabledStyles=(0,a.EW)(()=>this.showLoadingStyle()||this.disabledAttr()&&!1===this.loading()),this.loading=(0,r.geq)(!1),this.showLoadingStyle=(0,l.ot)((0,l.br)(this.loading).pipe((0,d.s)(e=>(0,c.Y)(e?75:0)))),this.disabled=(0,r.geq)(!1);const e=this.elementRef.nativeElement;(0,f.m)(e,this.disabledAttr);const t=e.getAttribute("title");(0,a.QZ)(()=>{var e;(0,u.J)({element:this.elementRef.nativeElement,title:void 0,label:this.label()});const i=t||this.label();i&&(null===(e=this.tooltip)||void 0===e||e.tooltipContent.set(i))})}}I.ɵfac=function(e){return new(e||I)},I.ɵcmp=o.VBU({type:I,selectors:[["button","bitIconButton","",5,"button","bitButton",""]],hostVars:3,hostBindings:function(e,t){2&e&&(o.BMQ("bitIconButton",t.icon()),o.HbH(t.classList))},inputs:{icon:[1,"bitIconButton","icon"],buttonType:[1,"buttonType"],size:[1,"size"],label:[1,"label"],loading:[1,"loading"],disabled:[1,"disabled"]},outputs:{icon:"bitIconButtonChange",size:"sizeChange",loading:"loadingChange",disabled:"disabledChange"},features:[o.Jv_([{provide:h.E,useExisting:I},{provide:p.H,useExisting:I}]),o.nM4([g.v,{directive:v.d,inputs:["tooltipPosition","tooltipPosition"]}])],attrs:["bitIconButton",""],decls:5,vars:7,consts:[[1,"tw-relative","tw-inline-block","tw-leading-[0px]"],[1,"tw-inline-block","tw-leading-[0px]",3,"ngClass"],["aria-hidden","true",1,"bwi",3,"ngClass"],[1,"tw-absolute","tw-inset-0","tw-flex","tw-items-center","tw-justify-center",3,"ngClass"],["size","fill","noColor",""]],template:function(e,t){1&e&&(o.j41(0,"span",0)(1,"span",1),o.nrm(2,"i",2),o.k0s(),o.j41(3,"span",3),o.nrm(4,"bit-spinner",4),o.k0s()()),2&e&&(o.R7$(),o.Y8G("ngClass",o.eq3(3,y,t.showLoadingStyle())),o.R7$(),o.Y8G("ngClass",t.iconClass()),o.R7$(),o.Y8G("ngClass",o.eq3(5,y,!t.showLoadingStyle())))},dependencies:[n.YU,m.t],encapsulation:2})},36304:(e,t,i)=>{"use strict";i.d(t,{K:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.credentialId=this.getResponseProperty("CredentialId"),this.keyType=this.getResponseProperty("KeyType"),this.keyAlgorithm=this.getResponseProperty("KeyAlgorithm"),this.keyCurve=this.getResponseProperty("KeyCurve"),this.keyValue=this.getResponseProperty("keyValue"),this.rpId=this.getResponseProperty("RpId"),this.userHandle=this.getResponseProperty("UserHandle"),this.userName=this.getResponseProperty("UserName"),this.counter=this.getResponseProperty("Counter"),this.rpName=this.getResponseProperty("RpName"),this.userDisplayName=this.getResponseProperty("UserDisplayName"),this.discoverable=this.getResponseProperty("Discoverable"),this.creationDate=this.getResponseProperty("CreationDate"))}}},36501:(e,t,i)=>{"use strict";i.d(t,{b:()=>n,x:()=>r});const n={None:0,Password:1};function r(e){switch(e){case n.None:case n.Password:return e;default:return n.None}}},36572:(e,t,i)=>{"use strict";i.d(t,{O:()=>u,_:()=>d});var n=i(93585),r=i(77468),s=i(94573),o=i(33812);const a=[[["","header",""]]],l=e=>({$implicit:e});function c(e,t){1&e&&o.eu8(0)}class d{constructor(e){this.template=e}}d.ɵfac=function(e){return new(e||d)(o.rXU(o.C4Q))},d.ɵdir=o.FsC({type:d,selectors:[["ng-template","body",""]]});class u{constructor(){this.dataSource=(0,s.hFB)(),this.layout=(0,s.hFB)("auto"),this.templateVariable=(0,s.sbv)(d),this._initialized=!1}get tableClass(){return["tw-w-full","tw-leading-normal","tw-text-main","tw-border-collapse","tw-text-start","auto"===this.layout()?"tw-table-auto":"tw-table-fixed"]}ngAfterContentChecked(){const e=this.dataSource();if(!this._initialized&&(0,n.y)(e)){this._initialized=!0;const t=e.connect();this.rows$=t}}ngOnDestroy(){const e=this.dataSource();(0,n.y)(e)&&e.disconnect()}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=o.VBU({type:u,selectors:[["bit-table"]],contentQueries:function(e,t,i){1&e&&o.C6U(i,t.templateVariable,d,5),2&e&&o.NyB()},inputs:{dataSource:[1,"dataSource"],layout:[1,"layout"]},ngContentSelectors:["[header]"],decls:5,vars:5,consts:[[3,"ngClass"],[1,"tw-border-0","tw-border-b-2","tw-border-solid","tw-border-secondary-300","tw-font-medium","tw-text-muted"],[4,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(e,t){1&e&&(o.NAR(a),o.j41(0,"table",0)(1,"thead",1),o.SdG(2),o.k0s(),o.j41(3,"tbody"),o.DNE(4,c,1,0,"ng-container",2),o.k0s()()),2&e&&(o.Y8G("ngClass",t.tableClass),o.R7$(4),o.Y8G("ngTemplateOutlet",t.templateVariable().template)("ngTemplateOutletContext",o.eq3(3,l,t.rows$)))},dependencies:[r.MD,r.YU,r.T3],encapsulation:2})},36801:(e,t,i)=>{"use strict";i.d(t,{$Z:()=>o.$,aZ:()=>r,F:()=>s});var n=i(74208);class r extends n.nKC{}const s=e=>e;var o=i(25740)},36890:(e,t,i)=>{"use strict";i.d(t,{m:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.privateKey=this.getResponseProperty("PrivateKey"),this.publicKey=this.getResponseProperty("PublicKey"),this.keyFingerprint=this.getResponseProperty("KeyFingerprint"))}}},36951:(e,t,i)=>{"use strict";i.d(t,{f:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 0.46 73.33 76.8">
    <path class="tw-fill-illustration-bg-primary" d="M3.333 32.89a5 5 0 0 1 1.745-3.796L37.287 1.46a4.167 4.167 0 0 1 5.426 0l32.21 27.635a5 5 0 0 1 1.744 3.794v41.035a3.333 3.333 0 0 1-3.334 3.334H6.667a3.333 3.333 0 0 1-3.334-3.334V32.89Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 73.924V32.89c0-.972-.425-1.896-1.163-2.53L41.627 2.725a2.5 2.5 0 0 0-3.255 0L6.162 30.36A3.333 3.333 0 0 0 5 32.89v41.035c0 .92.746 1.667 1.667 1.667h66.666c.92 0 1.667-.746 1.667-1.667ZM5.078 29.094a5 5 0 0 0-1.745 3.795v41.035a3.333 3.333 0 0 0 3.334 3.334h66.666a3.333 3.333 0 0 0 3.334-3.334V32.89a5 5 0 0 0-1.745-3.795L42.713 1.46a4.167 4.167 0 0 0-5.426 0L5.077 29.095Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M5.793 32.464a2.5 2.5 0 0 1-.113-3.886L37.287 1.46a4.167 4.167 0 0 1 5.426 0L74.32 28.578a2.5 2.5 0 0 1-.114 3.886L42.02 56.97a3.333 3.333 0 0 1-4.038 0L5.793 32.464Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="m41.01 55.644 32.187-24.506a.833.833 0 0 0 .038-1.295L41.628 2.725a2.5 2.5 0 0 0-3.256 0L6.765 29.843a.833.833 0 0 0 .038 1.295L38.99 55.644a1.667 1.667 0 0 0 2.02 0ZM5.68 28.578a2.5 2.5 0 0 0 .113 3.886L37.981 56.97a3.333 3.333 0 0 0 4.038 0l32.187-24.506a2.5 2.5 0 0 0 .114-3.886L42.713 1.46a4.167 4.167 0 0 0-5.426 0L5.68 28.578Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41.98 54.761a3.333 3.333 0 0 1-3.96 0L5.496 30.754a.833.833 0 1 0-.99 1.341l32.526 24.007a5 5 0 0 0 5.938 0l32.526-24.007a.833.833 0 0 0-.99-1.341L41.98 54.761Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M12.5 9.758h55V38.09L40.999 57.766a1.667 1.667 0 0 1-1.994-.004L12.5 37.882V9.759Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65.833 11.425H14.167v25.624l25.838 19.38 25.828-19.176V11.425ZM67.5 38.09 40.999 57.766a1.667 1.667 0 0 1-1.994-.004L12.5 37.882V9.759h55V38.09Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="m40 49.758 18.333 10.416L40 70.591 21.667 60.175 40 49.758Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.02 51.51a3.333 3.333 0 0 0-4.04 0L5.505 76.254a.833.833 0 1 1-1.01-1.325L36.97 50.185a5 5 0 0 1 6.06 0l-.494.648.494-.648 32.475 24.743a.833.833 0 0 1-1.01 1.325L42.02 51.511Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M21.667 29.757a5.833 5.833 0 0 1 5.833-5.833h25a5.833 5.833 0 0 1 0 11.666h-25a5.833 5.833 0 0 1-5.833-5.833Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M52.5 25.59h-25a4.167 4.167 0 0 0 0 8.334h25a4.167 4.167 0 1 0 0-8.334Zm-25-1.666a5.833 5.833 0 1 0 0 11.666h25a5.833 5.833 0 0 0 0-11.666h-25Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M27.5 31.424a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Zm5 0a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Zm6.667-1.666a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0Zm3.333 1.666a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Zm6.667-1.666a1.667 1.667 0 1 1-3.334 0 1.667 1.667 0 0 1 3.334 0Zm3.333 1.666a1.667 1.667 0 1 0 0-3.333 1.667 1.667 0 0 0 0 3.333Z" clip-rule="evenodd"/>
  </svg>
`},37115:(e,t,i)=>{"use strict";i.d(t,{y:()=>n});class n{}},37380:(e,t,i)=>{"use strict";i.d(t,{Ap:()=>S,q9:()=>T,tE:()=>n,Ow:()=>o,fz:()=>c});class n{}var r=i(31857),s=i(71804);const o={[s.R.Authenticator]:{type:s.R.Authenticator,name:null,description:null,priority:1,sort:2,premium:!1},[s.R.Yubikey]:{type:s.R.Yubikey,name:null,description:null,priority:3,sort:4,premium:!0},[s.R.Duo]:{type:s.R.Duo,name:"Duo",description:null,priority:2,sort:5,premium:!0},[s.R.OrganizationDuo]:{type:s.R.OrganizationDuo,name:"Duo (Organization)",description:null,priority:10,sort:6,premium:!1},[s.R.Email]:{type:s.R.Email,name:null,description:null,priority:0,sort:1,premium:!1},[s.R.WebAuthn]:{type:s.R.WebAuthn,name:null,description:null,priority:4,sort:3,premium:!1}},a=r.Zs.record(r.bh,"providers",{deserializer:e=>e}),l=new r.Zs(r.bh,"selected",{deserializer:e=>e});class c{}var d=i(20702);class u extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.key=this.getResponseProperty("Key"),this.userVerificationToken=this.getResponseProperty("UserVerificationToken")}}class h extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.host=this.getResponseProperty("Host"),this.clientSecret=this.getResponseProperty("ClientSecret"),this.clientId=this.getResponseProperty("ClientId")}}class p extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.email=this.getResponseProperty("Email")}}class m extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.type=this.getResponseProperty("Type")}}class v extends d.r{constructor(e){super(e),this.code=this.getResponseProperty("Code")}}var f=i(73556);class g extends d.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.key1=this.getResponseProperty("Key1"),this.key2=this.getResponseProperty("Key2"),this.key3=this.getResponseProperty("Key3"),this.key4=this.getResponseProperty("Key4"),this.key5=this.getResponseProperty("Key5"),this.nfc=this.getResponseProperty("Nfc")}}var y=i(12277),b=i(78781),w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class S{constructor(e){this.apiService=e}getTwoFactorProviders(){return w(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/two-factor",null,!0,!0);return new y.s(e,m)})}getTwoFactorOrganizationProviders(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/organizations/${e}/two-factor`,null,!0,!0);return new y.s(t,m)})}getTwoFactorAuthenticator(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-authenticator",e,!0,!0);return new u(t)})}putTwoFactorAuthenticator(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/authenticator",e,!0,!0);return new u(t)})}deleteTwoFactorAuthenticator(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("DELETE","/two-factor/authenticator",e,!0,!0);return new m(t)})}getTwoFactorEmail(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-email",e,!0,!0);return new p(t)})}postTwoFactorEmailSetup(e){return w(this,void 0,void 0,function*(){return this.apiService.send("POST","/two-factor/send-email",e,!0,!1)})}postTwoFactorEmail(e){return w(this,void 0,void 0,function*(){return this.apiService.send("POST","/two-factor/send-email-login",e,!1,!1)})}putTwoFactorEmail(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/email",e,!0,!0);return new p(t)})}getTwoFactorDuo(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-duo",e,!0,!0);return new h(t)})}getTwoFactorOrganizationDuo(e,t){return w(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/two-factor/get-duo`,t,!0,!0);return new h(i)})}putTwoFactorDuo(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/duo",e,!0,!0);return new h(t)})}putTwoFactorOrganizationDuo(e,t){return w(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT",`/organizations/${e}/two-factor/duo`,t,!0,!0);return new h(i)})}getTwoFactorYubiKey(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-yubikey",e,!0,!0);return new g(t)})}putTwoFactorYubiKey(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/yubikey",e,!0,!0);return new g(t)})}getTwoFactorWebAuthn(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-webauthn",e,!0,!0);return new f.j(t)})}getTwoFactorWebAuthnChallenge(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-webauthn-challenge",e,!0,!0);return new f.Jq(t)})}putTwoFactorWebAuthn(e){return w(this,void 0,void 0,function*(){const t=e.deviceResponse.response,i=Object.assign({},e);i.deviceResponse={id:e.deviceResponse.id,rawId:btoa(e.deviceResponse.id),type:e.deviceResponse.type,extensions:e.deviceResponse.getClientExtensionResults(),response:{AttestationObject:b.A.fromBufferToB64(t.attestationObject),clientDataJson:b.A.fromBufferToB64(t.clientDataJSON)}};const n=yield this.apiService.send("PUT","/two-factor/webauthn",i,!0,!0);return new f.j(n)})}deleteTwoFactorWebAuthn(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("DELETE","/two-factor/webauthn",e,!0,!0);return new f.j(t)})}getTwoFactorRecover(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/two-factor/get-recover",e,!0,!0);return new v(t)})}putTwoFactorDisable(e){return w(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/two-factor/disable",e,!0,!0);return new m(t)})}putTwoFactorOrganizationDisable(e,t){return w(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT",`/organizations/${e}/two-factor/disable`,t,!0,!0);return new m(i)})}}var I=i(3204),k=i(72245),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T{constructor(e,t,i,n){this.i18nService=e,this.platformUtilsService=t,this.globalStateProvider=i,this.twoFactorApiService=n,this.providersState=this.globalStateProvider.get(a),this.selectedState=this.globalStateProvider.get(l),this.providers$=this.providersState.state$.pipe((0,I.T)(e=>b.A.recordToMap(e))),this.selected$=this.selectedState.state$}init(){o[s.R.Email].name=this.i18nService.t("emailTitle"),o[s.R.Email].description=this.i18nService.t("emailDescV2"),o[s.R.Authenticator].name=this.i18nService.t("authenticatorAppTitle"),o[s.R.Authenticator].description=this.i18nService.t("authenticatorAppDescV2"),o[s.R.Duo].description=this.i18nService.t("duoDescV2"),o[s.R.OrganizationDuo].name="Duo ("+this.i18nService.t("organization")+")",o[s.R.OrganizationDuo].description=this.i18nService.t("duoOrganizationDesc"),o[s.R.WebAuthn].name=this.i18nService.t("webAuthnTitle"),o[s.R.WebAuthn].description=this.i18nService.t("webAuthnDesc"),o[s.R.Yubikey].name=this.i18nService.t("yubiKeyTitleV2"),o[s.R.Yubikey].description=this.i18nService.t("yubiKeyDesc")}getSupportedProviders(e){return C(this,void 0,void 0,function*(){const t=yield(0,k._)(this.providers$),i=[];return null==t||(t.has(s.R.OrganizationDuo)&&this.platformUtilsService.supportsDuo()&&i.push(o[s.R.OrganizationDuo]),t.has(s.R.Authenticator)&&i.push(o[s.R.Authenticator]),t.has(s.R.Yubikey)&&i.push(o[s.R.Yubikey]),t.has(s.R.Duo)&&this.platformUtilsService.supportsDuo()&&i.push(o[s.R.Duo]),t.has(s.R.WebAuthn)&&this.platformUtilsService.supportsWebAuthn(e)&&i.push(o[s.R.WebAuthn]),t.has(s.R.Email)&&i.push(o[s.R.Email])),i})}getDefaultProvider(e){return C(this,void 0,void 0,function*(){const t=yield(0,k._)(this.providers$),i=yield(0,k._)(this.selected$);if(null==t)return null;if(null!=i&&t.has(i))return i;let n=null,r=-1;return t.forEach((t,i)=>{const a=o[i];if(null!=a&&a.priority>r){if(i===s.R.WebAuthn&&!e)return;n=i,r=a.priority}}),n})}setSelectedProvider(e){return C(this,void 0,void 0,function*(){yield this.selectedState.update(()=>e)})}clearSelectedProvider(){return C(this,void 0,void 0,function*(){yield this.selectedState.update(()=>null)})}setProviders(e){return C(this,void 0,void 0,function*(){yield this.providersState.update(()=>e.twoFactorProviders2)})}clearProviders(){return C(this,void 0,void 0,function*(){yield this.providersState.update(()=>null)})}getProviders(){return(0,k._)(this.providers$)}getEnabledTwoFactorProviders(){return this.twoFactorApiService.getTwoFactorProviders()}getTwoFactorOrganizationProviders(e){return this.twoFactorApiService.getTwoFactorOrganizationProviders(e)}getTwoFactorAuthenticator(e){return this.twoFactorApiService.getTwoFactorAuthenticator(e)}getTwoFactorEmail(e){return this.twoFactorApiService.getTwoFactorEmail(e)}getTwoFactorDuo(e){return this.twoFactorApiService.getTwoFactorDuo(e)}getTwoFactorOrganizationDuo(e,t){return this.twoFactorApiService.getTwoFactorOrganizationDuo(e,t)}getTwoFactorYubiKey(e){return this.twoFactorApiService.getTwoFactorYubiKey(e)}getTwoFactorWebAuthn(e){return this.twoFactorApiService.getTwoFactorWebAuthn(e)}getTwoFactorWebAuthnChallenge(e){return this.twoFactorApiService.getTwoFactorWebAuthnChallenge(e)}getTwoFactorRecover(e){return this.twoFactorApiService.getTwoFactorRecover(e)}putTwoFactorAuthenticator(e){return this.twoFactorApiService.putTwoFactorAuthenticator(e)}deleteTwoFactorAuthenticator(e){return this.twoFactorApiService.deleteTwoFactorAuthenticator(e)}putTwoFactorEmail(e){return this.twoFactorApiService.putTwoFactorEmail(e)}putTwoFactorDuo(e){return this.twoFactorApiService.putTwoFactorDuo(e)}putTwoFactorOrganizationDuo(e,t){return this.twoFactorApiService.putTwoFactorOrganizationDuo(e,t)}putTwoFactorYubiKey(e){return this.twoFactorApiService.putTwoFactorYubiKey(e)}putTwoFactorWebAuthn(e){return this.twoFactorApiService.putTwoFactorWebAuthn(e)}deleteTwoFactorWebAuthn(e){return this.twoFactorApiService.deleteTwoFactorWebAuthn(e)}putTwoFactorDisable(e){return this.twoFactorApiService.putTwoFactorDisable(e)}putTwoFactorOrganizationDisable(e,t){return this.twoFactorApiService.putTwoFactorOrganizationDisable(e,t)}postTwoFactorEmailSetup(e){return this.twoFactorApiService.postTwoFactorEmailSetup(e)}postTwoFactorEmail(e){return this.twoFactorApiService.postTwoFactorEmail(e)}}},37579:(e,t,i)=>{"use strict";i.d(t,{C:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},37806:(e,t,i)=>{"use strict";i.d(t,{r:()=>d});var n=i(90097),r=i(65731),s=i(63734),o=i(72932),a=i(25065),l=i(74208),c=i(33812);class d{}d.ɵfac=function(e){return new(e||d)},d.ɵmod=c.$C({type:d}),d.ɵinj=l.G2t({imports:[a.G,o.G,n.H,s.Pu,s.vU,r.UJ,a.G]})},37856:(e,t,i)=>{"use strict";i.d(t,{a:()=>b});var n=i(94573),r=i(58625),s=i(639),o=i(33812),a=i(74208),l=i(43090),c=i(47696),d=i(83731),u=i(72245),h=i(58329),p=i(35500),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class v{constructor(e,t,i,n,r){this.templateRef=e,this.viewContainer=t,this.billingAccountProfileStateService=i,this.destroyRef=n,this.accountService=r}ngOnInit(){return m(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$);e?this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id).pipe((0,d.pQ)(this.destroyRef)).subscribe(e=>{e?this.viewContainer.clear():this.viewContainer.createEmbeddedView(this.templateRef)}):this.viewContainer.createEmbeddedView(this.templateRef)})}}v.ɵfac=function(e){return new(e||v)(o.rXU(o.C4Q),o.rXU(o.c1b),o.rXU(h.Q),o.rXU(a.abz),o.rXU(p.Di))},v.ɵdir=o.FsC({type:v,selectors:[["","appNotPremium",""]],standalone:!1});var f=i(88016),g=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function y(e,t){if(1&e){const e=o.RV6();o.j41(0,"button",1),o.bIt("click",function(t){a.eBV(e);const i=o.XpG();return a.Njj(i.promptForPremium(t))}),o.nrm(1,"i",2),o.EFF(2),o.nI1(3,"i18n"),o.k0s()}2&e&&(o.Y8G("variant","primary"),o.R7$(2),o.SpI("",o.bMT(3,2,"upgrade")," "))}class b{constructor(e){this.premiumUpgradePromptService=e,this.organizationId=(0,n.hFB)()}promptForPremium(e){return g(this,void 0,void 0,function*(){e.stopPropagation(),e.preventDefault(),yield this.premiumUpgradePromptService.promptForPremium(this.organizationId())})}}b.ɵfac=function(e){return new(e||b)(o.rXU(l.l))},b.ɵcmp=o.VBU({type:b,selectors:[["app-premium-badge"]],inputs:{organizationId:[1,"organizationId"]},decls:1,vars:0,consts:[["type","button","bitBadge","","class","!tw-text-primary-600 !tw-border-primary-600",3,"variant","click",4,"appNotPremium"],["type","button","bitBadge","",1,"!tw-text-primary-600","!tw-border-primary-600",3,"click","variant"],[1,"bwi","bwi-premium","tw-pe-1"]],template:function(e,t){1&e&&o.DNE(0,y,4,4,"button",0)},dependencies:[s.E,c.n,r.p,v,f.$],encapsulation:2})},37967:(e,t,i)=>{"use strict";i.d(t,{Ui:()=>hh,ng:()=>ih,US:()=>th,HM:()=>ch.H});var n=i(77468),r=i(33812),s=i(23649),o=i(28202);var a=i(93175),l=i(347),c=i(21001),d=i(71613),u=i(21495),h=i(2073),p=i(74208),m=i(66046),v=i(81285),f=i(93241),g=i(12012),y=i(72331),b=i(81582),w=i(19543),S=i(11224),I=i(67553),k=i(4717);class C{}class T extends C{}var F=i(35631),R=i(27866),P=i(18499),x=i(62316),$=i(13417),E=i(3204),A=i(84488),D=i(31857),O=i(52136);const M=D.Ok.record(D.nr,"organizations",{deserializer:e=>O.o.fromJSON(e),clearOn:["logout"]});var U=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function G(){return(0,E.T)(e=>e.length>0)}var j=i(20702);class N extends j.r{constructor(e){super(e),this.apiKey=this.getResponseProperty("ApiKey"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}var V=i(85776);class B extends j.r{static fromView(e,t=new B){return t.configType=e.configType,t.memberDecryptionType=e.memberDecryptionType,t.keyConnectorUrl=e.keyConnectorUrl,t.configType===V.Ah.OpenIdConnect?(t.authority=e.openId.authority,t.clientId=e.openId.clientId,t.clientSecret=e.openId.clientSecret,t.metadataAddress=e.openId.metadataAddress,t.redirectBehavior=e.openId.redirectBehavior,t.getClaimsFromUserInfoEndpoint=e.openId.getClaimsFromUserInfoEndpoint,t.additionalScopes=e.openId.additionalScopes,t.additionalUserIdClaimTypes=e.openId.additionalUserIdClaimTypes,t.additionalEmailClaimTypes=e.openId.additionalEmailClaimTypes,t.additionalNameClaimTypes=e.openId.additionalNameClaimTypes,t.acrValues=e.openId.acrValues,t.expectedReturnAcrValue=e.openId.expectedReturnAcrValue):t.configType===V.Ah.Saml2&&(t.spUniqueEntityId=e.saml.spUniqueEntityId,t.spNameIdFormat=e.saml.spNameIdFormat,t.spOutboundSigningAlgorithm=e.saml.spOutboundSigningAlgorithm,t.spSigningBehavior=e.saml.spSigningBehavior,t.spMinIncomingSigningAlgorithm=e.saml.spMinIncomingSigningAlgorithm,t.spWantAssertionsSigned=e.saml.spWantAssertionsSigned,t.spValidateCertificates=e.saml.spValidateCertificates,t.idpEntityId=e.saml.idpEntityId,t.idpBindingType=e.saml.idpBindingType,t.idpSingleSignOnServiceUrl=e.saml.idpSingleSignOnServiceUrl,t.idpSingleLogoutServiceUrl=e.saml.idpSingleLogoutServiceUrl,t.idpX509PublicCert=e.saml.idpX509PublicCert,t.idpOutboundSigningAlgorithm=e.saml.idpOutboundSigningAlgorithm,t.idpAllowUnsolicitedAuthnResponse=e.saml.idpAllowUnsolicitedAuthnResponse,t.idpWantAuthnRequestsSigned=e.saml.idpWantAuthnRequestsSigned,t.idpDisableOutboundLogoutRequests=!e.saml.idpAllowOutboundLogoutRequests),t}constructor(e=null){super(e),null!=e&&(this.configType=this.getResponseProperty("ConfigType"),this.memberDecryptionType=this.getResponseProperty("MemberDecryptionType"),this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl"),this.authority=this.getResponseProperty("Authority"),this.clientId=this.getResponseProperty("ClientId"),this.clientSecret=this.getResponseProperty("ClientSecret"),this.metadataAddress=this.getResponseProperty("MetadataAddress"),this.redirectBehavior=this.getResponseProperty("RedirectBehavior"),this.getClaimsFromUserInfoEndpoint=this.getResponseProperty("GetClaimsFromUserInfoEndpoint"),this.additionalScopes=this.getResponseProperty("AdditionalScopes"),this.additionalUserIdClaimTypes=this.getResponseProperty("AdditionalUserIdClaimTypes"),this.additionalEmailClaimTypes=this.getResponseProperty("AdditionalEmailClaimTypes"),this.additionalNameClaimTypes=this.getResponseProperty("AdditionalNameClaimTypes"),this.acrValues=this.getResponseProperty("AcrValues"),this.expectedReturnAcrValue=this.getResponseProperty("ExpectedReturnAcrValue"),this.spUniqueEntityId=this.getResponseProperty("SpUniqueEntityId"),this.spNameIdFormat=this.getResponseProperty("SpNameIdFormat"),this.spOutboundSigningAlgorithm=this.getResponseProperty("SpOutboundSigningAlgorithm"),this.spSigningBehavior=this.getResponseProperty("SpSigningBehavior"),this.spMinIncomingSigningAlgorithm=this.getResponseProperty("SpMinIncomingSigningAlgorithm"),this.spWantAssertionsSigned=this.getResponseProperty("SpWantAssertionsSigned"),this.spValidateCertificates=this.getResponseProperty("SpValidateCertificates"),this.idpEntityId=this.getResponseProperty("IdpEntityId"),this.idpBindingType=this.getResponseProperty("IdpBindingType"),this.idpSingleSignOnServiceUrl=this.getResponseProperty("IdpSingleSignOnServiceUrl"),this.idpSingleLogoutServiceUrl=this.getResponseProperty("IdpSingleLogoutServiceUrl"),this.idpX509PublicCert=this.getResponseProperty("IdpX509PublicCert"),this.idpOutboundSigningAlgorithm=this.getResponseProperty("IdpOutboundSigningAlgorithm"),this.idpAllowUnsolicitedAuthnResponse=this.getResponseProperty("IdpAllowUnsolicitedAuthnResponse"),this.idpDisableOutboundLogoutRequests=this.getResponseProperty("IdpDisableOutboundLogoutRequests"),this.idpWantAuthnRequestsSigned=this.getResponseProperty("IdpWantAuthnRequestsSigned"))}}class z extends j.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled"),this.identifier=this.getResponseProperty("Identifier"),this.data=null!=this.getResponseProperty("Data")?new B(this.getResponseProperty("Data")):null,this.urls=new L(this.getResponseProperty("Urls"))}}class L extends j.r{constructor(e){super(e),this.callbackPath=this.getResponseProperty("CallbackPath"),this.signedOutCallbackPath=this.getResponseProperty("SignedOutCallbackPath"),this.spEntityId=this.getResponseProperty("SpEntityId"),this.spEntityIdStatic=this.getResponseProperty("SpEntityIdStatic"),this.spMetadataUrl=this.getResponseProperty("SpMetadataUrl"),this.spAcsUrl=this.getResponseProperty("SpAcsUrl")}}class K extends j.r{constructor(e){super(e),this.balance=this.getResponseProperty("Balance");const t=this.getResponseProperty("PaymentSource");this.paymentSource=null==t?null:new q(t)}}class q extends j.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.cardBrand=this.getResponseProperty("CardBrand"),this.description=this.getResponseProperty("Description"),this.needsVerification=this.getResponseProperty("NeedsVerification")}}class _ extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.url=this.getResponseProperty("Url"),this.pdfUrl=this.getResponseProperty("PdfUrl"),this.number=this.getResponseProperty("Number"),this.paid=this.getResponseProperty("Paid"),this.date=this.getResponseProperty("Date"),this.amount=this.getResponseProperty("Amount")}}class X extends j.r{constructor(e){super(e),this.createdDate=this.getResponseProperty("CreatedDate"),this.amount=this.getResponseProperty("Amount"),this.refunded=this.getResponseProperty("Refunded"),this.partiallyRefunded=this.getResponseProperty("PartiallyRefunded"),this.refundedAmount=this.getResponseProperty("RefundedAmount"),this.type=this.getResponseProperty("Type"),this.paymentMethodType=this.getResponseProperty("PaymentMethodType"),this.details=this.getResponseProperty("Details")}}class Y extends j.r{constructor(e){super(e),this.invoices=[],this.transactions=[];const t=this.getResponseProperty("Transactions"),i=this.getResponseProperty("Invoices");null!=t&&(this.transactions=t.map(e=>new X(e))),null!=i&&(this.invoices=i.map(e=>new _(e)))}get hasNoHistory(){return 0==this.invoices.length&&0==this.transactions.length}}var H=i(69138),W=i(97315);class J extends j.r{constructor(e){super(e);const t=this.getResponseProperty("UserProfile");null!=t&&(this.userProfile=new W.l(t)),this.paymentIntentClientSecret=this.getResponseProperty("PaymentIntentClientSecret"),this.success=this.getResponseProperty("Success")}}var Z=i(12277);class Q extends j.r{constructor(e){super(e),this.keyType=this.getResponseProperty("KeyType")}}class ee extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.resetPasswordEnabled=this.getResponseProperty("ResetPasswordEnabled")}}class te extends j.r{constructor(e){super(e),this.privateKey=this.getResponseProperty("PrivateKey"),this.publicKey=this.getResponseProperty("PublicKey")}}class ie extends te{constructor(e){super(e)}}var ne=i(77788),re=i(72868),se=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class oe extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.organizationIdentifier=this.getResponseProperty("organizationIdentifier"),this.ssoAvailable=this.getResponseProperty("ssoAvailable"),this.domainName=this.getResponseProperty("domainName"),this.verifiedDate=this.getResponseProperty("verifiedDate")}}class ae extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.organizationId=this.getResponseProperty("organizationId"),this.txt=this.getResponseProperty("txt"),this.domainName=this.getResponseProperty("domainName"),this.creationDate=this.getResponseProperty("creationDate"),this.nextRunDate=this.getResponseProperty("nextRunDate"),this.jobRunCount=this.getResponseProperty("jobRunCount"),this.verifiedDate=this.getResponseProperty("verifiedDate"),this.lastCheckedDate=this.getResponseProperty("lastCheckedDate")}}class le extends j.r{constructor(e){super(e),this.organizationName=this.getResponseProperty("organizationName"),this.organizationIdentifier=this.getResponseProperty("organizationIdentifier"),this.domainName=this.getResponseProperty("domainName")}}class ce{constructor(e){this.email=e}}var de=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ue=i(16878);var he=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const pe=(me="autoConfirmFingerPrints",new D.Ok(D.ll,me,{deserializer:e=>e,clearOn:["logout"]}));var me;var ve=i(685),fe=i(72245),ge=i(44500),ye=i(3633),be=i(11573),we=i(7861),Se=i(78781),Ie=i(54967),ke=i(38449),Ce=i(25607),Te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Fe extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.plan=this.getResponseProperty("plan"),this.name=this.getResponseProperty("name"),this.seats=this.getResponseProperty("seats"),this.disabled=this.getResponseProperty("disabled")}}class Re extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.providerId=this.getResponseProperty("ProviderId"),this.organizationId=this.getResponseProperty("OrganizationId"),this.key=this.getResponseProperty("Key"),this.settings=this.getResponseProperty("Settings"),this.creationDate=this.getResponseProperty("CreationDate"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.userCount=this.getResponseProperty("UserCount"),this.seats=this.getResponseProperty("Seats"),this.occupiedSeats=this.getResponseProperty("OccupiedSeats"),this.remainingSeats=this.getResponseProperty("RemainingSeats"),this.plan=this.getResponseProperty("Plan")}}class Pe extends Re{constructor(e){super(e),this.organizationName=this.getResponseProperty("OrganizationName")}}class xe extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.businessName=this.getResponseProperty("BusinessName"),this.billingEmail=this.getResponseProperty("BillingEmail"),this.creationDate=this.getResponseProperty("CreationDate"),this.type=this.getResponseProperty("Type")}}var $e=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ee=i(15639),Ae=i(43978);class De{constructor(e){null!=e&&(this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.userId=e.userId,this.useEvents=e.useEvents,this.providerStatus=e.providerStatus,this.providerType=e.providerType)}get canAccess(){return!!this.isProviderAdmin||this.enabled&&this.status===Ae.PN.Confirmed}get canCreateOrganizations(){return this.enabled&&this.isProviderAdmin}get canManageUsers(){return this.isProviderAdmin}get canAccessEventLogs(){return this.isProviderAdmin}get isProviderAdmin(){return this.type===Ae.pP.ProviderAdmin}}var Oe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Me=D.Ok.record(D.L_,"providers",{deserializer:e=>e,clearOn:["logout"]});var Ue=i(46357),Ge=i(35500),je=i(29744);class Ne{}var Ve=i(68455),Be=i(86388),ze=i(8806),Le=i(40271);class Ke{}var qe=i(45891),_e=i(86214),Xe=i(83078);class Ye{}var He=i(62166);class We{}var Je=i(25279),Ze=i(45804);var Qe=i(43008),et=i(84079);class tt{constructor(e,t){this.token=e,this.expiresAt=t}isExpired(e=5e3){return Date.now()>=this.expiresAt-e}timeUntilExpirySeconds(){return Math.max(0,Math.floor((this.expiresAt-Date.now())/1e3))}static fromJson(e){return new tt(e.token,e.expiresAt)}static fromSendAccessTokenResponse(e){return new tt(e.token,e.expiresAt)}}var it=i(91968);const nt=it.Zs.record(it.Mc,"accessTokenDict",{deserializer:e=>tt.fromJson(e)});var rt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},st=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};var ot=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var at=i(6367),lt=i(28621),ct=i(54124);class dt{constructor(e){this.id=e.id,this.priority=e.priority,this.title=e.title,this.body=e.body,this.date=e.date,this.taskId=e.taskId,this.readDate=e.readDate,this.deletedDate=e.deletedDate}}class ut{constructor(e){this.id=e.id,this.priority=e.priority,this.title=e.title,this.body=e.body,this.date=e.date,this.taskId=e.taskId,this.readDate=e.readDate,this.deletedDate=e.deletedDate}static fromJSON(e){return Object.assign(new ut({}),e,{id:e.id,priority:e.priority,title:e.title,body:e.body,date:new Date(e.date),taskId:e.taskId,readDate:e.readDate?new Date(e.readDate):null,deletedDate:e.deletedDate?new Date(e.deletedDate):null})}}class ht extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.priority=this.getResponseProperty("Priority"),this.title=this.getResponseProperty("Title"),this.body=this.getResponseProperty("Body"),this.date=this.getResponseProperty("Date"),this.taskId=this.getResponseProperty("TaskId"),this.readDate=this.getResponseProperty("ReadDate"),this.deletedDate=this.getResponseProperty("DeletedDate")}}class pt extends j.r{constructor(e){super(e),this.contextId=this.getResponseProperty("ContextId"),this.type=this.getResponseProperty("Type");let t=this.getResponseProperty("Payload");if("string"==typeof t)try{t=JSON.parse(t)}catch(i){}switch(this.type){case be._n.SyncCipherCreate:case be._n.SyncCipherDelete:case be._n.SyncCipherUpdate:case be._n.SyncLoginDelete:this.payload=new mt(t);break;case be._n.SyncFolderCreate:case be._n.SyncFolderDelete:case be._n.SyncFolderUpdate:this.payload=new vt(t);break;case be._n.SyncVault:case be._n.SyncCiphers:case be._n.SyncOrganizations:case be._n.SyncOrgKeys:case be._n.SyncSettings:this.payload=new ft(t);break;case be._n.LogOut:this.payload=new Ct(t);break;case be._n.SyncSendCreate:case be._n.SyncSendUpdate:case be._n.SyncSendDelete:this.payload=new gt(t);break;case be._n.AuthRequest:case be._n.AuthRequestResponse:this.payload=new yt(t);break;case be._n.SyncOrganizationStatusChanged:this.payload=new bt(t);break;case be._n.SyncOrganizationCollectionSettingChanged:this.payload=new wt(t);break;case be._n.Notification:case be._n.NotificationStatus:this.payload=new ht(t);break;case be._n.OrganizationBankAccountVerified:this.payload=new St(t);break;case be._n.ProviderBankAccountVerified:this.payload=new It(t);break;case be._n.SyncPolicy:this.payload=new kt(t)}}}class mt extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.organizationId=this.getResponseProperty("OrganizationId"),this.collectionIds=this.getResponseProperty("CollectionIds"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class vt extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class ft extends j.r{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.date=new Date(this.getResponseProperty("Date"))}}class gt extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.revisionDate=new Date(this.getResponseProperty("RevisionDate"))}}class yt extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId")}}class bt extends j.r{constructor(e){super(e),this.organizationId=this.getResponseProperty("OrganizationId"),this.enabled=this.getResponseProperty("Enabled")}}class wt extends j.r{constructor(e){super(e),this.organizationId=this.getResponseProperty("OrganizationId"),this.limitCollectionCreation=this.getResponseProperty("LimitCollectionCreation"),this.limitCollectionDeletion=this.getResponseProperty("LimitCollectionDeletion")}}class St extends j.r{constructor(e){super(e),this.organizationId=this.getResponseProperty("OrganizationId")}}class It extends j.r{constructor(e){super(e),this.providerId=this.getResponseProperty("ProviderId"),this.adminId=this.getResponseProperty("AdminId")}}class kt extends j.r{constructor(e){super(e),this.policy=this.getResponseProperty("Policy")}}class Ct extends j.r{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.reason=this.getResponseProperty("Reason")}}class Tt extends Error{constructor(e){super(void 0===e?"Insecure URL not allowed. All URLs must use HTTPS.":`Insecure URL not allowed: ${e}. All URLs must use HTTPS.`)}}var Ft=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Rt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Pt=i(40711),xt=i(93695),$t=i(33338),Et=i(34040),At=i(27442),Dt=i(84110),Ot=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Mt{constructor(e){this.avatarColor=e}}var Ut=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Gt=new D.Ok(D.wt,"avatarColor",{deserializer:e=>e,clearOn:[]});class jt{constructor(e){Object.assign(this,e),this.response=e}}var Nt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Vt extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.name=this.getResponseProperty("Name"),this.identifier=this.getResponseProperty("Identifier"),this.type=this.getResponseProperty("Type"),this.creationDate=this.getResponseProperty("CreationDate"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.isTrusted=this.getResponseProperty("IsTrusted"),this.encryptedUserKey=this.getResponseProperty("EncryptedUserKey"),this.encryptedPublicKey=this.getResponseProperty("EncryptedPublicKey"),this.devicePendingAuthRequest=this.getResponseProperty("DevicePendingAuthRequest")}}class Bt{constructor(e){this.devices=e}}var zt=i(39306),Lt=i(67529);class Kt extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("id"),this.name=this.getResponseProperty("name"),this.identifier=this.getResponseProperty("identifier"),this.type=this.getResponseProperty("type"),this.creationDate=new Date(this.getResponseProperty("creationDate")),e.encryptedUserKey&&(this.encryptedUserKey=new zt.k(this.getResponseProperty("encryptedUserKey"))),e.encryptedPublicKey&&(this.encryptedPublicKey=new zt.k(this.getResponseProperty("encryptedPublicKey")))}getRotateableKeyset(){return new Lt.B(this.encryptedUserKey,this.encryptedPublicKey)}isTrusted(){return null!=this.encryptedUserKey&&null!=this.encryptedPublicKey}}class qt{constructor(e,t,i){this.encryptedUserKey=e,this.encryptedPublicKey=t,this.encryptedPrivateKey=i}}var _t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Xt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Yt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ht=i(52717),Wt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Jt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Zt=new D.Zs(D.iy,"ssoCodeVerifier",{deserializer:e=>e}),Qt=new D.Zs(D.iy,"ssoState",{deserializer:e=>e}),ei=new D.Ok(D.iy,"organizationSsoIdentifier",{deserializer:e=>e,clearOn:["logout"]}),ti=new D.Zs(D.iy,"organizationSsoIdentifier",{deserializer:e=>e}),ii=new D.Zs(D.iy,"ssoEmail",{deserializer:e=>e}),ni=new D.Zs(D.aC,"ssoRequiredCache",{deserializer:e=>e});var ri=i(16184),si=i(68467),oi=i(43890);class ai{constructor(e,t,i){this.accessToken=e,this.refreshToken=t,this.clientIdSecretPair=i}}const li=new D.Ok(D.uv,"accessToken",{deserializer:e=>e,clearOn:[]}),ci=new D.Ok(D.oR,"accessToken",{deserializer:e=>e,clearOn:[]}),di=new D.Ok(D.uv,"refreshToken",{deserializer:e=>e,clearOn:[]}),ui=new D.Ok(D.oR,"refreshToken",{deserializer:e=>e,clearOn:[]}),hi=D.Zs.record(D.MC,"emailTwoFactorTokenRecord",{deserializer:e=>e}),pi=new D.Ok(D.uv,"apiKeyClientId",{deserializer:e=>e,clearOn:[]}),mi=new D.Ok(D.oR,"apiKeyClientId",{deserializer:e=>e,clearOn:[]}),vi=new D.Ok(D.uv,"apiKeyClientSecret",{deserializer:e=>e,clearOn:[]}),fi=new D.Ok(D.oR,"apiKeyClientSecret",{deserializer:e=>e,clearOn:[]}),gi=new D.Ok(D.oR,"securityStamp",{deserializer:e=>e,clearOn:["logout"]});var yi,bi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e.Disk="disk",e.SecureStorage="secureStorage",e.Memory="memory"}(yi||(yi={}));var wi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Si=i(22848),Ii=i(68333),ki=i(7248);class Ci{constructor(e){this.OTP=e}}var Ti=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Fi=i(93824),Ri=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Pi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var xi=i(12117);class $i{constructor(e,t,i){this.token=e,this.deviceResponse=t,this.prfKey=i}}var Ei=i(97883),Ai=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Di=i(37380),Oi=i(70342),Mi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ui=new D.Ok(D.O2,"enableBadgeCounter",{deserializer:e=>null==e||e,clearOn:[]});var Gi=i(60276),ji=i(58605),Ni=i(48180),Vi=i(2922),Bi=i(58329),zi=i(41445),Li=i(49247),Ki=i(304),qi=i(3160),_i=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Xi=i(73276),Yi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Hi=new D.Ok(D.Cg,"accountProfile",{deserializer:e=>e,clearOn:["logout"]});class Wi extends j.r{constructor(e){super(e);const t=this.getResponseProperty("Seat");if(!t||"object"!=typeof t)throw new Error("PremiumPlanResponse: Missing or invalid 'Seat' property");this.seat=new Ji(t);const i=this.getResponseProperty("Storage");if(!i||"object"!=typeof i)throw new Error("PremiumPlanResponse: Missing or invalid 'Storage' property");this.storage=new Ji(i)}}class Ji extends j.r{constructor(e){if(super(e),this.stripePriceId=this.getResponseProperty("StripePriceId"),!this.stripePriceId||"string"!=typeof this.stripePriceId)throw new Error("PurchasableResponse: Missing or invalid 'StripePriceId' property");if(this.price=this.getResponseProperty("Price"),"number"!=typeof this.price||isNaN(this.price))throw new Error("PurchasableResponse: Missing or invalid 'Price' property");if(this.provided=this.getResponseProperty("Provided"),"number"!=typeof this.provided||isNaN(this.provided))throw new Error("PurchasableResponse: Missing or invalid 'Provided' property")}}class Zi extends j.r{constructor(e){super(e),this.invoices=[];const t=this.getResponseProperty("Invoices");t&&t.length&&(this.invoices=t.map(e=>new Qi(e)))}}class Qi extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.date=this.getResponseProperty("Date"),this.number=this.getResponseProperty("Number"),this.total=this.getResponseProperty("Total"),this.status=this.getResponseProperty("Status"),this.dueDate=this.getResponseProperty("DueDate"),this.url=this.getResponseProperty("Url")}}class en extends j.r{constructor(e){super(e),this.isOnSecretsManagerStandalone=this.getResponseProperty("IsOnSecretsManagerStandalone"),this.organizationOccupiedSeats=this.getResponseProperty("OrganizationOccupiedSeats")}}var tn=i(69580);class nn extends j.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.description=this.getResponseProperty("Description"),this.needsVerification=this.getResponseProperty("NeedsVerification")}}class rn extends j.r{constructor(e){super(e),this.suspensionDate=this.getResponseProperty("suspensionDate"),this.unpaidPeriodEndDate=this.getResponseProperty("unpaidPeriodEndDate"),this.gracePeriod=this.getResponseProperty("gracePeriod")}}class sn extends j.r{constructor(e){super(e),this.taxId=this.getResponseProperty("TaxIdNumber"),this.taxId||(this.taxId=this.getResponseProperty("TaxId")),this.taxIdType=this.getResponseProperty("TaxIdType"),this.line1=this.getResponseProperty("Line1"),this.line2=this.getResponseProperty("Line2"),this.city=this.getResponseProperty("City"),this.state=this.getResponseProperty("State"),this.postalCode=this.getResponseProperty("PostalCode"),this.country=this.getResponseProperty("Country")}}class on extends j.r{constructor(e){super(e),this.plans=[],this.status=this.getResponseProperty("status"),this.currentPeriodEndDate=this.getResponseProperty("currentPeriodEndDate"),this.discountPercentage=this.getResponseProperty("discountPercentage"),this.collectionMethod=this.getResponseProperty("collectionMethod");const t=this.getResponseProperty("plans");null!=t&&(this.plans=t.map(e=>new an(e))),this.accountCredit=this.getResponseProperty("accountCredit");const i=this.getResponseProperty("taxInformation");null!=i&&(this.taxInformation=new sn(i)),this.cancelAt=this.getResponseProperty("cancelAt");const n=this.getResponseProperty("suspension");null!=n&&(this.suspension=new rn(n)),this.providerType=this.getResponseProperty("providerType");const r=this.getResponseProperty("paymentSource");null!=r&&(this.paymentSource=new nn(r))}}class an extends j.r{constructor(e){super(e),this.planName=this.getResponseProperty("PlanName"),this.seatMinimum=this.getResponseProperty("SeatMinimum"),this.assignedSeats=this.getResponseProperty("AssignedSeats"),this.purchasedSeats=this.getResponseProperty("PurchasedSeats"),this.cost=this.getResponseProperty("Cost"),this.cadence=this.getResponseProperty("Cadence"),this.type=this.getResponseProperty("Type"),this.productTier=this.getResponseProperty("ProductTier")}}var ln=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var cn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var dn=i(82468),un=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var hn=i(20246),pn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var mn=i(77665),vn=i(56953),fn=i(88083),gn=i(55459),yn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var bn=i(37567),wn=i(58363),Sn=i(80909),In=i(75811),kn=i(58412);class Cn{constructor(e,t,i,n,r){this.billingApiService=e,this.configService=t,this.i18nService=i,this.logService=n,this.environmentService=r,this.getPersonalSubscriptionPricingTiers$=()=>(0,$t.z)([this.premium$,this.families$]).pipe((0,In.W)(e=>(this.logService.error("Failed to load personal subscription pricing tiers",e),(0,bn.$)(()=>e)))),this.getBusinessSubscriptionPricingTiers$=()=>(0,$t.z)([this.teams$,this.enterprise$,this.custom$]).pipe((0,In.W)(e=>(this.logService.error("Failed to load business subscription pricing tiers",e),(0,bn.$)(()=>e)))),this.getDeveloperSubscriptionPricingTiers$=()=>(0,$t.z)([this.free$,this.teams$,this.enterprise$]).pipe((0,In.W)(e=>(this.logService.error("Failed to load developer subscription pricing tiers",e),(0,bn.$)(()=>e)))),this.organizationPlansResponse$=this.environmentService.environment$.pipe((0,wn.s)(1),(0,ge.n)(e=>e.isCloud()?(0,et.H)(this.billingApiService.getPlans()):(0,xt.of)({data:[]})),(0,At.t)({bufferSize:1,refCount:!1})),this.premiumPlanResponse$=this.environmentService.environment$.pipe((0,wn.s)(1),(0,ge.n)(e=>e.isCloud()?(0,et.H)(this.billingApiService.getPremiumPlan()).pipe((0,In.W)(e=>(this.logService.error("Failed to fetch premium plan from API",e),(0,bn.$)(()=>e)))):(0,xt.of)({seat:void 0,storage:void 0})),(0,At.t)({bufferSize:1,refCount:!1})),this.premium$=this.configService.getFeatureFlag$(dn.TO.PM26793_FetchPremiumPriceFromPricingService).pipe((0,wn.s)(1),(0,ge.n)(e=>e?this.premiumPlanResponse$.pipe((0,E.T)(e=>{var t,i,n;return{seat:null===(t=e.seat)||void 0===t?void 0:t.price,storage:null===(i=e.storage)||void 0===i?void 0:i.price,provided:null===(n=e.storage)||void 0===n?void 0:n.provided}})):(0,xt.of)({seat:Cn.FALLBACK_PREMIUM_SEAT_PRICE,storage:Cn.FALLBACK_PREMIUM_STORAGE_PRICE,provided:Cn.FALLBACK_PREMIUM_PROVIDED_STORAGE_GB})),(0,E.T)(e=>({id:kn.OU.Premium,name:this.i18nService.t("premium"),description:this.i18nService.t("advancedOnlineSecurity"),availableCadences:[kn.fQ.Annually],passwordManager:{type:"standalone",annualPrice:e.seat,annualPricePerAdditionalStorageGB:e.storage,providedStorageGB:e.provided,features:[this.featureTranslations.builtInAuthenticator(),this.featureTranslations.secureFileStorage(),this.featureTranslations.emergencyAccess(),this.featureTranslations.breachMonitoring(),this.featureTranslations.andMoreFeatures()]}}))),this.families$=this.organizationPlansResponse$.pipe((0,Sn.v)(this.configService.getFeatureFlag$(dn.TO.PM26462_Milestone_3)),(0,E.T)(([e,t])=>{var i,n,r,s;const o=e.data.find(e=>e.type===(t?fn.OL.FamiliesAnnually:fn.OL.FamiliesAnnually2025));return{id:kn.OU.Families,name:this.i18nService.t("planNameFamilies"),description:this.i18nService.t("planDescFamiliesV2"),availableCadences:[kn.fQ.Annually],passwordManager:{type:"packaged",users:null===(i=null==o?void 0:o.PasswordManager)||void 0===i?void 0:i.baseSeats,annualPrice:null===(n=null==o?void 0:o.PasswordManager)||void 0===n?void 0:n.basePrice,annualPricePerAdditionalStorageGB:null===(r=null==o?void 0:o.PasswordManager)||void 0===r?void 0:r.additionalStoragePricePerGb,providedStorageGB:null===(s=null==o?void 0:o.PasswordManager)||void 0===s?void 0:s.baseStorageGb,features:[this.featureTranslations.premiumAccounts(),this.featureTranslations.familiesUnlimitedSharing(),this.featureTranslations.familiesUnlimitedCollections(),this.featureTranslations.familiesSharedStorage()]}}})),this.free$=this.organizationPlansResponse$.pipe((0,E.T)(e=>{var t,i,n;const r=e.data.find(e=>e.type===fn.OL.Free);return{id:kn.ql.Free,name:this.i18nService.t("planNameFree"),description:this.i18nService.t("planDescFreeV2","1"),availableCadences:[],passwordManager:{type:"free",features:[this.featureTranslations.limitedUsersV2(null===(t=null==r?void 0:r.PasswordManager)||void 0===t?void 0:t.maxSeats),this.featureTranslations.limitedCollectionsV2(null===(i=null==r?void 0:r.PasswordManager)||void 0===i?void 0:i.maxCollections),this.featureTranslations.alwaysFree()]},secretsManager:{type:"free",features:[this.featureTranslations.twoSecretsIncluded(),this.featureTranslations.projectsIncludedV2(null===(n=null==r?void 0:r.SecretsManager)||void 0===n?void 0:n.maxProjects)]}}})),this.teams$=this.organizationPlansResponse$.pipe((0,E.T)(e=>{var t,i,n,r,s,o;const a=e.data.find(e=>e.type===fn.OL.TeamsAnnually);return{id:kn.ql.Teams,name:this.i18nService.t("planNameTeams"),description:this.i18nService.t("teamsPlanUpgradeMessage"),availableCadences:[kn.fQ.Annually,kn.fQ.Monthly],passwordManager:{type:"scalable",annualPricePerUser:null===(t=null==a?void 0:a.PasswordManager)||void 0===t?void 0:t.seatPrice,annualPricePerAdditionalStorageGB:null===(i=null==a?void 0:a.PasswordManager)||void 0===i?void 0:i.additionalStoragePricePerGb,providedStorageGB:null===(n=null==a?void 0:a.PasswordManager)||void 0===n?void 0:n.baseStorageGb,features:[this.featureTranslations.secureItemSharing(),this.featureTranslations.eventLogMonitoring(),this.featureTranslations.directoryIntegration(),this.featureTranslations.scimSupport()]},secretsManager:{type:"scalable",annualPricePerUser:null===(r=null==a?void 0:a.SecretsManager)||void 0===r?void 0:r.seatPrice,annualPricePerAdditionalServiceAccount:null===(s=null==a?void 0:a.SecretsManager)||void 0===s?void 0:s.additionalPricePerServiceAccount,features:[this.featureTranslations.unlimitedSecretsAndProjects(),this.featureTranslations.includedMachineAccountsV2(null===(o=null==a?void 0:a.SecretsManager)||void 0===o?void 0:o.baseServiceAccount)]}}})),this.enterprise$=this.organizationPlansResponse$.pipe((0,E.T)(e=>{var t,i,n,r,s,o;const a=e.data.find(e=>e.type===fn.OL.EnterpriseAnnually);return{id:kn.ql.Enterprise,name:this.i18nService.t("planNameEnterprise"),description:this.i18nService.t("planDescEnterpriseV2"),availableCadences:[kn.fQ.Annually,kn.fQ.Monthly],passwordManager:{type:"scalable",annualPricePerUser:null===(t=null==a?void 0:a.PasswordManager)||void 0===t?void 0:t.seatPrice,annualPricePerAdditionalStorageGB:null===(i=null==a?void 0:a.PasswordManager)||void 0===i?void 0:i.additionalStoragePricePerGb,providedStorageGB:null===(n=null==a?void 0:a.PasswordManager)||void 0===n?void 0:n.baseStorageGb,features:[this.featureTranslations.enterpriseSecurityPolicies(),this.featureTranslations.passwordLessSso(),this.featureTranslations.accountRecovery(),this.featureTranslations.selfHostOption(),this.featureTranslations.complimentaryFamiliesPlan()]},secretsManager:{type:"scalable",annualPricePerUser:null===(r=null==a?void 0:a.SecretsManager)||void 0===r?void 0:r.seatPrice,annualPricePerAdditionalServiceAccount:null===(s=null==a?void 0:a.SecretsManager)||void 0===s?void 0:s.additionalPricePerServiceAccount,features:[this.featureTranslations.unlimitedUsers(),this.featureTranslations.includedMachineAccountsV2(null===(o=null==a?void 0:a.SecretsManager)||void 0===o?void 0:o.baseServiceAccount)]}}})),this.custom$=this.organizationPlansResponse$.pipe((0,E.T)(()=>({id:kn.ql.Custom,name:this.i18nService.t("planNameCustom"),description:this.i18nService.t("planDescCustom"),availableCadences:[],passwordManager:{type:"custom",features:[this.featureTranslations.strengthenCybersecurity(),this.featureTranslations.boostProductivity(),this.featureTranslations.seamlessIntegration()]}}))),this.featureTranslations={builtInAuthenticator:()=>({key:"builtInAuthenticator",value:this.i18nService.t("builtInAuthenticator")}),emergencyAccess:()=>({key:"emergencyAccess",value:this.i18nService.t("emergencyAccess")}),breachMonitoring:()=>({key:"breachMonitoring",value:this.i18nService.t("breachMonitoring")}),andMoreFeatures:()=>({key:"andMoreFeatures",value:this.i18nService.t("andMoreFeatures")}),premiumAccounts:()=>({key:"premiumAccounts",value:this.i18nService.t("premiumAccounts")}),secureFileStorage:()=>({key:"secureFileStorage",value:this.i18nService.t("secureFileStorage")}),familiesUnlimitedSharing:()=>({key:"familiesUnlimitedSharing",value:this.i18nService.t("familiesUnlimitedSharing")}),familiesUnlimitedCollections:()=>({key:"familiesUnlimitedCollections",value:this.i18nService.t("familiesUnlimitedCollections")}),familiesSharedStorage:()=>({key:"familiesSharedStorage",value:this.i18nService.t("familiesSharedStorage")}),limitedUsersV2:e=>({key:"limitedUsersV2",value:this.i18nService.t("limitedUsersV2",e)}),limitedCollectionsV2:e=>({key:"limitedCollectionsV2",value:this.i18nService.t("limitedCollectionsV2",e)}),alwaysFree:()=>({key:"alwaysFree",value:this.i18nService.t("alwaysFree")}),twoSecretsIncluded:()=>({key:"twoSecretsIncluded",value:this.i18nService.t("twoSecretsIncluded")}),projectsIncludedV2:e=>({key:"projectsIncludedV2",value:this.i18nService.t("projectsIncludedV2",e)}),secureItemSharing:()=>({key:"secureItemSharing",value:this.i18nService.t("secureItemSharing")}),eventLogMonitoring:()=>({key:"eventLogMonitoring",value:this.i18nService.t("eventLogMonitoring")}),directoryIntegration:()=>({key:"directoryIntegration",value:this.i18nService.t("directoryIntegration")}),scimSupport:()=>({key:"scimSupport",value:this.i18nService.t("scimSupport")}),unlimitedSecretsAndProjects:()=>({key:"unlimitedSecretsAndProjects",value:this.i18nService.t("unlimitedSecretsAndProjects")}),includedMachineAccountsV2:e=>({key:"includedMachineAccountsV2",value:this.i18nService.t("includedMachineAccountsV2",e)}),enterpriseSecurityPolicies:()=>({key:"enterpriseSecurityPolicies",value:this.i18nService.t("enterpriseSecurityPolicies")}),passwordLessSso:()=>({key:"passwordLessSso",value:this.i18nService.t("passwordLessSso")}),accountRecovery:()=>({key:"accountRecovery",value:this.i18nService.t("accountRecovery")}),selfHostOption:()=>({key:"selfHostOption",value:this.i18nService.t("selfHostOption")}),complimentaryFamiliesPlan:()=>({key:"complimentaryFamiliesPlan",value:this.i18nService.t("complimentaryFamiliesPlan")}),unlimitedUsers:()=>({key:"unlimitedUsers",value:this.i18nService.t("unlimitedUsers")}),strengthenCybersecurity:()=>({key:"strengthenCybersecurity",value:this.i18nService.t("strengthenCybersecurity")}),boostProductivity:()=>({key:"boostProductivity",value:this.i18nService.t("boostProductivity")}),seamlessIntegration:()=>({key:"seamlessIntegration",value:this.i18nService.t("seamlessIntegration")})}}}Cn.FALLBACK_PREMIUM_SEAT_PRICE=10,Cn.FALLBACK_PREMIUM_STORAGE_PRICE=4,Cn.FALLBACK_PREMIUM_PROVIDED_STORAGE_GB=1;class Tn extends j.r{constructor(e){super(e),this.addedDate=this.getResponseProperty("AddedDate"),this.breachDate=this.getResponseProperty("BreachDate"),this.dataClasses=this.getResponseProperty("DataClasses"),this.description=this.getResponseProperty("Description"),this.domain=this.getResponseProperty("Domain"),this.isActive=this.getResponseProperty("IsActive"),this.isVerified=this.getResponseProperty("IsVerified"),this.logoPath=this.getResponseProperty("LogoPath"),this.modifiedDate=this.getResponseProperty("ModifiedDate"),this.name=this.getResponseProperty("Name"),this.pwnCount=this.getResponseProperty("PwnCount"),this.title=this.getResponseProperty("Title")}}var Fn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Rn{constructor(e){this.apiService=e}getHibpBreach(e){return Fn(this,void 0,void 0,function*(){const t=encodeURIComponent(e);return(yield this.apiService.send("GET","/hibp/breach?username="+t,null,!0,!0)).map(e=>new Tn(e))})}}var Pn=i(76599),xn=i(23166),$n=i(45872),En=i(89105),An=i(62870),Dn=i(90250),On=i(82781),Mn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Un=i(55367),Gn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var jn=i(39935);class Nn extends ki.V{}class Vn{}class Bn extends Vn{}var zn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ln=new D.Ok(D.eP,"deviceKey",{deserializer:e=>e?oi.e.fromJSON(e):null,clearOn:[],cleanupDelayMs:0,debug:{enableRetrievalLogging:!0,enableUpdateLogging:!0}}),Kn=new D.Ok(D.eP,"shouldTrustDevice",{deserializer:e=>e,clearOn:[]});var qn=i(60512),_n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Xn{constructor(e,t,i,n,r){this.kdfConfigService=e,this.changeKdfService=t,this.logService=i,this.configService=n,this.masterPasswordService=r}runMigrations(e,t){return _n(this,void 0,void 0,function*(){(0,qn.x)(e,"userId"),(0,qn.x)(t,"masterPassword"),this.logService.info(`[MinimumKdfMigration] Updating user ${e} to minimum PBKDF2 iteration count ${Si.n1.ITERATIONS.defaultValue}`),yield this.changeKdfService.updateUserKdfParams(t,new Si.n1(Si.n1.ITERATIONS.defaultValue),e),yield this.kdfConfigService.setKdfConfig(e,new Si.n1(Si.n1.ITERATIONS.defaultValue))})}needsMigration(e){return _n(this,void 0,void 0,function*(){if((0,qn.x)(e,"userId"),!(yield this.masterPasswordService.userHasMasterPassword(e)))return"noMigrationNeeded";const t=yield this.kdfConfigService.getKdfConfig(e);return t.kdfType!==Si.ao.PBKDF2_SHA256||t.iterations>=Si.n1.ITERATIONS.min?"noMigrationNeeded":(yield this.configService.getFeatureFlag(dn.TO.ForceUpdateKDFSettings))?"needsMigrationWithMasterPassword":"noMigrationNeeded"})}}var Yn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Hn=i(27650),Wn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Jn{}var Zn=i(22397);class Qn extends Zn.T{constructor(e,t){super(),this.newMasterPasswordHash=e.masterPasswordAuthenticationHash,this.key=t.masterKeyWrappedUserKey,this.authenticationData=e,this.unlockData=t}}var er=i(10459),tr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},ir=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},nr=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});class rr{constructor(e,t){this.changeKdfApiService=e,this.sdkService=t}updateUserKdfParams(e,t,i){return tr(this,void 0,void 0,function*(){(0,qn.x)(e,"masterPassword"),(0,qn.x)(t,"kdf"),(0,qn.x)(i,"userId");const n=yield(0,fe._)(this.sdkService.userClient$(i).pipe((0,E.T)(i=>{const n={stack:[],error:void 0,hasError:!1};try{if(!i)throw new Error("SDK not available");const r=ir(n,i.take(),!1);return r.value.crypto().make_update_kdf(e,t.toSdkConfig())}catch(r){n.error=r,n.hasError=!0}finally{nr(n)}}))),r=(0,er.P)(n.masterPasswordAuthenticationData),s=er.k.fromSdk(n.masterPasswordUnlockData),o=(0,er.P)(n.oldMasterPasswordAuthenticationData),a=new Qn(r,s);a.authenticateWith(o),yield this.changeKdfApiService.updateUserKdfParams(a)})}}var sr=i(16992),or=i(31944),ar=i(52057);class lr extends j.r{constructor(e){super(e),this.organizationName=this.getResponseProperty("OrganizationName")}}var cr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var dr=i(69194),ur=i(48541);class hr{constructor(e){this.key=e}}class pr{constructor(e,t,i,n){this.key=e,this.kdf=t.kdfType,this.kdfIterations=t.iterations,t.kdfType===Si.ao.Argon2id&&(this.kdfMemory=t.memory,this.kdfParallelism=t.parallelism),this.orgIdentifier=i,this.keys=n}}var mr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const vr=new D.Ok(D._Q,"usesKeyConnector",{deserializer:e=>e,clearOn:["logout"],cleanupDelayMs:0}),fr=new D.Ok(D._Q,"newSsoUserKeyConnectorConversion",{deserializer:e=>null==e?null:{kdfConfig:e.kdfConfig.kdfType===Si.ao.PBKDF2_SHA256?Si.n1.fromJSON(e.kdfConfig):Si.hU.fromJSON(e.kdfConfig),keyConnectorUrl:e.keyConnectorUrl,organizationId:e.organizationId},clearOn:["logout"],cleanupDelayMs:0});var gr=i(66827);class yr{constructor(e){if("object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("publicKey"in e&&e.publicKey instanceof Uint8Array))throw new TypeError("Response must contain a valid publicKey");if(this.publicKey=e.publicKey,"verifyingKey"in e&&"string"==typeof e.verifyingKey?this.verifyingKey=e.verifyingKey:this.verifyingKey=null,"signedPublicKey"in e&&"string"==typeof e.signedPublicKey?this.signedPublicKey=e.signedPublicKey:this.signedPublicKey=null,null!==this.signedPublicKey&&null===this.verifyingKey||null===this.signedPublicKey&&null!==this.verifyingKey)throw new TypeError("Both signedPublicKey and verifyingKey must be present or absent together")}}var br=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var wr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Sr=i(17898),Ir=i(83541),kr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Cr=i(81441),Tr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Fr=new D.Ok(D.Tf,"masterKey",{deserializer:e=>oi.e.fromJSON(e),clearOn:["lock","logout"]}),Rr=new D.Ok(D.Br,"masterKeyHash",{deserializer:e=>e,clearOn:["logout"]}),Pr=new D.Ok(D.Br,"masterKeyEncryptedUserKey",{deserializer:e=>e,clearOn:["logout"]}),xr=new D.Ok(D.Br,"forceSetPasswordReason",{deserializer:e=>e,clearOn:["logout"]}),$r=new D.Ok(D.y7,"masterPasswordUnlockKey",{deserializer:e=>er.k.fromJSON(e),clearOn:["logout"]});class Er{}const Ar=new D.Ok(D.EF,"pinProtectedUserKeyEnvelopePersistent",{deserializer:e=>e,clearOn:["logout"]}),Dr=new D.Ok(D.aL,"pinProtectedUserKeyEnvelopeEphemeral",{deserializer:e=>e,clearOn:["logout"]}),Or=new D.Ok(D.EF,"userKeyEncryptedPin",{deserializer:e=>e,clearOn:["logout"]});var Mr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ur=i(84101),Gr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function jr(e,t){return Gr(this,void 0,void 0,function*(){const i=yield(0,fe._)(e);if(null==i)throw new Error(`Failed to get ${t}`);return i})}var Nr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Vr=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},Br=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});var zr=i(75633);const Lr=new D.Ok(D.Gg,"accountSecurityState",{deserializer:e=>e,clearOn:["logout"]});var Kr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qr{}var _r=i(35004),Xr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Yr=i(69554),Hr=i(91059),Wr=i(52396);class Jr{}var Zr=i(1601),Qr=i(29377);class es{}var ts=i(50700),is=i(56962),ns=i(83516),rs=i(37115);Error;Error;var ss=i(74683),os=i(66523),as=i(44997),ls=i(21551);class cs{}var ds=i(2471);class us{}class hs{openPopup(){throw new Error("Open Popup unsupported.")}}var ps=i(48479),ms=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class vs{get client(){if(!this._client)throw new Error("IpcService not initialized. Call init() first.");return this._client}get messages$(){if(!this._messages$)throw new Error("IpcService not initialized. Call init() first.");return this._messages$}initWithClient(e){return ms(this,void 0,void 0,function*(){this._client=e,yield this._client.start(),this._messages$=new ps.c(e=>{let t=!0;return(()=>{ms(this,void 0,void 0,function*(){const i=yield this.client.subscribe();for(;t;)try{const t=yield i.receive();e.next(t)}catch(n){e.error(n);break}})})(),()=>{t=!1}}).pipe((0,At.t)({bufferSize:0,refCount:!0}))})}send(e){return ms(this,void 0,void 0,function*(){yield this.client.send(e)})}}var fs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const gs=D.Zs.record(D.hs,"ipcSessions",{deserializer:e=>e});class ys{constructor(e){this.stateProvider=e,this.states=this.stateProvider.getGlobal(gs)}get(e){return(0,fe._)(this.states.state$.pipe((0,E.T)(t=>null==t?void 0:t[bs(e)])))}save(e,t){return fs(this,void 0,void 0,function*(){yield this.states.update(i=>Object.assign(Object.assign({},i),{[bs(e)]:t}))})}remove(e){return fs(this,void 0,void 0,function*(){yield this.states.update(t=>{const i=Object.assign({},t);return delete i[bs(e)],i})})}}function bs(e){return"object"==typeof e&&"Web"in e?`Web(${e.Web.id})`:e}var ws=i(10760),Ss=i(5819);function Is(e){return"string"==typeof e?JSON.parse(e):e}function ks(e){var t;const i=null!==(t=Is({sdk:!0}))&&void 0!==t?t:{};return null==i[e]||!!i[e]}var Cs,Ts=i(9249),Fs=i(15055);!function(e){e[e.SignalR=0]="SignalR",e[e.WebPush=1]="WebPush"}(Cs||(Cs={}));new D.Zs(D.g4,"subUsers",{deserializer:e=>{if(null==e)return{};const t={};for(const[i,n]of Object.entries(e))t[i]=Array.isArray(n)?n:[];return t}});var Rs=i(91566),Ps=i(63108),xs=i(1472);const $s=12e4;class Es{constructor(e){this.logService=e}redactMessage(e){const t="access_token=",i=e.indexOf(t);return-1!==i?e.substring(0,i+13)+"[REDACTED]":e}log(e,t){const i=`[SignalR] ${this.redactMessage(t)}`;switch(e){case Rs.$.Critical:case Rs.$.Error:this.logService.error(i);break;case Rs.$.Warning:this.logService.warning(i);break;case Rs.$.Information:this.logService.info(i);break;case Rs.$.Debug:this.logService.debug(i)}}}class As{constructor(e,t,i,n=()=>new at.$,r=globalThis){this.apiService=e,this.logService=t,this.platformUtilsService=i,this.hubConnectionBuilderFactory=n,this.timeoutManager=r}connect$(e,t){if(!t.startsWith("https://")&&!this.platformUtilsService.isDev())throw new Tt;return new ps.c(i=>{const n=this.hubConnectionBuilderFactory().withUrl(t+"/hub",{accessTokenFactory:()=>this.apiService.getActiveBearerToken(e),skipNegotiation:!0,transport:lt.w.WebSockets}).withHubProtocol(new ct.E).configureLogging(new Es(this.logService)).build();n.on("ReceiveMessage",e=>{i.next({type:"ReceiveMessage",message:new pt(e)})}),n.on("Heartbeat",()=>{i.next({type:"Heartbeat"})});let r=null;const s=()=>{if(null==n||n.state!==Ps.j.Disconnected||null!=r&&!r.closed)return;if(i.closed)return;const e=this.randomReconnectTime(),t=this.timeoutManager.setTimeout(()=>{n.start().then(()=>{r=null}).catch(()=>{s()})},e);r=new xs.yU(()=>this.timeoutManager.clearTimeout(t))};return n.onclose(e=>{s()}),n.start().catch(()=>{s()}),()=>{null==r||r.unsubscribe(),null==n||n.stop().catch(e=>{this.logService.error("Error while stopping SignalR connection",e)})}})}randomReconnectTime(){return Math.floor(180001*Math.random())+$s}}var Ds=i(99969),Os=i(3097),Ms=i(55159);var Us=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Gs=new Set([be._n.AuthRequest]);class js{supportStatus$(e){return(0,xt.of)({type:"not-supported",reason:"client-not-supported"})}}class Ns{}class Vs{static from(e){var t,i;const n=new Vs;return n.endpoint=e.endpoint,n.p256dh=null===(t=e.keys)||void 0===t?void 0:t.p256dh,n.auth=null===(i=e.keys)||void 0===i?void 0:i.auth,n}}var Bs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class zs{constructor(e,t){this.apiService=e,this.appIdService=t}putSubscription(e,t){return Bs(this,void 0,void 0,function*(){const i=Vs.from(e);yield this.apiService.send("POST",`/devices/identifier/${yield this.appIdService.getAppId()}/web-push-auth`,i,t,!1)})}}var Ls=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ks{constructor(e,t){this.storageService=e,this.logService=t}getAppId(){return Ls(this,void 0,void 0,function*(){return this.logService.info("Retrieving application id"),yield this.getEnsuredValue("global_applicationId_appId")})}getAnonymousAppId(){return Ls(this,void 0,void 0,function*(){return yield this.getEnsuredValue("global_applicationId_appId")})}getEnsuredValue(e){return Ls(this,void 0,void 0,function*(){let t=yield this.storageService.get(e);return null==t&&(t=Se.A.newGuid(),yield this.storageService.save(e,t)),t})}}class qs{constructor(e){var t;this.disableUserRegistration=null!==(t=null==e?void 0:e.disableUserRegistration)&&void 0!==t&&t}}class _s extends j.r{constructor(e){super(e),this.featureStates={},null!=e&&(this.version=this.getResponseProperty("Version"),this.gitHash=this.getResponseProperty("GitHash"),this.server=new Hs(this.getResponseProperty("Server")),this.environment=new Ys(this.getResponseProperty("Environment")),this.featureStates=this.getResponseProperty("FeatureStates"),this.push=new Xs(this.getResponseProperty("Push")),this.settings=new qs(this.getResponseProperty("Settings")))}}class Xs extends j.r{constructor(e=null){super(e),null!=e&&(this.pushTechnology=this.getResponseProperty("PushTechnology"),this.vapidPublicKey=this.getResponseProperty("VapidPublicKey"))}}class Ys extends j.r{constructor(e=null){super(e),null!=e&&(this.cloudRegion=this.getResponseProperty("CloudRegion"),this.vault=this.getResponseProperty("Vault"),this.api=this.getResponseProperty("Api"),this.identity=this.getResponseProperty("Identity"),this.notifications=this.getResponseProperty("Notifications"),this.sso=this.getResponseProperty("Sso"))}}class Hs extends j.r{constructor(e=null){super(e),null!=e&&(this.name=this.getResponseProperty("Name"),this.url=this.getResponseProperty("Url"))}}var Ws=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Js=i(36359),Zs=i(81714),Qs=i(65023),eo=i(72737),to=i(8029),io=i(62329);class no{constructor(e){var t,i;this.featureStates={},this.version=e.version,this.gitHash=e.gitHash,this.server=e.server,this.utcDate=new Date(e.utcDate),this.environment=e.environment,this.featureStates=e.featureStates,this.push=null==e.push?{pushTechnology:Cs.SignalR}:{pushTechnology:e.push.pushTechnology,vapidPublicKey:e.push.vapidPublicKey},this.settings=e.settings,null==(null===(t=this.server)||void 0===t?void 0:t.name)&&null==(null===(i=this.server)||void 0===i?void 0:i.url)&&(this.server=null)}getAgeInMilliseconds(){var e;return(new Date).getTime()-(null===(e=this.utcDate)||void 0===e?void 0:e.getTime())}isValid(){return this.getAgeInMilliseconds()<=864e5}static fromJSON(e){return null==e?null:new no(e)}}class ro{constructor(e){this.featureStates={},this.version=null==e?void 0:e.version,this.gitHash=null==e?void 0:e.gitHash,this.server=(null==e?void 0:e.server)?new oo(e.server):null,this.utcDate=(new Date).toISOString(),this.environment=(null==e?void 0:e.environment)?new ao(e.environment):null,this.featureStates=null==e?void 0:e.featureStates,this.settings=new qs(e.settings),this.push=(null==e?void 0:e.push)?new so(e.push):null}static fromJSON(e){return Object.assign(new ro({}),e,{server:(null==e?void 0:e.server)?oo.fromJSON(e.server):null,environment:(null==e?void 0:e.environment)?ao.fromJSON(e.environment):null})}}class so{constructor(e){this.pushTechnology=e.pushTechnology,this.vapidPublicKey=e.vapidPublicKey}static fromJSON(e){return Object.assign(new so({}),e)}}class oo{constructor(e){this.name=e.name,this.url=e.url}static fromJSON(e){return Object.assign(new oo({}),e)}}class ao{constructor(e){this.cloudRegion=e.cloudRegion,this.vault=e.vault,this.api=e.api,this.identity=e.identity,this.notifications=e.notifications,this.sso=e.sso}static fromJSON(e){return Object.assign(new ao({}),e)}}var lo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const co=new D.Ok(D.Z6,"serverConfig",{deserializer:e=>null==e?null:no.fromJSON(e),clearOn:["logout"]}),uo=D.Zs.record(D.Z6,"byServer",{deserializer:e=>null==e?null:no.fromJSON(e)}),ho=(e,t)=>e.getApiUrl()===t.getApiUrl();class po{constructor(e,t,i,n,r){this.configApiService=e,this.environmentService=t,this.logService=i,this.stateProvider=n,this.authService=r,this.failedFetchFallbackSubject=new m.B;const s=this.environmentService.globalEnvironment$.pipe((0,Et.F)(ho),(0,ge.n)(e=>this.globalConfigFor$(e.getApiUrl()).pipe((0,E.T)(t=>[t,null,e,t]))));this.serverConfig$=this.stateProvider.activeUserId$.pipe((0,Et.F)(),(0,ge.n)(e=>null==e?s:this.authService.authStatusFor$(e).pipe((0,E.T)(e=>e===Dt.J.Unlocked),(0,Et.F)(),(0,ge.n)(t=>t?(0,$t.z)([this.environmentService.getEnvironment$(e).pipe((0,Et.F)(ho)),this.userConfigFor$(e)]).pipe((0,ge.n)(([t,i])=>null==i?this.globalConfigFor$(t.getApiUrl()).pipe((0,E.T)(i=>[null,e,t,i])):(0,xt.of)([i,e,t,i]))):s))),(0,Js.M)(e=>lo(this,void 0,void 0,function*(){const[t,i,n,r]=e;t&&!this.olderThanRetrievalInterval(t.utcDate)||(yield this.renewConfig(t,i,n,r))})),(0,ge.n)(([e])=>!e||this.olderThanRetrievalInterval(e.utcDate)?Zs.t:(0,xt.of)(e)),(0,Qs.X)(this.failedFetchFallbackSubject),(0,Os.u)({connector:()=>new eo.m(1),resetOnRefCountZero:()=>(0,to.O)(1e3)})),this.cloudRegion$=this.serverConfig$.pipe((0,E.T)(e=>{var t,i;return null!==(i=null===(t=null==e?void 0:e.environment)||void 0===t?void 0:t.cloudRegion)&&void 0!==i?i:Qr.T.US})),this.serverSettings$=this.serverConfig$.pipe((0,E.T)(e=>{var t;return null!==(t=null==e?void 0:e.settings)&&void 0!==t?t:new qs}))}getFeatureFlag$(e){return this.serverConfig$.pipe((0,E.T)(t=>(0,dn.Y6)(t,e)))}userCachedFeatureFlag$(e,t){return this.stateProvider.getUser(t,co).state$.pipe((0,E.T)(t=>(0,dn.Y6)(t,e)))}getFeatureFlag(e){return lo(this,void 0,void 0,function*(){return yield(0,fe._)(this.getFeatureFlag$(e))})}checkServerMeetsVersionRequirement$(e){return this.serverConfig$.pipe((0,E.T)(t=>{if(null==t)return!1;return new io.SemVer(t.version).compare(e)>=0}))}ensureConfigFetched(){return lo(this,void 0,void 0,function*(){yield(0,fe._)(this.serverConfig$)})}olderThanRetrievalInterval(e){return(new Date).getTime()-e.getTime()>36e5}renewConfig(e,t,i,n){return lo(this,void 0,void 0,function*(){var r,s,o;try{const a=setTimeout(()=>{this.logService.info("Environment did not respond in time, emitting previous config."),this.failedFetchFallbackSubject.next(n)},800),l=yield this.configApiService.get(t);clearTimeout(a);const c=new no(new ro(l));null!=(null===(r=null==c?void 0:c.environment)||void 0===r?void 0:r.cloudRegion)&&(null===(s=null==e?void 0:e.environment)||void 0===s?void 0:s.cloudRegion)!=c.environment.cloudRegion&&(yield this.environmentService.setCloudRegion(t,null===(o=null==c?void 0:c.environment)||void 0===o?void 0:o.cloudRegion)),null==t?yield this.stateProvider.getGlobal(uo).update(e=>Object.assign(Object.assign({},e),{[i.getApiUrl()]:c})):yield this.stateProvider.setUserState(co,c,t)}catch(a){this.logService.error(`Unable to fetch ServerConfig from ${i.getApiUrl()}`,a),this.failedFetchFallbackSubject.next(n)}})}globalConfigFor$(e){return this.stateProvider.getGlobal(uo).state$.pipe((0,E.T)(t=>{var i;return null!==(i=null==t?void 0:t[e])&&void 0!==i?i:null}))}userConfigFor$(e){return this.stateProvider.getUser(e,co).state$}}var mo=i(62627);var vo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class fo{static fromJSON(e){return Object.assign(new fo,e)}}const go=new D.Zs(D.ww,"environment",{deserializer:fo.fromJSON}),yo=new D.Ok(D.ww,"environment",{deserializer:fo.fromJSON,clearOn:["logout"]}),bo=new D.Zs(D.Wm,"cloudRegion",{deserializer:e=>e}),wo=new D.Ok(D.Wm,"cloudRegion",{deserializer:e=>e,clearOn:["logout"]}),So=[{key:Qr.T.US,domain:"bitwarden.com",urls:{base:null,api:"https://api.bitwarden.com",identity:"https://identity.bitwarden.com",icons:"https://icons.bitwarden.net",webVault:"https://vault.bitwarden.com",notifications:"https://notifications.bitwarden.com",events:"https://events.bitwarden.com",scim:"https://scim.bitwarden.com"}},{key:Qr.T.EU,domain:"bitwarden.eu",urls:{base:null,api:"https://api.bitwarden.eu",identity:"https://identity.bitwarden.eu",icons:"https://icons.bitwarden.eu",webVault:"https://vault.bitwarden.eu",notifications:"https://notifications.bitwarden.eu",events:"https://events.bitwarden.eu",scim:"https://scim.bitwarden.eu"}}],Io=Qr.T.US,ko=So.find(e=>e.key===Io);class Co{constructor(e,t,i=[]){this.stateProvider=e,this.accountService=t,this.additionalRegionConfigs=i,this.activeAccountId$=this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id)),this.globalState=this.stateProvider.getGlobal(go),this.globalCloudRegionState=this.stateProvider.getGlobal(bo);const n=this.activeAccountId$.pipe((0,Et.F)((e,t)=>e==t));this.globalEnvironment$=this.stateProvider.getGlobal(go).state$.pipe((0,E.T)(e=>this.buildEnvironment(null==e?void 0:e.region,null==e?void 0:e.urls))),this.environment$=n.pipe((0,ge.n)(e=>e?this.stateProvider.getUser(e,yo).state$:this.stateProvider.getGlobal(go).state$),(0,E.T)(e=>this.buildEnvironment(null==e?void 0:e.region,null==e?void 0:e.urls))),this.cloudWebVaultUrl$=n.pipe((0,ge.n)(e=>e?this.stateProvider.getUser(e,wo).state$:this.stateProvider.getGlobal(bo).state$),(0,E.T)(e=>{if(null!=e){const t=this.getRegionConfig(e);if(null!=t)return t.urls.webVault}return ko.urls.webVault}))}availableRegions(){return So.concat(this.additionalRegionConfigs)}getRegionConfig(e){return this.availableRegions().find(t=>t.key===e)}setEnvironment(e,t){return vo(this,void 0,void 0,function*(){return null==this.getRegionConfig(e)&&(e=Qr.T.SelfHosted),e==Qr.T.SelfHosted&&Fo(t)&&(e=Io),e!=Qr.T.SelfHosted?(yield this.globalState.update(()=>({region:e,urls:null})),null):(t.base=To(t.base),t.webVault=To(t.webVault),t.api=To(t.api),t.identity=To(t.identity),t.icons=To(t.icons),t.notifications=To(t.notifications),t.events=To(t.events),t.keyConnector=To(t.keyConnector),t.scim=null,yield this.globalState.update(()=>({region:e,urls:{base:t.base,api:t.api,identity:t.identity,webVault:t.webVault,icons:t.icons,notifications:t.notifications,events:t.events,keyConnector:t.keyConnector}})),t)})}buildEnvironment(e,t){if(null==this.getRegionConfig(e)&&(e=Qr.T.SelfHosted),e==Qr.T.SelfHosted&&Fo(t)&&(e=Io),e!=Qr.T.SelfHosted){const t=this.getRegionConfig(e);if(null!=t)return new Po(t)}return new xo(t)}setCloudRegion(e,t){return vo(this,void 0,void 0,function*(){null==e?yield this.globalCloudRegionState.update(()=>t):yield this.stateProvider.getUser(e,wo).update(()=>t)})}getEnvironment$(e){return this.stateProvider.getUser(e,yo).state$.pipe((0,E.T)(e=>this.buildEnvironment(null==e?void 0:e.region,null==e?void 0:e.urls)))}getEnvironment(e){return vo(this,void 0,void 0,function*(){const t=null!=e?e:yield(0,fe._)(this.activeAccountId$);return(0,fe._)(this.getEnvironment$(t))})}seedUserEnvironment(e){return vo(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.globalState.state$);yield this.stateProvider.getUser(e,yo).update(()=>t)})}}function To(e){return null==e||""===e?null:((e=e.replace(/\/+$/g,"")).startsWith("http://")||e.startsWith("https://")||(e="https://"+e),e.trim())}function Fo(e){return null==e||null==e.base&&null==e.webVault&&null==e.api&&null==e.identity&&null==e.icons&&null==e.notifications&&null==e.events}class Ro{constructor(e,t){this.region=e,this.urls=t,e==Qr.T.SelfHosted&&(this.urls.scim=null)}getRegion(){return this.region}getUrls(){return{base:this.urls.base,webVault:this.urls.webVault,api:this.urls.api,identity:this.urls.identity,icons:this.urls.icons,notifications:this.urls.notifications,events:this.urls.events,keyConnector:this.urls.keyConnector,scim:this.urls.scim}}hasBaseUrl(){return null!=this.urls.base}getWebVaultUrl(){return this.getUrl("webVault","")}getApiUrl(){return this.getUrl("api","/api")}getEventsUrl(){return this.getUrl("events","/events")}getIconsUrl(){return this.getUrl("icons","/icons")}getIdentityUrl(){return this.getUrl("identity","/identity")}getKeyConnectorUrl(){return this.urls.keyConnector}getNotificationsUrl(){return this.getUrl("notifications","/notifications")}getScimUrl(){return null!=this.urls.scim?this.urls.scim+"/v2":"https://vault.bitwarden.com"===this.getWebVaultUrl()?"https://scim.bitwarden.com/v2":this.getWebVaultUrl()+"/scim/v2"}getSendUrl(){return"https://vault.bitwarden.com"===this.getWebVaultUrl()?"https://send.bitwarden.com/#":this.getWebVaultUrl()+"/#/send/"}isCloud(){return this.region!==Qr.T.SelfHosted}getUrl(e,t){return null!=this.urls[e]?this.urls[e]:this.urls.base?this.urls.base+t:ko.urls[e]}}class Po extends Ro{constructor(e){super(e.key,e.urls),this.config=e}getHostname(){return this.config.domain}}class xo extends Ro{constructor(e){super(Qr.T.SelfHosted,e)}getHostname(){return Se.A.getHost(this.getWebVaultUrl())}}var $o=i(62602),Eo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ao{constructor(e,t){this.logService=e,this.apiService=t}upload(e,t,i){return Eo(this,void 0,void 0,function*(){return t.buffer.byteLength<=268435456?yield this.azureUploadBlob(e,t):yield this.azureUploadBlocks(e,t,i)})}azureUploadBlob(e,t){return Eo(this,void 0,void 0,function*(){const i=Se.A.getUrl(e),n=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":i.searchParams.get("sv"),"Content-Length":t.buffer.byteLength.toString(),"x-ms-blob-type":"BlockBlob"}),r=new Request(e,{body:t.buffer,cache:"no-store",method:"PUT",headers:n}),s=yield this.apiService.nativeFetch(r);if(201!==s.status)throw new Error(`Failed to create Azure blob: ${s.status}`)})}azureUploadBlocks(e,t,i){return Eo(this,void 0,void 0,function*(){const n=Se.A.getUrl(e),r=this.getMaxBlockSize(n.searchParams.get("sv"));let s=0;const o=Math.ceil(t.buffer.byteLength/r),a=[];if(o>5e4)throw new Error("Cannot upload file, exceeds maximum size of "+5e4*r);try{for(;s<o;){e=yield this.renewUrlIfNecessary(e,i);const n=Se.A.getUrl(e),o=this.encodedBlockId(s);n.searchParams.append("comp","block"),n.searchParams.append("blockid",o);const l=s*r,c=t.buffer.slice(l,l+r),d=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":n.searchParams.get("sv"),"Content-Length":c.byteLength.toString()}),u=new Request(n.toString(),{body:c,cache:"no-store",method:"PUT",headers:d}),h=yield this.apiService.nativeFetch(u);if(201!==h.status){const e=`Unsuccessful block PUT. Received status ${h.status}`;throw this.logService.error(e+"\n"+(yield h.json())),new Error(e)}a.push(o),s++}e=yield this.renewUrlIfNecessary(e,i);const n=Se.A.getUrl(e),l=this.blockListXml(a);n.searchParams.append("comp","blocklist");const c=new Headers({"x-ms-date":(new Date).toUTCString(),"x-ms-version":n.searchParams.get("sv"),"Content-Length":l.length.toString()}),d=new Request(n.toString(),{body:l,cache:"no-store",method:"PUT",headers:c}),u=yield this.apiService.nativeFetch(d);if(201!==u.status){const e=`Unsuccessful block list PUT. Received status ${u.status}`;throw this.logService.error(e+"\n"+(yield u.json())),new Error(e)}}catch(l){throw l}})}renewUrlIfNecessary(e,t){return Eo(this,void 0,void 0,function*(){var i;const n=Se.A.getUrl(e),r=new Date(null!==(i=n.searchParams.get("se"))&&void 0!==i?i:"");return isNaN(r.getTime())&&r.setTime(Date.now()+36e5),r.getTime()<Date.now()+1e3?yield t():e})}encodedBlockId(e){const t=("000000000000000000000000000000000000000000000000"+e.toString()).slice(-48);return Se.A.fromUtf8ToB64(t)}blockListXml(e){let t='<?xml version="1.0" encoding="utf-8"?><BlockList>';return e.forEach(e=>{t+=`<Latest>${e}</Latest>`}),t+="</BlockList>",t}getMaxBlockSize(e){return Do.compare(e,"2019-12-12")>=0?4194304e3:Do.compare(e,"2016-05-31")>=0?104857600:4194304}}class Do{static compare(e,t){return"string"==typeof e&&(e=new Do(e)),"string"==typeof t&&(t=new Do(t)),e.year!==t.year?e.year-t.year:e.month!==t.month?e.month-t.month:e.day!==t.day?e.day-t.day:0}constructor(e){this.year=0,this.month=0,this.day=0;try{const t=e.split("-").map(e=>Number.parseInt(e,10));this.year=t[0],this.month=t[1],this.day=t[2]}catch(t){}}compare(e){return Do.compare(this,e)}}var Oo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Mo{upload(e,t,i){return Oo(this,void 0,void 0,function*(){const n=new FormData;if(Se.A.isBrowser){const i=new Blob([t.buffer],{type:"application/octet-stream"});n.append("data",i,e)}else{if(!Se.A.isNode)throw new Error("Unsupported environment");n.append("data",Buffer.from(t.buffer),{filename:e,contentType:"application/octet-stream"})}yield i(n)})}}var Uo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Go{build(){var e;return null!==(e=this.migrationBuilderCache)&&void 0!==e?e:this.migrationBuilderCache=(0,it.yT)()}}var jo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class No{constructor(e,t,i,n){this.diskStorage=e,this.logService=t,this.migrationBuilderService=i,this.clientType=n}run(){return jo(this,void 0,void 0,function*(){const e=new it.Nb(yield(0,it.YO)(this.diskStorage,this.logService),this.diskStorage,this.logService,"general",this.clientType);if(e.currentVersion<0)return void(yield this.diskStorage.save("stateVersion",it.V_));const t=this.migrationBuilderService.build();yield t.migrate(e)})}waitForCompletion(){return jo(this,void 0,void 0,function*(){yield(0,it.GR)(this.diskStorage,this.logService)})}}var Vo=i(30082),Bo=i(50572),zo=i(90586);class Lo{constructor(e){this.markedForDisposal=!1,this.refCount=0,this.value=e}take(){if(this.markedForDisposal)throw new Error("Cannot take a reference to a value marked for disposal");return this.refCount++,new Ko(()=>this.release(),this.value)}markForDisposal(){this.markedForDisposal=!0,this.freeIfPossible()}release(){this.refCount--,this.freeIfPossible()}freeIfPossible(){0===this.refCount&&this.markedForDisposal&&this.value.free()}}class Ko{constructor(e,t){this.release=e,this.value=t}[Symbol.dispose](){this.release()}}var qo=i(50451),_o=i(75751);const Xo=D.Ok.record(D.fn,"ciphers",{deserializer:e=>qo.A.fromJSON(e),clearOn:["logout"]}),Yo=D.Ok.record(D.Xk,"decryptedCiphers",{deserializer:e=>_o.f.fromJSON(e),clearOn:["logout","lock"]}),Ho=D.Ok.array(D.Xk,"failedDecryptedCiphers",{deserializer:e=>_o.f.fromJSON(e),clearOn:["logout","lock"]}),Wo=new D.Ok(D.HR,"localData",{deserializer:e=>e,clearOn:["logout"]}),Jo=new D.Ok(D.Xk,"addEditCipherInfo",{deserializer:e=>{if(null==e)return null;return{cipher:null!=(null==e?void 0:e.cipher.toJSON)?e.cipher:_o.f.fromJSON(null==e?void 0:e.cipher),collectionIds:e.collectionIds}},clearOn:["logout","lock"]});var Zo=i(23293);class Qo{userKeyDefinition(){return Xo}toSdk(e){return new Zo.o(e).toSdkCipher()}fromSdk(e){return Zo.o.fromSdkCipher(e).toCipherData()}}var ea=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ta(e,t,i){return ea(this,void 0,void 0,function*(){yield t.register_cipher_repository(new ia(e,i,new Qo))})}class ia{constructor(e,t,i){this.userId=e,this.stateProvider=t,this.mapper=i}get(e){return ea(this,void 0,void 0,function*(){const t=this.stateProvider.getUser(this.userId,this.mapper.userKeyDefinition()),i=(yield(0,fe._)(t.state$.pipe((0,E.T)(e=>null!=e?e:{}))))[e];return i?this.mapper.toSdk(i):null})}list(){return ea(this,void 0,void 0,function*(){const e=this.stateProvider.getUser(this.userId,this.mapper.userKeyDefinition()),t=yield(0,fe._)(e.state$.pipe((0,E.T)(e=>null!=e?e:{})));return Object.values(t).map(e=>this.mapper.toSdk(e))})}set(e,t){return ea(this,void 0,void 0,function*(){const i=this.stateProvider.getUser(this.userId,this.mapper.userKeyDefinition()),n=yield(0,fe._)(i.state$.pipe((0,E.T)(e=>null!=e?e:{})));n[e]=this.mapper.fromSdk(t),yield i.update(()=>n)})}remove(e){return ea(this,void 0,void 0,function*(){const t=this.stateProvider.getUser(this.userId,this.mapper.userKeyDefinition()),i=yield(0,fe._)(t.state$.pipe((0,E.T)(e=>null!=e?e:{})));i[e]&&(delete i[e],yield t.update(()=>i))})}}var na=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ra=Symbol("UnsetClient");class sa{constructor(e,t){this.apiService=e,this.userId=t}get_access_token(){return na(this,void 0,void 0,function*(){if(null!=this.userId)return yield this.apiService.getActiveBearerToken(this.userId)})}}var oa=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const aa=Symbol("UnsetClient");class la{constructor(e,t){this.apiService=e,this.userId=t}get_access_token(){return oa(this,void 0,void 0,function*(){if(null!=this.userId)return yield this.apiService.getActiveBearerToken(this.userId)})}}var ca=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class da{constructor(e){this.keyService=e}setUserKeyInMemoryIfAutoUserKeySet(e){return ca(this,void 0,void 0,function*(){if(null==e)return!1;const t=yield this.keyService.getUserKeyFromStorage(si.hq.Auto,e);return null!=t&&(yield this.keyService.setUserKey(t,e),!0)})}}var ua=i(49272);class ha{constructor(e){this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.userId=e.userId,this.useEvents=e.useEvents,this.providerStatus=e.providerStatus,this.providerType=e.providerType}}var pa=i(46798);class ma{constructor(e){null!=e&&(this.id=e.id,this.fileName=e.fileName,this.size=e.size,this.sizeName=e.sizeName)}}class va{constructor(e){null!=e&&(this.text=e.text,this.hidden=e.hidden)}}class fa{constructor(e){if(null!=e)switch(this.id=e.id,this.accessId=e.accessId,this.type=e.type,this.name=e.name,this.notes=e.notes,this.key=e.key,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.revisionDate=e.revisionDate,this.expirationDate=e.expirationDate,this.deletionDate=e.deletionDate,this.password=e.password,this.emails=e.emails,this.disabled=e.disable,this.hideEmail=e.hideEmail,this.type){case pa.N.Text:this.text=new va(e.text);break;case pa.N.File:this.file=new ma(e.file)}}}var ga=i(64194),ya=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ba=new D.Ok(D.W$,"lastSync",{deserializer:e=>null!=e?new Date(e):null,clearOn:["logout"]});class wa{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h){this.tokenService=e,this.folderService=t,this.folderApiService=i,this.messageSender=n,this.logService=r,this.cipherService=s,this.collectionService=o,this.apiService=a,this.accountService=l,this.authService=c,this.sendService=d,this.sendApiService=u,this.stateProvider=h,this.syncInProgress=!1}getLastSync(){return ya(this,void 0,void 0,function*(){const e=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id)));return null==e?null:yield(0,fe._)(this.lastSync$(e))})}lastSync$(e){return this.stateProvider.getUser(e,ba).state$}activeUserLastSync$(){return this.accountService.activeAccount$.pipe((0,ge.n)(e=>null==e?(0,xt.of)(null):this.lastSync$(e.id)))}setLastSync(e,t){return ya(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,ba).update(()=>e)})}syncUpsertFolder(e,t,i){return ya(this,void 0,void 0,function*(){this.syncStarted();if((yield(0,fe._)(this.authService.authStatusFor$(i)))>=Dt.J.Locked)try{const n=yield this.folderService.get(e.id,i);if(!t&&null==n||t&&null!=n&&n.revisionDate<e.revisionDate){const t=yield this.folderApiService.get(e.id);if(null!=t)return yield this.folderService.upsert(new ga.p(t),i),this.messageSender.send("syncedUpsertedFolder",{folderId:e.id}),this.syncCompleted(!0,i)}}catch(n){this.logService.error(n)}return this.syncCompleted(!1,i)})}syncDeleteFolder(e,t){return ya(this,void 0,void 0,function*(){this.syncStarted();return(yield(0,fe._)(this.authService.authStatusFor$(t)))>=Dt.J.Locked?(yield this.folderService.delete(e.id,t),this.messageSender.send("syncedDeletedFolder",{folderId:e.id}),this.syncCompleted(!0,t),!0):this.syncCompleted(!1,t)})}syncUpsertCipher(e,t,i){return ya(this,void 0,void 0,function*(){this.syncStarted();if((yield(0,fe._)(this.authService.authStatusFor$(i)))>=Dt.J.Locked)try{let n=!0;const r=yield this.cipherService.get(e.id,i);null!=r&&r.revisionDate>=e.revisionDate&&(n=!1);let s=!1;if(n&&(t?(n=null!=r,s=!0):null==e.collectionIds||null==e.organizationId?n=null==r:(n=!1,s=!0)),!n&&s&&null!=e.organizationId&&null!=e.collectionIds&&e.collectionIds.length>0){const t=yield(0,fe._)(this.collectionService.encryptedCollections$(i).pipe((0,E.T)(e=>null!=e?e:[])));if(null!=t)for(let i=0;i<t.length;i++)if(e.collectionIds.indexOf(t[i].id)>-1){n=!0;break}}if(n){const t=yield this.apiService.getFullCipherDetails(e.id);if(null!=t)return yield this.cipherService.upsert(new qo.A(t)),this.messageSender.send("syncedUpsertedCipher",{cipherId:e.id}),this.syncCompleted(!0,i)}}catch(n){if(null!=n&&404===n.statusCode&&t)return yield this.cipherService.delete(e.id,i),this.messageSender.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0,i)}return this.syncCompleted(!1,i)})}syncDeleteCipher(e,t){return ya(this,void 0,void 0,function*(){this.syncStarted();return(yield(0,fe._)(this.authService.authStatusFor$(t)))>=Dt.J.Locked?(yield this.cipherService.delete(e.id,t),this.messageSender.send("syncedDeletedCipher",{cipherId:e.id}),this.syncCompleted(!0,t)):this.syncCompleted(!1,t)})}syncUpsertSend(e,t){return ya(this,void 0,void 0,function*(){this.syncStarted();const[i,n]=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,ge.n)(e=>(null==e&&(0,xt.of)([null,Dt.J.LoggedOut]),this.authService.authStatusFor$(e.id).pipe((0,E.T)(t=>[e.id,t]))))));if(i===e.userId&&n!==Dt.J.LoggedOut)try{const n=yield(0,fe._)(this.sendService.get$(e.id));if(!t&&null==n||t&&null!=n&&n.revisionDate<e.revisionDate){const t=yield this.sendApiService.getSend(e.id);if(null!=t)return yield this.sendService.upsert(new fa(t)),this.messageSender.send("syncedUpsertedSend",{sendId:e.id}),this.syncCompleted(!0,i)}}catch(r){this.logService.error(r)}return this.syncCompleted(!1,void 0)})}syncDeleteSend(e){return ya(this,void 0,void 0,function*(){this.syncStarted();const t=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id)));return null!=t&&(yield(0,fe._)(this.tokenService.hasAccessToken$(t)))?(yield this.sendService.delete(e.id),this.messageSender.send("syncedDeletedSend",{sendId:e.id}),this.syncCompleted(!0,void 0),!0):this.syncCompleted(!1,void 0)})}syncStarted(){this.syncInProgress=!0,this.messageSender.send("syncStarted")}syncCompleted(e,t){return this.syncInProgress=!1,this.messageSender.send("syncCompleted",{successfully:e,userId:t}),e}}var Sa=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};Object.freeze({FirstOptionalButton:0,SecondOptionalButton:1,NotificationButton:2});var Ia=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var ka=i(83234);class Ca{constructor(e){this.ids=null==e?[]:e}}class Ta extends j.r{constructor(e,t){super(e),this.id=this.getResponseProperty("Id"),this.type=this.getResponseProperty("Type"),this.organizationId=this.getResponseProperty("OrganizationId"),this.enabled=this.getResponseProperty("Enabled");const i=this.getResponseProperty("Config");this.config=null==i?null:new t(i)}}class Fa extends j.r{constructor(e){super(e);const t=this.getResponseProperty("LastSyncDate");t&&(this.lastSyncDate=new Date(t))}}class Ra extends j.r{constructor(e){super(e),this.isTokenValid=this.getResponseProperty("IsTokenValid"),this.isFreeFamilyPolicyEnabled=this.getResponseProperty("IsFreeFamilyPolicyEnabled")}}class Pa extends o.IZ{}class xa extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.error=this.getResponseProperty("Error")}}var $a=i(95919);class Ea extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.userId=this.getResponseProperty("UserId"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.permissions=new $a.n(this.getResponseProperty("Permissions"))}}class Aa extends Ea{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email")}}var Da=i(73409),Oa=i(9997),Ma=i(68881),Ua=i(65485),Ga=i(1086),ja=i(78107),Na=i(27790),Va=i(65861),Ba=i(82489);class za extends j.r{constructor(e){super(e),this.key=this.getResponseProperty("Key")}}class La extends j.r{constructor(e){super(e),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism")}}class Ka extends j.r{constructor(e){super(e),this.token=this.getResponseProperty("Token")}}var qa=i(53674),_a=i(65791);class Xa extends j.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.userId=this.getResponseProperty("UserId"),this.organizationId=this.getResponseProperty("OrganizationId"),this.providerId=this.getResponseProperty("ProviderId"),this.cipherId=this.getResponseProperty("CipherId"),this.collectionId=this.getResponseProperty("CollectionId"),this.groupId=this.getResponseProperty("GroupId"),this.policyId=this.getResponseProperty("PolicyId"),this.organizationUserId=this.getResponseProperty("OrganizationUserId"),this.providerUserId=this.getResponseProperty("ProviderUserId"),this.providerOrganizationId=this.getResponseProperty("ProviderOrganizationId"),this.actingUserId=this.getResponseProperty("ActingUserId"),this.date=this.getResponseProperty("Date"),this.deviceType=this.getResponseProperty("DeviceType"),this.ipAddress=this.getResponseProperty("IpAddress"),this.installationId=this.getResponseProperty("InstallationId"),this.systemUser=this.getResponseProperty("SystemUser"),this.domainName=this.getResponseProperty("DomainName"),this.secretId=this.getResponseProperty("SecretId"),this.projectId=this.getResponseProperty("ProjectId"),this.serviceAccountId=this.getResponseProperty("ServiceAccountId"),this.grantedServiceAccountId=this.getResponseProperty("GrantedServiceAccountId")}}class Ya extends j.r{constructor(e){super(e),this.userId=this.getResponseProperty("UserId"),this.publicKey=this.getResponseProperty("PublicKey")}}var Ha=i(42700);class Wa extends j.r{constructor(e){super(e),this.url=null,this.attachmentId=this.getResponseProperty("AttachmentId"),this.fileUploadType=this.getResponseProperty("FileUploadType");const t=this.getResponseProperty("CipherResponse"),i=this.getResponseProperty("CipherMiniResponse");this.cipherResponse=null==t?null:new Ha.N(t),this.cipherMiniResponse=null==i?null:new Ha.N(i),this.url=this.getResponseProperty("Url")}}var Ja=i(74865);class Za extends j.r{constructor(e){super(e),this.unavailable=this.getResponseProperty("Unavailable"),this.cipher=new Ha.N(this.getResponseProperty("Cipher"))}}var Qa=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class el{constructor(e,t,i,n,r,s,o,a,l,c,d=null){this.tokenService=e,this.platformUtilsService=t,this.environmentService=i,this.appIdService=n,this.refreshAccessTokenErrorCallback=r,this.logService=s,this.logoutCallback=o,this.vaultTimeoutSettingsService=a,this.accountService=l,this.httpOperations=c,this.customUserAgent=d,this.refreshTokenPromise={},this.device=t.getDevice(),this.deviceType=this.device.toString()}postIdentityToken(e){return Qa(this,void 0,void 0,function*(){var t;const i=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&i.set("User-Agent",this.customUserAgent);const n=e instanceof Ua.i?e.toIdentityToken():e.toIdentityToken(this.platformUtilsService.getClientType()),r=yield(0,fe._)(this.environmentService.environment$),s=yield this.fetch(this.httpOperations.createRequest(r.getIdentityUrl()+"/connect/token",{body:this.qsStringify(n),credentials:yield this.getCredentials(r),cache:"no-store",headers:i,method:"POST"}));let o=null;if(this.isJsonResponse(s)&&(o=yield s.json()),null!=o){if(200===s.status)return new Va.L(o);if(400===s.status&&o.TwoFactorProviders2&&Object.keys(o.TwoFactorProviders2).length)return new Ba.x(o);if(400===s.status&&(null===(t=null==o?void 0:o.ErrorModel)||void 0===t?void 0:t.Message)===el.NEW_DEVICE_VERIFICATION_REQUIRED_MESSAGE)return new ja.H(o);if(400===s.status&&(null==o?void 0:o.SsoOrganizationIdentifier))return new Na.u(o)}return Promise.reject(new we._(o,s.status,!0))})}refreshIdentityToken(){return Qa(this,arguments,void 0,function*(e=null){const t=null!=e?e:e=yield this.getActiveUser();if(null==t)throw new Error("No user provided and no active user, cannot refresh the identity token.");try{yield this.refreshToken(t)}catch(i){throw this.logService.error("Error refreshing access token: ",i),i}})}getAuthRequest(e){return Qa(this,void 0,void 0,function*(){const t=`/auth-requests/${e}`,i=yield this.send("GET",t,null,!0,!0);return new Ga.B(i)})}putAuthRequest(e,t){return Qa(this,void 0,void 0,function*(){const i=`/auth-requests/${e}`,n=yield this.send("PUT",i,t,!0,!0);return new Ga.B(n)})}getAuthRequests(){return Qa(this,void 0,void 0,function*(){const e=yield this.send("GET","/auth-requests/",null,!0,!0);return new Z.s(e,Ga.B)})}getLastAuthRequest(){return Qa(this,void 0,void 0,function*(){const e=(yield this.getAuthRequests()).data.filter(e=>!e.isAnswered&&!e.isExpired);return e.sort((e,t)=>e.creationDate.localeCompare(t.creationDate))[e.length-1]})}getProfile(){return Qa(this,void 0,void 0,function*(){const e=yield this.send("GET","/accounts/profile",null,!0,!0);return new W.l(e)})}getUserSubscription(){return Qa(this,void 0,void 0,function*(){const e=yield this.send("GET","/accounts/subscription",null,!0,!0);return new qa.X8(e)})}putProfile(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/accounts/profile",e,!0,!0);return new W.l(t)})}putAvatar(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/accounts/avatar",e,!0,!0);return new W.l(t)})}postPrelogin(e){return Qa(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.environmentService.environment$),i=yield this.send("POST","/accounts/prelogin",e,!1,!0,t.getIdentityUrl());return new La(i)})}postEmailToken(e){return this.send("POST","/accounts/email-token",e,!0,!1)}postEmail(e){return this.send("POST","/accounts/email",e,!0,!1)}postSetKeyConnectorKey(e){return this.send("POST","/accounts/set-key-connector-key",e,!0,!1)}postSecurityStamp(e){return this.send("POST","/accounts/security-stamp",e,!0,!1)}getAccountRevisionDate(){return Qa(this,void 0,void 0,function*(){return yield this.send("GET","/accounts/revision-date",null,!0,!0)})}postPasswordHint(e){return this.send("POST","/accounts/password-hint",e,!1,!1)}postPremium(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("POST","/accounts/premium",e,!0,!0);return new J(t)})}postReinstatePremium(){return this.send("POST","/accounts/reinstate-premium",null,!0,!1)}postAccountStorage(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("POST","/accounts/storage",e,!0,!0);return new J(t)})}postAccountLicense(e){return this.send("POST","/accounts/license",e,!0,!1)}postAccountKeys(e){return this.send("POST","/accounts/keys",e,!0,!1)}postAccountVerifyEmail(){return this.send("POST","/accounts/verify-email",null,!0,!1)}postAccountVerifyEmailToken(e){return this.send("POST","/accounts/verify-email-token",e,!1,!1)}postAccountRecoverDelete(e){return this.send("POST","/accounts/delete-recover",e,!1,!1)}postAccountRecoverDeleteToken(e){return this.send("POST","/accounts/delete-recover-token",e,!1,!1)}postAccountKdf(e){return this.send("POST","/accounts/kdf",e,!0,!1)}deleteSsoUser(e){return Qa(this,void 0,void 0,function*(){return this.send("DELETE","/accounts/sso/"+e,null,!0,!1)})}getSsoUserIdentifier(){return Qa(this,void 0,void 0,function*(){return this.send("GET","/accounts/sso/user-identifier",null,!0,!0)})}postUserApiKey(e,t){return Qa(this,void 0,void 0,function*(){const e=yield this.send("POST","/accounts/api-key",t,!0,!0);return new N(e)})}postUserRotateApiKey(e,t){return Qa(this,void 0,void 0,function*(){const e=yield this.send("POST","/accounts/rotate-api-key",t,!0,!0);return new N(e)})}postConvertToKeyConnector(){return this.send("POST","/accounts/convert-to-key-connector",null,!0,!1)}getUserBillingHistory(){return Qa(this,void 0,void 0,function*(){const e=yield this.send("GET","/accounts/billing/history",null,!0,!0);return new Y(e)})}getCipher(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/ciphers/"+e,null,!0,!0);return new Ha.N(t)})}getFullCipherDetails(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/ciphers/"+e+"/details",null,!0,!0);return new Ha.N(t)})}getCipherAdmin(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/ciphers/"+e+"/admin",null,!0,!0);return new Ha.N(t)})}getCiphersOrganization(e,t){return Qa(this,void 0,void 0,function*(){let i="/ciphers/organization-details?organizationId="+e;t&&(i+=`&includeMemberItems=${t}`);const n=yield this.send("GET",i,null,!0,!0);return new Z.s(n,Ha.N)})}postCipher(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("POST","/ciphers",e,!0,!0);return new Ha.N(t)})}postCipherCreate(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("POST","/ciphers/create",e,!0,!0);return new Ha.N(t)})}postCipherAdmin(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("POST","/ciphers/admin",e,!0,!0);return new Ha.N(t)})}putCipher(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e,t,!0,!0);return new Ha.N(i)})}putPartialCipher(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/partial",t,!0,!0);return new Ha.N(i)})}putCipherAdmin(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/admin",t,!0,!0);return new Ha.N(i)})}deleteCipher(e){return this.send("DELETE","/ciphers/"+e,null,!0,!1)}deleteCipherAdmin(e){return this.send("DELETE","/ciphers/"+e+"/admin",null,!0,!1)}deleteManyCiphers(e){return this.send("DELETE","/ciphers",e,!0,!1)}deleteManyCiphersAdmin(e){return this.send("DELETE","/ciphers/admin",e,!0,!1)}putMoveCiphers(e){return this.send("PUT","/ciphers/move",e,!0,!1)}putShareCipher(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/share",t,!0,!0);return new Ha.N(i)})}putShareCiphers(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/share",e,!0,!0);return new Z.s(t,Ha.N)})}putCipherCollections(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("PUT","/ciphers/"+e+"/collections_v2",t,!0,!0);return new Za(i)})}putCipherCollectionsAdmin(e,t){return this.send("PUT","/ciphers/"+e+"/collections-admin",t,!0,!0)}postPurgeCiphers(e,t=null){let i="/ciphers/purge";return null!=t&&(i+="?organizationId="+t),this.send("POST",i,e,!0,!1)}putDeleteCipher(e){return this.send("PUT","/ciphers/"+e+"/delete",null,!0,!1)}putDeleteCipherAdmin(e){return this.send("PUT","/ciphers/"+e+"/delete-admin",null,!0,!1)}putDeleteManyCiphers(e){return this.send("PUT","/ciphers/delete",e,!0,!1)}putDeleteManyCiphersAdmin(e){return this.send("PUT","/ciphers/delete-admin",e,!0,!1)}putRestoreCipher(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore",null,!0,!0);return new Ha.N(t)})}putRestoreCipherAdmin(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/"+e+"/restore-admin",null,!0,!0);return new Ha.N(t)})}putRestoreManyCiphers(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/restore",e,!0,!0);return new Z.s(t,Ha.N)})}putRestoreManyCiphersAdmin(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/ciphers/restore-admin",e,!0,!0);return new Z.s(t,Ha.N)})}getAttachmentData(e,t,i){return Qa(this,void 0,void 0,function*(){const n=(null!=i?"/emergency-access/"+i+"/":"/ciphers/")+e+"/attachment/"+t,r=yield this.send("GET",n,null,!0,!0);return new Ja.l(r)})}getAttachmentDataAdmin(e,t){return Qa(this,void 0,void 0,function*(){const i="/ciphers/"+e+"/attachment/"+t+"/admin",n=yield this.send("GET",i,null,!0,!0);return new Ja.l(n)})}postCipherAttachment(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("POST","/ciphers/"+e+"/attachment/v2",t,!0,!0);return new Wa(i)})}deleteCipherAttachment(e,t){return this.send("DELETE","/ciphers/"+e+"/attachment/"+t,null,!0,!0)}deleteCipherAttachmentAdmin(e,t){return this.send("DELETE","/ciphers/"+e+"/attachment/"+t+"/admin",null,!0,!0)}postShareCipherAttachment(e,t,i,n){return this.send("POST","/ciphers/"+e+"/attachment/"+t+"/share?organizationId="+n,i,!0,!1)}renewAttachmentUploadUrl(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("GET","/ciphers/"+e+"/attachment/"+t+"/renew",null,!0,!0);return new Wa(i)})}postAttachmentFile(e,t,i){return this.send("POST","/ciphers/"+e+"/attachment/"+t,i,!0,!1)}getCollectionAccessDetails(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("GET","/organizations/"+e+"/collections/"+t+"/details",null,!0,!0);return new o.MH(i)})}getUserCollections(){return Qa(this,void 0,void 0,function*(){const e=yield this.send("GET","/collections",null,!0,!0);return new Z.s(e,o.uF)})}getCollections(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/organizations/"+e+"/collections",null,!0,!0);return new Z.s(t,o.uF)})}getManyCollectionsWithAccessDetails(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/organizations/"+e+"/collections/details",null,!0,!0);return new Z.s(t,o.MH)})}getCollectionUsers(e,t){return Qa(this,void 0,void 0,function*(){return(yield this.send("GET","/organizations/"+e+"/collections/"+t+"/users",null,!0,!0)).map(e=>new Da.U(e))})}postCollection(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("POST","/organizations/"+e+"/collections",t,!0,!0);return new o.MH(i)})}putCollection(e,t,i){return Qa(this,void 0,void 0,function*(){const n=yield this.send("PUT","/organizations/"+e+"/collections/"+t,i,!0,!0);return new o.MH(n)})}deleteCollection(e,t){return this.send("DELETE","/organizations/"+e+"/collections/"+t,null,!0,!1)}deleteManyCollections(e,t){return this.send("DELETE","/organizations/"+e+"/collections",new Ca(t),!0,!1)}getGroupUsers(e,t){return Qa(this,void 0,void 0,function*(){return yield this.send("GET","/organizations/"+e+"/groups/"+t+"/users",null,!0,!0)})}deleteGroupUser(e,t,i){return this.send("DELETE","/organizations/"+e+"/groups/"+t+"/user/"+i,null,!0,!1)}getPlans(){return Qa(this,void 0,void 0,function*(){const e=yield this.send("GET","/plans",null,!1,!0);return new Z.s(e,tn.tQ)})}getSettingsDomains(){return Qa(this,void 0,void 0,function*(){const e=yield this.send("GET","/settings/domains",null,!0,!0);return new _a.X(e)})}putSettingsDomains(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("PUT","/settings/domains",e,!0,!0);return new _a.X(t)})}getSync(){return Qa(this,void 0,void 0,function*(){const e=this.platformUtilsService.supportsAutofill()?"/sync":"/sync?excludeDomains=true",t=yield this.send("GET",e,null,!0,!0);return new ua.f(t)})}getCloudCommunicationsEnabled(){return Qa(this,void 0,void 0,function*(){return yield this.send("GET","/organizations/connections/enabled",null,!0,!0)})}getOrganizationConnection(e,t,i){return Qa(this,void 0,void 0,function*(){const n=yield this.send("GET",`/organizations/connections/${e}/${t}`,null,!0,!0);return new Ta(n,i)})}createOrganizationConnection(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("POST","/organizations/connections/",e,!0,!0);return new Ta(i,t)})}updateOrganizationConnection(e,t,i){return Qa(this,void 0,void 0,function*(){const n=yield this.send("PUT","/organizations/connections/"+i,e,!0,!0);return new Ta(n,t)})}deleteOrganizationConnection(e){return Qa(this,void 0,void 0,function*(){return this.send("DELETE","/organizations/connections/"+e,null,!0,!1)})}getProviderUsers(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/providers/"+e+"/users",null,!0,!0);return new Z.s(t,Aa)})}getProviderUser(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("GET","/providers/"+e+"/users/"+t,null,!0,!0);return new Ea(i)})}postProviderUserInvite(e,t){return this.send("POST","/providers/"+e+"/users/invite",t,!0,!1)}postProviderUserReinvite(e,t){return this.send("POST","/providers/"+e+"/users/"+t+"/reinvite",null,!0,!1)}postManyProviderUserReinvite(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/users/reinvite",t,!0,!0);return new Z.s(i,xa)})}postProviderUserBulkConfirm(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/users/confirm",t,!0,!0);return new Z.s(i,xa)})}deleteManyProviderUsers(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("DELETE","/providers/"+e+"/users",t,!0,!0);return new Z.s(i,xa)})}postProviderUserAccept(e,t,i){return this.send("POST","/providers/"+e+"/users/"+t+"/accept",i,!0,!1)}postProviderUserConfirm(e,t,i){return this.send("POST","/providers/"+e+"/users/"+t+"/confirm",i,!0,!1)}postProviderUsersPublicKey(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/users/public-keys",t,!0,!0);return new Z.s(i,Pa)})}putProviderUser(e,t,i){return this.send("PUT","/providers/"+e+"/users/"+t,i,!0,!1)}deleteProviderUser(e,t){return this.send("DELETE","/providers/"+e+"/users/"+t,null,!0,!1)}getProviderClients(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/providers/"+e+"/organizations",null,!0,!0);return new Z.s(t,Pe)})}postProviderAddOrganization(e,t){return this.send("POST","/providers/"+e+"/organizations/add",t,!0,!1)}postProviderCreateOrganization(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.send("POST","/providers/"+e+"/organizations",t,!0,!0);return new Re(i)})}deleteProviderOrganization(e,t){return this.send("DELETE","/providers/"+e+"/organizations/"+t,null,!0,!1)}getEvents(e,t,i){return Qa(this,void 0,void 0,function*(){const n=yield this.send("GET",this.addEventParameters("/events",e,t,i),null,!0,!0);return new Z.s(n,Xa)})}getEventsCipher(e,t,i,n){return Qa(this,void 0,void 0,function*(){const r=yield this.send("GET",this.addEventParameters("/ciphers/"+e+"/events",t,i,n),null,!0,!0);return new Z.s(r,Xa)})}getEventsSecret(e,t,i,n,r){return Qa(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organization/"+e+"/secrets/"+t+"/events",i,n,r),null,!0,!0);return new Z.s(s,Xa)})}getEventsServiceAccount(e,t,i,n,r){return Qa(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organization/"+e+"/service-account/"+t+"/events",i,n,r),null,!0,!0);return new Z.s(s,Xa)})}getEventsProject(e,t,i,n,r){return Qa(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organization/"+e+"/projects/"+t+"/events",i,n,r),null,!0,!0);return new Z.s(s,Xa)})}getEventsOrganization(e,t,i,n){return Qa(this,void 0,void 0,function*(){const r=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/events",t,i,n),null,!0,!0);return new Z.s(r,Xa)})}getEventsOrganizationUser(e,t,i,n,r){return Qa(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/organizations/"+e+"/users/"+t+"/events",i,n,r),null,!0,!0);return new Z.s(s,Xa)})}getEventsProvider(e,t,i,n){return Qa(this,void 0,void 0,function*(){const r=yield this.send("GET",this.addEventParameters("/providers/"+e+"/events",t,i,n),null,!0,!0);return new Z.s(r,Xa)})}getEventsProviderUser(e,t,i,n,r){return Qa(this,void 0,void 0,function*(){const s=yield this.send("GET",this.addEventParameters("/providers/"+e+"/users/"+t+"/events",i,n,r),null,!0,!0);return new Z.s(s,Xa)})}postEventsCollect(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.tokenService.getAccessToken(t),n=new Headers({"Device-Type":this.deviceType,Authorization:"Bearer "+i,"Content-Type":"application/json; charset=utf-8"});null!=this.customUserAgent&&n.set("User-Agent",this.customUserAgent);const r=yield(0,fe._)(null==t?this.environmentService.environment$:this.environmentService.getEnvironment$(t));if(200!==(yield this.fetch(this.httpOperations.createRequest(r.getEventsUrl()+"/collect",{cache:"no-store",credentials:yield this.getCredentials(r),method:"POST",body:JSON.stringify(e),headers:n}))).status)return Promise.reject("Event post failed.")})}getUserPublicKey(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/users/"+e+"/public-key",null,!0,!0);return new Ya(t)})}postBitPayInvoice(e){return Qa(this,void 0,void 0,function*(){return yield this.send("POST","/bitpay-invoice",e,!0,!0)})}postSetupPayment(){return Qa(this,void 0,void 0,function*(){return yield this.send("POST","/setup-payment",null,!0,!0)})}getMasterKeyFromKeyConnector(e){return Qa(this,void 0,void 0,function*(){const t=yield this.getActiveUser();if(null==t)throw new Error("No active user, cannot get master key from key connector.");const i=yield this.getActiveBearerToken(t),n=yield this.fetch(this.httpOperations.createRequest(e+"/user-keys",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+i})}));if(200!==n.status){const e=yield this.handleError(n,!1,!0);return Promise.reject(e)}return new za(yield n.json())})}postUserKeyToKeyConnector(e,t){return Qa(this,void 0,void 0,function*(){const i=yield this.getActiveUser();if(null==i)throw new Error("No active user, cannot post key to key connector.");const n=yield this.getActiveBearerToken(i),r=yield this.fetch(this.httpOperations.createRequest(e+"/user-keys",{cache:"no-store",method:"POST",headers:new Headers({Accept:"application/json",Authorization:"Bearer "+n,"Content-Type":"application/json; charset=utf-8"}),body:JSON.stringify(t)}));if(200!==r.status){const e=yield this.handleError(r,!1,!0);return Promise.reject(e)}})}getKeyConnectorAlive(e){return Qa(this,void 0,void 0,function*(){const t=yield this.fetch(this.httpOperations.createRequest(e+"/alive",{cache:"no-store",method:"GET",headers:new Headers({Accept:"application/json","Content-Type":"application/json; charset=utf-8"})}));if(200!==t.status){const e=yield this.handleError(t,!1,!0);return Promise.reject(e)}})}getActiveBearerToken(e){return Qa(this,void 0,void 0,function*(){let t=yield this.tokenService.getAccessToken(e);return(yield this.tokenService.tokenNeedsRefresh(e))&&(t=yield this.refreshToken(e)),t})}fetch(e){return Qa(this,void 0,void 0,function*(){if(!e.url.startsWith("https://")&&!this.platformUtilsService.isDev())throw new Tt;"GET"===e.method&&(e.headers.set("Cache-Control","no-store"),e.headers.set("Pragma","no-cache")),e.headers.set("Bitwarden-Client-Name",this.platformUtilsService.getClientType()),e.headers.set("Bitwarden-Client-Version",yield this.platformUtilsService.getApplicationVersionNumber());const t=yield this.platformUtilsService.packageType();return null!=t&&e.headers.set("Bitwarden-Package-Type",t),this.nativeFetch(e)})}nativeFetch(e){return fetch(e)}preValidateSso(e){return Qa(this,void 0,void 0,function*(){if(null==e||""===e)throw new Error("Organization Identifier was not provided.");const t=new Headers({Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&t.set("User-Agent",this.customUserAgent);const i=yield(0,fe._)(this.environmentService.environment$),n=`/sso/prevalidate?domainHint=${encodeURIComponent(e)}`,r=yield this.fetch(this.httpOperations.createRequest(i.getIdentityUrl()+n,{cache:"no-store",credentials:yield this.getCredentials(i),headers:t,method:"GET"}));if(200===r.status){const e=yield r.json();return new Ka(e)}{const e=yield this.handleError(r,!1,!0);return Promise.reject(e)}})}postCreateSponsorship(e,t){return Qa(this,void 0,void 0,function*(){return yield this.send("POST","/organization/sponsorship/"+(this.platformUtilsService.isSelfHost()?"self-hosted/":"")+e+"/families-for-enterprise",t,!0,!1)})}getSponsorshipSyncStatus(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("GET","/organization/sponsorship/"+e+"/sync-status",null,!0,!0);return new Fa(t)})}deleteRemoveSponsorship(e){return Qa(this,void 0,void 0,function*(){return yield this.send("DELETE","/organization/sponsorship/sponsored/"+e,null,!0,!1)})}postPreValidateSponsorshipToken(e){return Qa(this,void 0,void 0,function*(){const t=yield this.send("POST","/organization/sponsorship/validate-token?sponsorshipToken="+encodeURIComponent(e),null,!0,!0);return new Ra(t)})}postRedeemSponsorship(e,t){return Qa(this,void 0,void 0,function*(){return yield this.send("POST","/organization/sponsorship/redeem?sponsorshipToken="+encodeURIComponent(e),t,!0,!1)})}refreshToken(e){return void 0===this.refreshTokenPromise[e]&&(this.refreshTokenPromise[e]=this.internalRefreshToken(e),this.refreshTokenPromise[e].finally(()=>{delete this.refreshTokenPromise[e]})),this.refreshTokenPromise[e]}internalRefreshToken(e){return Qa(this,void 0,void 0,function*(){const t=yield this.tokenService.getRefreshToken(e);if(null!=t&&""!==t)return yield this.refreshAccessToken(e);const i=yield this.tokenService.getClientId(e),n=yield this.tokenService.getClientSecret(e);if(!Se.A.isNullOrWhitespace(i)&&!Se.A.isNullOrWhitespace(n))return yield this.refreshApiToken(e);throw this.refreshAccessTokenErrorCallback(),new Error("Cannot refresh access token, no refresh token or api keys are stored.")})}refreshAccessToken(e){return Qa(this,void 0,void 0,function*(){const t=yield this.tokenService.getRefreshToken(e);if(null==t||""===t)throw new Error;const i=new Headers({"Content-Type":"application/x-www-form-urlencoded; charset=utf-8",Accept:"application/json","Device-Type":this.deviceType});null!=this.customUserAgent&&i.set("User-Agent",this.customUserAgent);const n=yield(0,fe._)(this.environmentService.getEnvironment$(e)),r=yield this.tokenService.decodeAccessToken(e),s=yield this.fetch(this.httpOperations.createRequest(n.getIdentityUrl()+"/connect/token",{body:this.qsStringify({grant_type:"refresh_token",client_id:r.client_id,refresh_token:t}),cache:"no-store",credentials:yield this.getCredentials(n),headers:i,method:"POST"}));if(200===s.status){const e=yield s.json(),t=new Va.L(e),i=(yield this.tokenService.decodeAccessToken(t.accessToken)).sub,n=yield(0,fe._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(i)),r=yield(0,fe._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(i));return(yield this.tokenService.setTokens(t.accessToken,n,r,t.refreshToken)).accessToken}{const e=yield this.handleError(s,!0,!0);return Promise.reject(e)}})}refreshApiToken(e){return Qa(this,void 0,void 0,function*(){const t=yield this.tokenService.getClientId(e),i=yield this.tokenService.getClientSecret(e),n=yield this.appIdService.getAppId(),r=new Oa.C(n,this.platformUtilsService),s=new Ua.i(t,i,new Ma.i,r),o=yield this.postIdentityToken(s);if(!(o instanceof Va.L))throw new Error("Invalid response received when refreshing api token");const a=yield this.tokenService.decodeAccessToken(o.accessToken);if(a.sub!==e)throw new Error(`Token was supposed to be refreshed for ${e} but the token we got back was for ${a.sub}`);const l=yield(0,fe._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(e)),c=yield(0,fe._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(e));return yield this.tokenService.setAccessToken(o.accessToken,l,c)})}send(e,t,i,n,r,s,o){return Qa(this,void 0,void 0,function*(){if(null==n)throw new Error("A user id was given but it was null, cannot complete API request.");let a=null;"boolean"==typeof n&&n?a=yield this.getActiveUser():"string"==typeof n&&(a=n);const l=yield(0,fe._)(null==a?this.environmentService.environment$:this.environmentService.getEnvironment$(a));s=Se.A.isNullOrWhitespace(s)?l.getApiUrl():s;const c=t.split("?"),d=s+c[0]+(c.length>1?`?${c[1]}`:"");if(Se.A.invalidUrlPatterns(d))throw new Error("The request URL contains dangerous patterns.");const u=s+Se.A.normalizePath(c[0])+(c.length>1?`?${c[1]}`:""),[h,p]=yield this.buildHeadersAndBody(a,r,i,o),m={cache:"no-store",credentials:yield this.getCredentials(l),method:e};m.headers=h,m.body=p;const v=yield this.fetch(this.httpOperations.createRequest(u,m)),f=v.headers.get("content-type"),g=null!=f&&-1!==f.indexOf("application/json"),y=null!=f&&-1!==f.indexOf("text/csv");if(r&&200===v.status&&g){return yield v.json()}if(r&&200===v.status&&y)return yield v.text();if(200!==v.status&&204!==v.status){const e=yield this.handleError(v,!1,null!=a);return Promise.reject(e)}})}buildHeadersAndBody(e,t,i,n){return Qa(this,void 0,void 0,function*(){let r=null;const s=new Headers({"Device-Type":this.deviceType});if(ks("prereleaseBuild")&&s.set("Is-Prerelease","1"),null!=this.customUserAgent&&s.set("User-Agent",this.customUserAgent),t&&s.set("Accept","application/json"),null!=n&&n(s),null!=e){const t=yield this.getActiveBearerToken(e);s.set("Authorization","Bearer "+t)}else{const e=yield this.appIdService.getAppId();s.set("Device-Identifier",e)}return null!=i&&("string"==typeof i?(r=i,s.set("Content-Type","application/x-www-form-urlencoded; charset=utf-8")):"object"==typeof i&&(i instanceof FormData?r=i:(s.set("Content-Type","application/json; charset=utf-8"),r=JSON.stringify(i)))),[s,r]})}handleError(e,t,i){return Qa(this,void 0,void 0,function*(){let n=null;return this.isJsonResponse(e)?n=yield e.json():this.isTextPlainResponse(e)&&(n={Message:yield e.text()}),i&&(401===e.status||403===e.status||t&&400===e.status&&null!=n&&"invalid_grant"===n.error)&&(yield this.logoutCallback("invalidGrantError")),new we._(n,e.status,t)})}qsStringify(e){return Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&")}getActiveUser(){return Qa(this,void 0,void 0,function*(){return yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id)))})}getCredentials(e){return Qa(this,void 0,void 0,function*(){if(this.platformUtilsService.getClientType()!==be.sK.Web||e.hasBaseUrl())return"include"})}addEventParameters(e,t,i,n){return null!=t&&(e+="?start="+t),null!=i&&(e+=e.indexOf("?")>-1?"&":"?",e+="end="+i),null!=n&&(e+=e.indexOf("?")>-1?"&":"?",e+="continuationToken="+n),e}isJsonResponse(e){const t=e.headers.get("content-type");return null!=t&&t.indexOf("application/json")>-1}isTextPlainResponse(e){const t=e.headers.get("content-type");return null!=t&&t.indexOf("text/plain")>-1}}el.NEW_DEVICE_VERIFICATION_REQUIRED_MESSAGE="new device verification required";var tl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var il=i(88507);class nl{static fromJSON(e){return Object.assign(new nl,e)}}const rl=D.Ok.array(D.Qb,"events",{deserializer:e=>nl.fromJSON(e),clearOn:["logout"]});var sl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ol{}var al=i(1580),ll=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var cl=i(63457),dl=i(17989),ul=i(1758),hl=i(23385),pl=i(95668),ml=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class vl extends dl.A{constructor(e){if(super(),null!=e)switch(this.buildDomainModel(this,e,{id:null,accessId:null,name:null,notes:null,key:null},["id","accessId"]),this.type=e.type,this.maxAccessCount=e.maxAccessCount,this.accessCount=e.accessCount,this.password=e.password,this.emails=e.emails,this.disabled=e.disabled,this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null,this.deletionDate=null!=e.deletionDate?new Date(e.deletionDate):null,this.expirationDate=null!=e.expirationDate?new Date(e.expirationDate):null,this.hideEmail=e.hideEmail,this.type){case pa.N.Text:this.text=new pl.u(e.text);break;case pa.N.File:this.file=new hl.l(e.file)}}decrypt(e){return ml(this,void 0,void 0,function*(){if(!e)throw new Error("User ID must not be null or undefined");const t=new ul.u(this),i=Se.A.getContainerService().getKeyService(),n=Se.A.getContainerService().getEncryptService(),r=yield(0,fe._)(i.userKey$(e));switch(t.key=yield n.decryptBytes(this.key,r),t.cryptoKey=yield i.makeSendKey(t.key),yield this.decryptObj(this,t,["name","notes"],t.cryptoKey),this.type){case pa.N.File:t.file=yield this.file.decrypt(t.cryptoKey);break;case pa.N.Text:t.text=yield this.text.decrypt(t.cryptoKey)}return t})}static fromJSON(e){if(null==e)return null;const t=null==e.revisionDate?null:new Date(e.revisionDate),i=null==e.expirationDate?null:new Date(e.expirationDate),n=null==e.deletionDate?null:new Date(e.deletionDate);return Object.assign(new vl,e,{key:zt.k.fromJSON(e.key),name:zt.k.fromJSON(e.name),notes:zt.k.fromJSON(e.notes),text:pl.u.fromJSON(e.text),file:hl.l.fromJSON(e.file),revisionDate:t,expirationDate:i,deletionDate:n})}}var fl=i(41347),gl=i(62046);class yl{constructor(e,t){switch(this.type=e.type,this.fileLength=t,this.name=e.name?e.name.encryptedString:null,this.notes=e.notes?e.notes.encryptedString:null,this.maxAccessCount=e.maxAccessCount,this.expirationDate=null!=e.expirationDate?e.expirationDate.toISOString():null,this.deletionDate=null!=e.deletionDate?e.deletionDate.toISOString():null,this.key=null!=e.key?e.key.encryptedString:null,this.password=e.password,this.emails=e.emails,this.disabled=e.disabled,this.hideEmail=e.hideEmail,this.type){case pa.N.Text:this.text=new gl.Y,this.text.text=null!=e.text.text?e.text.text.encryptedString:null,this.text.hidden=e.text.hidden;break;case pa.N.File:this.file=new fl.h,this.file.fileName=null!=e.file.fileName?e.file.fileName.encryptedString:null}}}class bl extends j.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name");const t=this.getResponseProperty("Text");null!=t&&(this.text=new gl.Y(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new fl.h(i)),this.expirationDate=this.getResponseProperty("ExpirationDate"),this.creatorIdentifier=this.getResponseProperty("CreatorIdentifier")}}class wl extends j.r{constructor(e){super(e),this.id=null,this.url=null,this.id=this.getResponseProperty("Id"),this.url=this.getResponseProperty("Url")}}var Sl=i(54306);class Il extends j.r{constructor(e){super(e),this.url=null,this.fileUploadType=this.getResponseProperty("FileUploadType");const t=this.getResponseProperty("SendResponse");this.sendResponse=null==t?null:new Sl.o(t),this.url=this.getResponseProperty("Url")}}var kl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Cl=i(74867);const Tl=D.Ok.record(D.bj,"sendUserEncrypted",{deserializer:e=>e,clearOn:["logout"]}),Fl=new D.Ok(D.$g,"sendUserDecrypted",{deserializer:e=>e,clearOn:["lock"]});var Rl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Pl{}class xl extends yl{constructor(e){super(e),this.id=e.id}}var $l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var El=i(60954),Al=i(92411),Dl=i(56634),Ol=i(97212),Ml=i(5556);class Ul{}var Gl=i(41103),jl=i(74526),Nl=i(54351),Vl=i(63098);var Bl=i(97432);const zl=D.Ok.array(D.i9,"notifications",{deserializer:e=>ut.fromJSON(e),clearOn:["logout","lock"]});var Ll=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Kl=(0,E.T)(e=>Object.entries(null!=e?e:{}).filter(([,e])=>e>=Dt.J.Locked).map(([e])=>e));var ql=i(11979),_l=i(31442),Xl=i(7919),Yl=i(5571),Hl=i(19488),Wl=i(84454),Jl=i(77720),Zl=i(32072),Ql=i(21925),ec=i(73386),tc=i(50751),ic=i(47328);class nc{constructor(e){this.comparator=e,this.sortedCiphersByUrl=new Map,this.timeouts=new Map}isCached(e){return this.sortedCiphersByUrl.has(e)}addCiphers(e,t){t.sort(this.comparator),this.sortedCiphersByUrl.set(e,new rc(t)),this.resetTimer(e)}getLastUsed(e){return this.resetTimer(e),this.isCached(e)?this.sortedCiphersByUrl.get(e).getLastUsed():null}getLastLaunched(e){return this.isCached(e)?this.sortedCiphersByUrl.get(e).getLastLaunched():null}getNext(e){return this.resetTimer(e),this.isCached(e)?this.sortedCiphersByUrl.get(e).getNext():null}updateLastUsedIndex(e){this.isCached(e)&&this.sortedCiphersByUrl.get(e).updateLastUsedIndex()}clear(){this.sortedCiphersByUrl.clear(),this.timeouts.clear()}resetTimer(e){clearTimeout(this.timeouts.get(e)),this.timeouts.set(e,setTimeout(()=>{this.sortedCiphersByUrl.delete(e),this.timeouts.delete(e)},3e3))}}class rc{constructor(e){this.ciphers=e,this.lastUsedIndex=-1}getLastUsed(){return this.lastUsedIndex=Math.max(this.lastUsedIndex,0),this.ciphers[this.lastUsedIndex]}getLastLaunched(){return this.ciphers.filter(e=>{var t;return null===(t=e.localData)||void 0===t?void 0:t.lastLaunched}).sort((e,t)=>t.localData.lastLaunched.valueOf()-e.localData.lastLaunched.valueOf())[0]}getNextIndex(){return(this.lastUsedIndex+1)%this.ciphers.length}getNext(){return this.ciphers[this.getNextIndex()]}updateLastUsedIndex(){this.lastUsedIndex=this.getNextIndex()}}var sc=i(67756),oc=i(23080);class ac{constructor(e,t){this.ids=null==e?[]:e,this.folderId=t}}class lc{constructor(e,t){this.ids=null==e?[]:e,this.organizationId=t}}var cc=i(45113);class dc extends cc.P{constructor({cipher:e,encryptedFor:t}){super({cipher:e,encryptedFor:t}),this.id=e.id}}class uc{constructor(e,t,i){this.encryptedFor=i,null!=e&&(this.ciphers=[],e.forEach(e=>{this.ciphers.push(new dc({cipher:e,encryptedFor:i}))})),this.collectionIds=t}}class hc{constructor(e,t,i,n=!1){this.organizationId=e,this.cipherIds=t,this.collectionIds=i,this.removeCollections=n}}class pc{constructor(e){this.collectionIds=null==e?[]:e}}class mc{constructor({cipher:e,encryptedFor:t}){this.cipher=new cc.P({cipher:e,encryptedFor:t}),this.collectionIds=e.collectionIds}}class vc{constructor(e){this.folderId=e.folderId,this.favorite=e.favorite}}class fc{constructor({cipher:e,encryptedFor:t}){this.cipher=new cc.P({cipher:e,encryptedFor:t}),this.collectionIds=e.collectionIds}}var gc=i(12022),yc=i(61325),bc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const wc=new io.SemVer("2024.2.0");class Sc{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p){this.keyService=e,this.domainSettingsService=t,this.apiService=i,this.i18nService=n,this.searchService=r,this.autofillSettingsService=s,this.encryptService=o,this.cipherFileUploadService=a,this.configService=l,this.stateProvider=c,this.accountService=d,this.logService=u,this.cipherEncryptionService=h,this.messageSender=p,this.sortedCiphersCache=new nc(this.sortCiphersByLastUsed),this.clearCipherViewsForUser$=new m.B,this.cipherListViews$=(0,Bl.j)(e=>{let t;return this.configService.getFeatureFlag$(dn.TO.PM22134SdkCipherListView).pipe((0,ge.n)(i=>i?(0,$t.z)([this.encryptedCiphersState(e).state$,this.localData$(e),this.keyService.cipherDecryptionKeys$(e,!0)]).pipe((0,dr.p)(([e,t,i])=>null!=e&&null!=i),(0,E.T)(([e,t])=>Object.values(e).map(e=>new Zo.o(e,null==t?void 0:t[e.id]))),(0,Js.M)(()=>{t=performance.now()}),(0,ge.n)(t=>bc(this,void 0,void 0,function*(){const[i,n]=yield this.decryptCiphersWithSdk(t,e,!1);return this.setFailedDecryptedCiphers(n,e),this.getAllDecrypted(e),i})),(0,Js.M)(e=>{this.logService.measure(t,"Vault","CipherService","listView decrypt complete",[["Items",e.length]])})):this.cipherViews$(e)))}),this.cipherViews$=(0,Bl.j)(e=>(0,$t.z)([this.encryptedCiphersState(e).state$,this.localData$(e),this.keyService.cipherDecryptionKeys$(e)]).pipe((0,dr.p)(([e,t,i])=>null!=e&&null!=i),(0,ge.n)(()=>this.getAllDecrypted(e)),(0,Js.M)(()=>{this.messageSender.send("updateOverlayCiphers")})),this.clearCipherViewsForUser$),this.failedToDecryptCiphers$=(0,Bl.j)(e=>this.failedToDecryptCiphersState(e).state$.pipe((0,dr.p)(e=>null!=e)),this.clearCipherViewsForUser$)}localData$(e){return this.localDataState(e).state$.pipe((0,E.T)(e=>null!=e?e:{}))}ciphers$(e){return this.encryptedCiphersState(e).state$.pipe((0,E.T)(e=>null!=e?e:{}))}addEditCipherInfo$(e){return this.addEditCipherInfoState(e).state$}setDecryptedCipherCache(e,t){return bc(this,void 0,void 0,function*(){null!=e&&0===e.length||(yield this.setDecryptedCiphers(e,t)),null!=this.searchService&&(null==e?yield this.searchService.clearIndex(t):this.searchService.indexCiphers(t,e))})}setFailedDecryptedCiphers(e,t){return bc(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Ho,e,t)})}setDecryptedCiphers(e,t){return bc(this,void 0,void 0,function*(){const i={};null==e||e.forEach(e=>{i[e.id]=e}),yield this.stateProvider.setUserState(Yo,i,t)})}clearCache(e){return bc(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.stateProvider.activeUserId$);null!=e||(e=t),yield this.clearDecryptedCiphersState(e),this.clearCipherViewsForUser$.next(e)})}adjustCipherHistory(e,t,i){return bc(this,void 0,void 0,function*(){null!=e.id&&(null==i&&(i=yield this.get(e.id,t)),null!=i&&(yield this.updateModelfromExistingCipher(e,i,t)),this.adjustPasswordHistoryLength(e))})}encrypt(e,t,i,n){return bc(this,arguments,void 0,function*(e,t,i,n,r=null){var s;yield this.adjustCipherHistory(e,t,r);if((yield this.configService.getFeatureFlag(dn.TO.PM22136_SdkCipherEncryption))&&null==i&&null==n)return yield this.cipherEncryptionService.encrypt(e,t);const o=new Zo.o;if(o.id=e.id,o.folderId=e.folderId,o.favorite=e.favorite,o.organizationId=e.organizationId,o.type=e.type,o.collectionIds=e.collectionIds,o.creationDate=e.creationDate,o.revisionDate=e.revisionDate,o.archivedDate=e.archivedDate,o.reprompt=e.reprompt,o.edit=e.edit,(e.viewPassword||(null==r?void 0:r.key))&&(yield this.getCipherKeyEncryptionEnabled())){o.key=null!==(s=null==r?void 0:r.key)&&void 0!==s?s:null;const a=yield this.getKeyForCipherKeyDecryption(o,t);return i||(i=a),n||(n=a),{cipher:yield this.encryptCipherWithCipherKey(e,o,i,n),encryptedFor:t}}return i||(i=yield this.getKeyForCipherKeyDecryption(o,t)),o.key=null,{cipher:yield this.encryptCipher(e,o,i),encryptedFor:t}})}encryptAttachments(e,t){return bc(this,void 0,void 0,function*(){if(null==e||0===e.length)return null;const i=[],n=[];return e.forEach(e=>bc(this,void 0,void 0,function*(){const r=new Yl.o;r.id=e.id,r.size=e.size,r.sizeName=e.sizeName,r.url=e.url;const s=this.encryptObjProperty(e,r,{fileName:null},t).then(()=>bc(this,void 0,void 0,function*(){null!=e.key&&(r.key=yield this.encryptService.wrapSymmetricKey(e.key,t)),n.push(r)}));i.push(s)})),yield Promise.all(i),n})}encryptFields(e,t){return bc(this,void 0,void 0,function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce((e,r)=>bc(this,void 0,void 0,function*(){yield e;const s=yield i.encryptField(r,t);n.push(s)}),Promise.resolve()),n})}encryptField(e,t){return bc(this,void 0,void 0,function*(){const i=new Jl.D;return i.type=e.type,i.linkedId=e.linkedId,e.type===_l.PU.Boolean&&"true"!==e.value&&(e.value="false"),yield this.encryptObjProperty(e,i,{name:null,value:null},t),i})}encryptPasswordHistories(e,t){return bc(this,void 0,void 0,function*(){if(!e||!e.length)return null;const i=this,n=[];return yield e.reduce((e,r)=>bc(this,void 0,void 0,function*(){yield e;const s=yield i.encryptPasswordHistory(r,t);n.push(s)}),Promise.resolve()),n})}encryptPasswordHistory(e,t){return bc(this,void 0,void 0,function*(){const i=new tc._;return i.lastUsedDate=e.lastUsedDate,yield this.encryptObjProperty(e,i,{password:null},t),i})}get(e,t){return bc(this,void 0,void 0,function*(){const i=yield(0,fe._)(this.ciphers$(t));if(null==i||!i.hasOwnProperty(e))return null;const n=yield(0,fe._)(this.localData$(t)),r=e;return new Zo.o(i[r],n?n[r]:null)})}getAll(e){return bc(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.localData$(e)),i=yield(0,fe._)(this.ciphers$(e)),n=[];for(const e in i)if(i.hasOwnProperty(e)){const r=e;n.push(new Zo.o(i[r],t?t[r]:null))}return n})}getAllDecrypted(e){return bc(this,void 0,void 0,function*(){const t=yield this.getDecryptedCiphers(e);if(null!=t&&0!==t.length)return yield this.reindexCiphers(e),t;const i=yield this.decryptCiphers(yield this.getAll(e),e);if(null==i)return[];const[n,r]=i;return yield this.setDecryptedCipherCache(n,e),yield this.setFailedDecryptedCiphers(r,e),n})}getDecryptedCiphers(e){return bc(this,void 0,void 0,function*(){return Object.values(yield(0,fe._)(this.decryptedCiphersState(e).state$.pipe((0,E.T)(e=>null!=e?e:{}))))})}decryptCiphers(e,t){return bc(this,void 0,void 0,function*(){if(yield this.configService.getFeatureFlag(dn.TO.PM19941MigrateCipherDomainToSdk)){const i=performance.now(),n=yield this.decryptCiphersWithSdk(e,t,!0);return this.logService.measure(i,"Vault","CipherService","decrypt complete",[["Items",e.length]]),n}const i=yield(0,fe._)(this.keyService.cipherDecryptionKeys$(t));if(null==i||null==i.userKey&&0===Object.keys(i.orgKeys).length)return null;const n=e.reduce((e,t)=>{var i,n;return null!==(i=e[n=t.organizationId])&&void 0!==i||(e[n]=[]),e[t.organizationId].push(t),e},{}),r=performance.now(),s=(yield Promise.all(Object.entries(n).map(e=>bc(this,[e],void 0,function*([e,t]){var n;const r=null!==(n=i.orgKeys[e])&&void 0!==n?n:i.userKey;return yield Promise.all(t.map(e=>bc(this,void 0,void 0,function*(){return yield e.decrypt(r)})))})))).flat().sort(this.getLocaleSortingFunction());return this.logService.measure(r,"Vault","CipherService","decrypt complete",[["Items",e.length]]),s.reduce((e,t)=>(t.decryptionFailure?e[1].push(t):e[0].push(t),e),[[],[]])})}decrypt(e,t){return bc(this,void 0,void 0,function*(){if(yield this.configService.getFeatureFlag(dn.TO.PM19941MigrateCipherDomainToSdk))return yield this.cipherEncryptionService.decrypt(e,t);{const i=yield this.getKeyForCipherKeyDecryption(e,t);return yield e.decrypt(i)}})}reindexCiphers(e){return bc(this,void 0,void 0,function*(){var t;null!=this.searchService&&(null!==(t=yield(0,fe._)(this.searchService.indexedEntityId$(e)))&&void 0!==t?t:e)!==e&&(yield this.searchService.indexCiphers(e,yield this.getDecryptedCiphers(e),e))})}getAllDecryptedForGrouping(e,t){return bc(this,arguments,void 0,function*(e,t,i=!0){return(yield this.getAllDecrypted(t)).filter(t=>!t.isDeleted&&(!(!i||t.folderId!==e)||!i&&null!=t.collectionIds&&t.collectionIds.indexOf(e)>-1))})}getAllDecryptedForUrl(e,t,i){return bc(this,arguments,void 0,function*(e,t,i,n=null,r){return yield(0,fe._)(this.cipherViews$(t).pipe((0,dr.p)(e=>null!=e),(0,ge.n)(t=>bc(this,void 0,void 0,function*(){return yield this.filterCiphersForUrl(t,e,i,n,r)}))))})}getAllDecryptedForIds(e,t){return bc(this,void 0,void 0,function*(){return(0,fe._)(this.cipherViews$(e).pipe((0,dr.p)(e=>null!=e),(0,E.T)(e=>e.filter(e=>t.includes(e.id)))))})}filterCiphersForUrl(e,t,i){return bc(this,arguments,void 0,function*(e,t,i,n=null,r){if(null==t&&null==i)return[];const s=yield(0,fe._)(this.domainSettingsService.getUrlEquivalentDomains(t));null!=n||(n=yield(0,fe._)(this.domainSettingsService.resolvedDefaultUriMatchStrategy$));const o=yield this.configService.getFeatureFlag(dn.TO.PM19148_InnovationArchive);return e.filter(e=>{const a=yc.n.getType(e),l=null!==yc.n.getLogin(e);return!yc.n.isDeleted(e)&&((!o||!yc.n.isArchived(e))&&(!(!Array.isArray(i)||!i.includes(a)||l)||!!l&&yc.n.matchesUri(e,t,s,n,r)))})})}getAllDecryptedCiphersOfType(e,t){return bc(this,void 0,void 0,function*(){const i=yield this.getAllDecrypted(t),n=yield this.configService.getFeatureFlag(dn.TO.PM19148_InnovationArchive);return i.filter(t=>null==t.deletedDate&&(!n||!t.isArchived)&&e.includes(t.type)).sort((e,t)=>this.sortCiphersByLastUsedThenName(e,t))})}getAllFromApiForOrganization(e,t){return bc(this,void 0,void 0,function*(){const i=yield this.apiService.getCiphersOrganization(e,t);return yield this.decryptOrganizationCiphersResponse(i,e)})}getManyFromApiForOrganization(e){return bc(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/ciphers/organization-details/assigned?organizationId="+e,null,!0,!0),i=new Z.s(t,Ha.N);return this.decryptOrganizationCiphersResponse(i,e)})}decryptOrganizationCiphersResponse(e,t){return bc(this,void 0,void 0,function*(){if(null==(null==e?void 0:e.data)||e.data.length<1)return[];const i=e.data.map(e=>new Zo.o(new qo.A(e))),n=yield this.keyService.getOrgKey(t),r=yield Promise.all(i.map(e=>bc(this,void 0,void 0,function*(){return yield e.decrypt(n)})));return r.sort(this.getLocaleSortingFunction()),r})}getLastUsedForUrl(e,t){return bc(this,arguments,void 0,function*(e,t,i=!1){return this.getCipherForUrl(e,t,!0,!1,i)})}getLastLaunchedForUrl(e,t){return bc(this,arguments,void 0,function*(e,t,i=!1){return this.getCipherForUrl(e,t,!1,!0,i)})}getNextCipherForUrl(e,t){return bc(this,void 0,void 0,function*(){return this.getCipherForUrl(e,t,!1,!1,!1)})}getNextCardCipher(e){return bc(this,void 0,void 0,function*(){const t="cardCiphers";if(!this.sortedCiphersCache.isCached(t)){const i=yield this.getAllDecryptedCiphersOfType([Xl.gC.Card],e);if(!(null==i?void 0:i.length))return null;this.sortedCiphersCache.addCiphers(t,i)}return this.sortedCiphersCache.getNext(t)})}getNextIdentityCipher(e){return bc(this,void 0,void 0,function*(){const t="identityCiphers";if(!this.sortedCiphersCache.isCached(t)){const i=yield this.getAllDecryptedCiphersOfType([Xl.gC.Identity],e);if(!(null==i?void 0:i.length))return null;this.sortedCiphersCache.addCiphers(t,i)}return this.sortedCiphersCache.getNext(t)})}updateLastUsedIndexForUrl(e){this.sortedCiphersCache.updateLastUsedIndex(e)}updateLastUsedDate(e,t){return bc(this,void 0,void 0,function*(){let i=yield(0,fe._)(this.localData$(t));i||(i={});const n=e;i[n]?i[n].lastUsedDate=(new Date).getTime():i[n]={lastUsedDate:(new Date).getTime()},yield this.localDataState(t).update(()=>i);const r=yield this.getDecryptedCiphers(t);if(r){for(let t=0;t<r.length;t++){const n=r[t];if(n.id===e){n.localData=i[e];break}}yield this.setDecryptedCiphers(r,t)}})}updateLastLaunchedDate(e,t){return bc(this,void 0,void 0,function*(){let i=yield(0,fe._)(this.localData$(t));i||(i={});const n=(new Date).getTime();i[e]={lastLaunched:n,lastUsedDate:n},yield this.localDataState(t).update(()=>i);const r=yield this.getDecryptedCiphers(t);if(r){for(let t=0;t<r.length;t++){const n=r[t];if(n.id===e){n.localData=i[e];break}}yield this.setDecryptedCiphers(r,t)}})}saveNeverDomain(e){return bc(this,void 0,void 0,function*(){if(null==e)return;let t=yield(0,fe._)(this.domainSettingsService.neverDomains$);t||(t={}),t[e]=null,yield this.domainSettingsService.setNeverDomains(t)})}createWithServer(e,t){return bc(this,arguments,void 0,function*({cipher:e,encryptedFor:t},i){let n;if(i&&null!=e.organizationId){const i=new mc({cipher:e,encryptedFor:t});n=yield this.apiService.postCipherAdmin(i);const r=new qo.A(n,e.collectionIds);return new Zo.o(r)}if(null!=e.collectionIds&&e.collectionIds.length>0){const i=new mc({cipher:e,encryptedFor:t});n=yield this.apiService.postCipherCreate(i)}else{const i=new cc.P({cipher:e,encryptedFor:t});n=yield this.apiService.postCipher(i)}e.id=n.id;const r=new qo.A(n,e.collectionIds),s=yield this.upsert(r);return new Zo.o(s[e.id])})}updateWithServer(e,t){return bc(this,arguments,void 0,function*({cipher:e,encryptedFor:t},i){let n;if(i){const i=new cc.P({cipher:e,encryptedFor:t});n=yield this.apiService.putCipherAdmin(e.id,i);const r=new qo.A(n,e.collectionIds);return new Zo.o(r,e.localData)}if(e.edit){const i=new cc.P({cipher:e,encryptedFor:t});n=yield this.apiService.putCipher(e.id,i)}else{const t=new vc(e);n=yield this.apiService.putPartialCipher(e.id,t)}const r=new qo.A(n,e.collectionIds),s=yield this.upsert(r);return new Zo.o(s[e.id],e.localData)})}shareWithServer(e,t,i,n,r){return bc(this,void 0,void 0,function*(){const s=yield this.configService.getFeatureFlag(dn.TO.PM22136_SdkCipherEncryption);let o;if(yield this.adjustCipherHistory(e,n,r),s){if(null!=e.organizationId)throw new Error("Cipher is already associated with an organization.");o=yield this.cipherEncryptionService.moveToOrganization(e,t,n),o.cipher.collectionIds=i}else{const r=[];null!=e.attachments&&e.attachments.forEach(i=>{null==i.key&&r.push(this.shareAttachmentWithServer(i,e.id,t,e.revisionDate))}),yield Promise.all(r),e.organizationId=t,e.collectionIds=i,o=yield this.encryptSharedCipher(e,n)}const a=new fc(o),l=yield this.apiService.putShareCipher(e.id,a),c=new qo.A(l,i);return yield this.upsert(c),new Zo.o(c,e.localData)})}shareManyWithServer(e,t,i,n){return bc(this,void 0,void 0,function*(){const r=yield this.configService.getFeatureFlag(dn.TO.PM22136_SdkCipherEncryption),s=[],o=[];for(const c of e)if(r){if(null!=c.organizationId)throw new Error("Cipher is already associated with an organization.");s.push(this.cipherEncryptionService.moveToOrganization(c,t,n).then(e=>{e.cipher.collectionIds=i,o.push(e.cipher)}))}else c.organizationId=t,c.collectionIds=i,s.push(this.encryptSharedCipher(c,n).then(e=>{o.push(e.cipher)}));yield Promise.all(s);const a=new uc(o,i,n);try{const e=yield this.apiService.putShareCiphers(a),t=new Map(e.data.map(e=>[e.id,e]));o.forEach(e=>{const i=t.get(e.id);i&&(e.revisionDate=new Date(i.revisionDate))}),yield this.upsert(o.map(e=>e.toCipherData()))}catch(l){for(const t of e)t.organizationId=null,t.collectionIds=null;throw l}})}saveAttachmentWithServer(e,t,i,n=!1){return new Promise((r,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>bc(this,void 0,void 0,function*(){try{const s=yield this.saveAttachmentRawWithServer(e,t.name,o.target.result,i,n);r(s)}catch(a){s(a)}}),o.onerror=()=>{s("Error reading file.")}})}saveAttachmentRawWithServer(e,t,i,n){return bc(this,arguments,void 0,function*(e,t,i,n,r=!1){const s=yield this.getKeyForCipherKeyDecryption(e,n),o=yield this.getCipherKeyEncryptionEnabled(),a=o&&null!=e.key?yield this.encryptService.unwrapSymmetricKey(e.key,s):s;if(null!=e.key&&!o){const t=yield this.decrypt(e,n),i=yield this.encrypt(t,n);yield this.updateWithServer(i)}const l=yield this.encryptService.encryptString(t,a),c=yield this.keyService.makeDataEncKey(a),d=yield this.encryptService.encryptFileData(new Uint8Array(i),c[0]),u=yield this.cipherFileUploadService.upload(e,l,d,r,c),h=new qo.A(u,e.collectionIds);return r||(yield this.upsert(h)),new Zo.o(h)})}saveCollectionsWithServer(e,t){return bc(this,void 0,void 0,function*(){const i=new pc(e.collectionIds),n=yield this.apiService.putCipherCollections(e.id,i);if(n.unavailable)return void(yield this.delete(e.id,t));const r=new qo.A(n.cipher),s=yield this.upsert(r);return new Zo.o(s[e.id],e.localData)})}saveCollectionsWithServerAdmin(e){return bc(this,void 0,void 0,function*(){const t=new pc(e.collectionIds),i=yield this.apiService.putCipherCollectionsAdmin(e.id,t),n=new Ha.N(i);n.edit=!0,n.viewPassword=!0,n.favorite=!1;const r=new qo.A(n);return new Zo.o(r)})}bulkUpdateCollectionsWithServer(e,t,i,n){return bc(this,arguments,void 0,function*(e,t,i,n,r=!1){var s,o;const a=new hc(e,i,n,r);yield this.apiService.send("POST","/ciphers/bulk-collections",a,!0,!1);const l=yield(0,fe._)(this.ciphers$(t));for(const c of i){const e=l[c];e&&(e.collectionIds=r?null===(s=e.collectionIds)||void 0===s?void 0:s.filter(e=>!n.includes(e)):[...new Set([...null!==(o=e.collectionIds)&&void 0!==o?o:[],...n])])}yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>l)})}upsert(e){return bc(this,void 0,void 0,function*(){const t=e instanceof qo.A?[e]:e,i=yield this.updateEncryptedCipherState(e=>(t.forEach(t=>e[t.id]=t),e));return yield new Promise(e=>setTimeout(e,0)),i})}replace(e,t){return bc(this,void 0,void 0,function*(){var i;const n=null!==(i=yield(0,fe._)(this.encryptedCiphersState(t).state$))&&void 0!==i?i:{};Object.keys(n).length>0&&JSON.stringify(n)===JSON.stringify(e)||(yield this.updateEncryptedCipherState(()=>e,t))})}updateEncryptedCipherState(e){return bc(this,arguments,void 0,function*(e,t=null){t||(t=yield(0,fe._)(this.stateProvider.activeUserId$)),yield this.clearCache(t);const i=yield this.stateProvider.getUser(t,Xo).update(t=>e(null!=t?t:{}));return yield new Promise(e=>setTimeout(e,0)),i})}clear(e){return bc(this,void 0,void 0,function*(){null!=e||(e=yield(0,fe._)(this.stateProvider.activeUserId$)),yield this.clearEncryptedCiphersState(e),yield this.clearCache(e)})}moveManyWithServer(e,t,i){return bc(this,void 0,void 0,function*(){yield this.apiService.putMoveCiphers(new ac(e,t));let n=yield(0,fe._)(this.ciphers$(i));null==n&&(n={}),e.forEach(e=>{n.hasOwnProperty(e)&&(n[e].folderId=t)}),yield this.clearCache(),yield this.encryptedCiphersState(i).update(()=>n)})}delete(e,t){return bc(this,void 0,void 0,function*(){const i=yield(0,fe._)(this.ciphers$(t));if(null!=i){if("string"==typeof e){const t=e;if(null==i[t])return;delete i[t]}else e.forEach(e=>{delete i[e]});yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>i)}})}deleteWithServer(e,t){return bc(this,arguments,void 0,function*(e,t,i=!1){i?yield this.apiService.deleteCipherAdmin(e):yield this.apiService.deleteCipher(e),yield this.delete(e,t)})}deleteManyWithServer(e,t){return bc(this,arguments,void 0,function*(e,t,i=!1){const n=new oc.U(e);i?yield this.apiService.deleteManyCiphersAdmin(n):yield this.apiService.deleteManyCiphers(n),yield this.delete(e,t)})}deleteAttachment(e,t,i,n){return bc(this,void 0,void 0,function*(){let r=yield(0,fe._)(this.ciphers$(n));const s=e;if(null!=r&&r.hasOwnProperty(e)&&null!=r[s].attachments){for(let e=0;e<r[s].attachments.length;e++)r[s].attachments[e].id===i&&r[s].attachments.splice(e,1);return r[s].revisionDate=t,yield this.clearCache(),yield this.encryptedCiphersState(n).update(()=>(null==r&&(r={}),r)),r[s]}})}deleteAttachmentWithServer(e,t,i){return bc(this,arguments,void 0,function*(e,t,i,n=!1){let r=null;try{r=n?yield this.apiService.deleteCipherAttachmentAdmin(e,t):yield this.apiService.deleteCipherAttachment(e,t)}catch(o){return Promise.reject(o.getSingleMessage())}const s=qo.A.fromJSON(null==r?void 0:r.cipher);return yield this.deleteAttachment(e,s.revisionDate,t,i)})}sortCiphersByLastUsed(e,t){const i=e.localData&&e.localData.lastUsedDate?e.localData.lastUsedDate:null,n=t.localData&&t.localData.lastUsedDate?t.localData.lastUsedDate:null,r=null!=i&&null!=n;return r&&i<n?1:null!=i&&null==n||r&&i>n?-1:null!=n&&null==i?1:0}sortCiphersByLastUsedThenName(e,t){const i=this.sortCiphersByLastUsed(e,t);return 0!==i?i:this.getLocaleSortingFunction()(e,t)}getLocaleSortingFunction(){return(e,t)=>{let i=e.name,n=t.name;if(null==i&&null!=n)return-1;if(null!=i&&null==n)return 1;if(null==i&&null==n)return 0;const r=this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n),s=yc.n.getType(e),o=yc.n.getType(t);if(0!==r||s!==Xl.gC.Login||o!==Xl.gC.Login)return r;const a=yc.n.getLogin(e),l=yc.n.getLogin(t);return null!=a.username&&(i+=a.username),null!=l.username&&(n+=l.username),this.i18nService.collator?this.i18nService.collator.compare(i,n):i.localeCompare(n)}}softDelete(e,t){return bc(this,void 0,void 0,function*(){let i=yield(0,fe._)(this.ciphers$(t));if(null==i)return;const n=e=>{null!=i[e]&&(i[e].deletedDate=(new Date).toISOString(),i[e].archivedDate=null)};"string"==typeof e?n(e):e.forEach(n),yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>(null==i&&(i={}),i))})}softDeleteWithServer(e,t){return bc(this,arguments,void 0,function*(e,t,i=!1){i?yield this.apiService.putDeleteCipherAdmin(e):yield this.apiService.putDeleteCipher(e),yield this.softDelete(e,t)})}softDeleteManyWithServer(e,t){return bc(this,arguments,void 0,function*(e,t,i=!1){const n=new oc.U(e);i?yield this.apiService.putDeleteManyCiphersAdmin(n):yield this.apiService.putDeleteManyCiphers(n),yield this.softDelete(e,t)})}restore(e,t){return bc(this,void 0,void 0,function*(){let i=yield(0,fe._)(this.ciphers$(t));if(null==i)return;const n=e=>{const t=e.id;null!=i[t]&&(i[t].deletedDate=null,i[t].revisionDate=e.revisionDate)};e.constructor.name===Array.name?e.forEach(n):n(e),yield this.clearCache(),yield this.encryptedCiphersState(t).update(()=>(null==i&&(i={}),i))})}restoreWithServer(e,t){return bc(this,arguments,void 0,function*(e,t,i=!1){let n;n=i?yield this.apiService.putRestoreCipherAdmin(e):yield this.apiService.putRestoreCipher(e),yield this.restore({id:e,revisionDate:n.revisionDate},t)})}restoreManyWithServer(e,t,i){return bc(this,void 0,void 0,function*(){let n;if(i){const t=new lc(e,i);n=yield this.apiService.putRestoreManyCiphersAdmin(t)}else{const t=new lc(e);n=yield this.apiService.putRestoreManyCiphers(t)}const r=[];for(const e of n.data)r.push({id:e.id,revisionDate:e.revisionDate});yield this.restore(r,t)})}getKeyForCipherKeyDecryption(e,t){return bc(this,void 0,void 0,function*(){return null==e.organizationId?yield(0,fe._)(this.keyService.userKey$(t)):yield(0,fe._)(this.keyService.orgKeys$(t).pipe((0,E.T)(t=>t[e.organizationId])))})}setAddEditCipherInfo(e,t){return bc(this,void 0,void 0,function*(){yield this.addEditCipherInfoState(t).update(()=>e,{shouldUpdate:t=>!(null==t&&null==e)})})}getRotatedData(e,t,i){return bc(this,void 0,void 0,function*(){if(null==e)throw new Error("Original user key is required to rotate ciphers");if(null==t)throw new Error("New user key is required to rotate ciphers");let n=[];const r=yield(0,fe._)(this.cipherViews$(i)),s=yield(0,fe._)(this.failedToDecryptCiphers$(i));if(!r)return n;if(s.length>0)throw new Error("Cannot rotate ciphers when decryption failures are present");const o=r.filter(e=>null==e.organizationId);if(0===o.length)return n;const a=yield this.configService.getFeatureFlag(dn.TO.PM22136_SdkCipherEncryption);return n=yield Promise.all(o.map(n=>bc(this,void 0,void 0,function*(){const r=a?yield this.cipherEncryptionService.encryptCipherForRotation(n,i,t):yield this.encrypt(n,i,t,e);return new dc(r)}))),n})}getDecryptedAttachmentBuffer(e,t,i,n,r){return bc(this,void 0,void 0,function*(){const s=yield this.configService.getFeatureFlag(dn.TO.PM19941MigrateCipherDomainToSdk),o=yield(0,fe._)(this.ciphers$(n).pipe((0,E.T)(t=>new Zo.o(t[e]))));if(s&&!r){const e=yield i.arrayBuffer();return this.cipherEncryptionService.decryptAttachmentContent(o,t,new Uint8Array(e),n)}const a=yield Dn.q.fromResponse(i),l=null!=t.key?t.key:o.organizationId?yield(0,fe._)(this.keyService.orgKeys$(n).pipe((0,Bl.w)(),(0,E.T)(e=>e[o.organizationId]))):yield(0,fe._)(this.keyService.userKey$(n).pipe((0,Bl.w)()));return yield this.encryptService.decryptFileData(a,l)})}localDataState(e){return this.stateProvider.getUser(e,Wo)}encryptedCiphersState(e){return this.stateProvider.getUser(e,Xo)}decryptedCiphersState(e){return this.stateProvider.getUser(e,Yo)}addEditCipherInfoState(e){return this.stateProvider.getUser(e,Jo)}failedToDecryptCiphersState(e){return this.stateProvider.getUser(e,Ho)}encryptSharedCipher(e,t){return bc(this,void 0,void 0,function*(){const i=yield this.keyService.getUserKey(t);return yield this.encrypt(e,t,null,i)})}updateModelfromExistingCipher(e,t,i){return bc(this,void 0,void 0,function*(){const n=yield this.decrypt(t,i);if(e.passwordHistory=n.passwordHistory||[],e.type===Xl.gC.Login&&n.type===Xl.gC.Login)if(null!=n.login.password&&""!==n.login.password&&n.login.password!==e.login.password){const t=new gc.j;t.password=n.login.password,t.lastUsedDate=e.login.passwordRevisionDate=new Date,e.passwordHistory.splice(0,0,t)}else e.login.passwordRevisionDate=n.login.passwordRevisionDate;if(n.hasFields){const t=n.fields.filter(e=>e.type===_l.PU.Hidden&&null!=e.name&&""!==e.name&&null!=e.value&&""!==e.value),i=null==e.fields?[]:e.fields.filter(e=>e.type===_l.PU.Hidden&&null!=e.name&&""!==e.name);t.forEach(t=>{const n=i.find(e=>e.name===t.name);if(null==n||n.value!==t.value){const i=new gc.j;i.password=t.name+": "+t.value,i.lastUsedDate=new Date,e.passwordHistory.splice(0,0,i)}})}})}adjustPasswordHistoryLength(e){null!=e.passwordHistory&&0===e.passwordHistory.length?e.passwordHistory=null:null!=e.passwordHistory&&e.passwordHistory.length>5&&(e.passwordHistory=e.passwordHistory.slice(0,5))}shareAttachmentWithServer(e,t,i,n){return bc(this,void 0,void 0,function*(){const r=yield(0,fe._)(this.accountService.activeAccount$),s=yield this.apiService.nativeFetch(new Request(e.url,{cache:"no-store"}));if(200!==s.status)throw Error("Failed to download attachment: "+s.status.toString());const o=yield Dn.q.fromResponse(s),a=yield this.keyService.getUserKey(r.id),l=yield this.encryptService.decryptFileData(o,a);let c;c=yield this.keyService.getOrgKey(i),c||(c=yield this.keyService.getUserKey());const d=yield this.keyService.makeDataEncKey(c),u=yield this.encryptService.encryptString(e.fileName,c),h=yield this.encryptService.encryptFileData(new Uint8Array(l),d[0]),p=new FormData;try{const e=new Blob([h.buffer],{type:"application/octet-stream"});p.append("key",d[1].encryptedString),p.append("data",e,u.encryptedString),p.append("lastKnownRevisionDate",n.toISOString())}catch(m){if(!Se.A.isNode||Se.A.isBrowser)throw m;p.append("key",d[1].encryptedString),p.append("lastKnownRevisionDate",n.toISOString()),p.append("data",Buffer.from(h.buffer),{filepath:u.encryptedString,contentType:"application/octet-stream"})}try{yield this.apiService.postShareCipherAttachment(t,e.id,p,i)}catch(m){throw new Error(m.getSingleMessage())}})}upgradeOldCipherAttachments(e,t,i){return bc(this,void 0,void 0,function*(){if(!e.hasOldAttachments)return e;let n=yield this.get(e.id,t);for(const s of e.attachments)if(null==s.key&&(null==i||s.id===i))try{const i=yield this.getAttachmentDownloadUrl(e.id,s),r=yield this.apiService.nativeFetch(new Request(i,{cache:"no-store"}));if(200!==r.status)throw new Error(`Failed to download attachment. Status: ${r.status}`);const o=yield this.getDecryptedAttachmentBuffer(e.id,s,r,t);n=yield this.saveAttachmentRawWithServer(n,s.fileName,o,t);const a=yield this.deleteAttachmentWithServer(e.id,s.id,t);n=new Zo.o(a)}catch(r){throw this.logService.error(`Failed to upgrade attachment ${s.id}`,r),r}return yield this.decrypt(n,t)})}getAttachmentDownloadUrl(e,t){return bc(this,void 0,void 0,function*(){try{return(yield this.apiService.getAttachmentData(e,t.id)).url}catch(i){if(i instanceof we._&&404===i.statusCode&&t.url)return t.url;throw new Error(`Failed to get download URL for attachment ${t.id}`)}})}encryptObjProperty(e,t,i,n){return bc(this,void 0,void 0,function*(){const r=[],s=this;for(const o in i)i.hasOwnProperty(o)&&function(t,o){const a=Promise.resolve().then(()=>{const r=e[i[t]||t];return r&&""!==r?s.encryptService.encryptString(r,n):null}).then(e=>{o[t]=e});r.push(a)}(o,t);yield Promise.all(r)})}encryptCipherData(e,t,i){return bc(this,void 0,void 0,function*(){switch(e.type){case Xl.gC.Login:if(e.login=new Ql.a,e.login.passwordRevisionDate=t.login.passwordRevisionDate,e.login.autofillOnPageLoad=t.login.autofillOnPageLoad,yield this.encryptObjProperty(t.login,e.login,{username:null,password:null,totp:null},i),null!=t.login.uris){e.login.uris=[],t.login.uris=t.login.uris.filter(e=>null!=e.uri&&""!==e.uri);for(let n=0;n<t.login.uris.length;n++){const r=new ec.m;r.match=t.login.uris[n].match,yield this.encryptObjProperty(t.login.uris[n],r,{uri:null},i);const s=yield this.encryptService.hash(t.login.uris[n].uri,"sha256");r.uriChecksum=yield this.encryptService.encryptString(s,i),e.login.uris.push(r)}}return void(null!=t.login.fido2Credentials&&(e.login.fido2Credentials=yield Promise.all(t.login.fido2Credentials.map(e=>bc(this,void 0,void 0,function*(){const t=new Wl.U;return yield this.encryptObjProperty(e,t,{credentialId:null,keyType:null,keyAlgorithm:null,keyCurve:null,keyValue:null,rpId:null,rpName:null,userHandle:null,userName:null,userDisplayName:null,origin:null},i),t.counter=yield this.encryptService.encryptString(String(e.counter),i),t.discoverable=yield this.encryptService.encryptString(String(e.discoverable),i),t.creationDate=e.creationDate,t})))));case Xl.gC.SecureNote:return e.secureNote=new ic.S,void(e.secureNote.type=t.secureNote.type);case Xl.gC.Card:return e.card=new Hl.Z,void(yield this.encryptObjProperty(t.card,e.card,{cardholderName:null,brand:null,number:null,expMonth:null,expYear:null,code:null},i));case Xl.gC.Identity:return e.identity=new Zl.l,void(yield this.encryptObjProperty(t.identity,e.identity,{title:null,firstName:null,middleName:null,lastName:null,address1:null,address2:null,address3:null,city:null,state:null,postalCode:null,country:null,company:null,email:null,phone:null,ssn:null,username:null,passportNumber:null,licenseNumber:null},i));case Xl.gC.SshKey:return e.sshKey=new sc.M,void(yield this.encryptObjProperty(t.sshKey,e.sshKey,{privateKey:null,publicKey:null,keyFingerprint:null},i));default:throw new Error("Unknown cipher type.")}})}getAutofillOnPageLoadDefault(){return bc(this,void 0,void 0,function*(){return yield(0,fe._)(this.autofillSettingsService.autofillOnPageLoadDefault$)})}getCipherForUrl(e,t,i,n,r){return bc(this,void 0,void 0,function*(){const s=r?"autofillOnPageLoad-"+e:e;if(!this.sortedCiphersCache.isCached(s)){let i=yield this.getAllDecryptedForUrl(e,t);if(!(null==i?void 0:i.length))return null;const n=yield(0,fe._)(this.localData$(t));if(n)for(const e of i){const t=n[e.id];t&&(e.localData=t)}if(r){const e=yield this.getAutofillOnPageLoadDefault();if(i=i.filter(t=>t.login.autofillOnPageLoad||null==t.login.autofillOnPageLoad&&!1!==e),0===i.length)return null}this.sortedCiphersCache.addCiphers(s,i)}return n?this.sortedCiphersCache.getLastLaunched(s):i?this.sortedCiphersCache.getLastUsed(s):this.sortedCiphersCache.getNext(s)})}clearEncryptedCiphersState(e){return bc(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Xo,{},e)})}clearDecryptedCiphersState(e){return bc(this,void 0,void 0,function*(){yield this.setDecryptedCiphers(null,e),yield this.setFailedDecryptedCiphers(null,e),this.clearSortedCiphers()})}clearSortedCiphers(){this.sortedCiphersCache.clear()}encryptCipher(e,t,i){return bc(this,void 0,void 0,function*(){if(null==i)throw new Error("Key to encrypt cipher must not be null. Use the org key, user key or cipher key.");return yield Promise.all([this.encryptObjProperty(e,t,{name:null,notes:null},i),this.encryptCipherData(t,e,i),this.encryptFields(e.fields,i).then(e=>{t.fields=e}),this.encryptPasswordHistories(e.passwordHistory,i).then(e=>{t.passwordHistory=e}),this.encryptAttachments(e.attachments,i).then(e=>{t.attachments=e})]),t})}encryptCipherWithCipherKey(e,t,i,n){return bc(this,void 0,void 0,function*(){let r;return r=null==t.key?yield this.keyService.makeCipherKey():yield this.encryptService.unwrapSymmetricKey(t.key,n),t.key=yield this.encryptService.wrapSymmetricKey(r,i),this.encryptCipher(e,t,r)})}getCipherKeyEncryptionEnabled(){return bc(this,void 0,void 0,function*(){const e=yield this.configService.getFeatureFlag(dn.TO.CipherKeyEncryption),t=yield(0,fe._)(this.configService.checkServerMeetsVersionRequirement$(wc));return e&&t})}decryptCiphersWithSdk(e,t){return bc(this,arguments,void 0,function*(e,t,i=!0){if(i){const[i,n]=yield this.cipherEncryptionService.decryptManyLegacy(e,t);return[i.sort(this.getLocaleSortingFunction()),n]}const[n,r]=yield this.cipherEncryptionService.decryptManyWithFailures(e,t),s=r.map(e=>{const t=new _o.f(e);return t.name="[error: cannot decrypt]",t.decryptionFailure=!0,t});return[n.sort(this.getLocaleSortingFunction()),s]})}getFullCipherView(e){return bc(this,void 0,void 0,function*(){if(yc.n.isCipherListView(e)){const t=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id))),i=yield this.get((0,os.zw)(e.id),t);return this.decrypt(i,t)}return Promise.resolve(e)})}}class Ic{constructor(e){this.ids=null==e?[]:e}}class kc{constructor(e){this.ids=null==e?[]:e}}var Cc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Tc=i(65918),Fc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},Rc=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},Pc=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});var xc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})},$c=function(e,t,i){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n,r;if(i){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose],i&&(r=n)}if("function"!=typeof n)throw new TypeError("Object not disposable.");r&&(n=function(){try{r.call(this)}catch(e){return Promise.reject(e)}}),e.stack.push({value:t,dispose:n,async:i})}else i&&e.stack.push({async:!0});return t},Ec=function(e){return function(t){function i(i){t.error=t.hasError?new e(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var n,r=0;return function e(){for(;n=t.stack.pop();)try{if(!n.async&&1===r)return r=0,t.stack.push(n),Promise.resolve().then(e);if(n.dispose){var s=n.dispose.call(n.value);if(n.async)return r|=2,Promise.resolve(s).then(e,function(t){return i(t),e()})}else r|=1}catch(o){i(o)}if(1===r)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}()}}("function"==typeof SuppressedError?SuppressedError:function(e,t,i){var n=new Error(i);return n.name="SuppressedError",n.error=e,n.suppressed=t,n});var Ac=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Dc=i(75174),Oc=i(98850),Mc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Uc=i(83892),Gc=i(84274),jc=i(78078),Nc=i(89177);const Vc=D.Ok.record(D.Rv,"folders",{deserializer:e=>ga.p.fromJSON(e),clearOn:["logout"]}),Bc=new D.Ok(D.jx,"decryptedFolders",{deserializer:e=>{var t;return null!==(t=null==e?void 0:e.map(e=>jc.u.fromJSON(e)))&&void 0!==t?t:[]},clearOn:["logout","lock"]});var zc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Lc=i(66983),Kc=i(14688);const qc=new D.Zs(D.Jb,"enablePasskeys",{deserializer:e=>e}),_c=new D.Ok(D.Jb,"showCardsCurrentTab",{deserializer:e=>e,clearOn:[]}),Xc=new D.Ok(D.Jb,"showIdentitiesCurrentTab",{deserializer:e=>e,clearOn:[]}),Yc=new D.Ok(D.Jb,"clickItemsToAutofillOnVaultView",{deserializer:e=>e,clearOn:[]});var Hc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Wc=i(69650),Jc=i(69855),Zc=i(1221);var Qc=i(21274),ed=i(192),td=i(71373),id=i(93173),nd=i(22166),rd=i(66387),sd=i(63580),od=i(28778),ad=i(35185),ld=i(16436);var cd=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class dd{getPremiumInterest(e){return cd(this,void 0,void 0,function*(){return null})}setPremiumInterest(e,t){return cd(this,void 0,void 0,function*(){})}clearPremiumInterest(e){return cd(this,void 0,void 0,function*(){})}}dd.ɵfac=function(e){return new(e||dd)},dd.ɵprov=p.jDH({token:dd,factory:dd.ɵfac});var ud=i(51757),hd=i(58625),pd=i(81573),md=i(26477),vd=i(29029),fd=i(22191),gd=i(37579),yd=i(26411),bd=i(7730),wd=i(68016),Sd=i(59032),Id=i(56898),kd=i(36288),Cd=i(26657),Td=i(45154),Fd=i(86226),Rd=i(93199),Pd=i(97553),xd=i(43759),$d=i(76356),Ed=i(69896),Ad=i(88016),Dd=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Od{constructor(){this.dialogRef=(0,p.WQX)(Qc.ce),this.formBuilder=(0,p.WQX)(ud.ok),this.uvService=(0,p.WQX)(He.i),this.accountService=(0,p.WQX)(Ge.Di),this.migrationPasswordForm=this.formBuilder.group({masterPassword:["",[ud.k0.required]]}),this.submit=()=>Dd(this,void 0,void 0,function*(){const e=this.migrationPasswordForm.controls.masterPassword;if(!e.value||e.invalid)return;const{userId:t,email:i}=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,dr.p)(e=>null!=e),(0,E.T)(e=>({userId:e.id,email:e.email}))));(yield this.uvService.verifyUserByMasterPassword({type:Ii.k.MasterPassword,secret:e.value},t,i))&&this.dialogRef.close(e.value)})}static open(e){return e.open(Od)}}Od.ɵfac=function(e){return new(e||Od)},Od.ɵcmp=r.VBU({type:Od,selectors:[["ng-component"]],decls:33,vars:33,consts:[[3,"bitSubmit","formGroup"],["bitDialogTitle","",1,"tw-font-semibold"],["bitDialogContent",""],["bitLink","","href","https://bitwarden.com/help/kdf-algorithms/","target","_blank","rel","noreferrer","aria-label","external link"],["aria-hidden","true",1,"bwi","bwi-external-link"],["bitInput","","type","password","formControlName","masterPassword",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(r.j41(0,"form",0)(1,"bit-dialog")(2,"div",1),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",2)(6,"p"),r.EFF(7),r.nI1(8,"i18n"),r.j41(9,"a",3),r.EFF(10),r.nI1(11,"i18n"),r.nrm(12,"i",4),r.k0s()(),r.j41(13,"bit-form-field")(14,"bit-label"),r.EFF(15),r.nI1(16,"i18n"),r.k0s(),r.j41(17,"bit-hint"),r.EFF(18),r.nI1(19,"i18n"),r.k0s(),r.nrm(20,"input",5),r.nI1(21,"i18n"),r.nrm(22,"button",6),r.nI1(23,"i18n"),r.nI1(24,"i18n"),r.k0s()(),r.qex(25,7),r.j41(26,"button",8)(27,"span"),r.EFF(28),r.nI1(29,"i18n"),r.k0s()(),r.j41(30,"button",9),r.EFF(31),r.nI1(32,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e&&(r.Y8G("bitSubmit",t.submit)("formGroup",t.migrationPasswordForm),r.R7$(3),r.SpI(" ",r.bMT(4,13,"updateEncryptionSettingsTitle")," "),r.R7$(4),r.SpI(" ",r.bMT(8,15,"updateEncryptionSettingsDesc")," "),r.R7$(3),r.SpI(" ",r.bMT(11,17,"learnMore")," "),r.R7$(5),r.JRh(r.bMT(16,19,"masterPass")),r.R7$(3),r.JRh(r.bMT(19,21,"confirmIdentityToContinue")),r.R7$(2),r.BMQ("title",r.bMT(21,23,"masterPass")),r.R7$(2),r.BMQ("title",r.bMT(23,25,"toggleVisibility"))("aria-label",r.bMT(24,27,"toggleVisibility")),r.R7$(4),r.Y8G("disabled",t.migrationPasswordForm.invalid),r.R7$(2),r.JRh(r.bMT(29,29,"updateSettings")),r.R7$(3),r.SpI(" ",r.bMT(32,31,"later")," "))},dependencies:[pd.P,bd.I,wd.m,md.V,Sd.L,n.MD,hd.p,vd.t,Id.Q,fd.Q,kd.s,ud.X1,ud.qT,ud.me,ud.BC,ud.cb,ud.j4,ud.JD,gd.C,Cd.$,Td.L,yd.L,Fd.j,Rd.I,Pd.J,xd.h,$d.e,Ed.a,Ad.$],encapsulation:2,changeDetection:0});var Md=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ud=new D.Ok(D.K8,"encryptedMigrationDismissed",{deserializer:e=>null!=e?new Date(e):null,clearOn:[]}),Gd=["/vault","/tabs/vault","/tabs/current"];class jd{}var Nd=i(90268);class Vd extends p.zcH{constructor(){super(...arguments),this.injector=(0,p.WQX)(p.zZn)}handleError(e){try{this.injector.get(is.K,null).error("Unhandled error in angular",e)}catch(t){super.handleError(e)}}}Vd.ɵfac=(()=>{let e;return function(t){return(e||(e=r.xGo(Vd)))(t||Vd)}})(),Vd.ɵprov=p.jDH({token:Vd,factory:Vd.ɵfac});var Bd=i(31436);class zd{static createSystemThemeFromWindow(e){return(0,Uc.h)((0,xt.of)(zd.getSystemThemeFromWindow(e)),(0,Bd.R)(e.matchMedia("(prefers-color-scheme: dark)"),"change").pipe((0,E.T)(e=>e.matches?si.NJ.Dark:si.NJ.Light)))}static getSystemThemeFromWindow(e){return e.matchMedia("(prefers-color-scheme: dark)").matches?si.NJ.Dark:si.NJ.Light}constructor(e,t){this.themeStateService=e,this.systemTheme$=t,this.theme$=this.themeStateService.selectedTheme$.pipe((0,ge.n)(e=>e===si.NJ.System?this.systemTheme$:(0,xt.of)(e)))}applyThemeChangesTo(e){return this.theme$.subscribe(t=>{e.documentElement.classList.remove("theme_"+si.NJ.Light,"theme_"+si.NJ.Dark),e.documentElement.classList.add("theme_"+t)})}}zd.ɵfac=function(e){return new(e||zd)(p.KVO(ka.oO),p.KVO(h.eL))},zd.ɵprov=p.jDH({token:zd,factory:zd.ɵfac});class Ld{}var Kd=i(47836);class qd{signal(e){return(0,p.vPA)(e.initialValue)}formGroup(e){return e.control}}qd.ɵfac=function(e){return new(e||qd)},qd.ɵprov=p.jDH({token:qd,factory:qd.ɵfac,providedIn:"root"});var _d=i(14928),Xd=i(94573),Yd=i(63609);class Hd{constructor(){this._onCreated=new m.B,this._onClose=new m.B,this._onClosed=new m.B,this._onShow=new m.B,this._onShown=new m.B,this.onCreated=this._onCreated.asObservable(),this.onClose=this._onClose.asObservable(),this.onClosed=this._onClosed.asObservable(),this.onShow=this._onShow.asObservable(),this.onShown=this._onShow.asObservable()}show(){this._onShow.next()}shown(){this._onShown.next()}close(e){this.lastResult=e,this._onClose.next(e)}closed(){this._onClosed.next(this.lastResult)}created(e){this._onCreated.next(e)}onClosedPromise(){return this.onClosed.pipe((0,_d.$)()).toPromise()}}const Wd=["modalContent"];function Jd(e,t){}class Zd{constructor(e,t,i,n){this.cd=e,this.el=t,this.focusTrapFactory=i,this.modalRef=n}ngAfterViewInit(){this.loadChildComponent(this.childComponentType),null!=this.setComponentParameters&&this.setComponentParameters(this.componentRef.instance),this.cd.detectChanges(),this.modalRef.created(this.el.nativeElement),this.focusTrap=this.focusTrapFactory.create(this.el.nativeElement.querySelector(".modal-dialog")),null==this.el.nativeElement.querySelector("[appAutoFocus]")&&this.focusTrap.focusFirstTabbableElementWhenReady()}loadChildComponent(e){this.modalContentRef.clear(),this.componentRef=this.modalContentRef.createComponent(e)}ngOnDestroy(){this.componentRef&&this.componentRef.destroy(),this.focusTrap.destroy()}close(){this.modalRef.close()}getFocus(){const e=this.el.nativeElement.querySelector("[appAutoFocus]");null==e||e.focus()}}Zd.ɵfac=function(e){return new(e||Zd)(r.rXU(Xd.gRc),r.rXU(r.aKT),r.rXU(Yd.Fp),r.rXU(Hd))},Zd.ɵcmp=r.VBU({type:Zd,selectors:[["app-modal"]],viewQuery:function(e,t){if(1&e&&r.GBs(Wd,7,r.c1b),2&e){let e;r.mGM(e=r.lsd())&&(t.modalContentRef=e.first)}},standalone:!1,decls:2,vars:0,consts:[["modalContent",""]],template:function(e,t){1&e&&r.DNE(0,Jd,0,0,"ng-template",null,0,r.C5r)},encapsulation:2});class Qd{constructor(e,t){this._parentInjector=e,this._additionalTokens=t}get(e,t,i){var n;return null!==(n=this._additionalTokens.get(e))&&void 0!==n?n:this._parentInjector.get(e,t)}}var eu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class tu{constructor(e){this.injector=e,this.modalList=[],document.addEventListener("keyup",e=>{"Escape"===e.key&&this.modalCount>0&&this.topModal.instance.close()})}get modalCount(){return this.modalList.length}get topModal(){return this.modalList[this.modalCount-1]}openViewRef(e,t){return eu(this,arguments,void 0,function*(e,t,i=null){const[n,r]=this.openInternal(t,e);return r.instance.setComponentParameters=i,t.insert(r.hostView),yield n.onCreated.pipe((0,_d.$)()).toPromise(),[n,r.instance.componentRef.instance]})}closeAll(){this.modalList.forEach(e=>e.instance.close())}openInternal(e,t){const[i,n]=this.createModalComponent(e);return n.instance.childComponentType=t,i.onClosed.pipe((0,_d.$)()).subscribe(()=>{n.destroy(),this.modalList.pop(),this.modalCount>0&&this.topModal.instance.getFocus()}),this.setupHandlers(i),this.modalList.push(n),[i,n]}setupHandlers(e){let t=null;e.onCreated.pipe((0,_d.$)()).subscribe(i=>{document.body.classList.add("modal-open");const n=i.querySelector(".modal"),r=n.querySelector(".modal-dialog");t=document.createElement("div"),t.className="modal-backdrop fade",t.style.zIndex=`${this.modalCount}040`,n.prepend(t),r.addEventListener("click",e=>{e.stopPropagation()}),r.style.zIndex=`${this.modalCount}050`;const s=Array.from(i.querySelectorAll('.modal-backdrop, .modal *[data-dismiss="modal"]'));for(const t of s)t.addEventListener("click",()=>{e.close()})}),e.onClose.pipe((0,_d.$)()).subscribe(()=>{e.closed(),0===this.modalCount&&document.body.classList.remove("modal-open")})}createModalComponent(e){const t=new Hd,i=new WeakMap;i.set(Hd,t);const n=new Qd(this.injector,i);return[t,e.createComponent(Zd,{injector:n})]}}tu.ɵfac=function(e){return new(e||tu)(p.KVO(p.zZn))},tu.ɵprov=p.jDH({token:tu,factory:tu.ɵfac});var iu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const nu=[(0,u.F)(tu),(0,u.F)(nd.qX),(0,u.F)({provide:h.jf,useValue:window}),(0,u.F)({provide:h.qQ,useValue:document}),(0,u.F)({provide:r.xe9,useFactory:e=>e.translationLocale,deps:[ts.W]}),(0,u.F)({provide:h.Vc,useFactory:e=>e.supportsSecureStorage(),deps:[rs.y]}),(0,u.F)({provide:h.U1,useValue:"./locales"}),(0,u.F)({provide:h.Xk,useFactory:e=>e.navigator.language,deps:[h.jf]}),(0,u.F)({provide:h.dZ,useFactory:e=>(t,i)=>iu(void 0,void 0,void 0,function*(){return Promise.resolve(e.send("logout",{logoutReason:t,userId:i}))}),deps:[ns.U]}),(0,u.F)({provide:h.Pn,useValue:!0}),(0,u.F)({provide:h.eL,useFactory:e=>zd.createSystemThemeFromWindow(e),deps:[h.jf]}),(0,u.F)({provide:ka.oO,useClass:ka.T2,deps:[it.Y2]}),(0,u.F)({provide:Ld,useClass:zd,deps:[ka.oO,h.eL]}),(0,u.F)({provide:Hr.Y,useClass:Ks,deps:[h.ml,is.K]}),(0,u.F)({provide:y.d,useClass:class{constructor(e,t,i,n=100){this.cryptoFunctionService=e,this.apiService=t,this.hibpApiService=i,this.maxConcurrent=n,this.passwordLeakedSubject=new m.B,this.maxConcurrent=n,this.passwordLeakedSubject.pipe((0,Ms.Z)(e=>tl(this,void 0,void 0,function*(){try{const t=yield this.fetchLeakedPasswordCount(e.password);e.resolve(t)}catch(t){e.reject(t)}}),this.maxConcurrent)).subscribe()}passwordLeaked(e){return tl(this,void 0,void 0,function*(){return new Promise((t,i)=>{this.passwordLeakedSubject.next({password:e,resolve:t,reject:i})})})}fetchLeakedPasswordCount(e){return tl(this,void 0,void 0,function*(){const t=yield this.cryptoFunctionService.hash(e,"sha1"),i=Se.A.fromBufferToHex(t).toUpperCase(),n=i.substr(0,5),r=i.substr(5),s=yield this.apiService.nativeFetch(new Request("https://api.pwnedpasswords.com/range/"+n)),o=(yield s.text()).split(/\r?\n/).find(e=>e.split(":")[0]===r);return null!=o?parseInt(o.split(":")[1],10):0})}breachedAccounts(e){return tl(this,void 0,void 0,function*(){return this.hibpApiService.getHibpBreach(e)})}},deps:[$n.R,g.G,Rn]}),(0,u.F)({provide:Rn,useClass:Rn,deps:[g.G]}),(0,u.F)({provide:Ve.u,useClass:class{constructor(e,t,i,n,r,s){this.accountService=e,this.messageSender=t,this.keyService=i,this.apiService=n,this.stateService=r,this.tokenService=s,this.activeAccountStatus$=this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id),(0,ge.n)(e=>this.authStatusFor$(e))),this.authStatuses$=this.accountService.accounts$.pipe((0,E.T)(e=>Object.keys(e)),(0,ge.n)(e=>0===e.length?(0,xt.of)([]):(0,$t.z)(e.map(e=>this.authStatusFor$(e).pipe((0,E.T)(t=>({userId:e,status:t})))))),(0,E.T)(e=>e.reduce((e,{userId:t,status:i})=>(e[t]=i,e),{})))}authStatusFor$(e){return Se.A.isGuid(e)?(0,$t.z)([this.keyService.getInMemoryUserKeyFor$(e),this.tokenService.hasAccessToken$(e)]).pipe((0,E.T)(([e,t])=>t?e?Dt.J.Unlocked:Dt.J.Locked:Dt.J.LoggedOut),(0,Et.F)(),(0,At.t)({bufferSize:1,refCount:!1})):(0,xt.of)(Dt.J.LoggedOut)}getAuthStatus(e){return Ot(this,void 0,void 0,function*(){return null!=e||(e=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id)))),yield(0,fe._)(this.authStatusFor$(e))})}logOut(e,t){e(),this.messageSender.send("loggedOut",{userId:t})}},deps:[Ge.Di,ns.U,Si.Lu,g.G,as.d,Xe.B]}),(0,u.F)({provide:sr.J,useClass:rr,deps:[Jn,os.K5]}),(0,u.F)({provide:Hn.G,useClass:class{constructor(e,t,i,n,r,s){this.kdfConfigService=e,this.changeKdfService=t,this.logService=i,this.configService=n,this.masterPasswordService=r,this.syncService=s,this.migrations=[],this.isRunningMigration=!1,this.migrations.push({name:"Minimum PBKDF2 Iteration Count Migration",migration:new Xn(e,t,i,n,r)})}runMigrations(e,t){return Yn(this,void 0,void 0,function*(){(0,qn.x)(e,"userId");const i=yield this.needsMigrations(e);if("noMigrationNeeded"!==i&&("needsMigrationWithMasterPassword"!==i||null!=t))try{if(this.isRunningMigration)return;this.isRunningMigration=!0,this.logService.mark("[Encrypted Migrator] Start"),this.logService.info(`[Encrypted Migrator] Starting migrations for user: ${e}`);let i=!1;for(const{name:n,migration:r}of this.migrations)if("noMigrationNeeded"!==(yield r.needsMigration(e))){this.logService.info(`[Encrypted Migrator] Running migration: ${n}`);const s=performance.now();yield r.runMigrations(e,t),this.logService.measure(s,"[Encrypted Migrator]",n,"ExecutionTime"),i=!0}this.logService.mark("[Encrypted Migrator] Finish"),this.logService.info(`[Encrypted Migrator] Completed migrations for user: ${e}`),i&&(yield this.syncService.fullSync(!0))}catch(n){throw this.logService.error(`[Encrypted Migrator] Error running migrations for user: ${e}`,n),n}finally{this.isRunningMigration=!1}})}needsMigrations(e){return Yn(this,void 0,void 0,function*(){(0,qn.x)(e,"userId");const t=yield Promise.all(this.migrations.map(t=>Yn(this,[t],void 0,function*({migration:t}){return t.needsMigration(e)})));return t.includes("needsMigrationWithMasterPassword")?"needsMigrationWithMasterPassword":t.includes("needsMigration")?"needsMigration":"noMigrationNeeded"})}isRunningMigrations(){return this.isRunningMigration}},deps:[Si.zZ,sr.J,is.K,Zr.w,Ir.L,ua.H]}),(0,u.F)({provide:f.sg,useClass:f.CL,deps:[Ge.Di,Ir.O,Si.Lu,g.G,Xe.B,Hr.Y,rs.y,ns.U,is.K,ar.K,Qr.v,as.d,Di.fz,ts.W,En.N,cl.Q,P.m,jn.M,f.XF,f.bj,it.Y2,Bi.Q,ri.ep,Si.zZ,Ts.Cc,Zr.w]}),(0,u.F)({provide:es,useClass:class{constructor(e,t){this.logService=e,this.azureFileUploadService=new Ao(e,t),this.bitwardenFileUploadService=new Mo}upload(e,t,i,n){return Uo(this,void 0,void 0,function*(){try{switch(e.fileUploadType){case si.K9.Direct:yield this.bitwardenFileUploadService.upload(t.encryptedString,i,e=>n.postDirect(e));break;case si.K9.Azure:yield this.azureFileUploadService.upload(e.url,i,n.renewFileUploadUrl);break;default:throw new Error("Unknown file upload type")}}catch(r){throw yield n.rollback(),r}})}},deps:[is.K,g.G]}),(0,u.F)({provide:Ul,useClass:class{constructor(e,t){this.apiService=e,this.fileUploadService=t}upload(e,t,i,n,r){return Ac(this,void 0,void 0,function*(){const s={key:r[1].encryptedString,fileName:t.encryptedString,fileSize:i.buffer.byteLength,adminRequest:n,lastKnownRevisionDate:e.revisionDate};let o;try{const r=yield this.apiService.postCipherAttachment(e.id,s);o=n?r.cipherMiniResponse:r.cipherResponse,yield this.fileUploadService.upload(r,t,i,this.generateMethods(r,o,s.adminRequest))}catch(a){throw a instanceof we._?new Error(a.getSingleMessage()):a}return o})}generateMethods(e,t,i){return{postDirect:this.generatePostDirectCallback(e,i),renewFileUploadUrl:this.generateRenewFileUploadUrlCallback(e,t,i),rollback:this.generateRollbackCallback(t,e,i)}}generatePostDirectCallback(e,t){return i=>{const n=t?e.cipherMiniResponse:e.cipherResponse;return this.apiService.postAttachmentFile(n.id,e.attachmentId,i)}}generateRenewFileUploadUrlCallback(e,t,i){return()=>Ac(this,void 0,void 0,function*(){const i=yield this.apiService.renewAttachmentUploadUrl(t.id,e.attachmentId);return null==i?void 0:i.url})}generateRollbackCallback(e,t,i){return()=>i?this.apiService.deleteCipherAttachmentAdmin(e.id,t.attachmentId):this.apiService.deleteCipherAttachment(e.id,t.attachmentId)}},deps:[g.G,es]}),(0,u.F)({provide:Gi.V,useClass:Gi.G,deps:[it.v2,P.m,Ge.Di]}),(0,u.F)({provide:Ml.p,useFactory:(e,t,i,n,r,s,o,a,l,c,d,u,h,p)=>new Sc(e,t,i,n,r,s,o,a,l,c,d,u,h,p),deps:[Si.Lu,Gi.V,g.G,ts.W,Nl.S,Oi.h,En.N,Ul,Zr.w,it.v2,Ge.Di,is.K,Dl.q,ns.U]}),(0,u.F)({provide:Ol.A,useClass:class{constructor(e,t){this.sdkService=e,this.cipherService=t}computeRiskForCiphers(e,t,i){return xc(this,void 0,void 0,function*(){const n=this.mapToLoginDetails(e);return 0===n.length?[]:yield(0,fe._)(this.sdkService.userClient$(t).pipe((0,ge.n)(e=>xc(this,void 0,void 0,function*(){const t={stack:[],error:void 0,hasError:!1};try{const r=$c(t,e.take(),!1).value.vault().cipher_risk();return yield r.compute_risk(n,null!=i?i:{checkExposed:!1})}catch(r){t.error=r,t.hasError=!0}finally{Ec(t)}}))))})}computeCipherRiskForUser(e,t){return xc(this,arguments,void 0,function*(e,t,i=!0){const n=yield(0,fe._)(this.cipherService.cipherViews$(t).pipe((0,Bl.w)())),r=null==n?void 0:n.find(t=>(0,os.WD)(t.id)===e);if(!r)throw new Error(`Cipher with id ${e} not found`);const s=yield this.buildPasswordReuseMap(n,t);return(yield this.computeRiskForCiphers([r],t,{passwordMap:s,checkExposed:i}))[0]})}buildPasswordReuseMap(e,t){return xc(this,void 0,void 0,function*(){const i=this.mapToLoginDetails(e);return 0===i.length?{}:yield(0,fe._)(this.sdkService.userClient$(t).pipe((0,ge.n)(e=>xc(this,void 0,void 0,function*(){const t={stack:[],error:void 0,hasError:!1};try{const n=$c(t,e.take(),!1);return n.value.vault().cipher_risk().password_reuse_map(i)}catch(n){t.error=n,t.hasError=!0}finally{Ec(t)}}))))})}mapToLoginDetails(e){return e.filter(e=>{var t;return e.type===Xl.gC.Login&&null!=(null===(t=e.login)||void 0===t?void 0:t.password)&&""!==e.login.password}).map(e=>({id:(0,os.WD)(e.id),password:e.login.password,username:e.login.username}))}},deps:[os.K5,Ml.p]}),(0,u.F)({provide:jl.Z,useClass:class{constructor(e,t,i,n,r){this.keyService=e,this.encryptService=t,this.i18nService=i,this.cipherService=n,this.stateProvider=r,this.folderViewCache=new Map,this.forceFolderViews={}}folders$(e){return this.encryptedFoldersState(e).state$.pipe((0,E.T)(e=>null==e?[]:Object.values(e).map(e=>new Gc.v(e))))}folderViews$(e){if(!this.folderViewCache.has(e)){this.forceFolderViews[e]||(this.forceFolderViews[e]=new m.B);const t=(0,Uc.h)(this.forceFolderViews[e],(0,$t.z)([this.encryptedFoldersState(e).state$,this.keyService.userKey$(e)]).pipe((0,dr.p)(([e,t])=>null!=e&&null!=t),(0,ge.n)(([t,i])=>this.decryptFolders(e,t)))).pipe((0,At.t)({refCount:!1,bufferSize:1}));this.folderViewCache.set(e,t)}return this.folderViewCache.get(e)}encrypt(e,t){return zc(this,void 0,void 0,function*(){const i=new Gc.v;return i.id=e.id,i.name=yield this.encryptService.encryptString(e.name,t),i})}get(e,t){return zc(this,void 0,void 0,function*(){return(yield(0,fe._)(this.folders$(t))).find(t=>t.id===e)})}getDecrypted$(e,t){return this.folderViews$(t).pipe((0,E.T)(t=>t.find(t=>t.id===e)),(0,At.t)({refCount:!0,bufferSize:1}))}getAllFromState(e){return zc(this,void 0,void 0,function*(){return yield(0,fe._)(this.folders$(e))})}getFromState(e,t){return zc(this,void 0,void 0,function*(){const i=yield this.get(e,t);return i||null})}getAllDecryptedFromState(e){return zc(this,void 0,void 0,function*(){return yield(0,fe._)(this.folderViews$(e))})}upsert(e,t){return zc(this,void 0,void 0,function*(){yield this.clearDecryptedFolderState(t),yield this.encryptedFoldersState(t).update(t=>{if(null==t&&(t={}),e instanceof ga.p){const i=e;t[i.id]=i}else e.forEach(e=>{t[e.id]=e});return t})})}replace(e,t){return zc(this,void 0,void 0,function*(){e&&(yield this.clearDecryptedFolderState(t),yield this.stateProvider.getUser(t,Vc).update(()=>Object.assign({},e)))})}clearDecryptedFolderState(e){return zc(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");yield this.setDecryptedFolders([],e)})}clear(e){return zc(this,void 0,void 0,function*(){var t;null===(t=this.forceFolderViews[e])||void 0===t||t.next([]),yield this.encryptedFoldersState(e).update(()=>({})),yield this.clearDecryptedFolderState(e)})}delete(e,t){return zc(this,void 0,void 0,function*(){yield this.clearDecryptedFolderState(t),yield this.encryptedFoldersState(t).update(t=>{if(null==t)return;return(Array.isArray(e)?e:[e]).forEach(e=>{null!=t[e]&&delete t[e]}),t});const i=yield this.cipherService.getAll(t);if(null!=i){const t=[];for(const n in i)i[n].folderId===e&&(i[n].folderId=null,t.push(i[n]));t.length>0&&(yield this.cipherService.upsert(t.map(e=>e.toCipherData())))}})}getRotatedData(e,t,i){return zc(this,void 0,void 0,function*(){if(null==t)throw new Error("New user key is required for rotation.");let e=[];const n=yield(0,fe._)(this.folderViews$(i));return n?(e=yield Promise.all(n.map(e=>zc(this,void 0,void 0,function*(){const i=yield this.encrypt(e,t);return new Nc.T(i)}))),e):e})}decryptFolders(e,t){return zc(this,void 0,void 0,function*(){const i=yield(0,fe._)(this.stateProvider.getUser(e,Bc).state$);if(null==i?void 0:i.length)return i;if(null==t)return[];const n=Object.values(t).map(e=>new Gc.v(e)),r=yield(0,fe._)(this.keyService.userKey$(e));if(!r)return[];const s=n.map(e=>zc(this,void 0,void 0,function*(){try{return yield e.decryptWithKey(r,this.encryptService)}catch(t){return null}})),o=(yield Promise.all(s)).filter(e=>null!==e).sort(Se.A.getSortFunction(this.i18nService,"name")),a=new jc.u;return a.name=this.i18nService.t("noneFolder"),o.push(a),yield this.setDecryptedFolders(o,e),o})}encryptedFoldersState(e){return this.stateProvider.getUser(e,Vc)}setDecryptedFolders(e,t){return zc(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Bc,e,t)})}},deps:[Si.Lu,En.N,ts.W,Ml.p,it.v2]}),(0,u.F)({provide:jl.k,useExisting:jl.Z}),(0,u.F)({provide:Gl.w,useClass:class{constructor(e,t){this.folderService=e,this.apiService=t}save(e,t){return Mc(this,void 0,void 0,function*(){const i=new Dc.O(e);let n;null==e.id?(n=yield this.postFolder(i),e.id=n.id):n=yield this.putFolder(e.id,i);const r=new ga.p(n);return yield this.folderService.upsert(r,t),r})}delete(e,t){return Mc(this,void 0,void 0,function*(){yield this.deleteFolder(e),yield this.folderService.delete(e,t)})}deleteAll(e){return Mc(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/folders/all",null,!0,!1),yield this.folderService.clear(e)})}get(e){return Mc(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/folders/"+e,null,!0,!0);return new Oc.s(t)})}postFolder(e){return Mc(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/folders",e,!0,!0);return new Oc.s(t)})}putFolder(e,t){return Mc(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/folders/"+e,t,!0,!0);return new Oc.s(i)})}deleteFolder(e){return this.apiService.send("DELETE","/folders/"+e,null,!0,!1)}},deps:[jl.Z,g.G]}),(0,u.F)({provide:Ue.T,useClass:class{constructor(e,t,i,n,r){this.apiService=e,this.userVerificationService=t,this.logService=i,this.accountService=n,this.environmentService=r}deleteAccount(e){return ot(this,void 0,void 0,function*(){try{const t=yield this.userVerificationService.buildRequest(e);yield this.apiService.send("DELETE","/accounts",t,!0,!1),this.accountService.delete()}catch(t){throw this.logService.error(t),t}})}registerSendVerificationEmail(e){return ot(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.environmentService.environment$);try{return yield this.apiService.send("POST","/accounts/register/send-verification-email",e,!1,!0,t.getIdentityUrl())}catch(i){if(i instanceof we._&&204===i.statusCode)return null;throw this.logService.error(i),i}})}registerVerificationEmailClicked(e){return ot(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.environmentService.environment$);try{return yield this.apiService.send("POST","/accounts/register/verification-email-clicked",e,!1,!1,t.getIdentityUrl())}catch(i){throw this.logService.error(i),i}})}registerFinish(e){return ot(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.environmentService.environment$);try{return yield this.apiService.send("POST","/accounts/register/finish",e,!1,!0,t.getIdentityUrl())}catch(i){throw this.logService.error(i),i}})}setVerifyDevices(e){return ot(this,void 0,void 0,function*(){try{return yield this.apiService.send("POST","/accounts/verify-devices",e,!0,!0)}catch(t){throw this.logService.error(t),t}})}},deps:[g.G,He.i,is.K,Ge.A6,Qr.v]}),(0,u.F)({provide:Ge.A6,useClass:ye.xy,deps:[ns.U,is.K,it.Y2,it.Ys]}),(0,u.F)({provide:Ge.Di,useExisting:Ge.A6}),(0,u.F)({provide:Be.v,useClass:class{constructor(e,t){this.apiService=e,this.stateProvider=t,this.avatarColor$=this.stateProvider.getActive(Gt).state$}setAvatarColor(e){return Ut(this,void 0,void 0,function*(){const{avatarColor:t}=yield this.apiService.putAvatar(new Mt(e));yield this.stateProvider.setUserState(Gt,t)})}setSyncAvatarColor(e,t){return Ut(this,void 0,void 0,function*(){yield this.stateProvider.getUser(e,Gt).update(()=>t)})}getUserAvatarColor$(e){return this.stateProvider.getUser(e,Gt).state$}},deps:[g.G,it.v2]}),(0,u.F)({provide:is.K,useFactory:()=>new mo.V(!1),deps:[]}),(0,u.F)({provide:o.YD,useClass:o.dw,deps:[Si.Lu,En.N,ts.W,it.v2]}),(0,u.F)({provide:h.oq,useValue:[]}),(0,u.F)({provide:Qr.v,useClass:Co,deps:[it.v2,Ge.Di,h.oq]}),(0,u.F)({provide:f.bj,useClass:f.GX,deps:[it.Ys]}),(0,u.F)({provide:f.Ym,useExisting:f.bj}),(0,u.F)({provide:Vl.R,useClass:class{constructor(e){this.sdkService=e}getCode$(e){return(0,to.O)(0,1e3).pipe((0,ge.n)(()=>this.sdkService.client$.pipe((0,E.T)(t=>t.vault().totp().generate_totp(e)))),(0,At.t)({refCount:!0,bufferSize:1}))}},deps:[os.K5]}),(0,u.F)({provide:Xe.B,useClass:class{constructor(e,t,i,n,r,s,o,a){this.singleUserStateProvider=e,this.globalStateProvider=t,this.platformSupportsSecureStorage=i,this.secureStorageService=n,this.keyGenerationService=r,this.encryptService=s,this.logService=o,this.logoutCallback=a,this.accessTokenKeySecureStorageKey="_accessTokenKey",this.refreshTokenSecureStorageKey="_refreshToken",this.initializeState()}hasAccessToken$(e){return(0,$t.z)([this.singleUserStateProvider.get(e,li).state$,this.singleUserStateProvider.get(e,ci).state$]).pipe((0,E.T)(([e,t])=>Boolean(e||t)))}initializeState(){this.emailTwoFactorTokenRecordGlobalState=this.globalStateProvider.get(hi),this.activeUserIdGlobalState=this.globalStateProvider.get(ye.xU)}setTokens(e,t,i,n,r){return bi(this,void 0,void 0,function*(){if(!e)throw new Error("Access token is required.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");const s=yield this.getUserIdFromAccessToken(e);if(!s)throw new Error("User id not found. Cannot set tokens.");const o=yield this._setAccessToken(e,t,i,s),a=new ai(o);if(n&&(a.refreshToken=yield this.setRefreshToken(n,t,i,s)),null!=r){const e=yield this.setClientId(r[0],t,i,s),n=yield this.setClientSecret(r[1],t,i,s);a.clientIdSecretPair=[e,n]}return a})}getAccessTokenKey(e){return bi(this,void 0,void 0,function*(){const t=yield this.secureStorageService.get(`${e}${this.accessTokenKeySecureStorageKey}`,this.getSecureStorageOptions(e));if(!t)return null;return oi.e.fromJSON(t)})}createAndSaveAccessTokenKey(e){return bi(this,void 0,void 0,function*(){const t=yield this.keyGenerationService.createKey(512);yield this.secureStorageService.save(`${e}${this.accessTokenKeySecureStorageKey}`,t,this.getSecureStorageOptions(e));if(!(yield this.getAccessTokenKey(e)))throw new Error("New Access token key unable to be retrieved from secure storage.");return t})}clearAccessTokenKey(e){return bi(this,void 0,void 0,function*(){yield this.secureStorageService.remove(`${e}${this.accessTokenKeySecureStorageKey}`,this.getSecureStorageOptions(e))})}getOrCreateAccessTokenKey(e){return bi(this,void 0,void 0,function*(){if(!this.platformSupportsSecureStorage)throw new Error("Platform does not support secure storage. Cannot obtain access token key.");if(!e)throw new Error("User id not found. Cannot obtain access token key.");let t=yield this.getAccessTokenKey(e);return t||(t=yield this.createAndSaveAccessTokenKey(e)),t})}encryptAccessToken(e,t){return bi(this,void 0,void 0,function*(){const i=yield this.getOrCreateAccessTokenKey(t);return yield this.encryptService.encryptString(e,i)})}decryptAccessToken(e,t){return bi(this,void 0,void 0,function*(){if(!e)throw new Error("decryptAccessToken: Access token key required. Cannot decrypt access token.");try{return yield this.encryptService.decryptString(t,e)}catch(i){throw this.logService.error("[TokenService] Error decrypting access token",i),i}})}_setAccessToken(e,t,i,n){return bi(this,void 0,void 0,function*(){switch(yield this.determineStorageLocation(t,i,!0)){case yi.SecureStorage:{let t=null;try{const i=yield this.encryptAccessToken(e,n);yield this.singleUserStateProvider.get(n,li).update(e=>i.encryptedString,{shouldUpdate:e=>e!==i.encryptedString}),t=e,yield this.singleUserStateProvider.get(n,ci).update(e=>null)}catch(r){this.logService.error("SetAccessToken: storing encrypted access token in secure storage failed. Falling back to disk storage.",r),t=yield this.singleUserStateProvider.get(n,li).update(t=>e,{shouldUpdate:t=>t!==e})}return t}case yi.Disk:return yield this.singleUserStateProvider.get(n,li).update(t=>e,{shouldUpdate:t=>t!==e});case yi.Memory:return yield this.singleUserStateProvider.get(n,ci).update(t=>e)}})}setAccessToken(e,t,i){return bi(this,void 0,void 0,function*(){if(!e)throw new Error("Access token is required.");const n=yield this.getUserIdFromAccessToken(e);if(!n)throw new Error("User id not found. Cannot save access token.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");return yield this._setAccessToken(e,t,i,n)})}clearAccessToken(e){return bi(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear access token.");this.platformSupportsSecureStorage&&(yield this.clearAccessTokenKey(e)),yield this.singleUserStateProvider.get(e,li).update(e=>null,{shouldUpdate:e=>null!==e}),yield this.singleUserStateProvider.get(e,ci).update(e=>null)})}getAccessToken(e){return bi(this,void 0,void 0,function*(){if(!e)return null;const t=yield this.getStateValueByUserIdAndKeyDef(e,ci);if(null!=t)return t;const i=yield this.getStateValueByUserIdAndKeyDef(e,li);if(!i)return null;if(this.platformSupportsSecureStorage){let t;try{t=yield this.getAccessTokenKey(e)}catch(n){return zt.k.isSerializedEncString(i)?(this.logService.error("Access token key retrieval failed. Unable to decrypt encrypted access token. Logging user out.",n),yield this.logoutCallback("accessTokenUnableToBeDecrypted",e),null):i}if(!t)return zt.k.isSerializedEncString(i)?(this.logService.error("Access token key not found to decrypt encrypted access token. Logging user out."),yield this.logoutCallback("accessTokenUnableToBeDecrypted",e),null):i;try{const e=new zt.k(i);return yield this.decryptAccessToken(t,e)}catch(n){return this.logService.error("Failed to decrypt access token",n),yield this.logoutCallback("accessTokenUnableToBeDecrypted",e),null}}return i})}setRefreshToken(e,t,i,n){return bi(this,void 0,void 0,function*(){if(!n)throw new Error("User id not found. Cannot save refresh token.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");switch(yield this.determineStorageLocation(t,i,!0)){case yi.SecureStorage:{let t=null;try{yield this.saveStringToSecureStorage(n,this.refreshTokenSecureStorageKey,e);const i=yield this.getStringFromSecureStorage(n,this.refreshTokenSecureStorageKey);if(null!==e&&!i)throw new Error("Refresh token failed to save to secure storage.");t=e,yield this.singleUserStateProvider.get(n,di).update(e=>null,{shouldUpdate:e=>null!==e}),yield this.singleUserStateProvider.get(n,ui).update(e=>null)}catch(r){this.logService.error("SetRefreshToken: storing refresh token in secure storage failed. Falling back to disk storage.",r),t=yield this.singleUserStateProvider.get(n,di).update(t=>e,{shouldUpdate:t=>t!==e})}return t}case yi.Disk:return yield this.singleUserStateProvider.get(n,di).update(t=>e,{shouldUpdate:t=>t!==e});case yi.Memory:return yield this.singleUserStateProvider.get(n,ui).update(t=>e)}})}getRefreshToken(e){return bi(this,void 0,void 0,function*(){if(!e)return null;const t=yield this.getStateValueByUserIdAndKeyDef(e,ui);if(null!=t)return t;const i=yield this.getStateValueByUserIdAndKeyDef(e,di);if(null!=i)return i;if(this.platformSupportsSecureStorage)try{const t=yield this.getStringFromSecureStorage(e,this.refreshTokenSecureStorageKey);if(null!=t)return t;this.logService.error("Refresh token not found in secure storage. Access token will fail to refresh upon expiration or manual refresh.")}catch(n){this.logService.error("Failed to retrieve refresh token from secure storage",n),yield this.logoutCallback("refreshTokenSecureStorageRetrievalFailure",e)}return null})}clearRefreshToken(e){return bi(this,void 0,void 0,function*(){if(!e)throw new Error("User id not found. Cannot clear refresh token.");this.platformSupportsSecureStorage&&(yield this.secureStorageService.remove(`${e}${this.refreshTokenSecureStorageKey}`,this.getSecureStorageOptions(e))),yield this.singleUserStateProvider.get(e,ui).update(e=>null),yield this.singleUserStateProvider.get(e,di).update(e=>null,{shouldUpdate:e=>null!==e})})}setClientId(e,t,i,n){return bi(this,void 0,void 0,function*(){if(null!=n||(n=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!n)throw new Error("User id not found. Cannot save client id.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");const r=yield this.determineStorageLocation(t,i,!1);return r===yi.Disk?yield this.singleUserStateProvider.get(n,pi).update(t=>e):r===yi.Memory?yield this.singleUserStateProvider.get(n,mi).update(t=>e):void 0})}getClientId(e){return bi(this,void 0,void 0,function*(){if(!e)return;const t=yield this.getStateValueByUserIdAndKeyDef(e,mi);return null!=t?t:yield this.getStateValueByUserIdAndKeyDef(e,pi)})}clearClientId(e){return bi(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear client id.");yield this.singleUserStateProvider.get(e,mi).update(e=>null),yield this.singleUserStateProvider.get(e,pi).update(e=>null)})}setClientSecret(e,t,i,n){return bi(this,void 0,void 0,function*(){if(null!=n||(n=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!n)throw new Error("User id not found. Cannot save client secret.");if(null==i)throw new Error("Vault Timeout is required.");if(null==t)throw new Error("Vault Timeout Action is required.");const r=yield this.determineStorageLocation(t,i,!1);return r===yi.Disk?yield this.singleUserStateProvider.get(n,vi).update(t=>e):r===yi.Memory?yield this.singleUserStateProvider.get(n,fi).update(t=>e):void 0})}getClientSecret(e){return bi(this,void 0,void 0,function*(){if(!e)return;const t=yield this.getStateValueByUserIdAndKeyDef(e,fi);return null!=t?t:yield this.getStateValueByUserIdAndKeyDef(e,vi)})}clearClientSecret(e){return bi(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear client secret.");yield this.singleUserStateProvider.get(e,fi).update(e=>null),yield this.singleUserStateProvider.get(e,vi).update(e=>null)})}setTwoFactorToken(e,t){return bi(this,void 0,void 0,function*(){yield this.emailTwoFactorTokenRecordGlobalState.update(i=>(null!=i||(i={}),i[e]=t,i))})}getTwoFactorToken(e){return bi(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.emailTwoFactorTokenRecordGlobalState.state$);return t?t[e]:null})}clearTwoFactorToken(e){return bi(this,void 0,void 0,function*(){yield this.emailTwoFactorTokenRecordGlobalState.update(t=>(null!=t||(t={}),delete t[e],t))})}clearTokens(e){return bi(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot clear tokens.");yield Promise.all([this.clearAccessToken(e),this.clearRefreshToken(e),this.clearClientId(e),this.clearClientSecret(e)])})}decodeAccessToken(e){return bi(this,void 0,void 0,function*(){let t=e;if(Se.A.isGuid(e)?t=yield this.getAccessToken(e):null!=t||(t=yield this.getAccessToken(yield(0,fe._)(this.activeUserIdGlobalState.state$))),null==t)throw new Error("Access token not found.");return(0,f.iD)(t)})}getTokenExpirationDate(e){return bi(this,void 0,void 0,function*(){let t;try{t=yield this.decodeAccessToken(e)}catch(n){throw new Error("Failed to decode access token: "+n.message)}if(!t||"number"!=typeof t.exp)return null;const i=new Date(0);return i.setUTCSeconds(t.exp),i})}tokenSecondsRemaining(e){return bi(this,arguments,void 0,function*(e,t=0){const i=yield this.getTokenExpirationDate(e);if(null==i)return 0;const n=i.valueOf()-((new Date).valueOf()+1e3*t);return Math.round(n/1e3)})}tokenNeedsRefresh(e){return bi(this,arguments,void 0,function*(e,t=5){return(yield this.tokenSecondsRemaining(e))<60*t})}getUserId(){return bi(this,void 0,void 0,function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"string"!=typeof e.sub)throw new Error("No user id found");return e.sub})}getUserIdFromAccessToken(e){return bi(this,void 0,void 0,function*(){let t;try{t=yield this.decodeAccessToken(e)}catch(i){throw new Error("Failed to decode access token: "+i.message)}if(!t||"string"!=typeof t.sub)throw new Error("No user id found");return t.sub})}getEmail(){return bi(this,void 0,void 0,function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"string"!=typeof e.email)throw new Error("No email found");return e.email})}getEmailVerified(){return bi(this,void 0,void 0,function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"boolean"!=typeof e.email_verified)throw new Error("No email verification found");return e.email_verified})}getName(){return bi(this,void 0,void 0,function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}return e&&"string"==typeof e.name?e.name:null})}getIssuer(){return bi(this,void 0,void 0,function*(){let e;try{e=yield this.decodeAccessToken()}catch(t){throw new Error("Failed to decode access token: "+t.message)}if(!e||"string"!=typeof e.iss)throw new Error("No issuer found");return e.iss})}getIsExternal(e){return bi(this,void 0,void 0,function*(){let t;try{t=yield this.decodeAccessToken(e)}catch(i){throw new Error("Failed to decode access token: "+i.message)}return Array.isArray(t.amr)&&t.amr.includes("external")})}getSecurityStamp(e){return bi(this,void 0,void 0,function*(){if(null!=e||(e=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!e)throw new Error("User id not found. Cannot get security stamp.");return yield this.getStateValueByUserIdAndKeyDef(e,gi)})}setSecurityStamp(e,t){return bi(this,void 0,void 0,function*(){if(null!=t||(t=yield(0,fe._)(this.activeUserIdGlobalState.state$)),!t)throw new Error("User id not found. Cannot set security stamp.");yield this.singleUserStateProvider.get(t,gi).update(t=>e)})}getStateValueByUserIdAndKeyDef(e,t){return bi(this,void 0,void 0,function*(){return yield(0,fe._)(this.singleUserStateProvider.get(e,t).state$)})}determineStorageLocation(e,t,i){return bi(this,void 0,void 0,function*(){if(null==e)throw new Error("TokenService - determineStorageLocation: We expect the vault timeout action to always exist at this point.");if(null==t)throw new Error("TokenService - determineStorageLocation: We expect the vault timeout to always exist at this point.");return e===ri.W4.LogOut&&t!==ri.Lw.Never?yi.Memory:i&&this.platformSupportsSecureStorage?yi.SecureStorage:yi.Disk})}saveStringToSecureStorage(e,t,i){return bi(this,void 0,void 0,function*(){yield this.secureStorageService.save(`${e}${t}`,i,this.getSecureStorageOptions(e))})}getStringFromSecureStorage(e,t){return bi(this,void 0,void 0,function*(){return yield this.secureStorageService.get(`${e}${t}`,this.getSecureStorageOptions(e))})}getSecureStorageOptions(e){return{storageLocation:si.$B.Disk,useSecureStorage:!0,userId:e}}},deps:[it.Ys,it.Y2,h.Vc,h.G$,xn.$,En.N,is.K,h.dZ]}),(0,u.F)({provide:xn.$,useClass:xn.G,deps:[$n.R]}),(0,u.F)({provide:Si.Lu,useClass:Si.gX,deps:[Ir.O,xn.$,$n.R,En.N,rs.y,is.K,as.d,Ge.Di,it.v2,Si.zZ]}),(0,u.F)({provide:zr.p,useClass:class{constructor(e){this.stateProvider=e}accountSecurityState$(e){return this.stateProvider.getUserState$(Lr,e)}setAccountSecurityState(e,t){return Kr(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Lr,e,t)})}},deps:[it.v2]}),(0,u.F)({provide:Lc.b,useClass:Lc.b,deps:[Ge.Di,I.PV,P.m]}),(0,u.F)({provide:cl.Q,useClass:cl.y,deps:[]}),(0,u.F)({provide:td.JJ,useFactory:td.Im,deps:[En.N,Si.Lu,P.m,Ge.Di,it.v2]}),(0,u.F)({provide:ed.ZS,useClass:ed.Kt,deps:[En.N,Si.Lu,it.v2]}),(0,u.F)({provide:td.GL,useFactory:td.pV,deps:[g.G,ts.W,Si.Lu,En.N,P.m,Ge.Di,it.v2]}),(0,u.F)({provide:h.Ug,useFactory:(e,t)=>()=>{e.showToast({variant:"error",title:t.t("errorRefreshingAccessToken"),message:t.t("errorRefreshingAccessTokenDesc")})},deps:[Jc.f,ts.W]}),(0,u.F)({provide:h.Kk,useValue:{createRequest:(e,t)=>new Request(e,t)}}),(0,u.F)({provide:g.G,useClass:el,deps:[Xe.B,rs.y,Qr.v,Hr.Y,h.Ug,is.K,h.dZ,ri.ep,Ge.Di,h.Kk]}),(0,u.F)({provide:El.u,useExisting:El.x}),(0,u.F)({provide:El.x,useClass:class{constructor(e,t,i,n,r,s){this.accountService=e,this.keyService=t,this.i18nService=i,this.keyGenerationService=n,this.stateProvider=r,this.encryptService=s,this.sendKeySalt="bitwarden-send",this.sendKeyPurpose="send",this.sends$=this.stateProvider.encryptedState$.pipe((0,E.T)(([,e])=>Object.values(e||{}).map(e=>new vl(e)))),this.sendViews$=this.stateProvider.encryptedState$.pipe((0,Xi.H)(([e,t])=>this.decryptSends(Object.values(t||{}).map(e=>new vl(e)),e)))}encrypt(e,t,i,n){return $l(this,void 0,void 0,function*(){var r,s;let o=null;const a=new vl;if(a.id=e.id,a.type=e.type,a.disabled=e.disabled,a.hideEmail=e.hideEmail,a.maxAccessCount=e.maxAccessCount,a.deletionDate=e.deletionDate,a.expirationDate=e.expirationDate,null==e.key){const t=yield this.keyGenerationService.createKeyWithPurpose(128,this.sendKeyPurpose,this.sendKeySalt);e.key=t.material,e.cryptoKey=t.derivedKey}if((null!==(s=null===(r=e.emails)||void 0===r?void 0:r.length)&&void 0!==s?s:0)>0)a.emails=e.emails.join(","),a.password=null;else if(null!=i){const t=yield this.keyGenerationService.deriveKeyFromPassword(i,e.key,new Si.n1(_r.o));a.password=t.keyB64}const l=(yield(0,fe._)(this.accountService.activeAccount$)).id;if(null==n&&(n=yield(0,fe._)(this.keyService.userKey$(l))),a.key=yield this.encryptService.encryptBytes(e.key,n),a.name=yield this.encryptService.encryptString(e.name,e.cryptoKey),a.notes=yield this.encryptService.encryptString(e.notes,e.cryptoKey),a.type===pa.N.Text)a.text=new pl.u,a.text.text=yield this.encryptService.encryptString(e.text.text,e.cryptoKey),a.text.hidden=e.text.hidden;else if(a.type===pa.N.File&&(a.file=new hl.l,null!=t))if(t instanceof ArrayBuffer){const[i,n]=yield this.encryptFileData(e.file.fileName,t,e.cryptoKey,l);a.file.fileName=i,o=n}else o=yield this.parseFile(a,t,e.cryptoKey,l);return[a,o]})}get$(e){return this.sends$.pipe((0,Et.F)((t,i)=>{const n=t.find(t=>t.id===e),r=i.find(t=>t.id===e);if(!n||!r)return!1;const s=Object.keys(r).every(e=>{if(null!=n[e]&&null===r[e]||null===n[e]&&null!=r[e])return!1;switch(e){case"name":case"notes":case"key":return null===n[e]&&null===r[e]||n[e].encryptedString===r[e].encryptedString;case"text":return null==n[e].text&&null==r[e].text||!(null!=n[e].text&&null==r[e].text||null==n[e].text&&null!=r[e].text)&&n[e].text.encryptedString===r[e].text.encryptedString;case"file":return!0;case"revisionDate":case"expirationDate":case"deletionDate":return null===n[e]&&null===r[e]||n[e].getTime()===r[e].getTime();default:return n[e]===r[e]}});return s}),(0,E.T)(t=>t.find(t=>t.id===e)))}getFromState(e){return $l(this,void 0,void 0,function*(){const[,t]=yield this.stateProvider.getEncryptedSends();return null!=t&&t.hasOwnProperty(e)?new vl(t[e]):null})}getAll(){return $l(this,void 0,void 0,function*(){const[,e]=yield this.stateProvider.getEncryptedSends(),t=[];for(const i in e)e.hasOwnProperty(i)&&t.push(new vl(e[i]));return t})}getAllDecryptedFromState(e){return $l(this,void 0,void 0,function*(){if(!e)throw new Error("User ID must not be null or undefined");let t=yield this.stateProvider.getDecryptedSends();if(null!=t)return t;t=[];if(!(yield this.keyService.hasUserKey(e)))throw new Error("No user key found.");const i=[];return(yield this.getAll()).forEach(n=>{i.push(n.decrypt(e).then(e=>t.push(e)))}),yield Promise.all(i),t.sort(Se.A.getSortFunction(this.i18nService,"name")),yield this.stateProvider.setDecryptedSends(t),t})}upsert(e){return $l(this,void 0,void 0,function*(){const[t,i]=yield this.stateProvider.getEncryptedSends();let n=i;if(null==n&&(n={}),e instanceof fa){const t=e;n[t.id]=t}else e.forEach(e=>{n[e.id]=e});yield this.replace(n,t)})}delete(e){return $l(this,void 0,void 0,function*(){const[t,i]=yield this.stateProvider.getEncryptedSends();if(null!=i){if("string"==typeof e){if(null==i[e])return;delete i[e]}else e.forEach(e=>{delete i[e]});yield this.replace(i,t)}})}replace(e,t){return $l(this,void 0,void 0,function*(){yield this.stateProvider.setEncryptedSends(e,t)})}getRotatedData(e,t,i){return $l(this,void 0,void 0,function*(){if(null==t)throw new Error("New user key is required for rotation.");if(null==e)throw new Error("Original user key is required for rotation.");return yield(0,fe._)(this.sends$.pipe((0,Xi.H)(i=>$l(this,void 0,void 0,function*(){return this.toRotatedKeyRequestMap(i,e,t)}))))})}toRotatedKeyRequestMap(e,t,i){return $l(this,void 0,void 0,function*(){return yield Promise.all(e.map(e=>$l(this,void 0,void 0,function*(){const n=yield this.encryptService.decryptBytes(e.key,t);return e.key=yield this.encryptService.encryptBytes(n,i),new xl(e)})))})}parseFile(e,t,i,n){return new Promise((r,s)=>{const o=new FileReader;o.readAsArrayBuffer(t),o.onload=o=>$l(this,void 0,void 0,function*(){try{const[s,a]=yield this.encryptFileData(t.name,o.target.result,i,n);e.file.fileName=s,r(a)}catch(a){s(a)}}),o.onerror=()=>{s("Error reading file.")}})}encryptFileData(e,t,i,n){return $l(this,void 0,void 0,function*(){null==i&&(i=yield(0,fe._)(this.keyService.userKey$(n)));return[yield this.encryptService.encryptString(e,i),yield this.encryptService.encryptFileData(new Uint8Array(t),i)]})}decryptSends(e,t){return $l(this,void 0,void 0,function*(){const i=e.map(e=>e.decrypt(t)),n=yield Promise.all(i);return n.sort(Se.A.getSortFunction(this.i18nService,"name")),n})}},deps:[Ge.Di,Si.Lu,ts.W,xn.$,Pl,En.N]}),(0,u.F)({provide:Pl,useClass:class{constructor(e){this.stateProvider=e,this.activeUserEncryptedState=this.stateProvider.getActive(Tl),this.encryptedState$=this.activeUserEncryptedState.combinedState$,this.activeUserDecryptedState=this.stateProvider.getActive(Fl),this.decryptedState$=this.activeUserDecryptedState.state$}getEncryptedSends(){return Rl(this,void 0,void 0,function*(){return yield(0,fe._)(this.encryptedState$)})}setEncryptedSends(e,t){return Rl(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,Tl).update(()=>e)})}getDecryptedSends(){return Rl(this,void 0,void 0,function*(){return yield(0,fe._)(this.decryptedState$)})}setDecryptedSends(e){return Rl(this,void 0,void 0,function*(){yield this.activeUserDecryptedState.update(()=>e)})}},deps:[it.v2]}),(0,u.F)({provide:Cl.M,useClass:class{constructor(e,t,i){this.apiService=e,this.fileUploadService=t,this.sendService=i}getSend(e){return kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/sends/"+e,null,!0,!0);return new Sl.o(t)})}postSendAccess(e,t,i){return kl(this,void 0,void 0,function*(){const n=yield this.apiService.send("POST","/sends/access/"+e,t,!1,!0,i,t=>{t.set("Send-Id",e)});return new bl(n)})}getSendFileDownloadData(e,t,i){return kl(this,void 0,void 0,function*(){const n=yield this.apiService.send("POST","/sends/"+e.id+"/access/file/"+e.file.id,t,!1,!0,i,t=>{t.set("Send-Id",e.id)});return new wl(n)})}getSends(){return kl(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/sends",null,!0,!0);return new Z.s(e,Sl.o)})}postSend(e){return kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/sends",e,!0,!0);return new Sl.o(t)})}postFileTypeSend(e){return kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/sends/file/v2",e,!0,!0);return new Il(t)})}renewSendFileUploadUrl(e,t){return kl(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET","/sends/"+e+"/file/"+t,null,!0,!0);return new Il(i)})}postSendFile(e,t,i){return this.apiService.send("POST","/sends/"+e+"/file/"+t,i,!0,!1)}putSend(e,t){return kl(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/sends/"+e,t,!0,!0);return new Sl.o(i)})}putSendRemovePassword(e){return kl(this,void 0,void 0,function*(){const t=yield this.apiService.send("PUT","/sends/"+e+"/remove-password",null,!0,!0);return new Sl.o(t)})}deleteSend(e){return this.apiService.send("DELETE","/sends/"+e,null,!0,!1)}save(e){return kl(this,void 0,void 0,function*(){const t=yield this.upload(e),i=new fa(t);return yield this.sendService.upsert(i),new vl(i)})}delete(e){return kl(this,void 0,void 0,function*(){yield this.deleteSend(e),yield this.sendService.delete(e)})}removePassword(e){return kl(this,void 0,void 0,function*(){const t=yield this.putSendRemovePassword(e),i=new fa(t);yield this.sendService.upsert(i)})}upload(e){return kl(this,void 0,void 0,function*(){var t;const i=new yl(e[0],null===(t=e[1])||void 0===t?void 0:t.buffer.byteLength);let n;if(null==e[0].id){if(e[0].type===pa.N.Text)n=yield this.postSend(i);else try{const t=yield this.postFileTypeSend(i);n=t.sendResponse,yield this.fileUploadService.upload(t,e[0].file.fileName,e[1],this.generateMethods(t,n))}catch(r){throw r instanceof we._?new Error(r.getSingleMessage()):r}e[0].id=n.id,e[0].accessId=n.accessId}else n=yield this.putSend(e[0].id,i);return n})}generateMethods(e,t){return{postDirect:this.generatePostDirectCallback(t),renewFileUploadUrl:this.generateRenewFileUploadUrlCallback(t.id,t.file.id),rollback:this.generateRollbackCallback(t.id)}}generatePostDirectCallback(e){return t=>this.postSendFile(e.id,e.file.id,t)}generateRenewFileUploadUrlCallback(e,t){return()=>kl(this,void 0,void 0,function*(){const i=yield this.renewSendFileUploadUrl(e,t);return null==i?void 0:i.url})}generateRollbackCallback(e){return()=>this.deleteSend(e)}},deps:[g.G,es,El.x]}),(0,u.F)({provide:class{},useClass:class{constructor(e){this.apiService=e}getUserPublicKeys(e){return br(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/users/"+e+"/keys",null,!0,!0);return new yr(t)})}},deps:[g.G]}),(0,u.F)({provide:ua.H,useClass:class extends wa{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g,y,b,w,S,I,k,C,T){super(S,r,m,l,u,s,a,i,t,I,d,f,k),this.masterPasswordService=e,this.domainSettingsService=n,this.keyService=o,this.policyService=c,this.keyConnectorService=h,this.providerService=p,this.organizationService=v,this.userDecryptionOptionsService=g,this.avatarService=y,this.logoutCallback=b,this.billingAccountProfileStateService=w,this.securityStateService=C,this.kdfConfigService=T,this.syncInProgress=!1,this.inFlightApiCalls={refreshToken:null,sync:null}}fullSync(e,t){return Sa(this,void 0,void 0,function*(){const{allowThrowOnError:i=!1,skipTokenRefresh:n=!1}="boolean"==typeof t?{allowThrowOnError:t}:null!=t?t:{},r=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id)));this.syncStarted();if((yield(0,fe._)(this.authService.authStatusFor$(r)))===Dt.J.LoggedOut)return this.syncCompleted(!1,r);const s=new Date;let o=!1,a=!0;try{o=yield this.needsSyncing(e)}catch(l){if(a=!1,i)throw this.syncCompleted(!1,r),l}if(!o)return a&&(yield this.setLastSync(s,r)),this.syncCompleted(!1,r);try{n||(null===this.inFlightApiCalls.refreshToken&&(this.inFlightApiCalls.refreshToken=this.apiService.refreshIdentityToken()),yield this.inFlightApiCalls.refreshToken),null===this.inFlightApiCalls.sync?this.inFlightApiCalls.sync=this.apiService.getSync():this.logService.debug("Sync: Sync network call already in progress, returning existing promise");const e=yield this.inFlightApiCalls.sync;return yield this.syncUserDecryption(e.profile.id,e.userDecryption),yield this.syncProfile(e.profile),yield this.syncFolders(e.folders,e.profile.id),yield this.syncCollections(e.collections,e.profile.id),yield this.syncCiphers(e.ciphers,e.profile.id),yield this.syncSends(e.sends,e.profile.id),yield this.syncSettings(e.domains,e.profile.id),yield this.syncPolicies(e.policies,e.profile.id),yield this.setLastSync(s,r),this.syncCompleted(!0,r)}catch(l){if(i)throw this.syncCompleted(!1,r),l;return this.syncCompleted(!1,r)}finally{this.inFlightApiCalls.refreshToken=null,this.inFlightApiCalls.sync=null}})}needsSyncing(e){return Sa(this,void 0,void 0,function*(){if(e)return!0;const t=yield this.getLastSync();if(null==t||0===t.getTime())return!0;const i=yield this.apiService.getAccountRevisionDate();return i<0&&this.logoutCallback&&(yield this.logoutCallback("accountDeleted")),!(new Date(i)<=t)})}syncProfile(e){return Sa(this,void 0,void 0,function*(){const t=yield this.tokenService.getSecurityStamp(e.id);if(null!=t&&t!==e.securityStamp)throw null!=this.logoutCallback&&(yield this.logoutCallback("invalidSecurityStamp")),new Error("Stamp has changed");(null==e?void 0:e.key)&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,e.id)),null!=e.accountKeys?(yield this.keyService.setPrivateKey(e.accountKeys.publicKeyEncryptionKeyPair.wrappedPrivateKey,e.id),null!==e.accountKeys.signatureKeyPair&&(yield this.keyService.setUserSigningKey(e.accountKeys.signatureKeyPair.wrappedSigningKey,e.id),yield this.securityStateService.setAccountSecurityState(e.accountKeys.securityState.securityState,e.id),yield this.keyService.setSignedPublicKey(e.accountKeys.publicKeyEncryptionKeyPair.signedPublicKey,e.id))):yield this.keyService.setPrivateKey(e.privateKey,e.id),yield this.keyService.setProviderKeys(e.providers,e.id),yield this.keyService.setOrgKeys(e.organizations,e.providerOrganizations,e.id),yield this.avatarService.setSyncAvatarColor(e.id,e.avatarColor),yield this.tokenService.setSecurityStamp(e.securityStamp,e.id),yield this.accountService.setAccountEmailVerified(e.id,e.emailVerified),yield this.accountService.setAccountVerifyNewDeviceLogin(e.id,e.verifyDevices),yield this.accountService.setAccountCreationDate(e.id,e.creationDate),yield this.billingAccountProfileStateService.setHasPremium(e.premiumPersonally,e.premiumFromOrganization,e.id),yield this.keyConnectorService.setUsesKeyConnector(e.usesKeyConnector,e.id),yield this.setForceSetPasswordReasonIfNeeded(e);const i={};e.providers.forEach(e=>{i[e.id]=new ha(e)}),yield this.providerService.save(i,e.id),yield this.syncProfileOrganizations(e,e.id),(yield(0,fe._)(this.keyConnectorService.convertAccountRequired$))&&this.messageSender.send("convertAccountToKeyConnector")})}setForceSetPasswordReasonIfNeeded(e){return Sa(this,void 0,void 0,function*(){var t;e.forcePasswordReset&&(yield this.masterPasswordService.setForceSetPasswordReason(Cr.n.AdminForcePasswordReset,e.id));const i=yield(0,fe._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e.id));null==i&&this.logService.error("Sync: Account decryption options are null or undefined.");let n=!1;for(const r of e.organizations){const e=r.type===Ae.D7.Admin,t=r.type===Ae.D7.Owner;if(e||t||r.permissions&&r.permissions.manageResetPassword){n=!0;break}}if(void 0!==i.trustedDeviceOption&&!i.hasMasterPassword&&n){const e=null===(t=yield(0,fe._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;yield this.masterPasswordService.setForceSetPasswordReason(Cr.n.TdeUserWithoutPasswordHasPasswordResetPermission,e)}})}syncProfileOrganizations(e,t){return Sa(this,void 0,void 0,function*(){const i={};e.organizations.forEach(e=>{i[e.id]=new O.o(e,{isMember:!0,isProviderUser:!1})}),e.providerOrganizations.forEach(e=>{null==i[e.id]?i[e.id]=new O.o(e,{isMember:!1,isProviderUser:!0}):i[e.id].isProviderUser=!0}),yield this.organizationService.replace(i,t)})}syncFolders(e,t){return Sa(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new ga.p(e)}),yield this.folderService.replace(i,t)})}syncCollections(e,t){return Sa(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new o.Fw(e)}),yield this.collectionService.replace(i,t)})}syncCiphers(e,t){return Sa(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new qo.A(e)}),yield this.cipherService.replace(i,t)})}syncSends(e,t){return Sa(this,void 0,void 0,function*(){const i={};return e.forEach(e=>{i[e.id]=new fa(e)}),yield this.sendService.replace(i,t)})}syncSettings(e,t){return Sa(this,void 0,void 0,function*(){let i=[];return null!=e&&null!=e.equivalentDomains&&(i=i.concat(e.equivalentDomains)),null!=e&&null!=e.globalEquivalentDomains&&e.globalEquivalentDomains.forEach(e=>{e.domains.length>0&&i.push(e.domains)}),this.domainSettingsService.setEquivalentDomains(i,t)})}syncPolicies(e,t){return Sa(this,void 0,void 0,function*(){const i={};return null!=e&&e.forEach(e=>{i[e.id]=new Ie.L(e)}),yield this.policyService.replace(i,t)})}syncUserDecryption(e,t){return Sa(this,void 0,void 0,function*(){if(null!=t&&null!=t.masterPasswordUnlock){const i=t.masterPasswordUnlock.toMasterPasswordUnlockData();yield this.masterPasswordService.setMasterPasswordUnlockData(i,e),yield this.kdfConfigService.setKdfConfig(e,i.kdf)}})}},deps:[Ir.O,Ge.Di,g.G,Gi.V,jl.Z,Ml.p,Si.Lu,o.YD,ns.U,P.N,El.x,is.K,ar.K,$.$,Gl.w,I.k4,Cl.M,f.Ym,Be.v,h.dZ,Bi.Q,Xe.B,Ve.u,it.v2,zr.p,Si.zZ]}),(0,u.F)({provide:Wr.y,useClass:class{constructor(e){this.messageListener=e,this.subscriptions=new Map}subscribe(e,t){this.subscriptions.set(e,this.messageListener.allMessages$.subscribe(e=>{t(e)}))}unsubscribe(e){const t=this.subscriptions.get(e);null==t||t.unsubscribe(),this.subscriptions.delete(e)}},deps:[ws.qk]}),(0,u.F)({provide:ri.ep,useClass:ri.rq,deps:[Ge.Di,Er,f.Ym,Si.Lu,Xe.B,P.m,Si.vB,it.v2,is.K,h.de,Yr.T]}),(0,u.F)({provide:ri.a6,useClass:ri.a6,deps:[Ge.Di,rs.y,Ve.u,ri.ep,Ts.Cc,is.K,f.FQ,f.k4]}),(0,u.F)({provide:ri.nv,useExisting:ri.a6}),(0,u.F)({provide:_e._,useClass:class{constructor(e,t,i){this.stateProvider=e,this.logService=t,this.policyService=i,this.codeVerifierState=this.stateProvider.getGlobal(Zt),this.ssoState=this.stateProvider.getGlobal(Qt),this.orgSsoIdentifierState=this.stateProvider.getGlobal(ti),this.ssoEmailState=this.stateProvider.getGlobal(ii),this.ssoRequiredCacheState=this.stateProvider.getGlobal(ni),this.ssoRequiredCache$=this.ssoRequiredCacheState.state$.pipe((0,E.T)(e=>new Set(e)))}getCodeVerifier(){return(0,fe._)(this.codeVerifierState.state$)}setCodeVerifier(e){return Jt(this,void 0,void 0,function*(){yield this.codeVerifierState.update(t=>e)})}getSsoState(){return(0,fe._)(this.ssoState.state$)}setSsoState(e){return Jt(this,void 0,void 0,function*(){yield this.ssoState.update(t=>e)})}getOrganizationSsoIdentifier(){return(0,fe._)(this.orgSsoIdentifierState.state$)}setOrganizationSsoIdentifier(e){return Jt(this,void 0,void 0,function*(){yield this.orgSsoIdentifierState.update(t=>e)})}getSsoEmail(){return(0,fe._)(this.ssoEmailState.state$)}setSsoEmail(e){return Jt(this,void 0,void 0,function*(){yield this.ssoEmailState.update(t=>e)})}clearSsoEmail(){return Jt(this,void 0,void 0,function*(){yield this.ssoEmailState.update(e=>null)})}getActiveUserOrganizationSsoIdentifier(e){return(0,fe._)(this.userOrgSsoIdentifierState(e).state$)}setActiveUserOrganizationSsoIdentifier(e,t){return Jt(this,void 0,void 0,function*(){void 0!==t?yield this.userOrgSsoIdentifierState(t).update(t=>e):this.logService.error("Tried to set a user organization sso identifier with an undefined user id.")})}userOrgSsoIdentifierState(e){return this.stateProvider.getUser(e,ei)}addToSsoRequiredCache(e){return Jt(this,void 0,void 0,function*(){yield this.ssoRequiredCacheState.update(t=>null==t?[e]:[...t,e],{shouldUpdate:t=>null==t||!t.includes(e)})})}removeFromSsoRequiredCacheIfPresent(e){return Jt(this,void 0,void 0,function*(){yield this.ssoRequiredCacheState.update(t=>{var i;return null!==(i=null==t?void 0:t.filter(t=>t!==e))&&void 0!==i?i:t},{shouldUpdate:t=>null!=t&&t.includes(e)})})}updateSsoRequiredCache(e,t){return Jt(this,void 0,void 0,function*(){(yield(0,fe._)(this.policyService.policyAppliesToUser$(Ae.tt.RequireSso,t)))?yield this.addToSsoRequiredCache(e.toLowerCase()):yield this.removeFromSsoRequiredCacheIfPresent(e.toLowerCase())})}},deps:[it.v2,is.K,P.m]}),(0,u.F)({provide:as.d,useClass:id.mH,deps:[ls.zq,h.G$,id.Bz]}),(0,u.F)({provide:rd.DX,useClass:rd.n_,deps:[jl.k,Ml.p,xn.$,Si.Lu,En.N,$n.R,Si.zZ,g.G,Lc.b]}),(0,u.F)({provide:rd.SF,useClass:rd.Rf,deps:[g.G]}),(0,u.F)({provide:rd.to,useClass:rd.zo,deps:[Ml.p,rd.SF,xn.$,Si.Lu,En.N,$n.R,o.YD,Si.zZ,Lc.b]}),(0,u.F)({provide:rd.Os,useClass:rd.C8,deps:[rd.DX,rd.to,Ge.Di]}),(0,u.F)({provide:Nl.S,useClass:Kc.Sc,deps:[is.K,ts.W,it.v2]}),(0,u.F)({provide:zs,useClass:zs,deps:[g.G,Hr.Y]}),(0,u.F)({provide:As,useClass:As,deps:[g.G,is.K,rs.y]}),(0,u.F)({provide:Ns,useClass:js,deps:[]}),(0,u.F)({provide:us,useClass:hs,deps:[]}),(0,u.F)({provide:us,useClass:hs,deps:[]}),(0,u.F)({provide:class{},useClass:class{constructor(){this.notificationClicked$=(0,bn.$)(()=>new Error("Notification clicked is not supported."))}create(e){return Ia(this,void 0,void 0,function*(){throw new Error("Create OS Notification unsupported.")})}clear(e){throw new Error("Clear OS Notification unsupported.")}isSupported(){return!1}},deps:[]}),(0,u.F)({provide:Pt.O,useClass:Pt.O,deps:[it.v2]}),(0,u.F)({provide:Ne,useClass:class{constructor(){}receivedPendingAuthRequest(e,t){return Rt(this,void 0,void 0,function*(){})}handleAuthRequestNotificationClicked(e){return Rt(this,void 0,void 0,function*(){})}processPendingAuthRequests(){return Rt(this,void 0,void 0,function*(){})}},deps:[]}),(0,u.F)({provide:Fs.J,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h){this.logService=e,this.syncService=t,this.appIdService=i,this.environmentService=n,this.logoutCallback=r,this.messagingService=s,this.accountService=o,this.signalRConnectionService=a,this.authService=l,this.webPushConnectionService=c,this.authRequestAnsweringService=d,this.configService=u,this.policyService=h,this.activitySubject=new ue.t("active"),this.notifications$=this.configService.getFeatureFlag$(dn.TO.InactiveUserServerNotification).pipe((0,Et.F)(),(0,ge.n)(e=>e?this.accountService.accounts$.pipe((0,E.T)(e=>{const t=Object.entries(e).filter(([e,t])=>""!==t.email||t.emailVerified).map(([e,t])=>e);return new Set(t)}),(0,Ee.pn)(e=>this.userNotifications$(e).pipe((0,E.T)(t=>[t,e])))):this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id),(0,Et.F)(),(0,ge.n)(e=>null==e?Ds.w:this.userNotifications$(e).pipe((0,E.T)(t=>[t,e]))))),(0,Os.u)())}userNotifications$(e){return this.environmentService.getEnvironment$(e).pipe((0,E.T)(e=>e.getNotificationsUrl()),(0,Et.F)(),(0,ge.n)(t=>"http://-"===t?Ds.w:this.userNotificationsHelper$(e,t)))}userNotificationsHelper$(e,t){return this.hasAccessToken$(e).pipe((0,ge.n)(e=>e?this.activitySubject:Ds.w),(0,ge.n)(t=>"inactive"===t?Ds.w:this.webPushConnectionService.supportStatus$(e)),(i={supported:i=>(this.logService.info("Using WebPush for server notifications"),i.notifications$.pipe((0,In.W)(i=>(this.logService.warning("Issue with web push, falling back to SignalR",i),this.connectSignalR$(e,t))))),notSupported:()=>(this.logService.info("Using SignalR for server notifications"),this.connectSignalR$(e,t))},(0,ge.n)((e,t)=>"supported"===e.type?i.supported(e.service,t):i.notSupported(e.reason,t))));var i}connectSignalR$(e,t){return this.signalRConnectionService.connect$(e,t).pipe((0,dr.p)(e=>"ReceiveMessage"===e.type),(0,E.T)(e=>e.message))}hasAccessToken$(e){return this.configService.getFeatureFlag$(dn.TO.PushNotificationsWhenLocked).pipe((0,Et.F)(),(0,ge.n)(t=>t?this.authService.authStatusFor$(e).pipe((0,E.T)(e=>e===Dt.J.Locked||e===Dt.J.Unlocked),(0,Et.F)()):this.authService.authStatusFor$(e).pipe((0,E.T)(e=>e===Dt.J.Unlocked),(0,Et.F)())))}processNotification(e,t){return Us(this,void 0,void 0,function*(){var i,n;const r=yield this.appIdService.getAppId();if(null==e||e.contextId===r)return;const s=(null===(i=e.payload)||void 0===i?void 0:i.userId)||(null===(n=e.payload)||void 0===n?void 0:n.UserId);if(null==s||s===t){if(yield(0,fe._)(this.configService.getFeatureFlag$(dn.TO.InactiveUserServerNotification))){if(!((yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>null==e?void 0:e.id))))===t)&&!Gs.has(e.type))return}switch(e.type){case be._n.SyncCipherCreate:case be._n.SyncCipherUpdate:yield this.syncService.syncUpsertCipher(e.payload,e.type===be._n.SyncCipherUpdate,t);break;case be._n.SyncCipherDelete:case be._n.SyncLoginDelete:yield this.syncService.syncDeleteCipher(e.payload,t);break;case be._n.SyncFolderCreate:case be._n.SyncFolderUpdate:yield this.syncService.syncUpsertFolder(e.payload,e.type===be._n.SyncFolderUpdate,t);break;case be._n.SyncFolderDelete:yield this.syncService.syncDeleteFolder(e.payload,t);break;case be._n.SyncVault:case be._n.SyncCiphers:case be._n.SyncSettings:yield this.syncService.fullSync(!1);break;case be._n.SyncOrganizations:yield this.syncService.fullSync(!0);break;case be._n.SyncOrgKeys:yield this.syncService.fullSync(!0),this.activitySubject.next("inactive"),this.activitySubject.next("active");break;case be._n.LogOut:{this.logService.info("[Notifications Service] Received logout notification");const i=e.payload;(yield(0,fe._)(this.configService.getFeatureFlag$(dn.TO.NoLogoutOnKdfChange)))&&i.reason===be.Oc.KdfChange?this.logService.info("[Notifications Service] Skipping logout due to no logout KDF change"):yield this.logoutCallback("logoutNotification",t);break}case be._n.SyncSendCreate:case be._n.SyncSendUpdate:yield this.syncService.syncUpsertSend(e.payload,e.type===be._n.SyncSendUpdate);break;case be._n.SyncSendDelete:yield this.syncService.syncDeleteSend(e.payload);break;case be._n.AuthRequest:yield this.authRequestAnsweringService.receivedPendingAuthRequest(e.payload.userId,e.payload.id),this.messagingService.send("openLoginApproval",{notificationId:e.payload.id});break;case be._n.SyncOrganizationStatusChanged:case be._n.SyncOrganizationCollectionSettingChanged:yield this.syncService.fullSync(!0);break;case be._n.OrganizationBankAccountVerified:this.messagingService.send("organizationBankAccountVerified",{organizationId:e.payload.organizationId});break;case be._n.ProviderBankAccountVerified:this.messagingService.send("providerBankAccountVerified",{providerId:e.payload.providerId,adminId:e.payload.adminId});break;case be._n.SyncPolicy:yield this.policyService.syncPolicy(Ie.L.fromPolicy(e.payload.policy))}}})}startListening(){return this.notifications$.pipe((0,Ms.Z)(e=>Us(this,[e],void 0,function*([e,t]){try{yield this.processNotification(e,t)}catch(i){this.logService.error(`Problem processing notification of type ${e.type}`,i)}}))).subscribe({error:e=>this.logService.error("Fatal error in server notifications$ observable, notifications won't be recieved anymore.",e)})}reconnectFromActivity(){this.activitySubject.next("active")}disconnectFromInactivity(){this.activitySubject.next("inactive")}},deps:[is.K,ua.H,Hr.Y,Qr.v,h.dZ,ns.U,Ge.Di,As,Ve.u,Ns,Ne,Zr.w,P.N]}),(0,u.F)({provide:$n.R,useClass:class{constructor(e){var t;if(null==(null===(t=null==e?void 0:e.crypto)||void 0===t?void 0:t.subtle)){const e=document.createElement("div");e.setAttribute("role","alert"),e.appendChild(document.createTextNode("You are not using a secure context which is required for the Subtle Crypto API to work. "));const t=document.createElement("a");t.appendChild(document.createTextNode("You need to enable HTTPS!")),t.href="https://github.com/dani-garcia/vaultwarden/wiki/Enabling-HTTPS",e.appendChild(t);const i=document.getElementsByClassName("spinner-container")[0];throw i.setAttribute("class","toast-center-center tw-fixed tw-w-full tw-max-w-md tw-mx-auto tw-p-2 tw-ps-4 tw-text-main tw-bg-warning-100 tw-border-solid tw-border-2 tw-border-warning-700 tw-rounded-2xl"),i.replaceChild(e,i.firstChild),new Error("Could not instantiate WebCryptoFunctionService. Could not locate Subtle crypto.")}this.crypto=e.crypto,this.subtle=this.crypto.subtle}pbkdf2(e,t,i,n){return Gn(this,void 0,void 0,function*(){const r="sha256"===i?256:512,s=this.toBuf(e),o={name:"PBKDF2",salt:this.toBuf(t),iterations:n,hash:{name:this.toWebCryptoAlgorithm(i)}},a=yield this.subtle.importKey("raw",s,{name:"PBKDF2"},!1,["deriveBits"]),l=yield this.subtle.deriveBits(o,a,r);return new Uint8Array(l)})}hkdf(e,t,i,n,r){return Gn(this,void 0,void 0,function*(){const s={name:"HKDF",salt:this.toBuf(t),info:this.toBuf(i),hash:{name:this.toWebCryptoAlgorithm(r)}},o=yield this.subtle.importKey("raw",e,{name:"HKDF"},!1,["deriveBits"]),a=yield this.subtle.deriveBits(s,o,8*n);return new Uint8Array(a)})}hkdfExpand(e,t,i,n){return Gn(this,void 0,void 0,function*(){const r="sha256"===n?32:64;if(i>255*r)throw new Error("outputByteSize is too large.");if(new Uint8Array(e).length<r)throw new Error("prk is too small.");const s=this.toBuf(t),o=new Uint8Array(s);let a=0,l=new Uint8Array(0);const c=Math.ceil(i/r),d=new Uint8Array(c*r);for(let t=0;t<c;t++){const r=new Uint8Array(l.length+o.length+1);if(r.set(l),r.set(o,l.length),r.set([t+1],r.length-1),l=new Uint8Array(yield this.hmac(r,e,n)),d.set(l,a),a+=l.length,a>=i)break}return d.slice(0,i)})}hash(e,t){return Gn(this,void 0,void 0,function*(){if("md5"===t){const t=Un.md.md5.create(),i=this.toByteString(e);return t.update(i,"raw"),Se.A.fromByteStringToArray(t.digest().data)}const i=this.toBuf(e),n=yield this.subtle.digest({name:this.toWebCryptoAlgorithm(t)},i);return new Uint8Array(n)})}hmac(e,t,i){return Gn(this,void 0,void 0,function*(){const n={name:"HMAC",hash:{name:this.toWebCryptoAlgorithm(i)}},r=yield this.subtle.importKey("raw",t,n,!1,["sign"]),s=yield this.subtle.sign(n,r,e);return new Uint8Array(s)})}hmacFast(e,t,i){const n=Un.hmac.create();n.start(i,t),n.update(e);const r=n.digest().getBytes();return Promise.resolve(r)}compareFast(e,t){return Gn(this,void 0,void 0,function*(){const i=yield this.randomBytes(32),n=new Uint32Array(i),r=Un.util.createBuffer();for(let e=0;e<n.length;e++)r.putInt32(n[e]);const s=r.getBytes(),o=Un.hmac.create();o.start("sha256",s),o.update(e);const a=o.digest().getBytes();o.start("sha256",null),o.update(t);return a===o.digest().getBytes()})}aesDecryptFastParameters(e,t,i,n){const r=n.inner();if(r.type===si.Qd.AesCbc256_B64)return{iv:Un.util.decode64(t),data:Un.util.decode64(e),encKey:Un.util.createBuffer(r.encryptionKey).getBytes()};if(r.type===si.Qd.AesCbc256_HmacSha256_B64){const n=Un.util.decode64(t)+Un.util.decode64(e);return{iv:Un.util.decode64(t),data:Un.util.decode64(e),encKey:Un.util.createBuffer(r.encryptionKey).getBytes(),macKey:Un.util.createBuffer(r.authenticationKey).getBytes(),mac:Un.util.decode64(i),macData:n}}throw new Error("Unsupported encryption type.")}aesDecryptFast({mode:e,parameters:t}){const i=Un.cipher.createDecipher(this.toWebCryptoAesMode(e),t.encKey),n={};"cbc"===e&&(n.iv=t.iv);const r=Un.util.createBuffer(t.data);i.start(n),i.update(r),i.finish();const s=i.output.toString();return Promise.resolve(s)}aesDecrypt(e,t,i,n){return Gn(this,void 0,void 0,function*(){if("ecb"===n){const t={data:this.toByteString(e),encKey:this.toByteString(i)},n=yield this.aesDecryptFast({mode:"ecb",parameters:t});return Se.A.fromByteStringToArray(n)}const r=yield this.subtle.importKey("raw",i,{name:"AES-CBC"},!1,["decrypt"]);if(null==t)throw new Error("IV is required for CBC mode.");const s=yield this.subtle.decrypt({name:"AES-CBC",iv:t},r,e);return new Uint8Array(s)})}rsaEncrypt(e,t,i){return Gn(this,void 0,void 0,function*(){return yield An.B.Ready,On.PureCrypto.rsa_encrypt_data(e,t)})}rsaDecrypt(e,t,i){return Gn(this,void 0,void 0,function*(){return yield An.B.Ready,On.PureCrypto.rsa_decrypt_data(e,t)})}rsaExtractPublicKey(e){return Gn(this,void 0,void 0,function*(){return yield An.B.Ready,On.PureCrypto.rsa_extract_public_key(e)})}rsaGenerateKeyPair(e){return Gn(this,void 0,void 0,function*(){yield An.B.Ready;const e=On.PureCrypto.rsa_generate_keypair();return[yield this.rsaExtractPublicKey(e),e]})}aesGenerateKey(){return Gn(this,arguments,void 0,function*(e=960){if(512===e){const e=yield this.aesGenerateKey(256),t=yield this.aesGenerateKey(256);return new Uint8Array([...e,...t])}const t={name:"AES-CBC",length:e},i=yield this.subtle.generateKey(t,!0,["encrypt","decrypt"]),n=yield this.subtle.exportKey("raw",i);return new Uint8Array(n)})}randomBytes(e){const t=new Uint8Array(e);return this.crypto.getRandomValues(t),Promise.resolve(t)}toBuf(e){let t;return t="string"==typeof e?Se.A.fromUtf8ToArray(e):e,t}toByteString(e){let t;return t="string"==typeof e?Un.util.encodeUtf8(e):Se.A.fromBufferToByteString(e),t}toWebCryptoAlgorithm(e){if("md5"===e)throw new Error("MD5 is not supported in WebCrypto.");return"sha1"===e?"SHA-1":"sha256"===e?"SHA-256":"SHA-512"}toWebCryptoAesMode(e){return"cbc"===e?"AES-CBC":"AES-ECB"}},deps:[h.jf]}),(0,u.F)({provide:En.N,useClass:class{constructor(e,t,i){this.cryptoFunctionService=e,this.logService=t,this.logMacFailures=i,this.disableType0Decryption=!1}init(e){e.serverConfig$.subscribe(e=>{null!=e&&this.setDisableType0Decryption(!0===e.featureStates[dn.TO.PM25174_DisableType0Decryption])})}setDisableType0Decryption(e){this.disableType0Decryption=e}encryptString(e,t){return Mn(this,void 0,void 0,function*(){return null==e?(this.logService.warning("[EncryptService] WARNING: encryptString called with null value. Returning null, but this behavior is deprecated and will be removed."),null):(yield An.B.Ready,new zt.k(On.PureCrypto.symmetric_encrypt_string(e,t.toEncoded())))})}encryptBytes(e,t){return Mn(this,void 0,void 0,function*(){return yield An.B.Ready,new zt.k(On.PureCrypto.symmetric_encrypt_bytes(e,t.toEncoded()))})}encryptFileData(e,t){return Mn(this,void 0,void 0,function*(){return yield An.B.Ready,new Dn.q(On.PureCrypto.symmetric_encrypt_filedata(e,t.toEncoded()))})}decryptString(e,t){return Mn(this,void 0,void 0,function*(){if(this.disableType0Decryption&&e.encryptionType===si.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield An.B.Ready,On.PureCrypto.symmetric_decrypt_string(e.encryptedString,t.toEncoded())})}decryptBytes(e,t){return Mn(this,void 0,void 0,function*(){if(this.disableType0Decryption&&e.encryptionType===si.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield An.B.Ready,On.PureCrypto.symmetric_decrypt_bytes(e.encryptedString,t.toEncoded())})}decryptFileData(e,t){return Mn(this,void 0,void 0,function*(){if(this.disableType0Decryption&&e.encryptionType===si.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield An.B.Ready,On.PureCrypto.symmetric_decrypt_filedata(e.buffer,t.toEncoded())})}wrapDecapsulationKey(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No decapsulation key provided for wrapping.");if(null==t)throw new Error("No wrappingKey provided for wrapping.");return yield An.B.Ready,new zt.k(On.PureCrypto.wrap_decapsulation_key(e,t.toEncoded()))})}wrapEncapsulationKey(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No encapsulation key provided for wrapping.");if(null==t)throw new Error("No wrappingKey provided for wrapping.");return yield An.B.Ready,new zt.k(On.PureCrypto.wrap_encapsulation_key(e,t.toEncoded()))})}wrapSymmetricKey(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No keyToBeWrapped provided for wrapping.");if(null==t)throw new Error("No wrappingKey provided for wrapping.");return yield An.B.Ready,new zt.k(On.PureCrypto.wrap_symmetric_key(e.toEncoded(),t.toEncoded()))})}unwrapDecapsulationKey(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No wrappedDecapsulationKey provided for unwrapping.");if(null==t)throw new Error("No wrappingKey provided for unwrapping.");if(this.disableType0Decryption&&e.encryptionType===si.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield An.B.Ready,On.PureCrypto.unwrap_decapsulation_key(e.encryptedString,t.toEncoded())})}unwrapEncapsulationKey(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No wrappedEncapsulationKey provided for unwrapping.");if(null==t)throw new Error("No wrappingKey provided for unwrapping.");if(this.disableType0Decryption&&e.encryptionType===si.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield An.B.Ready,On.PureCrypto.unwrap_encapsulation_key(e.encryptedString,t.toEncoded())})}unwrapSymmetricKey(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No keyToBeUnwrapped provided for unwrapping.");if(null==t)throw new Error("No wrappingKey provided for unwrapping.");if(this.disableType0Decryption&&e.encryptionType===si.Qd.AesCbc256_B64)throw new Error("Decryption of AesCbc256_B64 encrypted data is disabled.");return yield An.B.Ready,new oi.e(On.PureCrypto.unwrap_symmetric_key(e.encryptedString,t.toEncoded()))})}hash(e,t){return Mn(this,void 0,void 0,function*(){const i=yield this.cryptoFunctionService.hash(e,t);return Se.A.fromBufferToB64(i)})}encapsulateKeyUnsigned(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No sharedKey provided for encapsulation");if(null==t)throw new Error("No encapsulationKey provided for encapsulation");return yield An.B.Ready,new zt.k(On.PureCrypto.encapsulate_key_unsigned(e.toEncoded(),t))})}decapsulateKeyUnsigned(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("No encryptedSharedKey provided for decapsulation");if(null==t)throw new Error("No decapsulationKey provided for decapsulation");yield An.B.Ready;const i=On.PureCrypto.decapsulate_key_unsigned(e.encryptedString,t);return new oi.e(i)})}rsaDecrypt(e,t){return Mn(this,void 0,void 0,function*(){if(null==e)throw new Error("[Encrypt service] rsaDecrypt: No data provided for decryption.");switch(e.encryptionType){case si.Qd.Rsa2048_OaepSha1_B64:case si.Qd.Rsa2048_OaepSha1_HmacSha256_B64:break;default:throw new Error("Invalid encryption type.")}if(null==t)throw new Error("[Encrypt service] rsaDecrypt: No private key provided for decryption.");return this.cryptoFunctionService.rsaDecrypt(e.dataBytes,t,"sha1")})}},deps:[$n.R,is.K,h.Pn]}),(0,u.F)({provide:w.f,useClass:class{constructor(e,t,i,n,r){this.apiService=e,this.stateProvider=t,this.logService=i,this.authService=n,this.taskSchedulerService=r,this.inited=!1,this.taskSchedulerService.registerTaskHandler(al.f.eventUploadsInterval,()=>this.uploadEvents())}init(e){this.inited||(this.inited=!0,e&&(this.uploadEvents(),this.taskSchedulerService.setInterval(al.f.eventUploadsInterval,6e4)))}uploadEvents(e){return ll(this,void 0,void 0,function*(){if(e||(e=yield(0,fe._)(this.stateProvider.activeUserId$)),!e)return;if(!(yield(0,fe._)(this.authService.authStatusFor$(e).pipe((0,E.T)(e=>e===Dt.J.Unlocked)))))return;const t=yield this.takeEvents(e);if(null==t||0===t.length)return;const i=t.map(e=>{const t=new ol;return t.type=e.type,t.cipherId=e.cipherId,t.date=e.date,t.organizationId=e.organizationId,t});try{yield this.apiService.postEventsCollect(i,e)}catch(n){this.logService.error(n),yield this.stateProvider.setUserState(rl,t,e)}})}takeEvents(e){return ll(this,void 0,void 0,function*(){let t=null;return yield this.stateProvider.getUser(e,rl).update(e=>(t=null!=e?e:[],[])),t})}},deps:[g.G,it.v2,is.K,Ve.u,Ts.Cc]}),(0,u.F)({provide:b.c,useClass:class{constructor(e,t,i,n,r,s){this.cipherService=e,this.stateProvider=t,this.organizationService=i,this.eventUploadService=n,this.authService=r,this.accountService=s,this.getOrgIds=e=>{var t,i;return null!==(i=null===(t=null==e?void 0:e.filter(e=>e.useEvents))||void 0===t?void 0:t.map(e=>e.id))&&void 0!==i?i:[]}}collectMany(e,t){return sl(this,arguments,void 0,function*(e,t,i=!1){const n=yield(0,fe._)((0,ye.F6)(this.accountService.activeAccount$)),r=this.stateProvider.getUser(n,rl);if(!(yield this.shouldUpdate(n,null,e,t)))return;const s=this.organizationService.organizations$(n).pipe((0,E.T)(e=>this.getOrgIds(e)),(0,E.T)(i=>t.filter(e=>i.includes(e.organizationId)).map(t=>({type:e,cipherId:t.id,date:(new Date).toISOString(),organizationId:t.organizationId}))));yield r.update((e,t)=>[...null!=e?e:[],...t],{combineLatestWith:s}),i&&(yield this.eventUploadService.uploadEvents())})}collect(e){return sl(this,arguments,void 0,function*(e,t=null,i=!1,n=null){const r=yield(0,fe._)((0,ye.F6)(this.accountService.activeAccount$)),s=this.stateProvider.getUser(r,rl);if(!(yield this.shouldUpdate(r,n,e,void 0,t)))return;const o=new nl;o.type=e,o.cipherId=t,o.date=(new Date).toISOString(),o.organizationId=n,yield s.update(e=>((e=null!=e?e:[]).push(o),e)),i&&(yield this.eventUploadService.uploadEvents())})}shouldUpdate(e){return sl(this,arguments,void 0,function*(e,t=null,i=null,n=[],r){const s=(0,et.H)(this.cipherService.get(r,e)),o=this.organizationService.organizations$(e).pipe((0,E.T)(e=>this.getOrgIds(e))),[a,l,c]=yield(0,fe._)((0,il.y)(this.authService.activeAccountStatus$,o,s));if(a!=Dt.J.Unlocked)return!1;if(null==l||0==l.length)return!1;if(i==be.Bx.User_ClientExportedVault)return!0;if(null!=c&&n.push(new _o.f(c)),(null==n||0==n.length)&&null==t)return!1;if(null!=n&&n.length>0){return n.filter(e=>l.includes(e.organizationId)).length>0}return!(null!=t&&!l.includes(t))})}},deps:[Ml.p,it.v2,I.PV,w.f,Ve.u,Ge.Di]}),(0,u.F)({provide:P.N,useClass:ve.XS,deps:[it.v2,I.PV,Ge.Di]}),(0,u.F)({provide:P.m,useExisting:P.N}),(0,u.F)({provide:R.m,useClass:class{constructor(e,t,i){this.policyService=e,this.apiService=t,this.accountService=i}getPolicy(e,t){return Te(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/policies/"+t,null,!0,!0);return new Ce.i(i)})}getPolicies(e){return Te(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/policies",null,!0,!0);return new Z.s(t,Ce.i)})}getPoliciesByToken(e,t,i,n){return Te(this,void 0,void 0,function*(){const r=yield this.apiService.send("GET","/organizations/"+e+"/policies/token?token="+encodeURIComponent(t)+"&email="+Se.A.encodeRFC3986URIComponent(i)+"&organizationUserId="+n,null,!1,!0);return ke.P.fromListResponse(new Z.s(r,Ce.i))})}getMasterPasswordPolicyResponseForOrgUser(e){return Te(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/policies/master-password",null,!0,!0);return new Ce.i(t)})}getMasterPasswordPolicyOptsForOrgUser(e){return Te(this,void 0,void 0,function*(){try{const t=yield this.getMasterPasswordPolicyResponseForOrgUser(e),i=ke.P.fromResponse(t);return i?(0,fe._)(this.accountService.activeAccount$.pipe(ye.F6,(0,ge.n)(e=>this.policyService.masterPasswordPolicyOptions$(e,[i])),(0,E.T)(e=>null!=e?e:null))):null}catch(t){if(t instanceof we._&&t.statusCode===be.kG.NotFound)return null;throw t}})}putPolicy(e,t,i){return Te(this,void 0,void 0,function*(){const n=yield this.apiService.send("PUT","/organizations/"+e+"/policies/"+t,i,!0,!0);yield this.handleResponse(n)})}putPolicyVNext(e,t,i){return Te(this,void 0,void 0,function*(){const n=yield this.apiService.send("PUT",`/organizations/${e}/policies/${t}/vnext`,i,!0,!0);yield this.handleResponse(n)})}handleResponse(e){return Te(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.accountService.activeAccount$.pipe(ye.F6)),i=new Ce.i(e),n=new Ie.L(i);yield this.policyService.upsert(n,t)})}},deps:[P.N,g.G,Ge.Di]}),(0,u.F)({provide:Ir.O,useClass:class{constructor(e,t,i,n,r){this.stateProvider=e,this.keyGenerationService=t,this.logService=i,this.cryptoFunctionService=n,this.accountService=r}userHasMasterPassword(e){return Tr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId");const t=yield(0,fe._)(this.stateProvider.getUser(e,vr).state$);return(yield(0,fe._)(this.stateProvider.getUser(e,Pr).state$))&&!t})}saltForUser$(e){return(0,qn.x)(e,"userId"),this.accountService.accounts$.pipe((0,E.T)(t=>t[e].email),(0,E.T)(e=>this.emailToSalt(e)))}masterKey$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,Fr).state$}masterKeyHash$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,Rr).state$}forceSetPasswordReason$(e){if(null==e)throw new Error("User ID is required.");return this.stateProvider.getUser(e,xr).state$.pipe((0,E.T)(e=>null!=e?e:Cr.n.None))}getMasterKeyEncryptedUserKey(e){return Tr(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");const t=yield(0,fe._)(this.stateProvider.getUser(e,Pr).state$);return zt.k.fromJSON(t)})}emailToSalt(e){return e.toLowerCase().trim()}setMasterKey(e,t){return Tr(this,void 0,void 0,function*(){if(null==e)throw new Error("Master key is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,Fr).update(t=>e)})}clearMasterKey(e){return Tr(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");yield this.stateProvider.getUser(e,Fr).update(e=>null)})}setMasterKeyHash(e,t){return Tr(this,void 0,void 0,function*(){if(null==e)throw new Error("Master key hash is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,Rr).update(t=>e,{shouldUpdate:t=>t!==e})})}clearMasterKeyHash(e){return Tr(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required.");yield this.stateProvider.getUser(e,Rr).update(e=>null,{shouldUpdate:e=>null!==e})})}setMasterKeyEncryptedUserKey(e,t){return Tr(this,void 0,void 0,function*(){if(null==e||null==e.encryptedString)throw new Error("Encrypted Key is required.");if(null==t)throw new Error("User ID is required.");yield this.stateProvider.getUser(t,Pr).update(t=>e.toJSON())})}setForceSetPasswordReason(e,t){return Tr(this,void 0,void 0,function*(){if(null==e)throw new Error("Reason is required.");if(null==t)throw new Error("User ID is required.");(yield(0,fe._)(this.forceSetPasswordReason$(t)))===Cr.n.AdminForcePasswordReset&&e!==Cr.n.None||(yield this.stateProvider.getUser(t,xr).update(t=>e))})}decryptUserKeyWithMasterKey(e,t,i){return Tr(this,void 0,void 0,function*(){if(null!=i||(i=yield this.getMasterKeyEncryptedUserKey(t)),null!=e||(e=yield(0,fe._)(this.masterKey$(t))),null==e)throw new Error("No master key found.");yield An.B.Ready;try{return new oi.e(On.PureCrypto.decrypt_user_key_with_master_key(i.toSdk(),e.toEncoded()))}catch(n){return this.logService.warning("Failed to decrypt user key with master key."),null}})}makeMasterPasswordAuthenticationData(e,t,i){return Tr(this,void 0,void 0,function*(){if((0,qn.x)(e,"password"),(0,qn.x)(t,"kdf"),(0,qn.x)(i,"salt"),""===e)throw new Error("Master password cannot be empty.");i=i.toLowerCase().trim();const n=yield this.keyGenerationService.deriveKeyFromPassword(e,i,t),r=Se.A.fromBufferToB64(yield this.cryptoFunctionService.pbkdf2(n.toEncoded(),e,"sha256",1));return{salt:i,kdf:t,masterPasswordAuthenticationHash:r}})}makeMasterPasswordUnlockData(e,t,i,n){return Tr(this,void 0,void 0,function*(){if((0,qn.x)(e,"password"),(0,qn.x)(t,"kdf"),(0,qn.x)(i,"salt"),(0,qn.x)(n,"userKey"),""===e)throw new Error("Master password cannot be empty.");i=i.toLowerCase().trim(),yield An.B.Ready;const r=On.PureCrypto.encrypt_user_key_with_master_password(n.toEncoded(),e,i,t.toSdkConfig());return new er.k(i,t,r)})}unwrapUserKeyFromMasterPasswordUnlockData(e,t){return Tr(this,void 0,void 0,function*(){(0,qn.x)(e,"password"),(0,qn.x)(t,"masterPasswordUnlockData"),yield An.B.Ready;return new oi.e(On.PureCrypto.decrypt_user_key_with_master_password(t.masterKeyWrappedUserKey,e,t.salt,t.kdf.toSdkConfig()))})}setMasterPasswordUnlockData(e,t){return Tr(this,void 0,void 0,function*(){(0,qn.x)(e,"masterPasswordUnlockData"),(0,qn.x)(t,"userId"),yield this.stateProvider.getUser(t,$r).update(()=>e.toJSON())})}masterPasswordUnlockData$(e){return(0,qn.x)(e,"userId"),this.stateProvider.getUser(e,$r).state$}},deps:[it.v2,xn.$,is.K,$n.R,Ge.Di]}),(0,u.F)({provide:Ir.L,useExisting:Ir.O}),(0,u.F)({provide:Sr.b,useClass:class{constructor(e,t,i){this.masterPasswordService=e,this.keyService=t,this.logService=i}unlockWithMasterPassword(e,t){return kr(this,void 0,void 0,function*(){this.validateInput(e,t);const i=yield(0,fe._)(this.masterPasswordService.masterPasswordUnlockData$(t));if(null==i)throw new Error("Master password unlock data was not found for the user "+t);const n=yield this.masterPasswordService.unwrapUserKeyFromMasterPasswordUnlockData(e,i);return yield this.setLegacyState(e,i,t),n})}proofOfDecryption(e,t){return kr(this,void 0,void 0,function*(){this.validateInput(e,t);try{const i=yield(0,fe._)(this.masterPasswordService.masterPasswordUnlockData$(t));if(null==i)return this.logService.warning(`[DefaultMasterPasswordUnlockService] No master password unlock data found for user ${t} returning false.`),!1;return null!=(yield this.masterPasswordService.unwrapUserKeyFromMasterPasswordUnlockData(e,i))}catch(i){return(0,On.isCryptoError)(i)&&"InvalidKey"===i.variant?this.logService.debug(`[DefaultMasterPasswordUnlockService] Error during proof of decryption for user ${t} returning false: ${i}`):this.logService.error(`[DefaultMasterPasswordUnlockService] Unexpected error during proof of decryption for user ${t} returning false: ${i}`),!1}})}validateInput(e,t){if(null==e||""===e)throw new Error("Master password is required");if(null==t)throw new Error("User ID is required")}setLegacyState(e,t,i){return kr(this,void 0,void 0,function*(){const n=yield this.keyService.makeMasterKey(e,t.salt,t.kdf);if(!n)throw new Error("Master key could not be created to set legacy master password state.");const r=yield this.keyService.hashMasterKey(e,n,si.VK.LocalAuthorization);yield this.masterPasswordService.setMasterKeyHash(r,i),yield this.masterPasswordService.setMasterKey(n,i)})}},deps:[Ir.O,Si.Lu,is.K]}),(0,u.F)({provide:ar.K,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c){this.masterPasswordService=t,this.keyService=i,this.apiService=n,this.tokenService=r,this.logService=s,this.organizationService=o,this.keyGenerationService=a,this.logoutCallback=l,this.stateProvider=c,this.convertAccountRequired$=e.activeAccount$.pipe((0,dr.p)(e=>null!=e),(0,ge.n)(e=>(0,$t.z)([(0,xt.of)(e.id),this.organizationService.organizations$(e.id).pipe((0,dr.p)(e=>null!=e)),this.stateProvider.getUserState$(vr,e.id).pipe((0,dr.p)(e=>null!=e)),r.hasAccessToken$(e.id).pipe((0,dr.p)(e=>e))])),(0,ge.n)(e=>mr(this,[e],void 0,function*([e,t,i]){const n=yield this.tokenService.getIsExternal(e),r=null!=this.findManagingOrganization(t);return n&&r&&!i})))}setUsesKeyConnector(e,t){return mr(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,vr).update(()=>e)})}getUsesKeyConnector(e){return mr(this,void 0,void 0,function*(){var t;return null!==(t=yield(0,fe._)(this.stateProvider.getUserState$(vr,e)))&&void 0!==t&&t})}migrateUser(e,t){return mr(this,void 0,void 0,function*(){const i=yield(0,fe._)(this.masterPasswordService.masterKey$(t)),n=new hr(Se.A.fromBufferToB64(i.inner().encryptionKey));try{yield this.apiService.postUserKeyToKeyConnector(e,n)}catch(r){this.handleKeyConnectorError(r)}yield this.apiService.postConvertToKeyConnector(),yield this.setUsesKeyConnector(!0,t)})}setMasterKeyFromUrl(e,t){return mr(this,void 0,void 0,function*(){try{const i=yield this.apiService.getMasterKeyFromKeyConnector(e),n=Se.A.fromB64ToArray(i.key),r=new oi.e(n);yield this.masterPasswordService.setMasterKey(r,t)}catch(i){this.handleKeyConnectorError(i)}})}getManagingOrganization(e){return mr(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.organizationService.organizations$(e));return this.findManagingOrganization(t)})}convertNewSsoUserToKeyConnector(e){return mr(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.stateProvider.getUserState$(fr,e));if(null==t)throw new Error("Key Connector conversion not found");const{kdfConfig:i,keyConnectorUrl:n,organizationId:r}=t,s=yield this.keyGenerationService.createKey(512),o=yield this.keyService.makeMasterKey(s.keyB64,yield this.tokenService.getEmail(),i),a=new hr(Se.A.fromBufferToB64(o.inner().encryptionKey));yield this.masterPasswordService.setMasterKey(o,e);const l=yield this.keyService.makeUserKey(o);yield this.keyService.setUserKey(l[0],e),yield this.masterPasswordService.setMasterKeyEncryptedUserKey(l[1],e);const[c,d]=yield this.keyService.makeKeyPair(l[0]);try{yield this.apiService.postUserKeyToKeyConnector(n,a)}catch(p){this.handleKeyConnectorError(p)}const u=new ur.G(c,d.encryptedString),h=new pr(l[1].encryptedString,i,r,u);yield this.apiService.postSetKeyConnectorKey(h),yield this.stateProvider.getUser(e,fr).update(()=>null)})}setNewSsoUserKeyConnectorConversionData(e,t){return mr(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,fr).update(()=>e)})}requiresDomainConfirmation$(e){return this.stateProvider.getUserState$(fr,e).pipe((0,E.T)(e=>null!=e?{keyConnectorUrl:e.keyConnectorUrl,organizationSsoIdentifier:e.organizationId}:null))}handleKeyConnectorError(e){throw this.logService.error(e),null!=this.logoutCallback&&this.logoutCallback("keyConnectorError"),new Error("Key Connector error")}findManagingOrganization(e){return e.find(e=>e.keyConnectorEnabled&&e.type!==Ae.D7.Admin&&e.type!==Ae.D7.Owner&&!e.isProviderUser)}},deps:[Ge.Di,Ir.O,Si.Lu,g.G,Xe.B,is.K,I.PV,xn.$,h.dZ,it.v2]}),(0,u.F)({provide:He.i,useClass:class{constructor(e,t,i,n,r,s,o,a,l){this.keyService=e,this.accountService=t,this.masterPasswordService=i,this.i18nService=n,this.userVerificationApiService=r,this.userDecryptionOptionsService=s,this.pinService=o,this.kdfConfigService=a,this.biometricsService=l}getAvailableVerificationOptions(e){return Ti(this,void 0,void 0,function*(){var t;const i=null===(t=yield(0,fe._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;if("client"===e){const[e,t,n]=yield Promise.all([this.hasMasterPasswordAndMasterKeyHash(i),this.pinService.isPinDecryptionAvailable(i),this.biometricsService.getBiometricsStatus()]);return{client:{masterPassword:e,pin:t,biometrics:n===Si.cR.Available},server:{masterPassword:!1,otp:!1}}}{const e=yield this.hasMasterPassword(i);return{client:{masterPassword:!1,pin:!1,biometrics:!1},server:{masterPassword:e,otp:!e}}}})}buildRequest(e,t){return Ti(this,void 0,void 0,function*(){this.validateSecretInput(e);const i=null!=t?new t:new ki.V;if(e.type===Ii.k.OTP)i.otp=e.secret;else{const t=yield(0,fe._)(this.accountService.activeAccount$.pipe(ye.F6)),n=yield this.kdfConfigService.getKdfConfig(t),r=yield(0,fe._)(this.masterPasswordService.saltForUser$(t)),s=yield this.masterPasswordService.makeMasterPasswordAuthenticationData(e.secret,n,r);i.authenticateWith(s)}return i})}verifyUser(e){return Ti(this,void 0,void 0,function*(){if(null==e)throw new Error("Verification is required.");const[t,i]=yield(0,fe._)(this.accountService.activeAccount$.pipe((0,E.T)(e=>[null==e?void 0:e.id,null==e?void 0:e.email])));switch(function(e){return"secret"in e}(e)&&this.validateSecretInput(e),e.type){case Ii.k.OTP:return this.verifyUserByOTP(e);case Ii.k.MasterPassword:return yield this.verifyUserByMasterPassword(e,t,i),!0;case Ii.k.PIN:return this.verifyUserByPIN(e,t);case Ii.k.Biometrics:return this.verifyUserByBiometrics();default:return e}})}verifyUserByOTP(e){return Ti(this,void 0,void 0,function*(){const t=new Ci(e.secret);try{yield this.userVerificationApiService.postAccountVerifyOTP(t)}catch(i){throw new Error(this.i18nService.t("invalidVerificationCode"))}return!0})}verifyUserByMasterPassword(e,t,i){return Ti(this,void 0,void 0,function*(){if(!e.secret)throw new Error("Master Password is required. Cannot verify user without a master password.");if(!t)throw new Error("User ID is required. Cannot verify user by master password.");if(!i)throw new Error("Email is required. Cannot verify user by master password.");const n=yield this.kdfConfigService.getKdfConfig(t);if(!n)throw new Error("KDF config is required. Cannot verify user by master password.");let r,s=yield(0,fe._)(this.masterPasswordService.masterKey$(t));if(s||(s=yield this.keyService.makeMasterKey(e.secret,i,n)),!s)throw new Error("Master key could not be created to verify the master password.");if(yield this.hasMasterPasswordAndMasterKeyHash(t)){if(!(yield this.keyService.compareKeyHash(e.secret,s,t)))throw new Error(this.i18nService.t("invalidMasterPassword"));r=null}else{const t=new ki.V,i=yield this.keyService.hashMasterKey(e.secret,s,si.VK.ServerAuthorization);t.masterPasswordHash=i;try{r=yield this.userVerificationApiService.postAccountVerifyPassword(t)}catch(a){throw new Error(this.i18nService.t("invalidMasterPassword"))}}const o=yield this.keyService.hashMasterKey(e.secret,s,si.VK.LocalAuthorization);return yield this.masterPasswordService.setMasterKeyHash(o,t),yield this.masterPasswordService.setMasterKey(s,t),{policyOptions:r,masterKey:s,email:i}})}verifyUserByPIN(e,t){return Ti(this,void 0,void 0,function*(){if(!t)throw new Error("User ID is required. Cannot verify user by PIN.");return null!=(yield this.pinService.decryptUserKeyWithPin(e.secret,t))})}verifyUserByBiometrics(){return Ti(this,void 0,void 0,function*(){return this.biometricsService.authenticateWithBiometrics()})}requestOTP(){return Ti(this,void 0,void 0,function*(){yield this.userVerificationApiService.postAccountRequestOTP()})}hasMasterPassword(e){return Ti(this,void 0,void 0,function*(){var t;const i=null!=e?e:null===(t=yield(0,fe._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;return!!i&&(yield(0,fe._)(this.userDecryptionOptionsService.hasMasterPasswordById$(i)))})}hasMasterPasswordAndMasterKeyHash(e){return Ti(this,void 0,void 0,function*(){var t;return null!=e||(e=null===(t=yield(0,fe._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id),(yield this.hasMasterPassword(e))&&null!=(yield(0,fe._)(this.masterPasswordService.masterKeyHash$(e)))})}validateSecretInput(e){if(null==(null==e?void 0:e.secret)||""===e.secret)switch(e.type){case Ii.k.OTP:throw new Error(this.i18nService.t("verificationCodeRequired"));case Ii.k.MasterPassword:throw new Error(this.i18nService.t("masterPasswordRequired"));case Ii.k.PIN:throw new Error(this.i18nService.t("pinRequired"))}}},deps:[Si.Lu,Ge.Di,Ir.O,ts.W,Ye,f.Ym,Ur.t,Si.zZ,Si.Zm]}),(0,u.F)({provide:I.k4,useClass:class{memberOrganizations$(e){return this.organizations$(e).pipe((0,E.T)(e=>e.filter(e=>e.isMember)))}constructor(e){this.stateProvider=e}canManageSponsorships$(e){return this.organizations$(e).pipe((0,E.T)(e=>e.filter(e=>e.canManageSponsorships)),G())}familySponsorshipAvailable$(e){return this.organizations$(e).pipe((0,E.T)(e=>e.some(e=>e.familySponsorshipAvailable)))}hasOrganizations(e){return this.organizations$(e).pipe(G())}upsert(e,t){return U(this,void 0,void 0,function*(){yield this.organizationState(t).update(t=>{const i=null!=t?t:{};return i[e.id]=e,i})})}replace(e,t){return U(this,void 0,void 0,function*(){yield this.organizationState(t).update(()=>e)})}organizations$(e){return this.organizationState(e).state$.pipe(this.mapOrganizationRecordToArray())}organizationState(e){return this.stateProvider.getUser(e,M)}mapOrganizationRecordToArray(){return(0,E.T)(e=>{var t;return null===(t=Object.values(null!=e?e:{}))||void 0===t?void 0:t.map(e=>new A.y(e))})}},deps:[it.v2]}),(0,u.F)({provide:o.Ki,useClass:o.tc,deps:[Si.Lu,En.N,o.uB,Ge.Di,ts.W]}),(0,u.F)({provide:I.PV,useExisting:I.k4}),(0,u.F)({provide:o.uB,useClass:o.Lf,deps:[g.G]}),(0,u.F)({provide:qe._,useClass:class{constructor(e,t,i,n,r,s){this.organizationApiService=e,this.accountService=t,this.keyService=i,this.encryptService=n,this.organizationUserApiService=r,this.i18nService=s}enrollIfRequired(e){return Wt(this,void 0,void 0,function*(){const t=yield this.organizationApiService.getAutoEnrollStatus(e);t.resetPasswordEnabled||(yield this.enroll(t.id,null,null))})}enroll(e,t,i){return Wt(this,void 0,void 0,function*(){const n=yield this.organizationApiService.getKeys(e);if(null==n)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const r=Se.A.fromB64ToArray(n.publicKey);if(null==(t=null!=t?t:yield(0,fe._)(this.accountService.activeAccount$.pipe(ye.F6))))throw new Error("User ID is required");i=null!=i?i:yield(0,fe._)(this.keyService.userKey$(t));const s=yield this.encryptService.encapsulateKeyUnsigned(i,r),a=new o.Wt;a.resetPasswordKey=s.encryptedString,yield this.organizationUserApiService.putOrganizationUserResetPasswordEnrollment(e,t,a)})}},deps:[S.X,Ge.Di,Si.Lu,En.N,o.uB,ts.W]}),(0,u.F)({provide:$.$,useClass:class{constructor(e){this.stateProvider=e}providers$(e){return this.stateProvider.getUser(e,Me).state$.pipe(this.mapProviderRecordToArray())}mapProviderRecordToArray(){return(0,E.T)(e=>Object.values(null!=e?e:{}).map(e=>new De(e)))}get$(e,t){return this.providers$(t).pipe((0,Ee.Hc)(e))}save(e,t){return Oe(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(Me,e,t)})}},deps:[it.v2]}),(0,u.F)({provide:Di.fz,useClass:Di.q9,deps:[ts.W,rs.y,it.Y2,Di.tE]}),(0,u.F)({provide:class{},useClass:class{getFormValidationErrors(e){let t=[];return Object.keys(e).forEach(i=>{const n=e[i];n instanceof ud.J3&&(t=t.concat(this.getFormValidationErrors(n.controls)));const r=e[i].errors;null!==r&&Object.keys(r).forEach(e=>{t.push({controlName:i,errorName:e})})}),t}},deps:[]}),(0,u.F)({provide:Ye,useClass:class{constructor(e){this.apiService=e}postAccountVerifyOTP(e){return this.apiService.send("POST","/accounts/verify-otp",e,!0,!1)}postAccountRequestOTP(){return wi(this,void 0,void 0,function*(){return this.apiService.send("POST","/accounts/request-otp",null,!0,!1)})}postAccountVerifyPassword(e){return this.apiService.send("POST","/accounts/verify-password",e,!0,!0)}},deps:[g.G]}),(0,u.F)({provide:S.X,useClass:class{constructor(e,t){this.apiService=e,this.syncService=t}get(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e,null,!0,!0);return new ne.t(t)})}getBilling(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing",null,!0,!0);return new K(t)})}getBillingHistory(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/history",null,!0,!0);return new Y(t)})}getSubscription(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/subscription",null,!0,!0);return new H._(t)})}getLicense(e,t){return se(this,void 0,void 0,function*(){return this.apiService.send("GET","/organizations/"+e+"/license?installationId="+t,null,!0,!0)})}getAutoEnrollStatus(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/auto-enroll-status",null,!0,!0);return new ee(t)})}create(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations",e,!0,!0);return yield this.syncService.fullSync(!0),new ne.t(t)})}createWithoutPayment(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/create-without-payment",e,!0,!0);return yield this.syncService.fullSync(!0),new ne.t(t)})}createLicense(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/licenses/self-hosted",e,!0,!0);return new ne.t(t)})}save(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e,t,!0,!0),n=new ne.t(i);return yield this.syncService.fullSync(!0),n})}upgrade(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/upgrade",t,!0,!0);return new J(i)})}updatePasswordManagerSeats(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/subscription",t,!0,!0);return new re.C(i)})}updateSecretsManagerSubscription(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/sm-subscription",t,!0,!0);return new re.C(i)})}updateSeats(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/seat",t,!0,!0);return new J(i)})}updateStorage(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/storage",t,!0,!0);return new J(i)})}reinstate(e){return se(this,void 0,void 0,function*(){return this.apiService.send("POST","/organizations/"+e+"/reinstate",null,!0,!1)})}leave(e){return se(this,void 0,void 0,function*(){yield this.apiService.send("POST","/organizations/"+e+"/leave",null,!0,!1),yield this.syncService.fullSync(!0)})}delete(e,t){return se(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/organizations/"+e,t,!0,!1),yield this.syncService.fullSync(!0)})}deleteUsingToken(e,t){return this.apiService.send("POST","/organizations/"+e+"/delete-recover-token",t,!1,!1)}updateLicense(e,t){return se(this,void 0,void 0,function*(){yield this.apiService.send("POST","/organizations/licenses/self-hosted/"+e,t,!0,!1)})}importDirectory(e,t){return se(this,void 0,void 0,function*(){return this.apiService.send("POST","/organizations/"+e+"/import",t,!0,!1)})}getOrCreateApiKey(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/api-key",t,!0,!0);return new N(i)})}getApiKeyInformation(e){return se(this,arguments,void 0,function*(e,t=null){const i=null===t?"/organizations/"+e+"/api-key-information":"/organizations/"+e+"/api-key-information/"+t,n=yield this.apiService.send("GET",i,null,!0,!0);return new Z.s(n,Q)})}rotateApiKey(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/rotate-api-key",t,!0,!0);return new N(i)})}getKeys(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/keys",null,!0,!0);return new ie(t)})}updateKeys(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/keys",t,!0,!0);return new ie(i)})}getSso(e){return se(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/sso",null,!0,!0);return new z(t)})}updateSso(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/sso",t,!0,!0);return new z(i)})}selfHostedSyncLicense(e){return se(this,void 0,void 0,function*(){yield this.apiService.send("POST","/organizations/licenses/self-hosted/"+e+"/sync/",null,!0,!1)})}subscribeToSecretsManager(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/subscribe-secrets-manager",t,!0,!0);return new re.C(i)})}updateCollectionManagement(e,t){return se(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/organizations/"+e+"/collection-management",t,!0,!0),n=new ne.t(i);return yield this.syncService.fullSync(!0),n})}},deps:[g.G,ua.H]}),(0,u.F)({provide:Ki.l,useClass:class{constructor(e,t){this.apiService=e,this.platformUtilsService=t}getOrganizationSponsorship(e){return pn(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organization/sponsorship/"+(this.platformUtilsService.isSelfHost()?"self-hosted/":"")+e+"/sponsored",null,!0,!0);return new Z.s(t,hn.B)})}postResendSponsorshipOffer(e,t){return pn(this,void 0,void 0,function*(){let i="/organization/sponsorship/"+e+"/families-for-enterprise/resend";return t&&(i+=`?sponsoredFriendlyName=${encodeURIComponent(t)}`),yield this.apiService.send("POST",i,null,!0,!1)})}deleteRevokeSponsorship(e){return pn(this,arguments,void 0,function*(e,t=!1){const i=this.platformUtilsService.isSelfHost()?"self-hosted/":"";return yield this.apiService.send("DELETE","/organization/sponsorship/"+i+e,null,!0,!1)})}deleteAdminInitiatedRevokeSponsorship(e,t){return pn(this,void 0,void 0,function*(){const i=this.platformUtilsService.isSelfHost()?"self-hosted/":"";return yield this.apiService.send("DELETE","/organization/sponsorship/"+i+e+"/"+encodeURIComponent(t)+"/revoke",null,!0,!1)})}},deps:[g.G,rs.y]}),(0,u.F)({provide:Li.C,useClass:class{constructor(e){this.apiService=e}getBillingInvoices(e,t,i){return cn(this,void 0,void 0,function*(){const n=new URLSearchParams;t&&n.append("status",t),i&&n.append("startAfter",i);const r=`?${n.toString()}`,s=yield this.apiService.send("GET",`/organizations/${e}/billing/invoices${r}`,null,!0,!0);return(null==s?void 0:s.map(e=>new _(e)))||[]})}getBillingTransactions(e,t){return cn(this,void 0,void 0,function*(){const i=t?`?startAfter=${t}`:"",n=yield this.apiService.send("GET",`/organizations/${e}/billing/transactions${i}`,null,!0,!0);return(null==n?void 0:n.map(e=>new X(e)))||[]})}setupBusinessUnit(e,t){return cn(this,void 0,void 0,function*(){return yield this.apiService.send("POST",`/organizations/${e}/billing/setup-business-unit`,t,!0,!0)})}changeSubscriptionFrequency(e,t){return cn(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/organizations/"+e+"/billing/change-frequency",t,!0,!1)})}},deps:[g.G]}),(0,u.F)({provide:Vi.k,useClass:class{constructor(e){this.apiService=e}getBillingInvoices(e,t){return _i(this,void 0,void 0,function*(){const i=new URLSearchParams;e&&i.append("status",e),t&&i.append("startAfter",t);const n=`?${i.toString()}`,r=yield this.apiService.send("GET",`/accounts/billing/invoices${n}`,null,!0,!0);return(null==r?void 0:r.map(e=>new _(e)))||[]})}getBillingTransactions(e){return _i(this,void 0,void 0,function*(){const t=e?`?startAfter=${e}`:"",i=yield this.apiService.send("GET",`/accounts/billing/transactions${t}`,null,!0,!0);return(null==i?void 0:i.map(e=>new X(e)))||[]})}},deps:[g.G]}),(0,u.F)({provide:po,useClass:po,deps:[Jr,Qr.v,is.K,it.v2,Ve.u]}),(0,u.F)({provide:Zr.w,useExisting:po}),(0,u.F)({provide:Jr,useClass:class{constructor(e){this.apiService=e}get(e){return Ws(this,void 0,void 0,function*(){let t;return t=null==e?yield this.apiService.send("GET","/config",null,!1,!0):yield this.apiService.send("GET","/config",null,e,!0),new _s(t)})}},deps:[g.G]}),(0,u.F)({provide:je.k,useClass:class{constructor(e,t,i){this.environmentService=e,this.authRequestService=t,this.platformUtilsService=i}createHubConnection(e){return Ft(this,void 0,void 0,function*(){if(this.url=(yield(0,fe._)(this.environmentService.environment$)).getNotificationsUrl(),!this.url.startsWith("https://")&&!this.platformUtilsService.isDev())throw new Tt;this.anonHubConnection=(new at.$).withUrl(this.url+"/anonymous-hub?Token="+e,{skipNegotiation:!0,transport:lt.w.WebSockets}).withHubProtocol(new ct.E).build(),yield this.anonHubConnection.start(),this.anonHubConnection.on("AuthRequestResponseRecieved",e=>{this.ProcessNotification(new pt(e))})})}stopHubConnection(){return Ft(this,void 0,void 0,function*(){this.anonHubConnection&&(yield this.anonHubConnection.stop())})}ProcessNotification(e){if(e.type===be._n.AuthRequestResponse)this.authRequestService.sendAuthRequestPushNotification(e.payload)}},deps:[Qr.v,f.XF,rs.y]}),(0,u.F)({provide:ds.B,useClass:class{constructor(e,t){this.i18nService=e,this.platformUtilsService=t}showError(e){const t=this.i18nService.t("unexpectedError");let i=[];return null!=e&&"string"==typeof e?i.push(e):null==e||"object"!=typeof e?i.push(t):null!=e.validationErrors?i=i.concat(e.getAllMessages()):i.push(e.message?e.message:t),1===i.length?this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),i[0]):i.length>1&&this.platformUtilsService.showToast("error",this.i18nService.t("errorOccurred"),i,{timeout:5e3*i.length}),i}},deps:[ts.W,rs.y]}),(0,u.F)({provide:f.DS,useClass:f.pi,deps:[Ge.Di,Ve.u,it.v2]}),(0,u.F)({provide:T,useClass:class{constructor(e,t){this.platformUtilsService=e,this.i18nService=t,this._orgDomains$=new ue.t([]),this.orgDomains$=this._orgDomains$.asObservable()}get(e){return this._orgDomains$.getValue().find(t=>t.id===e)}copyDnsTxt(e){this.platformUtilsService.copyToClipboard(e)}upsert(e){const t=this._orgDomains$.getValue();e.forEach(e=>{const i=t.findIndex(t=>t.id===e.id);-1!==i?t[i]=e:t.push(e)}),this._orgDomains$.next(t)}replace(e){this._orgDomains$.next(e)}clearCache(){this._orgDomains$.next([])}delete(e){const t=this._orgDomains$.getValue();e.forEach(e=>{const i=t.findIndex(t=>t.id===e);-1!==i&&t.splice(i,1)}),this._orgDomains$.next(t)}},deps:[rs.y,ts.W]}),(0,u.F)({provide:C,useExisting:T}),(0,u.F)({provide:k.o,useClass:class{constructor(e,t){this.orgDomainService=e,this.apiService=t}getAllByOrgId(e){return de(this,void 0,void 0,function*(){const t=(yield this.apiService.send("GET",`/organizations/${e}/domain`,null,!0,!0)).data.map(e=>new ae(e));return this.orgDomainService.replace(t),t})}getByOrgIdAndOrgDomainId(e,t){return de(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET",`/organizations/${e}/domain/${t}`,null,!0,!0),n=new ae(i);return this.orgDomainService.upsert([n]),n})}post(e,t){return de(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/domain`,t,!0,!0),n=new ae(i);return this.orgDomainService.upsert([n]),n})}verify(e,t){return de(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/organizations/${e}/domain/${t}/verify`,null,!0,!0),n=new ae(i);return this.orgDomainService.upsert([n]),n})}delete(e,t){return de(this,void 0,void 0,function*(){yield this.apiService.send("DELETE",`/organizations/${e}/domain/${t}`,null,!0,!1),this.orgDomainService.delete([t])})}getClaimedOrgDomainByEmail(e){return de(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/domain/sso/details",new ce(e),!1,!0);return new oe(t)})}getVerifiedOrgDomainsByEmail(e){return de(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/organizations/domain/sso/verified",new ce(e),!1,!0);return new Z.s(t,le)})}},deps:[T,g.G]}),(0,u.F)({provide:Le.T,useClass:class{constructor(e){this.apiService=e}getKnownDevice(e,t){return _t(this,void 0,void 0,function*(){return yield this.apiService.send("GET","/devices/knowndevice",null,!1,!0,null,i=>{i.set("X-Device-Identifier",t),i.set("X-Request-Email",Se.A.fromUtf8ToUrlB64(e))})})}getDeviceByIdentifier(e){return _t(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/devices/identifier/${e}`,null,!0,!0);return new Vt(t)})}getDevices(){return _t(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/devices",null,!0,!0,null);return new Z.s(e,Vt)})}updateTrustedDeviceKeys(e,t,i,n){return _t(this,void 0,void 0,function*(){const r=new qt(t,i,n),s=yield this.apiService.send("PUT",`/devices/${e}/keys`,r,!0,!0);return new Vt(s)})}updateTrust(e,t){return _t(this,void 0,void 0,function*(){yield this.apiService.send("POST","/devices/update-trust",e,!0,!1,null,e=>{e.set("Device-Identifier",t)})})}getDeviceKeys(e){return _t(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST",`/devices/${e}/retrieve-keys`,null,!0,!0);return new Kt(t)})}postDeviceTrustLoss(e){return _t(this,void 0,void 0,function*(){yield this.apiService.send("POST","/devices/lost-trust",null,!0,!1,null,t=>{t.set("Device-Identifier",e)})})}deactivateDevice(e){return _t(this,void 0,void 0,function*(){yield this.apiService.send("POST",`/devices/${e}/deactivate`,null,!0,!1)})}untrustDevices(e){return _t(this,void 0,void 0,function*(){yield this.apiService.send("POST","/devices/untrust",new Bt(e),!0,!1)})}},deps:[g.G]}),(0,u.F)({provide:ze.L,useClass:class{constructor(e,t,i){this.appIdService=e,this.devicesApiService=t,this.i18nService=i}getDevices$(){return(0,Qe.v)(()=>this.devicesApiService.getDevices()).pipe((0,E.T)(e=>e.data.map(e=>new jt(e))))}getDeviceByIdentifier$(e){return(0,Qe.v)(()=>this.devicesApiService.getDeviceByIdentifier(e)).pipe((0,E.T)(e=>new jt(e)))}isDeviceKnownForUser$(e,t){return(0,Qe.v)(()=>this.devicesApiService.getKnownDevice(e,t))}updateTrustedDeviceKeys$(e,t,i,n){return(0,Qe.v)(()=>this.devicesApiService.updateTrustedDeviceKeys(e,t,i,n)).pipe((0,E.T)(e=>new jt(e)))}deactivateDevice$(e){return(0,Qe.v)(()=>this.devicesApiService.deactivateDevice(e))}getCurrentDevice$(){return(0,Qe.v)(()=>Nt(this,void 0,void 0,function*(){const e=yield this.appIdService.getAppId();return this.devicesApiService.getDeviceByIdentifier(e)}))}getReadableDeviceTypeName(e){if(void 0===e)return this.i18nService.t("unknownDevice");const t=be.mz[e];if(!t)return this.i18nService.t("unknownDevice");const i="Unknown"===t.platform?this.i18nService.t("unknown"):t.platform,n=this.i18nService.t(t.category);return i?`${n} - ${i}`:n}},deps:[Hr.Y,Le.T,ts.W]}),(0,u.F)({provide:f.d8,useClass:f._l,deps:[g.G,is.K]}),(0,u.F)({provide:jn.M,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p){this.keyGenerationService=e,this.cryptoFunctionService=t,this.keyService=i,this.encryptService=n,this.appIdService=r,this.devicesApiService=s,this.i18nService=o,this.platformUtilsService=a,this.stateProvider=l,this.secureStorageService=c,this.userDecryptionOptionsService=d,this.logService=u,this.configService=h,this.accountService=p,this.platformSupportsSecureStorage=this.platformUtilsService.supportsSecureStorage(),this.deviceKeySecureStorageKey="_deviceKey",this.deviceTrustedSubject=new m.B,this.deviceTrusted$=this.deviceTrustedSubject.asObservable(),this.supportsDeviceTrust$=this.accountService.activeAccount$.pipe((0,ge.n)(e=>null==e?[!1]:this.userDecryptionOptionsService.userDecryptionOptionsById$(e.id).pipe((0,E.T)(e=>null!=(null==e?void 0:e.trustedDeviceOption)))))}supportsDeviceTrustByUserId$(e){return this.userDecryptionOptionsService.userDecryptionOptionsById$(e).pipe((0,E.T)(e=>null!=(null==e?void 0:e.trustedDeviceOption)))}getShouldTrustDevice(e){return zn(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot get should trust device.");return yield(0,fe._)(this.stateProvider.getUserState$(Kn,e))})}setShouldTrustDevice(e,t){return zn(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot set should trust device.");yield this.stateProvider.setUserState(Kn,t,e)})}trustDeviceIfRequired(e){return zn(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot trust device if required.");(yield this.getShouldTrustDevice(e))&&(yield this.trustDevice(e),yield this.setShouldTrustDevice(e,null))})}trustDevice(e){return zn(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot trust device.");const t=yield(0,fe._)(this.keyService.userKey$(e));if(!t)throw new Error("User symmetric key not found");const i=yield this.makeDeviceKey(),[n,r]=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048),[s,o,a]=yield Promise.all([this.encryptService.encapsulateKeyUnsigned(t,n),this.encryptService.wrapEncapsulationKey(n,t),this.encryptService.wrapDecapsulationKey(r,i)]),l=yield this.appIdService.getAppId(),c=yield this.devicesApiService.updateTrustedDeviceKeys(l,s.encryptedString,o.encryptedString,a.encryptedString);return yield this.setDeviceKey(e,i),this.deviceTrustedSubject.next(),c})}getRotatedData(e,t,i){return zn(this,void 0,void 0,function*(){if(!i)throw new Error("UserId is required. Cannot get rotated data.");if(!e)throw new Error("Old user key is required. Cannot get rotated data.");if(!t)throw new Error("New user key is required. Cannot get rotated data.");const n=yield this.devicesApiService.getDevices(),r=[],s=yield Promise.all(n.data.filter(e=>e.isTrusted).map(i=>zn(this,void 0,void 0,function*(){const n=yield this.encryptService.unwrapEncapsulationKey(new zt.k(i.encryptedPublicKey),e);if(!n)return r.push(i.id),null;const s=yield this.encryptService.wrapEncapsulationKey(n,t),o=yield this.encryptService.encapsulateKeyUnsigned(t,n),a=new Lt.B(o,s),l=new Bn;return l.encryptedPublicKey=a.encryptedPublicKey.encryptedString,l.encryptedUserKey=a.encapsulatedDownstreamKey.encryptedString,l.deviceId=i.id,l})).filter(e=>null!=e));return s.length>0&&(this.logService.info("[Device trust rotation] Distrusting devices that failed to decrypt."),yield this.devicesApiService.untrustDevices(r)),s})}rotateDevicesTrust(e,t,i){return zn(this,void 0,void 0,function*(){if(this.logService.info("[Device trust rotation] Rotating device trust..."),!e)throw new Error("UserId is required. Cannot rotate device's trust.");if(null==(yield this.getDeviceKey(e)))return void this.logService.info("[Device trust rotation] No device key available to rotate trust!");const n=yield(0,fe._)(this.keyService.userKey$(e));n==t&&this.logService.info("[Device trust rotation] Old user key is the same as the new user key.");const r=yield this.appIdService.getAppId();(new ki.V).masterPasswordHash=i;const s=yield this.devicesApiService.getDeviceKeys(r),o=yield this.encryptService.unwrapEncapsulationKey(s.encryptedPublicKey,n),a=yield this.encryptService.encapsulateKeyUnsigned(t,o),l=yield this.encryptService.wrapEncapsulationKey(o,t),c=new Vn;c.encryptedUserKey=a.encryptedString,c.encryptedPublicKey=l.encryptedString;const d=new Nn;d.masterPasswordHash=i,d.currentDevice=c,d.otherDevices=[],this.logService.info("[Device trust rotation] Posting device trust update with current device:",r),yield this.devicesApiService.updateTrust(d,r),this.logService.info("[Device trust rotation] Device trust update posted successfully.")})}getDeviceKey(e){return zn(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot get device key.");try{if(this.platformSupportsSecureStorage){const t=yield this.secureStorageService.get(`${e}${this.deviceKeySecureStorageKey}`,this.getSecureStorageOptions(e));return oi.e.fromJSON(t)}return yield(0,fe._)(this.stateProvider.getUserState$(Ln,e))}catch(t){this.logService.error("Failed to get device key",t)}})}setDeviceKey(e,t){return zn(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot set device key.");try{if(this.platformSupportsSecureStorage)return void(yield this.secureStorageService.save(`${e}${this.deviceKeySecureStorageKey}`,t,this.getSecureStorageOptions(e)));yield this.stateProvider.setUserState(Ln,null==t?void 0:t.toJSON(),e)}catch(i){this.logService.error("Failed to set device key",i)}})}makeDeviceKey(){return zn(this,void 0,void 0,function*(){return yield this.keyGenerationService.createKey(512)})}decryptUserKeyWithDeviceKey(e,t,i,n){return zn(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot decrypt user key with device key.");if(!t)throw new Error("Encrypted device private key is required. Cannot decrypt user key with device key.");if(!i)throw new Error("Encrypted user key is required. Cannot decrypt user key with device key.");if(!n)return null;try{const e=yield this.encryptService.unwrapDecapsulationKey(t,n);return yield this.encryptService.decapsulateKeyUnsigned(new zt.k(i.encryptedString),e)}catch(r){return this.logService.error("Failed to decrypt using device key. Removing device key."),yield this.setDeviceKey(e,null),null}})}recordDeviceTrustLoss(){return zn(this,void 0,void 0,function*(){const e=yield this.appIdService.getAppId();yield this.devicesApiService.postDeviceTrustLoss(e)})}getSecureStorageOptions(e){return{storageLocation:si.$B.Disk,useSecureStorage:!0,userId:e}}},deps:[xn.$,$n.R,Si.Lu,En.N,Hr.Y,Le.T,ts.W,rs.y,it.v2,h.G$,f.Ym,is.K,Zr.w,Ge.Di]}),(0,u.F)({provide:Jn,useClass:class{constructor(e){this.apiService=e}updateUserKdfParams(e){return Wn(this,void 0,void 0,function*(){return this.apiService.send("POST","/accounts/kdf",e,!0,!1)})}},deps:[g.G]}),(0,u.F)({provide:sr.J,useClass:rr,deps:[Jn,os.K5]}),(0,u.F)({provide:f.XF,useClass:f.H8,deps:[Hr.Y,Ir.O,Si.Lu,En.N,g.G,it.v2,f.d8,Ge.Di]}),(0,u.F)({provide:Er,useClass:class{constructor(e){this.stateProvider=e}userKeyEncryptedPin$(e){return(0,qn.x)(e,"userId"),this.stateProvider.getUserState$(Or,e).pipe((0,E.T)(e=>e?new zt.k(e):null))}isPinSet(e){return Mr(this,void 0,void 0,function*(){return(0,qn.x)(e,"userId"),"DISABLED"!==(yield this.getPinLockType(e))})}getPinLockType(e){return Mr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId");const t=null!=(yield this.getPinProtectedUserKeyEnvelope(e,"PERSISTENT")),i=null!=(yield(0,fe._)(this.stateProvider.getUserState$(Or,e)));return t?"PERSISTENT":i?"EPHEMERAL":"DISABLED"})}getPinProtectedUserKeyEnvelope(e,t){return Mr(this,void 0,void 0,function*(){if((0,qn.x)(e,"userId"),"EPHEMERAL"===t)return yield(0,fe._)(this.stateProvider.getUserState$(Dr,e));if("PERSISTENT"===t)return yield(0,fe._)(this.stateProvider.getUserState$(Ar,e));throw new Error(`Unsupported PinLockType: ${t}`)})}setPinState(e,t,i,n){return Mr(this,void 0,void 0,function*(){if((0,qn.x)(e,"userId"),(0,qn.x)(t,"pinProtectedUserKeyEnvelope"),(0,qn.x)(n,"pinLockType"),"EPHEMERAL"===n)yield this.stateProvider.setUserState(Dr,t,e);else{if("PERSISTENT"!==n)throw new Error(`Cannot set up PIN with pin lock type ${n}`);yield this.stateProvider.setUserState(Ar,t,e)}yield this.stateProvider.setUserState(Or,i,e)})}clearPinState(e){return Mr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId"),yield this.stateProvider.setUserState(Or,null,e),yield this.stateProvider.setUserState(Dr,null,e),yield this.stateProvider.setUserState(Ar,null,e)})}clearEphemeralPinState(e){return Mr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId"),yield this.stateProvider.setUserState(Dr,null,e)})}},deps:[it.v2]}),(0,u.F)({provide:Ur.t,useClass:class{constructor(e,t,i,n,r){this.encryptService=e,this.logService=t,this.keyService=i,this.sdkService=n,this.pinStateService=r}getPinLockType(e){return(0,qn.x)(e,"userId"),this.pinStateService.getPinLockType(e)}isPinSet(e){return Nr(this,void 0,void 0,function*(){return(0,qn.x)(e,"userId"),"DISABLED"!==(yield this.pinStateService.getPinLockType(e))})}logout(e){return Nr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId"),yield this.pinStateService.clearPinState(e)})}userUnlocked(e){return Nr(this,void 0,void 0,function*(){if("EPHEMERAL"===(yield this.pinStateService.getPinLockType(e))&&!(yield this.isPinDecryptionAvailable(e))){this.logService.info("[Pin Service] On first unlock: Setting up ephemeral PIN");const t=yield this.getPin(e);yield this.setPin(t,"EPHEMERAL",e)}})}getPin(e){return Nr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId");const t=yield jr(this.keyService.userKey$(e),"userKey"),i=yield jr(this.pinStateService.userKeyEncryptedPin$(e),"userKeyEncryptedPin");return this.encryptService.decryptString(i,t)})}setPin(e,t,i){return Nr(this,void 0,void 0,function*(){(0,qn.x)(e,"pin"),(0,qn.x)(t,"pinLockType"),(0,qn.x)(i,"userId");const{pinProtectedUserKeyEnvelope:n,userKeyEncryptedPin:r}=yield(0,fe._)(this.sdkService.userClient$(i).pipe((0,E.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{return Vr(i,t.take(),!1).value.crypto().enroll_pin(e)}catch(n){i.error=n,i.hasError=!0}finally{Br(i)}})));yield this.pinStateService.setPinState(i,n,r,t)})}unsetPin(e){return Nr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId"),yield this.pinStateService.clearPinState(e)})}isPinDecryptionAvailable(e){return Nr(this,void 0,void 0,function*(){(0,qn.x)(e,"userId");const t=yield this.pinStateService.getPinLockType(e);switch(t){case"DISABLED":return!1;case"PERSISTENT":return!0;case"EPHEMERAL":return null!=(yield this.pinStateService.getPinProtectedUserKeyEnvelope(e,"EPHEMERAL"));default:throw new Error(`Unexpected pinLockType: ${t}`)}})}decryptUserKeyWithPin(e,t){return Nr(this,void 0,void 0,function*(){(0,qn.x)(e,"pin"),(0,qn.x)(t,"userId"),this.logService.info("[Pin Service] Pin-unlock via PinProtectedUserKeyEnvelope");const i=yield this.pinStateService.getPinLockType(t),n=yield this.pinStateService.getPinProtectedUserKeyEnvelope(t,i);try{const t=performance.now(),i=yield(0,fe._)(this.sdkService.client$.pipe((0,E.T)(t=>{if(!t)throw new Error("SDK not available");return t.crypto().unseal_password_protected_key_envelope(e,n)})));return this.logService.measure(t,"Crypto","PinService","UnsealPinEnvelope"),new oi.e(i)}catch(r){return this.logService.error(`Failed to unseal pin: ${r}`),null}})}},deps:[En.N,is.K,Si.Lu,os.K5,Er]}),(0,u.F)({provide:Je.u,useClass:class{constructor(e){this.cryptoFunctionService=e}getLoginWithPrfSalt(){return Pi(this,void 0,void 0,function*(){return yield this.cryptoFunctionService.hash("passwordless-login","sha256")})}createSymmetricKeyFromPrf(e){return Pi(this,void 0,void 0,function*(){return yield this.stretchKey(new Uint8Array(e))})}stretchKey(e){return Pi(this,void 0,void 0,function*(){const t=new Uint8Array(64),i=yield this.cryptoFunctionService.hkdfExpand(e,"enc",32,"sha256"),n=yield this.cryptoFunctionService.hkdfExpand(e,"mac",32,"sha256");return t.set(new Uint8Array(i)),t.set(new Uint8Array(n),32),new oi.e(t)})}},deps:[$n.R]}),(0,u.F)({provide:We,useClass:class{constructor(e,t){this.apiService=e,this.environmentService=t}getCredentialAssertionOptions(){return Ri(this,void 0,void 0,function*(){const e=yield(0,fe._)(this.environmentService.environment$),t=yield this.apiService.send("GET","/accounts/webauthn/assertion-options",null,!1,!0,e.getIdentityUrl());return new Fi.x(t)})}},deps:[g.G,Qr.v]}),(0,u.F)({provide:Ze.t,useClass:class{constructor(e,t,i,n,r){this.webAuthnLoginApiService=e,this.loginStrategyService=t,this.webAuthnLoginPrfKeyService=i,this.window=n,this.logService=r,this.navigatorCredentials=this.window.navigator.credentials}getCredentialAssertionOptions(){return Ai(this,void 0,void 0,function*(){const e=yield this.webAuthnLoginApiService.getCredentialAssertionOptions();return new xi.E(e.options,e.token)})}assertCredential(e){return Ai(this,void 0,void 0,function*(){var t,i,n;const r={publicKey:e.options};r.publicKey.extensions={prf:{eval:{first:yield this.webAuthnLoginPrfKeyService.getLoginWithPrfSalt()}}};try{const n=yield this.navigatorCredentials.get(r);if(!(n instanceof PublicKeyCredential))return;const s=null===(i=null===(t=n.getClientExtensionResults().prf)||void 0===t?void 0:t.results)||void 0===i?void 0:i.first;let o;null!=s&&(o=yield this.webAuthnLoginPrfKeyService.createSymmetricKeyFromPrf(s));const a=new Ei.c(n);if("prf"in a.extensions)throw new Error("PRF information is not allowed to be sent to the server.");return new $i(e.token,a,o)}catch(s){return void(null===(n=this.logService)||void 0===n||n.error(s))}})}logIn(e){return Ai(this,void 0,void 0,function*(){const t=new f.Gz(e.token,e.deviceResponse,e.prfKey);return yield this.loginStrategyService.logIn(t)})}},deps:[We,f.sg,Je.u,h.jf,is.K]}),(0,u.F)({provide:ls.wH,useClass:ls.wH,deps:[h.ml,h.ye]}),(0,u.F)({provide:it.iO,useClass:id.df,deps:[it.Y2,ls.wH]}),(0,u.F)({provide:it.lR,useClass:id.ep,deps:[it.Y2,ls.wH]}),(0,u.F)({provide:it.Y2,useClass:id.dR,deps:[ls.wH,is.K]}),(0,u.F)({provide:id.Bz,useClass:class{constructor(e){this.accountService=e,this.activeUserId$=this.accountService.activeAccount$.pipe((0,E.T)(e=>null!=e?e.id:null))}},deps:[Ge.Di]}),(0,u.F)({provide:it.Md,useClass:id.$5,deps:[id.Bz,it.Ys]}),(0,u.F)({provide:it.Ys,useClass:id.Bh,deps:[ls.wH,it.iO,is.K]}),(0,u.F)({provide:it.w8,useClass:id.jx,deps:[]}),(0,u.F)({provide:it.v2,useClass:id.Cp,deps:[it.Md,it.Ys,it.Y2,it.w8]}),(0,u.F)({provide:ji.Y,useClass:class{constructor(e,t,i,n,r,s,o){this.apiService=e,this.billingApiService=t,this.keyService=i,this.encryptService=n,this.i18nService=r,this.organizationApiService=s,this.syncService=o}purchaseSubscription(e,t){return yn(this,void 0,void 0,function*(){const i=new mn.L,n=yield this.makeOrganizationKeys(t);this.setOrganizationKeys(i,n),this.setOrganizationInformation(i,e.organization),this.setPlanInformation(i,e.plan),this.setPaymentInformation(i,e.payment);const r=yield this.organizationApiService.create(i);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),r})}purchaseSubscriptionNoPaymentMethod(e,t){return yn(this,void 0,void 0,function*(){const i=new gn.J,n=yield this.makeOrganizationKeys(t);this.setOrganizationKeys(i,n),this.setOrganizationInformation(i,e.organization),this.setPlanInformation(i,e.plan);const r=yield this.organizationApiService.createWithoutPayment(i);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),r})}startFree(e,t){return yn(this,void 0,void 0,function*(){const i=new mn.L,n=yield this.makeOrganizationKeys(t);this.setOrganizationKeys(i,n),this.setOrganizationInformation(i,e.organization),this.setPlanInformation(i,e.plan);const r=yield this.organizationApiService.create(i);return yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),r})}makeOrganizationKeys(e){return yn(this,void 0,void 0,function*(){const[t,i]=yield this.keyService.makeOrgKey(e),[n,r]=yield this.keyService.makeKeyPair(i);return{encryptedKey:t,publicKey:n,encryptedPrivateKey:r,encryptedCollectionName:yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),i)}})}prohibitsAdditionalSeats(e){switch(e){case fn.OL.Free:case fn.OL.FamiliesAnnually:case fn.OL.FamiliesAnnually2019:case fn.OL.FamiliesAnnually2025:case fn.OL.TeamsStarter2023:case fn.OL.TeamsStarter:return!0;default:return!1}}setOrganizationInformation(e,t){e.name=t.name,e.businessName=t.businessName,e.billingEmail=t.billingEmail,e.initiationPath=t.initiationPath}setOrganizationKeys(e,t){e.key=t.encryptedKey.encryptedString,e.keys=new vn.B(t.publicKey,t.encryptedPrivateKey.encryptedString),e.collectionName=t.encryptedCollectionName.encryptedString}setPaymentInformation(e,t){const[i,n]=t.paymentMethod;e.paymentToken=i,e.paymentMethodType=n,e.skipTrial=t.skipTrial;const r=t.billing;e.billingAddressPostalCode=r.postalCode,e.billingAddressCountry=r.country,r.taxId&&(e.taxIdNumber=r.taxId,e.billingAddressLine1=r.addressLine1,e.billingAddressLine2=r.addressLine2,e.billingAddressCity=r.city,e.billingAddressState=r.state)}setPlanInformation(e,t){if(e.planType=t.type,this.prohibitsAdditionalSeats(e.planType))return e.useSecretsManager=t.subscribeToSecretsManager,void(e.isFromSecretsManagerTrial=t.isFromSecretsManagerTrial);e.additionalSeats=t.passwordManagerSeats,t.subscribeToSecretsManager&&(e.useSecretsManager=!0,e.isFromSecretsManagerTrial=t.isFromSecretsManagerTrial,e.additionalSmSeats=t.secretsManagerSeats,e.additionalServiceAccounts=t.secretsManagerServiceAccounts),t.storage&&(e.additionalStorageGb=t.storage)}restartSubscription(e,t,i){return yn(this,void 0,void 0,function*(){const n=new mn.L,r=yield this.makeOrganizationKeys(i);this.setOrganizationKeys(n,r),this.setOrganizationInformation(n,t.organization),this.setPlanInformation(n,t.plan),this.setPaymentInformation(n,t.payment),yield this.billingApiService.restartSubscription(e,n)})}},deps:[g.G,Ni.P,Si.Lu,En.N,ts.W,S.X,ua.H]}),(0,u.F)({provide:Oi.h,useClass:Oi.N,deps:[it.v2,P.m,Ge.Di,Lc.b]}),(0,u.F)({provide:class{},useClass:class{constructor(e){this.stateProvider=e,this.enableBadgeCounterState=this.stateProvider.getActive(Ui),this.enableBadgeCounter$=this.enableBadgeCounterState.state$.pipe((0,E.T)(e=>null==e||e))}setEnableBadgeCounter(e){return Mi(this,void 0,void 0,function*(){yield this.enableBadgeCounterState.update(()=>e)})}},deps:[it.v2]}),(0,u.F)({provide:Si.vB,useClass:Si.QH,deps:[it.v2]}),(0,u.F)({provide:class{},useClass:class{constructor(e,t){this.stateProvider=e,this.restrictedItemTypesService=t,this.enablePasskeysState=this.stateProvider.getGlobal(qc),this.enablePasskeys$=this.enablePasskeysState.state$.pipe((0,E.T)(e=>null==e||e)),this.showCardsCurrentTabState=this.stateProvider.getActive(_c),this.showCardsCurrentTab$=(0,$t.z)([this.showCardsCurrentTabState.state$.pipe((0,E.T)(e=>null==e||e)),this.restrictedItemTypesService.restricted$]).pipe((0,E.T)(([e,t])=>e&&!t.some(e=>e.cipherType===_l.gC.Card))),this.showIdentitiesCurrentTabState=this.stateProvider.getActive(Xc),this.showIdentitiesCurrentTab$=this.showIdentitiesCurrentTabState.state$.pipe((0,E.T)(e=>null==e||e)),this.clickItemsToAutofillVaultViewState=this.stateProvider.getActive(Yc),this.clickItemsToAutofillVaultView$=this.clickItemsToAutofillVaultViewState.state$.pipe((0,E.T)(e=>null!=e&&e),(0,At.t)({bufferSize:1,refCount:!1}))}setShowCardsCurrentTab(e){return Hc(this,void 0,void 0,function*(){yield this.showCardsCurrentTabState.update(()=>e)})}setShowIdentitiesCurrentTab(e){return Hc(this,void 0,void 0,function*(){yield this.showIdentitiesCurrentTabState.update(()=>e)})}setClickItemsToAutofillVaultView(e){return Hc(this,void 0,void 0,function*(){yield this.clickItemsToAutofillVaultViewState.update(()=>e)})}setEnablePasskeys(e){return Hc(this,void 0,void 0,function*(){yield this.enablePasskeysState.update(()=>e)})}},deps:[it.v2,Lc.b]}),(0,u.F)({provide:No,useClass:No,deps:[ls.zq,is.K,Go,h.Hq]}),(0,u.F)({provide:Go,useClass:Go,deps:[]}),(0,u.F)({provide:Ni.P,useClass:class{constructor(e){this.apiService=e}cancelOrganizationSubscription(e,t){return this.apiService.send("POST","/organizations/"+e+"/cancel",t,!0,!1)}cancelPremiumUserSubscription(e){return this.apiService.send("POST","/accounts/cancel",e,!0,!1)}getOrganizationBillingMetadata(e){return ln(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/metadata",null,!0,!0);return new en(t)})}getOrganizationBillingMetadataVNext(e){return ln(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/vnext/metadata",null,!0,!0);return new en(t)})}getOrganizationBillingMetadataVNextSelfHost(e){return ln(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/billing/vnext/self-host/metadata",null,!0,!0);return new en(t)})}getPlans(){return ln(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/plans",null,!0,!0);return new Z.s(e,tn.tQ)})}getPremiumPlan(){return ln(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/plans/premium",null,!0,!0);return new Wi(e)})}getProviderClientInvoiceReport(e,t){return ln(this,void 0,void 0,function*(){return yield this.apiService.send("GET","/providers/"+e+"/billing/invoices/"+t,null,!0,!0)})}getProviderInvoices(e){return ln(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e+"/billing/invoices",null,!0,!0);return new Zi(t)})}getProviderSubscription(e){return ln(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e+"/billing/subscription",null,!0,!0);return new on(t)})}restartSubscription(e,t){return ln(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/organizations/"+e+"/billing/restart-subscription",t,!0,!1)})}},deps:[g.G]}),(0,u.F)({provide:zi.Q,useClass:class{constructor(e,t,i){this.billingApiService=e,this.configService=t,this.platformUtilsService=i,this.metadataCache=new Map,this.refreshMetadataTrigger=new ue.t(void 0),this.refreshMetadataCache=()=>{this.metadataCache.clear(),this.refreshMetadataTrigger.next()}}getOrganizationMetadata$(e){return(0,$t.z)([this.refreshMetadataTrigger,this.configService.getFeatureFlag$(dn.TO.PM25379_UseNewOrganizationMetadataStructure)]).pipe((0,ge.n)(([t,i])=>i?this.vNextGetOrganizationMetadataInternal$(e):this.getOrganizationMetadataInternal$(e)))}vNextGetOrganizationMetadataInternal$(e){const t=this.metadataCache.get(e);if(t)return t;const i=(0,et.H)(this.fetchMetadata(e,!0)).pipe((0,At.t)({bufferSize:1,refCount:!1}));return this.metadataCache.set(e,i),i}getOrganizationMetadataInternal$(e){return(0,et.H)(this.fetchMetadata(e,!1)).pipe((0,At.t)({bufferSize:1,refCount:!1}))}fetchMetadata(e,t){return un(this,void 0,void 0,function*(){return t?this.platformUtilsService.isSelfHost()?yield this.billingApiService.getOrganizationBillingMetadataVNextSelfHost(e):yield this.billingApiService.getOrganizationBillingMetadataVNext(e):yield this.billingApiService.getOrganizationBillingMetadata(e)})}},deps:[Ni.P,Zr.w,rs.y]}),(0,u.F)({provide:Bi.Q,useClass:class{constructor(e,t,i){this.stateProvider=e,this.platformUtilsService=t,this.apiService=i}hasPremiumFromAnyOrganization$(e){return this.stateProvider.getUser(e,Hi).state$.pipe((0,E.T)(e=>!!(null==e?void 0:e.hasPremiumFromAnyOrganization)))}hasPremiumPersonally$(e){return this.stateProvider.getUser(e,Hi).state$.pipe((0,E.T)(e=>!!(null==e?void 0:e.hasPremiumPersonally)))}hasPremiumFromAnySource$(e){return this.stateProvider.getUser(e,Hi).state$.pipe((0,E.T)(e=>!0===(null==e?void 0:e.hasPremiumFromAnyOrganization)||!0===(null==e?void 0:e.hasPremiumPersonally)))}setHasPremium(e,t,i){return Yi(this,void 0,void 0,function*(){yield this.stateProvider.getUser(i,Hi).update(i=>({hasPremiumPersonally:e,hasPremiumFromAnyOrganization:t}),{shouldUpdate:i=>null==i||i.hasPremiumFromAnyOrganization!==t||i.hasPremiumPersonally!==e})})}canViewSubscription$(e){return(0,$t.z)([this.hasPremiumPersonally$(e),this.hasPremiumFromAnyOrganization$(e)]).pipe((0,Xi.H)(e=>Yi(this,[e],void 0,function*([e,t]){if(!0===e||!0==!t)return!0;if(!this.platformUtilsService.isSelfHost()){const e=yield this.apiService.getUserBillingHistory();return!(null==e?void 0:e.hasNoHistory)}return!1})))}},deps:[it.v2,rs.y,g.G]}),(0,u.F)({provide:qi.z,useClass:Cn,deps:[Ni.P,Zr.w,ts.W,is.K,Qr.v]}),(0,u.F)({provide:F.y,useClass:class{constructor(e){this.stateProvider=e,this.autoConfirmFingerPrints=this.buildOrganizationManagementPreference(pe,!1)}buildOrganizationManagementPreference(e,t){return new F.i(this.getKeyFromState(e).state$.pipe((0,E.T)(e=>null!=e?e:t)),this.setKeyInStateFn(e))}getKeyFromState(e){return this.stateProvider.getActive(e)}setKeyInStateFn(e){return t=>he(this,void 0,void 0,function*(){yield this.getKeyFromState(e).update(()=>t)})}},deps:[it.v2]}),(0,u.F)({provide:da,useClass:da,deps:[Si.Lu]}),(0,u.F)({provide:p.zcH,useClass:Vd,deps:[]}),(0,u.F)({provide:h.mq,useFactory:()=>new m.B,deps:[]}),(0,u.F)({provide:ws.qk,useFactory:e=>new ws.qk(e.asObservable()),deps:[h.mq]}),(0,u.F)({provide:ws.D$,useFactory:e=>new Ss.fg(e),deps:[h.mq]}),(0,u.F)({provide:Ts.Cc,useClass:Ts.P8,deps:[is.K]}),(0,u.F)({provide:x.J,useClass:class{constructor(e){this.apiService=e}postProviderSetup(e,t){return $e(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/providers/"+e+"/setup",t,!0,!0);return new xe(i)})}getProvider(e){return $e(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e,null,!0,!0);return new xe(t)})}putProvider(e,t){return $e(this,void 0,void 0,function*(){const i=yield this.apiService.send("PUT","/providers/"+e,t,!0,!0);return new xe(i)})}providerRecoverDeleteToken(e,t){return this.apiService.send("POST","/providers/"+e+"/delete-recover-token",t,!1,!1)}deleteProvider(e){return $e(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/providers/"+e,null,!0,!1)})}getProviderOrganizations(e){return $e(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/providers/"+e+"/organizations",null,!0,!0);return new Z.s(t,Pe)})}getProviderAddableOrganizations(e){return $e(this,void 0,void 0,function*(){return(yield this.apiService.send("GET","/providers/"+e+"/clients/addable",null,!0,!0)).map(e=>new Fe(e))})}addOrganizationToProvider(e,t){return this.apiService.send("POST","/providers/"+e+"/clients/existing",t,!0,!1)}updateProviderOrganization(e,t,i){return $e(this,void 0,void 0,function*(){return yield this.apiService.send("PUT","/providers/"+e+"/clients/"+t,i,!0,!1)})}createProviderOrganization(e,t){return this.apiService.send("POST","/providers/"+e+"/clients",t,!0,!1)}},deps:[g.G]}),(0,u.F)({provide:Si.zZ,useClass:Si.aT,deps:[it.v2]}),(0,u.F)({provide:Ht.i,useClass:class{getOrganizationInvite(){return Yt(this,void 0,void 0,function*(){return null})}setOrganizationInvitation(e){return Yt(this,void 0,void 0,function*(){})}clearOrganizationInvitation(){return Yt(this,void 0,void 0,function*(){})}},deps:[]}),(0,u.F)({provide:c.HQ,useClass:ad.K,deps:[g.G,En.N,ts.W,Si.zZ,Si.Lu,Ke,Ir.O,S.X,o.uB,f.bj]}),(0,u.F)({provide:$o.t,useClass:$o.t,deps:[Zr.w]}),(0,u.F)({provide:Zc.f,useClass:class{constructor(){this.anonLayoutWrapperDataSubject=new m.B}setAnonLayoutWrapperData(e){this.anonLayoutWrapperDataSubject.next(e)}anonLayoutWrapperData$(){return this.anonLayoutWrapperDataSubject.asObservable()}},deps:[]}),(0,u.F)({provide:v.mZ,useClass:v.v2,deps:[Si.Lu,Ue.T]}),(0,u.F)({provide:v.yX,useClass:v.NH,deps:[]}),(0,u.F)({provide:v.ag,useClass:v.jr,deps:[]}),(0,u.F)({provide:Di.tE,useClass:Di.Ap,deps:[g.G]}),(0,u.F)({provide:Kd.Z,useExisting:qd,deps:[]}),(0,u.F)({provide:v.qG,useClass:v.nF,deps:[$n.R,Qr.v,td.JJ,rs.y,_e._]}),(0,u.F)({provide:class{},useClass:class{constructor(e,t,i,n,r,s,o,a=null){this.sdkClientFactory=e,this.environmentService=t,this.platformUtilsService=i,this.accountService=n,this.apiService=r,this.stateProvider=s,this.configService=o,this.userAgent=a,this.sdkClientOverrides=new ue.t({}),this.sdkClientCache=new Map,this.client$=this.environmentService.environment$.pipe((0,Xi.H)(e=>oa(this,void 0,void 0,function*(){yield An.B.Ready;const t=this.toSettings(e),i=yield this.sdkClientFactory.createSdkClient(new la(this.apiService),t);return yield this.loadFeatureFlags(i),i})),(0,At.t)({refCount:!0,bufferSize:1}))}registerClient$(e){return this.sdkClientOverrides.pipe((0,Vo.v)(t=>t[e]!==aa,!1),(0,E.T)(t=>{if(t[e]===aa)throw new Error("Encountered UnsetClient even though it should have been filtered out");return t[e]}),(0,Et.F)(),(0,ge.n)(t=>t?(0,xt.of)(t):this.internalClient$(e)),(0,Vo.v)(e=>void 0!==e,!1),(0,Bo.v)(()=>new os.m8(e)))}internalClient$(e){const t=this.sdkClientCache.get(e);if(void 0!==t)return t;const i=this.accountService.accounts$.pipe((0,E.T)(t=>t[e]),(0,Et.F)()),n=(0,$t.z)([this.environmentService.getEnvironment$(e),i,An.B.Ready]).pipe((0,ge.n)(([t,i])=>new ps.c(n=>{let r;return(()=>oa(this,void 0,void 0,function*(){if(null==t||null==i)return;const n=this.toSettings(t),r=yield this.sdkClientFactory.createSdkClient(new la(this.apiService,e),n);return yield ta(e,r.platform().state(),this.stateProvider),yield this.loadFeatureFlags(r),r}))().then(e=>{r=void 0===e?void 0:new Lo(e),n.next(r)}).catch(e=>{n.error(e)}),()=>null==r?void 0:r.markForDisposal()})),(0,Js.M)({finalize:()=>this.sdkClientCache.delete(e)}),(0,At.t)({refCount:!0,bufferSize:1}));return this.sdkClientCache.set(e,n),n}loadFeatureFlags(e){return oa(this,void 0,void 0,function*(){var t;const i=yield(0,fe._)(this.configService.serverConfig$),n=new Map(Object.entries(null!==(t=null==i?void 0:i.featureStates)&&void 0!==t?t:{}).filter(([,e])=>"boolean"==typeof e).map(([e,t])=>[e,t]));e.platform().load_flags(n)})}toSettings(e){var t;return{apiUrl:e.getApiUrl(),identityUrl:e.getIdentityUrl(),deviceType:(0,os.yL)(this.platformUtilsService.getDevice()),userAgent:null!==(t=this.userAgent)&&void 0!==t?t:navigator.userAgent}}},deps:[ss.k,Qr.v,rs.y,Ge.Di,g.G,it.v2,Zr.w]}),(0,u.F)({provide:os.K5,useClass:class{constructor(e,t,i,n,r,s,o,a,l,c,d=null){this.sdkClientFactory=e,this.environmentService=t,this.platformUtilsService=i,this.accountService=n,this.kdfConfigService=r,this.keyService=s,this.securityStateService=o,this.apiService=a,this.stateProvider=l,this.configService=c,this.userAgent=d,this.sdkClientOverrides=new ue.t({}),this.sdkClientCache=new Map,this.client$=this.environmentService.environment$.pipe((0,Xi.H)(e=>na(this,void 0,void 0,function*(){yield An.B.Ready;const t=this.toSettings(e),i=yield this.sdkClientFactory.createSdkClient(new sa(this.apiService),t);return yield this.loadFeatureFlags(i),i})),(0,At.t)({refCount:!0,bufferSize:1})),this.version$=this.client$.pipe((0,E.T)(e=>e.version()),(0,In.W)(()=>"Unsupported"))}userClient$(e){return this.sdkClientOverrides.pipe((0,Vo.v)(t=>t[e]!==ra,!1),(0,E.T)(t=>{if(t[e]===ra)throw new Error("Encountered UnsetClient even though it should have been filtered out");return t[e]}),(0,Et.F)(),(0,ge.n)(t=>t?(0,xt.of)(t):this.internalClient$(e)),(0,Vo.v)(e=>void 0!==e,!1),(0,Bo.v)(()=>new os.m8(e)))}setClient(e,t){const i=this.sdkClientOverrides.value[e];this.sdkClientOverrides.next(Object.assign(Object.assign({},this.sdkClientOverrides.value),{[e]:t?new Lo(t):ra})),i!==ra&&void 0!==i&&i.markForDisposal()}internalClient$(e){const t=this.sdkClientCache.get(e);if(void 0!==t)return t;const i=this.accountService.accounts$.pipe((0,E.T)(t=>t[e]),(0,Et.F)()),n=this.kdfConfigService.getKdfConfig$(e).pipe((0,Et.F)()),r=this.keyService.userEncryptedPrivateKey$(e).pipe((0,Et.F)()),s=this.keyService.userSigningKey$(e).pipe((0,Et.F)()),o=this.keyService.userKey$(e).pipe((0,Et.F)()),a=this.keyService.encryptedOrgKeys$(e).pipe((0,Et.F)(zo.c)),l=this.securityStateService.accountSecurityState$(e).pipe((0,Et.F)(zo.c)),c=this.keyService.userSignedPublicKey$(e).pipe((0,Et.F)(zo.c)),d=(0,$t.z)([this.environmentService.getEnvironment$(e),i,n,r,o,s,a,l,c,An.B.Ready]).pipe((0,ge.n)(([t,i,n,r,s,o,a,l,c])=>new ps.c(d=>{let u;return(()=>na(this,void 0,void 0,function*(){if(null==t||null==n||null==r||null==s)return;const d=this.toSettings(t),u=yield this.sdkClientFactory.createSdkClient(new sa(this.apiService,e),d);let h;return h=null!=o&&null!=l&&null!=c?{V2:{private_key:r,signing_key:o,security_state:l,signed_public_key:c}}:{V1:{private_key:r}},yield this.initializeClient(e,u,i,n,s,h,a),u}))().then(e=>{u=void 0===e?void 0:new Lo(e),d.next(u)}).catch(e=>{d.error(e)}),()=>null==u?void 0:u.markForDisposal()})),(0,Js.M)({finalize:()=>this.sdkClientCache.delete(e)}),(0,At.t)({refCount:!0,bufferSize:1}));return this.sdkClientCache.set(e,d),d}initializeClient(e,t,i,n,r,s,o){return na(this,void 0,void 0,function*(){yield t.crypto().initialize_user_crypto({userId:(0,os.WD)(e),email:i.email,method:{decryptedKey:{decrypted_user_key:r.keyB64}},kdfParams:n.kdfType===Si.ao.PBKDF2_SHA256?{pBKDF2:{iterations:n.iterations}}:{argon2id:{iterations:n.iterations,memory:n.memory,parallelism:n.parallelism}},accountCryptographicState:s}),yield t.crypto().initialize_org_crypto({organizationKeys:new Map(Object.entries(o).map(([e,t])=>[(0,os.WD)(e),t.toJSON()]))}),yield ta(e,t.platform().state(),this.stateProvider),yield this.loadFeatureFlags(t)})}loadFeatureFlags(e){return na(this,void 0,void 0,function*(){var t;const i=yield(0,fe._)(this.configService.serverConfig$),n=new Map(Object.entries(null!==(t=null==i?void 0:i.featureStates)&&void 0!==t?t:{}).filter(([,e])=>"boolean"==typeof e).map(([e,t])=>[e,t]));e.platform().load_flags(n)})}toSettings(e){var t;return{apiUrl:e.getApiUrl(),identityUrl:e.getIdentityUrl(),deviceType:(0,os.yL)(this.platformUtilsService.getDevice()),userAgent:null!==(t=this.userAgent)&&void 0!==t?t:navigator.userAgent}}},deps:[ss.k,Qr.v,rs.y,Ge.Di,Si.zZ,Si.Lu,zr.p,g.G,it.v2,Zr.w]}),(0,u.F)({provide:ql.y,useClass:ql.H,deps:[o.YD,I.PV,Ge.Di]}),(0,u.F)({provide:qr,useClass:class{constructor(e){this.cryptoFunctionService=e}hashPassword(e,t){return Xr(this,void 0,void 0,function*(){if(!e||!t)throw new Error("Password and key material are required.");return yield this.cryptoFunctionService.pbkdf2(e,t,"sha256",_r.o)})}},deps:[$n.R]}),(0,u.F)({provide:od.x,useClass:sd.O,deps:[]}),(0,u.F)({provide:v.Ak,useClass:v.dl,deps:[ns.U]}),(0,u.F)({provide:Si.ox,useClass:Si.PA,deps:[g.G]}),(0,u.F)({provide:Si.wM,useClass:Si.xP,deps:[Si.Lu,Ml.p,Si.ox,is.K,os.K5,g.G,Zr.w]}),(0,u.F)({provide:f.aJ,useClass:f.L7,deps:[Zr.w,f.pi,_e._,ua.H,Si.wM,Hn.G,is.K]}),(0,u.F)({provide:Wc.RB,useClass:Wc.Sb,deps:[it.v2,g.G,I.PV,Ve.u,Fs.J,ws.qk]}),(0,u.F)({provide:class{},useClass:class{constructor(e,t,i){this.globalStateProvider=e,this.sdkService=t,this.sendPasswordService=i,this.initializeState()}initializeState(){this.sendAccessTokenDictGlobalState=this.globalStateProvider.get(nt)}tryGetSendAccessToken$(e){return(0,Qe.v)(()=>(0,et.H)(this._tryGetSendAccessToken(e)))}_tryGetSendAccessToken(e){return rt(this,void 0,void 0,function*(){this.validateSendId(e);const t=yield this.getSendAccessTokenFromStorage(e);if(null!=t)return t.isExpired()?(yield this.clearSendAccessTokenFromStorage(e),{kind:"expired"}):t;const i={sendId:e},n=yield(0,fe._)(this.sdkService.client$);try{const t=yield n.auth().send_access().request_send_access_token(i),r=tt.fromSendAccessTokenResponse(t);return yield this.setSendAccessTokenInStorage(e,r),r}catch(r){return this.normalizeSendAccessTokenError(r)}})}getSendAccessToken$(e,t){return(0,Qe.v)(()=>(0,et.H)(this._getSendAccessToken(e,t)))}_getSendAccessToken(e,t){return rt(this,void 0,void 0,function*(){this.validateCredentialsRequest(e,t);const i={sendId:e,sendAccessCredentials:this.convertDomainCredentialsToSdkCredentials(t)},n=yield(0,fe._)(this.sdkService.client$);try{const t=yield n.auth().send_access().request_send_access_token(i),r=tt.fromSendAccessTokenResponse(t);return yield this.setSendAccessTokenInStorage(e,r),r}catch(r){return this.normalizeSendAccessTokenError(r)}})}invalidateSendAccessToken(e){return rt(this,void 0,void 0,function*(){yield this.clearSendAccessTokenFromStorage(e)})}hashSendPassword(e,t){return rt(this,void 0,void 0,function*(){if(null==e||""===e.trim())throw new Error("Password must be provided.");if(null==t||""===t.trim())throw new Error("KeyMaterialUrlB64 must be provided.");const i=Se.A.fromUrlB64ToArray(t),n=yield this.sendPasswordService.hashPassword(e,i);return Se.A.fromBufferToB64(n)})}getSendAccessTokenFromStorage(e){return rt(this,void 0,void 0,function*(){if(null!=this.sendAccessTokenDictGlobalState){const t=yield(0,fe._)(this.sendAccessTokenDictGlobalState.state$);return null==t?void 0:t[e]}})}setSendAccessTokenInStorage(e,t){return rt(this,void 0,void 0,function*(){null!=this.sendAccessTokenDictGlobalState&&(yield this.sendAccessTokenDictGlobalState.update(i=>(null!=i||(i={}),i[e]=t,i),{shouldUpdate:i=>{const n=null==i?void 0:i[e];return(null==n?void 0:n.token)!==t.token||(null==n?void 0:n.expiresAt)!==t.expiresAt}}))})}clearSendAccessTokenFromStorage(e){return rt(this,void 0,void 0,function*(){null!=this.sendAccessTokenDictGlobalState&&(yield this.sendAccessTokenDictGlobalState.update(t=>{if(!t)return t;if(null==t[e])return t;const i=t,n=e;i[n];return st(i,["symbol"==typeof n?n:n+""])},{shouldUpdate:t=>null!=(null==t?void 0:t[e])}))})}normalizeSendAccessTokenError(e){if(this.isSendAccessTokenError(e))return"unexpected"===e.kind?{kind:"unexpected_server",error:e.data}:{kind:"expected_server",error:e.data};if(e instanceof Error)return{kind:"unknown",error:e.message};try{return{kind:"unknown",error:JSON.stringify(e)}}catch(t){return{kind:"unknown",error:"error cannot be stringified"}}}isSendAccessTokenError(e){return"object"==typeof e&&null!==e&&"kind"in e&&("expected"===e.kind||"unexpected"===e.kind)}validateSendId(e){if(null==e||""===e.trim())throw new Error("sendId must be provided.")}validateCredentialsRequest(e,t){if(this.validateSendId(e),null==t)throw new Error("sendAccessCredentials must be provided.");if("password"===t.kind&&!t.passwordHashB64)throw new Error("passwordHashB64 must be provided for password credentials.");if("email"===t.kind&&!t.email)throw new Error("email must be provided for email credentials.");if(!("email_otp"!==t.kind||t.email&&t.otp))throw new Error("email and otp must be provided for email_otp credentials.")}convertDomainCredentialsToSdkCredentials(e){switch(e.kind){case"password":return{passwordHashB64:e.passwordHashB64};case"email":return{email:e.email};case"email_otp":return{email:e.email,otp:e.otp}}}},deps:[it.Y2,os.K5,qr]}),(0,u.F)({provide:class{},useClass:class{constructor(e,t,i,n,r){this.stateProvider=e,this.apiService=t,this.notificationService=i,this.authService=n,this.logService=r,this.notifications$=(0,Bl.j)(e=>this.notificationState(e).state$.pipe((0,ge.n)(t=>Ll(this,void 0,void 0,function*(){return null==t?(yield this.fetchNotificationsFromApi(e),null):t})),(0,Bl.w)(),(0,E.T)(e=>e.map(e=>new dt(e))))),this.unreadNotifications$=(0,Bl.j)(e=>this.notifications$(e).pipe((0,E.T)(e=>e.filter(e=>null==e.readDate))))}markAsRead(e,t){return Ll(this,void 0,void 0,function*(){yield this.apiService.send("PATCH",`/notifications/${e}/read`,null,!0,!1),yield this.notificationState(t).update(t=>{const i=null==t?void 0:t.find(t=>t.id===e);return i&&(i.readDate=new Date),t})})}markAsDeleted(e,t){return Ll(this,void 0,void 0,function*(){yield this.apiService.send("DELETE",`/notifications/${e}/delete`,null,!0,!1),yield this.notificationState(t).update(t=>{const i=null==t?void 0:t.find(t=>t.id===e);return i&&(i.deletedDate=new Date),t})})}clearState(e){return Ll(this,void 0,void 0,function*(){yield this.replaceNotificationState(e,[])})}refreshNotifications(e){return Ll(this,void 0,void 0,function*(){yield this.fetchNotificationsFromApi(e)})}filteredEndUserNotifications$(e){return 0==e.length?Ds.w:this.notificationService.notifications$.pipe((0,dr.p)(([{type:t},i])=>(t===be._n.Notification||t===be._n.NotificationStatus)&&e.includes(i)))}listenForEndUserNotifications(){return this.authService.authStatuses$.pipe(Kl,(0,ge.n)(e=>this.filteredEndUserNotifications$(e)),(0,Xi.H)(([e,t])=>this.upsertNotification(t,new ut(e.payload)))).subscribe()}fetchNotificationsFromApi(e){return Ll(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/notifications?pageSize=50",null,!0,!0),i=new Z.s(t,ht);null!=i.continuationToken&&this.logService.warning("More notifications available, but not fetched. Consider increasing the page size from 50");const n=i.data.map(e=>new ut(e));yield this.replaceNotificationState(e,n)})}replaceNotificationState(e,t){return this.notificationState(e).update(()=>t)}upsertNotification(e,t){return Ll(this,void 0,void 0,function*(){return this.notificationState(e).update(e=>{null!=e||(e=[]);const i=e.findIndex(e=>e.id===t.id);return-1===i?e.push(t):e[i]=t,e})})}notificationState(e){return this.stateProvider.getUser(e,zl)}},deps:[it.v2,g.G,Fs.J,Ve.u,is.K]}),(0,u.F)({provide:ld.T,useClass:class{constructor(e,t,i,n){this.authRequestService=e,this.deviceTrustService=t,this.i18nService=i,this.toastService=n,this.adminLoginApproved$=this.authRequestService.adminLoginApproved$.pipe((0,Js.M)(()=>{this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("loginApproved")})})),this.deviceTrusted$=this.deviceTrustService.deviceTrusted$.pipe((0,Js.M)(()=>{this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("deviceTrusted")})})),this.setupListeners$=(0,Uc.h)(this.adminLoginApproved$,this.deviceTrusted$)}},deps:[f.XF,jn.M,ts.W,Jc.f]}),(0,u.F)({provide:Ke,useClass:class{constructor(e,t){this.apiService=e,this.logService=t}setPassword(e){return Xt(this,void 0,void 0,function*(){try{return yield this.apiService.send("POST","/accounts/set-password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}postPassword(e){return Xt(this,void 0,void 0,function*(){try{return yield this.apiService.send("POST","/accounts/password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}putUpdateTempPassword(e){return Xt(this,void 0,void 0,function*(){try{return yield this.apiService.send("PUT","/accounts/update-temp-password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}putUpdateTdeOffboardingPassword(e){return Xt(this,void 0,void 0,function*(){try{return yield this.apiService.send("PUT","/accounts/update-tde-offboarding-password",e,!0,!1)}catch(t){throw this.logService.error(t),t}})}},deps:[g.G,is.K]}),(0,u.F)({provide:f.k4,useClass:f.$c,deps:[ns.U]}),(0,u.F)({provide:Nd.n,useClass:Nd.n,deps:[h.qQ,ts.W]}),(0,u.F)({provide:Dl.q,useClass:class{constructor(e,t){this.sdkService=e,this.logService=t}encrypt(e,t){return Fc(this,void 0,void 0,function*(){return(0,fe._)(this.sdkService.userClient$(t).pipe((0,E.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const n=Rc(i,t.take(),!1),r=this.toSdkCipherView(e,n.value),s=n.value.vault().ciphers().encrypt(r);return{cipher:Zo.o.fromSdkCipher(s.cipher),encryptedFor:(0,os.zw)(s.encryptedFor)}}catch(n){i.error=n,i.hasError=!0}finally{Pc(i)}}),(0,In.W)(e=>(this.logService.error(`Failed to encrypt cipher: ${e}`),Ds.w))))})}moveToOrganization(e,t,i){return Fc(this,void 0,void 0,function*(){return(0,fe._)(this.sdkService.userClient$(i).pipe((0,E.T)(i=>{const n={stack:[],error:void 0,hasError:!1};try{if(!i)throw new Error("SDK not available");const r=Rc(n,i.take(),!1),s=this.toSdkCipherView(e,r.value),o=r.value.vault().ciphers().move_to_organization(s,(0,os.WD)(t)),a=r.value.vault().ciphers().encrypt(o);return{cipher:Zo.o.fromSdkCipher(a.cipher),encryptedFor:(0,os.zw)(a.encryptedFor)}}catch(r){n.error=r,n.hasError=!0}finally{Pc(n)}}),(0,In.W)(e=>(this.logService.error(`Failed to move cipher to organization: ${e}`),Ds.w))))})}encryptCipherForRotation(e,t,i){return Fc(this,void 0,void 0,function*(){return(0,fe._)(this.sdkService.userClient$(t).pipe((0,E.T)(t=>{const n={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const r=Rc(n,t.take(),!1),s=this.toSdkCipherView(e,r.value),o=r.value.vault().ciphers().encrypt_cipher_for_rotation(s,i.toBase64());return{cipher:Zo.o.fromSdkCipher(o.cipher),encryptedFor:(0,os.zw)(o.encryptedFor)}}catch(r){n.error=r,n.hasError=!0}finally{Pc(n)}}),(0,In.W)(e=>(this.logService.error(`Failed to rotate cipher data: ${e}`),Ds.w))))})}decrypt(e,t){return Fc(this,void 0,void 0,function*(){return(0,fe._)(this.sdkService.userClient$(t).pipe((0,E.T)(t=>{var i,n;const r={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const s=Rc(r,t.take(),!1),o=s.value.vault().ciphers().decrypt(e.toSdkCipher()),a=_o.f.fromSdkCipherView(o);if(a.type===_l.gC.Login&&(null===(n=null===(i=o.login)||void 0===i?void 0:i.fido2Credentials)||void 0===n?void 0:n.length)){const e=s.value.vault().ciphers().decrypt_fido2_credentials(o),t=s.value.vault().ciphers().decrypt_fido2_private_key(o);a.login.fido2Credentials=e.map(e=>{const i=Tc.X.fromSdkFido2CredentialView(e);return i.keyValue=t,i}).filter(e=>void 0!==e)}return a}catch(s){r.error=s,r.hasError=!0}finally{Pc(r)}}),(0,In.W)(e=>(this.logService.error(`Failed to decrypt cipher ${e}`),Ds.w))))})}decryptManyLegacy(e,t){return(0,fe._)(this.sdkService.userClient$(t).pipe((0,E.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK not available");const n=Rc(i,t.take(),!1),r=[],s=[];return e.forEach(e=>{var t,i;try{const s=n.value.vault().ciphers().decrypt(e.toSdkCipher()),o=_o.f.fromSdkCipherView(s);if(o.type===_l.gC.Login&&(null===(i=null===(t=s.login)||void 0===t?void 0:t.fido2Credentials)||void 0===i?void 0:i.length)){const e=n.value.vault().ciphers().decrypt_fido2_credentials(s),t=n.value.vault().ciphers().decrypt_fido2_private_key(s);o.login.fido2Credentials=e.map(e=>{const i=Tc.X.fromSdkFido2CredentialView(e);return i.keyValue=t,i}).filter(e=>void 0!==e)}r.push(o)}catch(o){this.logService.error(`Failed to decrypt cipher ${e.id}: ${o}`);const t=new _o.f(e);t.name="[error: cannot decrypt]",t.decryptionFailure=!0,s.push(t)}}),[r,s]}catch(n){i.error=n,i.hasError=!0}finally{Pc(i)}}),(0,In.W)(e=>(this.logService.error(`Failed to decrypt ciphers: ${e}`),Ds.w))))}decryptManyWithFailures(e,t){return Fc(this,void 0,void 0,function*(){return(0,fe._)(this.sdkService.userClient$(t).pipe((0,E.T)(t=>{const i={stack:[],error:void 0,hasError:!1};try{if(!t)throw new Error("SDK is undefined");const n=Rc(i,t.take(),!1).value.vault().ciphers().decrypt_list_with_failures(e.map(e=>e.toSdkCipher())),r=n.successes;return[r,n.failures.map(e=>Zo.o.fromSdkCipher(e)).filter(e=>void 0!==e)]}catch(n){i.error=n,i.hasError=!0}finally{Pc(i)}})))})}decryptAttachmentContent(e,t,i,n){return Fc(this,void 0,void 0,function*(){return(0,fe._)(this.sdkService.userClient$(n).pipe((0,E.T)(n=>{const r={stack:[],error:void 0,hasError:!1};try{if(!n)throw new Error("SDK is undefined");return Rc(r,n.take(),!1).value.vault().attachments().decrypt_buffer(e.toSdkCipher(),t.toSdkAttachmentView(),i)}catch(s){r.error=s,r.hasError=!0}finally{Pc(r)}}),(0,In.W)(e=>(this.logService.error(`Failed to decrypt cipher buffer: ${e}`),Ds.w))))})}toSdkCipherView(e,t){var i,n;let r=e.toSdkCipherView();if(e.type===_l.gC.Login&&(null===(i=e.login)||void 0===i?void 0:i.hasFido2Credentials)){const i=null===(n=e.login.fido2Credentials)||void 0===n?void 0:n.map(e=>e.toSdkFido2CredentialFullView());r=t.vault().ciphers().set_fido2_credentials(r,i)}return r}},deps:[os.K5,is.K]}),(0,u.F)({provide:l.Fx,useClass:l.kg,deps:[Si.Lu,Ke,Ir.O]}),(0,u.F)({provide:jd,useClass:class{constructor(e,t,i,n,r,o,a,l,c,d){this.syncService=e,this.accountService=t,this.stateProvider=i,this.encryptedMigrator=n,this.authService=r,this.logService=o,this.dialogService=a,this.toastService=l,this.i18nService=c,this.router=d,this.isMigrating=!1,this.url$=this.router.events.pipe((0,dr.p)(e=>e instanceof s.wF),(0,E.T)(e=>e.url)),this.accountService.accounts$.pipe((0,ge.n)(e=>{const t=Object.keys(e);return 0===t.length?(0,xt.of)([]):(0,$t.z)(t.map(e=>(0,$t.z)([this.authService.authStatusFor$(e),this.syncService.lastSync$(e).pipe((0,dr.p)(e=>null!=e)),this.url$]).pipe((0,dr.p)(([e,t,i])=>e===Dt.J.Unlocked&&Gd.includes(i)),(0,Xi.H)(()=>this.runMigrationsIfNeeded(e)))))})).subscribe()}runMigrationsIfNeeded(e){return Md(this,void 0,void 0,function*(){if((yield(0,fe._)(this.authService.authStatusFor$(e)))===Dt.J.Unlocked)if(this.isMigrating||this.encryptedMigrator.isRunningMigrations())this.logService.info(`[EncryptedMigrationsScheduler] Skipping migration check for user ${e} because migrations are already in progress`);else{switch(this.isMigrating=!0,yield this.encryptedMigrator.needsMigrations(e)){case"noMigrationNeeded":this.logService.info(`[EncryptedMigrationsScheduler] No migrations needed for user ${e}`);break;case"needsMigrationWithMasterPassword":this.logService.info(`[EncryptedMigrationsScheduler] User ${e} needs migrations with master password`),yield this.runMigrationsWithInteraction(e);break;case"needsMigration":this.logService.info(`[EncryptedMigrationsScheduler] User ${e} needs migrations with master password`),yield this.runMigrationsWithoutInteraction(e)}this.isMigrating=!1}})}runMigrationsWithoutInteraction(e){return Md(this,void 0,void 0,function*(){try{yield this.encryptedMigrator.runMigrations(e,null)}catch(t){this.logService.error("[EncryptedMigrationsScheduler] Error during migration without interaction",t)}})}runMigrationsWithInteraction(e){return Md(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.stateProvider.getUser(e,Ud).state$);if(null!=t){if(((new Date).getTime()-t.getTime())/36e5<24)return void this.logService.info("[EncryptedMigrationsScheduler] Migration prompt dismissed recently, skipping for now.")}try{const t=Od.open(this.dialogService),i=yield(0,fe._)(t.closed);Se.A.isNullOrWhitespace(i)?yield this.stateProvider.setUserState(Ud,new Date,e):yield this.encryptedMigrator.runMigrations(e,void 0===i?null:i)}catch(i){this.logService.error("[EncryptedMigrationsScheduler] Error during migration prompt",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("migrationsFailed")})}})}},deps:[ua.H,Ge.Di,it.v2,Hn.G,Ve.u,is.K,Qc.o3,Jc.f,ts.W,s.Ix]}),(0,u.F)({provide:r.hnV,useFactory:e=>()=>{},deps:[jd],multi:!0}),(0,u.F)({provide:f.FQ,useClass:f.uU,deps:[Ge.Di,Si.Zm,ri.ep,f.k4,ns.U,Nl.S,jl.k,Ir.O,it.lR,Ml.p,Ve.u,cs,Pn.Y,is.K,Si.Lu]}),(0,u.F)({provide:Al.J,useClass:class{constructor(e,t,i,n){this.cipherService=e,this.apiService=t,this.billingAccountProfileStateService=i,this.configService=n,this.hasArchiveFlagEnabled$=this.configService.getFeatureFlag$(dn.TO.PM19148_InnovationArchive).pipe((0,At.t)({refCount:!0,bufferSize:1}))}archivedCiphers$(e){return this.cipherService.cipherListViews$(e).pipe((0,dr.p)(e=>null!=e),(0,E.T)(e=>e.filter(e=>yc.n.isArchived(e)&&!yc.n.isDeleted(e))))}userCanArchive$(e){return(0,$t.z)([this.billingAccountProfileStateService.hasPremiumFromAnySource$(e),this.configService.getFeatureFlag$(dn.TO.PM19148_InnovationArchive)]).pipe((0,E.T)(([e,t])=>e&&t),(0,At.t)({refCount:!0,bufferSize:1}))}userHasPremium$(e){return this.billingAccountProfileStateService.hasPremiumFromAnySource$(e).pipe((0,At.t)({refCount:!0,bufferSize:1}))}showSubscriptionEndedMessaging$(e){return(0,$t.z)([this.archivedCiphers$(e),this.userHasPremium$(e)]).pipe((0,E.T)(([e,t])=>e.length>0&&!t),(0,At.t)({refCount:!0,bufferSize:1}))}archiveWithServer(e,t){return Cc(this,void 0,void 0,function*(){const i=new Ic(Array.isArray(e)?e:[e]),n=yield this.apiService.send("PUT","/ciphers/archive",i,!0,!0),r=new Z.s(n,Ha.N),s=yield(0,fe._)(this.cipherService.ciphers$(t));for(const e of r.data){const t=s[e.id];null!=t&&(t.archivedDate=e.archivedDate,t.revisionDate=e.revisionDate)}yield this.cipherService.replace(s,t)})}unarchiveWithServer(e,t){return Cc(this,void 0,void 0,function*(){const i=new kc(Array.isArray(e)?e:[e]),n=yield this.apiService.send("PUT","/ciphers/unarchive",i,!0,!0),r=new Z.s(n,Ha.N),s=yield(0,fe._)(this.cipherService.ciphers$(t));for(const e of r.data){const t=s[e.id];null!=t&&(t.archivedDate=e.archivedDate,t.revisionDate=e.revisionDate)}yield this.cipherService.replace(s,t)})}},deps:[Ml.p,g.G,Bi.Q,Zr.w]}),(0,u.F)({provide:gr.y,useClass:class{constructor(e,t){this.keyService=e,this.encryptService=t}createKeySet(e,t){return wr(this,void 0,void 0,function*(){if(!e)throw new Error("failed to create key set: upstreamKey is required");if(!t)throw new Error("failed to create key set: downstreamKey is required");const[i,n]=yield this.keyService.makeKeyPair(e),r=Se.A.fromB64ToArray(i),s=yield this.encryptService.encapsulateKeyUnsigned(t,r),o=yield this.encryptService.wrapEncapsulationKey(r,t);return new Lt.B(s,o,n)})}rotateKeySet(e,t,i){return wr(this,void 0,void 0,function*(){if(!e)throw new Error("failed to rotate key set: keySet is required");if(!t)throw new Error("failed to rotate key set: oldDownstreamKey is required");if(!i)throw new Error("failed to rotate key set: newDownstreamKey is required");const n=yield this.encryptService.unwrapEncapsulationKey(e.encryptedPublicKey,t);if(null==n)throw new Error("failed to rotate key set: could not decrypt public key");const r=yield this.encryptService.wrapEncapsulationKey(n,i),s=yield this.encryptService.encapsulateKeyUnsigned(i,n);return new Lt.B(s,r,e.encryptedPrivateKey)})}},deps:[Si.Lu,En.N]}),(0,u.F)({provide:v.o,useClass:v.$w,deps:[]}),(0,u.F)({provide:ys,useClass:ys,deps:[it.v2]}),(0,u.F)({provide:or.E,useClass:class{constructor(e){this.apiService=e}getConfirmationDetails(e){return cr(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/accounts/key-connector/confirmation-details/"+encodeURIComponent(e),null,!0,!0);return new lr(t)})}},deps:[g.G]}),(0,u.F)({provide:d.a,useClass:dd,deps:[]})];class ru{}ru.ɵfac=function(e){return new(e||ru)},ru.ɵmod=r.$C({type:ru}),ru.ɵinj=p.G2t({providers:nu});var su=i(53127),ou=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var au=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class lu extends An.B{load(){return au(this,void 0,void 0,function*(){throw new Error("SDK not available in this environment")})}}var cu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class du{constructor(e){this.storage=e,this.updatesSubject=new m.B,this.updates$=this.updatesSubject.asObservable()}get valuesRequireDeserialization(){return!0}get(e,t){const i=this.storage.getItem(e);return null!=i?Promise.resolve(JSON.parse(i)):Promise.resolve(null)}has(e,t){return cu(this,void 0,void 0,function*(){return null!=(yield this.get(e,t))})}save(e,t,i){if(null==t)return this.remove(e,i);t instanceof Set&&(t=Array.from(t)),this.storage.setItem(e,JSON.stringify(t)),this.updatesSubject.next({key:e,updateType:"save"})}remove(e,t){return this.storage.removeItem(e),this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}getKeys(){return Object.keys(this.storage)}}var uu=i(11009),hu=i(43090),pu=i(27545),mu=i(78212),vu=i(55784);const fu=new D.Zs(D.fK,"organizationInvite",{deserializer:e=>e?vu.J.fromJSON(e):null});var gu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var yu=i(39960);function bu(e){return ks(e)}var wu=i(54607),Su=i(82522);class Iu extends v.FX{constructor(e){super(),this.i18nService=e}setDocumentCookies(){document.cookie=`ssoHandOffMessage=${this.i18nService.t("ssoHandOff")};SameSite=strict`}}Iu.ɵfac=function(e){return new(e||Iu)(p.KVO(ts.W))},Iu.ɵprov=p.jDH({token:Iu,factory:Iu.ɵfac});var ku=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Cu=new it.Ok(it.g,"premiumInterest",{deserializer:e=>e,clearOn:["lock","logout"]});class Tu{constructor(e){this.stateProvider=e}getPremiumInterest(e){return ku(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot get 'premiumInterest'.");return yield(0,fe._)(this.stateProvider.getUserState$(Cu,e))})}setPremiumInterest(e,t){return ku(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot set 'premiumInterest'.");yield this.stateProvider.setUserState(Cu,t,e)})}clearPremiumInterest(e){return ku(this,void 0,void 0,function*(){if(!e)throw new Error("UserId is required. Cannot clear 'premiumInterest'.");yield this.stateProvider.setUserState(Cu,null,e)})}}Tu.ɵfac=function(e){return new(e||Tu)(p.KVO(it.v2))},Tu.ɵprov=p.jDH({token:Tu,factory:Tu.ɵfac});var Fu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ru{get defaultOptions(){return{htmlStorageLocation:si.EO.Session}}get valuesRequireDeserialization(){return!0}constructor(){this.updatesSubject=new m.B,this.updates$=this.updatesSubject.asObservable()}get(e,t=this.defaultOptions){let i=null;switch(t.htmlStorageLocation){case si.EO.Local:i=window.localStorage.getItem(e);break;case si.EO.Session:default:i=window.sessionStorage.getItem(e)}if(null!=i){const e=JSON.parse(i);return Promise.resolve(e)}return Promise.resolve(null)}has(e){return Fu(this,arguments,void 0,function*(e,t=this.defaultOptions){return null!=(yield this.get(e,t))})}save(e,t,i=this.defaultOptions){if(null==t)return this.remove(e,i);t instanceof Set&&(t=Array.from(t));const n=JSON.stringify(t);switch(i.htmlStorageLocation){case si.EO.Local:window.localStorage.setItem(e,n);break;case si.EO.Session:default:window.sessionStorage.setItem(e,n)}return this.updatesSubject.next({key:e,updateType:"save"}),Promise.resolve()}remove(e,t=this.defaultOptions){switch(t.htmlStorageLocation){case si.EO.Local:window.localStorage.removeItem(e);break;case si.EO.Session:default:window.sessionStorage.removeItem(e)}return this.updatesSubject.next({key:e,updateType:"remove"}),Promise.resolve()}}Ru.ɵfac=function(e){return new(e||Ru)},Ru.ɵprov=p.jDH({token:Ru,factory:Ru.ɵfac});var Pu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class xu{constructor(e,t,i){this.systemLanguage=e,this.localesDirectory=t,this.getLocalesJson=i,this.supportedTranslationLocales=["en"],this.defaultLocale="en",this.localeNames=new Map([["af","Afrikaans"],["ar","العربية الفصحى"],["az","Azərbaycanca"],["be","Беларуская"],["bg","български"],["bn","বাংলা"],["bs","bosanski jezik"],["ca","català"],["cs","čeština"],["cy","Cymraeg, y Gymraeg"],["da","dansk"],["de","Deutsch"],["el","Ελληνικά"],["en","English"],["en-GB","English (British)"],["en-IN","English (India)"],["eo","Esperanto"],["es","español"],["et","eesti"],["eu","euskara"],["fa","فارسی"],["fi","suomi"],["fil","Wikang Filipino"],["fr","français"],["gl","galego"],["he","עברית"],["hi","हिन्दी"],["hr","hrvatski"],["hu","magyar"],["id","Bahasa Indonesia"],["it","italiano"],["ja","日本語"],["ka","ქართული"],["km","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ"],["kn","ಕನ್ನಡ"],["ko","한국어"],["lt","lietuvių kalba"],["lv","Latvietis"],["me","црногорски"],["ml","മലയാളം"],["mr","मराठी"],["my","ဗမာစကား"],["nb","norsk (bokmål)"],["ne","नेपाली"],["nl","Nederlands"],["nn","Norsk Nynorsk"],["or","ଓଡ଼ିଆ"],["pl","polski"],["pt-BR","português do Brasil"],["pt-PT","português"],["ro","română"],["ru","русский"],["si","සිංහල"],["sk","slovenčina"],["sl","Slovenski jezik, Slovenščina"],["sr","Српски"],["sv","svenska"],["ta","தமிழ்"],["te","తెలుగు"],["th","ไทย"],["tr","Türkçe"],["uk","українська"],["vi","Tiếng Việt"],["zh-CN","中文（中国大陆）"],["zh-TW","中文（台灣）"]]),this.defaultMessages={},this.localeMessages={},this.systemLanguage=e.replace("_","-")}init(e){return Pu(this,void 0,void 0,function*(){if(this.inited)throw new Error("i18n already initialized.");if(null==this.supportedTranslationLocales||0===this.supportedTranslationLocales.length)throw new Error("supportedTranslationLocales not set.");this.inited=!0,this.translationLocale=null!=e?e:this.systemLanguage;try{this.collator=new Intl.Collator(this.translationLocale,{numeric:!0,sensitivity:"base"})}catch(t){this.collator=null}-1===this.supportedTranslationLocales.indexOf(this.translationLocale)&&(this.translationLocale=this.translationLocale.slice(0,2),-1===this.supportedTranslationLocales.indexOf(this.translationLocale)&&(this.translationLocale=this.defaultLocale)),null!=this.localesDirectory&&(yield this.loadMessages(this.translationLocale,this.localeMessages),this.translationLocale!==this.defaultLocale&&(yield this.loadMessages(this.defaultLocale,this.defaultMessages)))})}t(e,t,i,n){return this.translate(e,t,i,n)}translate(e,t,i,n){let r;return r=this.localeMessages.hasOwnProperty(e)&&this.localeMessages[e]?this.localeMessages[e]:this.defaultMessages.hasOwnProperty(e)&&this.defaultMessages[e]?this.defaultMessages[e]:"",""!==r&&(null!=t&&(r=r.split("__$1__").join(t.toString())),null!=i&&(r=r.split("__$2__").join(i.toString())),null!=n&&(r=r.split("__$3__").join(n.toString()))),r}loadMessages(e,t){return Pu(this,void 0,void 0,function*(){const i=e.replace("-","_"),n=yield this.getLocalesJson(i);for(const e in n)if(n.hasOwnProperty(e)&&(t[e]=n[e].message,n[e].placeholders))for(const i in n[e].placeholders){if(!n[e].placeholders.hasOwnProperty(i)||!n[e].placeholders[i].content)continue;const r="\\$"+i.toUpperCase()+"\\$";let s=n[e].placeholders[i].content;"$1"!==s&&"$2"!==s&&"$3"!==s||(s="__$"+s+"__"),t[e]=t[e].replace(new RegExp(r,"g"),s)}})}}var $u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Eu=new D.Zs(D.Ud,"locale",{deserializer:e=>e});class Au extends xu{constructor(e,t,i,n){super(e,t,i),this.systemLanguage=e,this.localesDirectory=t,this.getLocalesJson=i,this.translationLocaleState=n.get(Eu),this.userSetLocale$=this.translationLocaleState.state$,this.locale$=this.userSetLocale$.pipe((0,E.T)(e=>null!=e?e:this.translationLocale))}setLocale(e){return $u(this,void 0,void 0,function*(){yield this.translationLocaleState.update(()=>e)})}init(){const e=Object.create(null,{init:{get:()=>super.init}});return $u(this,void 0,void 0,function*(){const t=yield(0,fe._)(this.translationLocaleState.state$);yield e.init.call(this,t)})}}const Du=["en","af","ar","az","be","bg","bn","bs","ca","cs","cy","da","de","el","en-GB","en-IN","eo","es","et","eu","fa","fi","fil","fr","gl","he","hi","hr","hu","id","it","ja","ka","km","kn","ko","lv","ml","mr","my","nb","ne","nl","nn","or","pl","pt-PT","pt-BR","ro","ru","si","sk","sl","sr","sv","ta","te","th","tr","uk","vi","zh-CN","zh-TW"];var Ou=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Mu{get blobOptions(){var e;const t=null!==(e=this._request.blobOptions)&&void 0!==e?e:{};return null==t.type&&(t.type=this.fileType),t}get blob(){return null!=this.blobOptions?new Blob([this._request.blobData],this.blobOptions):new Blob([this._request.blobData])}get downloadMethod(){return null!=this._request.downloadMethod?this._request.downloadMethod:"application/pdf"!=this.fileType?"save":"open"}get fileType(){const e=this._request.fileName.toLowerCase();return e.endsWith(".pdf")?"application/pdf":e.endsWith(".xlsx")?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":e.endsWith(".docx")?"application/vnd.openxmlformats-officedocument.wordprocessingml.document":e.endsWith(".pptx")?"application/vnd.openxmlformats-officedocument.presentationml.presentation":e.endsWith(".csv")?"text/csv":e.endsWith(".png")?"image/png":e.endsWith(".jpg")||e.endsWith(".jpeg")?"image/jpeg":e.endsWith(".gif")?"image/gif":null}constructor(e){this._request=e}}class Uu{constructor(e){this.platformUtilsService=e}download(e){const t=new Mu(e),i=window.document.createElement("a");this.platformUtilsService.supportsFileDownloads()||(i.rel="noreferrer",i.target="_blank"),i.href=URL.createObjectURL(t.blob),i.download=e.fileName,window.document.body.appendChild(i),i.click(),window.document.body.removeChild(i)}}Uu.ɵfac=function(e){return new(e||Uu)(p.KVO(rs.y))},Uu.ɵprov=p.jDH({token:Uu,factory:Uu.ɵfac});var Gu=i(29730),ju=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Nu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Vu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Bu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class zu extends Si.Zm{authenticateWithBiometrics(){return Bu(this,void 0,void 0,function*(){return!1})}getBiometricsStatus(){return Bu(this,void 0,void 0,function*(){return Si.cR.PlatformUnsupported})}unlockWithBiometricsForUser(e){return Bu(this,void 0,void 0,function*(){return null})}getBiometricsStatusForUser(e){return Bu(this,void 0,void 0,function*(){return Si.cR.PlatformUnsupported})}getShouldAutopromptNow(){return Bu(this,void 0,void 0,function*(){return!1})}setShouldAutopromptNow(e){return Bu(this,void 0,void 0,function*(){})}canEnableBiometricUnlock(){return Bu(this,void 0,void 0,function*(){return!1})}}var Lu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ku=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qu extends Po{constructor(e,t){super(e),this.urls=t}}var _u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Xu extends it.Nb{constructor(e,t,i){super(e,t,i,"web-disk-local",be.sK.Web),this.diskLocalStorageService=t}getAccounts(){return _u(this,void 0,void 0,function*(){const e=this.diskLocalStorageService.getKeys(),t=[];for(const i of e){if(!Se.A.isGuid(i))continue;const e=yield this.diskLocalStorageService.get(i);null!=e&&("object"==typeof e&&t.push({userId:i,account:e}))}return t})}}var Yu=i(73442),Hu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Wu=(()=>{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}}catch(e){}return!1})();class Ju extends An.B{load(){return Hu(this,void 0,void 0,function*(){let e;e=Wu?yield i.e(502).then(i.bind(i,71502)):yield i.e(531).then(i.bind(i,92531)),Yu.TsN(e)})}}class Zu extends ls.wH{constructor(e,t,i){super(e,t),this.diskLocalStorageService=i}get(e,t){var i;const n=null!==(i=t.web)&&void 0!==i?i:e;return"disk-local"===n?["disk-local",this.diskLocalStorageService]:super.get(n,t)}}var Qu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var eh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class th{constructor(e,t,i){this.i18nService=e,i.activeAccount$.pipe(ye.F6,(0,ge.n)(e=>t.policies$(e))).subscribe(e=>{this.policies=e})}getDefaultDateFilters(){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate(),23,59);e.setDate(e.getDate()-30);const i=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0);return[this.toDateTimeLocalString(i),this.toDateTimeLocalString(t)]}formatDateFilters(e,t){const i=new Date(e),n=new Date(t+":59.999");if(isNaN(i.getTime())||isNaN(n.getTime())||n<i)throw new Error("Invalid date range.");return[i.toISOString(),n.toISOString()]}getEventInfo(e){return eh(this,arguments,void 0,function*(e,t=new ih){const i=this.getAppInfo(e),{message:n,humanReadableMessage:r}=yield this.getEventMessage(e,t);return{message:n,humanReadableMessage:r,appIcon:i[0],appName:i[1]}})}getEventMessage(e,t){return eh(this,void 0,void 0,function*(){let i="",n="";switch(e.type){case be.Bx.User_LoggedIn:i=n=this.i18nService.t("loggedIn");break;case be.Bx.User_ChangedPassword:i=n=this.i18nService.t("changedPassword");break;case be.Bx.User_Updated2fa:i=n=this.i18nService.t("enabledUpdated2fa");break;case be.Bx.User_Disabled2fa:i=n=this.i18nService.t("disabled2fa");break;case be.Bx.User_Recovered2fa:i=n=this.i18nService.t("recovered2fa");break;case be.Bx.User_FailedLogIn:i=n=this.i18nService.t("failedLogin");break;case be.Bx.User_FailedLogIn2fa:i=n=this.i18nService.t("failedLogin2fa");break;case be.Bx.User_ClientExportedVault:i=n=this.i18nService.t("exportedVault");break;case be.Bx.User_UpdatedTempPassword:i=n=this.i18nService.t("updatedTempPassword");break;case be.Bx.User_MigratedKeyToKeyConnector:i=n=this.i18nService.t("migratedKeyConnector");break;case be.Bx.User_RequestedDeviceApproval:i=n=this.i18nService.t("requestedDeviceApproval");break;case be.Bx.User_TdeOffboardingPasswordSet:i=n=this.i18nService.t("tdeOffboardingPasswordSet");break;case be.Bx.Cipher_Created:i=this.i18nService.t("createdItemId",this.formatCipherId(e,t)),n=this.i18nService.t("createdItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_Updated:i=this.i18nService.t("editedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("editedItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_Deleted:i=this.i18nService.t("permanentlyDeletedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("permanentlyDeletedItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_SoftDeleted:i=this.i18nService.t("deletedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("deletedItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_Restored:i=this.i18nService.t("restoredItemId",this.formatCipherId(e,t)),n=this.i18nService.t("restoredItemId",this.formatCipherId(e,t));break;case be.Bx.Cipher_AttachmentCreated:i=this.i18nService.t("createdAttachmentForItem",this.formatCipherId(e,t)),n=this.i18nService.t("createdAttachmentForItem",this.getShortId(e.cipherId));break;case be.Bx.Cipher_AttachmentDeleted:i=this.i18nService.t("deletedAttachmentForItem",this.formatCipherId(e,t)),n=this.i18nService.t("deletedAttachmentForItem",this.getShortId(e.cipherId));break;case be.Bx.Cipher_Shared:i=this.i18nService.t("movedItemIdToOrg",this.formatCipherId(e,t)),n=this.i18nService.t("movedItemIdToOrg",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientViewed:i=this.i18nService.t("viewedItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientToggledPasswordVisible:i=this.i18nService.t("viewedPasswordItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedPasswordItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientToggledHiddenFieldVisible:i=this.i18nService.t("viewedHiddenFieldItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedHiddenFieldItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientToggledCardNumberVisible:i=this.i18nService.t("viewedCardNumberItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedCardNumberItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientToggledCardCodeVisible:i=this.i18nService.t("viewedSecurityCodeItemId",this.formatCipherId(e,t)),n=this.i18nService.t("viewedSecurityCodeItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientCopiedHiddenField:i=this.i18nService.t("copiedHiddenFieldItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedHiddenFieldItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientCopiedPassword:i=this.i18nService.t("copiedPasswordItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedPasswordItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientCopiedCardCode:i=this.i18nService.t("copiedSecurityCodeItemId",this.formatCipherId(e,t)),n=this.i18nService.t("copiedSecurityCodeItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_ClientAutofilled:i=this.i18nService.t("autofilledItemId",this.formatCipherId(e,t)),n=this.i18nService.t("autofilledItemId",this.getShortId(e.cipherId));break;case be.Bx.Cipher_UpdatedCollections:i=this.i18nService.t("editedCollectionsForItem",this.formatCipherId(e,t)),n=this.i18nService.t("editedCollectionsForItem",this.getShortId(e.cipherId));break;case be.Bx.Collection_Created:i=this.i18nService.t("createdCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("createdCollectionId",this.getShortId(e.collectionId));break;case be.Bx.Collection_Updated:i=this.i18nService.t("editedCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("editedCollectionId",this.getShortId(e.collectionId));break;case be.Bx.Collection_Deleted:i=this.i18nService.t("deletedCollectionId",this.formatCollectionId(e)),n=this.i18nService.t("deletedCollectionId",this.getShortId(e.collectionId));break;case be.Bx.Group_Created:i=this.i18nService.t("createdGroupId",this.formatGroupId(e)),n=this.i18nService.t("createdGroupId",this.getShortId(e.groupId));break;case be.Bx.Group_Updated:i=this.i18nService.t("editedGroupId",this.formatGroupId(e)),n=this.i18nService.t("editedGroupId",this.getShortId(e.groupId));break;case be.Bx.Group_Deleted:i=this.i18nService.t("deletedGroupId",this.formatGroupId(e)),n=this.i18nService.t("deletedGroupId",this.getShortId(e.groupId));break;case be.Bx.OrganizationUser_Invited:i=this.i18nService.t("invitedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("invitedUserId",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_Confirmed:i=this.i18nService.t("confirmedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("confirmedUserId",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_Updated:i=this.i18nService.t("editedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("editedUserId",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_Removed:i=this.i18nService.t("removedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("removedUserId",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_UpdatedGroups:i=this.i18nService.t("editedGroupsForUser",this.formatOrgUserId(e)),n=this.i18nService.t("editedGroupsForUser",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_UnlinkedSso:i=this.i18nService.t("unlinkedSsoUser",this.formatOrgUserId(e)),n=this.i18nService.t("unlinkedSsoUser",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_ResetPassword_Enroll:i=this.i18nService.t("eventEnrollAccountRecovery",this.formatOrgUserId(e)),n=this.i18nService.t("eventEnrollAccountRecovery",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_ResetPassword_Withdraw:i=this.i18nService.t("eventWithdrawAccountRecovery",this.formatOrgUserId(e)),n=this.i18nService.t("eventWithdrawAccountRecovery",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_AdminResetPassword:i=this.i18nService.t("eventAdminPasswordReset",this.formatOrgUserId(e)),n=this.i18nService.t("eventAdminPasswordReset",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_ResetSsoLink:i=this.i18nService.t("eventResetSsoLink",this.formatOrgUserId(e)),n=this.i18nService.t("eventResetSsoLink",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_FirstSsoLogin:i=this.i18nService.t("firstSsoLogin",this.formatOrgUserId(e)),n=this.i18nService.t("firstSsoLogin",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_Revoked:i=this.i18nService.t("revokedUserId",this.formatOrgUserId(e)),n=this.i18nService.t("revokedUserId",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_Restored:i=this.i18nService.t("restoredUserId",this.formatOrgUserId(e)),n=this.i18nService.t("restoredUserId",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_ApprovedAuthRequest:i=this.i18nService.t("approvedAuthRequest",this.formatOrgUserId(e)),n=this.i18nService.t("approvedAuthRequest",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_RejectedAuthRequest:i=this.i18nService.t("rejectedAuthRequest",this.formatOrgUserId(e)),n=this.i18nService.t("rejectedAuthRequest",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_Deleted:i=this.i18nService.t("deletedUserIdEventMessage",this.formatOrgUserId(e)),n=this.i18nService.t("deletedUserIdEventMessage",this.getShortId(e.organizationUserId));break;case be.Bx.OrganizationUser_Left:i=this.i18nService.t("userLeftOrganization",this.formatOrgUserId(e)),n=this.i18nService.t("userLeftOrganization",this.getShortId(e.organizationUserId));break;case be.Bx.Organization_Updated:i=n=this.i18nService.t("editedOrgSettings");break;case be.Bx.Organization_PurgedVault:i=n=this.i18nService.t("purgedOrganizationVault");break;case be.Bx.Organization_ClientExportedVault:i=n=this.i18nService.t("exportedOrganizationVault");break;case be.Bx.Organization_VaultAccessed:i=n=this.i18nService.t("vaultAccessedByProvider");break;case be.Bx.Organization_EnabledSso:i=n=this.i18nService.t("enabledSso");break;case be.Bx.Organization_DisabledSso:i=n=this.i18nService.t("ssoTurnedOff");break;case be.Bx.Organization_EnabledKeyConnector:i=n=this.i18nService.t("enabledKeyConnector");break;case be.Bx.Organization_DisabledKeyConnector:i=n=this.i18nService.t("disabledKeyConnector");break;case be.Bx.Organization_SponsorshipsSynced:i=n=this.i18nService.t("sponsorshipsSynced");break;case be.Bx.Organization_CollectionManagementUpdated:i=this.i18nService.t("modifiedCollectionManagement",this.formatOrganizationId(e)),n=this.i18nService.t("modifiedCollectionManagement",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_LimitCollectionCreationEnabled:i=this.i18nService.t("limitCollectionCreationEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionCreationEnabled",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_LimitCollectionCreationDisabled:i=this.i18nService.t("limitCollectionCreationDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionCreationDisabled",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_LimitCollectionDeletionEnabled:i=this.i18nService.t("limitCollectionDeletionEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionDeletionEnabled",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_LimitCollectionDeletionDisabled:i=this.i18nService.t("limitCollectionDeletionDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitCollectionDeletionDisabled",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_LimitItemDeletionEnabled:i=this.i18nService.t("limitItemDeletionEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitItemDeletionEnabled",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_LimitItemDeletionDisabled:i=this.i18nService.t("limitItemDeletionDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("limitItemDeletionDisabled",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsEnabled:i=this.i18nService.t("allowAdminAccessToAllCollectionItemsEnabled",this.formatOrganizationId(e)),n=this.i18nService.t("allowAdminAccessToAllCollectionItemsEnabled",this.getShortId(e.organizationId));break;case be.Bx.Organization_CollectionManagement_AllowAdminAccessToAllCollectionItemsDisabled:i=this.i18nService.t("allowAdminAccessToAllCollectionItemsDisabled",this.formatOrganizationId(e)),n=this.i18nService.t("allowAdminAccessToAllCollectionItemsDisabled",this.getShortId(e.organizationId));break;case be.Bx.Policy_Updated:{i=this.i18nService.t("modifiedPolicyId",this.formatPolicyId(e));const t=this.policies.filter(t=>t.id===e.policyId)[0];let r=this.getShortId(e.policyId);null!=t&&(r=Ae.tt[t.type]),n=this.i18nService.t("modifiedPolicyId",r);break}case be.Bx.ProviderUser_Invited:i=this.i18nService.t("invitedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("invitedUserId",this.getShortId(e.providerUserId));break;case be.Bx.ProviderUser_Confirmed:i=this.i18nService.t("confirmedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("confirmedUserId",this.getShortId(e.providerUserId));break;case be.Bx.ProviderUser_Updated:i=this.i18nService.t("editedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("editedUserId",this.getShortId(e.providerUserId));break;case be.Bx.ProviderUser_Removed:i=this.i18nService.t("removedUserId",this.formatProviderUserId(e)),n=this.i18nService.t("removedUserId",this.getShortId(e.providerUserId));break;case be.Bx.ProviderOrganization_Created:i=this.i18nService.t("createdOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("createdOrganizationId",this.getShortId(e.providerOrganizationId));break;case be.Bx.ProviderOrganization_Added:i=this.i18nService.t("addedOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("addedOrganizationId",this.getShortId(e.providerOrganizationId));break;case be.Bx.ProviderOrganization_Removed:i=this.i18nService.t("removedOrganizationId",this.formatProviderOrganizationId(e)),n=this.i18nService.t("removedOrganizationId",this.getShortId(e.providerOrganizationId));break;case be.Bx.ProviderOrganization_VaultAccessed:i=this.i18nService.t("accessedClientVault",this.formatProviderOrganizationId(e)),n=this.i18nService.t("accessedClientVault",this.getShortId(e.providerOrganizationId));break;case be.Bx.OrganizationDomain_Added:i=n=this.i18nService.t("addedDomain",e.domainName);break;case be.Bx.OrganizationDomain_Removed:i=n=this.i18nService.t("removedDomain",e.domainName);break;case be.Bx.OrganizationDomain_Verified:i=n=this.i18nService.t("domainClaimedEvent",e.domainName);break;case be.Bx.OrganizationDomain_NotVerified:i=n=this.i18nService.t("domainNotClaimedEvent",e.domainName);break;case be.Bx.Secret_Retrieved:i=this.i18nService.t("accessedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("accessedSecretWithId",this.getShortId(e.secretId));break;case be.Bx.Secret_Created:i=this.i18nService.t("createdSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("createdSecretWithId",this.getShortId(e.secretId));break;case be.Bx.Secret_Deleted:i=this.i18nService.t("deletedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("deletedSecretWithId",this.getShortId(e.secretId));break;case be.Bx.Secret_Permanently_Deleted:i=this.i18nService.t("permanentlyDeletedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("permanentlyDeletedSecretWithId",this.getShortId(e.secretId));break;case be.Bx.Secret_Restored:i=this.i18nService.t("restoredSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("restoredSecretWithId",this.getShortId(e.secretId));break;case be.Bx.Secret_Edited:i=this.i18nService.t("editedSecretWithId",this.formatSecretId(e,t)),n=this.i18nService.t("editedSecretWithId",this.getShortId(e.secretId));break;case be.Bx.Project_Retrieved:i=this.i18nService.t("accessedProjectWithIdentifier",this.formatProjectId(e,t)),n=this.i18nService.t("accessedProjectWithIdentifier",this.getShortId(e.projectId));break;case be.Bx.Project_Created:i=this.i18nService.t("createdProjectWithId",this.formatProjectId(e,t)),n=this.i18nService.t("createdProjectWithId",this.getShortId(e.projectId));break;case be.Bx.Project_Deleted:i=this.i18nService.t("deletedProjectWithId",this.formatProjectId(e,t)),n=this.i18nService.t("deletedProjectWithId",this.getShortId(e.projectId));break;case be.Bx.Project_Edited:i=this.i18nService.t("editedProjectWithId",this.formatProjectId(e,t)),n=this.i18nService.t("editedProjectWithId",this.getShortId(e.projectId));break;case be.Bx.ServiceAccount_UserAdded:i=this.i18nService.t("addedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t)),n=this.i18nService.t("addedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t));break;case be.Bx.ServiceAccount_UserRemoved:i=this.i18nService.t("removedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t)),n=this.i18nService.t("removedUserToServiceAccountWithId",this.formatUserId(e,t),this.formatServiceAccountId(e,t));break;case be.Bx.ServiceAccount_GroupRemoved:i=this.i18nService.t("removedGroupFromServiceAccountWithId",this.formatGroupId(e),this.formatServiceAccountId(e,t)),n=this.i18nService.t("removedGroupFromServiceAccountWithId",this.formatGroupId(e),this.formatServiceAccountId(e,t));break;case be.Bx.ServiceAccount_GroupAdded:i=this.i18nService.t("addedGroupToServiceAccountId",this.formatGroupId(e),this.formatServiceAccountId(e,t)),n=this.i18nService.t("addedGroupToServiceAccountId",this.formatGroupId(e),this.formatServiceAccountId(e,t));break;case be.Bx.ServiceAccount_Created:i=this.i18nService.t("serviceAccountCreatedWithId",this.formatServiceAccountId(e,t)),n=this.i18nService.t("serviceAccountCreatedWithId",this.formatServiceAccountId(e,t));break;case be.Bx.ServiceAccount_Deleted:i=this.i18nService.t("serviceAccountDeletedWithId",this.formatServiceAccountId(e,t)),n=this.i18nService.t("serviceAccountDeletedWithId",this.formatServiceAccountId(e,t))}return{message:""===i?null:i,humanReadableMessage:""===n?null:n}})}getAppInfo(e){if(e.serviceAccountId)return["bwi-globe",this.i18nService.t("sdk")];switch(e.deviceType){case be.bq.Android:return["bwi-mobile",this.i18nService.t("mobile")+" - Android"];case be.bq.iOS:return["bwi-mobile",this.i18nService.t("mobile")+" - iOS"];case be.bq.UWP:return["bwi-mobile",this.i18nService.t("mobile")+" - Windows"];case be.bq.ChromeExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Chrome"];case be.bq.FirefoxExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Firefox"];case be.bq.OperaExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Opera"];case be.bq.EdgeExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Edge"];case be.bq.VivaldiExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Vivaldi"];case be.bq.SafariExtension:return["bwi-puzzle",this.i18nService.t("extension")+" - Safari"];case be.bq.WindowsDesktop:return["bwi-desktop",this.i18nService.t("desktop")+" - Windows"];case be.bq.MacOsDesktop:return["bwi-desktop",this.i18nService.t("desktop")+" - macOS"];case be.bq.LinuxDesktop:return["bwi-desktop",this.i18nService.t("desktop")+" - Linux"];case be.bq.ChromeBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Chrome"];case be.bq.FirefoxBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Firefox"];case be.bq.OperaBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Opera"];case be.bq.SafariBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Safari"];case be.bq.VivaldiBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Vivaldi"];case be.bq.EdgeBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - Edge"];case be.bq.IEBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - IE"];case be.bq.Server:return["bwi-user-monitor",this.i18nService.t("server")];case be.bq.WindowsCLI:return["bwi-cli",this.i18nService.t("cli")+" - Windows"];case be.bq.MacOsCLI:return["bwi-cli",this.i18nService.t("cli")+" - macOS"];case be.bq.LinuxCLI:return["bwi-cli",this.i18nService.t("cli")+" - Linux"];case be.bq.UnknownBrowser:return["bwi-browser",this.i18nService.t("webVault")+" - "+this.i18nService.t("unknown")];default:return["bwi-globe",this.i18nService.t("unknown")]}}formatCipherId(e,t){const i=this.getShortId(e.cipherId);if(null==e.organizationId||!t.cipherInfo)return"<code>"+i+"</code>";const n=this.makeAnchor(i);return n.setAttribute("href",`#/organizations/${e.organizationId}/vault?search=${i}&viewEvents=${e.cipherId}&type=all`),n.outerHTML}formatGroupId(e){const t=this.getShortId(e.groupId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/groups?search="+t),i.outerHTML}formatCollectionId(e){const t=this.getShortId(e.collectionId),i=this.makeAnchor(t);return i.setAttribute("href",`#/organizations/${e.organizationId}/vault?collectionId=${e.collectionId}`),i.outerHTML}formatOrgUserId(e){const t=this.getShortId(e.organizationUserId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/members?search="+t+"&viewEvents="+e.organizationUserId),i.outerHTML}formatProviderUserId(e){const t=this.getShortId(e.providerUserId),i=this.makeAnchor(t);return i.setAttribute("href","#/providers/"+e.providerId+"/manage/people?search="+t+"&viewEvents="+e.providerUserId),i.outerHTML}formatProviderOrganizationId(e){const t=this.getShortId(e.providerOrganizationId),i=this.makeAnchor(t);return i.setAttribute("href","#/providers/"+e.providerId+"/clients?search="+t),i.outerHTML}formatOrganizationId(e){const t=this.getShortId(e.organizationId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/settings/account"),i.outerHTML}formatPolicyId(e){const t=this.getShortId(e.policyId),i=this.makeAnchor(t);return i.setAttribute("href","#/organizations/"+e.organizationId+"/settings/policies?policyId="+e.policyId),i.outerHTML}formatSecretId(e,t){const i=this.getShortId(e.secretId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/sm/"+e.organizationId+"/secrets?search="+i+"&viewEvents="+e.secretId+"&type=all"),n.outerHTML}formatServiceAccountId(e,t){const i=this.getShortId(e.grantedServiceAccountId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/sm/"+e.organizationId+"/machine-accounts?search="+i+"&viewEvents="+e.grantedServiceAccountId+"&type=all"),n.outerHTML}formatUserId(e,t){const i=this.getShortId(e.userId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/organizations/"+e.organizationId+"/members?search="+i),n.outerHTML}formatProjectId(e,t){const i=this.getShortId(e.projectId);if(t.disableLink)return i;const n=this.makeAnchor(i);return n.setAttribute("href","#/sm/"+e.organizationId+"/projects?search="+i+"&viewEvents="+e.projectId+"&type=all"),n.outerHTML}makeAnchor(e){const t=document.createElement("a");return t.title=this.i18nService.t("view"),t.innerHTML="<code>"+e+"</code>",t}getShortId(e){return null==e?void 0:e.substring(0,8)}toDateTimeLocalString(e){return e.getFullYear()+"-"+this.pad(e.getMonth()+1)+"-"+this.pad(e.getDate())+"T"+this.pad(e.getHours())+":"+this.pad(e.getMinutes())}pad(e){const t=Math.floor(Math.abs(e));return(t<10?"0":"")+t}}th.ɵfac=function(e){return new(e||th)(p.KVO(ts.W),p.KVO(P.m),p.KVO(Ge.Di))},th.ɵprov=p.jDH({token:th,factory:th.ɵfac});class ih{constructor(){this.cipherInfo=!0,this.disableLink=!1}}class nh{constructor(e,t){this.keyService=e,this.encryptService=t}attachToGlobal(e){e.bitwardenContainerService||(e.bitwardenContainerService=this)}getKeyService(){if(null==this.keyService)throw new Error("ContainerService.keyService not initialized.");return this.keyService}getEncryptService(){if(null==this.encryptService)throw new Error("ContainerService.encryptService not initialized.");return this.encryptService}}var rh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class sh{constructor(e,t){this.platformUtilsService=e,this.sdkService=t}applyVersionToWindow(){window.__version=()=>rh(this,void 0,void 0,function*(){return{client:yield this.platformUtilsService.getApplicationVersion(),sdk:yield(0,fe._)(this.sdkService.client$.pipe((0,E.T)(e=>e.version()),(0,In.W)(()=>"Unsupported")))}})}}sh.ɵfac=function(e){return new(e||sh)(p.KVO(rs.y),p.KVO(os.K5))},sh.ɵprov=p.jDH({token:sh,factory:sh.ɵfac,providedIn:"root"});var oh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ah{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g){this.win=e,this.serverNotificationsService=t,this.vaultTimeoutService=i,this.i18nService=n,this.eventUploadService=r,this.twoFactorService=s,this.keyService=o,this.themingService=a,this.encryptService=l,this.userAutoUnlockKeyService=c,this.accountService=d,this.versionService=u,this.ipcService=h,this.sdkLoadService=p,this.taskService=m,this.configService=v,this.migrationRunner=f,this.document=g}init(){return()=>oh(this,void 0,void 0,function*(){yield this.sdkLoadService.loadAndInit(),yield this.migrationRunner.run(),this.encryptService.init(this.configService);const e=yield(0,fe._)(this.accountService.activeAccount$);e&&(yield this.userAutoUnlockKeyService.setUserKeyInMemoryIfAutoUserKeySet(e.id)),this.serverNotificationsService.startListening(),yield this.vaultTimeoutService.init(!0),yield this.i18nService.init(),this.eventUploadService.init(!0),this.twoFactorService.init();this.win.document.documentElement.classList.add("locale_"+this.i18nService.translationLocale),this.themingService.applyThemeChangesTo(this.document),this.versionService.applyVersionToWindow(),this.ipcService.init(),this.taskService.listenForTaskNotifications();new nh(this.keyService,this.encryptService).attachToGlobal(this.win)})}}ah.ɵfac=function(e){return new(e||ah)(p.KVO(h.jf),p.KVO(Fs.J),p.KVO(ri.a6),p.KVO(ts.W),p.KVO(w.f),p.KVO(Di.fz),p.KVO(Si.Lu),p.KVO(Ld),p.KVO(En.N),p.KVO(da),p.KVO(Ge.Di),p.KVO(sh),p.KVO(vs),p.KVO(An.B),p.KVO(Wc.RB),p.KVO(Zr.w),p.KVO(No),p.KVO(p.qQL))},ah.ɵprov=p.jDH({token:ah,factory:ah.ɵfac});const lh=new h.aZ("ENV_URLS");var ch=i(51971),dh=i(83724);const uh=[(0,u.F)(ah),(0,u.F)(ch.H),(0,u.F)(th),(0,u.F)({provide:wu.WM,useValue:wu.bS}),(0,u.F)({provide:h.de,deps:[rs.y],useFactory:e=>e.isDev()?ri.Lw.Never:15}),(0,u.F)({provide:r.hnV,useFactory:e=>e.init(),deps:[ah],multi:!0}),(0,u.F)({provide:ts.W,useClass:class extends Au{constructor(e,t,i){super(e||"en-US",t,e=>Ou(this,void 0,void 0,function*(){const t=this.localesDirectory+"/"+e+"/messages.json?cache=trguzs",i=yield fetch(t);return yield i.json()}),i),this.supportedTranslationLocales=Du}},deps:[h.Xk,h.U1,D.Y2]}),(0,u.F)({provide:ls.zq,useClass:Ru,deps:[]}),(0,u.F)({provide:h.G$,useClass:ls.g2,deps:[]}),(0,u.F)({provide:h.A5,useClass:ls.g2,deps:[]}),(0,u.F)({provide:h.ye,useClass:ls.Cc,deps:[]}),(0,u.F)({provide:h.ml,useFactory:()=>new du(window.sessionStorage),deps:[]}),(0,u.F)({provide:rs.y,useClass:dh._,useAngularDecorators:!0}),(0,u.F)({provide:su.y,useClass:Uu,useAngularDecorators:!0}),(0,u.F)({provide:du,useFactory:()=>new du(window.localStorage),deps:[]}),(0,u.F)({provide:h.e$,useExisting:du}),(0,u.F)({provide:ls.wH,useClass:Zu,deps:[h.ml,h.ye,h.e$]}),(0,u.F)({provide:No,useClass:class extends No{constructor(e,t,i,n){super(e,t,i,be.sK.Web),this.diskLocalStorage=n}run(){const e=Object.create(null,{run:{get:()=>super.run}});return _u(this,void 0,void 0,function*(){yield e.run.call(this);const t=this.migrationBuilderService.build();let i=yield this.diskLocalStorage.get("stateVersion");null==i&&(i=12);const n=new Xu(i,this.diskLocalStorage,this.logService);yield t.migrate(n)})}},deps:[ls.zq,is.K,Go,du]}),(0,u.F)({provide:lh,useValue:{}}),(0,u.F)({provide:Qr.v,useClass:class extends Co{constructor(e,t,i,n=[],r,s){var o;super(t,i,n),this.win=e,this.router=r,this.envUrls=s;let a=this.win.location.href;a=a.replace(/(\/+|\/*#.*|\/*\?.*)$/,""),null!==(o=s.base)&&void 0!==o||(s.base=a);const l=new URL(this.win.location.href).hostname,c=this.availableRegions().find(e=>new URL(e.urls.webVault).hostname===l);let d;d=c?new qu(c,s):new xo(s);const u=new eo.m(1);u.next(d),this._environmentSubject=u,this.environment$=u.asObservable(),this.globalEnvironment$=u.asObservable()}setEnvironment(e,t){return Ku(this,void 0,void 0,function*(){if(e===Qr.T.SelfHosted)throw new Error("setEnvironment does not work in web for self-hosted.");const t=new URL(this.win.location.href).hostname;if(this.availableRegions().find(e=>new URL(e.urls.webVault).hostname===t).key===e){return(yield(0,fe._)(this.environment$)).getUrls()}const i=this.availableRegions().find(t=>t.key===e);if(null==i)throw new Error("The selected region is not known as an available region.");const n=`/#${this.router.url}`;return this.win.location.href=i.urls.webVault+n,i.urls})}getEnvironment$(e){return this._environmentSubject.asObservable()}},deps:[h.jf,D.v2,Ge.Di,h.oq,s.Ix,lh]}),(0,u.F)({provide:Si.Zm,useClass:zu,deps:[]}),(0,u.F)({provide:ka.oO,useClass:ka.T2,deps:[D.Y2]}),(0,u.F)({provide:h.Hq,useValue:be.sK.Web}),(0,u.F)({provide:Ht.i,useClass:class{constructor(e){this.globalStateProvider=e,this.organizationInvitationState=this.globalStateProvider.get(fu)}getOrganizationInvite(){return gu(this,void 0,void 0,function*(){return yield(0,fe._)(this.organizationInvitationState.state$)})}setOrganizationInvitation(e){return gu(this,void 0,void 0,function*(){if(null==e)throw new Error("Invite cannot be null. Use clearOrganizationInvitation instead.");yield this.organizationInvitationState.update(()=>e)})}clearOrganizationInvitation(){return gu(this,void 0,void 0,function*(){yield this.organizationInvitationState.update(()=>null)})}},deps:[D.Y2]}),(0,u.F)({provide:v.mZ,useClass:Su.Ew,deps:[Si.Lu,Ue.T,Ht.i,R.m,is.K,P.m]}),(0,u.F)({provide:Ns,useClass:js,deps:[]}),(0,u.F)({provide:mu.qi,useClass:class{constructor(){this.userDecryptionOptionsService=(0,p.WQX)(f.Ym)}getBiometricsError(e){throw new Error("Biometric unlock is not supported in the web app. See getAvailableUnlockOptions$")}getPreviousUrl(){return null}popOutBrowserExtension(){throw new Error("Method not supported on this platform.")}closeBrowserExtensionPopout(){throw new Error("Method not supported on this platform.")}isWindowVisible(){return ju(this,void 0,void 0,function*(){throw new Error("Method not implemented.")})}getBiometricsUnlockBtnText(){throw new Error("Biometric unlock is not supported in the web app. See getAvailableUnlockOptions$")}getAvailableUnlockOptions$(e){var t;return null===(t=this.userDecryptionOptionsService.userDecryptionOptionsById$(e))||void 0===t?void 0:t.pipe((0,E.T)(e=>({masterPassword:{enabled:e.hasMasterPassword},pin:{enabled:!1},biometrics:{enabled:!1,biometricsStatus:Si.cR.PlatformUnsupported}})))}},deps:[]}),(0,u.F)({provide:c.HQ,useClass:Su.hV,deps:[g.G,En.N,ts.W,Si.zZ,Si.Lu,Ke,Ir.O,S.X,o.uB,f.bj,Ht.i,ch.H]}),(0,u.F)({provide:Hr.Y,useClass:Ks,deps:[h.e$,is.K]}),(0,u.F)({provide:v.qG,useClass:Su.aI,deps:[Ht.i,is.K,R.m,P.N,ch.H,$n.R,Qr.v,td.JJ,rs.y,_e._,s.Ix,Ge.Di,Zr.w]}),(0,u.F)({provide:o.vE,useClass:o.Qd,deps:[g.G,Si.Lu,En.N,o.YD,I.PV]}),(0,u.F)({provide:o.Ki,useClass:o.tc,deps:[Si.Lu,En.N,o.uB,Ge.Di,ts.W]}),(0,u.F)({provide:o.zh,useClass:o.wG,deps:[Zr.w,g.G,o.Ki,D.v2,I.k4,o.uB]}),(0,u.F)({provide:An.B,useClass:bu("sdk")?Ju:lu,deps:[]}),(0,u.F)({provide:ss.k,useClass:bu("sdk")?class{createSdkClient(...e){return ou(this,void 0,void 0,function*(){return Promise.resolve(new On.PasswordManagerClient(...e))})}}:class{createSdkClient(...e){return Promise.reject(new Error("SDK not available"))}},deps:[]}),(0,u.F)({provide:Pn.Y,useClass:class{constructor(e){this.window=e}startProcessReload(){return Nu(this,void 0,void 0,function*(){this.window.location.reload()})}cancelProcessReload(){}},deps:[h.jf]}),(0,u.F)({provide:f.pi,useClass:f.pi,deps:[Ge.Di,Ve.u,D.v2]}),(0,u.F)({provide:v.C5,useClass:Iu,deps:[ts.W]}),(0,u.F)({provide:Su.fA,useClass:Su.fA,deps:[_e._,g.G,$n.R,Qr.v,td.JJ,rs.y]}),(0,u.F)({provide:v.Ms,useClass:Su.u3,deps:[rs.y]}),(0,u.F)({provide:v.Ak,useClass:Su.oE,deps:[ns.U,ch.H,Ht.i]}),(0,u.F)({provide:vs,useClass:class extends vs{constructor(){super(...arguments),this.logService=(0,p.WQX)(is.K),this.platformUtilsService=(0,p.WQX)(rs.y),this.sessionRepository=(0,p.WQX)(ys)}init(){const e=Object.create(null,{initWithClient:{get:()=>super.initWithClient}});return Lu(this,void 0,void 0,function*(){try{yield An.B.Ready,this.communicationBackend=new On.IpcCommunicationBackend({send(e){return Lu(this,void 0,void 0,function*(){if("BrowserBackground"!==e.destination)throw new Error(`Destination not supported: ${e.destination}`);window.postMessage({type:"bitwarden-ipc-message",message:{destination:e.destination,payload:[...e.payload],topic:e.topic}},window.location.origin)})}}),window.addEventListener("message",e=>Lu(this,void 0,void 0,function*(){var t;if(e.origin!==window.origin)return;const i=e.data;(function(e){return"bitwarden-ipc-message"===e.type})(i)&&"object"==typeof i.message.destination&&null!=i.message.destination.Web&&(null===(t=this.communicationBackend)||void 0===t||t.receive(new On.IncomingMessage(new Uint8Array(i.message.payload),i.message.destination,"BrowserBackground",i.message.topic)))})),yield e.initWithClient.call(this,On.IpcClient.newWithClientManagedSessions(this.communicationBackend,this.sessionRepository)),this.platformUtilsService.isDev()&&(yield(0,On.ipcRegisterDiscoverHandler)(this.client,{version:yield this.platformUtilsService.getApplicationVersion()}))}catch(t){this.logService.error("[IPC] Initialization failed",t)}})}},deps:[]}),(0,u.F)({provide:nd.Vi,useClass:nd.cM,deps:[Qc.o3,Jc.f,rs.y,ts.W]}),(0,u.F)({provide:l.Fx,useClass:Su.L0,deps:[Si.Lu,Ke,Ir.O,Gu.y,ch.H]}),(0,u.F)({provide:a.W,useClass:class{showHeaderInformation(){return!0}},deps:[]}),(0,u.F)({provide:hu.l,useClass:yu.x,deps:[Qc.o3,Zr.w,Ge.Di,g.G,uu.H,Bi.Q,rs.y,s.Ix]}),(0,u.F)({provide:d.a,useClass:Tu,deps:[D.v2]}),(0,u.F)({provide:cs,useClass:class extends cs{clearClipboard(e,t){return Qu(this,void 0,void 0,function*(){})}clearPendingClipboard(){return Qu(this,void 0,void 0,function*(){})}},deps:[]}),(0,u.F)({provide:Yr.T,useClass:class{constructor(e){this.platformUtilsService=e}isAvailable(e){return Vu(this,void 0,void 0,function*(){switch(e){case ri.BF.Immediately:return!1;case ri.Lw.OnRestart:case ri.Lw.Custom:return!0;case ri.Lw.Never:return this.platformUtilsService.isDev();default:if((0,ri.ft)(e))return!0}return!1})}getOrPromoteToAvailable(e){return Vu(this,void 0,void 0,function*(){return(yield this.isAvailable(e))?e:e===ri.BF.Immediately?ri.BF.OnMinute:ri.Lw.OnRestart})}},deps:[rs.y]}),(0,u.F)({provide:mu.TP,useClass:mu.TP,deps:[ts.W,Yr.T,P.m]})];class hh{constructor(e){if(e)throw new Error("CoreModule is already loaded. Import it in the AppModule only")}}hh.ɵfac=function(e){return new(e||hh)(p.KVO(hh,12))},hh.ɵmod=r.$C({type:hh}),hh.ɵinj=p.G2t({providers:uh,imports:[n.MD,ru,pu._h]})},38140:(e,t,i)=>{"use strict";i.d(t,{X:()=>d});var n=i(77468),r=i(94573),s=i(33812);const o=e=>({width:e});function a(e,t){if(1&e&&(s.j41(0,"div",2)(1,"div",3),s.EFF(2," "),s.k0s(),s.j41(3,"div",4),s.EFF(4),s.k0s()()),2&e){const e=s.XpG();s.R7$(4),s.JRh(e.textContent)}}const l={small:["tw-h-1"],default:["tw-h-4"],large:["tw-h-6"]},c={danger:["tw-bg-danger-600"],primary:["tw-bg-primary-600"],success:["tw-bg-success-600"],warning:["tw-bg-warning-600"]};class d{constructor(){this.barWidth=(0,r.hFB)(0),this.bgColor=(0,r.hFB)("primary"),this.showText=(0,r.hFB)(!0),this.size=(0,r.hFB)("default"),this.text=(0,r.hFB)()}get displayText(){return this.showText()&&"small"!==this.size()}get outerBarStyles(){return["tw-overflow-hidden","tw-rounded","tw-bg-secondary-100"].concat(l[this.size()])}get innerBarStyles(){return["tw-flex","tw-justify-center","tw-items-center","tw-whitespace-nowrap","tw-text-xs","tw-font-medium","tw-text-contrast","tw-transition-all"].concat(l[this.size()]).concat(c[this.bgColor()])}get textContent(){return this.text()||this.barWidth()+"%"}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=s.VBU({type:d,selectors:[["bit-progress"]],inputs:{barWidth:[1,"barWidth"],bgColor:[1,"bgColor"],showText:[1,"showText"],size:[1,"size"],text:[1,"text"]},decls:3,vars:7,consts:[[3,"ngClass"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",3,"ngClass","ngStyle"],[1,"tw-flex","tw-h-full","tw-flex-wrap","tw-items-center","tw-overflow-hidden"],[1,"tw-h-full"],[1,"tw-pe-1"]],template:function(e,t){1&e&&(s.j41(0,"div",0)(1,"div",1),s.nVh(2,a,5,1,"div",2),s.k0s()()),2&e&&(s.Y8G("ngClass",t.outerBarStyles),s.R7$(),s.Y8G("ngClass",t.innerBarStyles)("ngStyle",s.eq3(5,o,t.barWidth()+"%")),s.BMQ("aria-valuenow",t.barWidth()),s.R7$(),s.vxM(t.displayText?2:-1))},dependencies:[n.MD,n.YU,n.B3],encapsulation:2})},38410:(e,t,i)=>{"use strict";i.d(t,{Q:()=>r});var n=i(33812);class r{get classList(){return["tw-p-3","has-[[biticonbutton]]:tw-py-1"]}}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["th","bitCell",""],["td","bitCell",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.HbH(t.classList)}})},38420:(e,t,i)=>{"use strict";i.d(t,{Ew:()=>n.Ew,L0:()=>n.L0,aI:()=>n.aI,fA:()=>n.fA,hV:()=>n.hV,oE:()=>n.oE,u3:()=>n.u3,yB:()=>n.yB});var n=i(27197)},38449:(e,t,i)=>{"use strict";i.d(t,{P:()=>s});var n=i(17989),r=i(54967);class s extends n.A{constructor(e){super(),null!=e&&(this.id=e.id,this.organizationId=e.organizationId,this.type=e.type,this.data=e.data,this.enabled=e.enabled,this.revisionDate=new Date(e.revisionDate))}static fromResponse(e){return new s(new r.L(e))}static fromListResponse(e){return e.data.map(e=>s.fromResponse(e))}}},38453:(e,t,i)=>{"use strict";function n(e){if(null!=e)return{lastUsedDate:e.lastUsedDate?new Date(e.lastUsedDate).getTime():void 0,lastLaunched:e.lastLaunched?new Date(e.lastLaunched).getTime():void 0}}function r(e){if(null!=e)return{lastUsedDate:e.lastUsedDate?new Date(e.lastUsedDate).toISOString():void 0,lastLaunched:e.lastLaunched?new Date(e.lastLaunched).toISOString():void 0}}i.d(t,{H:()=>r,e:()=>n})},39200:(e,t,i)=>{"use strict";i.d(t,{y:()=>s});var n=i(94573),r=i(33812);class s{get disabledAttr(){return this.disabled||null}constructor(e){this.elementRef=e,this.active=(0,n.hFB)(),this.disabled=!1}focus(){this.elementRef.nativeElement.focus()}click(){this.elementRef.nativeElement.click()}get classList(){return this.baseClassList.concat(this.active()?this.activeClassList:[]).concat(this.disabled?this.disabledClassList:[]).concat(this.textColorClassList)}get textColorClassList(){return this.disabled?["!tw-text-secondary-300","hover:!tw-text-secondary-300"]:this.active()?["!tw-text-primary-600","hover:!tw-text-primary-700"]:["!tw-text-main","hover:!tw-text-main"]}get baseClassList(){return["tw-block","tw-relative","tw-py-2","tw-px-4","tw-font-medium","tw-transition","tw-rounded-t-lg","tw-border-0","tw-border-x","tw-border-t-4","tw-border-transparent","tw-border-solid","tw-bg-transparent","hover:tw-underline","focus-visible:tw-z-10","focus-visible:tw-outline-none","focus-visible:tw-ring-2","focus-visible:tw-ring-primary-600"]}get disabledClassList(){return["!tw-no-underline","tw-cursor-not-allowed"]}get activeClassList(){return["tw--mb-px","tw-border-x-secondary-100","tw-border-t-primary-600","tw-border-b","tw-border-b-background","!tw-bg-background","hover:tw-no-underline","hover:tw-border-t-primary-700","focus-visible:tw-border-t-primary-700","focus-visible:!tw-text-primary-700"]}}s.ɵfac=function(e){return new(e||s)(r.rXU(r.aKT))},s.ɵdir=r.FsC({type:s,selectors:[["","bitTabListItem",""]],hostVars:3,hostBindings:function(e,t){2&e&&(r.BMQ("disabled",t.disabledAttr),r.HbH(t.classList))},inputs:{active:[1,"active"],disabled:"disabled"}})},39306:(e,t,i)=>{"use strict";i.d(t,{h:()=>o,k:()=>a});var n=i(68467),r=i(78781),s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const o="[error: cannot decrypt]";class a{constructor(e,t,i,n){null!=t?this.initFromData(e,t,i,n):this.initFromEncryptedString(e)}get ivBytes(){return null==this.iv?null:r.A.fromB64ToArray(this.iv)}get macBytes(){return null==this.mac?null:r.A.fromB64ToArray(this.mac)}get dataBytes(){return null==this.data?null:r.A.fromB64ToArray(this.data)}toSdk(){return this.encryptedString}toJSON(){return this.encryptedString}static fromJSON(e){return null==e?null:new a(e)}initFromData(e,t,i,n){this.encryptedString=null!=i?e+"."+i+"|"+t:e+"."+t,null!=n&&(this.encryptedString=this.encryptedString+"|"+n),this.encryptionType=e,this.data=t,this.iv=i,this.mac=n}initFromEncryptedString(e){if(this.encryptedString=e,!this.encryptedString)return;const{encType:t,encPieces:i}=a.parseEncryptedString(this.encryptedString);if(this.encryptionType=t,i.length===n.iS[t])switch(t){case n.Qd.AesCbc256_HmacSha256_B64:this.iv=i[0],this.data=i[1],this.mac=i[2];break;case n.Qd.AesCbc256_B64:this.iv=i[0],this.data=i[1];break;case n.Qd.Rsa2048_OaepSha256_B64:case n.Qd.Rsa2048_OaepSha1_B64:this.data=i[0];break;case n.Qd.Rsa2048_OaepSha256_HmacSha256_B64:case n.Qd.Rsa2048_OaepSha1_HmacSha256_B64:this.data=i[0],this.mac=i[1];break;default:return}}static parseEncryptedString(e){const t=e.split(".");let i,r=null;if(2===t.length)try{i=parseInt(t[0],null),r=t[1].split("|")}catch(s){return{encType:NaN,encPieces:[]}}else r=e.split("|"),i=n.Qd.AesCbc256_B64;return{encType:i,encPieces:r}}static isSerializedEncString(e){if(null==e)return!1;const{encType:t,encPieces:i}=this.parseEncryptedString(e);return!isNaN(t)&&0!==i.length&&n.iS[t]===i.length}decrypt(e){return s(this,arguments,void 0,function*(e,t=null,i){if(null!=this.decryptedValue)return this.decryptedValue;try{if(null==t&&(t=yield this.getKeyForDecryption(e)),null==t)throw new Error("No key to decrypt EncString with orgId "+e);const i=r.A.getContainerService().getEncryptService();this.decryptedValue=yield i.decryptString(this,t)}catch(n){console.error("[EncString Generic Decrypt] failed to decrypt encstring. Context: "+(null!=i?i:"No context"),n),this.decryptedValue=o}return this.decryptedValue})}getKeyForDecryption(e){return s(this,void 0,void 0,function*(){const t=r.A.getContainerService().getKeyService();return null!=e?yield t.getOrgKey(e):yield t.getUserKey()})}}},39307:(e,t,i)=>{"use strict";i.d(t,{e:()=>r});var n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class r{constructor(e,t){this.api=e,this.i18n=t}fetchJson(e,t){return n(this,void 0,void 0,function*(){const i=e.toRequest(t),n=yield this.api.nativeFetch(i);let r,s,o;const a=yield this.detectCommonErrors(n);if(a?[s,o]=a:e.hasJsonPayload(n)&&([r,o]=e.processJson(yield n.json())),r)return r;null!=s||(s=o?"forwarderError":"forwarderUnknownError");throw this.i18n.t(s,e.requestor.name,o)})}detectCommonErrors(e){return n(this,void 0,void 0,function*(){if(401===e.status){const t=yield this.tryGetErrorMessage(e);return[t?"forwaderInvalidTokenWithMessage":"forwaderInvalidToken",t]}if(403===e.status){const t=yield this.tryGetErrorMessage(e);return[t?"forwaderInvalidOperationWithMessage":"forwaderInvalidOperation",t]}if(e.status>=400){const t=yield this.tryGetErrorMessage(e);return[t?"forwarderError":"forwarderUnknownError",t]}})}tryGetErrorMessage(e){return n(this,void 0,void 0,function*(){var t,i,n;const r=null!==(t=yield e.text())&&void 0!==t?t:"";return(null!==(n=null!==(i=this.tryFindErrorAsJson(r))&&void 0!==i?i:this.tryFindErrorAsText(r))&&void 0!==n?n:e.statusText)||void 0})}tryFindErrorAsJson(e){var t,i,n,r,s;if(!(e.startsWith("{")||e.startsWith("'")||e.startsWith('"')))return;let o;try{o=JSON.parse(e)}catch(c){return!1}if(o&&"string"==typeof o)return o;const a=null!==(i=null===(t=o.error)||void 0===t?void 0:t.toString())&&void 0!==i?i:null,l=null!==(r=null===(n=o.message)||void 0===n?void 0:n.toString())&&void 0!==r?r:null;return a&&l?`${a}: ${l}`:null!==(s=null!=a?a:l)&&void 0!==s&&s}tryFindErrorAsText(e){if(e.length&&!e.includes("<"))return e}}},39326:(e,t,i)=>{"use strict";i.d(t,{p:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.title=this.getResponseProperty("Title"),this.firstName=this.getResponseProperty("FirstName"),this.middleName=this.getResponseProperty("MiddleName"),this.lastName=this.getResponseProperty("LastName"),this.address1=this.getResponseProperty("Address1"),this.address2=this.getResponseProperty("Address2"),this.address3=this.getResponseProperty("Address3"),this.city=this.getResponseProperty("City"),this.state=this.getResponseProperty("State"),this.postalCode=this.getResponseProperty("PostalCode"),this.country=this.getResponseProperty("Country"),this.company=this.getResponseProperty("Company"),this.email=this.getResponseProperty("Email"),this.phone=this.getResponseProperty("Phone"),this.ssn=this.getResponseProperty("SSN"),this.username=this.getResponseProperty("Username"),this.passportNumber=this.getResponseProperty("PassportNumber"),this.licenseNumber=this.getResponseProperty("LicenseNumber"))}}},39488:(e,t,i)=>{"use strict";i.d(t,{H:()=>n.H});var n=i(49272)},39738:(e,t,i)=>{"use strict";i.d(t,{a:()=>v});var n=i(33338),r=i(3204),s=i(28202),o=i(84175),a=i(23567),l=i(30550);class c{constructor(e,t,i){this.routedFilter=e,this.legacyFilter=t,this.bridgeService=i}get collectionBreadcrumbs(){return this.legacyFilter.collectionBreadcrumbs}get isCollectionSelected(){return this.legacyFilter.isCollectionSelected}get isUnassignedCollectionSelected(){return this.legacyFilter.isUnassignedCollectionSelected}get isMyVaultSelected(){return this.legacyFilter.isMyVaultSelected}get selectedOrganizationNode(){return this.legacyFilter.selectedOrganizationNode}set selectedOrganizationNode(e){this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{organizationId:"MyVault"===(null==e?void 0:e.node.id)?s.I_:null==e?void 0:e.node.id,folderId:void 0,collectionId:void 0}))}get selectedCipherTypeNode(){return this.legacyFilter.selectedCipherTypeNode}set selectedCipherTypeNode(e){let t;"AllItems"===(null==e?void 0:e.node.id)&&"path"===this.routedFilter.organizationIdParamType?t=l.u:"AllItems"===(null==e?void 0:e.node.id)&&"query"===this.routedFilter.organizationIdParamType?t=void 0:(0,l.F)(null==e?void 0:e.node.id)&&(t=null==e?void 0:e.node.id),this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{type:t,folderId:void 0,collectionId:void 0}))}get selectedFolderNode(){return this.legacyFilter.selectedFolderNode}set selectedFolderNode(e){const t=null!=e&&null===e.node.id?s.I_:null==e?void 0:e.node.id;this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{folderId:t,type:void 0,collectionId:void 0}))}get selectedCollectionNode(){return this.legacyFilter.selectedCollectionNode}set selectedCollectionNode(e){let t;t=null!=e&&null===e.node.id?s.I_:"AllCollections"===(null==e?void 0:e.node.id)&&"path"===this.routedFilter.organizationIdParamType?void 0:"AllCollections"===(null==e?void 0:e.node.id)&&"query"===this.routedFilter.organizationIdParamType?l.u:null==e?void 0:e.node.id,this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{collectionId:t,type:void 0,folderId:void 0}))}get isFavorites(){return this.legacyFilter.isFavorites}get isDeleted(){return this.legacyFilter.isDeleted}get isArchived(){return this.legacyFilter.isArchived}get organizationId(){return this.legacyFilter.organizationId}get cipherType(){return this.legacyFilter.cipherType}get cipherStatus(){return this.legacyFilter.cipherStatus}get cipherTypeId(){return this.legacyFilter.cipherTypeId}get folderId(){return this.legacyFilter.folderId}get collectionId(){return this.legacyFilter.collectionId}resetFilter(){this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{collectionId:void 0,folderId:void 0,organizationId:"path"===this.routedFilter.organizationIdParamType?this.routedFilter.organizationId:void 0,type:void 0}))}resetOrganization(){this.bridgeService.navigate(Object.assign(Object.assign({},this.routedFilter),{organizationId:void 0}))}buildFilter(){return this.legacyFilter.buildFilter()}}var d=i(51122),u=i(8144),h=i(74208),p=i(23649),m=i(91240);class v{constructor(e,t,i){this.router=e,this.routedVaultFilterService=t,this.activeFilter$=(0,n.z)([t.filter$,i.collectionTree$,i.folderTree$,i.organizationTree$,i.cipherTypeTree$]).pipe((0,r.T)(([e,t,i,n,r])=>{const u=function(e){return"path"===e.organizationIdParamType}(e)?function(e,t,i){const n=new d.$;void 0===e.collectionId&&void 0===e.type?n.selectedCollectionNode=a.F.getTreeNodeObject(t,"AllCollections"):void 0!==e.collectionId&&e.collectionId===s.I_?n.selectedCollectionNode=a.F.getTreeNodeObject(t,null):void 0!==e.collectionId&&(n.selectedCollectionNode=a.F.getTreeNodeObject(t,e.collectionId));void 0===e.collectionId&&e.type===l.u?n.selectedCipherTypeNode=a.F.getTreeNodeObject(i,"AllItems"):void 0!==e.type&&"trash"===e.type?n.selectedCipherTypeNode=new o.n({id:"trash",name:"",type:"trash",icon:""},null):void 0!==e.type&&"trash"!==e.type&&(n.selectedCipherTypeNode=a.F.getTreeNodeObject(i,e.type));return n}(e,t,r):function(e,t,i,n,r){const c=new d.$;void 0!==e.collectionId&&e.collectionId===s.I_?c.selectedCollectionNode=a.F.getTreeNodeObject(t,null):void 0!==e.collectionId&&e.collectionId===l.u?c.selectedCollectionNode=a.F.getTreeNodeObject(t,"AllCollections"):void 0!==e.collectionId&&(c.selectedCollectionNode=a.F.getTreeNodeObject(t,e.collectionId));void 0!==e.folderId&&e.folderId===s.I_?c.selectedFolderNode=a.F.getTreeNodeObject(i,null):void 0!==e.folderId&&e.folderId!==s.I_&&(c.selectedFolderNode=a.F.getTreeNodeObject(i,e.folderId));void 0!==e.organizationId&&e.organizationId===s.I_?c.selectedOrganizationNode=a.F.getTreeNodeObject(n,"MyVault"):void 0!==e.organizationId&&e.organizationId!==s.I_&&(c.selectedOrganizationNode=a.F.getTreeNodeObject(n,e.organizationId));void 0===e.type?c.selectedCipherTypeNode=a.F.getTreeNodeObject(r,"AllItems"):void 0!==e.type&&"trash"===e.type?c.selectedCipherTypeNode=new o.n({id:"trash",name:"",type:"trash",icon:""},null):void 0!==e.type&&"archive"===e.type?c.selectedCipherTypeNode=new o.n({id:"archive",name:"",type:"archive",icon:""},null):void 0!==e.type&&"trash"!==e.type&&(c.selectedCipherTypeNode=a.F.getTreeNodeObject(r,e.type));return c}(e,t,i,n,r);return new c(e,u,this)}))}navigate(e){const[t,i]=this.routedVaultFilterService.createRoute(e);this.router.navigate(t,i)}}v.ɵfac=function(e){return new(e||v)(h.KVO(p.Ix),h.KVO(u.B),h.KVO(m.u))},v.ɵprov=h.jDH({token:v,factory:v.ɵfac})},39805:(e,t,i)=>{"use strict";i.d(t,{J:()=>d});var n=i(58716),r=i(94573),s=i(74208),o=i(40443),a=i(17386),l=i(97560),c=i(33812);class d{constructor(){this.tabLabels=(0,r.tEk)((0,s.Rfq)(()=>l.T)),this.label=(0,r.hFB)("")}ngAfterContentInit(){this.keyManager=new n.B(this.tabLabels()).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd()}updateActiveLink(){var e;const t=this.tabLabels();for(let i=0;i<t.length;i++)t[i].active&&(null===(e=this.keyManager)||void 0===e||e.updateActiveItem(i))}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=c.VBU({type:d,selectors:[["bit-tab-nav-bar"]],contentQueries:function(e,t,i){1&e&&c.C6U(i,t.tabLabels,l.T,4),2&e&&c.NyB()},hostAttrs:[1,"tw-block"],inputs:{label:[1,"label"]},ngContentSelectors:["*"],decls:3,vars:1,consts:[["bitTabListContainer","",3,"keydown"]],template:function(e,t){1&e&&(c.NAR(),c.j41(0,"bit-tab-header")(1,"nav",0),c.bIt("keydown",function(e){return t.keyManager.onKeydown(e)}),c.SdG(2),c.k0s()()),2&e&&(c.R7$(),c.BMQ("aria-label",t.label()))},dependencies:[o.g,a.k],encapsulation:2})},39907:(e,t,i)=>{"use strict";i.d(t,{jd:()=>n,ov:()=>r});i(78781),i(97440);function n(e){const t=null==e||""===e;let i=t?null:`${e}`;if(t||i&&/^[1-9]{1}\d{3}$/.test(i))return i;if(i=(i||"").replace(/[^\d]/g,"").replace(/^[0]+(?=.)/,""),""===i&&(i=null),i&&4!==i.length){const e=("00"+i).slice(-2);i=`${(new Date).getFullYear()}`.slice(0,2)+e}return i}function r(e){if(e){const{expMonth:t=null,expYear:i=null}=e;if(!i)return!1;const r=new Date,s=n(i),o=s?parseInt(s,10):NaN,a=o<r.getFullYear(),l=o>r.getFullYear();if(s&&a)return!0;if(s&&l)return!1;if(s&&t){const e=parseInt(t,10);if(!(e&&!isNaN(e)))return!1;return new Date(o,e-1+1,1)<=r}}return!1}},39935:(e,t,i)=>{"use strict";i.d(t,{M:()=>n});class n{}},39960:(e,t,i)=>{"use strict";i.d(t,{x:()=>b});var n=i(66046),r=i(88565),s=i(72245),o=i(82468),a=i(49272),l=i(27485),c=i(24593),d=i(74208),u=i(21274),h=i(1601),p=i(35500),m=i(12012),v=i(58329),f=i(37115),g=i(23649),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class b{constructor(e,t,i,r,s,o,a,l,c){this.dialogService=e,this.configService=t,this.accountService=i,this.apiService=r,this.syncService=s,this.billingAccountProfileStateService=o,this.platformUtilsService=a,this.router=l,this.dialog=c,this._upgradeConfirmed$=new n.B,this.upgradeConfirmed$=this._upgradeConfirmed$.asObservable(),this.subscriptionPageRoute="settings/subscription/premium"}promptForPremium(e){return y(this,void 0,void 0,function*(){const t=yield(0,s._)(this.accountService.activeAccount$);if(!t)return;if(yield(0,s._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(t.id)))return;if((yield this.configService.getFeatureFlag(o.TO.PM23713_PremiumBadgeOpensNewPremiumUpgradeDialog))&&!e)return void(yield this.promptForPremiumVNext(t));let i=!1,n=null;e?(i=yield this.dialogService.openSimpleDialog({title:{key:"upgradeOrganization"},content:{key:"upgradeOrganizationDesc"},acceptButtonText:{key:"upgradeOrganization"},type:"info"}),i&&(n=["organizations",e,"billing","subscription"])):(i=yield this.dialogService.openSimpleDialog({title:{key:"premiumRequired"},content:{key:"premiumRequiredDesc"},acceptButtonText:{key:"upgrade"},type:"success"}),i&&(n=[this.subscriptionPageRoute])),this._upgradeConfirmed$.next(i),n&&(yield this.router.navigate(n)),i&&this.dialog&&this.dialog.close(c.r.PremiumUpgrade)})}promptForPremiumVNext(e){return y(this,void 0,void 0,function*(){yield this.platformUtilsService.isSelfHost()?this.redirectToSubscriptionPage():this.openUpgradeDialog(e)})}redirectToSubscriptionPage(){return y(this,void 0,void 0,function*(){yield this.router.navigate([this.subscriptionPageRoute]),this.dialog&&this.dialog.close(c.r.PremiumUpgrade)})}openUpgradeDialog(e){return y(this,void 0,void 0,function*(){const t=l.gY.open(this.dialogService,{data:{account:e,planSelectionStepTitleOverride:"upgradeYourPlan",hideContinueWithoutUpgradingButton:!0}}),i=yield(0,r.s)(t.closed);(null==i?void 0:i.status)!==l.PD.UpgradedToPremium&&(null==i?void 0:i.status)!==l.PD.UpgradedToFamilies||(yield this.syncService.fullSync(!0))})}}b.ɵfac=function(e){return new(e||b)(d.KVO(u.o3),d.KVO(h.w),d.KVO(p.Di),d.KVO(m.G),d.KVO(a.H),d.KVO(v.Q),d.KVO(f.y),d.KVO(g.Ix),d.KVO(u.ce,8))},b.ɵprov=d.jDH({token:b,factory:b.ɵfac})},40101:(e,t,i)=>{"use strict";i.d(t,{Fk:()=>r.F,rd:()=>n.r});var n=i(37806),r=i(91517)},40271:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{}},40443:(e,t,i)=>{"use strict";i.d(t,{g:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-tab-header"]],hostAttrs:[1,"tw-h-16","tw-ps-4","tw-bg-background-alt","tw-flex","tw-items-end","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-100"],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2})},40640:(e,t,i)=>{"use strict";var n;i.d(t,{j:()=>n}),function(e){e[e.Enabled=0]="Enabled",e[e.Supported=1]="Supported",e[e.Unsupported=2]="Unsupported"}(n||(n={}))},40711:(e,t,i)=>{"use strict";i.d(t,{O:()=>o});var n=i(31857),r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const s=n.Zs.array(n.dn,"pendingAuthRequests",{deserializer:e=>e});class o{constructor(e){this.stateProvider=e,this.state=this.stateProvider.getGlobal(s)}getAll$(){return this.state.state$}add(e){return r(this,void 0,void 0,function*(){const t=Date.now();yield this.stateProvider.getGlobal(s).update(i=>[...(null!=i?i:[]).filter(t=>t.userId!==e),{userId:e,receivedAtMs:t}])})}pruneOlderThan(e){return r(this,void 0,void 0,function*(){const t=Date.now()-e;yield this.stateProvider.getGlobal(s).update(e=>(null!=e?e:[]).filter(e=>e.receivedAtMs>=t))})}clear(e){return r(this,void 0,void 0,function*(){yield this.stateProvider.getGlobal(s).update(t=>(null!=t?t:[]).filter(t=>t.userId!==e))})}}},41103:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});class n{}},41226:(e,t,i)=>{"use strict";i.d(t,{g:()=>a});var n=i(7861),r=i(56962),s=i(74208),o=i(69855);class a{constructor(e,t){this.logService=e,this.toastService=t}handleError(e,t=""){throw this.logService.error(e),e instanceof n._&&this.toastService.showToast({variant:"error",title:t,message:e.getSingleMessage()}),e}showSuccess(e,t=""){this.toastService.showToast({variant:"success",title:t,message:e})}showError(e,t=""){this.toastService.showToast({variant:"error",title:t,message:e})}}a.ɵfac=function(e){return new(e||a)(s.KVO(r.K),s.KVO(o.f))},a.ɵprov=s.jDH({token:a,factory:a.ɵfac,providedIn:"root"})},41347:(e,t,i)=>{"use strict";i.d(t,{h:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.id=this.getResponseProperty("Id"),this.fileName=this.getResponseProperty("FileName"),this.size=this.getResponseProperty("Size"),this.sizeName=this.getResponseProperty("SizeName"))}}},41445:(e,t,i)=>{"use strict";i.d(t,{Q:()=>n});class n{}},41607:(e,t,i)=>{"use strict";i.d(t,{y:()=>j});var n=i(77468),r=i(24137),s=i(87916),o=i(33812),a=i(74208),l=i(37115),c=i(65067);function d(e,t){if(1&e){const e=o.RV6();o.j41(0,"bit-nav-item",1),o.bIt("click",function(){a.eBV(e);const t=o.XpG();return a.Njj(t.toggleWidth())}),o.k0s()}}class u{constructor(e){this.isDev=e.isDev()}toggleWidth(){"unset"===document.body.style.minWidth?document.body.style.minWidth="":document.body.style.minWidth="unset"}}u.ɵfac=function(e){return new(e||u)(o.rXU(l.y))},u.ɵcmp=o.VBU({type:u,selectors:[["app-toggle-width"]],decls:1,vars:1,consts:[["text","Toggle Width","icon","bwi-bug",3,"click",4,"ngIf"],["text","Toggle Width","icon","bwi-bug",3,"click"]],template:function(e,t){1&e&&o.DNE(0,d,1,0,"bit-nav-item",0),2&e&&o.Y8G("ngIf",t.isDev)},dependencies:[n.MD,n.bT,r.f,c.u],encapsulation:2});var h=i(42503),p=i(3204),m=i(78867),v=i(6056),f=i(23649),g=i(72245),y=i(88565),b=i(12012),w=i(35500),S=i(39488),I=i(21274),k=i(36801),C=i(27485),T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class F{constructor(){this.dialogService=(0,a.WQX)(I.o3),this.accountService=(0,a.WQX)(w.Di),this.syncService=(0,a.WQX)(S.H),this.apiService=(0,a.WQX)(b.G),this.router=(0,a.WQX)(f.Ix),this.platformUtilsService=(0,a.WQX)(l.y),this.upgrade=()=>T(this,void 0,void 0,function*(){this.platformUtilsService.isSelfHost()?yield this.navigateToSelfHostSubscriptionPage():yield this.openUpgradeDialog()})}navigateToSelfHostSubscriptionPage(){return T(this,void 0,void 0,function*(){yield this.router.navigate(["/settings/subscription/premium"])})}openUpgradeDialog(){return T(this,void 0,void 0,function*(){const e=yield(0,g._)(this.accountService.activeAccount$);if(!e)return;const t=C.gY.open(this.dialogService,{data:{account:e,planSelectionStepTitleOverride:"upgradeYourPlan",hideContinueWithoutUpgradingButton:!0}}),i=yield(0,y.s)(t.closed);if((null==i?void 0:i.status)===C.PD.UpgradedToPremium)yield this.syncService.fullSync(!0);else if((null==i?void 0:i.status)===C.PD.UpgradedToFamilies){const e=`/organizations/${i.organizationId}/vault`;yield this.router.navigate([e])}})}}F.ɵfac=function(e){return new(e||F)},F.ɵcmp=o.VBU({type:F,selectors:[["app-upgrade-nav-button"]],decls:6,vars:3,consts:[[1,"tw-px-2","tw-mt-3","tw-mb-2","tw-h-10"],[1,"tw-rounded-full","tw-bg-primary-100","tw-size-full"],["type","button",1,"tw-py-1.5","tw-px-4","tw-flex","tw-gap-2","tw-items-center","tw-size-full","focus-visible:tw-ring-2","focus-visible:tw-ring-offset-0","focus:tw-outline-none","focus-visible:tw-outline-none","focus-visible:tw-ring-text-alt2","focus-visible:tw-z-10","tw-font-medium","tw-rounded-full","tw-transition","tw-border","tw-border-solid","tw-text-left","tw-bg-primary-100","tw-text-primary-600","tw-border-primary-600","hover:tw-bg-hover-default","hover:tw-text-primary-700","hover:tw-border-primary-700",3,"click"],["aria-hidden","true",1,"bwi","bwi-premium"]],template:function(e,t){1&e&&(o.rj2(0,"div",0)(1,"div",1)(2,"button",2),o.VwU("click",function(){return t.upgrade()}),o.Hgh(3,"i",3),o.EFF(4),o.nI1(5,"i18n"),o.eux()()()),2&e&&(o.R7$(4),o.SpI(" ",o.bMT(5,1,"upgradeYourPlan")," "))},dependencies:[k.$Z],encapsulation:2});var R=i(25740);function P(e,t){if(1&e&&o.nrm(0,"bit-nav-item",1),2&e){const e=t.$implicit;o.Y8G("icon",e.icon)("text",e.name)("route",e.appRoute)("forceActiveStyles",e.isActive),o.BMQ("icon",e.icon)}}function x(e,t){if(1&e&&o.DNE(0,P,1,5,"bit-nav-item",3),2&e){o.XpG();const e=o.r8f(1);o.Y8G("ngForOf",e)}}function $(e,t){1&e&&o.nrm(0,"app-upgrade-nav-button")}function E(e,t){if(1&e&&(o.j41(0,"div",11),o.EFF(1),o.k0s()),2&e){const e=o.XpG(2).$implicit;o.R7$(),o.SpI(" ",e.otherProductOverrides.supportingText," ")}}function A(e,t){var i;if(1&e&&(o.j41(0,"a",9),o.nrm(1,"i"),o.j41(2,"div"),o.EFF(3),o.DNE(4,E,2,1,"div",10),o.k0s()()),2&e){const e=o.XpG().$implicit;o.Y8G("href",e.marketingRoute.route,o.B4B),o.R7$(),o.HbH(o.VkB("bwi bwi-fw ",e.icon," tw-mt-1 tw-mx-1")),o.R7$(2),o.SpI(" ",null!==(i=null==e.otherProductOverrides?null:e.otherProductOverrides.name)&&void 0!==i?i:e.name," "),o.R7$(),o.Y8G("ngIf",null==e.otherProductOverrides?null:e.otherProductOverrides.supportingText)}}function D(e,t){if(1&e&&(o.j41(0,"div",11),o.EFF(1),o.k0s()),2&e){const e=o.XpG(2).$implicit;o.R7$(),o.SpI(" ",e.otherProductOverrides.supportingText," ")}}function O(e,t){var i;if(1&e&&(o.j41(0,"a",12),o.nrm(1,"i"),o.j41(2,"div"),o.EFF(3),o.DNE(4,D,2,1,"div",10),o.k0s()()),2&e){const e=o.XpG().$implicit;o.Y8G("routerLink",e.marketingRoute.route),o.R7$(),o.HbH(o.VkB("bwi bwi-fw ",e.icon," tw-mt-1 tw-mx-1")),o.R7$(2),o.SpI(" ",null!==(i=null==e.otherProductOverrides?null:e.otherProductOverrides.name)&&void 0!==i?i:e.name," "),o.R7$(),o.Y8G("ngIf",null==e.otherProductOverrides?null:e.otherProductOverrides.supportingText)}}function M(e,t){if(1&e&&(o.qex(0),o.j41(1,"div",6),o.DNE(2,A,5,6,"a",7)(3,O,5,6,"a",8),o.k0s(),o.bVm()),2&e){const e=t.$implicit;o.R7$(2),o.Y8G("ngIf",e.marketingRoute.external),o.R7$(),o.Y8G("ngIf",!e.marketingRoute.external)}}function U(e,t){if(1&e&&(o.j41(0,"section",2)(1,"span",4),o.EFF(2),o.nI1(3,"i18n"),o.k0s(),o.DNE(4,M,4,2,"ng-container",5),o.k0s()),2&e){o.XpG();const e=o.r8f(6);o.R7$(2),o.JRh(o.bMT(3,2,"moreFromBitwarden")),o.R7$(2),o.Y8G("ngForOf",e)}}class G{constructor(e){this.productSwitcherService=e,this.shouldShowPremiumUpgradeButton$=this.productSwitcherService.shouldShowPremiumUpgradeButton$,this.accessibleProducts$=this.productSwitcherService.products$.pipe((0,p.T)(e=>{var t;return null!==(t=e.bento)&&void 0!==t?t:[]})),this.moreProducts$=this.productSwitcherService.products$.pipe((0,p.T)(e=>{var t;return null!==(t=e.other)&&void 0!==t?t:[]}),(0,p.T)(e=>e.sort(e=>"Organizations"===e.name?-1:1)))}}G.ɵfac=function(e){return new(e||G)(o.rXU(m.Y))},G.ɵcmp=o.VBU({type:G,selectors:[["navigation-product-switcher"]],standalone:!1,decls:9,vars:11,consts:[[1,"tw-mt-auto"],[3,"icon","text","route","forceActiveStyles"],[1,"tw-mt-2","tw-flex","tw-w-full","tw-flex-col","tw-gap-2","tw-border-0"],[3,"icon","text","route","forceActiveStyles",4,"ngFor","ngForOf"],[1,"tw-text-xs","!tw-text-alt2","tw-p-2","tw-pb-0"],[4,"ngFor","ngForOf"],[1,"tw-ps-2","tw-pe-2"],["target","_blank","rel","noreferrer","class","tw-flex tw-px-3 tw-py-2 tw-rounded-md tw-font-medium !tw-text-alt2 !tw-no-underline hover:tw-bg-hover-contrast [&>:not(.bwi)]:hover:tw-underline",3,"href",4,"ngIf"],["rel","noreferrer","class","tw-flex tw-px-3 tw-py-2 tw-rounded-md tw-font-medium !tw-text-alt2 !tw-no-underline hover:tw-bg-hover-contrast [&>:not(.bwi)]:hover:tw-underline",3,"routerLink",4,"ngIf"],["target","_blank","rel","noreferrer",1,"tw-flex","tw-px-3","tw-py-2","tw-rounded-md","tw-font-medium","!tw-text-alt2","!tw-no-underline","hover:tw-bg-hover-contrast","[&>:not(.bwi)]:hover:tw-underline",3,"href"],["class","tw-text-xs tw-font-normal",4,"ngIf"],[1,"tw-text-xs","tw-font-normal"],["rel","noreferrer",1,"tw-flex","tw-px-3","tw-py-2","tw-rounded-md","tw-font-medium","!tw-text-alt2","!tw-no-underline","hover:tw-bg-hover-contrast","[&>:not(.bwi)]:hover:tw-underline",3,"routerLink"]],template:function(e,t){if(1&e&&(o.j41(0,"div",0),o.SS7(1),o.nI1(2,"async"),o.nVh(3,x,1,1,"bit-nav-item",1),o.nVh(4,$,1,0,"app-upgrade-nav-button"),o.nI1(5,"async"),o.SS7(6),o.nI1(7,"async"),o.nVh(8,U,5,4,"section",2),o.k0s()),2&e){o.R7$();const e=o.bH3(o.bMT(2,3,t.accessibleProducts$));o.R7$(2),o.vxM(e&&e.length>1?3:-1),o.R7$(),o.vxM(o.bMT(5,6,t.shouldShowPremiumUpgradeButton$)?4:-1),o.R7$(2);const i=o.bH3(o.bMT(7,8,t.moreProducts$));o.R7$(2),o.vxM(i&&i.length>0?8:-1)}},dependencies:[n.Sq,n.bT,v.Wk,c.u,F,n.Jj,R.$],encapsulation:2});class j{constructor(){this.variant="primary"}}j.ɵfac=function(e){return new(e||j)},j.ɵcmp=o.VBU({type:j,selectors:[["app-side-nav"]],inputs:{variant:"variant"},ngContentSelectors:["*"],decls:5,vars:1,consts:[[3,"variant"],["slot","footer"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"bit-side-nav",0),o.SdG(1),o.qex(2,1),o.nrm(3,"navigation-product-switcher")(4,"app-toggle-width"),o.bVm(),o.k0s()),2&e&&o.Y8G("variant",t.variant)},dependencies:[n.MD,r.f,h.K,s.V,G,u],encapsulation:2})},42234:(e,t,i)=>{"use strict";i.d(t,{a:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),this.delete=!1,this.restore=!1,null!=e&&(this.delete=this.getResponseProperty("Delete"),this.restore=this.getResponseProperty("Restore"))}static fromJSON(e){return Object.assign(new r,e)}static fromSdkCipherPermissions(e){if(!e)return;const t=new r;return t.delete=e.delete,t.restore=e.restore,t}toSdkCipherPermissions(){return this}}},42503:(e,t,i)=>{"use strict";i.d(t,{K:()=>b});var n=i(60989),r=i(77468),s=i(94573),o=i(74208),a=i(33812),l=i(36801),c=i(36288),d=i(74269),u=i(21823);const h=["toggleButton"],p=["*",[["","slot","footer"]]],m=(e,t)=>({open:e,isOverlay:t}),v=e=>({"tw-w-60":e}),f=()=>({"--color-text-alt2":"var(--color-text-main)","--color-background-alt3":"var(--color-secondary-100)","--color-background-alt4":"var(--color-secondary-300)","--color-hover-contrast":"var(--color-hover-default)"});function g(e,t){1&e&&a.SdG(0,1)}function y(e,t){if(1&e){const e=a.RV6();a.j41(0,"nav",2),a.bIt("keydown",function(t){o.eBV(e);const i=a.XpG();return o.Njj(i.handleKeyDown(t))}),a.SdG(1),a.j41(2,"div",3),a.nrm(3,"bit-nav-divider"),a.nVh(4,g,1,0),a.j41(5,"div",4)(6,"button",5,0),a.nI1(8,"i18n"),a.bIt("click",function(){o.eBV(e);const t=a.XpG();return o.Njj(t.sideNavService.toggle())}),a.k0s()()()()}if(2&e){const e=t,i=a.XpG();a.Y8G("ngClass",a.eq3(11,v,e.open))("ngStyle","secondary"===i.variant()&&a.lJ4(13,f))("cdkTrapFocus",e.isOverlay),a.BMQ("role",e.isOverlay?"dialog":null)("aria-modal",e.isOverlay?"true":null),a.R7$(4),a.vxM(e.open?4:-1),a.R7$(2),a.Y8G("bitIconButton",e.open?"bwi-angle-left":"bwi-angle-right")("label",a.bMT(8,9,"toggleSideNavigation")),a.BMQ("aria-expanded",e.open)}}class b{constructor(){this.variant=(0,s.hFB)("primary"),this.toggleButton=(0,s.ebz)("toggleButton",{read:a.aKT}),this.sideNavService=(0,o.WQX)(u.G),this.handleKeyDown=e=>{var t;return"Escape"!==e.key||(this.sideNavService.setClose(),null===(t=this.toggleButton())||void 0===t||t.nativeElement.focus(),!1)}}}b.ɵfac=function(e){return new(e||b)},b.ɵcmp=a.VBU({type:b,selectors:[["bit-side-nav"]],viewQuery:function(e,t){1&e&&a.wEZ(t.toggleButton,h,5,a.aKT),2&e&&a.NyB()},hostAttrs:[1,"tw-block","tw-h-full"],inputs:{variant:[1,"variant"]},ngContentSelectors:["*","[slot=footer]"],decls:3,vars:8,consts:[["toggleButton",""],["id","bit-side-nav",1,"tw-sticky","tw-inset-y-0","tw-left-0","tw-z-30","tw-flex","tw-h-full","tw-flex-col","tw-overscroll-none","tw-overflow-auto","tw-bg-background-alt3","tw-outline-none",3,"ngClass","ngStyle","cdkTrapFocus"],["id","bit-side-nav",1,"tw-sticky","tw-inset-y-0","tw-left-0","tw-z-30","tw-flex","tw-h-full","tw-flex-col","tw-overscroll-none","tw-overflow-auto","tw-bg-background-alt3","tw-outline-none",3,"keydown","ngClass","ngStyle","cdkTrapFocus"],[1,"[@media(min-height:53rem)]:tw-sticky","tw-bottom-0","tw-left-0","tw-z-20","tw-mt-auto","tw-w-full","tw-bg-background-alt3"],[1,"tw-mx-0.5","tw-my-4","tw-w-[3.75rem]"],["type","button","buttonType","nav-contrast","size","small","aria-controls","bit-side-nav",1,"tw-mx-auto","tw-block","tw-max-w-fit",3,"click","bitIconButton","label"]],template:function(e,t){if(1&e&&(a.NAR(p),a.nVh(0,y,9,14,"nav",1),a.nI1(1,"async"),a.nI1(2,"async")),2&e){let e;a.vxM((e=a.l_i(5,m,a.bMT(1,1,t.sideNavService.open$),a.bMT(2,3,t.sideNavService.isOverlay$)))?0:-1,e)}},dependencies:[r.MD,r.YU,r.B3,n.kB,d.K,c.s,r.Jj,l.$Z],encapsulation:2})},42700:(e,t,i)=>{"use strict";i.d(t,{N:()=>m});var n=i(20702),r=i(36501),s=i(61782),o=i(42234),a=i(61182),l=i(39326),c=i(36107),d=i(10070),u=i(36890),h=i(74865);class p extends n.r{constructor(e){super(e),this.password=this.getResponseProperty("Password"),this.lastUsedDate=this.getResponseProperty("LastUsedDate")}}class m extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.folderId=this.getResponseProperty("FolderId")||null,this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.notes=this.getResponseProperty("Notes"),this.favorite=this.getResponseProperty("Favorite")||!1,this.edit=!!this.getResponseProperty("Edit"),null==this.getResponseProperty("ViewPassword")?this.viewPassword=!0:this.viewPassword=this.getResponseProperty("ViewPassword"),this.permissions=new o.a(this.getResponseProperty("Permissions")),this.organizationUseTotp=this.getResponseProperty("OrganizationUseTotp"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.collectionIds=this.getResponseProperty("CollectionIds"),this.creationDate=this.getResponseProperty("CreationDate"),this.deletedDate=this.getResponseProperty("DeletedDate"),this.archivedDate=this.getResponseProperty("ArchivedDate");const t=this.getResponseProperty("Login");null!=t&&(this.login=new c.a(t));const i=this.getResponseProperty("Card");null!=i&&(this.card=new s.j(i));const n=this.getResponseProperty("Identity");null!=n&&(this.identity=new l.p(n));const m=this.getResponseProperty("SecureNote");null!=m&&(this.secureNote=new d.c(m));const v=this.getResponseProperty("sshKey");null!=v&&(this.sshKey=new u.m(v));const f=this.getResponseProperty("Fields");null!=f&&(this.fields=f.map(e=>new a.d(e)));const g=this.getResponseProperty("Attachments");null!=g&&(this.attachments=g.map(e=>new h.l(e)));const y=this.getResponseProperty("PasswordHistory");null!=y&&(this.passwordHistory=y.map(e=>new p(e))),this.reprompt=this.getResponseProperty("Reprompt")||r.b.None,this.key=this.getResponseProperty("Key")||null}}},43090:(e,t,i)=>{"use strict";i.d(t,{l:()=>n});class n{}},43184:(e,t,i)=>{"use strict";i.d(t,{t:()=>te,Z:()=>ee});var n=i(74208),r=i(51757),s=i(66046),o=i(14803);function a(e,t,i){let n=0,r=e.length||0,s=-1,o=0;for(;n<r;)if(s=Math.floor((n+r)/2),o=i(e[s],t),o<0)n=s+1;else{if(!(o>0))return s;r=s}return n}class l{constructor(e,t){this.controlFactory=e,this.compareFn=t,this.allItems=[],this.selectedItems=[],this.deselectedItems=[],this.formArray=new r.Yp([])}selectItems(e,t){for(const i of e)this.selectItem(i,t)}deselectItems(e){for(const t of e)this.deselectItem(t)}deselectAll(){this.formArray.clear(),this.selectedItems=[],this.deselectedItems=[...this.allItems]}selectItem(e,t){const i=this.deselectedItems.findIndex(t=>t.id===e);if(-1===i)return;const n=this.deselectedItems[i];this.deselectedItems=[...this.deselectedItems.slice(0,i),...this.deselectedItems.slice(i+1)];const r=a(this.selectedItems,n,this.compareFn);this.selectedItems=[...this.selectedItems.slice(0,r),n,...this.selectedItems.slice(r)];const s=this.controlFactory(n);s.patchValue(Object.assign({id:e},t)),this.formArray.insert(r,s)}deselectItem(e){const t=this.selectedItems.findIndex(t=>t.id===e);if(-1===t)return;const i=this.selectedItems[t];this.selectedItems=[...this.selectedItems.slice(0,t),...this.selectedItems.slice(t+1)],this.formArray.removeAt(t);const n=a(this.deselectedItems,i,this.compareFn);this.deselectedItems=[...this.deselectedItems.slice(0,n),i,...this.deselectedItems.slice(n)]}populateItems(e,t=[]){this.formArray.clear(),this.allItems=[...e].sort(this.compareFn),this.selectedItems=[],this.deselectedItems=[...this.allItems];for(const i of t)this.selectItem(i.id,i)}forEachControlItem(e){for(let t=0;t<this.formArray.length;t++)e(this.formArray.at(t),this.selectedItems[t])}}var c=i(45980),d=i(33812),u=i(50700),h=i(77468),p=i(54471),m=i(47696),v=i(86226),f=i(93199),g=i(406),y=i(43759),b=i(36288),w=i(33886),S=i(68923),I=i(38410),k=i(22466),C=i(36572),T=i(88016),F=i(43978);class R{constructor(e){this.i18nService=e}transform(e,t){if(null==e)return null!=t?t:this.i18nService.t("unknown");switch(e){case F.D7.Owner:return this.i18nService.t("owner");case F.D7.Admin:return this.i18nService.t("admin");case F.D7.User:return this.i18nService.t("user");case F.D7.Custom:return this.i18nService.t("custom")}}}R.ɵfac=function(e){return new(e||R)(d.rXU(u.W,16))},R.ɵpipe=d.EJ8({name:"userType",type:R,pure:!0,standalone:!1});var P=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const x=()=>({standalone:!0}),$=e=>({"tw-text-muted":e});function E(e,t){if(1&e&&(d.nrm(0,"bit-option",16),d.nI1(1,"i18n")),2&e){const e=t.$implicit;d.Y8G("value",e.perm)("label",d.bMT(1,2,e.labelId))}}function A(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-form-field",13)(1,"bit-label"),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"bit-select",14),d.mxI("ngModelChange",function(t){n.eBV(e);const i=d.XpG(2);return d.DH7(i.initialPermission,t)||(i.initialPermission=t),n.Njj(t)}),d.bIt("closed",function(){n.eBV(e);const t=d.XpG(2);return n.Njj(t.handleBlur())}),d.DNE(5,E,2,4,"bit-option",15),d.k0s()()}if(2&e){const e=d.XpG(2);d.R7$(2),d.JRh(d.bMT(3,5,"permission")),d.R7$(2),d.Y8G("disabled",e.disabled),d.R50("ngModel",e.initialPermission),d.Y8G("ngModelOptions",d.lJ4(7,x)),d.R7$(),d.Y8G("ngForOf",e.permissionList)}}function D(e,t){if(1&e&&(d.j41(0,"bit-hint"),d.EFF(1),d.k0s()),2&e){const e=d.XpG(3);d.R7$(),d.JRh(e.selectorHelpText)}}function O(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-form-field",17)(1,"bit-label"),d.EFF(2),d.k0s(),d.j41(3,"bit-multi-select",18),d.bIt("onItemsConfirmed",function(t){n.eBV(e);const i=d.XpG(2);return n.Njj(i.selectItems(t))})("blur",function(){n.eBV(e);const t=d.XpG(2);return n.Njj(t.handleBlur())}),d.k0s(),d.DNE(4,D,2,1,"bit-hint",19),d.k0s()}if(2&e){const e=d.XpG(2);d.R7$(2),d.JRh(e.selectorLabelText),d.R7$(),d.Y8G("baseItems",e.selectionList.deselectedItems)("removeSelectedItems",!0)("disabled",e.disabled),d.R7$(),d.Y8G("ngIf",e.selectorHelpText)}}function M(e,t){if(1&e&&(d.j41(0,"div",10),d.DNE(1,A,6,8,"bit-form-field",11)(2,O,5,5,"bit-form-field",12),d.k0s()),2&e){const e=d.XpG();d.R7$(),d.Y8G("ngIf","edit"==e.permissionMode),d.R7$(),d.Y8G("ngIf",!e.disabled)}}function U(e,t){1&e&&(d.j41(0,"th",20)(1,"div",21),d.EFF(2),d.nI1(3,"i18n"),d.k0s()()),2&e&&(d.R7$(2),d.SpI(" ",d.bMT(3,1,"permission")," "))}function G(e,t){1&e&&(d.j41(0,"th",22),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.JRh(d.bMT(2,1,"role")))}function j(e,t){1&e&&(d.j41(0,"th",23),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.JRh(d.bMT(2,1,"group")))}function N(e,t){1&e&&(d.j41(0,"span",37),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.SpI(" ",d.bMT(2,1,"invited")," "))}function V(e,t){if(1&e&&(d.j41(0,"div",38),d.EFF(1),d.k0s()),2&e){const e=d.XpG(2).$implicit;d.R7$(),d.SpI(" ",e.email," ")}}function B(e,t){if(1&e&&(d.j41(0,"div",32),d.nrm(1,"i",33),d.j41(2,"div",34)(3,"div"),d.EFF(4),d.DNE(5,N,3,3,"span",35),d.k0s(),d.DNE(6,V,2,1,"div",36),d.k0s()()),2&e){const e=d.XpG().$implicit;d.R7$(),d.HbH(d.VkB("bwi tw-mr-3 ",e.icon)),d.R7$(3),d.SpI(" ",e.labelName," "),d.R7$(),d.Y8G("ngIf",0==e.status),d.R7$(),d.Y8G("ngIf",0!=e.status&&e.labelName!=e.email)}}function z(e,t){if(1&e&&(d.j41(0,"div",32),d.nrm(1,"i",39),d.j41(2,"span"),d.EFF(3),d.k0s()()),2&e){const e=d.XpG().$implicit,t=d.XpG(2);d.R7$(),d.Y8G("ngClass",e.icon||t.itemIcon(e)),d.R7$(2),d.JRh(e.labelName)}}function L(e,t){if(1&e&&(d.nrm(0,"bit-option",16),d.nI1(1,"i18n")),2&e){const e=t.$implicit;d.Y8G("value",e.perm)("label",d.bMT(1,2,e.labelId))}}function K(e,t){if(1&e){const e=d.RV6();d.qex(0),d.j41(1,"bit-form-field")(2,"bit-select",41),d.nI1(3,"i18n"),d.bIt("closed",function(){n.eBV(e);const t=d.XpG(4);return n.Njj(t.handleBlur())}),d.DNE(4,L,2,4,"bit-option",15),d.k0s()(),d.bVm()}if(2&e){const e=d.XpG(2),t=e.$implicit,i=e.index,n=d.XpG(2);d.R7$(2),d.Y8G("appA11yTitle",d.ai1("",t.labelName," ",d.bMT(3,5,"permission")))("id","permission"+i),d.R7$(2),d.Y8G("ngForOf",n.permissionList)}}function q(e,t){if(1&e&&(d.j41(0,"div",43),d.nI1(1,"i18n"),d.EFF(2),d.nI1(3,"i18n"),d.k0s()),2&e){const e=d.XpG(3).$implicit,t=d.XpG(2);d.Y8G("title",d.bMT(1,2,t.permissionLabelId(e.readonlyPermission))),d.R7$(2),d.SpI(" ",d.bMT(3,4,t.permissionLabelId(e.readonlyPermission))," ")}}function _(e,t){if(1&e&&d.DNE(0,q,4,6,"div",42),2&e){const e=d.XpG(2).$implicit,t=d.XpG(2);d.Y8G("ngIf",e.readonly||t.disabled)}}function X(e,t){if(1&e&&(d.j41(0,"td",4),d.DNE(1,K,5,7,"ng-container",40)(2,_,1,1,"ng-template",null,0,d.C5r),d.k0s()),2&e){const e=d.sdS(3),t=d.XpG().$implicit,i=d.XpG(2);d.R7$(),d.Y8G("ngIf",i.canEditItemPermission(t))("ngIfElse",e)}}function Y(e,t){if(1&e&&(d.j41(0,"td",4),d.EFF(1),d.nI1(2,"userType"),d.k0s()),2&e){const e=d.XpG().$implicit;d.R7$(),d.SpI(" ",d.i5U(2,1,e.role,"-")," ")}}function H(e,t){var i;if(1&e&&(d.j41(0,"td",4),d.EFF(1),d.k0s()),2&e){const e=d.XpG().$implicit;d.R7$(),d.SpI(" ",null!==(i=e.viaGroupName)&&void 0!==i?i:"-"," ")}}function W(e,t){if(1&e){const e=d.RV6();d.j41(0,"button",44),d.nI1(1,"i18n"),d.bIt("click",function(){n.eBV(e);const t=d.XpG().$implicit,i=d.XpG(2);return i.selectionList.deselectItem(t.id),n.Njj(i.handleBlur())}),d.k0s()}if(2&e){const e=d.XpG().$implicit,t=d.XpG(2);d.Y8G("label",d.ai1("",d.bMT(1,4,"remove")," ",e.labelName))("disabled",t.disabled)}}function J(e,t){if(1&e&&(d.j41(0,"tr",25)(1,"td",26),d.DNE(2,B,7,6,"div",27)(3,z,4,2,"div",28),d.k0s(),d.DNE(4,X,4,2,"td",29)(5,Y,3,4,"td",29)(6,H,2,1,"td",29),d.j41(7,"td",30),d.DNE(8,W,2,6,"button",31),d.k0s()()),2&e){const e=t.$implicit,i=t.index,n=d.XpG(2);d.Y8G("formGroupName",i)("ngClass",d.eq3(8,$,e.readonly)),d.R7$(),d.Y8G("ngSwitch",e.type),d.R7$(),d.Y8G("ngSwitchCase",n.itemType.Member),d.R7$(2),d.Y8G("ngIf","hidden"!=n.permissionMode),d.R7$(),d.Y8G("ngIf",n.showMemberRoles),d.R7$(),d.Y8G("ngIf",n.showGroupColumn),d.R7$(2),d.Y8G("ngIf",!n.disabled&&!e.readonly)}}function Z(e,t){if(1&e&&(d.j41(0,"tr")(1,"td",4),d.EFF(2),d.k0s()()),2&e){const e=d.XpG(2);d.R7$(2),d.JRh(e.emptySelectionText)}}function Q(e,t){if(1&e&&d.DNE(0,J,9,10,"tr",24)(1,Z,3,1,"tr",19),2&e){const e=d.XpG();d.Y8G("ngForOf",e.selectionList.selectedItems),d.R7$(),d.Y8G("ngIf",0==e.selectionList.selectedItems.length)}}var ee;!function(e){e.Hidden="hidden",e.Readonly="readonly",e.Edit="edit"}(ee||(ee={}));class te{get items(){return this.selectionList.allItems}set items(e){var t;const i=(null!==(t=this.selectionList.formArray.getRawValue())&&void 0!==t?t:[]).concat(e.filter(e=>e.readonly));this.selectionList.populateItems(e.map(e=>{var t;return e.icon=null!==(t=e.icon)&&void 0!==t?t:this.itemIcon(e),e}),i)}get permissionMode(){return this._permissionMode}set permissionMode(e){this._permissionMode=e,this.updateAllRowControlDisableStates()}constructor(e,t){this.formBuilder=e,this.i18nService=t,this.destroy$=new s.B,this.updateRowControlDisableState=(e,t)=>{t.readonly?e.disable():(e.enable(),this.permissionMode!=ee.Edit&&e.controls.permission.disable())},this.updateAllRowControlDisableStates=()=>{this.selectionList.forEachControlItem((e,t)=>{this.updateRowControlDisableState(e,t)})},this.selectionList=new l(e=>{const t=this.formBuilder.control(this.initialPermission),i=this.formBuilder.group({id:new r.MJ(e.id),type:new r.MJ(e.type),permission:t});return this.updateRowControlDisableState(i,e),i},this._itemComparator.bind(this)),this.formGroup=this.formBuilder.group({items:this.selectionList.formArray}),this.itemType=c.Uv,this._permissionMode=ee.Hidden,this.hideMultiSelect=!1,this.initialPermission=c.aF.View}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouch=e}setDisabledState(e){this.disabled=e,this.disabled?(this.permissionMode=ee.Readonly,this.formGroup.disable()):(this.formGroup.enable(),this.updateAllRowControlDisableStates())}writeValue(e){if(this.pauseChangeNotification=!0,this.selectionList.deselectAll(),this.selectionList.selectItems(this.items.filter(e=>e.readonly).map(e=>e.id)),null!=e){if(!Array.isArray(e))throw new Error("The access selector component only supports Array form values!");for(const t of e)this.selectionList.selectItem(t.id,t);this.pauseChangeNotification=!1}else this.pauseChangeNotification=!1}ngOnInit(){return P(this,void 0,void 0,function*(){this.permissionList=(0,c.M3)(),this.selectionList.formArray.valueChanges.pipe((0,o.Q)(this.destroy$)).subscribe(e=>{this.notifyOnChange&&!this.pauseChangeNotification&&(this.selectionList.formArray.disabled?this.notifyOnChange([]):this.notifyOnChange(e))})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}handleBlur(){this.notifyOnTouch&&this.notifyOnTouch()}selectItems(e){this.pauseChangeNotification=!0,this.selectionList.selectItems(e.map(e=>e.id)),this.pauseChangeNotification=!1,null!=this.notifyOnChange&&this.notifyOnChange(this.selectionList.formArray.value)}itemIcon(e){switch(e.type){case c.Uv.Collection:return"bwi-collection-shared";case c.Uv.Group:return"bwi-users";case c.Uv.Member:return"bwi-user"}}permissionLabelId(e){var t;return null===(t=this.permissionList.find(t=>t.perm==e))||void 0===t?void 0:t.labelId}canEditItemPermission(e){return this.permissionMode==ee.Edit&&!e.readonly}_itemComparator(e,t){return e.type-t.type||this.i18nService.collator.compare(e.listName,t.listName)||this.i18nService.collator.compare(e.labelName,t.labelName)||Number(t.readonly)-Number(e.readonly)}}te.ɵfac=function(e){return new(e||te)(d.rXU(r.ok),d.rXU(u.W))},te.ɵcmp=d.VBU({type:te,selectors:[["bit-access-selector"]],inputs:{items:"items",permissionMode:"permissionMode",columnHeader:"columnHeader",selectorLabelText:"selectorLabelText",selectorHelpText:"selectorHelpText",emptySelectionText:"emptySelectionText",showMemberRoles:"showMemberRoles",showGroupColumn:"showGroupColumn",hideMultiSelect:"hideMultiSelect",initialPermission:"initialPermission"},standalone:!1,features:[d.Jv_([{provide:r.kq,useExisting:(0,n.Rfq)(()=>te),multi:!0}])],decls:11,vars:6,consts:[["readOnlyPerm",""],["class","tw-flex",4,"ngIf"],[3,"formGroup"],["header",""],["bitCell",""],["bitCell","","id","permissionColHeading",4,"ngIf"],["bitCell","","id","roleColHeading",4,"ngIf"],["bitCell","","id","groupColHeading",4,"ngIf"],["bitCell","",1,"tw-w-20"],["body","","formArrayName","items"],[1,"tw-flex"],["class","tw-mr-3 tw-shrink-0 tw-basis-2/5",4,"ngIf"],["class","tw-grow tw-p-3",4,"ngIf"],[1,"tw-mr-3","tw-shrink-0","tw-basis-2/5"],["bitInput","",3,"ngModelChange","closed","disabled","ngModel","ngModelOptions"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],[1,"tw-grow","tw-p-3"],[1,"tw-w-full",3,"onItemsConfirmed","blur","baseItems","removeSelectedItems","disabled"],[4,"ngIf"],["bitCell","","id","permissionColHeading"],[1,"tw-border","tw-border-solid","tw-border-transparent"],["bitCell","","id","roleColHeading"],["bitCell","","id","groupColHeading"],["bitRow","",3,"formGroupName","ngClass",4,"ngFor","ngForOf"],["bitRow","",3,"formGroupName","ngClass"],["bitCell","",1,"tw-w-5/12",3,"ngSwitch"],["class","tw-flex tw-items-center",4,"ngSwitchCase"],["class","tw-flex tw-items-center",4,"ngSwitchDefault"],["bitCell","",4,"ngIf"],["bitCell","",1,"tw-text-right"],["type","button","bitIconButton","bwi-close","buttonType","muted",3,"label","disabled","click",4,"ngIf"],[1,"tw-flex","tw-items-center"],["aria-hidden","true"],[1,"tw-flex","tw-flex-col"],["bitBadge","","variant","secondary",4,"ngIf"],["class","tw-text-xs tw-text-muted",4,"ngIf"],["bitBadge","","variant","secondary"],[1,"tw-text-xs","tw-text-muted"],["aria-hidden","true",1,"bwi","tw-mr-3","tw-px-0.5","tw-text-2xl",3,"ngClass"],[4,"ngIf","ngIfElse"],["bitInput","","formControlName","permission",3,"closed","appA11yTitle","id"],["class","tw-max-w-40 tw-overflow-hidden tw-overflow-ellipsis tw-whitespace-nowrap tw-font-medium tw-text-muted",3,"title",4,"ngIf"],[1,"tw-max-w-40","tw-overflow-hidden","tw-overflow-ellipsis","tw-whitespace-nowrap","tw-font-medium","tw-text-muted",3,"title"],["type","button","bitIconButton","bwi-close","buttonType","muted",3,"click","label","disabled"]],template:function(e,t){1&e&&(d.DNE(0,M,3,2,"div",1),d.j41(1,"bit-table",2),d.qex(2,3),d.j41(3,"tr")(4,"th",4),d.EFF(5),d.k0s(),d.DNE(6,U,4,3,"th",5)(7,G,3,3,"th",6)(8,j,3,3,"th",7),d.nrm(9,"th",8),d.k0s(),d.bVm(),d.DNE(10,Q,2,2,"ng-template",9),d.k0s()),2&e&&(d.Y8G("ngIf",!t.hideMultiSelect),d.R7$(),d.Y8G("formGroup",t.formGroup),d.R7$(4),d.JRh(t.columnHeader),d.R7$(),d.Y8G("ngIf","hidden"!=t.permissionMode),d.R7$(),d.Y8G("ngIf",t.showMemberRoles),d.R7$(),d.Y8G("ngIf",t.showGroupColumn))},dependencies:[h.YU,h.Sq,h.bT,h.ux,h.e1,h.fG,r.BC,r.cb,r.vS,r.j4,r.JD,r.$R,r.v8,p.C,m.n,v.j,f.I,g.b,y.h,b.s,w.w,S.P,I.Q,k.Y,C._,C.O,T.$,R],encapsulation:2})},43215:(e,t,i)=>{"use strict";i.d(t,{Pi:()=>In,F3:()=>me,Uz:()=>pe,AM:()=>V});var n=i(77468),r=i(58625),s=i(55542),o=i(81525),a=i(81573),l=i(47659),c=i(29029),d=i(33812),u=i(21274),h=i(7730),p=i(68016),m=i(38410),v=i(22466),f=i(36572),g=i(56898),y=i(88016);function b(e,t){if(1&e&&(d.j41(0,"tr",9)(1,"td",4),d.EFF(2),d.k0s(),d.j41(3,"td",4),d.EFF(4),d.k0s()()),2&e){const e=t.$implicit;d.R7$(2),d.JRh(e.type),d.R7$(2),d.JRh(e.message)}}function w(e,t){if(1&e&&(d.DNE(0,b,5,2,"tr",8),d.nI1(1,"async")),2&e){const e=t.$implicit;d.Y8G("ngForOf",d.bMT(1,1,e))}}class S{constructor(e,t){this.dialogRef=e,this.data=t,this.dataSource=new s.s}ngOnInit(){const e=this.data.message.split("\n\n");if(1==e.length)return void(this.dataSource.data=[{type:"",message:this.data.message}]);const t=[];e.forEach(e=>{t.push({type:"",message:e})}),this.dataSource.data=t}}S.ɵfac=function(e){return new(e||S)(d.rXU(u.ce),d.rXU(o.Qs))},S.ɵcmp=d.VBU({type:S,selectors:[["ng-component"]],decls:22,vars:16,consts:[["bitDialogTitle",""],["bitDialogContent",""],[3,"dataSource"],["header",""],["bitCell",""],["body",""],["bitDialogFooter",""],["bitButton","","bitDialogClose","","buttonType","primary","type","button"],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""]],template:function(e,t){1&e&&(d.j41(0,"bit-dialog")(1,"span",0),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"span",1)(5,"div"),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.j41(8,"bit-table",2),d.qex(9,3),d.j41(10,"tr")(11,"th",4),d.EFF(12),d.nI1(13,"i18n"),d.k0s(),d.j41(14,"th",4),d.EFF(15),d.nI1(16,"i18n"),d.k0s()(),d.bVm(),d.DNE(17,w,2,3,"ng-template",5),d.k0s()(),d.qex(18,6),d.j41(19,"button",7),d.EFF(20),d.nI1(21,"i18n"),d.k0s(),d.bVm(),d.k0s()),2&e&&(d.R7$(2),d.SpI(" ",d.bMT(3,6,"importError")," "),d.R7$(4),d.JRh(d.bMT(7,8,"resolveTheErrorsBelowAndTryAgain")),d.R7$(2),d.Y8G("dataSource",t.dataSource),d.R7$(4),d.JRh(d.bMT(13,10,"name")),d.R7$(3),d.JRh(d.bMT(16,12,"description")),d.R7$(5),d.SpI(" ",d.bMT(21,14,"ok")," "))},dependencies:[n.MD,n.Sq,r.p,a.P,h.I,p.m,l.b,m.Q,v.Y,f._,f.O,c.t,g.Q,n.Jj,y.$],encapsulation:2});var I=i(31442);function k(e,t){if(1&e&&(d.j41(0,"tr",9)(1,"td",4),d.nrm(2,"i",10),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"td",4),d.EFF(6),d.k0s()()),2&e){const e=t.$implicit;d.R7$(2),d.HbH(d.VkB("bwi bwi-fw bwi-",e.icon)),d.R7$(),d.SpI(" ",d.bMT(4,5,e.type)," "),d.R7$(3),d.JRh(e.count)}}function C(e,t){if(1&e&&(d.DNE(0,k,7,7,"tr",8),d.nI1(1,"async")),2&e){const e=t.$implicit;d.Y8G("ngForOf",d.bMT(1,1,e))}}class T{constructor(e,t){this.dialogRef=e,this.data=t,this.dataSource=new s.s}ngOnInit(){null!=this.data&&(this.dataSource.data=this.buildResultList())}buildResultList(){let e=0,t=0,i=0,n=0,r=0;this.data.ciphers.map(s=>{switch(s.type){case I.gC.Login:e++;break;case I.gC.Card:t++;break;case I.gC.SecureNote:n++;break;case I.gC.Identity:i++;break;case I.gC.SshKey:r++}});const s=[];return e>0&&s.push({icon:"globe",type:"typeLogin",count:e}),t>0&&s.push({icon:"credit-card",type:"typeCard",count:t}),i>0&&s.push({icon:"id-card",type:"typeIdentity",count:i}),n>0&&s.push({icon:"sticky-note",type:"typeSecureNote",count:n}),r>0&&s.push({icon:"key",type:"typeSshKey",count:r}),this.data.folders.length>0&&s.push({icon:"folder",type:"folders",count:this.data.folders.length}),this.data.collections.length>0&&s.push({icon:"collection",type:"collections",count:this.data.collections.length}),s}}T.ɵfac=function(e){return new(e||T)(d.rXU(u.ce),d.rXU(o.Qs))},T.ɵcmp=d.VBU({type:T,selectors:[["ng-component"]],decls:22,vars:17,consts:[["bitDialogTitle",""],["bitDialogContent",""],[3,"dataSource"],["header",""],["bitCell",""],["body",""],["bitDialogFooter",""],["bitButton","","bitDialogClose","","buttonType","primary","type","button"],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["aria-hidden","true"]],template:function(e,t){1&e&&(d.j41(0,"bit-dialog")(1,"span",0),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"div",1)(5,"span"),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.j41(8,"bit-table",2),d.qex(9,3),d.j41(10,"tr")(11,"th",4),d.EFF(12),d.nI1(13,"i18n"),d.k0s(),d.j41(14,"th",4),d.EFF(15),d.nI1(16,"i18n"),d.k0s()(),d.bVm(),d.DNE(17,C,2,3,"ng-template",5),d.k0s()(),d.qex(18,6),d.j41(19,"button",7),d.EFF(20),d.nI1(21,"i18n"),d.k0s(),d.bVm(),d.k0s()),2&e&&(d.R7$(2),d.SpI(" ",d.bMT(3,6,"importSuccess")," "),d.R7$(4),d.JRh(d.i5U(7,8,"importSuccessNumberOfItems",t.data.ciphers.length)),d.R7$(2),d.Y8G("dataSource",t.dataSource),d.R7$(4),d.JRh(d.bMT(13,11,"type")),d.R7$(3),d.JRh(d.bMT(16,13,"total")),d.R7$(5),d.SpI(" ",d.bMT(21,15,"ok")," "))},dependencies:[n.MD,n.Sq,r.p,a.P,h.I,p.m,l.b,m.Q,v.Y,f._,f.O,c.t,g.Q,n.Jj,y.$],encapsulation:2});var F=i(51757),R=i(26411),P=i(37579),x=i(22191),$=i(49519),E=i(57083),A=i(86226),D=i(97553),O=i(43759),M=i(76356),U=i(69896),G=i(45154),j=i(36288);class N{constructor(e,t){this.dialogRef=e,this.formBuilder=t,this.formGroup=this.formBuilder.group({filePassword:["",F.k0.required]}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.value.filePassword)}}}N.ɵfac=function(e){return new(e||N)(d.rXU(u.ce),d.rXU(F.ok))},N.ɵcmp=d.VBU({type:N,selectors:[["ng-component"]],decls:23,vars:17,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-mt-6"],["bitInput","","type","password","formControlName","filePassword","appAutofocus","","appInputVerbatim",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"div",2),d.EFF(6),d.nI1(7,"i18n"),d.j41(8,"bit-form-field",3)(9,"bit-label"),d.EFF(10),d.nI1(11,"i18n"),d.k0s(),d.nrm(12,"input",4)(13,"button",5),d.k0s()(),d.qex(14,6),d.j41(15,"button",7)(16,"span"),d.EFF(17),d.nI1(18,"i18n"),d.k0s()(),d.j41(19,"button",8)(20,"span"),d.EFF(21),d.nI1(22,"i18n"),d.k0s()(),d.bVm(),d.k0s()()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(3),d.SpI(" ",d.bMT(4,7,"confirmVaultImport")," "),d.R7$(3),d.SpI(" ",d.bMT(7,9,"confirmVaultImportDesc")," "),d.R7$(4),d.JRh(d.bMT(11,11,"confirmFilePassword")),d.R7$(7),d.JRh(d.bMT(18,13,"import")),d.R7$(4),d.JRh(d.bMT(22,15,"cancel")))},dependencies:[n.MD,r.p,$.B,E.q,a.P,h.I,p.m,R.L,A.j,D.J,O.h,M.e,U.a,P.C,G.L,c.t,g.Q,x.Q,j.s,F.X1,F.qT,F.me,F.BC,F.cb,F.j4,F.JD,y.$],encapsulation:2});class V{constructor(e,t){this.dialogRef=e,this.formBuilder=t,this.formGroup=this.formBuilder.group({sshKeyPassword:["",F.k0.required]}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.value.sshKeyPassword)}}}V.ɵfac=function(e){return new(e||V)(d.rXU(u.ce),d.rXU(F.ok))},V.ɵcmp=d.VBU({type:V,selectors:[["ng-component"]],decls:23,vars:17,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-mt-6"],["bitInput","","type","password","formControlName","sshKeyPassword","appAutofocus","","appInputVerbatim",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"div",2),d.EFF(6),d.nI1(7,"i18n"),d.j41(8,"bit-form-field",3)(9,"bit-label"),d.EFF(10),d.nI1(11,"i18n"),d.k0s(),d.nrm(12,"input",4)(13,"button",5),d.k0s()(),d.qex(14,6),d.j41(15,"button",7)(16,"span"),d.EFF(17),d.nI1(18,"i18n"),d.k0s()(),d.j41(19,"button",8)(20,"span"),d.EFF(21),d.nI1(22,"i18n"),d.k0s()(),d.bVm(),d.k0s()()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(3),d.SpI(" ",d.bMT(4,7,"enterSshKeyPassword")," "),d.R7$(3),d.SpI(" ",d.bMT(7,9,"enterSshKeyPasswordDesc")," "),d.R7$(4),d.JRh(d.bMT(11,11,"confirmSshKeyPassword")),d.R7$(7),d.JRh(d.bMT(18,13,"importSshKey")),d.R7$(4),d.JRh(d.bMT(22,15,"cancel")))},dependencies:[n.MD,r.p,$.B,E.q,a.P,h.I,p.m,R.L,A.j,D.J,O.h,M.e,U.a,P.C,G.L,c.t,g.Q,x.Q,j.s,F.X1,F.qT,F.me,F.BC,F.cb,F.j4,F.JD,y.$],encapsulation:2});var B=i(28202),z=i(21495),L=i(12012),K=i(18499),q=i(35500),_=i(23166),X=i(89105),Y=i(1601),H=i(50700),W=i(56962),J=i(37115),Z=i(97445),Q=i(43946),ee=i(43348),te=i(25304),ie=i(48856),ne=i(8936);var re=i(63344),se=i(20136);var oe=i(5556),ae=i(74526),le=i(66983),ce=i(22848),de=i(91968),ue=i(36801),he=i(97741);const pe=new ue.aZ("SystemServices"),me=[(0,z.F)({provide:he.RI,useClass:he.Bd,deps:[L.G]}),(0,z.F)({provide:Q.p,useClass:Z.p,deps:[X.N,ce.Lu]}),(0,z.F)({provide:ee.F,useFactory:()=>function(){const e=new ie.T(te.iP,te.xN);for(const t of Reflect.ownKeys(te.YY))e.registerSite(te.YY[t]);for(const t of ne.G)e.registerVendor(t);for(const t of ne.B)e.registerExtension(t);return e}(),deps:[]}),(0,z.F)({provide:pe,useFactory:function(e,t,i,n,r,s,o){let a;return a=s.isDev()?(0,se.oR)(r,[]):se.S2,{policy:i,extension:new re.r(n,{encryptor:e,state:t,log:a,now:Date.now}),log:a,configService:o,environment:s}},deps:[Q.p,de.v2,K.m,ee.F,W.K,J.y,Y.w]}),(0,z.F)({provide:he.Tt,useClass:he.XM,deps:[oe.p,ae.k,he.RI,H.W,B.YD,ce.Lu,X.N,_.$,q.Di,le.b]})];var ve=i(83731),fe=i(74794),ge=i(66046),ye=i(16878),be=i(72245),we=i(33338),Se=i(88565),Ie=i(44500),ke=i(14803),Ce=i(3204),Te=i(80909),Fe=i(69194),Re=i(67553),Pe=i(43978),xe=i(3633),$e=i(11573),Ee=i(15639),Ae=i(78781),De=i(5076),Oe=i(39488),Me=i(8433),Ue=i(80351),Ge=i(8297),je=i(14318),Ne=i(58950),Ve=i(88832),Be=i(26477),ze=i(83586),Le=i(94573),Ke=i(33277),qe=i(98869),_e=i(75583),Xe=i(47135),Ye=i(33886),He=i(68923),We=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Je(e,t){if(1&e&&d.nrm(0,"bit-option",3),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}class Ze{constructor(e,t,i,n){this.formBuilder=e,this.controlContainer=t,this.logService=i,this.i18nService=n,this.formGroup=this.formBuilder.group({profile:["",{nonNullable:!0,validators:[F.k0.required],asyncValidators:[this.validateAndEmitData()],updateOn:"submit"}]}),this.profileList=[],this.format=Le.hFB.required(),this.csvDataLoaded=new d.bkB,(0,Ke.QZ)(()=>We(this,void 0,void 0,function*(){this.profileList=yield this.onLoadProfilesFromBrowser(this.getBrowserName(this.format()))}))}ngOnInit(){return We(this,void 0,void 0,function*(){this._parentFormGroup=this.controlContainer.control,this._parentFormGroup.addControl("chromeOptions",this.formGroup)})}ngOnDestroy(){this._parentFormGroup.removeControl("chromeOptions")}validateAndEmitData(){return()=>We(this,void 0,void 0,function*(){try{const e=yield this.onImportFromBrowser(this.getBrowserName(this.format()),this.formGroup.controls.profile.value);if(e.some(e=>null!=e.failure)){const t=e.find(e=>null!=e.failure);return this.logService.error("Chromium importer failure:",t.failure.error),{errors:{message:this.i18nService.t("errorOccurred")}}}if(0===e.length)return{errors:{message:this.i18nService.t("importNothingError")}};const t=[];for(const n of e)null!=n.login&&t.push(new Qe(n.login));const i=qe.unparse(t);return this.csvDataLoaded.emit(i),null}catch(e){return this.logService.error(`Chromium importer error: ${e}`),{errors:{message:this.i18nService.t(this.getValidationErrorI18nKey(e))}}}})}getValidationErrorI18nKey(e){"string"==typeof e||null==e||e.message;return"errorOccurred"}getBrowserName(e){return"edgecsv"===e?"Microsoft Edge":"operacsv"===e?"Opera":"bravecsv"===e?"Brave":"vivaldicsv"===e?"Vivaldi":"Chrome"}}Ze.ɵfac=function(e){return new(e||Ze)(d.rXU(F.ok),d.rXU(F.ZU),d.rXU(W.K),d.rXU(H.W))},Ze.ɵcmp=d.VBU({type:Ze,selectors:[["import-chrome"]],inputs:{format:[1,"format"],onLoadProfilesFromBrowser:"onLoadProfilesFromBrowser",onImportFromBrowser:"onImportFromBrowser"},outputs:{csvDataLoaded:"csvDataLoaded"},decls:7,vars:5,consts:[[3,"formGroup"],["formControlName","profile"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"]],template:function(e,t){1&e&&(d.j41(0,"div",0)(1,"bit-form-field")(2,"bit-label"),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"bit-select",1),d.DNE(6,Je,1,2,"bit-option",2),d.k0s()()()),2&e&&(d.Y8G("formGroup",t.formGroup),d.R7$(3),d.JRh(d.bMT(4,3,"browserProfile")),d.R7$(3),d.Y8G("ngForOf",t.profileList))},dependencies:[n.MD,n.Sq,r.p,Ue.j,_e.E,R.L,A.j,O.h,F.X1,F.BC,F.cb,F.j4,F.JD,x.Q,Xe.q,Me.p,Ye.w,He.P,y.$],encapsulation:2});class Qe{constructor(e){const t=Ae.A.getUrl(null==e?void 0:e.url);null!=t&&(this.name=new URL(t).hostname),null==this.name&&(this.name=e.url),this.url=e.url,this.username=e.username,this.password=e.password,this.note=e.note}}var et=i(44280),tt=i(29377),it=i(71373);class nt{}class rt{}const st=Object.freeze({Azure:0,OktaAuthServer:1,OktaNoAuthServer:2,Google:3,PingOne:4,OneLogin:5}),ot=Object.freeze({MasterPassword:0,Federated:3}),at=Object.freeze({GoogleAuth:0,MicrosoftAuth:1,Yubikey:2}),lt=Object.freeze({Desktop:0,Mobile:1});class ct{static createClientInfo(e){return{platform:lt.Desktop,id:e,description:"Importer"}}}class dt{constructor(e){this.url=e.url,this.username=e.username,this.password=e.password,this.totp=e.totp,this.extra=e.notes,this.name=e.name,this.grouping="(none)"===e.path?null:e.path,this.fav=e.isFavorite?1:0}}class ut{}class ht{constructor(e,t,i){this.waitForOutOfBand=e,this.passcode=t,this.rememberMe=i}waitForApproval(e){return new ht(!0,"",e)}continueWithPasscode(e,t){return new ht(!1,e,t)}}ht.cancel=new ht(!1,"cancel",!1);class pt{constructor(e,t){this.passcode=e,this.rememberMe=t}}pt.cancel=new pt("cancel",!1);class mt{constructor(){this.parseSecureNotesToAccount=!0}}mt.default=new mt;class vt{}class ft{}class gt{isFederated(){return this.type===ot.Federated&&this.hasValue(this.identityProviderURL)&&this.hasValue(this.openIDConnectAuthority)&&this.hasValue(this.openIDConnectClientId)}get oidcScope(){let e="openid profile email";return this.provider===st.PingOne&&(e+=" lastpass"),e}get openIDConnectAuthorityBase(){return this.openIDConnectAuthority.replace("/.well-known/openid-configuration","")}hasValue(e){return null!=e&&""!==e.trim()}}var yt=i(93241);class bt{constructor(e){this.arr=e,this.position=0;const t=new Uint32Array([287454020]),i=new Uint8Array(t.buffer);this.isLittleEndian=68===i[0]}readBytes(e){if(this.position+e>this.arr.length)throw new Error("End of array reached");const t=this.arr.subarray(this.position,this.position+e);return this.position+=e,t}readUInt16(){const e=this.readBytes(2);return(e[0]|e[1]<<8)>>>0}readUInt32(){const e=this.readBytes(4);return(e[0]|e[1]<<8|e[2]<<16|e[3]<<24)>>>0}readUInt16BigEndian(){let e=this.readUInt16();if(this.isLittleEndian){e=(255&e)<<8|e>>8&255}return e}readUInt32BigEndian(){let e=this.readUInt32();if(this.isLittleEndian){e=(255&e)<<24|(e>>8&255)<<16|(e>>16&255)<<8|e>>24&255}return e}seekFromCurrentPosition(e){const t=this.position+e;if(t<0)throw new Error("Position cannot be negative");if(t>this.arr.length)throw new Error("Array not large enough to seek to this position");this.position=t}atEnd(){return this.position>=this.arr.length-1}}var wt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class St{constructor(){this.isBrowser=!0}get(e){return wt(this,arguments,void 0,function*(e,t=null,i=null){const n={method:"GET",credentials:"include"};this.setHeaders(n,t,i);const r=new Request(this.baseUrl+"/"+e,n);return yield fetch(r)})}postForm(e){return wt(this,arguments,void 0,function*(e,t=null,i=null,n=null){return yield this.post(e,(e,i)=>{if(null!=t&&t.size>0){const i=new FormData;for(const[e,n]of t)i.set(e,n);e.body=i}},i,n)})}postJson(e,t){return wt(this,arguments,void 0,function*(e,t,i=null,n=null){return yield this.post(e,(e,i)=>{null!=t&&(i.set("Content-Type","application/json; charset=utf-8"),e.body=JSON.stringify(t))},i,n)})}post(e,t){return wt(this,arguments,void 0,function*(e,t,i=null,n=null){const r={method:"POST",credentials:"include"};null==i&&(i=new Map),t(r,i),this.setHeaders(r,i,n);const s=new Request(this.baseUrl+"/"+e,r);return yield fetch(s)})}setHeaders(e,t=null,i=null){const n=new Headers;let r=!1;if(null!=t&&t.size>0){r=!0;for(const[e,i]of t)n.set(e,i)}if(!this.isBrowser&&null!=i&&i.size>0){r=!0;const e=Array.from(i.keys()).map(e=>`${e}=${i.get(e)}`).join("; ");n.set("cookie",e)}r&&(e.headers=n)}}var It=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const kt=new Map([[lt.Desktop,"cli"],[lt.Mobile,"android"]]),Ct=new Map([["googleauthrequired",at.GoogleAuth],["microsoftauthrequired",at.MicrosoftAuth],["otprequired",at.Yubikey]]);class Tt{constructor(e,t){this.parser=e,this.cryptoUtils=t}openVault(e,t,i,n,r,s){return It(this,void 0,void 0,function*(){const o=e.toLowerCase(),[a,l]=yield this.login(o,t,i,n,r);try{const e=yield this.downloadVault(a,l),i=yield this.cryptoUtils.deriveKey(o,t,a.keyIterationCount);let n=null;return null!=a.encryptedPrivateKey&&""!=a.encryptedPrivateKey&&(n=yield this.parser.parseEncryptedPrivateKey(a.encryptedPrivateKey,i)),this.parseVault(e,i,n,s)}finally{yield this.logout(a,l)}})}parseVault(e,t,i,n){return It(this,void 0,void 0,function*(){const r=new bt(e),s=this.parser.extractChunks(r);if(!this.isComplete(s))throw new Error("Blob is truncated or corrupted");return yield this.parseAccounts(s,t,i,n)})}parseAccounts(e,t,i,n){return It(this,void 0,void 0,function*(){const r=new Array;let s=null;for(const o of e)if("ACCT"===o.id){const e=null==s?t:s.encryptionKey,i=yield this.parser.parseAcct(o,e,s,n);null!=i&&r.push(i)}else"SHAR"===o.id&&(s=yield this.parser.parseShar(o,t,i));return r})}isComplete(e){if(e.length>0&&"ENDM"===e[e.length-1].id){return"OK"===Ae.A.fromBufferToUtf8(e[e.length-1].payload)}return!1}login(e,t,i,n,r){return It(this,void 0,void 0,function*(){const s=new St;s.baseUrl="https://lastpass.com";let o=100100,a=null,l=null;for(let r=0;r<3;r++){if(a=yield this.performSingleLoginRequest(e,t,i,o,new Map,n,s),l=this.extractSessionFromLoginResponse(a,o,n),null!=l)return[l,s];const r=this.getOptionalErrorAttribute(a,"server");if(null!=r&&""!=r.trim()){s.baseUrl="https://"+r;continue}const c=this.getOptionalErrorAttribute(a,"iterations");if(null==c)break;try{o=parseInt(c)}catch(u){throw"Failed to parse the iteration count, expected an integer value '"+c+"'"}}const c=this.getOptionalErrorAttribute(a,"cause");if(null==c)throw this.makeLoginError(a);const d=Ct.get(c);if(null!=d?l=yield this.loginWithOtp(e,t,i,o,d,n,r,s):"outofbandrequired"===c&&(l=yield this.loginWithOob(e,t,i,o,this.getAllErrorAttributes(a),n,r,s)),null==l)throw this.makeLoginError(a);return[l,s]})}loginWithOtp(e,t,i,n,r,s,o,a){return It(this,void 0,void 0,function*(){let l=null;switch(r){case at.GoogleAuth:l=yield o.provideGoogleAuthPasscode();break;case at.MicrosoftAuth:l=yield o.provideMicrosoftAuthPasscode();break;case at.Yubikey:l=yield o.provideYubikeyPasscode();break;default:throw new Error("Invalid OTP method")}if(l==pt.cancel)throw new Error("Second factor step is canceled by the user");const c=yield this.performSingleLoginRequest(e,t,i,n,new Map([["otp",l.passcode]]),s,a),d=this.extractSessionFromLoginResponse(c,n,s);if(null==d)throw this.makeLoginError(c);return l.rememberMe&&(yield this.markDeviceAsTrusted(d,s,a)),d})}loginWithOob(e,t,i,n,r,s,o,a){return It(this,void 0,void 0,function*(){const l=r=>It(this,void 0,void 0,function*(){const o=yield this.performSingleLoginRequest(e,t,i,n,r,s,a),c=this.extractSessionFromLoginResponse(o,n,s);if(null!=c)return c;if("outofbandrequired"!=this.getOptionalErrorAttribute(o,"cause"))throw this.makeLoginError(o);return r.set("outofbandretry","1"),r.set("outofbandretryid",this.getErrorAttribute(o,"retryid")),l(r)});return yield Promise.race([(()=>{const e=new Map;return e.set("outofbandrequest",1),l(e)})(),(()=>It(this,void 0,void 0,function*(){const t=yield this.approveOob(e,r,o,a);if(t==ht.cancel)throw new Error("Out of band step is canceled by the user");const i=new Map;i.set("otp",t.passcode);const n=yield l(i);return t.rememberMe&&(yield this.markDeviceAsTrusted(n,s,a)),n}))()]).finally(()=>{o.closeMFADialog()})})}approveOob(e,t,i,n){return It(this,void 0,void 0,function*(){const r=t.get("outofbandtype");if(null==r)throw new Error("Out of band method is not specified");switch(r){case"lastpassauth":return i.approveLastPassAuth();case"duo":return this.approveDuo(e,t,i,n);case"salesforcehash":return i.approveSalesforceAuth();default:throw new Error("Out of band method "+r+" is not supported")}})}approveDuo(e,t,i,n){return It(this,void 0,void 0,function*(){return"1"==t.get("preferduowebsdk")?this.approveDuoWebSdk(e,t,i,n):i.approveDuo()})}approveDuoWebSdk(e,t,i,n){return i.approveDuo()}markDeviceAsTrusted(e,t,i){return It(this,void 0,void 0,function*(){const n=new Map([["uuid",t.id],["trustlabel",t.description],["token",e.token]]),r=yield i.postForm("trust.php",n,null,this.getSessionCookies(e));r.status!=$e.kG.Ok&&this.makeError(r)})}logout(e,t){return It(this,void 0,void 0,function*(){const i=new Map([["method",kt.get(e.platform)],["noredirect",1]]),n=yield t.postForm("logout.php",i,null,this.getSessionCookies(e));n.status!=$e.kG.Ok&&this.makeError(n)})}downloadVault(e,t){return It(this,void 0,void 0,function*(){const i="getaccts.php?mobile=1&b64=1&hash=0.0&hasplugin=3.0.23&requestsrc="+kt.get(e.platform),n=yield t.get(i,null,this.getSessionCookies(e));if(n.status==$e.kG.Ok){const e=yield n.text();return Ae.A.fromB64ToArray(e)}this.makeError(n)})}getSessionCookies(e){return new Map([["PHPSESSID",encodeURIComponent(e.id)]])}getErrorAttribute(e,t){const i=this.getOptionalErrorAttribute(e,t);if(null!=i)return i;throw new Error("Unknown response schema: attribute "+t+" is missing")}getOptionalErrorAttribute(e,t){const i=e.querySelector("response > error");if(null==i)return null;const n=i.attributes.getNamedItem(t);return null==n?null:n.value}getAllErrorAttributes(e){const t=e.querySelector("response > error");if(null==t)return null;const i=new Map;for(const n of Array.from(t.attributes))i.set(n.name,n.value);return i}extractSessionFromLoginResponse(e,t,i){const n=e.querySelector("response > ok");if(null==n)return null;const r=n.attributes.getNamedItem("sessionid");if(null==r)return null;const s=n.attributes.getNamedItem("token");if(null==s)return null;const o=new vt;o.id=r.value,o.keyIterationCount=t,o.token=s.value,o.platform=i.platform;const a=n.attributes.getNamedItem("privatekeyenc");return null!=a&&null!=a.value&&""!=a.value.trim()&&(o.encryptedPrivateKey=a.value),o}performSingleLoginRequest(e,t,i,n,r,s,o){return It(this,void 0,void 0,function*(){const a=yield this.cryptoUtils.deriveKeyHash(e,t,n),l=new Map([["method",kt.get(s.platform)],["xml","2"],["username",e],["hash",Ae.A.fromBufferToHex(a.buffer)],["iterations",n],["includeprivatekeyenc","1"],["outofbandsupported","1"],["uuid",s.id],["trustlabel",s.description]]);null!=i&&(l.set("alpfragmentid",i),l.set("calculatedfragmentid",i));for(const[e,t]of r)l.set(e,t);const c=yield o.postForm("login.php",l);if(c.status==$e.kG.Ok){const e=yield c.text();return(new window.DOMParser).parseFromString(e,"text/xml")}this.makeError(c)})}makeError(e){throw new Error("HTTP request to "+e.url+" failed with status "+e.status+".")}makeLoginError(e){var t;const i=e.querySelector("response > error");if(null==i)return"Unknown response schema";const n=i.attributes.getNamedItem("cause"),r=i.attributes.getNamedItem("message");if(null!=n)switch(n.value){case"unknownemail":return"Invalid username";case"password_invalid":case"unknownpassword":return"Invalid password";case"googleauthfailed":case"microsoftauthfailed":case"otpfailed":return"Second factor code is incorrect";case"multifactorresponsefailed":return"Out of band authentication failed";case"unifiedloginresult":return"unifiedloginresult";default:return null!==(t=null==r?void 0:r.value)&&void 0!==t?t:n.value}return null!=r?r.value:"Unknown error"}}var Ft=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Rt{constructor(e){this.cryptoFunctionService=e}deriveKey(e,t,i){return Ft(this,void 0,void 0,function*(){if(i<0)throw new Error("Iteration count should be positive");return 1==i?yield this.cryptoFunctionService.hash(e+t,"sha256"):yield this.cryptoFunctionService.pbkdf2(t,e,"sha256",i)})}deriveKeyHash(e,t,i){return Ft(this,void 0,void 0,function*(){const n=yield this.deriveKey(e,t,i);return 1==i?yield this.cryptoFunctionService.hash(Ae.A.fromBufferToHex(n.buffer)+t,"sha256"):yield this.cryptoFunctionService.pbkdf2(n,t,"sha256",1)})}ExclusiveOr(e,t){if(e.length!==t.length)throw new Error("Arrays must be the same length.");const i=new Uint8Array(e.length);for(let n=0;n<e.length;n++)i[n]=e[n]^t[n];return i}decryptAes256PlainWithDefault(e,t,i){return Ft(this,void 0,void 0,function*(){try{return this.decryptAes256Plain(e,t)}catch(n){return i}})}decryptAes256Base64WithDefault(e,t,i){return Ft(this,void 0,void 0,function*(){try{return this.decryptAes256Base64(e,t)}catch(n){return i}})}decryptAes256Plain(e,t){return Ft(this,void 0,void 0,function*(){return 0===e.length?"":33===e[0]&&e.length%16==1&&e.length>32?this.decryptAes256CbcPlain(e,t):this.decryptAes256EcbPlain(e,t)})}decryptAes256Base64(e,t){return Ft(this,void 0,void 0,function*(){return 0===e.length?"":33===e[0]?this.decryptAes256CbcBase64(e,t):this.decryptAes256EcbBase64(e,t)})}decryptAes256(e,t,i){return Ft(this,arguments,void 0,function*(e,t,i,n=new Uint8Array(16)){if(0===e.length)return"";const r=yield this.cryptoFunctionService.aesDecrypt(e,n,t,i);return Ae.A.fromBufferToUtf8(r)})}decryptAes256EcbPlain(e,t){return Ft(this,void 0,void 0,function*(){return this.decryptAes256(e,t,"ecb")})}decryptAes256EcbBase64(e,t){return Ft(this,void 0,void 0,function*(){const i=Ae.A.fromB64ToArray(Ae.A.fromBufferToUtf8(e));return this.decryptAes256(i,t,"ecb")})}decryptAes256CbcPlain(e,t){return Ft(this,void 0,void 0,function*(){const i=e.subarray(17),n=e.subarray(1,17);return this.decryptAes256(i,t,"cbc",n)})}decryptAes256CbcBase64(e,t){return Ft(this,void 0,void 0,function*(){const i=Ae.A.fromB64ToArray(Ae.A.fromBufferToUtf8(e.subarray(26))),n=Ae.A.fromB64ToArray(Ae.A.fromBufferToUtf8(e.subarray(1,25)));return this.decryptAes256(i,t,"cbc",n)})}}var Pt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const xt=new Set(["Server","Email Account","Database","Instant Messenger"]);class $t{constructor(e,t){this.cryptoFunctionService=e,this.cryptoUtils=t}parseAcct(e,t,i,n){return Pt(this,void 0,void 0,function*(){let r,s=0;try{const o="decryption failed",a=new bt(e.payload);r=Ae.A.fromBufferToUtf8(this.readItem(a)),s=1;const l=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=2;const c=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=3;const d=this.readItem(a);let u=d.length>0&&33===d[0]?yield this.cryptoUtils.decryptAes256PlainWithDefault(d,t,o):Ae.A.fromBufferToUtf8(this.decodeHexLoose(Ae.A.fromBufferToUtf8(d)));if("http://group"==u)return null;s=4;const h=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=5;const p="1"===Ae.A.fromBufferToUtf8(this.readItem(a));this.skipItem(a),s=7;let m=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=8;let v=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);this.skipItem(a),this.skipItem(a),s=11;const f="1"===Ae.A.fromBufferToUtf8(this.readItem(a));if(n.parseSecureNotesToAccount&&f){let e="";for(const t of h.split("\n")){const i=t.split(":",2);if(!(i.length<2))switch(i[0]){case"NoteType":e=i[1];break;case"Hostname":u=i[1];break;case"Username":m=i[1];break;case"Password":v=i[1]}}if(!xt.has(e))return null}this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),this.skipItem(a),s=39;const g=yield this.cryptoUtils.decryptAes256PlainWithDefault(this.readItem(a),t,o);s=42;const y=this.makeAccountPath(c,i),b=new nt;return b.id=r,b.name=l,b.username=m,b.password=v,b.url=u,b.path=y,b.notes=h,b.totp=g,b.isFavorite=p,b.isShared=null!=i,b}catch(o){throw new Error("Error parsing accounts on item with ID:"+r+" step #"+s+" errorMessage: "+o.message)}})}parseShar(e,t,i){return Pt(this,void 0,void 0,function*(){let t;try{const n=new bt(e.payload);t=Ae.A.fromBufferToUtf8(this.readItem(n));const r=this.readItem(n),s=Ae.A.fromHexToArray(Ae.A.fromBufferToUtf8(r)),o=yield this.cryptoFunctionService.rsaDecrypt(s,i,"sha1"),a=Ae.A.fromHexToArray(Ae.A.fromBufferToUtf8(o)),l=this.readItem(n),c=yield this.cryptoUtils.decryptAes256Base64(l,a),d=new ft;return d.id=t,d.name=c,d.encryptionKey=a,d}catch(n){throw new Error("Error parsing shared folder with ID:"+t+" errorMessage: "+n.message)}})}parseEncryptedPrivateKey(e,t){return Pt(this,void 0,void 0,function*(){const i=yield this.cryptoUtils.decryptAes256(Ae.A.fromHexToArray(e),t,"cbc",t.subarray(0,16)),n="LastPassPrivateKey<",r=">LastPassPrivateKey";if(!i.startsWith(n)||!i.endsWith(r))throw new Error("Failed to decrypt private key");const s=i.substring(19,i.length-19);return Ae.A.fromHexToArray(s)})}makeAccountPath(e,t){const i=null==e||""===e.trim();return null==t?i?"(none)":e:i?t.name:t.name+"\\"+e}extractChunks(e){const t=new Array;for(;!e.atEnd();){const i=this.readChunk(e);t.push(i)}return t}readChunk(e){const t=new rt;return t.id=this.readId(e),t.payload=this.readPayload(e,this.readSize(e)),t}readItem(e){return this.readPayload(e,this.readSize(e))}skipItem(e){e.seekFromCurrentPosition(this.readSize(e))}readId(e){return Ae.A.fromBufferToUtf8(e.readBytes(4))}readSize(e){return e.readUInt32BigEndian()}readPayload(e,t){return e.readBytes(t)}decodeHexLoose(e){return Ae.A.fromHexToArray(e.length%2==0?e:"0"+e)}}var Et=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class At{constructor(e){this.cryptoFunctionService=e,this.cryptoUtils=new Rt(e);const t=new $t(e,this.cryptoUtils);this.client=new Tt(t,this.cryptoUtils)}open(e,t,i,n){return Et(this,arguments,void 0,function*(e,t,i,n,r=mt.default){this.accounts=yield this.client.openVault(e,t,null,i,n,r)})}openFederated(e,t,i){return Et(this,arguments,void 0,function*(e,t,i,n=mt.default){if(null==e)throw new Error("Federated user context is not set.");const r=yield this.getK1(e),[s,o]=yield this.getK2FragmentId(e),a=yield this.cryptoFunctionService.hash(this.cryptoUtils.ExclusiveOr(r,s),"sha256"),l=Ae.A.fromBufferToB64(a);this.accounts=yield this.client.openVault(e.username,l,o,t,i,n)})}setUserTypeContext(e){return Et(this,void 0,void 0,function*(){const t=e.toLowerCase(),i=new St;i.baseUrl="https://lastpass.com";const n="lmiapi/login/type?username="+encodeURIComponent(t),r=yield i.get(n);if(r.status===$e.kG.Ok){const e=yield r.json();if(this.userType=new gt,this.userType.companyId=e.CompanyId,this.userType.identityProviderGUID=e.IdentityProviderGUID,this.userType.identityProviderURL=e.IdentityProviderURL,this.userType.isPasswordlessEnabled=e.IsPasswordlessEnabled,this.userType.openIDConnectAuthority=e.OpenIDConnectAuthority,this.userType.openIDConnectClientId=e.OpenIDConnectClientId,this.userType.pkceEnabled=e.PkceEnabled,this.userType.provider=e.Provider,this.userType.type=e.type,this.userType.provider===st.Azure){const e=this.userType.openIDConnectAuthority.indexOf("?app");e>-1&&(this.userType.openIDConnectAuthority=this.userType.openIDConnectAuthority.substring(0,e))}return}throw new Error("Cannot determine LastPass user type.")})}accountsToExportedCsvString(e=!1){if(null==this.accounts)throw new Error("Vault has not opened any accounts.");const t=this.accounts.filter(t=>!t.isShared||t.isShared&&!e).map(e=>new dt(e));if(0===t.length)throw new Error("No accounts to transform");return qe.unparse(t)}getK1(e){return Et(this,void 0,void 0,function*(){var t;if(null==this.userType)throw new Error("User type is not set.");if(!this.userType.isFederated())throw new Error("Cannot get k1 for LastPass user that is not federated.");if(null==e)throw new Error("Federated user is not set.");let i=null;if(null!=(null===(t=e.idpUserInfo)||void 0===t?void 0:t.LastPassK1))return Ae.A.fromByteStringToArray(e.idpUserInfo.LastPassK1);if(this.userType.provider===st.Azure)i=yield this.getK1Azure(e);else if(this.userType.provider===st.Google)i=yield this.getK1Google(e);else{const t=this.userType.provider===st.PingOne;i=yield this.getK1FromAccessToken(e,t)}if(null!=i)return i;throw new Error("Cannot get k1.")})}getK1Azure(e){return Et(this,void 0,void 0,function*(){const t=new St;t.baseUrl="https://graph.microsoft.com";const i=yield t.get("v1.0/me?$select=id,displayName,mail&$expand=extensions",new Map([["Authorization","Bearer "+e.accessToken]]));if(i.status===$e.kG.Ok){const e=yield i.json();if(null!=(null==e?void 0:e.extensions)&&e.extensions.length>0){const t=e.extensions[0].LastPassK1;if(null!=t)return Ae.A.fromB64ToArray(t)}}return null})}getK1Google(e){return Et(this,void 0,void 0,function*(){const t=new Map([["Authorization","Bearer "+e.accessToken]]),i=new St;i.baseUrl="https://content.googleapis.com";const n=yield i.get("drive/v3/files?pageSize=1&q=name%20%3D%20%27k1.lp%27&spaces=appDataFolder&fields=nextPageToken%2C%20files(id%2C%20name)",t);if(n.status===$e.kG.Ok){const e=yield n.json(),r=null==e?void 0:e.files;if(null!=r&&r.length>0&&null!=r[0].id&&"k1.lp"===r[0].name){i.baseUrl="https://www.googleapis.com";const e=yield i.get("drive/v3/files/"+r[0].id+"?alt=media",t);if(e.status===$e.kG.Ok){const t=yield e.text();return Ae.A.fromB64ToArray(t)}}}return null})}getK1FromAccessToken(e,t){return Et(this,void 0,void 0,function*(){const i=(0,yt.iD)(e.accessToken),n=null==i?void 0:i.LastPassK1;return null!=n?t?Ae.A.fromB64ToArray(n):Ae.A.fromByteStringToArray(n):null})}getK2FragmentId(e){return Et(this,void 0,void 0,function*(){if(null==this.userType)throw new Error("User type is not set.");if(!this.userType.isFederated())throw new Error("Cannot get k2 for LastPass user that is not federated.");const t=new St;t.baseUrl=this.userType.identityProviderURL;const i=yield t.postJson("federatedlogin/api/v1/getkey",{company_id:this.userType.companyId,id_token:e.idToken});if(i.status===$e.kG.Ok){const e=yield i.json(),t=null==e?void 0:e.k2,n=null==e?void 0:e.fragment_id;if(null!=t&&null!=n)return[Ae.A.fromB64ToArray(t),n]}throw new Error("Cannot get k2 and/or fragment ID.")})}}var Dt=i(93199),Ot=i(26657);class Mt{constructor(e){this.dialogRef=e,this.formGroup=new F.gE({password:new F.MJ("",{validators:F.k0.required,updateOn:"submit"})}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.controls.password.value)}}static open(e){const t=e.open(Mt);return(0,be._)(t.closed)}}Mt.ɵfac=function(e){return new(e||Mt)(d.rXU(u.ce))},Mt.ɵcmp=d.VBU({type:Mt,selectors:[["ng-component"]],decls:24,vars:17,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"!tw-mb-0"],["bitInput","","type","password","formControlName","password","appAutofocus","","appInputVerbatim",""],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","bitFormButton",""],["bitButton","","bitDialogClose","","buttonType","secondary","type","button","bitFormButton",""]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"div",2)(6,"bit-form-field",3)(7,"bit-label"),d.EFF(8),d.nI1(9,"i18n"),d.k0s(),d.nrm(10,"input",4)(11,"button",5),d.j41(12,"bit-hint"),d.EFF(13),d.nI1(14,"i18n"),d.k0s()()(),d.qex(15,6),d.j41(16,"button",7)(17,"span"),d.EFF(18),d.nI1(19,"i18n"),d.k0s()(),d.j41(20,"button",8)(21,"span"),d.EFF(22),d.nI1(23,"i18n"),d.k0s()(),d.bVm(),d.k0s()()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(3),d.SpI(" ",d.bMT(4,7,"lastPassAuthRequired")," "),d.R7$(5),d.JRh(d.bMT(9,9,"lastPassMasterPassword")),d.R7$(5),d.JRh(d.bMT(14,11,"confirmIdentity")),d.R7$(5),d.JRh(d.bMT(19,13,"submit")),d.R7$(4),d.JRh(d.bMT(23,15,"cancel")))},dependencies:[n.MD,r.p,$.B,E.q,F.X1,F.qT,F.me,F.BC,F.cb,F.j4,F.JD,a.P,h.I,p.m,R.L,A.j,Dt.I,D.J,O.h,M.e,U.a,P.C,Ot.$,G.L,c.t,g.Q,x.Q,j.s,_e.E,y.$],encapsulation:2});class Ut{get descriptionI18nKey(){switch(this.variant){case"oob":return"lastPassOOBDesc";case"yubikey":return"lastPassYubikeyDesc";default:return"lastPassMFADesc"}}constructor(e,t){this.dialogRef=e,this.data=t,this.variant=this.data.variant,this.formGroup=new F.gE({passcode:new F.MJ("",{validators:F.k0.required,updateOn:"submit"})}),this.submit=()=>{this.formGroup.markAsTouched(),this.formGroup.valid&&this.dialogRef.close(this.formGroup.value.passcode)}}static open(e,t){return e.open(Ut,{data:t})}}Ut.ɵfac=function(e){return new(e||Ut)(d.rXU(u.ce),d.rXU(o.Qs))},Ut.ɵcmp=d.VBU({type:Ut,selectors:[["ng-component"]],decls:26,vars:20,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[1,"!tw-mb-0"],["bitInput","","type","text","formControlName","passcode","appAutofocus","","appInputVerbatim",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","bitFormButton",""],["bitButton","","bitDialogClose","cancel","buttonType","secondary","type","button","bitFormButton",""]],template:function(e,t){1&e&&(d.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"div",2)(6,"p"),d.EFF(7),d.nI1(8,"i18n"),d.k0s(),d.j41(9,"bit-form-field",3)(10,"bit-label"),d.EFF(11),d.nI1(12,"i18n"),d.k0s(),d.nrm(13,"input",4),d.j41(14,"bit-hint"),d.EFF(15),d.nI1(16,"i18n"),d.k0s()()(),d.qex(17,5),d.j41(18,"button",6)(19,"span"),d.EFF(20),d.nI1(21,"i18n"),d.k0s()(),d.j41(22,"button",7)(23,"span"),d.EFF(24),d.nI1(25,"i18n"),d.k0s()(),d.bVm(),d.k0s()()),2&e&&(d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(3),d.SpI(" ",d.bMT(4,8,"lastPassMFARequired")," "),d.R7$(4),d.JRh(d.bMT(8,10,t.descriptionI18nKey)),d.R7$(4),d.JRh(d.bMT(12,12,"passcode")),d.R7$(4),d.JRh(d.bMT(16,14,"confirmIdentity")),d.R7$(5),d.JRh(d.bMT(21,16,"continue")),d.R7$(4),d.JRh(d.bMT(25,18,"cancel")))},dependencies:[n.MD,r.p,$.B,E.q,F.X1,F.qT,F.me,F.BC,F.cb,F.j4,F.JD,a.P,h.I,p.m,R.L,A.j,Dt.I,D.J,O.h,P.C,Ot.$,G.L,c.t,g.Q,x.Q,_e.E,y.$],encapsulation:2});var Gt=i(74208),jt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Nt{constructor(e){this.dialogService=e}getOTPResult(e){return jt(this,void 0,void 0,function*(){const t=yield this.openMFADialog(e);return new pt(t,!1)})}getOOBResult(e){return jt(this,void 0,void 0,function*(){const t=yield this.openMFADialog(e);return new ht(!1,t,!1)})}openMFADialog(e){return this.mfaDialogRef=Ut.open(this.dialogService,{variant:e}),(0,be._)(this.mfaDialogRef.closed)}closeMFADialog(){var e;null===(e=this.mfaDialogRef)||void 0===e||e.close()}provideGoogleAuthPasscode(){return jt(this,void 0,void 0,function*(){return this.getOTPResult("otp")})}provideMicrosoftAuthPasscode(){return jt(this,void 0,void 0,function*(){return this.getOTPResult("otp")})}provideYubikeyPasscode(){return jt(this,void 0,void 0,function*(){return this.getOTPResult("yubikey")})}approveLastPassAuth(){return jt(this,void 0,void 0,function*(){return this.getOOBResult("oob")})}approveDuo(){return jt(this,void 0,void 0,function*(){return this.getOOBResult("oob")})}approveSalesforceAuth(){return jt(this,void 0,void 0,function*(){return this.getOOBResult("oob")})}}Nt.ɵfac=function(e){return new(e||Nt)(Gt.KVO(u.o3))},Nt.ɵprov=Gt.jDH({token:Nt,factory:Nt.ɵfac,providedIn:"root"});var Vt=i(45872),Bt=i(91059),zt=i(52396),Lt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Kt{constructor(e,t,i,n,r,s,o,a,l,c){this.cryptoFunctionService=e,this.environmentService=t,this.appIdService=i,this.lastPassDirectImportUIService=n,this.platformUtilsService=r,this.passwordGenerationService=s,this.broadcasterService=o,this.ngZone=a,this.dialogService=l,this.i18nService=c,this._ssoImportCallback$=new ge.B,this.ssoImportCallback$=this._ssoImportCallback$.asObservable(),this.vault=new At(this.cryptoFunctionService),this.broadcasterService.subscribe("LastPassDirectImportService",e=>{this.ngZone.run(()=>Lt(this,void 0,void 0,function*(){if("importCallbackLastPass"===e.command)this._ssoImportCallback$.next({oidcCode:e.code,oidcState:e.state})}))})}handleImport(e,t){return Lt(this,void 0,void 0,function*(){if(yield this.verifyLastPassAccountExists(e),this.isAccountFederated){const i=yield this.handleFederatedLogin(e);return yield this.handleFederatedImport(i.oidcCode,i.oidcState,t)}const i=yield Mt.open(this.dialogService);return yield this.handleStandardImport(e,i,t)})}get isAccountFederated(){return this.vault.userType.isFederated()}verifyLastPassAccountExists(e){return Lt(this,void 0,void 0,function*(){yield this.vault.setUserTypeContext(e)})}handleFederatedLogin(e){return Lt(this,void 0,void 0,function*(){const t=(0,be._)(this.ssoImportCallback$),i=yield this.createOidcSigninRequest(e);this.platformUtilsService.launchUri(i.url);const n=this.dialogService.openSimpleDialogRef({title:this.i18nService.t("awaitingSSO"),content:this.i18nService.t("awaitingSSODesc"),type:"warning",icon:"bwi-key",acceptButtonText:this.i18nService.t("cancel"),cancelButtonText:null}),r=(0,be._)(n.closed).then(e=>{throw Error("SSO auth cancelled")});return Promise.race([r,t]).finally(()=>{n.close()})})}createOidcSigninRequest(e){return Lt(this,void 0,void 0,function*(){return this.oidcClient=new et.hz({authority:this.vault.userType.openIDConnectAuthorityBase,client_id:this.vault.userType.openIDConnectClientId,redirect_uri:yield this.getOidcRedirectUrl(),response_type:"code",scope:this.vault.userType.oidcScope,response_mode:"query",loadUserInfo:!0}),yield this.oidcClient.createSigninRequest({state:{email:e},nonce:yield this.passwordGenerationService.generatePassword({length:20,uppercase:!0,lowercase:!0,number:!0})})})}getOidcRedirectUrlWithParams(e,t){const i=this.oidcClient.settings.redirect_uri,n="code="+e+"&state="+t;return 0===i.indexOf("bitwarden://")?i+"/?"+n:i+"&"+n}getOidcRedirectUrl(){return Lt(this,void 0,void 0,function*(){if(this.platformUtilsService.getClientType()===$e.sK.Desktop)return"bitwarden://import-callback-lp";return(yield(0,be._)(this.environmentService.environment$)).getWebVaultUrl()+"/sso-connector.html?lp=1"})}handleStandardImport(e,t,i){return Lt(this,void 0,void 0,function*(){const n=yield this.createClientInfo(e);return yield this.vault.open(e,t,n,this.lastPassDirectImportUIService,{parseSecureNotesToAccount:!1}),this.vault.accountsToExportedCsvString(!i)})}handleFederatedImport(e,t,i){return Lt(this,void 0,void 0,function*(){const n=yield this.oidcClient.processSigninResponse(this.getOidcRedirectUrlWithParams(e,t)),r=n.userState,s=new ut;s.idToken=n.id_token,s.accessToken=n.access_token,s.idpUserInfo=n.profile,s.username=r.email;const o=yield this.createClientInfo(s.username);return yield this.vault.openFederated(s,o,this.lastPassDirectImportUIService,{parseSecureNotesToAccount:!1}),this.vault.accountsToExportedCsvString(!i)})}createClientInfo(e){return Lt(this,void 0,void 0,function*(){const t="lastpass"+(yield this.appIdService.getAppId())+e,i=yield this.cryptoFunctionService.hash(t,"sha256");return ct.createClientInfo(Ae.A.fromBufferToHex(i))})}}Kt.ɵfac=function(e){return new(e||Kt)(Gt.KVO(Vt.R),Gt.KVO(tt.v),Gt.KVO(Bt.Y),Gt.KVO(Nt),Gt.KVO(J.y),Gt.KVO(it.JJ),Gt.KVO(zt.y),Gt.KVO(d.SKi),Gt.KVO(u.o3),Gt.KVO(H.W))},Kt.ɵprov=Gt.jDH({token:Kt,factory:Kt.ɵfac,providedIn:"root"});var qt=i(90246),_t=i(50352),Xt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Yt{constructor(e,t,i,n,r){this.formBuilder=e,this.controlContainer=t,this.logService=i,this.lastPassDirectImportService=n,this.i18nService=r,this.formGroup=this.formBuilder.group({email:["",{validators:[F.k0.required,F.k0.email],asyncValidators:[this.validateAndEmitData()],updateOn:"submit"}],includeSharedFolders:[!1]}),this.emailHint$=this.formGroup.controls.email.statusChanges.pipe((0,Ce.T)(e=>{if("PENDING"===e)return this.i18nService.t("importingYourAccount")})),this.csvDataLoaded=new d.bkB}ngOnInit(){this._parentFormGroup=this.controlContainer.control,this._parentFormGroup.addControl("lastpassOptions",this.formGroup)}ngOnDestroy(){this._parentFormGroup.removeControl("lastpassOptions")}validateAndEmitData(){return()=>Xt(this,void 0,void 0,function*(){try{const e=yield this.lastPassDirectImportService.handleImport(this.formGroup.controls.email.value,this.formGroup.controls.includeSharedFolders.value);return this.csvDataLoaded.emit(e),null}catch(e){return this.logService.error(`LP importer error: ${e}`),{errors:{message:this.i18nService.t(this.getValidationErrorI18nKey(e))}}}})}getValidationErrorI18nKey(e){switch("string"==typeof e?e:null==e?void 0:e.message){case"SSO auth cancelled":case"Second factor step is canceled by the user":case"Out of band step is canceled by the user":return"multifactorAuthenticationCancelled";case"No accounts to transform":case"Vault has not opened any accounts.":return"noLastPassDataFound";case"Invalid username":case"Invalid password":return"incorrectUsernameOrPassword";case"Second factor code is incorrect":case"Out of band authentication failed":return"multifactorAuthenticationFailed";case"unifiedloginresult":return"lastPassTryAgainCheckEmail";default:return"errorOccurred"}}}Yt.ɵfac=function(e){return new(e||Yt)(d.rXU(F.ok),d.rXU(F.ZU),d.rXU(W.K),d.rXU(Kt),d.rXU(H.W))},Yt.ɵcmp=d.VBU({type:Yt,selectors:[["import-lastpass"]],outputs:{csvDataLoaded:"csvDataLoaded"},decls:14,vars:10,consts:[[3,"formGroup"],["bitInput","","type","text","formControlName","email"],["bitCheckbox","","type","checkbox","formControlName","includeSharedFolders","id","import-lastpass_input_includeSharedFolders"]],template:function(e,t){1&e&&(d.j41(0,"div",0)(1,"bit-form-field")(2,"bit-label"),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.nrm(5,"input",1),d.j41(6,"bit-hint"),d.EFF(7),d.nI1(8,"async"),d.k0s()(),d.j41(9,"bit-form-control"),d.nrm(10,"input",2),d.j41(11,"bit-label"),d.EFF(12),d.nI1(13,"i18n"),d.k0s()()()),2&e&&(d.Y8G("formGroup",t.formGroup),d.R7$(3),d.JRh(d.bMT(4,4,"lastPassEmail")),d.R7$(4),d.JRh(d.bMT(8,6,t.emailHint$)),d.R7$(5),d.JRh(d.bMT(13,8,"includeSharedFolders")))},dependencies:[n.MD,r.p,Ue.j,_e.E,R.L,qt.f,A.j,Dt.I,D.J,O.h,F.X1,F.me,F.Zm,F.BC,F.cb,F.j4,F.JD,x.Q,Xe.q,_t.P,n.Jj,y.$],encapsulation:2});var Ht=i(69855),Wt=i(44432),Jt=i(24374),Zt=i(17721),Qt=i(59032),ei=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ti(e,t){1&e&&(d.j41(0,"bit-callout",18),d.nI1(1,"i18n"),d.EFF(2),d.nI1(3,"i18n"),d.k0s()),2&e&&(d.Y8G("title",d.bMT(1,2,"restrictCardTypeImport")),d.R7$(2),d.SpI(" ",d.bMT(3,4,"restrictCardTypeImportDesc"),"\n"))}function ii(e,t){1&e&&(d.nrm(0,"bit-option",19),d.nI1(1,"i18n")),2&e&&d.Y8G("label",d.bMT(1,1,"myVault"))}function ni(e,t){if(1&e&&d.nrm(0,"bit-option",20),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}function ri(e,t){if(1&e&&d.nrm(0,"bit-option",23),2&e){const e=t.$implicit;d.Y8G("value",e)("label",e.name)}}function si(e,t){if(1&e&&(d.qex(0),d.nrm(1,"bit-option",21),d.nI1(2,"i18n"),d.DNE(3,ri,1,2,"bit-option",22),d.nI1(4,"async"),d.bVm()),2&e){const e=d.XpG();d.R7$(),d.Y8G("label",d.VkB("-- ",d.bMT(2,4,"selectImportFolder")," --"))("value",null),d.R7$(2),d.Y8G("ngForOf",d.bMT(4,6,e.folders$))}}function oi(e,t){if(1&e&&d.nrm(0,"bit-option",25),2&e){const e=t.$implicit,i=d.XpG(2);d.Y8G("value",e)("label",e.name)("icon",e.type===i.DefaultCollectionType?"bwi-user":"bwi-collection-shared")}}function ai(e,t){if(1&e&&(d.qex(0),d.nrm(1,"bit-option",21),d.nI1(2,"i18n"),d.DNE(3,oi,1,3,"bit-option",24),d.nI1(4,"async"),d.bVm()),2&e){const e=d.XpG();d.R7$(),d.Y8G("label",d.VkB("-- ",d.bMT(2,4,"selectImportCollection")," --"))("value",null),d.R7$(2),d.Y8G("ngForOf",d.bMT(4,6,e.collections$))}}function li(e,t){if(1&e&&d.nrm(0,"bit-option",21),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}function ci(e,t){if(1&e&&d.nrm(0,"bit-option",21),2&e){const e=t.$implicit;d.Y8G("value",e.id)("label",e.name)}}function di(e,t){if(1&e&&(d.qex(0),d.nrm(1,"bit-option",26),d.DNE(2,ci,1,2,"bit-option",15),d.bVm()),2&e){const e=d.XpG();d.R7$(2),d.Y8G("ngForOf",e.importOptions)}}function ui(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",27),d.EFF(3," https://bitwarden.com/help/export-your-data/"),d.k0s(),d.bVm())}function hi(e,t){1&e&&(d.j41(0,"bit-radio-group",31)(1,"bit-radio-button",32)(2,"bit-label"),d.EFF(3),d.nI1(4,"i18n"),d.k0s()(),d.j41(5,"bit-radio-button",33)(6,"bit-label"),d.EFF(7),d.nI1(8,"i18n"),d.k0s()()()),2&e&&(d.R7$(3),d.JRh(d.bMT(4,2,"importDirectlyFromLastPass")),d.R7$(4),d.JRh(d.bMT(8,4,"importFromCSV")))}function pi(e,t){if(1&e&&(d.qex(0),d.j41(1,"p",28),d.EFF(2),d.nI1(3,"i18n"),d.j41(4,"a",29),d.EFF(5," https://bitwarden.com/help/import-from-lastpass/"),d.k0s()(),d.DNE(6,hi,9,6,"bit-radio-group",30),d.bVm()),2&e){const e=d.XpG(2);d.R7$(2),d.SpI(" ",d.bMT(3,2,"seeDetailedInstructions")," "),d.R7$(4),d.Y8G("ngIf",e.showLastPassToggle)}}function mi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the KeePassX desktop application, navigate to "Database" → "Export to CSV file" and save the CSV file. '),d.bVm())}function vi(e,t){1&e&&(d.qex(0),d.EFF(1,' In the Avira web vault, go to "Settings" → "My Data" → "Export data" and save the CSV file. '),d.bVm())}function fi(e,t){1&e&&(d.qex(0),d.EFF(1,' In the Blur web vault, click your username at the top and go to "Settings" → "Export Data", then click "Export CSV" for your "Accounts". '),d.bVm())}function gi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the SaveInCloud desktop application, navigate to "File" → "Export" → "As XML" and save the XML file. '),d.bVm())}function yi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Padlock desktop application, click the hamburger icon in the top left corner and navigate to "Settings" → "Export" button and save the file "As CSV". '),d.bVm())}function bi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the KeePass 2 desktop application, navigate to "File" → "Export" and select the "KeePass XML (2.x)" option. '),d.bVm())}function wi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Universal Password Manager desktop application, navigate to "Database" → "Export" and save the CSV file. '),d.bVm())}function Si(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the SaferPass browser extension, click the hamburger icon in the top left corner and navigate to "Settings". Click the "Export accounts" button to save the CSV file. '),d.bVm())}function Ii(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Meldium web vault, navigate to "Settings". Locate the "Export data" function and click "Show me my data" to save the CSV file. '),d.bVm())}function ki(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Keeper web vault (keepersecurity.com/vault). Click on your "account email" (top right) and select "Settings". Go to "Export" and find the "Export to .csv File" option. Click "Export" to save the CSV file. '),d.bVm())}function Ci(e,t){1&e&&(d.j41(0,"span"),d.EFF(1," The process is exactly the same as importing from Google Chrome. "),d.k0s())}function Ti(e,t){if(1&e&&(d.qex(0),d.DNE(1,Ci,2,0,"span",10),d.j41(2,"p"),d.EFF(3," See detailed instructions on our help site at "),d.j41(4,"a",34),d.EFF(5," https://bitwarden.com/help/import-from-chrome/"),d.k0s()(),d.j41(6,"bit-radio-group",35),d.nI1(7,"async"),d.j41(8,"bit-radio-button",36)(9,"bit-label"),d.EFF(10),d.nI1(11,"i18n"),d.k0s()(),d.j41(12,"bit-radio-button",37)(13,"bit-label"),d.EFF(14),d.nI1(15,"i18n"),d.k0s()()(),d.bVm()),2&e){const e=d.XpG(2);d.R7$(),d.Y8G("ngIf","chromecsv"!==e.format),d.R7$(5),d.Y8G("hidden",!d.bMT(7,4,e.browserImporterAvailable$)),d.R7$(4),d.JRh(d.bMT(11,6,"importDirectlyFromBrowser")),d.R7$(4),d.JRh(d.bMT(15,8,"importFromCSV"))}}function Fi(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",38),d.EFF(3," https://bitwarden.com/help/import-from-firefox/"),d.k0s(),d.EFF(4,". "),d.bVm())}function Ri(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",39),d.EFF(3," https://bitwarden.com/help/import-from-safari/"),d.k0s(),d.EFF(4,". "),d.bVm())}function Pi(e,t){1&e&&(d.qex(0),d.EFF(1," See detailed instructions on our help site at "),d.j41(2,"a",40),d.EFF(3," https://bitwarden.com/help/import-from-1password/"),d.k0s(),d.EFF(4,". "),d.bVm())}function xi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Dragon desktop application, navigate to "File" → "Export" → "To XML". In the dialog that pops up select "All Rows" and check all fields. Click the "Export" button and save the XML file. '),d.bVm())}function $i(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Enpass desktop application, navigate to "File" → "Export" → "As CSV". Select "OK" to the warning alert and save the CSV file. Note that the importer only supports files exported while Enpass is set to the English language, so adjust your settings accordingly. '),d.bVm())}function Ei(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Enpass 6 desktop application, click the menu button and navigate to "File" → "Export". Select the ".json" file format option and save the JSON file. '),d.bVm())}function Ai(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Safe desktop application, navigate to "File" → "Export To" → "XML format..." and save the XML file. '),d.bVm())}function Di(e,t){1&e&&(d.qex(0),d.EFF(1,' Log in to Dashlane, click on "My Account" → "Settings" → "Export file" and select "Export as a CSV file". This will download a zip archive containing various CSV files. Unzip the archive and import each CSV file individually. '),d.bVm())}function Oi(e,t){1&e&&(d.qex(0),d.EFF(1," Dashlane no longer supports the JSON format. Only use this if you have an existing JSON for import. Use the CSV importer when creating new exports. "),d.bVm())}function Mi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the mSecure desktop application, navigate to "File" → "Export" → "CSV File..." and save the CSV file. '),d.bVm())}function Ui(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Sticky Password desktop application, navigate to "Menu" (top right) → "Export" → "Export all". Select the unencrypted format XML option and save the XML file. '),d.bVm())}function Gi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the True Key desktop application, click the gear icon (top right) and then navigate to "App Settings". Click the "Export" button, enter your password and save the CSV file. '),d.bVm())}function ji(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Clipperz web application (clipperz.is/app). Click the hamburger menu icon in the top right to expand the navigation bar. Navigate to "Data" → "Export". Click the "download HTML+JSON" button to save the HTML file. '),d.bVm())}function Ni(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the RoboForm Editor desktop application, navigate to "RoboForm" (top left) → "Options" → "Account & Data" and click the "Export" button. Select all of your data, change the "Format" to "CSV file" and then click the "Export" button to save the CSV file. Note: RoboForm only allows you to export Logins. Other items will not be exported. '),d.bVm())}function Vi(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Passbolt web vault and navigate to the "Passwords" listing. Select all of the passwords you would like to export and click the "Export" button at the top of the listing. Choose the "csv (lastpass)" export format and click the "Export" button. '),d.bVm())}function Bi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Ascendo DataVault desktop application, navigate to "Tools" → "Export". In the dialog that pops up, select the "All Items (DVX, CSV)" option. Click the "Ok" button to save the CSV file. '),d.bVm())}function zi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Boss desktop application, navigate to "File" → "Export data" → "Password Boss JSON - not encrypted" and save the JSON file. '),d.bVm())}function Li(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Zoho web vault (vault.zoho.com). Navigate to "Tools" → "Export Secrets". Select "All Secrets" and click the "Zoho Vault Format CSV" button. Highlight and copy the data from the textarea. Open a text editor like Notepad and paste the data. Save the data from the text editor as '),d.j41(2,"code"),d.EFF(3,"zoho_export.csv"),d.k0s(),d.EFF(4,". "),d.bVm())}function Ki(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the SplashID Safe desktop application, click on the SplashID blue lock logo in the top right corner. Navigate to "Export" → "Export as CSV" and save the CSV file. '),d.bVm())}function qi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the PassKeep mobile app, navigate to "Backup/Restore". Locate the "CSV Backup/Restore" section and click "Backup to CSV" to save the CSV file. '),d.bVm())}function _i(e,t){1&e&&(d.qex(0),d.EFF(1," Make sure you have python-keyring and python-gnomekeyring installed. Save the "),d.j41(2,"a",41),d.EFF(3,"GNOME Keyring Import/Export"),d.k0s(),d.EFF(4," python script to your desktop as "),d.j41(5,"code"),d.EFF(6,"pw_helper.py"),d.k0s(),d.EFF(7,". Open terminal and run "),d.j41(8,"code"),d.EFF(9,"chmod +rx Desktop/pw_helper.py"),d.k0s(),d.EFF(10," and then "),d.j41(11,"code"),d.EFF(12,"python Desktop/pw_helper.py export Desktop/my_passwords.json"),d.k0s(),d.EFF(13,". Then upload the resulting "),d.j41(14,"code"),d.EFF(15,"my_passwords.json"),d.k0s(),d.EFF(16," file here to Bitwarden. "),d.bVm())}function Xi(e,t){1&e&&(d.qex(0),d.EFF(1,' Using the Password Agent desktop application navigate to "File" → "Export", select the "Fields to export" button and check all of the fields, change the "Output format" to "CSV", and then click the "Start" button to save the CSV file. '),d.bVm())}function Yi(e,t){1&e&&(d.qex(0),d.EFF(1,' Log into the Passpack website vault and navigate to "Settings" → "Export", then click the "Download" button to save the CSV file. '),d.bVm())}function Hi(e,t){1&e&&(d.qex(0),d.EFF(1,' Open your Passman vault and click on "Settings" in the bottom left corner. In the "Settings" window switch to the "Export credentials" tab and choose "JSON" as the export type. Enter your vault\'s passphrase and click the "Export" button to save the JSON file. '),d.bVm())}function Wi(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Avast Passwords desktop application and navigate to "Settings" → "Import/export data". Select the "Export" button for the "Export to CSV file" option to save the CSV file. '),d.bVm())}function Ji(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Avast Passwords desktop application and navigate to "Settings" → "Import/export data". Select the "Export" button for the "Export to JSON file" option to save the JSON file. '),d.bVm())}function Zi(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the F-Secure KEY desktop application and navigate to "Settings" → "Export Passwords". Select the "Export" button, enter your master password, and save the FSK file. '),d.bVm())}function Qi(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Kaspersky Password Manager desktop application and navigate to "Settings" → "Import/Export". Locate the "Export to text file" section and select the "Export" button to save the TXT file. '),d.bVm())}function en(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the RememBear desktop application and navigate to "Settings" → "Account" → "Export". Enter your master password and select the "Export Anyway" button to save the CSV file. '),d.bVm())}function tn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the PasswordWallet desktop application and navigate to "File" → "Export" → "Visible entries to text file". Enter your password and select the "Ok" button to save the TXT file. '),d.bVm())}function nn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Myki desktop browser extension and navigate to "Advanced" → "Export Accounts" and then scan the QR code with your mobile device. Various CSV files will then be saved to your computer\'s downloads folder. '),d.bVm())}function rn(e,t){1&e&&(d.qex(0),d.EFF(1," Export your SecureSafe password safe to a CSV file with a comma delimiter. "),d.bVm())}function sn(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the LogMeOnce browser extension, then navigate to "Open Menu" → "Export To" and select "CSV File" to save the CSV file. '),d.bVm())}function on(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the BlackBerry Password Keeper application, then navigate to "Settings" → "Import/Export". Select "Export Passwords" and follow the instructions on screen to save the unencrypted CSV file. '),d.bVm())}function an(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Buttercup desktop application and unlock your vault. Right click on your vault\'s icon and select "Export" to save the CSV file. '),d.bVm())}function ln(e,t){1&e&&(d.qex(0),d.EFF(1,' Open the Codebook desktop application and log in. Navigate to "File" → "Export all", then click "Yes" on the dialog and save the CSV file. '),d.bVm())}function cn(e,t){1&e&&(d.qex(0),d.EFF(1," Open the newest version of the Encryptr desktop application and allow all of your data to sync. Once syncing of your data is complete, the download icon in the top right corner will turn pink. Click the download icon and save the CSV file. "),d.bVm())}function dn(e,t){1&e&&(d.qex(0),d.EFF(1,' From the Yoti browser extension, click on "Settings", then "Export Saved Logins" and save the CSV file. '),d.bVm())}function un(e,t){1&e&&(d.qex(0),d.EFF(1,' Log in to the Psono web vault, click on the "Signed in as"-dropdown, select "Others". Go to the "Export"-tab and select the json type export and then click on Export. '),d.bVm())}function hn(e,t){1&e&&(d.qex(0),d.EFF(1,' Log in to "https://vault.passky.org" → "Import & Export" → "Export" in the Passky section. ("Backup" is unsupported as it is encrypted). '),d.bVm())}function pn(e,t){1&e&&(d.qex(0),d.EFF(1," In the ProtonPass browser extension, go to Settings > Export. Export without PGP encryption and save the zip file. "),d.bVm())}function mn(e,t){1&e&&(d.qex(0),d.EFF(1," Select Database → Export to file... menu. → Within the export options, ensure Folder names and Column titles is checked. → Press Browse... button and choose the target file and set it's type to CSV file. "),d.bVm())}function vn(e,t){1&e&&(d.qex(0),d.EFF(1," Open the FullClient, go to the Main Menu and select Export. Start the export passwords wizard and follow the instructions to export a CSV file. "),d.bVm())}function fn(e,t){1&e&&(d.qex(0),d.EFF(1," Log in to NordPass and open Settings → Scroll down to the Import and Export section and select Export items → Enter your Master Password and select Continue. → Save the CSV file on your device. "),d.bVm())}function gn(e,t){1&e&&(d.qex(0),d.EFF(1," On the desktop application, go to Tools → Export → Enter your master password → Select XML Format (*.xml) as Export format → Click on next → Choose which entries should be included in the export → Click on next to export into the location previously chosen. "),d.bVm())}function yn(e,t){if(1&e&&(d.j41(0,"bit-callout",18),d.DNE(1,ui,4,0,"ng-container",10)(2,pi,7,4,"ng-container",10)(3,mi,2,0,"ng-container",10)(4,vi,2,0,"ng-container",10)(5,fi,2,0,"ng-container",10)(6,gi,2,0,"ng-container",10)(7,yi,2,0,"ng-container",10)(8,bi,2,0,"ng-container",10)(9,wi,2,0,"ng-container",10)(10,Si,2,0,"ng-container",10)(11,Ii,2,0,"ng-container",10)(12,ki,2,0,"ng-container",10)(13,Ti,16,10,"ng-container",10),d.nI1(14,"async"),d.DNE(15,Fi,5,0,"ng-container",10)(16,Ri,5,0,"ng-container",10)(17,Pi,5,0,"ng-container",10)(18,xi,2,0,"ng-container",10)(19,$i,2,0,"ng-container",10)(20,Ei,2,0,"ng-container",10)(21,Ai,2,0,"ng-container",10)(22,Di,2,0,"ng-container",10)(23,Oi,2,0,"ng-container",10)(24,Mi,2,0,"ng-container",10)(25,Ui,2,0,"ng-container",10)(26,Gi,2,0,"ng-container",10)(27,ji,2,0,"ng-container",10)(28,Ni,2,0,"ng-container",10)(29,Vi,2,0,"ng-container",10)(30,Bi,2,0,"ng-container",10)(31,zi,2,0,"ng-container",10)(32,Li,5,0,"ng-container",10)(33,Ki,2,0,"ng-container",10)(34,qi,2,0,"ng-container",10)(35,_i,17,0,"ng-container",10)(36,Xi,2,0,"ng-container",10)(37,Yi,2,0,"ng-container",10)(38,Hi,2,0,"ng-container",10)(39,Wi,2,0,"ng-container",10)(40,Ji,2,0,"ng-container",10)(41,Zi,2,0,"ng-container",10)(42,Qi,2,0,"ng-container",10)(43,en,2,0,"ng-container",10)(44,tn,2,0,"ng-container",10)(45,nn,2,0,"ng-container",10)(46,rn,2,0,"ng-container",10)(47,sn,2,0,"ng-container",10)(48,on,2,0,"ng-container",10)(49,an,2,0,"ng-container",10)(50,ln,2,0,"ng-container",10)(51,cn,2,0,"ng-container",10)(52,dn,2,0,"ng-container",10)(53,un,2,0,"ng-container",10)(54,hn,2,0,"ng-container",10)(55,pn,2,0,"ng-container",10)(56,mn,2,0,"ng-container",10)(57,vn,2,0,"ng-container",10)(58,fn,2,0,"ng-container",10)(59,gn,2,0,"ng-container",10),d.k0s()),2&e){const e=d.XpG();d.Y8G("title",d.mNQ(e.getFormatInstructionTitle())),d.R7$(),d.Y8G("ngIf","bitwardencsv"===e.format||"bitwardenjson"===e.format),d.R7$(),d.Y8G("ngIf","lastpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","keepassxcsv"===e.format),d.R7$(),d.Y8G("ngIf","aviracsv"===e.format),d.R7$(),d.Y8G("ngIf","blurcsv"===e.format),d.R7$(),d.Y8G("ngIf","safeincloudxml"===e.format),d.R7$(),d.Y8G("ngIf","padlockcsv"===e.format),d.R7$(),d.Y8G("ngIf","keepass2xml"===e.format),d.R7$(),d.Y8G("ngIf","upmcsv"===e.format),d.R7$(),d.Y8G("ngIf","saferpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","meldiumcsv"===e.format),d.R7$(),d.Y8G("ngIf","keepercsv"===e.format),d.R7$(),d.Y8G("ngIf",d.bMT(14,60,e.showChromiumInstructions$)),d.R7$(2),d.Y8G("ngIf","firefoxcsv"===e.format),d.R7$(),d.Y8G("ngIf","safaricsv"===e.format),d.R7$(),d.Y8G("ngIf","1password1pux"===e.format||"1password1pif"===e.format||"1passwordwincsv"===e.format||"1passwordmaccsv"===e.format),d.R7$(),d.Y8G("ngIf","passworddragonxml"===e.format),d.R7$(),d.Y8G("ngIf","enpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","enpassjson"===e.format),d.R7$(),d.Y8G("ngIf","pwsafexml"===e.format),d.R7$(),d.Y8G("ngIf","dashlanecsv"===e.format),d.R7$(),d.Y8G("ngIf","dashlanejson"===e.format),d.R7$(),d.Y8G("ngIf","msecurecsv"===e.format),d.R7$(),d.Y8G("ngIf","stickypasswordxml"===e.format),d.R7$(),d.Y8G("ngIf","truekeycsv"===e.format),d.R7$(),d.Y8G("ngIf","clipperzhtml"===e.format),d.R7$(),d.Y8G("ngIf","roboformcsv"===e.format),d.R7$(),d.Y8G("ngIf","passboltcsv"===e.format),d.R7$(),d.Y8G("ngIf","ascendocsv"===e.format),d.R7$(),d.Y8G("ngIf","passwordbossjson"===e.format),d.R7$(),d.Y8G("ngIf","zohovaultcsv"===e.format),d.R7$(),d.Y8G("ngIf","splashidcsv"===e.format),d.R7$(),d.Y8G("ngIf","passkeepcsv"===e.format),d.R7$(),d.Y8G("ngIf","gnomejson"===e.format),d.R7$(),d.Y8G("ngIf","passwordagentcsv"===e.format),d.R7$(),d.Y8G("ngIf","passpackcsv"===e.format),d.R7$(),d.Y8G("ngIf","passmanjson"===e.format),d.R7$(),d.Y8G("ngIf","avastcsv"===e.format),d.R7$(),d.Y8G("ngIf","avastjson"===e.format),d.R7$(),d.Y8G("ngIf","fsecurefsk"===e.format),d.R7$(),d.Y8G("ngIf","kasperskytxt"===e.format),d.R7$(),d.Y8G("ngIf","remembearcsv"===e.format),d.R7$(),d.Y8G("ngIf","passwordwallettxt"===e.format),d.R7$(),d.Y8G("ngIf","mykicsv"===e.format),d.R7$(),d.Y8G("ngIf","securesafecsv"===e.format),d.R7$(),d.Y8G("ngIf","logmeoncecsv"===e.format),d.R7$(),d.Y8G("ngIf","blackberrycsv"===e.format),d.R7$(),d.Y8G("ngIf","buttercupcsv"===e.format),d.R7$(),d.Y8G("ngIf","codebookcsv"===e.format),d.R7$(),d.Y8G("ngIf","encryptrcsv"===e.format),d.R7$(),d.Y8G("ngIf","yoticsv"===e.format),d.R7$(),d.Y8G("ngIf","psonojson"===e.format),d.R7$(),d.Y8G("ngIf","passkyjson"===e.format),d.R7$(),d.Y8G("ngIf","protonpass"===e.format),d.R7$(),d.Y8G("ngIf","passwordxpcsv"===e.format),d.R7$(),d.Y8G("ngIf","netwrixpasswordsecure"===e.format),d.R7$(),d.Y8G("ngIf","nordpasscsv"===e.format),d.R7$(),d.Y8G("ngIf","passworddepot17xml"===e.format)}}function bn(e,t){if(1&e){const e=d.RV6();d.j41(0,"import-lastpass",42),d.bIt("csvDataLoaded",function(t){Gt.eBV(e);const i=d.XpG();return Gt.Njj(i.formGroup.controls.fileContents.setValue(t))}),d.k0s()}if(2&e){const e=d.XpG();d.Y8G("formGroup",e.formGroup)}}function wn(e,t){if(1&e){const e=d.RV6();d.j41(0,"import-chrome",43),d.bIt("csvDataLoaded",function(t){Gt.eBV(e);const i=d.XpG();return Gt.Njj(i.formGroup.controls.fileContents.setValue(t))}),d.k0s()}if(2&e){const e=d.XpG();d.Y8G("formGroup",e.formGroup)("onImportFromBrowser",e.onImportFromBrowser)("onLoadProfilesFromBrowser",e.onLoadProfilesFromBrowser)("format",e.format)}}function Sn(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-form-field")(1,"bit-label"),d.EFF(2),d.nI1(3,"i18n"),d.k0s(),d.j41(4,"div",44)(5,"button",45),d.bIt("click",function(){Gt.eBV(e);const t=d.sdS(11);return Gt.Njj(t.click())}),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.EFF(8),d.nI1(9,"i18n"),d.k0s(),d.j41(10,"input",46,0),d.bIt("change",function(t){Gt.eBV(e);const i=d.XpG();return Gt.Njj(i.setSelectedFile(t))}),d.k0s()(),d.j41(12,"bit-form-field",8)(13,"bit-label"),d.EFF(14),d.nI1(15,"i18n"),d.k0s(),d.nrm(16,"textarea",47),d.k0s()}if(2&e){const e=d.XpG();d.R7$(2),d.JRh(d.bMT(3,4,"selectImportFile")),d.R7$(4),d.SpI(" ",d.bMT(7,6,"chooseFile")," "),d.R7$(2),d.SpI(" ",e.fileSelected?e.fileSelected.name:d.bMT(9,8,"noFileChosen")," "),d.R7$(6),d.JRh(d.bMT(15,10,"orCopyPasteFileContents"))}}class In{get organizationId(){return this._organizationId}set organizationId(e){return Ae.A.isNullOrEmpty(e)?(this._organizationId=void 0,void(this.organization=void 0)):(0,De.e)(e)?(this._organizationId=e,void(0,xe.F6)(this.accountService.activeAccount$).pipe((0,Ie.n)(t=>this.organizationService.organizations$(t).pipe((0,Ee.Hc)(e)))).pipe((0,ke.Q)(this.destroy$)).subscribe(e=>{this._organizationId=null==e?void 0:e.id,this.organization=e})):(this._organizationId=void 0,void(this.organization=void 0))}ngAfterViewInit(){this.bitSubmit.loading$.pipe((0,ke.Q)(this.destroy$)).subscribe(e=>{this.formLoading.emit(e)}),this.bitSubmit.disabled$.pipe((0,ke.Q)(this.destroy$)).subscribe(e=>{this.formDisabled.emit(e)})}constructor(e,t,i,n,r,s,o,a,l,c,u,h,p,m,v,f,g){this.i18nService=e,this.importService=t,this.platformUtilsService=i,this.policyService=n,this.logService=r,this.syncService=s,this.dialogService=o,this.folderService=a,this.organizationService=l,this.collectionService=c,this.formBuilder=u,this.importCollectionService=h,this.toastService=p,this.accountService=m,this.restrictedItemTypesService=v,this.destroyRef=f,this.importMetadataService=g,this.DefaultCollectionType=B.it.DefaultUserCollection,this.format=null,this.organization=void 0,this.destroy$=new ge.B,this.isCardTypeRestricted$=this.restrictedItemTypesService.restricted$.pipe((0,Ce.T)(e=>e.length>0)),this._importBlockedByPolicy=!1,this.isFromAC=!1,this.activeUserId$=this.accountService.activeAccount$.pipe((0,Ce.T)(e=>null==e?void 0:e.id)),this.formGroup=this.formBuilder.group({vaultSelector:["myVault",{nonNullable:!0,validators:[F.k0.required]}],targetSelector:[null],format:[null,[F.k0.required]],fileContents:[],file:[],lastPassType:["direct"],chromiumLoader:[ze.aH.file]}),this.formLoading=new d.bkB,this.formDisabled=new d.bkB,this.onSuccessfulImport=new d.bkB,this.importer$=new ye.t(void 0),this.showChromiumInstructions$=this.importer$.pipe((0,Ce.T)(e=>(null==e?void 0:e.instructions)===ze.wP.chromium)),this.browserImporterAvailable$=this.importer$.pipe((0,Ce.T)(e=>{var t;return(null!==(t=null==e?void 0:e.loaders)&&void 0!==t?t:[]).includes(ze.aH.chromium)})),this.showChromiumOptions$=this.formGroup.controls.chromiumLoader.valueChanges.pipe((0,Ce.T)(e=>e===ze.aH.chromium)),this.submit=()=>ei(this,void 0,void 0,function*(){yield this.asyncValidatorsFinished(),this.formGroup.invalid?this.formGroup.markAllAsTouched():yield this.performImport()})}get importBlockedByPolicy(){return this._importBlockedByPolicy}get showLastPassToggle(){return"lastpasscsv"===this.format&&(this.platformUtilsService.getClientType()===$e.sK.Desktop||this.platformUtilsService.getClientType()===$e.sK.Browser)}get showLastPassOptions(){return this.showLastPassToggle&&"direct"===this.formGroup.controls.lastPassType.value}ngOnInit(){return ei(this,void 0,void 0,function*(){yield this.importMetadataService.init(),this.setImportOptions(),this.importMetadataService.metadata$(this.formGroup.controls.format.valueChanges).pipe((0,ve.pQ)(this.destroyRef)).subscribe({next:e=>{var t,i;this.importer$.next(e);const n=(null===(t=e.loaders)||void 0===t?void 0:t.includes(ze.aH.chromium))?ze.aH.chromium:null===(i=e.loaders)||void 0===i?void 0:i[0];this.formGroup.controls.chromiumLoader.setValue(null!=n?n:ze.aH.file)},error:e=>this.logService.error("an error occurred",e)}),this.organizationId?yield this.handleOrganizationImportInit():yield this.handleImportInit(),this.formGroup.controls.format.valueChanges.pipe((0,ke.Q)(this.destroy$)).subscribe(e=>{this.format=e}),yield this.handlePolicies()})}handleOrganizationImportInit(){return ei(this,void 0,void 0,function*(){const e=yield(0,be._)((0,xe.F6)(this.accountService.activeAccount$));this.organizations$=this.organizationService.memberOrganizations$(e).pipe((0,Ce.T)(e=>e.filter(e=>e.id==this.organizationId&&(e.canAccessImport||e.canCreateNewCollections)))),this.formGroup.controls.vaultSelector.patchValue(this.organizationId),this.formGroup.controls.vaultSelector.disable(),this.collections$=Ae.A.asyncToObservable(()=>this.importCollectionService.getAllAdminCollections(this.organizationId,e).then(e=>e.sort(Ae.A.getSortFunction(this.i18nService,"name")))),this.isFromAC=!0})}handleImportInit(){return ei(this,void 0,void 0,function*(){this.folders$=this.activeUserId$.pipe((0,Ie.n)(e=>this.folderService.folderViews$(e)),(0,Ce.T)(e=>e.filter(e=>null!=e.id))),this.formGroup.controls.targetSelector.disable();const e=yield(0,be._)((0,xe.F6)(this.accountService.activeAccount$));this.organizations$=this.organizationService.memberOrganizations$(e).pipe((0,Te.v)(this.collectionService.decryptedCollections$(e)),(0,Ce.T)(([e,t])=>e.filter(e=>t.some(t=>t.organizationId===e.id&&t.manage)).sort(Ae.A.getSortFunction(this.i18nService,"name")))),(0,we.z)([this.formGroup.controls.vaultSelector.valueChanges,this.organizations$]).pipe((0,ke.Q)(this.destroy$)).subscribe(([t,i])=>{this.organizationId="myVault"!==t?t:void 0,this._importBlockedByPolicy||this.formGroup.controls.targetSelector.enable(),t&&(this.collections$=this.collectionService.decryptedCollections$(e).pipe((0,Ce.T)(e=>e.filter(e=>e.organizationId===t&&e.manage).sort(Ae.A.getSortFunction(this.i18nService,"name")))))}),this.formGroup.controls.vaultSelector.setValue("myVault")})}handlePolicies(){return ei(this,void 0,void 0,function*(){(0,we.z)([this.accountService.activeAccount$.pipe(xe.F6,(0,Ie.n)(e=>this.policyService.policyAppliesToUser$(Pe.tt.OrganizationDataOwnership,e))),this.organizations$]).pipe((0,ke.Q)(this.destroy$)).subscribe(([e,t])=>{this._importBlockedByPolicy=e,e&&0==t.length&&this.formGroup.disable(),e&&t.length>0&&this.formGroup.controls.vaultSelector.setValue(t[0].id)})})}asyncValidatorsFinished(){return ei(this,void 0,void 0,function*(){this.formGroup.pending&&(yield(0,be._)(this.formGroup.statusChanges.pipe((0,Fe.p)(e=>"PENDING"!==e))))})}performImport(){return ei(this,void 0,void 0,function*(){var e;if(!(yield this.validateImport()))return;const t=this.importService.getImporter(this.format,()=>ei(this,void 0,void 0,function*(){return yield this.getFilePassword()}),this.organizationId);if(null===t)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFormat")});const i=yield this.setImportContents();if(null!=i&&""!==i)try{const n=yield this.importService.import(t,i,this.organizationId,this.formGroup.controls.targetSelector.value,(null===(e=this.organization)||void 0===e?void 0:e.canAccessImport)&&this.isFromAC);this.dialogService.open(T,{data:n}),this.syncService.fullSync(!0),this.onSuccessfulImport.emit(this._organizationId)}catch(n){this.dialogService.open(S,{data:n}),this.logService.error(n)}else this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("selectFile")})})}getFormatInstructionTitle(){if(null==this.format)return null;const e=this.featuredImportOptions.concat(this.importOptions).filter(e=>e.id===this.format);return e.length>0?this.i18nService.t("instructionsFor",e[0].name):null}setImportOptions(){this.featuredImportOptions=[...this.importService.featuredImportOptions],this.importOptions=[...this.importService.regularImportOptions].sort((e,t)=>null==e.name&&null!=t.name?-1:null!=e.name&&null==t.name?1:null==e.name&&null==t.name?0:this.i18nService.collator?this.i18nService.collator.compare(e.name,t.name):e.name.localeCompare(t.name))}setSelectedFile(e){const t=e.target;this.fileSelected=t.files.length>0?t.files[0]:null}getFileContents(e){return"1password1pux"===this.format&&e.name.endsWith(".1pux")?this.extractZipContent(e,"export.data"):"protonpass"!==this.format||"application/zip"!==e.type&&"application/x-zip-compressed"!=e.type&&!e.name.endsWith(".zip")?new Promise((t,i)=>{const n=new FileReader;n.readAsText(e,"utf-8"),n.onload=n=>{if("lastpasscsv"===this.format&&"text/html"===e.type){const e=(new DOMParser).parseFromString(n.target.result,"text/html").querySelector("pre");return null!=e?void t(e.textContent):void i()}t(n.target.result)},n.onerror=()=>{i()}}):this.extractZipContent(e,"Proton Pass/data.json")}extractZipContent(e,t){return(new fe).loadAsync(e).then(e=>e.file(t).async("string")).then(function(e){return e},function(e){return""})}getFilePassword(){return ei(this,void 0,void 0,function*(){const e=this.dialogService.open(N,{ariaModal:!0});return yield(0,Se.s)(e.closed)})}validateImport(){return ei(this,void 0,void 0,function*(){if(this.organization){if(!(yield this.dialogService.openSimpleDialog({title:{key:"warning"},content:{key:"importWarning",placeholders:[this.organization.name]},type:"warning"})))return!1}return!this.importBlockedByPolicy||null!=this.organizationId||(this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("personalOwnershipPolicyInEffectImports")}),!1)})}setImportContents(){return ei(this,void 0,void 0,function*(){const e=document.getElementById("import_input_file"),t=null==e?void 0:e.files;let i=this.formGroup.controls.fileContents.value;if(null!=t&&t.length>0)try{const e=yield this.getFileContents(t[0]);null!=e&&(i=e)}catch(n){this.logService.error(n)}return i})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}In.ɵfac=function(e){return new(e||In)(d.rXU(H.W),d.rXU(he.Tt),d.rXU(J.y),d.rXU(K.m),d.rXU(W.K),d.rXU(Oe.H),d.rXU(u.o3),d.rXU(ae.k),d.rXU(Re.PV),d.rXU(B.YD),d.rXU(F.ok),d.rXU(he.H7,8),d.rXU(Ht.f),d.rXU(q.Di),d.rXU(le.b),d.rXU(Gt.abz),d.rXU(he.UN))},In.ɵcmp=d.VBU({type:In,selectors:[["tools-import"]],viewQuery:function(e,t){if(1&e&&d.GBs(G.L,5),2&e){let e;d.mGM(e=d.lsd())&&(t.bitSubmit=e.first)}},inputs:{organizationId:"organizationId",onLoadProfilesFromBrowser:"onLoadProfilesFromBrowser",onImportFromBrowser:"onImportFromBrowser"},outputs:{formLoading:"formLoading",formDisabled:"formDisabled",onSuccessfulImport:"onSuccessfulImport"},features:[d.Jv_(me)],decls:51,vars:48,consts:[["fileSelector",""],["type","info",3,"title",4,"ngIf"],["id","import_form_importForm",3,"formGroup","bitSubmit"],["bitTypography","h6",1,"tw-font-medium"],[3,"hidden"],["formControlName","vaultSelector"],["value","myVault","icon","bwi-user",3,"label",4,"ngIf"],["icon","bwi-business",3,"value","label",4,"ngFor","ngForOf"],["disableMargin",""],["formControlName","targetSelector"],[4,"ngIf"],[1,"@2xl:tw-w-1/2"],["formControlName","format"],["value","",3,"label"],["value","-","disabled","",1,"tw-font-medium","tw-text-muted","tw-text-xs",3,"label"],[3,"value","label",4,"ngFor","ngForOf"],[3,"formGroup"],[3,"formGroup","onImportFromBrowser","onLoadProfilesFromBrowser","format"],["type","info",3,"title"],["value","myVault","icon","bwi-user",3,"label"],["icon","bwi-business",3,"value","label"],[3,"value","label"],["icon","bwi-folder",3,"value","label",4,"ngFor","ngForOf"],["icon","bwi-folder",3,"value","label"],[3,"value","label","icon",4,"ngFor","ngForOf"],[3,"value","label","icon"],["value","-","label","--------------------------------------","disabled",""],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/export-your-data/"],["bitTypography","body1"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-lastpass/"],["formControlName","lastPassType",4,"ngIf"],["formControlName","lastPassType"],["id","import_bit-radio-button_lp-direct","value","direct",1,"tw-block"],["id","import_bit-radio-button_lp-csv","value","csv",1,"tw-block"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-chrome/"],["formControlName","chromiumLoader",3,"hidden"],["id","import_bit-radio-button_chrome-browser","value","chromium",1,"tw-block"],["id","import_bit-radio-button_chrome-file","value","file",1,"tw-block"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-firefox/"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-safari/"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://bitwarden.com/help/import-from-1password/"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer","href","https://github.com/spookylukey/gnome-keyring-import-export"],[3,"csvDataLoaded","formGroup"],[3,"csvDataLoaded","formGroup","onImportFromBrowser","onLoadProfilesFromBrowser","format"],[1,"file-selector","tw-pt-2","tw-pb-1","tw-break-words"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitInput","","type","file","id","import_input_file","formControlName","file","hidden","",1,"tw-hidden",3,"change"],["id","import_textarea_fileContents","bitInput","","formControlName","fileContents"]],template:function(e,t){1&e&&(d.DNE(0,ti,4,6,"bit-callout",1),d.nI1(1,"async"),d.j41(2,"form",2)(3,"bit-section")(4,"bit-section-header")(5,"h2",3),d.EFF(6),d.nI1(7,"i18n"),d.k0s()(),d.j41(8,"bit-card")(9,"bit-form-field",4)(10,"bit-label"),d.EFF(11),d.nI1(12,"i18n"),d.k0s(),d.j41(13,"bit-select",5),d.DNE(14,ii,2,3,"bit-option",6)(15,ni,1,2,"bit-option",7),d.nI1(16,"async"),d.k0s()(),d.j41(17,"bit-form-field",8)(18,"bit-label"),d.EFF(19),d.nI1(20,"i18n"),d.nI1(21,"i18n"),d.k0s(),d.j41(22,"bit-select",9),d.DNE(23,si,5,8,"ng-container",10)(24,ai,5,8,"ng-container",10),d.k0s(),d.j41(25,"bit-hint"),d.EFF(26),d.nI1(27,"i18n"),d.nI1(28,"i18n"),d.k0s()()()(),d.j41(29,"bit-section")(30,"bit-section-header")(31,"h2",3),d.EFF(32),d.nI1(33,"i18n"),d.k0s()(),d.j41(34,"bit-card")(35,"bit-form-field",11)(36,"bit-label"),d.EFF(37),d.nI1(38,"i18n"),d.k0s(),d.j41(39,"bit-select",12),d.nrm(40,"bit-option",13),d.nI1(41,"i18n"),d.nrm(42,"bit-option",14),d.nI1(43,"i18n"),d.DNE(44,li,1,2,"bit-option",15)(45,di,3,1,"ng-container",10),d.k0s()(),d.DNE(46,yn,60,62,"bit-callout",1),d.nVh(47,bn,1,1,"import-lastpass",16),d.nI1(48,"async"),d.vZN(49,wn,1,4,"import-chrome",17)(50,Sn,17,12),d.k0s()()()),2&e&&(d.Y8G("ngIf",d.bMT(1,22,t.isCardTypeRestricted$)),d.R7$(2),d.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),d.R7$(4),d.JRh(d.bMT(7,24,"destination")),d.R7$(3),d.Y8G("hidden",t.isFromAC),d.R7$(2),d.JRh(d.bMT(12,26,"vault")),d.R7$(3),d.Y8G("ngIf",!t.importBlockedByPolicy),d.R7$(),d.Y8G("ngForOf",d.bMT(16,28,t.organizations$)),d.R7$(4),d.JRh(t.organizationId?d.bMT(20,30,"collection"):d.bMT(21,32,"folder")),d.R7$(4),d.Y8G("ngIf",!t.organizationId),d.R7$(),d.Y8G("ngIf",t.organizationId),d.R7$(2),d.JRh(t.organizationId?d.bMT(27,34,"importTargetHintCollection"):d.bMT(28,36,"importTargetHintFolder")),d.R7$(6),d.JRh(d.bMT(33,38,"data")),d.R7$(5),d.JRh(d.bMT(38,40,"fileFormat")),d.R7$(3),d.Y8G("label",d.VkB("-- ",d.bMT(41,42,"select")," --")),d.R7$(2),d.Y8G("label",d.mNQ(d.bMT(43,44,"commonImportFormats"))),d.R7$(2),d.Y8G("ngForOf",t.featuredImportOptions),d.R7$(),d.Y8G("ngIf",t.importOptions&&t.importOptions.length),d.R7$(),d.Y8G("ngIf",t.format),d.R7$(),d.vxM(t.showLastPassOptions?47:d.bMT(48,46,t.showChromiumOptions$)?49:50))},dependencies:[n.MD,n.Sq,n.bT,r.p,R.L,A.j,Dt.I,D.J,O.h,P.C,G.L,c.t,g.Q,x.Q,Me.p,Ye.w,He.P,Ue.j,Wt.G,F.X1,F.qT,F.me,F.BC,F.cb,F.j4,F.JD,Ze,Yt,Ge.K,Jt.d,Zt.Y,je.i,Ne.U,Ve.n,Be.V,Qt.L,n.Jj,y.$],encapsulation:2})},43348:(e,t,i)=>{"use strict";i.d(t,{F:()=>n});class n{}},43600:(e,t,i)=>{"use strict";i.d(t,{q:()=>Yt});var n=i(66046),r=i(44500),s=i(14803),o=i(88565),a=i(14928),l=i(30675),c=i(81285),d=i(43978),u=i(71804),h=i(16888),p=i(3633),m=i(37380),v=i(88083),f=i(83516),g=i(98403),y=i(72932),b=i(62963),w=i(77468),S=i(81525),I=i(81573),k=i(29029),C=i(75583),T=i(36801),F=i(33812),R=i(74208),P=i(50700),x=i(7730),$=i(68016),E=i(56898),A=i(58806);function D(e,t){if(1&e&&(F.qex(0),F.j41(1,"p",7),F.EFF(2),F.nI1(3,"i18n"),F.k0s(),F.j41(4,"code",8),F.EFF(5),F.k0s(),F.bVm()),2&e){const e=F.XpG(2);F.R7$(2),F.SpI("",F.bMT(3,2,"twoFactorRecoveryYourCode"),":"),F.R7$(3),F.JRh(e.code)}}function O(e,t){1&e&&(F.qex(0),F.EFF(1),F.nI1(2,"i18n"),F.bVm()),2&e&&(F.R7$(),F.SpI(" ",F.bMT(2,1,"twoFactorRecoveryNoCode")," "))}function M(e,t){if(1&e&&(F.qex(0,5),F.DNE(1,D,6,4,"ng-container",6)(2,O,3,3,"ng-container",6),F.bVm()),2&e){const e=F.XpG();F.R7$(),F.Y8G("ngIf",e.code),F.R7$(),F.Y8G("ngIf",!e.code)}}function U(e,t){if(1&e){const e=F.RV6();F.j41(0,"button",9),F.bIt("click",function(){R.eBV(e);const t=F.XpG();return R.Njj(t.print())}),F.EFF(1),F.nI1(2,"i18n"),F.k0s()}2&e&&(F.R7$(),F.SpI(" ",F.bMT(2,1,"printCode")," "))}class G{constructor(e,t){this.data=e,this.i18nService=t,this.type=-1,this.code="",this.authed=!1,this.twoFactorProviderType=u.R,this.auth(e.response)}auth(e){this.authed=!0,this.processResponse(e.response)}print(){const e=window.open();e&&(e.document.write('<div style="font-size: 18px; text-align: center;"><p>'+this.i18nService.t("twoFactorRecoveryYourCode")+":</p><code style=\"font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\">"+this.code+'</code></div><p style="text-align: center;">'+new Date+"</p>"),e.onafterprint=()=>e.close(),e.print())}formatString(e){return null==e?"":e.replace(/(.{4})/g,"$1 ").trim().toUpperCase()}processResponse(e){this.code=this.formatString(e.code)}static open(e,t){return e.open(G,t)}}G.ɵfac=function(e){return new(e||G)(F.rXU(S.Qs),F.rXU(P.W))},G.ɵcmp=F.VBU({type:G,selectors:[["app-two-factor-recovery"]],decls:9,vars:11,consts:[["dialogSize","default",3,"title","subtitle"],["bitDialogContent","",4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"click",4,"ngIf"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""],["bitDialogContent",""],[4,"ngIf"],["bitTypography","body1",1,"tw-text-center"],[1,"tw-text-lg","tw-w-full","tw-flex","tw-justify-center"],["bitButton","","type","button","buttonType","primary",3,"click"]],template:function(e,t){1&e&&(F.j41(0,"bit-dialog",0),F.nI1(1,"i18n"),F.nI1(2,"i18n"),F.DNE(3,M,3,2,"ng-container",1),F.qex(4,2),F.DNE(5,U,3,3,"button",3),F.j41(6,"button",4),F.EFF(7),F.nI1(8,"i18n"),F.k0s(),F.bVm(),F.k0s()),2&e&&(F.Y8G("title",F.bMT(1,5,"twoStepLogin"))("subtitle",F.bMT(2,7,"recoveryCodeTitle")),F.R7$(3),F.Y8G("ngIf",t.authed),F.R7$(2),F.Y8G("ngIf",t.code),F.R7$(2),F.SpI(" ",F.bMT(8,9,"close")," "))},dependencies:[w.MD,w.bT,I.P,x.I,$.m,k.t,E.Q,C.E,A.r,T.$Z],encapsulation:2});var j=i(51757),N=i(72245),V=i(3204),B=i(58625);class z extends h.G{}var L=i(7248);class K extends L.V{}var q=i(56962),_=i(78781),X=i(26411),Y=i(89479),H=i(26477),W=i(80351),J=i(55807),Z=i(37579),Q=i(89294),ee=i(21274),te=i(69855),ie=i(62166),ne=i(37115),re=i(35500),se=i(1601),oe=i(86226),ae=i(97553),le=i(43759),ce=i(59032),de=i(44432),ue=i(26657),he=i(45154),pe=i(54471),me=i(57083),ve=i(88016),fe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ge(e,t){1&e&&(F.qex(0),F.j41(1,"bit-callout",13),F.nI1(2,"i18n"),F.j41(3,"p",14),F.EFF(4),F.nI1(5,"i18n"),F.k0s(),F.EFF(6),F.nI1(7,"i18n"),F.k0s(),F.j41(8,"p",14),F.EFF(9),F.nI1(10,"i18n"),F.k0s(),F.bVm()),2&e&&(F.R7$(),F.Y8G("title",F.mNQ(F.bMT(2,5,"enabled"))),F.R7$(3),F.JRh(F.bMT(5,7,"twoStepLoginProviderEnabled")),F.R7$(2),F.SpI(" ",F.bMT(7,9,"twoStepAuthenticatorReaddDesc")," "),F.R7$(3),F.JRh(F.bMT(10,11,"twoStepAuthenticatorNeedApp")))}function ye(e,t){if(1&e){const e=F.RV6();F.qex(0),F.j41(1,"p"),F.EFF(2),F.nI1(3,"i18n"),F.j41(4,"a",15),F.bIt("click",function(){R.eBV(e);const t=F.XpG(2);return R.Njj(t.launchExternalUrl("https://getaegis.app"))}),F.EFF(5,"Aegis"),F.k0s(),F.EFF(6),F.nI1(7,"i18n"),F.j41(8,"a",15),F.bIt("click",function(){R.eBV(e);const t=F.XpG(2);return R.Njj(t.launchExternalUrl("https://2fas.com"))}),F.EFF(9,"2FAS"),F.k0s(),F.EFF(10),F.nI1(11,"i18n"),F.j41(12,"a",15),F.bIt("click",function(){R.eBV(e);const t=F.XpG(2);return R.Njj(t.launchBitwardenUrl("https://bitwarden.com/products/authenticator/"))}),F.EFF(13,"Bitwarden Authenticator"),F.k0s(),F.EFF(14),F.nI1(15,"i18n"),F.k0s(),F.j41(16,"p",16)(17,"a",17),F.nrm(18,"img",18),F.k0s(),F.j41(19,"a",19),F.nrm(20,"img",20),F.k0s()(),F.EFF(21),F.nI1(22,"i18n"),F.bVm()}2&e&&(F.R7$(2),F.SpI(" ",F.bMT(3,5,"twoStepAuthenticatorInstructionPrefix")," "),F.R7$(4),F.SpI(" ",F.bMT(7,7,"twoStepAuthenticatorInstructionInfix1")," "),F.R7$(4),F.SpI(" ",F.bMT(11,9,"twoStepAuthenticatorInstructionInfix2")," "),F.R7$(4),F.SpI(" ",F.bMT(15,11,"twoStepAuthenticatorInstructionSuffix")," "),F.R7$(7),F.SpI(" ",F.bMT(22,13,"twoStepAuthenticatorScanCodeV2")," "))}function be(e,t){1&e&&F.nrm(0,"hr")}function we(e,t){1&e&&(F.qex(0,21),F.nrm(1,"i",22),F.j41(2,"p"),F.EFF(3),F.nI1(4,"i18n"),F.k0s(),F.bVm()),2&e&&(F.R7$(3),F.SpI(" ",F.bMT(4,1,"twoStepAuthenticatorQRCanvasError")," "))}function Se(e,t){1&e&&F.nrm(0,"canvas",23)}function Ie(e,t){1&e&&(F.j41(0,"bit-form-field",24)(1,"bit-label"),F.EFF(2),F.nI1(3,"i18n"),F.k0s(),F.nrm(4,"input",25),F.k0s()),2&e&&(F.Y8G("disableMargin",!0),F.R7$(2),F.JRh(F.bMT(3,2,"twoStepAuthenticatorEnterCodeV2")))}function ke(e,t){if(1&e){const e=F.RV6();F.j41(0,"form",1)(1,"bit-dialog",2),F.nI1(2,"i18n"),F.nI1(3,"i18n"),F.qex(4,3),F.DNE(5,ge,11,13,"ng-container",4)(6,ye,23,15,"ng-container",4)(7,be,1,0,"hr",4),F.j41(8,"p",5),F.DNE(9,we,5,3,"ng-container",6)(10,Se,1,0,"canvas",7),F.nrm(11,"br"),F.j41(12,"code",8),F.nI1(13,"i18n"),F.EFF(14),F.k0s()(),F.DNE(15,Ie,5,4,"bit-form-field",9),F.bVm(),F.qex(16,10),F.j41(17,"button",11),F.bIt("click",function(){R.eBV(e);const t=F.XpG();return R.Njj(t.validateTokenControl())}),F.EFF(18),F.nI1(19,"i18n"),F.k0s(),F.j41(20,"button",12),F.EFF(21),F.nI1(22,"i18n"),F.k0s(),F.bVm(),F.k0s()()}if(2&e){const e=F.XpG();F.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),F.R7$(),F.Y8G("title",F.bMT(2,15,"twoStepLogin"))("subtitle",F.bMT(3,17,"authenticatorAppTitle")),F.R7$(4),F.Y8G("ngIf",e.enabled),F.R7$(),F.Y8G("ngIf",!e.enabled),F.R7$(),F.Y8G("ngIf",e.enabled),F.R7$(2),F.Y8G("ngIf",e.qrScriptError),F.R7$(),F.Y8G("ngIf",!e.qrScriptError),F.R7$(2),F.Y8G("appA11yTitle",F.mNQ(F.bMT(13,19,"key"))),F.R7$(2),F.JRh(e.key),F.R7$(),F.Y8G("ngIf",!e.enabled),F.R7$(3),F.SpI(" ",F.bMT(19,21,e.enabled?"disable":"enable")," "),F.R7$(3),F.SpI(" ",F.bMT(22,23,"close")," ")}}class Ce extends Q.g{constructor(e,t,i,n,r,s,o,a,l,c,d,h){super(i,n,o,a,r,c,h),this.data=e,this.dialogRef=t,this.formBuilder=s,this.accountService=l,this.configService=d,this.toastService=h,this.onChangeStatus=new F.bkB,this.type=u.R.Authenticator,this.componentName="app-two-factor-authenticator",this.qrScriptError=!1,this.formGroup=this.formBuilder.group({token:new j.MJ(null,[j.k0.required,j.k0.minLength(6)])}),this.submit=()=>fe(this,void 0,void 0,function*(){this.formGroup.invalid&&!this.enabled||(this.enabled?(yield this.disableMethod(),this.dialogRef.close(this.enabled)):yield this.enable(),this.onChangeStatus.emit(this.enabled))}),this.qrScript=window.document.createElement("script"),this.qrScript.src="scripts/qrious.min.js",this.qrScript.async=!0}ngOnInit(){return fe(this,void 0,void 0,function*(){window.document.body.appendChild(this.qrScript),yield this.auth(this.data)})}ngOnDestroy(){window.document.body.removeChild(this.qrScript)}validateTokenControl(){this.formGroup.controls.token.markAsTouched()}auth(e){const t=Object.create(null,{auth:{get:()=>super.auth}});return fe(this,void 0,void 0,function*(){return t.auth.call(this,e),this.processResponse(e.response)})}enable(){return fe(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(K);e.token=this.formGroup.value.token,e.key=this.key,e.userVerificationToken=this.userVerificationToken;const t=yield this.twoFactorService.putTwoFactorAuthenticator(e);yield this.processResponse(t),this.onUpdated.emit(!0)})}disableMethod(){return fe(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"disable"},content:{key:"twoStepDisableDesc"},type:"warning"})))return;const e=yield this.buildRequestModel(z);e.type=this.type,e.key=this.key,e.userVerificationToken=this.userVerificationToken,yield this.twoFactorService.deleteTwoFactorAuthenticator(e),this.enabled=!1,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("twoStepDisabled")}),this.onUpdated.emit(!1)})}processResponse(e){return fe(this,void 0,void 0,function*(){this.formGroup.get("token").setValue(null),this.enabled=e.enabled,this.key=e.key,this.userVerificationToken=e.userVerificationToken,yield this.waitForQRiousToLoadOrError().catch(e=>{this.logService.error(e),this.qrScriptError=!0}),yield this.createQRCode()})}waitForQRiousToLoadOrError(){return fe(this,void 0,void 0,function*(){return void 0!==window.QRious||this.qrScriptError?Promise.resolve():new Promise((e,t)=>{this.qrScript.onload=()=>e(),this.qrScript.onerror=()=>t(new Error(this.i18nService.t("twoStepAuthenticatorQRCanvasError")))})})}createQRCode(){return fe(this,void 0,void 0,function*(){if(this.qrScriptError)return;const e=yield(0,N._)(this.accountService.activeAccount$.pipe((0,V.T)(e=>null==e?void 0:e.email)));new window.QRious({element:document.getElementById("qr"),value:"otpauth://totp/Vaultwarden:"+_.A.encodeRFC3986URIComponent(e)+"?secret="+encodeURIComponent(this.key)+"&issuer=Vaultwarden",size:160})})}static open(e,t){return e.open(Ce,t)}launchExternalUrl(e){return fe(this,void 0,void 0,function*(){const t=new URL(e).hostname;(yield this.dialogService.openSimpleDialog({title:this.i18nService.t("continueToExternalUrlTitle",t),content:this.i18nService.t("continueToExternalUrlDesc"),type:"info",acceptButtonText:{key:"continue"}}))&&this.platformUtilsService.launchUri(e)})}launchBitwardenUrl(e){return fe(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:this.i18nService.t("twoStepContinueToBitwardenUrlTitle"),content:this.i18nService.t("twoStepContinueToBitwardenUrlDesc"),type:"info",acceptButtonText:{key:"continue"}}))&&this.platformUtilsService.launchUri(e)})}}Ce.ɵfac=function(e){return new(e||Ce)(F.rXU(S.Qs),F.rXU(ee.ce),F.rXU(m.fz),F.rXU(P.W),F.rXU(ie.i),F.rXU(j.ok),F.rXU(ne.y),F.rXU(q.K),F.rXU(re.Di),F.rXU(ee.o3),F.rXU(se.w),F.rXU(te.f))},Ce.ɵcmp=F.VBU({type:Ce,selectors:[["app-two-factor-setup-authenticator"]],outputs:{onChangeStatus:"onChangeStatus"},features:[F.Vt3],decls:1,vars:1,consts:[[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title","subtitle"],["bitDialogContent",""],[4,"ngIf"],[1,"tw-text-center","tw-mb-0"],["class","tw-mt-2",4,"ngIf"],["id","qr",4,"ngIf"],[3,"appA11yTitle"],[3,"disableMargin",4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary",3,"click"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi-check-circle",3,"title"],["bitTypography","body1"],["bitLink","","target","_blank","rel","noreferrer",3,"click"],[1,"tw-text-center"],["href","https://apps.apple.com/ca/app/bitwarden-authenticator/id6497335175","target","_blank"],["src","../../../images/download_apple_appstore.svg","alt","Download on App Store","max-width","120","height","40"],["href","https://play.google.com/store/apps/details?id=com.bitwarden.authenticator","target","_blank"],["src","../../../images/download_google_playstore.svg","alt","Get it on Google Play","max-width","120","height","40",2,"margin-left","10px"],[1,"tw-mt-2"],["aria-hidden","true",1,"bwi","bwi-error","tw-text-3xl","tw-text-danger"],["id","qr"],[3,"disableMargin"],["bitInput","","type","text","formControlName","token","appInputVerbatim",""]],template:function(e,t){1&e&&F.DNE(0,ke,23,25,"form",0),2&e&&F.Y8G("ngIf",t.authed)},dependencies:[w.MD,w.bT,j.X1,j.qT,j.me,j.BC,j.cb,j.j4,j.JD,I.P,x.I,$.m,X.L,oe.j,ae.J,le.h,Y.x,H.V,ce.L,C.E,A.r,W.j,de.G,k.t,E.Q,J.o,Z.C,ue.$,he.L,B.p,pe.C,me.q,ve.$],encapsulation:2});var Te=i(33818),Fe=i(74199);class Re extends L.V{}var Pe=i(3892),xe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function $e(e,t){if(1&e&&(F.qex(0),F.j41(1,"bit-callout",8),F.nI1(2,"i18n"),F.EFF(3),F.nI1(4,"i18n"),F.k0s(),F.j41(5,"strong"),F.EFF(6),F.nI1(7,"i18n"),F.k0s(),F.EFF(8),F.bVm()),2&e){const e=F.XpG(2);F.R7$(),F.Y8G("title",F.mNQ(F.bMT(2,5,"enabled"))),F.R7$(2),F.SpI(" ",F.bMT(4,7,"twoStepLoginProviderEnabled")," "),F.R7$(3),F.SpI("",F.bMT(7,9,"email"),":"),F.R7$(2),F.SpI(" ",e.email," ")}}function Ee(e,t){1&e&&(F.j41(0,"span",17),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e&&(F.R7$(),F.SpI(" ",F.bMT(2,1,"emailSent")," "))}function Ae(e,t){if(1&e&&(F.qex(0),F.j41(1,"p",9)(2,"span",10),F.EFF(3),F.nI1(4,"i18n"),F.k0s(),F.nrm(5,"img",11),F.k0s(),F.j41(6,"bit-form-field")(7,"bit-label"),F.EFF(8),F.nI1(9,"i18n"),F.k0s(),F.nrm(10,"input",12),F.k0s(),F.j41(11,"div",13)(12,"button",14),F.EFF(13),F.nI1(14,"i18n"),F.k0s(),F.DNE(15,Ee,3,3,"span",15),F.k0s(),F.j41(16,"bit-form-field")(17,"bit-label"),F.EFF(18),F.nI1(19,"i18n"),F.k0s(),F.nrm(20,"input",16),F.k0s(),F.bVm()),2&e){const e=F.XpG(2);F.R7$(3),F.JRh(F.bMT(4,6,"twoFactorEmailDesc")),F.R7$(5),F.SpI("1. ",F.bMT(9,8,"twoFactorEmailEnterEmail")),F.R7$(4),F.Y8G("bitAction",e.sendEmail),F.R7$(),F.SpI(" ",F.bMT(14,10,"sendEmail")," "),F.R7$(2),F.Y8G("ngIf",e.sentEmail),F.R7$(3),F.SpI("2. ",F.bMT(19,12,"twoFactorEmailEnterCode"))}}function De(e,t){1&e&&(F.j41(0,"span"),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e&&(F.R7$(),F.JRh(F.bMT(2,1,"enable")))}function Oe(e,t){1&e&&(F.j41(0,"span"),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e&&(F.R7$(),F.JRh(F.bMT(2,1,"disable")))}function Me(e,t){if(1&e&&(F.j41(0,"form",1)(1,"bit-dialog",2),F.nI1(2,"i18n"),F.nI1(3,"i18n"),F.qex(4,3),F.DNE(5,$e,9,11,"ng-container",4)(6,Ae,21,14,"ng-container",4),F.bVm(),F.qex(7,5),F.j41(8,"button",6),F.DNE(9,De,3,3,"span",4)(10,Oe,3,3,"span",4),F.k0s(),F.j41(11,"button",7),F.EFF(12),F.nI1(13,"i18n"),F.k0s(),F.bVm(),F.k0s()()),2&e){const e=F.XpG();F.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),F.R7$(),F.Y8G("title",F.bMT(2,9,"twoStepLogin"))("subtitle",F.bMT(3,11,"emailTitle")),F.R7$(4),F.Y8G("ngIf",e.enabled),F.R7$(),F.Y8G("ngIf",!e.enabled),F.R7$(3),F.Y8G("ngIf",!e.enabled),F.R7$(),F.Y8G("ngIf",e.enabled),F.R7$(2),F.SpI(" ",F.bMT(13,13,"close")," ")}}class Ue extends Q.g{constructor(e,t,i,n,r,s,o,a,l,c,d){super(t,i,n,r,s,a,d),this.data=e,this.accountService=o,this.formBuilder=l,this.dialogRef=c,this.toastService=d,this.onChangeStatus=new F.bkB,this.type=u.R.Email,this.sentEmail="",this.componentName="app-two-factor-email",this.formGroup=this.formBuilder.group({token:["",[j.k0.required]],email:["",[j.k0.email,j.k0.required]]}),this.submit=()=>xe(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.enabled)yield this.disableEmail(),this.onChangeStatus.emit(!1);else{if(this.formGroup.invalid)return;yield this.enable(),this.onChangeStatus.emit(!0)}}),this.sendEmail=()=>xe(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(Fe.v);e.email=this.email,this.emailPromise=this.twoFactorService.postTwoFactorEmailSetup(e),yield this.emailPromise,this.sentEmail=this.email}),this.onClose=()=>{this.dialogRef.close(this.enabled)}}get token(){var e;return(null===(e=this.formGroup.get("token"))||void 0===e?void 0:e.value)||""}set token(e){var t;null===(t=this.formGroup.get("token"))||void 0===t||t.setValue(e||"")}get email(){var e;return(null===(e=this.formGroup.get("email"))||void 0===e?void 0:e.value)||""}set email(e){var t;null===(t=this.formGroup.get("email"))||void 0===t||t.setValue(e||"")}ngOnInit(){return xe(this,void 0,void 0,function*(){yield this.auth(this.data)})}auth(e){return super.auth(e),this.processResponse(e.response)}disableEmail(){return super.disableMethod()}enable(){return xe(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(Re);e.email=this.email,e.token=this.token;const t=yield this.twoFactorService.putTwoFactorEmail(e);yield this.processResponse(t),this.onUpdated.emit(!0)})}processResponse(e){return xe(this,void 0,void 0,function*(){this.token=null,this.email=e.email,this.enabled=e.enabled,this.enabled||null!=this.email&&""!==this.email||(this.email=yield(0,N._)(this.accountService.activeAccount$.pipe((0,V.T)(e=>null==e?void 0:e.email))))})}static open(e,t){return e.open(Ue,t)}}Ue.ɵfac=function(e){return new(e||Ue)(F.rXU(S.Qs),F.rXU(m.fz),F.rXU(P.W),F.rXU(ne.y),F.rXU(q.K),F.rXU(ie.i),F.rXU(re.Di),F.rXU(ee.o3),F.rXU(j.ok),F.rXU(ee.ce),F.rXU(te.f))},Ue.ɵcmp=F.VBU({type:Ue,selectors:[["app-two-factor-setup-email"]],outputs:{onChangeStatus:"onChangeStatus"},features:[F.Vt3],decls:1,vars:1,consts:[[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],[3,"title","subtitle"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi-check-circle",3,"title"],[1,"tw-flex"],[1,"tw-mr-3"],["alt","Email logo",1,"tw-float-right","tw-ml-auto","mfaType1"],["bitInput","","type","text","formControlName","email","inputmode","email","appInputVerbatim","false"],[1,"tw-mb-3","tw-flex","tw-items-center"],["bitButton","","type","button","buttonType","primary",3,"bitAction"],["class","tw-text-success tw-ml-3",4,"ngIf"],["bitInput","","type","text","formControlName","token","appInputVerbatim",""],[1,"tw-text-success","tw-ml-3"]],template:function(e,t){1&e&&F.DNE(0,Me,14,15,"form",0),2&e&&F.Y8G("ngIf",t.authed)},dependencies:[Z.C,Pe.p,ue.$,he.L,k.t,E.Q,W.j,de.G,w.MD,w.bT,I.P,x.I,$.m,X.L,oe.j,ae.J,le.h,J.o,Y.x,j.X1,j.qT,j.me,j.BC,j.cb,j.j4,j.JD,C.E,T.$Z],encapsulation:2});class Ge extends L.V{}class je extends L.V{}var Ne=i(5771),Ve=i(93103),Be=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ze(e,t){1&e&&(F.j41(0,"bit-callout",20),F.nI1(1,"i18n"),F.EFF(2),F.nI1(3,"i18n"),F.k0s()),2&e&&(F.Y8G("title",F.mNQ(F.bMT(1,3,"enabled"))),F.R7$(2),F.SpI(" ",F.bMT(3,5,"twoStepLoginProviderEnabled")," "))}function Le(e,t){if(1&e&&(F.j41(0,"span",24),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e){const e=F.XpG().index;F.R7$(),F.SpI(" ",F.i5U(2,1,"webAuthnkeyX",(e+1).toString())," ")}}function Ke(e,t){if(1&e&&(F.j41(0,"span",24),F.EFF(1),F.k0s()),2&e){const e=F.XpG().$implicit;F.R7$(),F.SpI(" ",e.name," ")}}function qe(e,t){1&e&&(F.qex(0),F.j41(1,"span"),F.EFF(2),F.nI1(3,"i18n"),F.k0s(),F.bVm()),2&e&&(F.R7$(2),F.JRh(F.bMT(3,1,"webAuthnMigrated")))}function _e(e,t){if(1&e&&(F.qex(0),F.DNE(1,qe,4,3,"ng-container",15),F.bVm()),2&e){const e=F.XpG().$implicit;F.R7$(),F.Y8G("ngIf",e.migrated)}}function Xe(e,t){1&e&&(F.nrm(0,"i",27),F.nI1(1,"i18n")),2&e&&F.Y8G("title",F.mNQ(F.bMT(1,2,"loading")))}function Ye(e,t){if(1&e){const e=F.RV6();F.qex(0),F.DNE(1,Xe,2,4,"i",25),F.EFF(2," - "),F.j41(3,"a",26),F.bIt("click",function(){R.eBV(e);const t=F.XpG().$implicit,i=F.XpG(2);return R.Njj(i.remove(t))}),F.EFF(4),F.nI1(5,"i18n"),F.k0s(),F.bVm()}if(2&e){F.XpG();const e=F.sdS(1);F.R7$(),F.Y8G("ngIf",e.loading),F.R7$(3),F.JRh(F.bMT(5,2,"remove"))}}function He(e,t){if(1&e&&(F.j41(0,"li",21,1),F.nrm(2,"i",22),F.DNE(3,Le,3,4,"span",23)(4,Ke,2,1,"span",23)(5,_e,2,1,"ng-container",15)(6,Ye,6,4,"ng-container",15),F.k0s()),2&e){const e=t.$implicit,i=F.sdS(1),n=F.XpG(2);F.Y8G("appApiAction",e.removePromise),F.R7$(3),F.Y8G("ngIf",!e.configured||!e.name),F.R7$(),F.Y8G("ngIf",e.configured&&e.name),F.R7$(),F.Y8G("ngIf",e.configured&&!i.loading),F.R7$(),F.Y8G("ngIf",n.keysConfiguredCount>1&&e.configured)}}function We(e,t){1&e&&(F.qex(0),F.nrm(1,"i",28),F.bVm())}function Je(e,t){1&e&&(F.qex(0),F.nrm(1,"i",28),F.EFF(2),F.nI1(3,"i18n"),F.bVm()),2&e&&(F.R7$(2),F.SpI(" ",F.bMT(3,1,"twoFactorU2fWaiting"),"... "))}function Ze(e,t){1&e&&(F.qex(0),F.nrm(1,"i",29),F.EFF(2),F.nI1(3,"i18n"),F.bVm()),2&e&&(F.R7$(2),F.SpI(" ",F.bMT(3,1,"twoFactorU2fClickSave")," "))}function Qe(e,t){1&e&&(F.qex(0),F.nrm(1,"i",30),F.EFF(2),F.nI1(3,"i18n"),F.bVm()),2&e&&(F.R7$(2),F.SpI(" ",F.bMT(3,1,"twoFactorU2fProblemReadingTryAgain")," "))}function et(e,t){if(1&e&&(F.qex(0),F.DNE(1,Je,4,3,"ng-container",15)(2,Ze,4,3,"ng-container",15)(3,Qe,4,3,"ng-container",15),F.bVm()),2&e){const e=F.XpG(2);F.R7$(),F.Y8G("ngIf",e.webAuthnListening),F.R7$(),F.Y8G("ngIf",e.webAuthnResponse),F.R7$(),F.Y8G("ngIf",e.webAuthnError)}}function tt(e,t){if(1&e&&(F.j41(0,"button",31),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e){const e=F.XpG(2);F.Y8G("bitAction",e.disable),F.R7$(),F.SpI(" ",F.bMT(2,2,"disableAllKeys")," ")}}function it(e,t){if(1&e&&(F.j41(0,"form",3)(1,"bit-dialog",4),F.nI1(2,"i18n"),F.nI1(3,"i18n"),F.qex(4,5),F.DNE(5,ze,4,7,"bit-callout",6),F.nrm(6,"img",7),F.j41(7,"ul",8),F.DNE(8,He,7,5,"li",9),F.k0s(),F.nrm(9,"hr"),F.j41(10,"p",10),F.EFF(11),F.nI1(12,"i18n"),F.k0s(),F.j41(13,"ol",10)(14,"li"),F.EFF(15),F.nI1(16,"i18n"),F.k0s(),F.j41(17,"li"),F.EFF(18),F.nI1(19,"i18n"),F.k0s(),F.j41(20,"li"),F.EFF(21),F.nI1(22,"i18n"),F.k0s(),F.j41(23,"li"),F.EFF(24),F.nI1(25,"i18n"),F.k0s()(),F.j41(26,"div",11)(27,"bit-form-field",12)(28,"bit-label"),F.EFF(29),F.nI1(30,"i18n"),F.k0s(),F.nrm(31,"input",13),F.k0s()(),F.j41(32,"button",14,0),F.EFF(34),F.nI1(35,"i18n"),F.k0s(),F.DNE(36,We,2,0,"ng-container",15)(37,et,4,3,"ng-container",15),F.bVm(),F.qex(38,16),F.j41(39,"button",17),F.EFF(40),F.nI1(41,"i18n"),F.k0s(),F.DNE(42,tt,3,4,"button",18),F.j41(43,"button",19),F.EFF(44),F.nI1(45,"i18n"),F.k0s(),F.bVm(),F.k0s()()),2&e){const e=F.sdS(33),t=F.XpG();F.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),F.R7$(),F.Y8G("title",F.bMT(2,21,"twoStepLogin"))("subtitle",F.bMT(3,23,"webAuthnTitle")),F.R7$(4),F.Y8G("ngIf",t.enabled),F.R7$(3),F.Y8G("ngForOf",t.keys),F.R7$(3),F.SpI("",F.bMT(12,25,"twoFactorWebAuthnAdd"),":"),F.R7$(4),F.JRh(F.bMT(16,27,"twoFactorU2fGiveName")),F.R7$(3),F.JRh(F.bMT(19,29,"twoFactorU2fPlugInReadKey")),F.R7$(3),F.JRh(F.bMT(22,31,"twoFactorU2fTouchButton")),F.R7$(3),F.JRh(F.bMT(25,33,"twoFactorU2fSaveForm")),F.R7$(5),F.JRh(F.bMT(30,35,"name")),F.R7$(3),F.Y8G("bitAction",t.readKey)("disabled",e.loading()||t.webAuthnListening||!t.keyIdAvailable),F.R7$(2),F.SpI(" ",F.bMT(35,37,"readKey")," "),F.R7$(2),F.Y8G("ngIf",e.loading()),F.R7$(),F.Y8G("ngIf",!e.loading()),F.R7$(2),F.Y8G("disabled",!t.webAuthnResponse),F.R7$(),F.SpI(" ",F.bMT(41,39,"save")," "),F.R7$(2),F.Y8G("ngIf",t.enabled),F.R7$(2),F.SpI(" ",F.bMT(45,41,"close")," ")}}class nt extends Q.g{constructor(e,t,i,n,r,s,o,a,l,c){super(i,n,r,o,a,l,c),this.data=e,this.dialogRef=t,this.ngZone=s,this.type=u.R.WebAuthn,this.name="",this.keys=[],this.keyIdAvailable=null,this.keysConfiguredCount=0,this.webAuthnError=!1,this.webAuthnListening=!1,this.webAuthnResponse=null,this.componentName="app-two-factor-webauthn",this.submit=()=>Be(this,void 0,void 0,function*(){return null==this.webAuthnResponse||null==this.keyIdAvailable?Promise.reject():this.enable()}),this.disable=()=>Be(this,void 0,void 0,function*(){yield this.disableMethod(),this.enabled||(this.onUpdated.emit(this.enabled),this.dialogRef.close())}),this.readKey=()=>Be(this,void 0,void 0,function*(){if(null==this.keyIdAvailable)return;const e=yield this.buildRequestModel(L.V);this.challengePromise=this.twoFactorService.getTwoFactorWebAuthnChallenge(e);const t=yield this.challengePromise;this.readDevice(t)}),this.formGroup=new j.gE({name:new j.MJ({value:"",disabled:!1})}),this.auth(e)}auth(e){super.auth(e),this.processResponse(e.response)}enable(){return Be(this,void 0,void 0,function*(){const e=yield this.buildRequestModel(je);if(null==this.webAuthnResponse||null==this.keyIdAvailable)throw new Error("WebAuthn response or key ID is missing");e.deviceResponse=this.webAuthnResponse,e.id=this.keyIdAvailable,e.name=this.formGroup.value.name||"";const t=yield this.twoFactorService.putTwoFactorWebAuthn(e);this.processResponse(t),this.toastService.showToast({title:this.i18nService.t("success"),message:this.i18nService.t("twoFactorProviderEnabled"),variant:"success"}),this.onUpdated.emit(t.enabled)})}remove(e){return Be(this,void 0,void 0,function*(){if(this.keysConfiguredCount<=1||null!=e.removePromise)return;const t=null!=e.name?e.name:this.i18nService.t("webAuthnkeyX",e.id);if(!(yield this.dialogService.openSimpleDialog({title:t,content:{key:"removeU2fConfirmation"},type:"warning"})))return;const i=yield this.buildRequestModel(Ge);i.id=e.id;try{e.removePromise=this.twoFactorService.deleteTwoFactorWebAuthn(i);const t=yield e.removePromise;e.removePromise=null,yield this.processResponse(t)}catch(n){this.logService.error(n)}})}readDevice(e){console.log("listening for key..."),this.resetWebAuthn(!0),navigator.credentials.create({publicKey:e}).then(e=>{this.ngZone.run(()=>{this.webAuthnListening=!1,this.webAuthnResponse=e})}).catch(e=>{console.error(e),this.resetWebAuthn(!1),this.webAuthnError=!0})}resetWebAuthn(e=!1){this.webAuthnResponse=null,this.webAuthnError=!1,this.webAuthnListening=e}processResponse(e){this.resetWebAuthn(),this.keys=[],this.keyIdAvailable=null;const t=this.formGroup.get("name");t&&(t.enable(),t.setValue("")),this.keysConfiguredCount=0;for(let i=1;i<=5;i++){if(null!=e.keys){const t=e.keys.filter(e=>e.id===i);if(t.length>0){this.keysConfiguredCount++,this.keys.push({id:i,name:t[0].name,configured:!0,migrated:t[0].migrated,removePromise:null});continue}}this.keys.push({id:i,name:"",configured:!1,removePromise:null}),null==this.keyIdAvailable&&(this.keyIdAvailable=i)}this.enabled=e.enabled,this.onUpdated.emit(this.enabled)}static open(e,t){return e.open(nt,t)}}nt.ɵfac=function(e){return new(e||nt)(F.rXU(S.Qs),F.rXU(ee.ce),F.rXU(m.fz),F.rXU(P.W),F.rXU(ne.y),F.rXU(F.SKi),F.rXU(q.K),F.rXU(ie.i),F.rXU(ee.o3),F.rXU(te.f))},nt.ɵcmp=F.VBU({type:nt,selectors:[["app-two-factor-setup-webauthn"]],features:[F.Vt3],decls:1,vars:1,consts:[["readKeyBtn",""],["removeKeyBtn",""],[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"title","subtitle"],["bitDialogContent",""],["type","success","icon","bwi bwi-check-circle",3,"title",4,"ngIf"],["alt","FIDO2 WebAuthn logo",1,"tw-float-right","tw-ml-5","mfaType7"],[1,"bwi-ul"],[3,"appApiAction",4,"ngFor","ngForOf"],["bitTypography","body1"],[1,"tw-flex"],[1,"tw-basis-1/2"],["bitInput","","type","text","formControlName","name"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",1,"tw-mr-2",3,"bitAction","disabled"],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary",3,"disabled"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction",4,"ngIf"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["type","success","icon","bwi bwi-check-circle",3,"title"],[3,"appApiAction"],[1,"bwi","bwi-li","bwi-key"],["bitTypography","body1","class","tw-font-medium",4,"ngIf"],["bitTypography","body1",1,"tw-font-medium"],["class","bwi bwi-spin bwi-spinner tw-text-muted bwi-fw","aria-hidden","true",3,"title",4,"ngIf"],["bitLink","","href","#","appStopClick","",3,"click"],["aria-hidden","true",1,"bwi","bwi-spin","bwi-spinner","tw-text-muted","bwi-fw",3,"title"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-check-circle","tw-text-success"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-text-danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction"]],template:function(e,t){1&e&&F.DNE(0,it,46,43,"form",2),2&e&&F.Y8G("ngIf",t.authed)},dependencies:[Z.C,Pe.p,ue.$,he.L,k.t,E.Q,W.j,de.G,w.MD,w.Sq,w.bT,I.P,x.I,$.m,X.L,oe.j,ae.J,le.h,B.p,Ne.k,Ve.Y,H.V,ce.L,j.X1,j.qT,j.me,j.BC,j.cb,j.j4,j.JD,C.E,A.r,ve.$],encapsulation:2});class rt extends L.V{}var st=i(22191),ot=i(47135),at=i(90246),lt=i(93199),ct=i(36288),dt=i(50352),ut=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ht(e,t){1&e&&(F.j41(0,"bit-callout",19),F.nI1(1,"i18n"),F.EFF(2),F.nI1(3,"i18n"),F.k0s()),2&e&&(F.Y8G("title",F.mNQ(F.bMT(1,3,"enabled"))),F.R7$(2),F.SpI(" ",F.bMT(3,5,"twoStepLoginProviderEnabled")," "))}function pt(e,t){1&e&&(F.j41(0,"bit-form-field"),F.nrm(1,"input",23),F.k0s())}function mt(e,t){if(1&e){const e=F.RV6();F.j41(0,"div",24)(1,"span",25),F.EFF(2),F.k0s(),F.j41(3,"button",26),F.nI1(4,"i18n"),F.bIt("click",function(){R.eBV(e);const t=F.XpG().index,i=F.XpG(2);return R.Njj(i.remove(t))}),F.k0s()()}if(2&e){const e=F.XpG().index,t=F.XpG(2);F.R7$(2),F.JRh(t.keys[e].existingKey),F.R7$(),F.Y8G("label",F.mNQ(F.bMT(4,3,"remove")))}}function vt(e,t){if(1&e&&(F.j41(0,"div",20)(1,"bit-label"),F.EFF(2),F.nI1(3,"i18n"),F.k0s(),F.DNE(4,pt,2,0,"bit-form-field",21)(5,mt,5,5,"div",22),F.k0s()),2&e){const e=t.index,i=F.XpG(2);F.Y8G("formGroupName",e),F.R7$(2),F.JRh(F.i5U(3,4,"yubikeyX",(e+1).toString())),F.R7$(2),F.Y8G("ngIf",!i.keys[e].existingKey),F.R7$(),F.Y8G("ngIf",i.keys[e].existingKey)}}function ft(e,t){if(1&e&&(F.j41(0,"button",27),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e){const e=F.XpG(2);F.Y8G("bitAction",e.disable),F.R7$(),F.SpI(" ",F.bMT(2,2,"disableAllKeys")," ")}}function gt(e,t){if(1&e&&(F.j41(0,"form",1)(1,"bit-dialog",2),F.nI1(2,"i18n"),F.qex(3,3),F.DNE(4,ht,4,7,"bit-callout",4),F.j41(5,"bit-callout",5)(6,"p",6),F.EFF(7),F.nI1(8,"i18n"),F.k0s(),F.j41(9,"ul",7)(10,"li"),F.EFF(11),F.nI1(12,"i18n"),F.k0s(),F.j41(13,"li"),F.EFF(14),F.nI1(15,"i18n"),F.k0s()()(),F.nrm(16,"img",8),F.j41(17,"p",6),F.EFF(18),F.nI1(19,"i18n"),F.k0s(),F.j41(20,"ol",6)(21,"li"),F.EFF(22),F.nI1(23,"i18n"),F.k0s(),F.j41(24,"li"),F.EFF(25),F.nI1(26,"i18n"),F.k0s(),F.j41(27,"li"),F.EFF(28),F.nI1(29,"i18n"),F.k0s(),F.j41(30,"li"),F.EFF(31),F.nI1(32,"i18n"),F.k0s()(),F.nrm(33,"hr"),F.j41(34,"div",9),F.DNE(35,vt,6,7,"div",10),F.k0s(),F.j41(36,"p",11),F.EFF(37),F.nI1(38,"i18n"),F.k0s(),F.j41(39,"bit-form-control",12)(40,"bit-label"),F.EFF(41),F.nI1(42,"i18n"),F.k0s(),F.nrm(43,"input",13),F.j41(44,"bit-hint",14),F.EFF(45),F.nI1(46,"i18n"),F.k0s()(),F.bVm(),F.qex(47,15),F.j41(48,"button",16),F.EFF(49),F.nI1(50,"i18n"),F.k0s(),F.DNE(51,ft,3,4,"button",17),F.j41(52,"button",18),F.EFF(53),F.nI1(54,"i18n"),F.k0s(),F.bVm(),F.k0s()()),2&e){const e=F.XpG();F.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),F.R7$(),F.Y8G("title",F.bMT(2,22,"twoStepLogin"))("subtitle","YubiKey"),F.R7$(3),F.Y8G("ngIf",e.enabled),F.R7$(3),F.JRh(F.bMT(8,24,"twoFactorYubikeyWarning")),F.R7$(4),F.JRh(F.bMT(12,26,"twoFactorYubikeySupportUsb")),F.R7$(3),F.JRh(F.bMT(15,28,"twoFactorYubikeySupportMobile")),F.R7$(4),F.SpI("",F.bMT(19,30,"twoFactorYubikeyAdd"),":"),F.R7$(4),F.JRh(F.bMT(23,32,"twoFactorYubikeyPlugIn")),F.R7$(3),F.JRh(F.bMT(26,34,"twoFactorYubikeySelectKey")),F.R7$(3),F.JRh(F.bMT(29,36,"twoFactorYubikeyTouchButton")),F.R7$(3),F.JRh(F.bMT(32,38,"twoFactorYubikeySaveForm")),F.R7$(4),F.Y8G("ngForOf",e.keys),F.R7$(2),F.JRh(F.bMT(38,40,"nfcSupport")),F.R7$(2),F.Y8G("disableMargin",!0),F.R7$(2),F.JRh(F.bMT(42,42,"twoFactorYubikeySupportsNfc")),F.R7$(4),F.JRh(F.bMT(46,44,"twoFactorYubikeySupportsNfcDesc")),F.R7$(4),F.SpI(" ",F.bMT(50,46,"save")," "),F.R7$(2),F.Y8G("ngIf",e.enabled),F.R7$(),F.Y8G("bitDialogClose",e.enabled),F.R7$(),F.SpI(" ",F.bMT(54,48,"close")," ")}}class yt extends Q.g{get keysFormControl(){var e;return null===(e=this.formGroup)||void 0===e?void 0:e.controls.formKeys.controls}get anyKeyHasNfcFormControl(){var e;return null===(e=this.formGroup)||void 0===e?void 0:e.controls.anyKeyHasNfc}constructor(e,t,i,n,r,s,o,a,l){super(t,i,n,r,s,o,l),this.data=e,this.formBuilder=a,this.toastService=l,this.type=u.R.Yubikey,this.keys=[],this.anyKeyHasNfc=!1,this.componentName="app-two-factor-yubikey",this.submit=()=>ut(this,void 0,void 0,function*(){this.formGroup&&(this.formGroup.markAllAsTouched(),this.formGroup.invalid||(yield this.enable()))}),this.disable=()=>ut(this,void 0,void 0,function*(){if(yield this.disableMethod(),!this.enabled)for(let e=0;e<this.keys.length;e++)this.remove(e)})}ngOnInit(){this.auth(this.data),this.formGroup=this.formBuilder.group({formKeys:this.formBuilder.array([]),anyKeyHasNfc:this.formBuilder.control(this.anyKeyHasNfc)}),this.refreshFormArrayData()}refreshFormArrayData(){if(!this.formGroup)return;const e=this.formGroup.get("formKeys");e.clear(),this.keys.forEach(t=>{const i=this.formBuilder.group({key:t.key,existingKey:t.existingKey});e.push(i)})}auth(e){super.auth(e),this.processResponse(e.response)}enable(){return ut(this,void 0,void 0,function*(){var e,t,i,n,r,s,o,a,l,c,d;if(!this.formGroup)return;const u=this.formGroup.controls.formKeys.value,h=yield this.buildRequestModel(rt);h.key1=null!=u&&u.length>0&&null!==(t=null===(e=u[0])||void 0===e?void 0:e.key)&&void 0!==t?t:"",h.key2=null!=u&&u.length>1&&null!==(n=null===(i=u[1])||void 0===i?void 0:i.key)&&void 0!==n?n:"",h.key3=null!=u&&u.length>2&&null!==(s=null===(r=u[2])||void 0===r?void 0:r.key)&&void 0!==s?s:"",h.key4=null!=u&&u.length>3&&null!==(a=null===(o=u[3])||void 0===o?void 0:o.key)&&void 0!==a?a:"",h.key5=null!=u&&u.length>4&&null!==(c=null===(l=u[4])||void 0===l?void 0:l.key)&&void 0!==c?c:"",h.nfc=null!==(d=this.formGroup.value.anyKeyHasNfc)&&void 0!==d&&d,this.processResponse(yield this.twoFactorService.putTwoFactorYubiKey(h)),this.refreshFormArrayData(),this.toastService.showToast({title:this.i18nService.t("success"),message:this.i18nService.t("yubikeysUpdated"),variant:"success"}),this.onUpdated.emit(this.enabled)})}remove(e){this.keys[e].key="",this.keys[e].existingKey="",this.keysFormControl&&this.keysFormControl[e]&&this.keysFormControl[e].setValue({existingKey:"",key:""})}processResponse(e){this.enabled=e.enabled,this.anyKeyHasNfc=e.nfc||!e.enabled,this.keys=[{key:e.key1,existingKey:this.padRight(e.key1)},{key:e.key2,existingKey:this.padRight(e.key2)},{key:e.key3,existingKey:this.padRight(e.key3)},{key:e.key4,existingKey:this.padRight(e.key4)},{key:e.key5,existingKey:this.padRight(e.key5)}]}padRight(e,t="•",i=44){if(null==e||null==t||e.length>=i)return e;const n=(i-e.length)/t.length;for(let r=0;r<n;r++)e+=t;return e}static open(e,t){return e.open(yt,t)}}yt.ɵfac=function(e){return new(e||yt)(F.rXU(S.Qs),F.rXU(m.fz),F.rXU(P.W),F.rXU(ne.y),F.rXU(q.K),F.rXU(ie.i),F.rXU(ee.o3),F.rXU(j.ok),F.rXU(te.f))},yt.ɵcmp=F.VBU({type:yt,selectors:[["app-two-factor-setup-yubikey"]],features:[F.Vt3],decls:1,vars:1,consts:[[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],["dialogSize","large",3,"title","subtitle"],["bitDialogContent",""],["type","success","icon","bwi bwi-check-circle",3,"title",4,"ngIf"],["type","warning"],["bitTypography","body1"],["bitTypography","body1",1,"tw-mb-0"],["alt","YubiKey OTP security key logo",1,"tw-float-right","mfaType3"],["formArrayName","formKeys",1,"tw-flex","tw-flex-col","tw-mt-4"],[3,"formGroupName",4,"ngFor","ngForOf"],["bitTypography","body1",1,"tw-font-medium","tw-mb-2"],[3,"disableMargin"],["bitCheckbox","","type","checkbox","formControlName","anyKeyHasNfc"],[1,"tw-text-sm"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction",4,"ngIf"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitDialogClose"],["type","success","icon","bwi bwi-check-circle",3,"title"],[3,"formGroupName"],[4,"ngIf"],["class","tw-flex tw-justify-between tw-mb-4",4,"ngIf"],["bitInput","","type","password","formControlName","key","appInputVerbatim",""],[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-mr-2","tw-self-center"],["bitIconButton","bwi-minus-circle","type","button","buttonType","danger",3,"click","label"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"bitAction"]],template:function(e,t){1&e&&F.DNE(0,gt,55,50,"form",0),2&e&&F.Y8G("ngIf",t.authed)},dependencies:[w.MD,w.Sq,w.bT,j.X1,j.qT,j.me,j.Zm,j.BC,j.cb,j.j4,j.JD,j.$R,j.v8,B.p,me.q,I.P,x.I,$.m,X.L,at.f,oe.j,lt.I,ae.J,le.h,k.t,E.Q,st.Q,ct.s,W.j,de.G,ot.q,dt.P,H.V,C.E,A.r,Y.x,Z.C,Pe.p,ue.$,he.L,T.$Z],encapsulation:2});var bt=i(6804),wt=i(18499),St=i(58329),It=i(75556),kt=i(90300),Ct=i(4017),Tt=i(91962),Ft=i(93748),Rt=i(6056),Pt=i(23327),xt=i(10672),$t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Et=e=>({"mt-5":e});function At(e,t){1&e&&F.nrm(0,"app-header")}function Dt(e,t){1&e&&(F.j41(0,"h1"),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e&&(F.R7$(),F.JRh(F.bMT(2,1,"twoStepLogin")))}function Ot(e,t){1&e&&(F.j41(0,"h1"),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e&&(F.R7$(),F.JRh(F.bMT(2,1,"twoStepLoginEnforcement")))}function Mt(e,t){if(1&e&&(F.j41(0,"div",6),F.DNE(1,Dt,3,3,"h1",1)(2,Ot,3,3,"h1",1),F.k0s()),2&e){const e=F.XpG();F.R7$(),F.Y8G("ngIf",!e.organizationId||!e.isEnterpriseOrg),F.R7$(),F.Y8G("ngIf",e.organizationId&&e.isEnterpriseOrg)}}function Ut(e,t){1&e&&(F.j41(0,"p"),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e&&(F.R7$(),F.JRh(F.bMT(2,1,"twoStepLoginDesc")))}function Gt(e,t){1&e&&(F.qex(0),F.EFF(1),F.nI1(2,"i18n"),F.j41(3,"a",8),F.EFF(4),F.nI1(5,"i18n"),F.k0s(),F.nrm(6,"br"),F.EFF(7),F.nI1(8,"i18n"),F.nrm(9,"br")(10,"br"),F.j41(11,"p"),F.EFF(12),F.nI1(13,"i18n"),F.k0s(),F.bVm()),2&e&&(F.R7$(),F.SpI(" ",F.bMT(2,4,"twoStepLoginEnterpriseDescStart")," "),F.R7$(3),F.SpI("",F.bMT(5,6,"twoStepLoginPolicy"),"."),F.R7$(3),F.SpI(" ",F.bMT(8,8,"twoStepLoginOrganizationDuoDesc")," "),F.R7$(5),F.JRh(F.bMT(13,10,"twoStepLoginOrganizationSsoDesc")))}function jt(e,t){1&e&&(F.EFF(0),F.nI1(1,"i18n"),F.nrm(2,"br"),F.EFF(3),F.nI1(4,"i18n")),2&e&&(F.SpI(" ",F.bMT(1,2,"twoStepLoginTeamsDesc")," "),F.R7$(3),F.SpI(" ",F.bMT(4,4,"twoStepLoginOrganizationDuoDesc")," "))}function Nt(e,t){if(1&e&&(F.qex(0),F.j41(1,"p"),F.DNE(2,Gt,14,12,"ng-container",7)(3,jt,5,6,"ng-template",null,0,F.C5r),F.k0s(),F.bVm()),2&e){const e=F.sdS(4),t=F.XpG();F.R7$(2),F.Y8G("ngIf",t.isEnterpriseOrg)("ngIfElse",e)}}function Vt(e,t){if(1&e){const e=F.RV6();F.j41(0,"bit-callout",9)(1,"p"),F.EFF(2),F.k0s(),F.j41(3,"button",10),F.bIt("click",function(){R.eBV(e);const t=F.XpG();return R.Njj(t.recoveryCode())}),F.EFF(4),F.nI1(5,"i18n"),F.k0s()()}if(2&e){const e=F.XpG();F.R7$(2),F.JRh(e.recoveryCodeWarningMessage),F.R7$(2),F.SpI(" ",F.bMT(5,2,"viewRecoveryCode")," ")}}function Bt(e,t){1&e&&(F.j41(0,"small"),F.nrm(1,"i",11),F.nI1(2,"i18n"),F.j41(3,"span",12),F.EFF(4),F.nI1(5,"i18n"),F.k0s()()),2&e&&(F.R7$(),F.Y8G("title",F.mNQ(F.bMT(2,3,"loading"))),F.R7$(3),F.JRh(F.bMT(5,5,"loading")))}function zt(e,t){1&e&&(F.j41(0,"bit-callout",9),F.EFF(1),F.nI1(2,"i18n"),F.k0s()),2&e&&(F.R7$(),F.SpI(" ",F.bMT(2,1,"twoStepLoginPolicyUserWarning")," "))}function Lt(e,t){1&e&&(F.qex(0),F.nrm(1,"i",23),F.nI1(2,"i18n"),F.j41(3,"span",12),F.EFF(4),F.nI1(5,"i18n"),F.k0s(),F.bVm()),2&e&&(F.R7$(),F.Y8G("title",F.mNQ(F.bMT(2,3,"enabled"))),F.R7$(3),F.JRh(F.bMT(5,5,"enabled")))}function Kt(e,t){1&e&&F.nrm(0,"app-premium-badge",24)}function qt(e,t){if(1&e){const e=F.RV6();F.j41(0,"button",25),F.bIt("click",function(){R.eBV(e);const t=F.XpG().$implicit,i=F.XpG();return R.Njj(i.disablePremium2faTypeForNonPremiumUser(t.type))}),F.EFF(1),F.nI1(2,"i18n"),F.k0s()}2&e&&(F.R7$(),F.SpI(" ",F.bMT(2,1,"disable")," "))}function _t(e,t){if(1&e){const e=F.RV6();F.j41(0,"button",26),F.nI1(1,"async"),F.bIt("click",function(){R.eBV(e);const t=F.XpG().$implicit,i=F.XpG();return R.Njj(i.manage(t.type))}),F.EFF(2),F.nI1(3,"i18n"),F.k0s()}if(2&e){const e=F.XpG().$implicit,t=F.XpG();F.Y8G("disabled",!F.bMT(1,2,t.canAccessPremium$)&&e.premium),F.R7$(2),F.SpI(" ",F.bMT(3,4,"manage")," ")}}function Xt(e,t){if(1&e&&(F.j41(0,"bit-item")(1,"div",13),F.nrm(2,"auth-two-factor-icon",14),F.k0s(),F.j41(3,"div",15)(4,"h3",16)(5,"div",17),F.EFF(6),F.k0s(),F.DNE(7,Lt,6,7,"ng-container",1)(8,Kt,1,0,"app-premium-badge",18),F.k0s(),F.j41(9,"div",19),F.EFF(10),F.k0s()(),F.j41(11,"bit-item-action",20),F.nVh(12,qt,3,3,"button",21),F.nI1(13,"async"),F.vZN(14,_t,4,6,"button",22),F.k0s()()),2&e){const e=t.$implicit,i=F.XpG();F.HbH(F.VkB("tw-py-4 providers-2fa-",e.type)),F.R7$(2),F.Y8G("provider",e.type)("name",e.name),F.R7$(3),F.Aen(e.enabled||e.premium?"display:inline-block":""),F.R7$(),F.SpI(" ",e.name," "),F.R7$(),F.Y8G("ngIf",e.enabled),F.R7$(),F.Y8G("ngIf",e.premium),F.R7$(2),F.JRh(e.description),F.R7$(2),F.vxM(e.premium&&e.enabled&&!F.bMT(13,12,i.canAccessPremium$)?12:14)}}class Yt{constructor(e,t,i,s,o,a,l,c,d,u){this.dialogService=e,this.twoFactorService=t,this.messagingService=i,this.policyService=s,this.accountService=a,this.configService=l,this.i18nService=c,this.userVerificationService=d,this.toastService=u,this.providers=[],this.showPolicyWarning=!1,this.loading=!0,this.tabbedHeader=!0,this.destroy$=new n.B,this.canAccessPremium$=this.accountService.activeAccount$.pipe((0,r.n)(e=>o.hasPremiumFromAnySource$(e.id)))}ngOnInit(){return $t(this,void 0,void 0,function*(){this.recoveryCodeWarningMessage=this.i18nService.t("yourSingleUseRecoveryCode");for(const e in m.Ow){if(!m.Ow.hasOwnProperty(e))continue;const t=m.Ow[e];this.filterProvider(t.type)||this.providers.push({type:t.type,name:t.name,description:t.description,enabled:!1,premium:t.premium,sort:t.sort})}this.providers.sort((e,t)=>e.sort-t.sort),this.accountService.activeAccount$.pipe(p.F6,(0,r.n)(e=>this.policyService.policyAppliesToUser$(d.tt.TwoFactorAuthentication,e)),(0,s.Q)(this.destroy$)).subscribe(e=>{this.twoFactorAuthPolicyAppliesToActiveUser=e}),yield this.load()})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}load(){return $t(this,void 0,void 0,function*(){this.loading=!0;(yield this.getTwoFactorProviders()).data.forEach(e=>{this.providers.forEach(t=>{e.type===t.type&&(t.enabled=e.enabled)})}),this.evaluatePolicies(),this.loading=!1})}callTwoFactorVerifyDialog(e){return $t(this,void 0,void 0,function*(){const t=bt.S.open(this.dialogService,{data:{type:e,organizationId:this.organizationId}});return yield(0,o.s)(t.closed)})}disablePremium2faTypeForNonPremiumUser(e){return $t(this,void 0,void 0,function*(){const t=yield c.GA.open(this.dialogService,{title:"twoStepLogin",verificationType:{type:"custom",verificationFn:t=>$t(this,void 0,void 0,function*(){const i=yield this.userVerificationService.buildRequest(t,h.G);return i.type=e,yield this.twoFactorService.putTwoFactorDisable(i),!0})}});"cancel"!==t.userAction&&t.verificationSuccess&&(this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepDisabled")}),this.updateStatus(!1,e))})}manage(e){return $t(this,void 0,void 0,function*(){var t;switch(null===(t=this.twoFactorSetupSubscription)||void 0===t||t.unsubscribe(),e){case u.R.Authenticator:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=Ce.open(this.dialogService,{data:t});this.twoFactorSetupSubscription=i.componentInstance.onChangeStatus.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,u.R.Authenticator)});break}case u.R.Yubikey:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;yt.open(this.dialogService,{data:t}).componentInstance.onUpdated.pipe((0,s.Q)(this.destroy$)).subscribe(e=>{this.updateStatus(e,u.R.Yubikey)});break}case u.R.Duo:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=Te.U.open(this.dialogService,{data:{authResponse:t}});this.twoFactorSetupSubscription=i.componentInstance.onChangeStatus.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,u.R.Duo)});break}case u.R.Email:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=Ue.open(this.dialogService,{data:t});this.twoFactorSetupSubscription=i.componentInstance.onChangeStatus.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,u.R.Email)});break}case u.R.WebAuthn:{const t=yield this.callTwoFactorVerifyDialog(e);if(!t)return;const i=nt.open(this.dialogService,{data:t});this.twoFactorSetupSubscription=i.componentInstance.onUpdated.pipe((0,a.$)(),(0,s.Q)(this.destroy$)).subscribe(e=>{i.close(),this.updateStatus(e,u.R.WebAuthn)});break}}})}recoveryCode(){return $t(this,void 0,void 0,function*(){const e=yield this.callTwoFactorVerifyDialog(-1);if(e){const t=G.open(this.dialogService,{data:e});yield(0,o.s)(t.closed)}})}getTwoFactorProviders(){return this.twoFactorService.getEnabledTwoFactorProviders()}filterProvider(e){return e===u.R.OrganizationDuo}updateStatus(e,t){this.providers.forEach(i=>{i.type===t&&void 0!==e&&(i.enabled=e)}),this.evaluatePolicies()}evaluatePolicies(){null==this.organizationId&&1===this.providers.filter(e=>e.enabled).length?this.showPolicyWarning=this.twoFactorAuthPolicyAppliesToActiveUser:this.showPolicyWarning=!1}get isEnterpriseOrg(){var e;return(null===(e=this.organization)||void 0===e?void 0:e.productTierType)===v.K_.Enterprise}}Yt.ɵfac=function(e){return new(e||Yt)(F.rXU(ee.o3),F.rXU(m.fz),F.rXU(f.U),F.rXU(wt.m),F.rXU(St.Q),F.rXU(re.Di),F.rXU(se.w),F.rXU(P.W),F.rXU(ie.i),F.rXU(te.f))},Yt.ɵcmp=F.VBU({type:Yt,selectors:[["app-two-factor-setup"]],decls:14,vars:17,consts:[["teamsDescription",""],[4,"ngIf"],["class","tw-mt-6 tw-mb-2 tw-pb-2.5",4,"ngIf"],["type","warning",4,"ngIf"],[3,"ngClass"],[3,"class",4,"ngFor","ngForOf"],[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[4,"ngIf","ngIfElse"],["bitLink","","routerLink","../policies"],["type","warning"],["type","button","bitButton","","buttonType","secondary",3,"click"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-fw","tw-text-muted",3,"title"],[1,"tw-sr-only"],["slot","start",1,"tw-min-w-[120px]","tw-flex","tw-justify-center"],[1,"tw-flex","tw-items-center",3,"provider","name"],["bit-item-content","",1,"tw-px-4"],[1,"tw-mb-0"],[1,"tw-font-medium","tw-text-base"],["class","tw-ml-2",4,"ngIf"],[1,"tw-mt-2","tw-text-wrap"],["slot","end"],["type","button","bitButton","","buttonType","danger"],["type","button","bitButton","","buttonType","secondary",3,"disabled"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-success-600","bwi-fw","tw-ml-2",3,"title"],[1,"tw-ml-2"],["type","button","bitButton","","buttonType","danger",3,"click"],["type","button","bitButton","","buttonType","secondary",3,"click","disabled"]],template:function(e,t){1&e&&(F.DNE(0,At,1,0,"app-header",1),F.j41(1,"bit-container"),F.DNE(2,Mt,3,2,"div",2)(3,Ut,3,3,"p",1)(4,Nt,5,2,"ng-container",1)(5,Vt,6,4,"bit-callout",3),F.j41(6,"h2",4),F.EFF(7),F.nI1(8,"i18n"),F.DNE(9,Bt,6,7,"small",1),F.k0s(),F.DNE(10,zt,3,3,"bit-callout",3),F.j41(11,"bit-item-group"),F.nI1(12,"i18n"),F.DNE(13,Xt,15,14,"bit-item",5),F.k0s()()),2&e&&(F.Y8G("ngIf",null!=t.organizationId),F.R7$(2),F.Y8G("ngIf",null==t.organizationId),F.R7$(),F.Y8G("ngIf",!t.organizationId),F.R7$(),F.Y8G("ngIf",t.organizationId),F.R7$(),F.Y8G("ngIf",!t.organizationId),F.R7$(),F.Y8G("ngClass",F.eq3(15,Et,!t.organizationId)),F.R7$(),F.SpI(" ",F.bMT(8,11,"providers")," "),F.R7$(2),F.Y8G("ngIf",t.loading),F.R7$(),F.Y8G("ngIf",t.showPolicyWarning),F.R7$(),F.BMQ("aria-label",F.bMT(12,13,"providers")),F.R7$(2),F.Y8G("ngForOf",t.providers))},dependencies:[g.k,It.J,kt.g,Ct.D,Tt._,y.G,Ft.f,l.a,b.G,w.YU,w.Sq,w.bT,Rt.Wk,Pt.U,E.Q,de.G,xt.H,ce.L,w.Jj,ve.$],encapsulation:2})},43759:(e,t,i)=>{"use strict";i.d(t,{h:()=>G});var n=i(77468),r=i(94573),s=i(74208),o=i(36801),a=i(93199),l=i(86226),c=i(97553),d=i(33812),u=i(50700);let h=0;class p{constructor(e){this.i18nService=e,this.id="bit-error-"+h++,this.error=(0,r.hFB)()}get displayError(){var e,t,i,n,r,s,o;const a=this.error();if(!a)return"";switch(a[0]){case"required":return this.i18nService.t("inputRequired");case"email":return this.i18nService.t("inputEmail");case"minlength":return this.i18nService.t("inputMinLength",null===(e=a[1])||void 0===e?void 0:e.requiredLength);case"maxlength":return this.i18nService.t("inputMaxLength",null===(t=a[1])||void 0===t?void 0:t.requiredLength);case"min":return this.i18nService.t("inputMinValue",null===(i=a[1])||void 0===i?void 0:i.min);case"max":return this.i18nService.t("inputMaxValue",null===(n=a[1])||void 0===n?void 0:n.max);case"forbiddenCharacters":return this.i18nService.t("inputForbiddenCharacters",null===(r=a[1])||void 0===r?void 0:r.characters.join(", "));case"multipleEmails":return this.i18nService.t("multipleInputEmails");case"trim":return this.i18nService.t("inputTrimValidator");default:return(null===(s=a[1])||void 0===s?void 0:s.message)?null===(o=a[1])||void 0===o?void 0:o.message:a}}}p.ɵfac=function(e){return new(e||p)(d.rXU(u.W))},p.ɵcmp=d.VBU({type:p,selectors:[["bit-error"]],hostAttrs:["aria-live","assertive",1,"tw-block","tw-mt-1","tw-text-danger","tw-text-xs"],hostVars:1,hostBindings:function(e,t){2&e&&d.Avn("id",t.id)},inputs:{error:[1,"error"]},decls:2,vars:1,consts:[[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(d.Hgh(0,"i",0),d.EFF(1)),2&e&&(d.R7$(),d.SpI(" ",t.displayError))},encapsulation:2});var m=i(22949);const v=["prefixContainer"],f=["suffixContainer"],g=["*",[["bit-label"]],[["","bitPrefix",""]],[["","bitSuffix",""]],[["bit-hint"]]],y=(e,t)=>[e,t],b=(e,t)=>({"tw-border-secondary-300/50 tw-border-b tw-pb-[2px]":e,"tw-border-transparent tw-pb-[3px]":t});function w(e,t){1&e&&d.SdG(0)}function S(e,t){1&e&&d.SdG(0,1)}function I(e,t){1&e&&d.SdG(0,2)}function k(e,t){1&e&&d.SdG(0,3)}function C(e,t){1&e&&d.eu8(0)}function T(e,t){1&e&&(d.j41(0,"span",15),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.SpI(" (",d.bMT(2,1,"required"),")"))}function F(e,t){1&e&&d.eu8(0)}function R(e,t){1&e&&d.eu8(0)}function P(e,t){1&e&&d.eu8(0)}function x(e,t){if(1&e&&(d.j41(0,"div",6)(1,"div",9)(2,"div",10),d.nrm(3,"div",11),d.j41(4,"div",12)(5,"label",13),d.DNE(6,C,1,0,"ng-container",14),d.nVh(7,T,3,3,"span",15),d.k0s()(),d.nrm(8,"div",16),d.k0s()(),d.j41(9,"div",17)(10,"div",18,4),d.DNE(12,F,1,0,"ng-container",14),d.k0s(),d.j41(13,"div",19),d.DNE(14,R,1,0,"ng-container",14),d.k0s(),d.j41(15,"div",20,5),d.DNE(17,P,1,0,"ng-container",14),d.k0s()()()),2&e){const e=d.XpG(),t=d.sdS(1),i=d.sdS(3),n=d.sdS(5),r=d.sdS(7);d.R7$(3),d.Y8G("ngClass",e.inputBorderClasses),d.R7$(),d.Y8G("ngClass",e.inputBorderClasses),d.R7$(),d.BMQ("for",e.input().labelForId),d.R7$(),d.Y8G("ngTemplateOutlet",i),d.R7$(),d.vxM(e.input().required?7:-1),d.R7$(),d.Y8G("ngClass",e.inputBorderClasses),d.R7$(2),d.Y8G("hidden",!e.prefixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",n),d.R7$(),d.Y8G("ngClass",d.l_i(12,y,e.prefixHasChildren()?"":"tw-rounded-s-lg tw-ps-3",e.suffixHasChildren()?"":"tw-rounded-e-lg tw-pe-3")),d.R7$(),d.Y8G("ngTemplateOutlet",t),d.R7$(),d.Y8G("hidden",!e.suffixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",r)}}function $(e,t){1&e&&d.eu8(0)}function E(e,t){1&e&&d.eu8(0)}function A(e,t){1&e&&d.eu8(0)}function D(e,t){1&e&&d.eu8(0)}function O(e,t){if(1&e&&(d.j41(0,"div",7)(1,"label",21),d.DNE(2,$,1,0,"ng-container",14),d.k0s(),d.j41(3,"div",22)(4,"div",23,4),d.DNE(6,E,1,0,"ng-container",14),d.k0s(),d.j41(7,"div",24),d.DNE(8,A,1,0,"ng-container",14),d.k0s(),d.j41(9,"div",25,5),d.DNE(11,D,1,0,"ng-container",14),d.k0s()()()),2&e){const e=d.XpG(),t=d.sdS(1),i=d.sdS(3),n=d.sdS(5),r=d.sdS(7);d.R7$(),d.BMQ("for",e.input().labelForId),d.R7$(),d.Y8G("ngTemplateOutlet",i),d.R7$(),d.Y8G("ngClass",d.l_i(8,b,!e.disableReadOnlyBorder,e.disableReadOnlyBorder)),d.R7$(),d.Y8G("hidden",!e.prefixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",n),d.R7$(2),d.Y8G("ngTemplateOutlet",t),d.R7$(),d.Y8G("hidden",!e.suffixHasChildren()),d.R7$(2),d.Y8G("ngTemplateOutlet",r)}}function M(e,t){1&e&&d.SdG(0,4)}function U(e,t){if(1&e&&d.nrm(0,"bit-error",8),2&e){const e=d.XpG();d.Y8G("error",e.input().error)}}class G{constructor(){this.input=r.sbv.required(m.p),this.hint=(0,r.sbv)(a.I),this.label=(0,r.sbv)(l.j),this.prefixContainer=(0,r.ebz)("prefixContainer"),this.suffixContainer=(0,r.ebz)("suffixContainer"),this.error=(0,r.ebz)(p),this.disableMargin=(0,r.hFB)(!1,{transform:r.L39}),this.disableReadOnlyBorder=!1,this.prefixHasChildren=(0,s.vPA)(!1),this.suffixHasChildren=(0,s.vPA)(!1),this.defaultContentIsFocused=(0,s.vPA)(!1)}get inputBorderClasses(){const e=this.defaultContentIsFocused(),t=[this.input().hasError?"group-hover/bit-form-field:tw-border-danger-700":"group-hover/bit-form-field:tw-border-primary-600","group-has-[input:read-only]/bit-form-field:group-hover/bit-form-field:tw-border-secondary-500","group-has-[textarea:read-only]/bit-form-field:group-hover/bit-form-field:tw-border-secondary-500","group-focus-within/bit-form-field:tw-outline-none",e?"group-focus-within/bit-form-field:tw-border-2":"",e?"group-focus-within/bit-form-field:tw-border-primary-600":"",e?"group-focus-within/bit-form-field:group-hover/bit-form-field:tw-border-primary-600":""];return(0,c.V)(this.input().hasError).concat(t).join(" ")}get classList(){return["tw-block"].concat(this.disableMargin()?[]:["tw-mb-4","bit-compact:tw-mb-3"]).concat(this.readOnly?[]:"tw-pt-2")}onFocusIn(e){this.defaultContentIsFocused.set(e.matches("[data-default-content] *:focus-visible"))}onFocusOut(){this.defaultContentIsFocused.set(!1)}get readOnly(){return!!this.input().readOnly}ngAfterContentChecked(){var e,t,i,n;const r=this.error(),s=this.hint();this.input().ariaDescribedBy=r?r.id:s?s.id:void 0,this.prefixHasChildren.set((null!==(t=null===(e=this.prefixContainer())||void 0===e?void 0:e.nativeElement.childElementCount)&&void 0!==t?t:0)>0),this.suffixHasChildren.set((null!==(n=null===(i=this.suffixContainer())||void 0===i?void 0:i.nativeElement.childElementCount)&&void 0!==n?n:0)>0)}}G.ɵfac=function(e){return new(e||G)},G.ɵcmp=d.VBU({type:G,selectors:[["bit-form-field"]],contentQueries:function(e,t,i){1&e&&(d.C6U(i,t.input,m.p,5),d.C6U(i,t.hint,a.I,5),d.C6U(i,t.label,l.j,5)),2&e&&d.NyB(3)},viewQuery:function(e,t){1&e&&(d.wEZ(t.prefixContainer,v,5),d.wEZ(t.suffixContainer,f,5),d.wEZ(t.error,p,5)),2&e&&d.NyB(3)},hostVars:2,hostBindings:function(e,t){1&e&&d.bIt("focusin",function(e){return t.onFocusIn(e.target)})("focusout",function(){return t.onFocusOut()}),2&e&&d.HbH(t.classList)},inputs:{disableMargin:[1,"disableMargin"],disableReadOnlyBorder:[2,"disableReadOnlyBorder","disableReadOnlyBorder",r.L39]},ngContentSelectors:["*","bit-label","[bitPrefix]","[bitSuffix]","bit-hint"],decls:12,vars:2,consts:[["defaultContent",""],["labelContent",""],["prefixContent",""],["suffixContent",""],["prefixContainer",""],["suffixContainer",""],[1,"tw-w-full","tw-relative","tw-group/bit-form-field"],[1,"tw-w-full","tw-relative"],[3,"error"],[1,"tw-absolute","tw-size-full","tw-top-0","tw-pointer-events-none","tw-z-20"],[1,"tw-size-full","tw-flex"],[1,"tw-min-w-3","tw-border-r-0","group-focus-within/bit-form-field:tw-border-r-0","!tw-rounded-s-lg",3,"ngClass"],[1,"tw-px-1","tw-shrink","tw-min-w-0","tw-mt-px","tw-border-x-0","tw-border-t-0","group-focus-within/bit-form-field:tw-border-x-0","group-focus-within/bit-form-field:tw-border-t-0","tw-hidden","group-has-[bit-label]/bit-form-field:tw-block",3,"ngClass"],[1,"tw-flex","tw-gap-1","tw-text-sm","tw-text-muted","-tw-translate-y-[0.675rem]","tw-mb-0","tw-max-w-full","tw-pointer-events-auto"],[4,"ngTemplateOutlet"],[1,"tw-text-[0.625rem]","tw-relative","tw-bottom-[-1px]"],[1,"tw-min-w-3","tw-grow","tw-border-l-0","group-focus-within/bit-form-field:tw-border-l-0","!tw-rounded-e-lg",3,"ngClass"],[1,"tw-gap-1","tw-bg-background","tw-rounded-lg","tw-flex","tw-min-h-11","[&:has(input:read-only,textarea:read-only):not(:has(button:not([aria-disabled='true'])))]:tw-bg-secondary-100"],[1,"tw-flex","tw-items-center","tw-gap-1","tw-ps-3","has-[[biticonbutton]]:tw-ps-1","tw-py-1",3,"hidden"],["data-default-content","",1,"tw-w-full","tw-relative","tw-py-1","[&:has(select)_select]:tw-pe-6","has-[select]:after:tw-absolute","has-[select]:after:tw-end-4","has-[select]:after:tw-top-[calc(50%_-_2px)]","has-[select]:after:tw-rotate-[45deg]","has-[select]:after:-tw-translate-y-1/2","has-[select]:after:tw-size-2","has-[select]:after:tw-border-text-main","has-[select]:after:tw-border-r-[2px]","has-[select]:after:tw-border-b-[2px]","has-[bit-select]:tw-p-0","has-[bit-multi-select]:tw-p-0","has-[input:read-only:not([hidden])]:tw-bg-secondary-100","has-[textarea:read-only:not([hidden])]:tw-bg-secondary-100","has-[textarea]:tw-my-1",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-pe-3","has-[[biticonbutton]]:tw-pe-1","tw-py-1",3,"hidden"],[1,"tw-flex","tw-gap-1","tw-text-sm","tw-text-muted","tw-mb-0","tw-max-w-full"],[1,"tw-gap-1","tw-flex","tw-min-h-[1.85rem]","tw-border-0","tw-border-solid","tw-items-center",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-gap-1","tw-ps-1",3,"hidden"],["data-default-content","",1,"tw-w-full","tw-min-w-0","tw-pb-0","tw-relative","[&>*]:tw-p-0","[&>*::selection]:tw-bg-primary-700","[&>*::selection]:tw-text-contrast"],[1,"tw-flex","tw-items-center","tw-pe-1",3,"hidden"]],template:function(e,t){if(1&e&&(d.NAR(g),d.DNE(0,w,1,0,"ng-template",null,0,d.C5r)(2,S,1,0,"ng-template",null,1,d.C5r)(4,I,1,0,"ng-template",null,2,d.C5r)(6,k,1,0,"ng-template",null,3,d.C5r),d.nVh(8,x,18,15,"div",6)(9,O,12,11,"div",7),d.nVh(10,M,1,0)(11,U,1,1,"bit-error",8)),2&e){let e;d.R7$(8),d.vxM(t.readOnly?9:8),d.R7$(2),d.vxM(!1===(e=t.input().hasError)?10:!0===e?11:-1)}},dependencies:[n.MD,n.YU,n.T3,p,o.$Z],encapsulation:2})},43890:(e,t,i)=>{"use strict";i.d(t,{e:()=>s});var n=i(78781),r=i(68467);class s{constructor(e){if(null==e)throw new Error("Must provide key");if(32===e.byteLength)this.innerKey={type:r.Qd.AesCbc256_B64,encryptionKey:e},this.keyB64=this.toBase64();else if(64===e.byteLength)this.innerKey={type:r.Qd.AesCbc256_HmacSha256_B64,encryptionKey:e.slice(0,32),authenticationKey:e.slice(32)},this.keyB64=this.toBase64();else{if(!(e.byteLength>64))throw new Error(`Unsupported encType/key length ${e.byteLength}`);this.innerKey={type:r.Qd.CoseEncrypt0,encryptionKey:e},this.keyB64=this.toBase64()}}toJSON(){return{keyB64:this.keyB64}}inner(){return this.innerKey}toBase64(){return n.A.fromBufferToB64(this.toEncoded())}toEncoded(){if(this.innerKey.type===r.Qd.AesCbc256_B64)return this.innerKey.encryptionKey;if(this.innerKey.type===r.Qd.AesCbc256_HmacSha256_B64){const e=new Uint8Array(64);return e.set(this.innerKey.encryptionKey,0),e.set(this.innerKey.authenticationKey,32),e}if(this.innerKey.type===r.Qd.CoseEncrypt0)return this.innerKey.encryptionKey;throw new Error("Unsupported encryption type.")}static fromString(e){if(null==e)return null;const t=n.A.fromB64ToArray(e);return new s(t)}static fromJSON(e){return s.fromString(null==e?void 0:e.keyB64)}}},43946:(e,t,i)=>{"use strict";i.d(t,{p:()=>n});class n{}},43978:(e,t,i)=>{"use strict";var n,r,s,o;i.d(t,{pC:()=>n,eH:()=>r,Zx:()=>s,D7:()=>o,tt:()=>h.t,kC:()=>u,cp:()=>a,PN:()=>l,pP:()=>c}),function(e){e[e.Default=0]="Default",e[e.BillingSync=1]="BillingSync",e[e.Scim=2]="Scim"}(n||(n={})),function(e){e[e.CloudBillingSync=1]="CloudBillingSync",e[e.Scim=2]="Scim"}(r||(r={})),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(s||(s={})),function(e){e[e.Owner=0]="Owner",e[e.Admin=1]="Admin",e[e.User=2]="User",e[e.Custom=4]="Custom"}(o||(o={}));var a,l,c,d,u,h=i(1036);!function(e){e[e.Msp=0]="Msp",e[e.Reseller=1]="Reseller",e[e.BusinessUnit=2]="BusinessUnit"}(a||(a={})),function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(l||(l={})),function(e){e[e.ProviderAdmin=0]="ProviderAdmin",e[e.ServiceUser=1]="ServiceUser"}(c||(c={})),function(e){e[e.Default=0]="Default",e[e.AzureAd=1]="AzureAd",e[e.Okta=2]="Okta",e[e.OneLogin=3]="OneLogin",e[e.JumpCloud=4]="JumpCloud",e[e.GoogleWorkspace=5]="GoogleWorkspace",e[e.Rippling=6]="Rippling"}(d||(d={})),function(e){e[e.Pending=0]="Pending",e[e.Created=1]="Created",e[e.Billable=2]="Billable"}(u||(u={}))},44087:(e,t,i)=>{"use strict";i.d(t,{O:()=>F});var n=i(77468),r=i(94573),s=i(33277),o=i(33812),a=i(83731),l=i(36801),c=i(22191),d=i(34465),u=i(65067),h=i(74208),p=i(21823),m=i(36288);const v=[[["","slot","end"]],"*"],f=e=>({"tw-transform tw-rotate-[90deg]":e}),g=(e,t)=>[e,t];function y(e,t){if(1&e){const e=o.RV6();o.j41(0,"button",4),o.nI1(1,"i18n"),o.bIt("click",function(t){h.eBV(e);const i=o.XpG(2);return h.Njj(i.toggle(t))}),o.k0s()}if(2&e){const e=o.XpG(2),t=o.r8f(0);o.Y8G("ngClass",o.eq3(8,f,"tree"===t&&!e.open()))("bitIconButton",e.toggleButtonIcon())("buttonType","nav-contrast")("label",o.l_i(10,g,o.bMT(1,6,"toggleCollapse"),e.text()).join(" ")),o.BMQ("aria-expanded",e.open().toString())("aria-controls",e.contentId)}}function b(e,t){1&e&&o.eu8(0)}function w(e,t){if(1&e&&(o.qex(0,2),o.DNE(1,b,1,0,"ng-container",5),o.bVm()),2&e){o.XpG();const e=o.sdS(2);o.R7$(),o.Y8G("ngTemplateOutlet",e)}}function S(e,t){1&e&&o.eu8(0)}function I(e,t){if(1&e&&o.DNE(0,S,1,0,"ng-container",5),2&e){o.XpG();const e=o.sdS(2);o.Y8G("ngTemplateOutlet",e)}}function k(e,t){if(1&e&&(o.j41(0,"div",6),o.nI1(1,"i18n"),o.SdG(2,1),o.k0s()),2&e){const e=o.XpG(3);o.BMQ("id",e.contentId)("aria-label",o.l_i(4,g,e.text(),o.bMT(1,2,"submenu")).join(" "))}}function C(e,t){if(1&e&&o.nVh(0,k,3,7,"div",6),2&e){const e=o.XpG(2);o.vxM(e.open()?0:-1)}}function T(e,t){if(1&e){const e=o.RV6();o.j41(0,"bit-nav-item",1),o.bIt("mainContentClicked",function(){h.eBV(e);const t=o.XpG();return h.Njj(t.handleMainContentClicked())}),o.DNE(1,y,2,13,"ng-template",null,0,o.C5r),o.nVh(3,w,2,1,"ng-container",2),o.qex(4,3),o.SdG(5),o.nVh(6,I,1,1,"ng-container"),o.bVm(),o.k0s(),o.nVh(7,C,1,1)}if(2&e){const e=o.XpG(),t=o.r8f(0);o.Y8G("text",e.text())("icon",e.icon())("route",e.route())("variant",t)("treeDepth",e.treeDepth())("relativeTo",e.relativeTo())("routerLinkActiveOptions",e.routerLinkActiveOptions())("ariaLabel",e.ariaLabel())("hideActiveStyles",e.parentHideActiveStyles())("ariaCurrentWhenActive",e.ariaCurrent()),o.R7$(3),o.vxM("tree"===t?3:-1),o.R7$(3),o.vxM("tree"!==t?6:-1),o.R7$(),o.vxM(e.sideNavOpen()?7:-1)}}class F extends d.S{constructor(e,t){super(),this.sideNavService=e,this.parentNavGroup=t,this.nestedNavComponents=(0,r.tEk)(d.S,{descendants:!1}),this.sideNavOpen=(0,a.ot)(this.sideNavService.open$),this.sideNavAndGroupOpen=(0,s.EW)(()=>this.open()&&this.sideNavOpen()),this.parentHideActiveStyles=(0,s.EW)(()=>this.hideActiveStyles()||this.sideNavAndGroupOpen()),this.toggleButtonIcon=(0,s.EW)(()=>"tree"===this.variant()?"bwi-up-solid":this.open()?"bwi-angle-up":"bwi-angle-down"),this.ariaCurrentWhenActive=(0,r.hFB)(),this.ariaCurrent=(0,s.EW)(()=>{var e;return null!==(e=this.ariaCurrentWhenActive())&&void 0!==e?e:this.sideNavAndGroupOpen()?void 0:"page"}),this.contentId=Math.random().toString(36).substring(2),this.open=(0,r.geq)(!1),this.hideIfEmpty=(0,r.hFB)(!1,{transform:r.L39}),this.openChange=new o.bkB,this.parentNavGroup&&this.treeDepth.set(this.parentNavGroup.treeDepth()+1)}setOpen(e){var t;this.open.set(e),this.openChange.emit(this.open()),this.open()&&(null===(t=this.parentNavGroup)||void 0===t||t.setOpen(this.open()))}toggle(e){null==e||e.stopPropagation(),this.setOpen(!this.open())}handleMainContentClicked(){this.sideNavService.open?this.toggle():(this.route()||this.sideNavService.setOpen(),this.open.set(!0)),this.mainContentClicked.emit()}}F.ɵfac=function(e){return new(e||F)(o.rXU(p.G),o.rXU(F,12))},F.ɵcmp=o.VBU({type:F,selectors:[["bit-nav-group"]],contentQueries:function(e,t,i){1&e&&o.C6U(i,t.nestedNavComponents,d.S,4),2&e&&o.NyB()},inputs:{ariaCurrentWhenActive:[1,"ariaCurrentWhenActive"],open:[1,"open"],hideIfEmpty:[1,"hideIfEmpty"]},outputs:{open:"openChange",openChange:"openChange"},features:[o.Jv_([{provide:d.S,useExisting:F},{provide:u.H,useExisting:F}]),o.Vt3],ngContentSelectors:["[slot=end]","*"],decls:2,vars:2,consts:[["button",""],[3,"mainContentClicked","text","icon","route","variant","treeDepth","relativeTo","routerLinkActiveOptions","ariaLabel","hideActiveStyles","ariaCurrentWhenActive"],["slot","start"],["slot","end"],["type","button","size","small",1,"tw-ms-auto",3,"click","ngClass","bitIconButton","buttonType","label"],[4,"ngTemplateOutlet"],["role","group"]],template:function(e,t){1&e&&(o.NAR(v),o.SS7(0),o.nVh(1,T,8,13)),2&e&&(o.bH3(t.variant()),o.R7$(),o.vxM(!t.hideIfEmpty()||t.nestedNavComponents().length>0?1:-1))},dependencies:[n.MD,n.YU,n.T3,u.u,c.Q,m.s,l.$Z],encapsulation:2})},44432:(e,t,i)=>{"use strict";i.d(t,{G:()=>y});var n=i(94573),r=i(33277),s=i(89207),o=i(75583),a=i(33812),l=i(50700),c=i(77468),d=i(58806);const u=e=>[e],h=(e,t)=>[e,t];function p(e,t){if(1&e&&a.nrm(0,"i",1),2&e){a.XpG();const e=a.r8f(1),t=a.r8f(2);a.Y8G("ngClass",a.l_i(1,h,t,e?"tw-top-[3px] tw-self-start":"tw-top-[1px]"))}}function m(e,t){if(1&e&&(a.j41(0,"header",3),a.EFF(1),a.k0s()),2&e){const e=a.XpG(),t=a.r8f(1);a.Y8G("id",a.mNQ(e.titleId)),a.R7$(),a.SpI(" ",t," ")}}const v={success:"bwi-check-circle",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error",default:"bwi-star"},f={warning:"warning",danger:"error"};let g=0;class y{constructor(e){this.i18nService=e,this.type=(0,n.hFB)("info"),this.icon=(0,n.hFB)(),this.title=(0,n.hFB)(),this.useAlertRole=(0,n.hFB)(!1),this.iconComputed=(0,r.EW)(()=>void 0===this.icon()?v[this.type()]:this.icon()),this.titleComputed=(0,r.EW)(()=>{const e=this.title();if(null===e)return;const t=this.type();return null==e&&null!=f[t]?this.i18nService.t(f[t]):e}),this.titleId="bit-callout-title-"+g++,this.calloutClass=(0,r.EW)(()=>{switch(this.type()){case"danger":return"tw-bg-danger-100 tw-border-danger-700 tw-text-danger-700";case"info":return"tw-bg-info-100 tw-bg-info-100 tw-border-info-700 tw-text-info-700";case"success":return"tw-bg-success-100 tw-bg-success-100 tw-border-success-700 tw-text-success-700";case"warning":return"tw-bg-warning-100 tw-bg-warning-100 tw-border-warning-700 tw-text-warning-700";case"default":return"tw-bg-background-alt tw-border-secondary-700 tw-text-secondary-700"}})}}y.ɵfac=function(e){return new(e||y)(a.rXU(l.W))},y.ɵcmp=a.VBU({type:y,selectors:[["bit-callout"]],inputs:{type:[1,"type"],icon:[1,"icon"],title:[1,"title"],useAlertRole:[1,"useAlertRole"]},ngContentSelectors:["*"],decls:8,vars:8,consts:[[1,"tw-mb-4","tw-box-border","tw-border","tw-border-solid","tw-rounded-lg","tw-bg-background","tw-ps-4","tw-pe-4","tw-py-3","tw-leading-5","tw-flex","tw-gap-2",3,"ngClass"],["aria-hidden","true",1,"bwi","tw-relative",3,"ngClass"],[1,"tw-flex","tw-flex-col","tw-gap-0.5"],[1,"tw-text-base","tw-font-medium",3,"id"],["bitTypography","body2"]],template:function(e,t){if(1&e&&(a.NAR(),a.j41(0,"aside",0),a.SS7(1)(2),a.nVh(3,p,1,4,"i",1),a.j41(4,"div",2),a.nVh(5,m,2,3,"header",3),a.j41(6,"div",4),a.SdG(7),a.k0s()()()),2&e){a.Y8G("ngClass",a.eq3(6,u,t.calloutClass())),a.BMQ("aria-labelledby",t.titleId),a.R7$();const e=a.bH3(t.titleComputed());a.R7$();const i=a.bH3(t.iconComputed());a.R7$(),a.vxM(i?3:-1),a.R7$(2),a.vxM(e?5:-1)}},dependencies:[s.G,c.YU,o.E,d.r],encapsulation:2})},44997:(e,t,i)=>{"use strict";i.d(t,{d:()=>n.dw});var n=i(91968)},45113:(e,t,i)=>{"use strict";i.d(t,{P:()=>p});var n=i(7919),r=i(61782),s=i(36304),o=i(61182),a=i(39326),l=i(26076),c=i(36107),d=i(10070),u=i(36890);class h{}class p{constructor({cipher:e,encryptedFor:t}){var i,p,m;switch(this.type=e.type,this.encryptedFor=t,this.folderId=e.folderId,this.organizationId=e.organizationId,this.name=e.name?e.name.encryptedString:null,this.notes=e.notes?e.notes.encryptedString:null,this.favorite=e.favorite,this.lastKnownRevisionDate=e.revisionDate,this.archivedDate=e.archivedDate,this.reprompt=e.reprompt,this.key=null===(i=e.key)||void 0===i?void 0:i.encryptedString,this.type){case n.gC.Login:this.login=new c.a,this.login.uris=null!==(m=null===(p=e.login.uris)||void 0===p?void 0:p.map(e=>{const t=new l.q;return t.uri=null!=e.uri?e.uri.encryptedString:null,t.match=null!=e.match?e.match:null,t.uriChecksum=null!=e.uriChecksum?e.uriChecksum.encryptedString:null,t}))&&void 0!==m?m:[],this.login.username=e.login.username?e.login.username.encryptedString:null,this.login.password=e.login.password?e.login.password.encryptedString:null,this.login.passwordRevisionDate=null!=e.login.passwordRevisionDate?e.login.passwordRevisionDate.toISOString():null,this.login.totp=e.login.totp?e.login.totp.encryptedString:null,this.login.autofillOnPageLoad=e.login.autofillOnPageLoad,null!=e.login.fido2Credentials&&(this.login.fido2Credentials=e.login.fido2Credentials.map(e=>{const t=new s.K;return t.credentialId=null!=e.credentialId?e.credentialId.encryptedString:null,t.keyType=null!=e.keyType?e.keyType.encryptedString:null,t.keyAlgorithm=null!=e.keyAlgorithm?e.keyAlgorithm.encryptedString:null,t.keyCurve=null!=e.keyCurve?e.keyCurve.encryptedString:null,t.keyValue=null!=e.keyValue?e.keyValue.encryptedString:null,t.rpId=null!=e.rpId?e.rpId.encryptedString:null,t.rpName=null!=e.rpName?e.rpName.encryptedString:null,t.counter=null!=e.counter?e.counter.encryptedString:null,t.userHandle=null!=e.userHandle?e.userHandle.encryptedString:null,t.userName=null!=e.userName?e.userName.encryptedString:null,t.userDisplayName=null!=e.userDisplayName?e.userDisplayName.encryptedString:null,t.discoverable=null!=e.discoverable?e.discoverable.encryptedString:null,t.creationDate=null!=e.creationDate?e.creationDate.toISOString():null,t}));break;case n.gC.SecureNote:this.secureNote=new d.c,this.secureNote.type=e.secureNote.type;break;case n.gC.SshKey:this.sshKey=new u.m,this.sshKey.privateKey=null!=e.sshKey.privateKey?e.sshKey.privateKey.encryptedString:null,this.sshKey.publicKey=null!=e.sshKey.publicKey?e.sshKey.publicKey.encryptedString:null,this.sshKey.keyFingerprint=null!=e.sshKey.keyFingerprint?e.sshKey.keyFingerprint.encryptedString:null;break;case n.gC.Card:this.card=new r.j,this.card.cardholderName=null!=e.card.cardholderName?e.card.cardholderName.encryptedString:null,this.card.brand=null!=e.card.brand?e.card.brand.encryptedString:null,this.card.number=null!=e.card.number?e.card.number.encryptedString:null,this.card.expMonth=null!=e.card.expMonth?e.card.expMonth.encryptedString:null,this.card.expYear=null!=e.card.expYear?e.card.expYear.encryptedString:null,this.card.code=null!=e.card.code?e.card.code.encryptedString:null;break;case n.gC.Identity:this.identity=new a.p,this.identity.title=null!=e.identity.title?e.identity.title.encryptedString:null,this.identity.firstName=null!=e.identity.firstName?e.identity.firstName.encryptedString:null,this.identity.middleName=null!=e.identity.middleName?e.identity.middleName.encryptedString:null,this.identity.lastName=null!=e.identity.lastName?e.identity.lastName.encryptedString:null,this.identity.address1=null!=e.identity.address1?e.identity.address1.encryptedString:null,this.identity.address2=null!=e.identity.address2?e.identity.address2.encryptedString:null,this.identity.address3=null!=e.identity.address3?e.identity.address3.encryptedString:null,this.identity.city=null!=e.identity.city?e.identity.city.encryptedString:null,this.identity.state=null!=e.identity.state?e.identity.state.encryptedString:null,this.identity.postalCode=null!=e.identity.postalCode?e.identity.postalCode.encryptedString:null,this.identity.country=null!=e.identity.country?e.identity.country.encryptedString:null,this.identity.company=null!=e.identity.company?e.identity.company.encryptedString:null,this.identity.email=null!=e.identity.email?e.identity.email.encryptedString:null,this.identity.phone=null!=e.identity.phone?e.identity.phone.encryptedString:null,this.identity.ssn=null!=e.identity.ssn?e.identity.ssn.encryptedString:null,this.identity.username=null!=e.identity.username?e.identity.username.encryptedString:null,this.identity.passportNumber=null!=e.identity.passportNumber?e.identity.passportNumber.encryptedString:null,this.identity.licenseNumber=null!=e.identity.licenseNumber?e.identity.licenseNumber.encryptedString:null}null!=e.fields&&(this.fields=e.fields.map(e=>{const t=new o.d;return t.type=e.type,t.name=e.name?e.name.encryptedString:null,t.value=e.value?e.value.encryptedString:null,t.linkedId=e.linkedId,t})),null!=e.passwordHistory&&(this.passwordHistory=[],e.passwordHistory.forEach(e=>{this.passwordHistory.push({lastUsedDate:e.lastUsedDate,password:e.password?e.password.encryptedString:null})})),null!=e.attachments&&(this.attachments={},this.attachments2={},e.attachments.forEach(t=>{const i=t.fileName?t.fileName.encryptedString:null;this.attachments[t.id]=i;const n=new h;n.fileName=i,n.lastKnownRevisionDate=e.revisionDate,null!=t.key&&(n.key=t.key.encryptedString),this.attachments2[t.id]=n}))}}},45151:(e,t,i)=>{"use strict";i.d(t,{w:()=>b});var n=i(72245),r=i(44500),s=i(3204),o=i(28202),a=i(67553),l=i(3633),c=i(39306),d=i(78781),u=i(22848);class h{constructor(e,t,i){this.orgId=e,this.publicKey=t,this.orgName=i}}var p=i(74208),m=i(89105),v=i(11224),f=i(50700),g=i(35500),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class b{constructor(e,t,i,n,r,s,o){this.keyService=e,this.encryptService=t,this.organizationService=i,this.organizationUserApiService=n,this.organizationApiService=r,this.i18nService=s,this.accountService=o}buildRecoveryKey(e,t,i){return y(this,void 0,void 0,function*(){if(null==t)throw new Error("User key is required for recovery.");const n=yield this.organizationApiService.getKeys(e);if(null==n)throw new Error(this.i18nService.t("resetPasswordOrgKeysError"));const r=d.A.fromB64ToArray(n.publicKey);if(!i.some(e=>d.A.fromBufferToHex(e)===d.A.fromBufferToHex(r)))throw new Error("Untrusted public key");return(yield this.encryptService.encapsulateKeyUnsigned(t,r)).encryptedString})}resetMasterPassword(e,t,i,a){return y(this,void 0,void 0,function*(){const d=yield this.organizationUserApiService.getOrganizationUserResetPasswordDetails(a,i);if(null==d)throw new Error(this.i18nService.t("resetPasswordDetailsError"));const h=yield(0,n._)(this.accountService.activeAccount$.pipe(l.F6,(0,r.n)(e=>this.keyService.orgKeys$(e)),(0,s.T)(e=>{var t;return null!==(t=e[a])&&void 0!==t?t:null})));if(null==h)throw new Error("No org key found");const p=yield this.encryptService.unwrapDecapsulationKey(new c.k(d.encryptedPrivateKey),h),m=yield this.encryptService.decapsulateKeyUnsigned(new c.k(d.resetPasswordKey),p),v=d.kdf===u.ao.PBKDF2_SHA256?new u.n1(d.kdfIterations):new u.hU(d.kdfIterations,d.kdfMemory,d.kdfParallelism),f=yield this.keyService.makeMasterKey(e,t.trim().toLowerCase(),v),g=yield this.keyService.hashMasterKey(e,f),y=yield this.keyService.encryptUserKeyWithMasterKey(f,m),b=new o.W7;b.key=y[1].encryptedString,b.newMasterPasswordHash=g,yield this.organizationUserApiService.putOrganizationUserResetPassword(a,i,b)})}getPublicKeys(e){return y(this,void 0,void 0,function*(){const t=(yield(0,n._)(this.organizationService.organizations$(e))).filter(e=>e.resetPasswordEnrolled),i=[];for(const e of t){const t=yield this.organizationApiService.getKeys(e.id),n=d.A.fromB64ToArray(t.publicKey),r=new h(e.id,n,e.name);i.push(r)}return i})}getRotatedData(e,t,i){return y(this,void 0,void 0,function*(){if(null==e)throw new Error("New user key is required for rotation.");const r=yield(0,n._)(this.organizationService.organizations$(i));if(!r)throw new Error("Could not get organizations");const s=[];for(const i of r){if(!i.resetPasswordEnrolled)continue;const n=yield this.buildRecoveryKey(i.id,e,t),r=new o.YT;r.organizationId=i.id,r.resetPasswordKey=n,r.masterPasswordHash="ignored",s.push(r)}return s})}}b.ɵfac=function(e){return new(e||b)(p.KVO(u.Lu),p.KVO(m.N),p.KVO(a.PV),p.KVO(o.uB),p.KVO(v.X),p.KVO(f.W),p.KVO(g.Di))},b.ɵprov=p.jDH({token:b,factory:b.ɵfac,providedIn:"root"})},45154:(e,t,i)=>{"use strict";i.d(t,{L:()=>f});var n=i(74208),r=i(94573),s=i(83731),o=i(16878),a=i(93695),l=i(75811),c=i(69194),d=i(44500),u=i(56962),h=i(26038),p=i(33812),m=i(51757),v=i(2471);class f{constructor(e,t,i){this.formGroupDirective=e,this.destroyRef=(0,n.WQX)(n.abz),this._loading$=new o.t(!1),this._disabled$=new o.t(!1),this.handler=r.hFB.required({alias:"bitSubmit"}),this.allowDisabledFormSubmit=(0,r.hFB)(!1),this.loading$=this._loading$.asObservable(),this.disabled$=this._disabled$.asObservable(),e.ngSubmit.pipe((0,c.p)(()=>!this.disabled),(0,d.n)(()=>{const e=(0,h.Z)(this.handler());return this.loading=!0,e.pipe((0,l.W)(e=>(null==i||i.error(`Async submit exception: ${e}`),null==t||t.showError(e),(0,a.of)(void 0))))}),(0,s.pQ)()).subscribe({next:()=>this.loading=!1,complete:()=>this.loading=!1})}ngOnInit(){var e;null===(e=this.formGroupDirective.statusChanges)||void 0===e||e.pipe((0,s.pQ)(this.destroyRef)).subscribe(e=>{this.allowDisabledFormSubmit()?this._disabled$.next(!1):this._disabled$.next("DISABLED"===e)})}get disabled(){return this._disabled$.value}set disabled(e){this._disabled$.next(e)}get loading(){return this._loading$.value}set loading(e){this.disabled=e,this._loading$.next(e)}}f.ɵfac=function(e){return new(e||f)(p.rXU(m.j4),p.rXU(v.B,8),p.rXU(u.K,8))},f.ɵdir=p.FsC({type:f,selectors:[["","formGroup","","bitSubmit",""]],inputs:{handler:[1,"bitSubmit","handler"],allowDisabledFormSubmit:[1,"allowDisabledFormSubmit"]}})},45482:(e,t,i)=>{"use strict";i.d(t,{IJ:()=>o,qb:()=>l,d$:()=>u});var n=i(41226),r=i(33812),s=i(74208);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=r.$C({type:o}),o.ɵinj=s.G2t({providers:[n.g]});var a=i(56962);class l{constructor(e){this.logService=e}createDropin(){window.setTimeout(()=>{window.braintree.dropin.create({authorization:"",container:this.containerId,paymentOptionPriority:["paypal"],paypal:{flow:"vault",buttonStyle:{label:"pay",size:"medium",shape:"pill",color:"blue",tagline:"false"}}},(e,t)=>{null==e?this.braintree=t:this.logService.error(e)})},250)}loadBraintree(e,t){const i=window.document.createElement("script");i.id="dropin-script",i.src="scripts/dropin.js?cache=trguzs",i.async=!0,t&&(i.onload=()=>this.createDropin()),this.containerId=e,window.document.head.appendChild(i)}requestPaymentMethod(){return new Promise((e,t)=>{this.braintree.requestPaymentMethod((i,n)=>{i?(this.logService.error(i),t(i.message)):e(n.nonce)})})}unloadBraintree(){const e=window.document.getElementById("dropin-script");window.document.head.removeChild(e),window.setTimeout(()=>{const e=Array.from(window.document.head.querySelectorAll("script")).filter(e=>null!=e.src&&e.src.indexOf("paypal")>-1);e.forEach(e=>{try{window.document.head.removeChild(e)}catch(t){this.logService.error(t)}});const t=window.document.head.querySelector("#braintree-dropin-stylesheet");if(null!=t)try{window.document.head.removeChild(t)}catch(i){this.logService.error(i)}},500)}}l.ɵfac=function(e){return new(e||l)(s.KVO(a.K))},l.ɵprov=s.jDH({token:l,factory:l.ɵfac,providedIn:o});var c=i(12012),d=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class u{constructor(e,t){this.apiService=e,this.logService=t,this.stripe=null,this.stripeScriptLoaded=!1,this.instanceCount=0,this.instances=new Map,this.createSetupIntent=e=>d(this,void 0,void 0,function*(){return yield this.apiService.send("POST",(()=>{switch(e){case"bankAccount":return"/setup-intent/bank-account";case"card":return"/setup-intent/card"}})(),null,!0,!0)})}loadStripe(e,t,i){if(this.stripeScriptLoaded)this.initializeInstance(e,t,i);else if(window.document.getElementById("stripe-script"))this.initializeInstance(e,t,i);else{const n=window.document.createElement("script");n.id="stripe-script",n.src="https://js.stripe.com/v3?advancedFraudSignals=false",n.onload=()=>d(this,void 0,void 0,function*(){const n=window;this.stripe=n.Stripe(""),this.stripeScriptLoaded=!0,this.initializeInstance(e,t,i)}),window.document.head.appendChild(n)}}initializeInstance(e,t,i,n=1){if(!this.stripe)return void(n<10?(this.logService.warning(`Stripe not yet loaded for instance ${e}, retrying attempt ${n}...`),setTimeout(()=>this.initializeInstance(e,t,i,n+1),50)):this.logService.error(`Stripe failed to load for instance ${e} after ${n} attempts`));const r=this.stripe.elements();this.instances.set(e,{elements:r,elementIds:t}),this.instanceCount++,setTimeout(()=>{r.create("cardNumber",this.getElementOptions("cardNumber")),r.create("cardExpiry",this.getElementOptions("cardExpiry")),r.create("cardCvc",this.getElementOptions("cardCvc")),i&&this.mountElements(e)},50)}mountElements(e,t=1){setTimeout(()=>{const i=this.instances.get(e);if(i)if(i.elements){const n=i.elements.getElement("cardNumber"),r=i.elements.getElement("cardExpiry"),s=i.elements.getElement("cardCvc");[n,r,s].some(e=>!e)?(this.logService.warning(`Some Stripe card elements for instance ${e} are missing, retrying for attempt ${t}...`),this.mountElements(e,t+1)):(n.mount(i.elementIds.cardNumber),r.mount(i.elementIds.cardExpiry),s.mount(i.elementIds.cardCvc))}else this.logService.warning(`Stripe elements for instance ${e} are missing, retrying for attempt ${t}...`),this.mountElements(e,t+1);else t<10?(this.logService.warning(`Stripe instance ${e} not found, retrying for attempt ${t}...`),this.mountElements(e,t+1)):this.logService.error(`Stripe instance ${e} not found after ${t} attempts`)},100)}setupBankAccountPaymentMethod(e,t,i){return d(this,arguments,void 0,function*(e,{accountHolderName:t,routingNumber:i,accountNumber:n,accountHolderType:r},s){const o={payment_method:{us_bank_account:{routing_number:i,account_number:n,account_holder_type:r},billing_details:{name:t}}};s&&(o.payment_method.billing_details.address={country:s.country,postal_code:s.postalCode});const a=yield this.stripe.confirmUsBankAccountSetup(e,o);if(a.error||a.setupIntent&&"requires_action"!==a.setupIntent.status)throw this.logService.error(a.error),a.error;return a.setupIntent.payment_method})}setupCardPaymentMethod(e,t,i){return d(this,void 0,void 0,function*(){const n=this.instances.get(e);if(!n){const t=Array.from(this.instances.keys());throw this.logService.error(`Stripe instance ${e} not found. Available instances: [${t.join(", ")}]. This may occur if the component was destroyed during the payment flow.`),new Error("Payment method initialization failed. Please try again.")}const r={payment_method:{card:n.elements.getElement("cardNumber")}};i&&(r.payment_method.billing_details={address:{country:i.country,postal_code:i.postalCode}});const s=yield this.stripe.confirmCardSetup(t,r);if(s.error||s.setupIntent&&"succeeded"!==s.setupIntent.status)throw this.logService.error(s.error),s.error;return s.setupIntent.payment_method})}unloadStripe(e){const t=this.instances.get(e);if(t){if(t.elements)try{const e=t.elements.getElement("cardNumber"),i=t.elements.getElement("cardExpiry"),n=t.elements.getElement("cardCvc");e&&e.unmount(),i&&i.unmount(),n&&n.unmount()}catch(i){this.logService.error(`Error unmounting Stripe elements for instance ${e}:`,i)}if(this.instances.delete(e),this.instanceCount--,this.instanceCount<=0){this.instanceCount<0&&this.logService.error(`Stripe instance count became negative (${this.instanceCount}). This indicates a reference counting bug.`),this.instanceCount=0,this.stripeScriptLoaded=!1,this.stripe=null;const e=window.document.getElementById("stripe-script");e&&window.document.head.removeChild(e),window.setTimeout(()=>{Array.from(window.document.querySelectorAll("iframe")).filter(e=>null!=e.src&&e.src.indexOf("stripe")>-1).forEach(e=>{try{e.remove()}catch(i){this.logService.error(i)}})},500)}}}getElementOptions(e){const t={style:{base:{color:null,fontFamily:'Inter, "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontSize:"16px",fontSmoothing:"antialiased",lineHeight:"1.5",padding:"8px 12px","::placeholder":{color:null}},invalid:{color:null}},classes:{base:"tw-stripe-form-control",focus:"is-focused",empty:"is-empty",invalid:"is-invalid"}};t.style.base.fontWeight="500",["cardNumber","cardCvc"].includes(e)&&(t.placeholder="");const i=getComputedStyle(document.documentElement);return t.style.base.color=`rgb(${i.getPropertyValue("--color-text-main")})`,t.style.base["::placeholder"].color=`rgb(${i.getPropertyValue("--color-text-muted")})`,t.style.invalid.color=`rgb(${i.getPropertyValue("--color-text-main")})`,t.style.invalid.borderColor=`rgb(${i.getPropertyValue("--color-danger-600")})`,t}}u.ɵfac=function(e){return new(e||u)(s.KVO(c.G),s.KVO(a.K))},u.ɵprov=s.jDH({token:u,factory:u.ɵfac,providedIn:"root"})},45674:(e,t,i)=>{"use strict";i.d(t,{v:()=>s});var n=i(33812);const r={Visa:[{cardLength:16,blocks:[4,4,4,4]}],Mastercard:[{cardLength:16,blocks:[4,4,4,4]}],Maestro:[{cardLength:16,blocks:[4,4,4,4]},{cardLength:13,blocks:[4,4,5]},{cardLength:15,blocks:[4,6,5]},{cardLength:19,blocks:[4,4,4,4,3]}],Discover:[{cardLength:16,blocks:[4,4,4,4]}],"Diners Club":[{cardLength:14,blocks:[4,6,4]}],JCB:[{cardLength:16,blocks:[4,4,4,4]}],UnionPay:[{cardLength:16,blocks:[4,4,4,4]},{cardLength:19,blocks:[6,13]}],Amex:[{cardLength:15,blocks:[4,6,5]}],Other:[{cardLength:16,blocks:[4,4,4,4]}]};class s{transform(e,t){let i=r[t];null==i&&(i=r.Other);const n=e.length;let s=i.find(e=>e.cardLength==n);null==s&&(s=i[0]);const o=s.blocks,a=[];let l=0;return o.forEach(t=>{a.push(e.slice(l,l+t)),l+=t}),n>l&&a.push(e.slice(l)),a.join(" ")}}s.ɵfac=function(e){return new(e||s)},s.ɵpipe=n.EJ8({name:"creditCardNumber",type:s,pure:!0,standalone:!1})},45804:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});class n{}},45872:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});class n{}},45891:(e,t,i)=>{"use strict";i.d(t,{_:()=>n});class n{}},45980:(e,t,i)=>{"use strict";i.d(t,{Jh:()=>a,M3:()=>o,NU:()=>u,Uv:()=>r,aF:()=>n,df:()=>h,yo:()=>l});var n,r,s=i(28202);!function(e){e.View="view",e.ViewExceptPass="viewExceptPass",e.Edit="edit",e.EditExceptPass="editExceptPass",e.Manage="manage"}(n||(n={})),function(e){e[e.Collection=0]="Collection",e[e.Group=1]="Group",e[e.Member=2]="Member"}(r||(r={}));const o=()=>[{perm:n.ViewExceptPass,labelId:"viewItemsHidePass"},{perm:n.View,labelId:"viewItems"},{perm:n.EditExceptPass,labelId:"editItemsHidePass"},{perm:n.Edit,labelId:"editItems"},{perm:n.Manage,labelId:"manageCollection"}],a=e=>{if(null!=e)return e.manage?n.Manage:e.readOnly?e.hidePasswords?n.ViewExceptPass:n.View:e.hidePasswords?n.EditExceptPass:n.Edit},l=e=>new s.sK({id:e.id,readOnly:c(e.permission),hidePasswords:d(e.permission),manage:e.permission===n.Manage}),c=e=>[n.View,n.ViewExceptPass].includes(e),d=e=>[n.ViewExceptPass,n.EditExceptPass].includes(e);function u(e){return{id:e.id,type:r.Group,listName:e.name,labelName:e.name}}function h(e){var t,i;return{id:e.id,type:r.Member,email:e.email,role:e.type,listName:(null===(t=e.name)||void 0===t?void 0:t.length)>0?`${e.name} (${e.email})`:e.email,labelName:null!==(i=e.name)&&void 0!==i?i:e.email,status:e.status}}},46128:(e,t,i)=>{"use strict";i.d(t,{sE:()=>o,eO:()=>a,mw:()=>s});var n=i(28202),r=i(23567);function s(e){if(!e)return[];const t=e.sort((e,t)=>e.name.localeCompare(t.name)).map(o),i=[],s=new Map;t.map(e=>{var t;const i=e.organizationId;(null!==(t=s.get(i))&&void 0!==t?t:s.set(i,[]).get(i)).push(e)});for(const o of s.values()){const e=[];for(const t of o){const i=t.name?t.name.replace(/^\/+|\/+$/g,"").split(n.Kt):[];r.F.nestedTraverse(e,0,i,t,void 0,n.Kt)}i.push(...e)}return i}function o(e){let t;return t=e instanceof n.nb?Object.assign(new n.nb(Object.assign(Object.assign({},e),{name:e.name})),e):Object.assign(new n.iY(Object.assign(Object.assign({},e),{name:e.name})),e),t}function a(e){return e&&0!==e.length?e.flatMap(e=>{if(!e.children||0===e.children.length)return[e.node];const t=a(e.children);return[e.node,...t]}):[]}},46131:(e,t,i)=>{"use strict";i.d(t,{t:()=>l});var n=i(77468),r=i(75583),s=i(36801),o=i(33812),a=i(58806);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["app-danger-zone"]],ngContentSelectors:["*"],decls:7,vars:3,consts:[["content",""],["bitTypography","h1",1,"tw-mt-16","tw-pb-2.5","!tw-text-danger"],[1,"tw-rounded","tw-border","tw-border-solid","tw-border-danger-600","tw-p-5"],[1,"tw-grid","tw-auto-rows-fr","@2xl:tw-grid-cols-2","@3xl:tw-flex","tw-gap-2","@2xl:tw-gap-4","@3xl:tw-gap-2"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"h1",1),o.EFF(1),o.nI1(2,"i18n"),o.k0s(),o.j41(3,"div",2)(4,"div",3,0),o.SdG(6),o.k0s()()),2&e&&(o.R7$(),o.JRh(o.bMT(2,1,"dangerZone")))},dependencies:[n.MD,r.E,a.r,s.$Z],encapsulation:2})},46217:(e,t,i)=>{"use strict";i.d(t,{U:()=>r});var n=i(17989);class r extends n.A{constructor(){super(...arguments),this.minComplexity=0,this.minLength=0,this.requireUpper=!1,this.requireLower=!1,this.requireNumbers=!1,this.requireSpecial=!1,this.enforceOnLogin=!1}static fromResponse(e){if(null==e)return null;const t=new r;return t.minComplexity=e.minComplexity,t.minLength=e.minLength,t.requireUpper=e.requireUpper,t.requireLower=e.requireLower,t.requireNumbers=e.requireNumbers,t.requireSpecial=e.requireSpecial,t.enforceOnLogin=e.enforceOnLogin,t}}},46357:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{}},46798:(e,t,i)=>{"use strict";i.d(t,{N:()=>n});const n=Object.freeze({Text:0,File:1})},47135:(e,t,i)=>{"use strict";i.d(t,{q:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},47328:(e,t,i)=>{"use strict";i.d(t,{S:()=>l});var n=i(17989),r=i(31442),s=i(27280),o=i(86346),a=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class l extends n.A{constructor(e){super(),this.type=r.ak.Generic,null!=e&&(this.type=e.type)}decrypt(){return a(this,void 0,void 0,function*(){return new o.Z(this)})}toSecureNoteData(){const e=new s.e;return e.type=this.type,e}static fromJSON(e){if(null==e)return;const t=new l;return t.type=e.type,t}toSdkSecureNote(){return{type:(0,r.aw)(this.type)}}static fromSdkSecureNote(e){if(null==e)return;const t=new l;return t.type=e.type,t}}},47428:(e,t,i)=>{"use strict";i.d(t,{x:()=>r});var n=i(33812);class r{onClick(e){e.stopPropagation()}}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["","appStopProp",""]],hostBindings:function(e,t){1&e&&n.bIt("click",function(e){return t.onClick(e)})},standalone:!1})},47438:(e,t,i)=>{"use strict";i.d(t,{c:()=>s,e:()=>r});var n=i(20702);const r={Missing:"tax_id_missing",PendingVerification:"tax_id_pending_verification",FailedVerification:"tax_id_failed_verification"};class s extends n.r{constructor(e){super(e),this.type=this.getResponseProperty("Type")}}},47593:(e,t,i)=>{"use strict";i.d(t,{U:()=>u});var n=i(77468),r=i(94573),s=i(74208),o=i(50700),a=i(639),l=i(33812),c=i(47696);function d(e,t){if(1&e&&(l.j41(0,"span",1),l.EFF(1),l.k0s()),2&e){const e=l.XpG();l.BMQ("aria-label",e.getDiscountText()),l.R7$(),l.SpI(" ",e.getDiscountText(),"\n")}}class u{constructor(){this.discount=(0,r.hFB)(null),this.i18nService=(0,s.WQX)(o.W)}getDiscountText(){const e=this.discount();if(!e)return null;if(null!=e.percentOff&&e.percentOff>0){const t=e.percentOff<1?100*e.percentOff:e.percentOff;return`${Math.round(t)}% ${this.i18nService.t("discount")}`}if(null!=e.amountOff&&e.amountOff>0){return`${new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(e.amountOff)} ${this.i18nService.t("discount")}`}return null}hasDiscount(){const e=this.discount();return!!e&&(!!e.active&&(null!=e.percentOff&&e.percentOff>0||null!=e.amountOff&&e.amountOff>0))}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=l.VBU({type:u,selectors:[["billing-discount-badge"]],inputs:{discount:[1,"discount"]},decls:1,vars:1,consts:[["bitBadge","","variant","success","class","tw-w-fit","role","status",4,"ngIf"],["bitBadge","","variant","success","role","status",1,"tw-w-fit"]],template:function(e,t){1&e&&l.DNE(0,d,2,2,"span",0),2&e&&l.Y8G("ngIf",t.hasDiscount())},dependencies:[n.MD,n.bT,a.E,c.n],encapsulation:2,changeDetection:0})},47659:(e,t,i)=>{"use strict";i.d(t,{b:()=>c});var n=i(94251),r=i(77468),s=i(30930),o=i(36572),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[r.MD,n.E9,o.O,s.N]})},47696:(e,t,i)=>{"use strict";i.d(t,{n:()=>h});var n=i(77468),r=i(74208),s=i(33812),o=i(94573),a=i(33277),l=i(70171);const c=e=>({"tw-truncate tw-block":e}),d={primary:["tw-bg-primary-100","tw-border-primary-700","!tw-text-primary-700"],secondary:["tw-bg-secondary-100","tw-border-secondary-700","!tw-text-secondary-700"],success:["tw-bg-success-100","tw-border-success-700","!tw-text-success-700"],danger:["tw-bg-danger-100","tw-border-danger-700","!tw-text-danger-700"],warning:["tw-bg-warning-100","tw-border-warning-700","!tw-text-warning-700"],info:["tw-bg-info-100","tw-border-info-700","!tw-text-info-700"],notification:["tw-bg-notification-100","tw-border-notification-600","!tw-text-notification-600"]},u={primary:["hover:tw-bg-primary-600","hover:tw-border-primary-600","hover:!tw-text-contrast"],secondary:["hover:tw-bg-secondary-600","hover:tw-border-secondary-600","hover:!tw-text-contrast"],success:["hover:tw-bg-success-600","hover:tw-border-success-600","hover:!tw-text-contrast"],danger:["hover:tw-bg-danger-600","hover:tw-border-danger-600","hover:!tw-text-contrast"],warning:["hover:tw-bg-warning-600","hover:tw-border-warning-600","hover:!tw-text-black"],info:["hover:tw-bg-info-600","hover:tw-border-info-600","hover:!tw-text-black"],notification:["hover:tw-bg-notification-600","hover:tw-border-notification-600","hover:!tw-text-contrast"]};class h{constructor(){this.el=(0,r.WQX)(s.aKT),this.hasHoverEffects="SPAN"!==this.el.nativeElement.nodeName,this.title=(0,o.hFB)(),this.variant=(0,o.hFB)("primary"),this.truncate=(0,o.hFB)(!0),this.maxWidthClass=(0,o.hFB)("tw-max-w-40"),this.classList=(0,a.EW)(()=>["tw-inline-block","tw-py-1","tw-px-2","tw-font-medium","tw-text-center","tw-align-text-top","tw-rounded-full","tw-border-[0.5px]","tw-border-solid","tw-box-border","tw-whitespace-nowrap","tw-text-xs","hover:tw-no-underline","focus-visible:tw-outline-none","focus-visible:tw-ring-2","focus-visible:tw-ring-offset-2","focus-visible:tw-ring-primary-600","disabled:tw-bg-secondary-300","disabled:hover:tw-bg-secondary-300","disabled:tw-border-secondary-300","disabled:hover:tw-border-secondary-300","disabled:!tw-text-muted","disabled:hover:!tw-text-muted","disabled:tw-cursor-not-allowed"].concat(d[this.variant()]).concat(this.hasHoverEffects?[...u[this.variant()],"tw-min-w-10"]:[]).concat(this.truncate()?this.maxWidthClass():[])),this.titleAttr=(0,a.EW)(()=>{var e,t;const i=this.title();return void 0!==i?i:this.truncate()?null===(t=null===(e=this.el.nativeElement)||void 0===e?void 0:e.textContent)||void 0===t?void 0:t.trim():null})}getFocusTarget(){return this.el.nativeElement}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=s.VBU({type:h,selectors:[["span","bitBadge",""],["a","bitBadge",""],["button","bitBadge",""]],hostVars:3,hostBindings:function(e,t){2&e&&(s.BMQ("title",t.titleAttr()),s.HbH(t.classList()))},inputs:{title:[1,"title"],variant:[1,"variant"],truncate:[1,"truncate"],maxWidthClass:[1,"maxWidthClass"]},features:[s.Jv_([{provide:l.H,useExisting:h}])],attrs:["bitBadge",""],ngContentSelectors:["*"],decls:2,vars:3,consts:[[3,"ngClass"]],template:function(e,t){1&e&&(s.NAR(),s.j41(0,"span",0),s.SdG(1),s.k0s()),2&e&&s.Y8G("ngClass",s.eq3(1,c,t.truncate()))},dependencies:[n.MD,n.YU],encapsulation:2,changeDetection:0})},47836:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{}},47911:(e,t,i)=>{"use strict";i.d(t,{J:()=>a});var n=i(28202),r=i(31442),s=i(61325),o=i(30550);function a(e,t){return i=>{const a=s.n.getType(i),l=s.n.isDeleted(i);if("favorites"===e.type&&!i.favorite)return!1;if("card"===e.type&&a!==r.gC.Card)return!1;if("identity"===e.type&&a!==r.gC.Identity)return!1;if("login"===e.type&&a!==r.gC.Login)return!1;if("note"===e.type&&a!==r.gC.SecureNote)return!1;if("sshKey"===e.type&&a!==r.gC.SshKey)return!1;if("trash"===e.type&&!l)return!1;if("trash"!==e.type&&l)return!1;if(t){if("archive"===e.type&&!s.n.isArchived(i))return!1;if("archive"!==e.type&&s.n.isArchived(i))return!1}return(e.folderId!==n.I_||null==i.folderId)&&((void 0===e.folderId||e.folderId===o.u||e.folderId===n.I_||i.folderId===e.folderId)&&(e.collectionId!==o.u&&((e.collectionId!==n.I_||!(null==i.organizationId||null!=i.collectionIds&&i.collectionIds.length>0))&&(!!(void 0===e.collectionId||e.collectionId===o.u||e.collectionId===n.I_||null!=i.collectionIds&&i.collectionIds.includes(e.collectionId))&&((e.organizationId!==n.I_||null==i.organizationId)&&(void 0===e.organizationId||e.organizationId===n.I_||i.organizationId===e.organizationId))))))}}},48180:(e,t,i)=>{"use strict";i.d(t,{P:()=>n});class n{}},48312:(e,t,i)=>{"use strict";i.d(t,{r:()=>n});class n{constructor(e=void 0){this.keys=e}classify(e){var t;const i=JSON.parse(JSON.stringify(e)),n=null!==(t=this.keys)&&void 0!==t?t:Object.keys(i),r={};for(const s of n)r[s]=i[s];return{disclosed:null,secret:r}}declassify(e,t){var i;const n={},r=null!==(i=this.keys)&&void 0!==i?i:Object.keys(t);for(const s of r)n[s]=t[s];return n}}},48541:(e,t,i)=>{"use strict";i.d(t,{G:()=>n});class n{constructor(e,t){this.publicKey=e,this.encryptedPrivateKey=t}}},48550:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});class n{constructor(e){this.text=null,e&&(this.hidden=e.hidden)}get maskedText(){return null!=this.text?"••••••••":null}static fromJSON(e){return null==e?null:Object.assign(new n,e)}}},48856:(e,t,i)=>{"use strict";i.d(t,{T:()=>o});var n=i(78991);class r{constructor(e,t){this.site=e,this.extensions=t,(0,n.ol)(this)}}var s=i(25304);class o{constructor(e,t){this.allowedSites=e,this.allowedFields=t,this.allPermission="default",this.siteRegistrations=new Map,this.sitePermissions=new Map,this.vendorRegistrations=new Map,this.vendorPermissions=new Map,this.extensionRegistrations=new Array,this.extensionsBySiteByVendor=new Map,Object.freeze(this.allowedFields),Object.freeze(this.allowedSites)}registerSite(e){if(!this.allowedSites.includes(e.id))return this;const t=e.availableFields.filter(e=>this.allowedFields.includes(e)),i=(0,n.ol)({id:e.id,availableFields:t});return this.siteRegistrations.has(e.id)||this.siteRegistrations.set(e.id,i),this}site(e){return this.siteRegistrations.get(e)}sites(){const e=[];for(const[t,i]of this.siteRegistrations.entries()){const n={site:i},r=this.sitePermissions.get(t);r&&(n.permission=r),e.push(n)}return e}registerVendor(e){if(!this.vendorRegistrations.has(e.id)){const t=(0,n.ol)(e);this.vendorRegistrations.set(e.id,t)}return this}vendor(e){return this.vendorRegistrations.get(e)}vendors(){const e=[];for(const[t,i]of this.vendorRegistrations.entries()){const n={vendor:i},r=this.vendorPermissions.get(t);r&&(n.permission=r),e.push(n)}return e}setPermission(e,t){if(!s.FG.includes(t))throw new Error(`invalid extension permission: ${t}`);if("all"in e&&e.all)this.allPermission=t;else if("vendor"in e)this.vendorPermissions.set(e.vendor,t);else{if(!("site"in e))throw new Error(`Unrecognized extension set received: ${JSON.stringify(e)}.`);this.allowedSites.includes(e.site)&&this.sitePermissions.set(e.site,t)}return this}permission(e){return"all"in e&&e.all?this.allPermission:"vendor"in e?this.vendorPermissions.get(e.vendor):"site"in e?this.sitePermissions.get(e.site):void 0}permissions(){const e=[];e.push({set:{all:!0},permission:this.allPermission});for(const[t,i]of this.sitePermissions.entries())e.push({set:{site:t},permission:i});for(const[t,i]of this.vendorPermissions.entries())e.push({set:{vendor:t},permission:i});return e}registerExtension(e){var t;const i=this.siteRegistrations.get(e.site.id),n=this.vendorRegistrations.get(e.product.vendor.id);if(!i||!n)return this;const r=null!==(t=this.extensionsBySiteByVendor.get(e.site.id))&&void 0!==t?t:new Map;if(r.has(e.product.vendor.id))return this;const s={vendor:n};e.product.name&&(s.name=e.product.name);const o=Object.freeze({site:i,product:Object.freeze(s),host:Object.freeze(Object.assign({},e.host)),requestedFields:Object.freeze([...e.requestedFields])}),a=this.extensionRegistrations.push(o)-1;return r.set(n.id,a),this.extensionsBySiteByVendor.set(i.id,r),this}extension(e,t){var i,n;const r=null!==(n=null===(i=this.extensionsBySiteByVendor.get(e))||void 0===i?void 0:i.get(t))&&void 0!==n?n:-1;return r<0?void 0:this.extensionRegistrations[r]}getPermissions(e,t){return[this.sitePermissions.get(e),this.vendorPermissions.get(t),this.allPermission].filter(e=>!!e)}extensions(){const e=[];for(const t of this.extensionRegistrations){const i=this.getPermissions(t.site.id,t.product.vendor.id);e.push({extension:t,permissions:i})}return e}build(e){var t,i;const n=this.siteRegistrations.get(e);if(!n)return;if("deny"===this.allPermission)return new r(n,new Map);const s=new Map,o=null!==(i=null===(t=this.extensionsBySiteByVendor.get(e))||void 0===t?void 0:t.entries())&&void 0!==i?i:[];for(const[r,l]of o){const t=a(this.getPermissions(e,r),this.extensionRegistrations[l]);t&&s.set(r,t)}return new r(n,s)}}function a(e,t){if(!e.includes("deny")){if(e.includes("allow"))return t;if(!e.includes("none")){if(e.includes("default"))return t;throw new Error("failed to recognize any permissions")}}}},49247:(e,t,i)=>{"use strict";i.d(t,{C:()=>n});class n{}},49272:(e,t,i)=>{"use strict";i.d(t,{f:()=>m,H:()=>n.H});var n=i(11009),r=i(28202),s=i(25607),o=i(20702),a=i(67097);class l extends o.r{constructor(e){super(e);const t=this.getResponseProperty("MasterPasswordUnlock");null!=t&&"object"==typeof t&&(this.masterPasswordUnlock=new a.v(t))}}var c=i(65791),d=i(97315),u=i(54306),h=i(42700),p=i(98850);class m extends o.r{constructor(e){super(e),this.folders=[],this.collections=[],this.ciphers=[],this.policies=[],this.sends=[];const t=this.getResponseProperty("Profile");null!=t&&(this.profile=new d.l(t));const i=this.getResponseProperty("Folders");null!=i&&(this.folders=i.map(e=>new p.s(e)));const n=this.getResponseProperty("Collections");null!=n&&(this.collections=n.map(e=>new r.yv(e)));const o=this.getResponseProperty("Ciphers");null!=o&&(this.ciphers=o.map(e=>new h.N(e)));const a=this.getResponseProperty("Domains");null!=a&&(this.domains=new c.X(a));const m=this.getResponseProperty("Policies");null!=m&&(this.policies=m.map(e=>new s.i(e)));const v=this.getResponseProperty("Sends");null!=v&&(this.sends=v.map(e=>new u.o(e)));const f=this.getResponseProperty("UserDecryption");null!=f&&"object"==typeof f&&(this.userDecryption=new l(f))}}},49355:(e,t,i)=>{"use strict";i.d(t,{k:()=>u});var n=i(77468),r=i(33812),s=i(58625),o=i(63457),a=i(83691),l=i(50700),c=i(38140),d=i(88016);class u{set password(e){this.updatePasswordStrength(e)}constructor(e,t){this.i18nService=e,this.passwordStrengthService=t,this.size="default",this.showText=!1,this.passwordStrengthScore=new r.bkB,this.passwordScoreTextWithColor=new r.bkB,this.scoreWidth=0,this.color="danger"}ngOnChanges(){this.passwordStrengthTimeout=setTimeout(()=>{switch(this.scoreWidth=null==this.passwordScore?0:20*(this.passwordScore+1),this.passwordScore){case 4:this.color="success",this.text=this.i18nService.t("strong");break;case 3:this.color="primary",this.text=this.i18nService.t("good");break;case 2:this.color="warning",this.text=this.i18nService.t("weak");break;default:this.color="danger",this.text=null!=this.passwordScore?this.i18nService.t("weak"):null}this.passwordScoreTextWithColor.emit({color:this.color,text:this.text})},300)}updatePasswordStrength(e){var t;null!=this.passwordStrengthTimeout&&clearTimeout(this.passwordStrengthTimeout);const i=this.passwordStrengthService.getPasswordStrength(e,this.email,null===(t=this.name)||void 0===t?void 0:t.trim().toLowerCase().split(" "));this.passwordScore=null==i?null:i.score,this.passwordStrengthScore.emit(this.passwordScore)}}u.ɵfac=function(e){return new(e||u)(r.rXU(l.W),r.rXU(o.Q))},u.ɵcmp=r.VBU({type:u,selectors:[["tools-password-strength"]],inputs:{size:"size",showText:"showText",email:"email",name:"name",password:"password"},outputs:{passwordStrengthScore:"passwordStrengthScore",passwordScoreTextWithColor:"passwordScoreTextWithColor"},features:[r.OA$],decls:4,vars:9,consts:[[3,"size","text","bgColor","showText","barWidth"],["aria-live","polite",1,"tw-sr-only"]],template:function(e,t){1&e&&(r.nrm(0,"bit-progress",0),r.j41(1,"div",1),r.EFF(2),r.nI1(3,"i18n"),r.k0s()),2&e&&(r.Y8G("size",t.size)("text",t.text)("bgColor",t.color)("showText",t.showText)("barWidth",t.scoreWidth),r.R7$(2),r.SpI(" ",r.i5U(3,6,"passwordStrengthScore",t.text),"\n"))},dependencies:[n.MD,s.p,a.E,c.X,d.$],encapsulation:2})},49492:(e,t,i)=>{"use strict";i.d(t,{H:()=>z,n:()=>L});var n=i(74208),r=i(66046),s=i(72245),o=i(14803),a=i(3204),l=i(84488),c=i(3633),d=(i(51122),i(33812)),u=i(91240),h=i(35500),p=i(77468),m=i(6056),v=i(54471),f=i(37856),g=i(88016),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const b=e=>({active:e}),w=e=>({$implicit:e}),S=e=>({"disabled-organization":e}),I=(e,t)=>({"bwi-angle-right":e,"bwi-angle-down":t});function k(e,t){if(1&e){const e=d.RV6();d.j41(0,"button",9),d.nI1(1,"i18n"),d.nI1(2,"i18n"),d.bIt("click",function(){n.eBV(e);const t=d.XpG(3);return n.Njj(t.onFilterSelect(t.headerNode))}),d.j41(3,"h3",10),d.EFF(4),d.nI1(5,"i18n"),d.k0s()()}if(2&e){const e=d.XpG(3);d.Y8G("appA11yTitle",d.ai1("",d.bMT(1,5,e.isOrganizationFilter?"vault":"filter"),": ",d.bMT(2,7,e.headerNode.node.name))),d.R7$(3),d.Y8G("ngClass",d.eq3(11,b,e.isAllVaultsSelected||e.isNodeSelected(e.headerNode))),d.R7$(),d.SpI("  ",d.bMT(5,9,e.headerNode.node.name)," ")}}function C(e,t){if(1&e&&(d.j41(0,"h3",11),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e){const e=d.XpG(3);d.R7$(),d.SpI("  ",d.bMT(2,1,e.headerNode.node.name)," ")}}function T(e,t){if(1&e){const e=d.RV6();d.j41(0,"div",4)(1,"button",5),d.nI1(2,"i18n"),d.nI1(3,"i18n"),d.bIt("click",function(){n.eBV(e);const t=d.XpG(2);return n.Njj(t.toggleCollapse(t.headerNode.node))}),d.nrm(4,"i",6),d.k0s(),d.DNE(5,k,6,13,"button",7)(6,C,3,3,"h3",8),d.k0s()}if(2&e){const e=d.XpG(2);d.R7$(),d.Y8G("appA11yTitle",d.ai1("",d.bMT(2,7,"toggleCollapse"),": ",d.bMT(3,9,e.headerNode.node.name))),d.BMQ("aria-expanded",!e.isCollapsed(e.headerNode.node)),d.R7$(3),d.Y8G("ngClass",e.isCollapsed(e.headerNode.node)?"bwi-angle-right":"bwi-angle-down"),d.R7$(),d.Y8G("ngIf",e.headerInfo.isSelectable),d.R7$(),d.Y8G("ngIf",!e.headerInfo.isSelectable)}}function F(e,t){if(1&e){const e=d.RV6();d.j41(0,"button",25),d.nI1(1,"i18n"),d.bIt("click",function(){n.eBV(e);const t=d.XpG().$implicit,i=d.XpG(4);return n.Njj(i.toggleCollapse(t.node))}),d.nrm(2,"i",6),d.k0s()}if(2&e){const e=d.XpG().$implicit,t=d.XpG(4);d.Y8G("appA11yTitle",d.ai1("",d.bMT(1,6,"toggleCollapse"),": ",e.node.name)),d.BMQ("aria-expanded",!t.isCollapsed(e.node))("aria-controls",e.node.name+"_children"),d.R7$(2),d.Y8G("ngClass",d.l_i(8,I,t.isCollapsed(e.node),!t.isCollapsed(e.node)))}}function R(e,t){if(1&e&&d.nrm(0,"i",26),2&e){const e=d.XpG().$implicit;d.HbH(d.VkB("bwi bwi-fw ",e.node.icon))}}function P(e,t){if(1&e){const e=d.RV6();d.j41(0,"button",27),d.nI1(1,"i18n"),d.bIt("click",function(){n.eBV(e);const t=d.XpG().$implicit,i=d.XpG(4);return n.Njj(i.onEdit(t))}),d.nrm(2,"i",28),d.k0s()}if(2&e){const e=d.XpG().$implicit,t=d.XpG(4);d.Y8G("appA11yTitle",d.mNQ(d.brH(1,2,"editWithName",t.editInfo.filterName,e.node.name)))}}function x(e,t){1&e&&(d.nrm(0,"i",29),d.nI1(1,"i18n"),d.nI1(2,"i18n")),2&e&&(d.Y8G("appA11yTitle",d.mNQ(d.bMT(1,3,"organizationIsDisabled"))),d.BMQ("aria-label",d.bMT(2,5,"organizationIsDisabled")))}function $(e,t){1&e&&d.eu8(0)}function E(e,t){if(1&e&&(d.qex(0),d.DNE(1,$,1,0,"ng-container",30),d.bVm()),2&e){const e=d.XpG().$implicit,t=d.XpG(4);d.R7$(),d.Y8G("ngComponentOutlet",t.optionsInfo.component)("ngComponentOutletInjector",t.createInjector(e.node))}}function A(e,t){1&e&&(d.qex(0),d.nrm(1,"app-premium-badge"),d.bVm())}function D(e,t){1&e&&d.eu8(0)}function O(e,t){if(1&e&&(d.j41(0,"ul",31),d.DNE(1,D,1,0,"ng-container",13),d.k0s()),2&e){const e=d.XpG().$implicit;d.XpG(2);const t=d.sdS(2);d.Y8G("id",e.node.name+"_children"),d.R7$(),d.Y8G("ngTemplateOutlet",t)("ngTemplateOutletContext",d.eq3(3,w,e.children))}}function M(e,t){if(1&e){const e=d.RV6();d.j41(0,"li",16)(1,"span",17),d.DNE(2,F,3,11,"button",18),d.j41(3,"button",19),d.nI1(4,"i18n"),d.bIt("click",function(){const t=n.eBV(e).$implicit,i=d.XpG(4);return n.Njj(i.onFilterSelect(t))}),d.DNE(5,R,1,3,"i",20),d.EFF(6),d.k0s(),d.j41(7,"span",21),d.DNE(8,P,3,6,"button",22)(9,x,3,7,"i",23)(10,E,2,2,"ng-container",1)(11,A,2,0,"ng-container",1),d.k0s()(),d.DNE(12,O,2,5,"ul",24),d.k0s()}if(2&e){const e=t.$implicit,i=d.XpG(4);d.Y8G("ngClass",d.eq3(15,b,i.isNodeSelected(e))),d.R7$(2),d.Y8G("ngIf",e.children.length),d.R7$(),d.Y8G("appA11yTitle",d.ai1("",i.isOrganizationFilter?"vault":d.bMT(4,13,"filter"),": ",e.node.name))("ngClass",d.eq3(17,S,i.isOrganizationFilter&&!e.node.enabled)),d.R7$(2),d.Y8G("ngIf",0===e.children.length),d.R7$(),d.SpI("  ",e.node.name," "),d.R7$(2),d.Y8G("ngIf",i.editInfo&&e.node.id),d.R7$(),d.Y8G("ngIf",i.isOrganizationFilter&&!e.node.enabled),d.R7$(),d.Y8G("ngIf",i.optionsInfo&&!e.node.hideOptions),d.R7$(),d.Y8G("ngIf",i.premiumFeature),d.R7$(),d.Y8G("ngIf",e.children.length&&!i.isCollapsed(e.node))}}function U(e,t){if(1&e&&d.DNE(0,M,13,19,"li",15),2&e){const e=t.$implicit;d.Y8G("ngForOf",e)}}function G(e,t){1&e&&d.eu8(0)}function j(e,t){if(1&e&&(d.j41(0,"li",32)(1,"span",17)(2,"a",33),d.nrm(3,"i",34),d.EFF(4),d.nI1(5,"i18n"),d.k0s()()()),2&e){const e=d.XpG(3);d.R7$(2),d.Y8G("routerLink",d.mNQ(e.addInfo.route)),d.R7$(2),d.SpI("  ",d.bMT(5,3,e.addInfo.text)," ")}}function N(e,t){if(1&e&&(d.j41(0,"ul",12),d.DNE(1,U,1,1,"ng-template",null,0,d.C5r)(3,G,1,0,"ng-container",13)(4,j,6,5,"li",14),d.k0s()),2&e){const e=d.sdS(2),t=d.XpG(2);d.Y8G("id",d.VkB("",t.headerNode.node.name,"-filters")),d.R7$(3),d.Y8G("ngTemplateOutlet",e)("ngTemplateOutletContext",d.eq3(5,w,t.filters)),d.R7$(),d.Y8G("ngIf",t.showAddLink)}}function V(e,t){1&e&&d.nrm(0,"hr")}function B(e,t){if(1&e&&(d.qex(0),d.DNE(1,T,7,11,"div",2)(2,N,5,7,"ul",3)(3,V,1,0,"hr",1),d.bVm()),2&e){const e=d.XpG();d.R7$(),d.Y8G("ngIf",e.headerInfo.showHeader),d.R7$(),d.Y8G("ngIf",!e.isCollapsed(e.headerNode.node)),d.R7$(),d.Y8G("ngIf",e.divider)}}class z{constructor(e,t,i){this.vaultFilterService=e,this.injector=t,this.accountService=i,this.destroy$=new r.B,this.activeUserId$=(0,c.F6)(this.accountService.activeAccount$),this.collapsedFilterNodes=new Set,this.injectors=new Map,this.vaultFilterService.collapsedFilterNodes$.pipe((0,o.Q)(this.destroy$)).subscribe(e=>{this.collapsedFilterNodes=e})}ngOnInit(){return y(this,void 0,void 0,function*(){var e,t;null===(t=null===(e=this.section)||void 0===e?void 0:e.data$)||void 0===t||t.pipe((0,o.Q)(this.destroy$)).subscribe(e=>{this.data=e})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get headerNode(){return this.data}get headerInfo(){return this.section.header}get filters(){var e;return null===(e=this.data)||void 0===e?void 0:e.children}get isOrganizationFilter(){return this.data.node instanceof l.y}get isAllVaultsSelected(){return this.isOrganizationFilter&&!this.activeFilter.selectedOrganizationNode}isNodeSelected(e){const{organizationId:t,cipherTypeId:i,folderId:n,collectionId:r,isCollectionSelected:s}=this.activeFilter,o="AllCollections"===(null==e?void 0:e.node.id)&&(s||"AllCollections"===r);return t===(null==e?void 0:e.node.id)||i===(null==e?void 0:e.node.id)||n===(null==e?void 0:e.node.id)||o}onFilterSelect(e){return y(this,void 0,void 0,function*(){var t,i,n;(null===(i=null===(t=this.section)||void 0===t?void 0:t.premiumOptions)||void 0===i?void 0:i.blockFilterAction)?yield this.section.premiumOptions.blockFilterAction():yield null===(n=this.section)||void 0===n?void 0:n.action(e)})}get editInfo(){var e;return null===(e=this.section)||void 0===e?void 0:e.edit}onEdit(e){var t,i;null===(i=null===(t=this.section)||void 0===t?void 0:t.edit)||void 0===i||i.action(e.node)}get addInfo(){return this.section.add}get showAddLink(){return this.section.add&&this.section.add.route}onAdd(){return y(this,void 0,void 0,function*(){var e,t;null===(t=null===(e=this.section)||void 0===e?void 0:e.add)||void 0===t||t.action()})}get optionsInfo(){var e;return null===(e=this.section)||void 0===e?void 0:e.options}get premiumFeature(){var e,t;return null===(t=null===(e=this.section)||void 0===e?void 0:e.premiumOptions)||void 0===t?void 0:t.showBadgeForNonPremium}get divider(){var e;return null===(e=this.section)||void 0===e?void 0:e.divider}isCollapsed(e){return this.collapsedFilterNodes.has(e.id)}toggleCollapse(e){return y(this,void 0,void 0,function*(){this.collapsedFilterNodes.has(e.id)?this.collapsedFilterNodes.delete(e.id):this.collapsedFilterNodes.add(e.id);const t=yield(0,s._)(this.activeUserId$);yield this.vaultFilterService.setCollapsedFilterNodes(this.collapsedFilterNodes,t)})}createInjector(e){let t=this.injectors.get(e.id);if(!t){const i=this.section.data$.pipe((0,a.T)(t=>{var i,n;return null===(n=null===(i=null==t?void 0:t.children)||void 0===i?void 0:i.find(t=>t.node.id===e.id))||void 0===n?void 0:n.node}));t=n.zZn.create({providers:[{provide:L,useValue:i}],parent:this.injector}),this.injectors.set(e.id,t)}return t}}z.ɵfac=function(e){return new(e||z)(d.rXU(u.u),d.rXU(n.zZn),d.rXU(h.Di))},z.ɵcmp=d.VBU({type:z,selectors:[["app-filter-section"]],inputs:{activeFilter:"activeFilter",section:"section"},standalone:!1,decls:1,vars:1,consts:[["recursiveFilters",""],[4,"ngIf"],["class","filter-heading",4,"ngIf"],["class","filter-options",3,"id",4,"ngIf"],[1,"filter-heading"],["type","button","aria-controls","sub-filters",1,"toggle-button",3,"click","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-fw",3,"ngClass"],["type","button","class","filter-button",3,"appA11yTitle","click",4,"ngIf"],["class","filter-title",4,"ngIf"],["type","button",1,"filter-button",3,"click","appA11yTitle"],[3,"ngClass"],[1,"filter-title"],[1,"filter-options",3,"id"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["class","filter-option",4,"ngIf"],["class","filter-option",3,"ngClass",4,"ngFor","ngForOf"],[1,"filter-option",3,"ngClass"],[1,"filter-buttons"],["type","button","class","toggle-button",3,"appA11yTitle","click",4,"ngIf"],["type","button",1,"filter-button",3,"click","appA11yTitle","ngClass"],["aria-hidden","true",3,"class",4,"ngIf"],[1,"tw-ml-auto","tw-flex","tw-items-center"],["type","button","class","edit-button",3,"appA11yTitle","click",4,"ngIf"],["class","org-options bwi bwi-fw bwi-exclamation-triangle text-danger",3,"appA11yTitle",4,"ngIf"],["class","nested-filter-options",3,"id",4,"ngIf"],["type","button",1,"toggle-button",3,"click","appA11yTitle"],["aria-hidden","true"],["type","button",1,"edit-button",3,"click","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-pencil","bwi-fw"],[1,"org-options","bwi","bwi-fw","bwi-exclamation-triangle","text-danger",3,"appA11yTitle"],[4,"ngComponentOutlet","ngComponentOutletInjector"],[1,"nested-filter-options",3,"id"],[1,"filter-option"],["href","#",1,"filter-button","tw-truncate",3,"routerLink"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"]],template:function(e,t){1&e&&d.DNE(0,B,4,3,"ng-container",1),2&e&&d.Y8G("ngIf",t.filters&&t.filters.length)},dependencies:[p.YU,p.OI,p.Sq,p.bT,p.T3,m.Wk,v.C,f.a,g.$],encapsulation:2});const L=new n.nKC("OptionsInput")},49519:(e,t,i)=>{"use strict";i.d(t,{B:()=>l});var n=i(94573),r=i(58363),s=i(78781),o=i(33812),a=i(70171);class l{constructor(e,t,i){this.el=e,this.ngZone=t,this.focusableElement=i,this.appAutofocus=(0,n.hFB)(void 0,{transform:n.L39}),this.focused=!1}ngAfterContentChecked(){if(this.focused||!this.appAutofocus()||s.A.isMobileBrowser)return;null!=this.getElement()&&(this.ngZone.isStable?this.focus():this.ngZone.onStable.pipe((0,r.s)(1)).subscribe(this.focus.bind(this)))}focus(){const e=this.getElement();e&&(e.focus(),this.focused=e===document.activeElement)}getElement(){return this.focusableElement?this.focusableElement.getFocusTarget():this.el.nativeElement}}l.ɵfac=function(e){return new(e||l)(o.rXU(o.aKT),o.rXU(o.SKi),o.rXU(a.H,8))},l.ɵdir=o.FsC({type:l,selectors:[["","appAutofocus",""],["","bitAutofocus",""]],inputs:{appAutofocus:[1,"appAutofocus"]}})},49608:(e,t,i)=>{"use strict";i.d(t,{j:()=>l});var n=i(37831),r=i(94573),s=i(33812);class o{constructor(e){this.templateRef=e}}o.ɵfac=function(e){return new(e||o)(s.rXU(s.C4Q))},o.ɵdir=s.FsC({type:o,selectors:[["","bitTabLabel",""]]});function a(e,t){1&e&&s.SdG(0)}class l{get content(){return this._contentPortal}constructor(e){this._viewContainerRef=e,this.disabled=(0,r.hFB)(!1),this.textLabel=(0,r.hFB)("",{alias:"label"}),this.contentTabIndex=(0,r.hFB)(),this.implicitContent=r.ebz.required(s.C4Q),this._contentPortal=null}ngOnInit(){this._contentPortal=new n.VA(this.implicitContent(),this._viewContainerRef)}}l.ɵfac=function(e){return new(e||l)(s.rXU(s.c1b))},l.ɵcmp=s.VBU({type:l,selectors:[["bit-tab"]],contentQueries:function(e,t,i){if(1&e&&s.wni(i,o,5),2&e){let e;s.mGM(e=s.lsd())&&(t.templateLabel=e.first)}},viewQuery:function(e,t){1&e&&s.wEZ(t.implicitContent,s.C4Q,5),2&e&&s.NyB()},hostAttrs:["role","tabpanel"],inputs:{disabled:[1,"disabled"],textLabel:[1,"label","textLabel"],contentTabIndex:[1,"contentTabIndex"]},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(s.NAR(),s.PeT(0,a,1,0,"ng-template"))},encapsulation:2})},49701:()=>{},50342:(e,t,i)=>{"use strict";i.d(t,{V:()=>k});var n=i(51757),r=i(81285),s=i(81525),o=i(25065),a=i(33812),l=i(62166),c=i(77468),d=i(26657),u=i(45154),h=i(56898),p=i(44432),m=i(7730),v=i(68016),f=i(58806),g=i(88016),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function b(e,t){1&e&&a.nrm(0,"app-user-verification-form-input",10)}function w(e,t){if(1&e&&(a.j41(0,"bit-callout",11),a.EFF(1),a.nI1(2,"i18n"),a.k0s()),2&e){const e=a.XpG();a.R7$(),a.JRh(a.bMT(2,1,e.data.apiKeyWarning))}}function S(e,t){if(1&e&&(a.j41(0,"bit-callout",12),a.nI1(1,"i18n"),a.j41(2,"p",13)(3,"strong"),a.EFF(4,"client_id:"),a.k0s(),a.nrm(5,"br"),a.j41(6,"code"),a.EFF(7),a.k0s()(),a.j41(8,"p",13)(9,"strong"),a.EFF(10,"client_secret:"),a.k0s(),a.nrm(11,"br"),a.j41(12,"code"),a.EFF(13),a.k0s()(),a.j41(14,"p",13)(15,"strong"),a.EFF(16,"scope:"),a.k0s(),a.nrm(17,"br"),a.j41(18,"code"),a.EFF(19),a.k0s()(),a.j41(20,"p",14)(21,"strong"),a.EFF(22,"grant_type:"),a.k0s(),a.nrm(23,"br"),a.j41(24,"code"),a.EFF(25),a.k0s()()()),2&e){const e=a.XpG();a.Y8G("title",a.mNQ(a.bMT(1,6,"oauth2ClientCredentials"))),a.R7$(7),a.JRh(e.clientId),a.R7$(6),a.JRh(e.clientSecret),a.R7$(6),a.JRh(e.data.scope),a.R7$(6),a.JRh(e.data.grantType)}}function I(e,t){if(1&e&&(a.j41(0,"button",15)(1,"span"),a.EFF(2),a.nI1(3,"i18n"),a.k0s()()),2&e){const e=a.XpG();a.R7$(2),a.JRh(a.bMT(3,1,e.data.isRotation?"rotateApiKey":"viewApiKey"))}}class k{constructor(e,t,i){this.data=e,this.formBuilder=t,this.userVerificationService=i,this.formGroup=this.formBuilder.group({masterPassword:[null,[n.k0.required]]}),this.submit=()=>y(this,void 0,void 0,function*(){if(this.formGroup.invalid)return void this.formGroup.markAllAsTouched();const e=yield this.userVerificationService.buildRequest(this.formGroup.value.masterPassword).then(e=>this.data.postKey(this.data.entityId,e));this.clientSecret=e.apiKey,this.clientId=`${this.data.keyType}.${this.data.entityId}`})}}k.open=(e,t)=>e.open(k,t),k.ɵfac=function(e){return new(e||k)(a.rXU(s.Qs),a.rXU(n.ok),a.rXU(l.i))},k.ɵcmp=a.VBU({type:k,selectors:[["ng-component"]],decls:17,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["bitTypography","body1"],["formControlName","masterPassword",4,"ngIf"],["type","warning",4,"ngIf"],["type","info","icon","bwi-key",3,"title",4,"ngIf"],["bitDialogFooter",""],["type","submit","buttonType","primary","bitButton","","bitFormButton","",4,"ngIf"],["type","button","bitButton","","bitFormButton","","bitDialogClose",""],["formControlName","masterPassword"],["type","warning"],["type","info","icon","bwi-key",3,"title"],["bitTypography","body1",1,"tw-mb-1"],["bitTypography","body1",1,"tw-mb-0"],["type","submit","buttonType","primary","bitButton","","bitFormButton",""]],template:function(e,t){1&e&&(a.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),a.EFF(3),a.nI1(4,"i18n"),a.k0s(),a.j41(5,"div",2)(6,"p",3),a.EFF(7),a.nI1(8,"i18n"),a.k0s(),a.DNE(9,b,1,0,"app-user-verification-form-input",4)(10,w,3,3,"bit-callout",5)(11,S,26,8,"bit-callout",6),a.k0s(),a.qex(12,7),a.DNE(13,I,4,3,"button",8),a.j41(14,"button",9),a.EFF(15),a.nI1(16,"i18n"),a.k0s(),a.bVm(),a.k0s()()),2&e&&(a.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),a.R7$(3),a.JRh(a.bMT(4,9,t.data.apiKeyTitle)),a.R7$(4),a.JRh(a.bMT(8,11,t.data.apiKeyDescription)),a.R7$(2),a.Y8G("ngIf",!t.clientSecret),a.R7$(),a.Y8G("ngIf",t.clientSecret),a.R7$(),a.Y8G("ngIf",t.clientSecret),a.R7$(2),a.Y8G("ngIf",!t.clientSecret),a.R7$(2),a.SpI(" ",a.bMT(16,13,"close")," "))},dependencies:[o.G,c.bT,n.qT,n.BC,n.cb,n.j4,n.JD,d.$,u.L,h.Q,p.G,m.I,v.m,f.r,r.wV,g.$],encapsulation:2})},50352:(e,t,i)=>{"use strict";i.d(t,{P:()=>a});var n=i(94573),r=i(51757),s=i(15033),o=i(33812);class a{constructor(e){this.ngControl=e,this.inputClasses=["tw-appearance-none","tw-outline-none","tw-box-border","tw-relative","tw-transition","tw-cursor-pointer","disabled:tw-cursor-default","tw-inline-block","tw-align-sub","tw-flex-none","!tw-p-1","tw-h-[calc(1.12rem_+_theme(spacing.2))]","tw-w-[calc(1.12rem_+_theme(spacing.2))]","after:tw-inset-1","!-tw-mt-1","!-tw-mb-1","!-tw-ms-1","before:tw-content-['']","before:tw-block","before:tw-inset-0","before:tw-h-[1.12rem]","before:tw-w-[1.12rem]","before:tw-rounded","before:tw-border","before:tw-border-solid","before:tw-border-secondary-500","before:tw-box-border","after:tw-content-['']","after:tw-block","after:tw-absolute","after:tw-inset-0","after:tw-h-[1.12rem]","after:tw-w-[1.12rem]","after:tw-box-border","hover:before:tw-border-2","[&>label]:before:tw-border-2","[&:not(bit-form-control_*)]:focus-visible:before:tw-ring-2","[&:not(bit-form-control_*)]:focus-visible:before:tw-ring-offset-2","[&:not(bit-form-control_*)]:focus-visible:before:tw-ring-primary-600","disabled:before:tw-cursor-default","disabled:before:tw-border","disabled:before:hover:tw-border","disabled:before:tw-bg-secondary-100","disabled:hover:before:tw-bg-secondary-100","checked:before:tw-bg-primary-600","checked:before:tw-border-primary-600","checked:before:hover:tw-bg-primary-700","checked:before:hover:tw-border-primary-700","[&>label:hover]:checked:before:tw-bg-primary-700","[&>label:hover]:checked:before:tw-border-primary-700","checked:after:tw-bg-text-contrast","checked:after:tw-mask-position-[center]","checked:after:tw-mask-repeat-[no-repeat]","checked:disabled:before:tw-border-secondary-100","checked:disabled:hover:before:tw-border-secondary-100","checked:disabled:before:tw-bg-secondary-100","checked:disabled:after:tw-bg-text-muted","[&:not(:indeterminate)]:checked:after:tw-mask-image-[var(--mask-image)]","indeterminate:after:tw-mask-image-[var(--indeterminate-mask-image)]","indeterminate:before:tw-bg-primary-600","indeterminate:before:tw-border-primary-600","indeterminate:hover:before:tw-bg-primary-700","indeterminate:hover:before:tw-border-primary-700","[&>label:hover]:indeterminate:before:tw-bg-primary-700","[&>label:hover]:indeterminate:before:tw-border-primary-700","indeterminate:after:tw-bg-text-contrast","indeterminate:after:tw-mask-position-[center]","indeterminate:after:tw-mask-repeat-[no-repeat]","indeterminate:after:tw-mask-image-[var(--indeterminate-mask-image)]","indeterminate:disabled:tw-border-secondary-100","indeterminate:disabled:tw-bg-secondary-100","indeterminate:disabled:after:tw-bg-text-muted"],this.maskImage='url(\'data:image/svg+xml,%3Csvg class="svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10" height="10" viewBox="0 0 10 10"%3E%3Cpath d="M0.5 6.2L2.9 8.6L9.5 1.4" fill="none" stroke="white" stroke-width="2"%3E%3C/path%3E%3C/svg%3E\')',this.indeterminateImage='url(\'data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="none" viewBox="0 0 13 13"%3E%3Cpath stroke="%23fff" stroke-width="2" d="M2.5 6.5h8"/%3E%3C/svg%3E%0A\')',this.disabledInput=(0,n.hFB)(!1,{transform:n.L39,alias:"disabled"})}get disabled(){var e;return this.disabledInput()||(null===(e=this.ngControl)||void 0===e?void 0:e.disabled)||!1}get required(){var e,t,i;return null!==(i=null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.control)||void 0===t?void 0:t.hasValidator(r.k0.requiredTrue))&&void 0!==i&&i}get hasError(){var e,t;return!("INVALID"!==(null===(e=this.ngControl)||void 0===e?void 0:e.status)||!(null===(t=this.ngControl)||void 0===t?void 0:t.touched))}get error(){var e,t;const i=null!==(t=null===(e=this.ngControl)||void 0===e?void 0:e.errors)&&void 0!==t?t:{},n=Object.keys(i)[0];return[n,i[n]]}}a.ɵfac=function(e){return new(e||a)(o.rXU(r.vO,10))},a.ɵcmp=o.VBU({type:a,selectors:[["input","type","checkbox","bitCheckbox",""]],hostVars:7,hostBindings:function(e,t){2&e&&(o.Avn("disabled",t.disabled),o.HbH(t.inputClasses),o.xc7("--mask-image",t.maskImage)("--indeterminate-mask-image",t.indeterminateImage))},inputs:{disabledInput:[1,"disabled","disabledInput"]},features:[o.Jv_([{provide:s.J,useExisting:a}])],attrs:["type","checkbox","bitCheckbox",""],decls:0,vars:0,template:function(e,t){},encapsulation:2})},50451:(e,t,i)=>{"use strict";i.d(t,{A:()=>m});var n=i(36501),r=i(7919),s=i(42234),o=i(59281),a=i(9184),l=i(91304),c=i(82696),d=i(22203),u=i(11314),h=i(27280),p=i(96540);class m{constructor(e,t){if(this.id="",this.edit=!1,this.viewPassword=!0,this.organizationUseTotp=!1,this.favorite=!1,this.type=r.gC.Login,this.name="",this.reprompt=n.b.None,null!=e){switch(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.edit=e.edit,this.viewPassword=e.viewPassword,this.permissions=e.permissions,this.organizationUseTotp=e.organizationUseTotp,this.favorite=e.favorite,this.revisionDate=e.revisionDate,this.type=e.type,this.name=e.name,this.notes=e.notes,this.collectionIds=null!=t?t:e.collectionIds,this.creationDate=e.creationDate,this.deletedDate=e.deletedDate,this.archivedDate=e.archivedDate,this.reprompt=e.reprompt,this.key=e.key,this.type){case r.gC.Login:this.login=new d.k(e.login);break;case r.gC.SecureNote:this.secureNote=new h.e(e.secureNote);break;case r.gC.Card:this.card=new a.b(e.card);break;case r.gC.Identity:this.identity=new c.j(e.identity);break;case r.gC.SshKey:this.sshKey=new p.E(e.sshKey)}null!=e.fields&&(this.fields=e.fields.map(e=>new l.N(e))),null!=e.attachments&&(this.attachments=e.attachments.map(e=>new o.e(e))),null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map(e=>new u.k(e)))}else this.creationDate=this.revisionDate=(new Date).toISOString()}static fromJSON(e){const t=Object.assign(new m,e);return null!=e.permissions&&(t.permissions=s.a.fromJSON(e.permissions)),t}}},50545:(e,t,i)=>{"use strict";i.d(t,{I:()=>n});class n{constructor(e,t,i,n){this.id=e,this.readOnly=t,this.hidePasswords=i,this.manage=n}}},50700:(e,t,i)=>{"use strict";i.d(t,{W:()=>r});class n{}class r extends n{}},50751:(e,t,i)=>{"use strict";i.d(t,{_:()=>a});var n=i(39306),r=i(17989),s=i(11314),o=i(12022);class a extends r.A{constructor(e){super(),null!=e&&(this.password=new n.k(e.password),this.lastUsedDate=new Date(e.lastUsedDate))}decrypt(e){return this.decryptObj(this,new o.j(this),["password"],e,"DomainType: PasswordHistory")}toPasswordHistoryData(){const e=new s.k;return e.lastUsedDate=this.lastUsedDate.toISOString(),this.buildDataModel(this,e,{password:null}),e}static fromJSON(e){if(null==e)return;const t=new a;return t.password=n.k.fromJSON(e.password),t.lastUsedDate=new Date(e.lastUsedDate),t}toSdkPasswordHistory(){return{password:this.password.toSdk(),lastUsedDate:this.lastUsedDate.toISOString()}}static fromSdkPasswordHistory(e){if(!e)return;const t=new a;return t.password=n.k.fromJSON(e.password),t.lastUsedDate=new Date(e.lastUsedDate),t}}},50790:(e,t,i)=>{"use strict";i.d(t,{I:()=>a});var n=i(22166),r=i(74208),s=i(21274),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a{constructor(e){this.dialogService=e}viewPasswordHistory(e){return o(this,void 0,void 0,function*(){(0,n.IN)(this.dialogService,{data:{cipher:e}})})}}a.ɵfac=function(e){return new(e||a)(r.KVO(s.o3))},a.ɵprov=r.jDH({token:a,factory:a.ɵfac})},50866:(e,t,i)=>{"use strict";i.d(t,{R6:()=>a});var n=i(51757),r=i(62963),s=i(33812),o=i(74208);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=s.$C({type:a}),a.ɵinj=o.G2t({imports:[r.G,n.YN,n.X1]});var l=i(7855),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d{constructor(e,t,i,n,r,s,o){this.modalRef=e,this.config=t,this.userVerificationService=i,this.formBuilder=n,this.platformUtilsService=r,this.i18nService=s,this.toastService=o,this.confirmDescription=this.config.confirmDescription,this.confirmButtonText=this.config.confirmButtonText,this.modalTitle=this.config.modalTitle,this.formGroup=this.formBuilder.group({secret:this.formBuilder.control(null)}),this.invalidSecret=!1,this.submit=()=>c(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.invalid){try{yield this.userVerificationService.verifyUser(this.secret.value),this.invalidSecret=!1}catch(e){return this.invalidSecret=!0,void this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:e.message})}this.close(!0)}})}get secret(){return this.formGroup.controls.secret}close(e){this.modalRef.close(e)}}d.ɵfac=function(e){s.QTQ()},d.ɵdir=s.FsC({type:d});var u=i(81525),h=i(21274),p=i(69855),m=i(62166),v=i(37115),f=i(50700),g=i(26657),y=i(45154),b=i(56898),w=i(7730),S=i(68016),I=i(58806),k=i(88016);class C extends d{constructor(e,t,i,n,r,s,o){super(null,e,i,n,r,s,o),this.dialogRef=t}close(e){this.dialogRef.close(e)}}C.ɵfac=function(e){return new(e||C)(s.rXU(u.Qs),s.rXU(h.ce),s.rXU(m.i),s.rXU(n.ok),s.rXU(v.y),s.rXU(f.W),s.rXU(p.f))},C.ɵcmp=s.VBU({type:C,selectors:[["ng-component"]],standalone:!1,features:[s.Vt3],decls:17,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["bitTypography","body1"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(s.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.qex(5,2),s.j41(6,"p",3),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.j41(9,"app-user-verification",4),s.mxI("invalidSecretChange",function(e){return s.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),s.k0s(),s.bVm(),s.qex(10,5),s.j41(11,"button",6),s.EFF(12),s.nI1(13,"i18n"),s.k0s(),s.j41(14,"button",7),s.EFF(15),s.nI1(16,"i18n"),s.k0s(),s.bVm(),s.k0s()()),2&e&&(s.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),s.R7$(3),s.JRh(s.bMT(4,7,t.modalTitle)),s.R7$(4),s.JRh(s.bMT(8,9,t.confirmDescription)),s.R7$(2),s.R50("invalidSecret",t.invalidSecret),s.R7$(3),s.SpI(" ",s.bMT(13,11,t.confirmButtonText)," "),s.R7$(3),s.SpI(" ",s.bMT(16,13,"cancel")," "))},dependencies:[n.qT,n.BC,n.cb,n.j4,n.JD,g.$,y.L,b.Q,w.I,S.m,I.r,l.q,k.$],encapsulation:2})},51122:(e,t,i)=>{"use strict";i.d(t,{$:()=>r});var n=i(31442);class r{get collectionBreadcrumbs(){if(!this.isCollectionSelected)return[];const e=[this.selectedCollectionNode];for(;null!=e[e.length-1].parent;)e.push(e[e.length-1].parent);return e.slice(1).reverse()}get isCollectionSelected(){return null!=this.selectedCollectionNode&&"AllCollections"!==this.selectedCollectionNode.node.id}get isUnassignedCollectionSelected(){return null!=this.selectedCollectionNode&&null===this.selectedCollectionNode.node.id}get isMyVaultSelected(){var e;return"MyVault"===(null===(e=this.selectedOrganizationNode)||void 0===e?void 0:e.node.id)}get isFavorites(){var e;return"favorites"===(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)}get isDeleted(){var e;return"trash"===(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)||null}get isArchived(){var e;return"archive"===(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)}get organizationId(){var e;return null===(e=this.selectedOrganizationNode)||void 0===e?void 0:e.node.id}get cipherType(){var e,t;return(0,n.KN)(null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type)?null===(t=this.selectedCipherTypeNode)||void 0===t?void 0:t.node.type:null}get cipherStatus(){var e;return null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.type}get cipherTypeId(){var e;return null===(e=this.selectedCipherTypeNode)||void 0===e?void 0:e.node.id}get folderId(){var e;return null===(e=this.selectedFolderNode)||void 0===e?void 0:e.node.id}get collectionId(){var e;return null===(e=this.selectedCollectionNode)||void 0===e?void 0:e.node.id}constructor(e){Object.assign(this,e)}resetFilter(){this.selectedCipherTypeNode=null,this.selectedFolderNode=null,this.selectedCollectionNode=null}resetOrganization(){this.selectedOrganizationNode=null}buildFilter(){return e=>{let t=!0;return this.isFavorites&&t&&(t=e.favorite),this.isDeleted&&t&&(t=e.isDeleted),this.isArchived&&t&&(t=e.isArchived),this.cipherType&&t&&(t=e.type===this.cipherType),this.selectedFolderNode&&(null===this.folderId&&t&&(t=null===e.folderId),null!==this.folderId&&t&&(t=e.folderId===this.folderId)),this.selectedCollectionNode&&("AllCollections"===this.collectionId&&t&&(t=!1),null===this.collectionId&&t&&(t=null!=e.organizationId&&(null==e.collectionIds||0===e.collectionIds.length)),null!==this.collectionId&&"AllCollections"!==this.collectionId&&t&&(t=null!=e.collectionIds&&e.collectionIds.includes(this.collectionId))),this.selectedOrganizationNode&&("MyVault"===this.organizationId&&t?t=null===e.organizationId:null!==this.organizationId&&t&&(t=e.organizationId===this.organizationId)),t}}}},51971:(e,t,i)=>{"use strict";i.d(t,{H:()=>p});var n=i(23649),r=i(72245),s=i(69194),o=i(78781),a=i(31857),l=i(74208),c=i(23197),d=i(50700),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const h=new a.Zs(a.Sc,"deepLinkRedirectUrl",{deserializer:e=>e});class p{constructor(e,t,i,r,o){this.router=e,this.activatedRoute=t,this.titleService=i,this.stateProvider=r,this.previousUrl=void 0,this.currentUrl=void 0,this.deepLinkRedirectUrlState=this.stateProvider.getGlobal(h),this.currentUrl=this.router.url,e.events.pipe((0,s.p)(e=>e instanceof n.wF)).subscribe(e=>{var t,i,n,r,s,a;this.currentUrl=e.url;let l="Vaultwarden Web";this.currentUrl.includes("/sm/")&&(l=o.t("bitSecretsManager"));let c=this.activatedRoute.firstChild;for(;c.firstChild;)c=c.firstChild;const d=null===(i=null===(t=null==c?void 0:c.snapshot)||void 0===t?void 0:t.data)||void 0===i?void 0:i.titleId,u=null===(r=null===(n=null==c?void 0:c.snapshot)||void 0===n?void 0:n.data)||void 0===r?void 0:r.title,h=!(null===(a=null===(s=null==c?void 0:c.snapshot)||void 0===s?void 0:s.data)||void 0===a?void 0:a.doNotSaveUrl);if(null!=d||null!=u){const e=null!=u?u:o.t(d);null!=e&&""!==e&&(l=e+" | "+l)}this.titleService.setTitle(l),h&&this.setPreviousUrl(this.currentUrl)})}getPreviousUrl(){return this.previousUrl}setPreviousUrl(e){this.previousUrl=e}persistLoginRedirectUrl(e){return u(this,void 0,void 0,function*(){yield this.deepLinkRedirectUrlState.update(()=>e)})}getAndClearLoginRedirectUrl(){return u(this,void 0,void 0,function*(){const e=yield(0,r._)(this.deepLinkRedirectUrlState.state$);if(!o.A.isNullOrEmpty(e))return yield this.persistLoginRedirectUrl(null),e})}}p.ɵfac=function(e){return new(e||p)(l.KVO(n.Ix),l.KVO(n.nX),l.KVO(c.hE),l.KVO(a.v2),l.KVO(d.W))},p.ɵprov=l.jDH({token:p,factory:p.ɵfac})},52057:(e,t,i)=>{"use strict";i.d(t,{K:()=>n});class n{}},52136:(e,t,i)=>{"use strict";i.d(t,{o:()=>n});class n{constructor(e,t){null!=e&&(this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.usePolicies=e.usePolicies,this.useGroups=e.useGroups,this.useDirectory=e.useDirectory,this.useEvents=e.useEvents,this.useTotp=e.useTotp,this.use2fa=e.use2fa,this.useApi=e.useApi,this.useSso=e.useSso,this.useOrganizationDomains=e.useOrganizationDomains,this.useKeyConnector=e.useKeyConnector,this.useScim=e.useScim,this.useCustomPermissions=e.useCustomPermissions,this.useResetPassword=e.useResetPassword,this.useSecretsManager=e.useSecretsManager,this.usePasswordManager=e.usePasswordManager,this.useActivateAutofillPolicy=e.useActivateAutofillPolicy,this.useAutomaticUserConfirmation=e.useAutomaticUserConfirmation,this.selfHost=e.selfHost,this.usersGetPremium=e.usersGetPremium,this.seats=e.seats,this.maxCollections=e.maxCollections,this.maxStorageGb=e.maxStorageGb,this.ssoBound=e.ssoBound,this.identifier=e.identifier,this.permissions=e.permissions,this.resetPasswordEnrolled=e.resetPasswordEnrolled,this.userId=e.userId,this.organizationUserId=e.organizationUserId,this.hasPublicAndPrivateKeys=e.hasPublicAndPrivateKeys,this.providerId=e.providerId,this.providerName=e.providerName,this.providerType=e.providerType,this.familySponsorshipFriendlyName=e.familySponsorshipFriendlyName,this.familySponsorshipAvailable=e.familySponsorshipAvailable,this.productTierType=e.productTierType,this.keyConnectorEnabled=e.keyConnectorEnabled,this.keyConnectorUrl=e.keyConnectorUrl,this.familySponsorshipLastSyncDate=e.familySponsorshipLastSyncDate,this.familySponsorshipValidUntil=e.familySponsorshipValidUntil,this.familySponsorshipToDelete=e.familySponsorshipToDelete,this.accessSecretsManager=e.accessSecretsManager,this.limitCollectionCreation=e.limitCollectionCreation,this.limitCollectionDeletion=e.limitCollectionDeletion,this.limitItemDeletion=e.limitItemDeletion,this.allowAdminAccessToAllCollectionItems=e.allowAdminAccessToAllCollectionItems,this.userIsManagedByOrganization=e.userIsManagedByOrganization,this.useAccessIntelligence=e.useAccessIntelligence,this.useAdminSponsoredFamilies=e.useAdminSponsoredFamilies,this.isAdminInitiated=e.isAdminInitiated,this.ssoEnabled=e.ssoEnabled,this.ssoMemberDecryptionType=e.ssoMemberDecryptionType,this.usePhishingBlocker=e.usePhishingBlocker,this.isMember=t.isMember,this.isProviderUser=t.isProviderUser)}static fromJSON(e){return Object.assign(new n,e,{familySponsorshipLastSyncDate:null!=e.familySponsorshipLastSyncDate?new Date(e.familySponsorshipLastSyncDate):e.familySponsorshipLastSyncDate,familySponsorshipValidUntil:null!=e.familySponsorshipValidUntil?new Date(e.familySponsorshipValidUntil):e.familySponsorshipValidUntil})}}},52396:(e,t,i)=>{"use strict";i.d(t,{y:()=>n});class n{}},52717:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});class n{}},53072:(e,t,i)=>{"use strict";i.d(t,{v:()=>mt});var n=i(33812),r=i(51757),s=i(66046),o=i(72245),a=i(14803),l=i(3204),c=i(44500),d=i(67553),u=i(43978),h=i(77665),p=i(56953),m=i(79667);class v{constructor(e,t){this.clientOwnerEmail=e,this.organizationCreateRequest=t}}var f=i(3633),g=i(60512),y=i(88083),b=(i(69580),i(83516)),w=i(39488),S=i(22848),I=i(98221),k=i(63734),C=i(32501),T=i(40101),F=i(74208),R=i(12012),P=i(50700),x=i(37115),$=i(89105),E=i(23649),A=i(18499),D=i(11224),O=i(62316),M=i(69855),U=i(35500),G=i(1601),j=i(77468),N=i(26657),V=i(45154),B=i(56898),z=i(44432),L=i(50352),K=i(90246),q=i(86226),_=i(93199),X=i(97553),Y=i(68466),H=i(43759),W=i(24374),J=i(17721),Z=i(88832),Q=i(58806),ee=i(91517),te=i(49272),ie=i(10010),ne=i(83078),re=i(88016),se=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class oe extends ie.X{constructor(e,t,i,r,s,o,a,l,c,d,u){super(e,t,i,r,s),this.formBuilder=e,this.i18nService=t,this.platformUtilsService=i,this.toastService=r,this.tokenService=s,this.apiService=o,this.encryptService=a,this.keyService=l,this.organizationApiService=c,this.syncService=d,this.accountService=u,this.onLicenseFileUploaded=new n.bkB}submit(){const e=Object.create(null,{submit:{get:()=>super.submit}});return se(this,void 0,void 0,function*(){yield e.submit.call(this);const t=yield(0,o._)((0,f.F6)(this.accountService.activeAccount$)),i=yield this.keyService.makeOrgKey(t),n=i[0].encryptedString,r=(yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),i[1])).encryptedString,s=yield this.keyService.makeKeyPair(i[1]),a=new FormData;a.append("license",this.formValue.file),a.append("key",n),a.append("collectionName",r);const l=(yield this.organizationApiService.createLicense(a)).id;yield this.apiService.refreshIdentityToken();const c=new p.B(s[0],s[1].encryptedString);yield this.organizationApiService.updateKeys(l,c),yield this.apiService.refreshIdentityToken(),yield this.syncService.fullSync(!0),this.onLicenseFileUploaded.emit(l)})}get description(){return"uploadLicenseFileOrg"}get hintFileName(){return"bitwarden_organization_license.json"}}oe.ɵfac=function(e){return new(e||oe)(n.rXU(r.ok),n.rXU(P.W),n.rXU(x.y),n.rXU(M.f),n.rXU(ne.B),n.rXU(R.G),n.rXU($.N),n.rXU(S.Lu),n.rXU(D.X),n.rXU(te.H),n.rXU(U.Di))},oe.ɵcmp=n.VBU({type:oe,selectors:[["organization-self-hosting-license-uploader"]],outputs:{onLicenseFileUploaded:"onLicenseFileUploaded"},standalone:!1,features:[n.Vt3],decls:22,vars:21,consts:[["fileSelector",""],["bitTypography","body1",1,"tw-break-words","tw-whitespace-normal","tw-mb-8"],[3,"formGroup","bitSubmit"],[1,"tw-my-1"],["bitButton","","type","button","buttonType","secondary",3,"click"],["bitInput","","type","file","formControlName","file","accept","application/JSON","hidden","",1,"tw-hidden",3,"change"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"]],template:function(e,t){if(1&e){const e=n.RV6();n.j41(0,"p",1),n.EFF(1),n.nI1(2,"i18n"),n.k0s(),n.j41(3,"form",2)(4,"bit-form-field")(5,"bit-label"),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"div",3)(9,"button",4),n.bIt("click",function(){F.eBV(e);const t=n.sdS(15);return F.Njj(t.click())}),n.EFF(10),n.nI1(11,"i18n"),n.k0s(),n.EFF(12),n.nI1(13,"i18n"),n.k0s(),n.j41(14,"input",5,0),n.bIt("change",function(i){return F.eBV(e),F.Njj(t.onLicenseFileSelectedChanged(i))}),n.k0s(),n.j41(16,"bit-hint"),n.EFF(17),n.nI1(18,"i18n"),n.k0s()(),n.j41(19,"button",6),n.EFF(20),n.nI1(21,"i18n"),n.k0s()()}2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,8,"uploadLicenseFileOrg"),"\n"),n.R7$(2),n.Y8G("formGroup",t.form)("bitSubmit",t.submit),n.R7$(3),n.JRh(n.bMT(7,10,t.description)),n.R7$(4),n.SpI(" ",n.bMT(11,12,"chooseFile")," "),n.R7$(2),n.SpI(" ",t.form.value.file?t.form.value.file.name:n.bMT(13,14,"noFileChosen")," "),n.R7$(5),n.JRh(n.i5U(18,16,"licenseFileDesc",t.hintFileName)),n.R7$(3),n.SpI(" ",n.bMT(21,19,"submit")," "))},dependencies:[r.qT,r.me,r.BC,r.cb,r.j4,r.JD,N.$,V.L,B.Q,q.j,_.I,X.J,H.h,Q.r,re.$],encapsulation:2});var ae=i(58688),le=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ce=e=>({"tw-hidden":e}),de=e=>({type:"checkout",supportsTaxId:e});function ue(e,t){1&e&&(n.qex(0),n.nrm(1,"i",5),n.nI1(2,"i18n"),n.j41(3,"span",6),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.bVm()),2&e&&(n.R7$(),n.Y8G("title",n.mNQ(n.bMT(2,3,"loading"))),n.R7$(3),n.JRh(n.bMT(5,5,"loading")))}function he(e,t){if(1&e){const e=n.RV6();n.qex(0),n.j41(1,"organization-self-hosting-license-uploader",7),n.bIt("onLicenseFileUploaded",function(t){F.eBV(e);const i=n.XpG();return F.Njj(i.onLicenseFileUploaded(t))}),n.k0s(),n.bVm()}}function pe(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"onPremHostingOptional")))}function me(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"includeSsoAuthentication")))}function ve(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"includeEnterprisePolicies")," "))}function fe(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(2).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"xDayFreeTrial",e.trialPeriodDays)," ")}}function ge(e,t){if(1&e&&(n.qex(0),n.j41(1,"ul",23)(2,"li"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.DNE(5,pe,3,3,"li",3)(6,me,3,3,"li",3)(7,ve,3,3,"li",3)(8,fe,3,4,"li",3),n.k0s(),n.bVm()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.R7$(3),n.JRh(n.bMT(4,5,"includeAllTeamsFeatures")),n.R7$(2),n.Y8G("ngIf",e.hasSelfHost),n.R7$(),n.Y8G("ngIf",e.hasSso),n.R7$(),n.Y8G("ngIf",e.hasPolicies),n.R7$(),n.Y8G("ngIf",e.trialPeriodDays&&t.createOrganization)}}function ye(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"xDayFreeTrial",e.trialPeriodDays)," ")}}function be(e,t){if(1&e&&(n.qex(0),n.j41(1,"ul",23)(2,"li"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"li"),n.EFF(6),n.nI1(7,"i18n"),n.k0s(),n.j41(8,"li"),n.EFF(9),n.nI1(10,"i18n"),n.k0s(),n.DNE(11,ye,3,4,"li",3),n.k0s(),n.bVm()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(2);n.R7$(3),n.JRh(n.bMT(4,4,"includeAllTeamsStarterFeatures")),n.R7$(3),n.JRh(n.bMT(7,6,"chooseMonthlyOrAnnualBilling")),n.R7$(3),n.JRh(n.i5U(10,8,"abilityToAddMoreThanNMembers",10)),n.R7$(2),n.Y8G("ngIf",e.trialPeriodDays&&t.createOrganization)}}function we(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"limitedUsers",e.PasswordManager.maxSeats)," ")}}function Se(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"addShareLimitedUsers",e.PasswordManager.maxSeats)," ")}}function Ie(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"addShareUnlimitedUsers")," "))}function ke(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"limitedCollections",e.PasswordManager.maxCollections)," ")}}function Ce(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"addShareLimitedUsers",e.PasswordManager.maxAdditionalSeats)," ")}}function Te(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"createUnlimitedCollections")," "))}function Fe(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"gbEncryptedFileStorage",e.PasswordManager.baseStorageGb+" GB")," ")}}function Re(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"controlAccessWithGroups")," "))}function Pe(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"trackAuditLogs")))}function xe(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"syncUsersFromDirectory")," "))}function $e(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"onPremHostingOptional")," "))}function Ee(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"usersGetPremium")))}function Ae(e,t){1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"priorityCustomerSupport")," "))}function De(e,t){if(1&e&&(n.j41(0,"li"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.SpI(" ",n.i5U(2,1,"xDayFreeTrial",e.trialPeriodDays)," ")}}function Oe(e,t){if(1&e&&(n.j41(0,"ul",23),n.DNE(1,we,3,4,"li",3)(2,Se,3,4,"li",3)(3,Ie,3,3,"li",3)(4,ke,3,4,"li",3)(5,Ce,3,4,"li",3)(6,Te,3,3,"li",3)(7,Fe,3,4,"li",3)(8,Re,3,3,"li",3)(9,Pe,3,3,"li",3)(10,xe,3,3,"li",3)(11,$e,3,3,"li",3)(12,Ee,3,3,"li",3)(13,Ae,3,3,"li",3)(14,De,3,4,"li",3),n.k0s()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.productTier==t.productTypes.Free),n.R7$(),n.Y8G("ngIf",e.productTier!=t.productTypes.Free&&e.productTier!=t.productTypes.TeamsStarter&&e.PasswordManager.maxSeats),n.R7$(),n.Y8G("ngIf",!e.PasswordManager.maxSeats),n.R7$(),n.Y8G("ngIf",e.PasswordManager.maxCollections),n.R7$(),n.Y8G("ngIf",e.PasswordManager.maxAdditionalSeats),n.R7$(),n.Y8G("ngIf",!e.PasswordManager.maxCollections),n.R7$(),n.Y8G("ngIf",e.PasswordManager.baseStorageGb),n.R7$(),n.Y8G("ngIf",e.hasGroups),n.R7$(),n.Y8G("ngIf",e.hasApi),n.R7$(),n.Y8G("ngIf",e.hasDirectory),n.R7$(),n.Y8G("ngIf",e.hasSelfHost),n.R7$(),n.Y8G("ngIf",e.usersGetPremium),n.R7$(),n.Y8G("ngIf",e.productTier!=t.productTypes.Free),n.R7$(),n.Y8G("ngIf",e.trialPeriodDays&&t.createOrganization)}}function Me(e,t){if(1&e&&n.DNE(0,be,12,11,"ng-container",21)(1,Oe,15,14,"ng-template",null,1,n.C5r),2&e){const e=n.sdS(2),t=n.XpG().$implicit,i=n.XpG(2);n.Y8G("ngIf",t.productTier===i.productTypes.Teams&&i.teamsStarterPlanIsAvailable)("ngIfElse",e)}}function Ue(e,t){if(1&e&&(n.qex(0),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.bVm()),2&e){const e=n.XpG(3).$implicit;n.R7$(),n.E5c(" ",n.bMT(2,3,"additionalUsers").toLowerCase()," ",n.i5U(3,5,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$")," /",n.bMT(4,8,"month")," ")}}function Ge(e,t){if(1&e&&(n.qex(0),n.EFF(1),n.nI1(2,"currency"),n.nI1(3,"i18n"),n.nI1(4,"i18n"),n.DNE(5,Ue,5,10,"ng-container",3),n.bVm()),2&e){const e=n.XpG(2).$implicit;n.R7$(),n.E5c(" ",n.i5U(2,4,e.isAnnual?e.PasswordManager.basePrice/12:e.PasswordManager.basePrice,"$")," /",n.bMT(3,7,"month"),", ",n.i5U(4,9,"includesXUsers",e.PasswordManager.baseSeats)," "),n.R7$(4),n.Y8G("ngIf",e.PasswordManager.hasAdditionalSeatsOption)}}function je(e,t){if(1&e&&(n.j41(0,"span",24),n.DNE(1,Ge,6,12,"ng-container",3),n.k0s()),2&e){const e=n.XpG().$implicit,t=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.PasswordManager.basePrice&&!t.acceptingSponsorship)}}function Ne(e,t){if(1&e&&(n.j41(0,"span",24),n.EFF(1),n.nI1(2,"currency"),n.nI1(3,"i18n"),n.nI1(4,"i18n"),n.k0s()),2&e){const e=n.XpG().$implicit;n.R7$(),n.Lme(" ",n.i5U(3,5,"costPerUser",n.i5U(2,2,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$"))," /",n.bMT(4,8,"month")," ")}}function Ve(e,t){1&e&&(n.j41(0,"span",24),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.JRh(n.bMT(2,1,"freeForever")))}function Be(e,t){if(1&e){const e=n.RV6();n.j41(0,"div",18)(1,"bit-radio-button",19),n.bIt("change",function(){F.eBV(e);const t=n.XpG(2);return F.Njj(t.changedProduct())}),n.j41(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"bit-hint",20),n.EFF(6),n.nI1(7,"i18n"),n.DNE(8,ge,9,7,"ng-container",21)(9,Me,3,2,"ng-template",null,0,n.C5r),n.k0s()(),n.DNE(11,je,2,1,"span",22)(12,Ne,5,10,"span",22)(13,Ve,3,3,"span",22),n.k0s()}if(2&e){const e=t.$implicit,i=n.sdS(10),r=n.XpG(2);n.R7$(),n.Y8G("value",e.productTier),n.R7$(2),n.JRh(n.bMT(4,8,e.nameLocalizationKey)),n.R7$(3),n.SpI("",n.i5U(7,10,e.descriptionLocalizationKey,"1")," "),n.R7$(2),n.Y8G("ngIf",e.productTier===r.productTypes.Enterprise)("ngIfElse",i),n.R7$(3),n.Y8G("ngIf",e.productTier!=r.productTypes.Free),n.R7$(),n.Y8G("ngIf",!e.PasswordManager.basePrice&&e.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.productTier==r.productTypes.Free)}}function ze(e,t){1&e&&(n.j41(0,"bit-section")(1,"h2",11),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"div",26)(5,"bit-form-field",27)(6,"bit-label"),n.EFF(7),n.nI1(8,"i18n"),n.k0s(),n.nrm(9,"input",31),n.nI1(10,"i18n"),n.j41(11,"bit-hint",20),n.EFF(12),n.nI1(13,"i18n"),n.k0s()()()()),2&e&&(n.R7$(2),n.JRh(n.bMT(3,5,"users")),n.R7$(5),n.JRh(n.bMT(8,7,"userSeats")),n.R7$(2),n.Y8G("placeholder",n.mNQ(n.bMT(10,9,"userSeatsDesc"))),n.R7$(3),n.JRh(n.bMT(13,11,"userSeatsHowManyDesc")))}function Le(e,t){if(1&e&&(n.j41(0,"div",26)(1,"bit-form-field",27)(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.nrm(5,"input",32),n.nI1(6,"i18n"),n.j41(7,"bit-hint",20),n.EFF(8),n.nI1(9,"currency"),n.nI1(10,"i18n"),n.k0s()()()),2&e){const e=n.XpG(3);n.R7$(3),n.JRh(n.bMT(4,4,"additionalUserSeats")),n.R7$(2),n.Y8G("placeholder",n.mNQ(n.bMT(6,6,"userSeatsDesc"))),n.R7$(3),n.SpI("",n.brH(10,11,"userSeatsAdditionalDesc",e.selectedPlan.PasswordManager.baseSeats,n.i5U(9,8,e.seatPriceMonthly(e.selectedPlan),"$"))," ")}}function Ke(e,t){1&e&&(n.j41(0,"div",26)(1,"bit-form-control",27)(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.nrm(5,"input",33),n.j41(6,"bit-hint",20),n.EFF(7),n.nI1(8,"currency"),n.nI1(9,"i18n"),n.nI1(10,"i18n"),n.k0s()()()),2&e&&(n.R7$(3),n.JRh(n.bMT(4,2,"premiumAccess")),n.R7$(4),n.JRh(n.brH(10,9,"premiumAccessDesc",n.i5U(8,4,3.33,"$"),n.bMT(9,7,"month"))))}function qe(e,t){if(1&e&&(n.qex(0),n.j41(1,"span",37),n.EFF(2),n.nI1(3,"currency"),n.k0s(),n.EFF(4),n.nI1(5,"i18n"),n.bVm()),2&e){const e=n.XpG(3).$implicit;n.R7$(2),n.JRh(n.i5U(3,2,e.PasswordManager.basePrice,"$")),n.R7$(2),n.SpI(" ",n.bMT(5,5,"freeWithSponsorship")," ")}}function _e(e,t){if(1&e&&(n.EFF(0),n.nI1(1,"currency"),n.nI1(2,"i18n")),2&e){const e=n.XpG(3).$implicit;n.Lme(" ",n.i5U(1,2,e.PasswordManager.basePrice,"$")," /",n.bMT(2,5,"year")," ")}}function Xe(e,t){if(1&e&&(n.j41(0,"p",36),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.DNE(5,qe,6,7,"ng-container",21)(6,_e,3,7,"ng-template",null,2,n.C5r),n.k0s()),2&e){const e=n.sdS(7),t=n.XpG(2).$implicit,i=n.XpG(3);n.R7$(),n.E5c(" ",n.bMT(2,5,"basePrice"),": ",n.i5U(3,7,t.isAnnual?t.PasswordManager.basePrice/12:t.PasswordManager.basePrice,"$")," × 12 ",n.bMT(4,10,"monthAbbr")," = "),n.R7$(4),n.Y8G("ngIf",i.acceptingSponsorship)("ngIfElse",e)}}function Ye(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function He(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"users"),":"))}function We(e,t){if(1&e&&(n.j41(0,"p",36),n.DNE(1,Ye,3,3,"span",3)(2,He,3,3,"span",3),n.EFF(3),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.PasswordManager.baseSeats),n.R7$(),n.Y8G("ngIf",!e.PasswordManager.baseSeats),n.R7$(),n.SjE(" ",t.formGroup.controls.additionalSeats.value||0," × ",n.i5U(4,7,e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice,"$")," × 12 ",n.bMT(5,10,"monthAbbr")," = ",n.i5U(6,12,t.passwordManagerSeatTotal(e,t.formGroup.value.additionalSeats),"$")," /",n.bMT(7,15,"year")," ")}}function Je(e,t){if(1&e&&(n.j41(0,"p",36),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.nI1(5,"currency"),n.nI1(6,"i18n"),n.k0s()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(3);n.R7$(),n.ZXR(" ",n.bMT(2,6,"additionalStorageGb"),": ",t.formGroup.controls.additionalStorage.value||0," × ",n.i5U(3,8,e.isAnnual?e.PasswordManager.additionalStoragePricePerGb/12:e.PasswordManager.additionalStoragePricePerGb,"$")," × 12 ",n.bMT(4,11,"monthAbbr")," = ",n.i5U(5,13,t.additionalStorageTotal(e),"$")," /",n.bMT(6,16,"year")," ")}}function Ze(e,t){if(1&e&&(n.j41(0,"bit-hint"),n.DNE(1,Xe,8,12,"p",35)(2,We,8,17,"p",35)(3,Je,7,18,"p",35),n.k0s()),2&e){const e=n.XpG().$implicit;n.R7$(),n.Y8G("ngIf",e.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.PasswordManager.hasAdditionalStorageOption)}}function Qe(e,t){if(1&e&&(n.j41(0,"p",36),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.nI1(5,"currency"),n.nI1(6,"i18n"),n.k0s()),2&e){const e=n.XpG(2).$implicit;n.R7$(),n.SjE(" ",n.bMT(2,5,"basePrice"),": ",n.i5U(3,7,e.PasswordManager.basePrice,"$")," ",n.bMT(4,10,"monthAbbr")," = ",n.i5U(5,12,e.PasswordManager.basePrice,"$")," /",n.bMT(6,15,"month")," ")}}function et(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"additionalUsers"),":"))}function tt(e,t){1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.k0s()),2&e&&(n.R7$(),n.SpI("",n.bMT(2,1,"users"),":"))}function it(e,t){if(1&e&&(n.j41(0,"p",36),n.DNE(1,et,3,3,"span",3)(2,tt,3,3,"span",3),n.EFF(3),n.nI1(4,"currency"),n.nI1(5,"i18n"),n.nI1(6,"currency"),n.nI1(7,"i18n"),n.k0s()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(3);n.R7$(),n.Y8G("ngIf",e.PasswordManager.baseSeats),n.R7$(),n.Y8G("ngIf",!e.PasswordManager.baseSeats),n.R7$(),n.SjE(" ",t.formGroup.controls.additionalSeats.value||0," × ",n.i5U(4,7,e.PasswordManager.seatPrice,"$")," ",n.bMT(5,10,"monthAbbr")," = ",n.i5U(6,12,t.passwordManagerSeatTotal(e,t.formGroup.value.additionalSeats),"$")," /",n.bMT(7,15,"month")," ")}}function nt(e,t){if(1&e&&(n.j41(0,"p",36),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nI1(4,"i18n"),n.nI1(5,"currency"),n.nI1(6,"i18n"),n.k0s()),2&e){const e=n.XpG(2).$implicit,t=n.XpG(3);n.R7$(),n.ZXR(" ",n.bMT(2,6,"additionalStorageGb"),": ",t.formGroup.controls.additionalStorage.value||0," × ",n.i5U(3,8,e.PasswordManager.additionalStoragePricePerGb,"$")," ",n.bMT(4,11,"monthAbbr")," = ",n.i5U(5,13,t.additionalStorageTotal(e),"$")," /",n.bMT(6,16,"month")," ")}}function rt(e,t){if(1&e&&(n.j41(0,"bit-hint"),n.DNE(1,Qe,7,17,"p",35)(2,it,8,17,"p",35)(3,nt,7,18,"p",35),n.k0s()),2&e){const e=n.XpG().$implicit;n.R7$(),n.Y8G("ngIf",e.PasswordManager.basePrice),n.R7$(),n.Y8G("ngIf",e.PasswordManager.hasAdditionalSeatsOption),n.R7$(),n.Y8G("ngIf",e.PasswordManager.hasAdditionalStorageOption)}}function st(e,t){if(1&e&&(n.j41(0,"div")(1,"bit-radio-button",34)(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.DNE(5,Ze,4,3,"bit-hint",3)(6,rt,4,3,"bit-hint",3),n.k0s()()),2&e){const e=t.$implicit;n.R7$(),n.Y8G("id",n.VkB("interval",e.type))("value",e.type),n.R7$(2),n.JRh(n.bMT(4,6,e.isAnnual?"annually":"monthly")),n.R7$(2),n.Y8G("ngIf",e.isAnnual),n.R7$(),n.Y8G("ngIf",!e.isAnnual)}}function ot(e,t){if(1&e&&(n.j41(0,"bit-section"),n.DNE(1,ze,14,13,"bit-section",3),n.j41(2,"bit-section")(3,"h2",11),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.DNE(6,Le,11,15,"div",25),n.j41(7,"div",26)(8,"bit-form-field",27)(9,"bit-label"),n.EFF(10),n.nI1(11,"i18n"),n.k0s(),n.nrm(12,"input",28),n.nI1(13,"i18n"),n.j41(14,"bit-hint",20),n.EFF(15),n.nI1(16,"currency"),n.nI1(17,"i18n"),n.nI1(18,"i18n"),n.k0s()()()(),n.j41(19,"bit-section"),n.DNE(20,Ke,11,13,"div",25),n.k0s(),n.j41(21,"bit-section")(22,"h2",11),n.EFF(23),n.nI1(24,"i18n"),n.k0s(),n.j41(25,"bit-radio-group",29),n.DNE(26,st,7,8,"div",30),n.k0s()()()),2&e){const e=n.XpG(2);n.R7$(),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&!e.selectedPlan.PasswordManager.baseSeats),n.R7$(3),n.JRh(n.bMT(5,10,"addons")),n.R7$(2),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&e.selectedPlan.PasswordManager.baseSeats),n.R7$(4),n.JRh(n.bMT(11,12,"additionalStorageGb")),n.R7$(2),n.Y8G("placeholder",n.mNQ(n.bMT(13,14,"additionalStorageGbDesc"))),n.R7$(3),n.JRh(n.ii3(18,21,"additionalStorageIntervalDesc",`${e.selectedPlan.PasswordManager.baseStorageGb} GB`,n.i5U(16,16,e.additionalStoragePriceMonthly(e.selectedPlan),"$"),n.bMT(17,19,"month"))),n.R7$(5),n.Y8G("ngIf",e.selectedPlan.PasswordManager.hasPremiumAccessOption),n.R7$(3),n.JRh(n.bMT(24,26,"summary")),n.R7$(3),n.Y8G("ngForOf",e.selectablePlans)}}function at(e,t){if(1&e&&n.nrm(0,"sm-subscribe",38),2&e){const e=n.XpG(2);n.Y8G("formGroup",e.formGroup.controls.secretsManager)("selectedPlan",e.selectedSecretsManagerPlan)("upgradeOrganization",!e.createOrganization)}}function lt(e,t){if(1&e&&n.nrm(0,"app-enter-payment-method",40),2&e){const e=n.XpG(3);n.Y8G("group",e.billingFormGroup.controls.paymentMethod)}}function ct(e,t){if(1&e&&(n.j41(0,"span"),n.EFF(1),n.nI1(2,"i18n"),n.nI1(3,"currency"),n.nrm(4,"br"),n.k0s()),2&e){const e=n.XpG(3);n.R7$(),n.Lme(" ",n.bMT(2,2,"secretsManagerPlanPrice"),": ",n.i5U(3,4,e.secretsManagerSubtotal,"USD $")," ")}}function dt(e,t){if(1&e&&(n.j41(0,"bit-section")(1,"h2",11),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.j41(4,"p",39),n.EFF(5),n.k0s(),n.nVh(6,lt,1,1,"app-enter-payment-method",40),n.nrm(7,"app-enter-billing-address",41),n.j41(8,"div",42)(9,"div",43),n.EFF(10),n.nI1(11,"i18n"),n.nI1(12,"currency"),n.nrm(13,"br"),n.DNE(14,ct,5,7,"span",3),n.qex(15),n.EFF(16),n.nI1(17,"i18n"),n.nI1(18,"currency"),n.bVm(),n.k0s(),n.nrm(19,"hr",44),n.j41(20,"p",45)(21,"strong"),n.EFF(22),n.nI1(23,"i18n"),n.k0s(),n.EFF(24),n.nI1(25,"currency"),n.nI1(26,"i18n"),n.k0s()()()),2&e){const e=n.XpG(2);n.R7$(2),n.SpI(" ",n.bMT(3,13,e.createOrganization?"paymentInformation":"billingInformation")," "),n.R7$(3),n.SpI(" ",e.paymentDesc," "),n.R7$(),n.vxM(e.createOrganization||e.upgradeRequiresPaymentMethod?6:-1),n.R7$(),n.Y8G("group",e.billingFormGroup.controls.billingAddress)("scenario",n.eq3(32,de,e.showTaxIdField)),n.R7$(3),n.Lme(" ",n.bMT(11,15,"passwordManagerPlanPrice"),": ",n.i5U(12,17,e.passwordManagerSubtotal,"USD $")," "),n.R7$(4),n.Y8G("ngIf",e.planOffersSecretsManager&&e.formGroup.value.secretsManager.enabled),n.R7$(2),n.Lme(" ",n.bMT(17,20,"estimatedTax"),": ",n.i5U(18,22,e.estimatedTax,"USD $")," "),n.R7$(6),n.SpI("",n.bMT(23,25,"total"),":"),n.R7$(2),n.Lme(" ",n.i5U(25,27,e.total,"USD $"),"/",n.bMT(26,30,e.selectedPlanInterval)," ")}}function ut(e,t){1&e&&(n.j41(0,"bit-section")(1,"bit-callout",46),n.nI1(2,"i18n"),n.EFF(3),n.nI1(4,"i18n"),n.k0s()()),2&e&&(n.R7$(),n.Y8G("title",n.bMT(2,2,"error")),n.R7$(2),n.SpI(" ",n.bMT(4,4,"singleOrgBlockCreateMessage")," "))}function ht(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",47),n.bIt("click",function(){F.eBV(e);const t=n.XpG(2);return F.Njj(t.cancel())}),n.EFF(1),n.nI1(2,"i18n"),n.k0s()}2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"cancel")," "))}function pt(e,t){if(1&e){const e=n.RV6();n.j41(0,"form",8)(1,"bit-section",9)(2,"app-org-info",10),n.bIt("changedBusinessOwned",function(){F.eBV(e);const t=n.XpG();return F.Njj(t.changedOwnedBusiness())}),n.k0s()(),n.j41(3,"bit-section")(4,"h2",11),n.EFF(5),n.nI1(6,"i18n"),n.k0s(),n.j41(7,"bit-radio-group",12),n.DNE(8,Be,14,13,"div",13),n.k0s()(),n.DNE(9,ot,27,28,"bit-section",3),n.j41(10,"bit-section"),n.DNE(11,at,1,3,"sm-subscribe",14),n.k0s(),n.DNE(12,dt,27,34,"bit-section",3)(13,ut,5,6,"bit-section",3),n.j41(14,"bit-section")(15,"button",15),n.EFF(16),n.nI1(17,"i18n"),n.k0s(),n.DNE(18,ht,3,3,"button",16),n.nrm(19,"bit-error-summary",17),n.k0s()()}if(2&e){const e=n.XpG();n.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),n.R7$(),n.Y8G("ngClass",n.eq3(22,ce,!e.createOrganization)),n.R7$(),n.Y8G("formGroup",e.formGroup)("createOrganization",e.createOrganization)("isProvider",!!e.providerId)("acceptingSponsorship",e.acceptingSponsorship),n.R7$(3),n.JRh(n.bMT(6,18,"chooseYourPlan")),n.R7$(2),n.Y8G("block",!0),n.R7$(),n.Y8G("ngForOf",e.selectableProducts),n.R7$(),n.Y8G("ngIf",e.formGroup.value.productTier!==e.productTypes.Free),n.R7$(2),n.Y8G("ngIf",e.planOffersSecretsManager&&!e.hasProvider),n.R7$(),n.Y8G("ngIf",e.formGroup.value.productTier!==e.productTypes.Free),n.R7$(),n.Y8G("ngIf",e.singleOrgPolicyBlock),n.R7$(2),n.Y8G("disabled",!e.formGroup.valid),n.R7$(),n.SpI(" ",n.bMT(17,20,"submit")," "),n.R7$(2),n.Y8G("ngIf",e.showCancel),n.R7$(),n.Y8G("formGroup",e.formGroup)}}y.OL.TeamsMonthly2020,y.OL.TeamsAnnually2020,y.OL.EnterpriseAnnually2020,y.OL.EnterpriseMonthly2020;class mt{get productTier(){return this._productTier}set productTier(e){var t,i,n;this._productTier=e,null===(n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.controls)||void 0===i?void 0:i.productTier)||void 0===n||n.setValue(e)}get plan(){return this._plan}set plan(e){var t,i,n;this._plan=e,null===(n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.controls)||void 0===i?void 0:i.plan)||void 0===n||n.setValue(e)}constructor(e,t,i,a,l,c,d,u,h,p,m,v,g,b,w,S,I,C){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.keyService=a,this.encryptService=l,this.router=c,this.syncService=d,this.policyService=u,this.organizationService=h,this.messagingService=p,this.formBuilder=m,this.organizationApiService=v,this.providerApiService=g,this.toastService=b,this.accountService=w,this.subscriberBillingClient=S,this.taxClient=I,this.configService=C,this.showFree=!0,this.showCancel=!1,this.acceptingSponsorship=!1,this._productTier=y.K_.Free,this._plan=y.OL.Free,this.onSuccess=new n.bkB,this.onCanceled=new n.bkB,this.onTrialBillingSuccess=new n.bkB,this.loading=!0,this.selfHosted=!1,this.productTypes=y.K_,this.singleOrgPolicyAppliesToActiveUser=!1,this.isInTrialFlow=!1,this.discount=0,this.secretsManagerSubscription=(0,T.Fk)(this.formBuilder),this.formGroup=this.formBuilder.group({name:[""],billingEmail:["",[r.k0.email]],businessOwned:[!1],premiumAccessAddon:[!1],additionalStorage:[0,[r.k0.min(0),r.k0.max(99)]],additionalSeats:[0,[r.k0.min(0),r.k0.max(1e5)]],clientOwnerEmail:["",[r.k0.email]],plan:[this.plan],productTier:[this.productTier],secretsManager:this.secretsManagerSubscription}),this.billingFormGroup=this.formBuilder.group({paymentMethod:k.Pu.getFormGroup(),billingAddress:k.vU.getFormGroup()}),this.estimatedTax=0,this.total=0,this.destroy$=new s.B,this.submit=()=>le(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;if(this.singleOrgPolicyBlock)return;const e=()=>le(this,void 0,void 0,function*(){let e;if(this.createOrganization){const t=yield(0,o._)((0,f.F6)(this.accountService.activeAccount$)),i=yield this.keyService.makeOrgKey(t),n=i[0].encryptedString,r=(yield this.encryptService.encryptString(this.i18nService.t("defaultCollection"),i[1])).encryptedString,s=yield this.keyService.makeKeyPair(i[1]);e=yield this.createCloudHosted(n,r,s,i[1],t),this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationCreated"),message:this.i18nService.t("organizationReadyToGo")})}else e=yield this.updateOrganization(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("organizationUpgraded")});return yield this.syncService.fullSync(!0),this.acceptingSponsorship||this.isInTrialFlow||this.router.navigate(["/organizations/"+e]),this.isInTrialFlow&&this.onTrialBillingSuccess.emit({orgId:e,subLabelText:this.billingSubLabelText()}),e});try{this.formPromise=e();const t=yield this.formPromise;this.onSuccess.emit({organizationId:t}),this.messagingService.send("organizationCreated",{organizationId:t})}catch(t){if(t instanceof Error&&"Payment method validation failed"===t.message)return;throw t}}),this.selfHosted=this.platformUtilsService.isSelfHost()}ngOnInit(){return le(this,void 0,void 0,function*(){if(this.organizationId){const e=yield(0,o._)(this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id)));this.organization=yield(0,o._)(this.organizationService.organizations$(e).pipe((0,d.Sw)(this.organizationId))),this.billing=null,this.sub=null}this.createOrganization?(this.formGroup.controls.name.addValidators([r.k0.required,r.k0.maxLength(50)]),this.formGroup.controls.billingEmail.addValidators(r.k0.required)):this.upgradeFlowPrefillForm(),this.accountService.activeAccount$.pipe(f.F6,(0,c.n)(e=>this.policyService.policyAppliesToUser$(u.tt.SingleOrg,e)),(0,a.Q)(this.destroy$)).subscribe(e=>{this.singleOrgPolicyAppliesToActiveUser=e}),null!=this.preSelectedProductTier&&this.productTier<this.preSelectedProductTier&&(this.productTier=this.preSelectedProductTier),this.selfHosted||this.changedProduct(),this.loading=!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get singleOrgPolicyBlock(){return this.singleOrgPolicyAppliesToActiveUser&&!this.hasProvider}get createOrganization(){return null==this.organizationId}get upgradeRequiresPaymentMethod(){return!1}get selectedPlan(){return this.passwordManagerPlans.find(e=>e.type===this.formGroup.controls.plan.value)}get selectedSecretsManagerPlan(){return this.secretsManagerPlans.find(e=>e.type===this.formGroup.controls.plan.value)}get selectedPlanInterval(){return this.selectedPlan.isAnnual?"year":"month"}isProviderQualifiedFor2020Plan(){const e=new Date("2023-11-06");if(!this.provider||!this.provider.creationDate)return!1;return new Date(this.provider.creationDate)<e}get selectableProducts(){return null}get selectablePlans(){return null}get hasProvider(){return null!=this.providerId}additionalStoragePriceMonthly(e){return e.isAnnual?e.PasswordManager.additionalStoragePricePerGb/12:e.PasswordManager.additionalStoragePricePerGb}seatPriceMonthly(e){return e.isAnnual?e.PasswordManager.seatPrice/12:e.PasswordManager.seatPrice}additionalStorageTotal(e){return e.PasswordManager.hasAdditionalStorageOption?e.PasswordManager.additionalStoragePricePerGb*Math.abs(this.formGroup.controls.additionalStorage.value||0):0}passwordManagerSeatTotal(e,t){return e.PasswordManager.hasAdditionalSeatsOption?e.PasswordManager.seatPrice*Math.abs(t||0):0}secretsManagerSeatTotal(e,t){return e.SecretsManager.hasAdditionalSeatsOption?e.SecretsManager.seatPrice*Math.abs(t||0):0}additionalServiceAccountTotal(e){return e.SecretsManager.hasAdditionalServiceAccountOption?e.SecretsManager.additionalPricePerServiceAccount*Math.abs(this.secretsManagerForm.value.additionalServiceAccounts||0):0}get passwordManagerSubtotal(){let e=this.acceptingSponsorship?Math.max(this.selectedPlan.PasswordManager.basePrice-this.discount,0):this.selectedPlan.PasswordManager.basePrice;return this.selectedPlan.PasswordManager.hasAdditionalSeatsOption&&this.formGroup.controls.additionalSeats.value&&(e+=this.passwordManagerSeatTotal(this.selectedPlan,this.formGroup.value.additionalSeats)),this.selectedPlan.PasswordManager.hasPremiumAccessOption&&this.formGroup.controls.premiumAccessAddon.value&&(e+=this.selectedPlan.PasswordManager.premiumAccessOptionPrice),this.selectedPlan.PasswordManager.hasAdditionalStorageOption&&this.formGroup.controls.additionalStorage.value&&(e+=this.additionalStorageTotal(this.selectedPlan)),e}get secretsManagerSubtotal(){const e=this.selectedSecretsManagerPlan,t=this.secretsManagerForm.value;return this.planOffersSecretsManager&&t.enabled?e.SecretsManager.basePrice+this.secretsManagerSeatTotal(e,t.userSeats)+this.additionalServiceAccountTotal(e):0}get freeTrial(){return null!=this.selectedPlan.trialPeriodDays}get paymentDesc(){return this.acceptingSponsorship?this.i18nService.t("paymentSponsored"):this.freeTrial&&this.createOrganization?this.i18nService.t("paymentChargedWithTrial"):this.i18nService.t("paymentCharged",this.i18nService.t(this.selectedPlanInterval))}get secretsManagerForm(){return this.formGroup.controls.secretsManager}get planOffersSecretsManager(){return!1}get teamsStarterPlanIsAvailable(){return this.selectablePlans.some(e=>e.type===y.OL.TeamsStarter)}changedProduct(){}setPlanType(e){this.formGroup.controls.plan.setValue(e)}handlePremiumAddonAccess(e){this.formGroup.controls.premiumAccessAddon.setValue(!e)}handleAdditionalStorage(e){var t;e&&this.currentPlan?(null===(t=this.organization)||void 0===t?void 0:t.maxStorageGb)&&this.formGroup.controls.additionalStorage.setValue(this.organization.maxStorageGb-this.currentPlan.PasswordManager.baseStorageGb):this.formGroup.controls.additionalStorage.setValue(0)}handleAdditionalSeats(e){e?!this.currentPlan||this.currentPlan.PasswordManager.hasAdditionalSeatsOption?this.organization?this.formGroup.controls.additionalSeats.setValue(this.organization.seats):this.formGroup.controls.additionalSeats.setValue(1):this.formGroup.controls.additionalSeats.setValue(this.currentPlan.PasswordManager.baseSeats):this.formGroup.controls.additionalSeats.setValue(0)}handleSecretsManagerForm(){var e,t,i,n;this.planOffersSecretsManager&&this.secretsManagerForm.enable(),(null===(e=this.organization)||void 0===e?void 0:e.useSecretsManager)&&this.secretsManagerForm.controls.enabled.setValue(!0),this.secretsManagerForm.controls.enabled.value&&(this.secretsManagerForm.controls.userSeats.setValue((null===(t=this.sub)||void 0===t?void 0:t.smSeats)||1),this.secretsManagerForm.controls.additionalServiceAccounts.setValue((null===(i=this.sub)||void 0===i?void 0:i.smServiceAccounts)-(null===(n=this.currentPlan.SecretsManager)||void 0===n?void 0:n.baseServiceAccount)||0)),this.secretsManagerForm.updateValueAndValidity()}changedOwnedBusiness(){this.formGroup.controls.businessOwned.value&&!this.selectedPlan.canBeUsedByBusiness&&(this.teamsStarterPlanIsAvailable?(this.formGroup.controls.productTier.setValue(y.K_.TeamsStarter),this.formGroup.controls.plan.setValue(y.OL.TeamsStarter)):(this.formGroup.controls.productTier.setValue(y.K_.Teams),this.formGroup.controls.plan.setValue(y.OL.TeamsAnnually)),this.changedProduct())}cancel(){this.onCanceled.emit()}get showTaxIdField(){switch(this.formGroup.controls.productTier.value){case y.K_.Free:case y.K_.Families:return!1;default:return!0}}getPlanFromLegacyEnum(){switch(this.formGroup.value.plan){case y.OL.FamiliesAnnually:case y.OL.FamiliesAnnually2025:return{tier:"families",cadence:"annually"};case y.OL.TeamsMonthly:return{tier:"teams",cadence:"monthly"};case y.OL.TeamsAnnually:return{tier:"teams",cadence:"annually"};case y.OL.EnterpriseMonthly:return{tier:"enterprise",cadence:"monthly"};case y.OL.EnterpriseAnnually:return{tier:"enterprise",cadence:"annually"}}}buildTaxPreviewRequest(e,t){const i=this.selectedPlan.PasswordManager.hasAdditionalSeatsOption?this.formGroup.value.additionalSeats:1;return Object.assign(Object.assign({},this.getPlanFromLegacyEnum()),{passwordManager:{seats:i,additionalStorage:e,sponsored:t},secretsManager:this.formGroup.value.secretsManager.enabled?{seats:this.secretsManagerForm.value.userSeats,additionalServiceAccounts:this.secretsManagerForm.value.additionalServiceAccounts,standalone:!1}:void 0})}refreshSalesTax(){return le(this,void 0,void 0,function*(){})}updateOrganization(){return le(this,void 0,void 0,function*(){const e=new m.v;if(e.additionalSeats=this.formGroup.controls.additionalSeats.value,e.additionalStorageGb=this.formGroup.controls.additionalStorage.value,e.premiumAccessAddon=this.selectedPlan.PasswordManager.hasPremiumAccessOption&&this.formGroup.controls.premiumAccessAddon.value,e.planType=this.selectedPlan.type,e.billingAddressCountry=this.billingFormGroup.value.billingAddress.country,e.billingAddressPostalCode=this.billingFormGroup.value.billingAddress.postalCode,this.buildSecretsManagerRequest(e),this.upgradeRequiresPaymentMethod){if(this.billingFormGroup.invalid)return;const e=yield this.enterPaymentMethodComponent.tokenize();if(!e)throw new Error("Payment method validation failed");yield this.subscriberBillingClient.updatePaymentMethod({type:"organization",data:this.organization},e,{country:this.billingFormGroup.value.billingAddress.country,postalCode:this.billingFormGroup.value.billingAddress.postalCode})}if(!this.organization.hasPublicAndPrivateKeys){const t=yield(0,o._)(this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id))),i=yield(0,o._)(this.keyService.orgKeys$(t).pipe((0,l.T)(e=>{var t;return null!==(t=null==e?void 0:e[this.organizationId])&&void 0!==t?t:null}))),n=yield this.keyService.makeKeyPair(i);e.keys=new p.B(n[0],n[1].encryptedString)}return yield this.organizationApiService.upgrade(this.organizationId,e),this.organizationId})}createCloudHosted(e,t,i,n,r){return le(this,void 0,void 0,function*(){const s=new h.L;if(s.key=e,s.collectionName=t,s.name=this.formGroup.controls.name.value,s.billingEmail=this.formGroup.controls.billingEmail.value,s.initiationPath="New organization creation in-product",s.keys=new p.B(i[0],i[1].encryptedString),s.planType=y.OL.Free,this.hasProvider){const e=new v(this.formGroup.controls.clientOwnerEmail.value,s),t=yield(0,o._)(this.keyService.providerKeys$(r).pipe((0,l.T)(e=>{var t;return null!==(t=null==e?void 0:e[this.providerId])&&void 0!==t?t:null})));(0,g.x)(t,"Provider key not found"),e.organizationCreateRequest.key=(yield this.encryptService.wrapSymmetricKey(n,t)).encryptedString;return(yield this.apiService.postProviderCreateOrganization(this.providerId,e)).organizationId}return(yield this.organizationApiService.create(s)).id})}createSelfHosted(e,t,i){return le(this,void 0,void 0,function*(){if(!this.selectedFile)throw new Error(this.i18nService.t("selectFile"));const n=new FormData;n.append("license",this.selectedFile),n.append("key",e),n.append("collectionName",t);const r=(yield this.organizationApiService.createLicense(n)).id;yield this.apiService.refreshIdentityToken();const s=new p.B(i[0],i[1].encryptedString);return yield this.organizationApiService.updateKeys(r,s),r})}billingSubLabelText(){const e=this.selectedPlan,t=0===e.PasswordManager.basePrice?e.PasswordManager.seatPrice:e.PasswordManager.basePrice;let i="";return e.isAnnual?i+=`${this.i18nService.t("annual")} ($${t}/${this.i18nService.t("yr")})`:i+=`${this.i18nService.t("monthly")} ($${t}/${this.i18nService.t("monthAbbr")})`,i}buildSecretsManagerRequest(e){}upgradeFlowPrefillForm(){}planIsEnabled(e){return!e.disabled&&!e.legacyYear}onLicenseFileUploaded(e){return le(this,void 0,void 0,function*(){this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationCreated"),message:this.i18nService.t("organizationReadyToGo")}),this.acceptingSponsorship||this.isInTrialFlow||this.router.navigate(["/organizations/"+e]),this.isInTrialFlow&&this.onTrialBillingSuccess.emit({orgId:e,subLabelText:this.billingSubLabelText()}),this.onSuccess.emit({organizationId:e}),this.messagingService.send("organizationCreated",{organizationId:e})})}}mt.ɵfac=function(e){return new(e||mt)(n.rXU(R.G),n.rXU(P.W),n.rXU(x.y),n.rXU(S.Lu),n.rXU($.N),n.rXU(E.Ix),n.rXU(w.H),n.rXU(A.m),n.rXU(d.PV),n.rXU(b.U),n.rXU(r.ok),n.rXU(D.X),n.rXU(O.J),n.rXU(M.f),n.rXU(U.Di),n.rXU(I.Hd),n.rXU(I.jZ),n.rXU(G.w))},mt.ɵcmp=n.VBU({type:mt,selectors:[["app-organization-plans"]],viewQuery:function(e,t){if(1&e&&n.GBs(k.Pu,5),2&e){let e;n.mGM(e=n.lsd())&&(t.enterPaymentMethodComponent=e.first)}},inputs:{organizationId:"organizationId",showFree:"showFree",showCancel:"showCancel",acceptingSponsorship:"acceptingSponsorship",planSponsorshipType:"planSponsorshipType",currentPlan:"currentPlan",productTier:"productTier",plan:"plan",enableSecretsManagerByDefault:"enableSecretsManagerByDefault",providerId:"providerId",preSelectedProductTier:"preSelectedProductTier"},outputs:{onSuccess:"onSuccess",onCanceled:"onCanceled",onTrialBillingSuccess:"onTrialBillingSuccess"},features:[n.Jv_([I.Hd,I.jZ])],decls:3,vars:3,consts:[["nonEnterprisePlans",""],["fullFeatureList",""],["notAcceptingSponsorship",""],[4,"ngIf"],["class","tw-pt-6",3,"formGroup","bitSubmit",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"onLicenseFileUploaded"],[1,"tw-pt-6",3,"formGroup","bitSubmit"],[3,"ngClass"],[3,"changedBusinessOwned","formGroup","createOrganization","isProvider","acceptingSponsorship"],["bitTypography","h2"],["formControlName","productTier",3,"block"],["class","tw-mb-3",4,"ngFor","ngForOf"],[3,"formGroup","selectedPlan","upgradeOrganization",4,"ngIf"],["type","submit","buttonType","primary","bitButton","","bitFormButton","",3,"disabled"],["type","button","buttonType","secondary","bitButton","","bitFormButton","",3,"click",4,"ngIf"],[3,"formGroup"],[1,"tw-mb-3"],[3,"change","value"],[1,"tw-text-sm"],[4,"ngIf","ngIfElse"],["class","tw-pl-4",4,"ngIf"],[1,"tw-pl-0","tw-list-inside","tw-mb-0"],[1,"tw-pl-4"],["class","tw-grid tw-grid-cols-12 tw-gap-4",4,"ngIf"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],["bitInput","","type","number","formControlName","additionalStorage","step","1",3,"placeholder"],["formControlName","plan"],[4,"ngFor","ngForOf"],["bitInput","","type","number","formControlName","additionalSeats","required","",3,"placeholder"],["bitInput","","type","number","formControlName","additionalSeats",3,"placeholder"],["type","checkbox","bitCheckbox","","formControlName","premiumAccessAddon"],["type","radio",3,"id","value"],["class","tw-mb-0","bitTypography","body2",4,"ngIf"],["bitTypography","body2",1,"tw-mb-0"],[1,"tw-line-through"],[3,"formGroup","selectedPlan","upgradeOrganization"],["bitTypography","body2",1,"tw-text-muted","tw-italic","tw-mb-3","tw-block"],[3,"group"],[1,"tw-my-4",3,"group","scenario"],["id","price",1,"tw-my-4"],[1,"tw-text-muted","tw-text-base"],[1,"tw-my-1","tw-grid","tw-grid-cols-3","tw-ml-0"],[1,"tw-text-lg"],["type","danger",3,"title"],["type","button","buttonType","secondary","bitButton","","bitFormButton","",3,"click"]],template:function(e,t){1&e&&n.DNE(0,ue,6,7,"ng-container",3)(1,he,2,0,"ng-container",3)(2,pt,20,24,"form",4),2&e&&(n.Y8G("ngIf",t.loading),n.R7$(),n.Y8G("ngIf",t.createOrganization&&!1),n.R7$(),n.Y8G("ngIf",!t.loading))},dependencies:[T.rd,j.YU,j.Sq,j.bT,r.qT,r.me,r.Q0,r.Zm,r.BC,r.cb,r.YS,r.j4,r.JD,N.$,V.L,B.Q,z.G,L.P,K.f,q.j,_.I,X.J,Y.L,H.h,W.d,J.Y,Z.n,Q.r,ee.m,oe,C.Y,ae.T,k.Pu,k.vU,j.oe,re.$],encapsulation:2})},53100:(e,t,i)=>{"use strict";i.d(t,{E:()=>n});class n{}},53127:(e,t,i)=>{"use strict";i.d(t,{y:()=>n});class n{}},53323:(e,t,i)=>{"use strict";i.d(t,{W_:()=>s,aq:()=>r});const n=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function s(e){return n.test(e)}},53674:(e,t,i)=>{"use strict";i.d(t,{V8:()=>l,X8:()=>s,y7:()=>o});var n=i(20702),r=i(69138);class s extends n.r{constructor(e){super(e),this.storageName=this.getResponseProperty("StorageName"),this.storageGb=this.getResponseProperty("StorageGb"),this.maxStorageGb=this.getResponseProperty("MaxStorageGb"),this.license=this.getResponseProperty("License"),this.expiration=this.getResponseProperty("Expiration");const t=this.getResponseProperty("Subscription"),i=this.getResponseProperty("UpcomingInvoice"),n=this.getResponseProperty("CustomerDiscount");this.subscription=null==t?null:new o(t),this.upcomingInvoice=null==i?null:new l(i),this.customerDiscount=null==n?null:new r.P(n)}}class o extends n.r{constructor(e){super(e),this.items=[],this.trialStartDate=this.getResponseProperty("TrialStartDate"),this.trialEndDate=this.getResponseProperty("TrialEndDate"),this.periodStartDate=this.getResponseProperty("PeriodStartDate"),this.periodEndDate=this.getResponseProperty("PeriodEndDate"),this.cancelledDate=this.getResponseProperty("CancelledDate"),this.cancelAtEndDate=this.getResponseProperty("CancelAtEndDate"),this.status=this.getResponseProperty("Status"),this.cancelled=this.getResponseProperty("Cancelled");const t=this.getResponseProperty("Items");null!=t&&(this.items=t.map(e=>new a(e))),this.collectionMethod=this.getResponseProperty("CollectionMethod"),this.suspensionDate=this.getResponseProperty("SuspensionDate"),this.unpaidPeriodEndDate=this.getResponseProperty("unpaidPeriodEndDate"),this.gracePeriod=this.getResponseProperty("GracePeriod")}}class a extends n.r{constructor(e){super(e),this.productId=this.getResponseProperty("ProductId"),this.name=this.getResponseProperty("Name"),this.amount=this.getResponseProperty("Amount"),this.quantity=this.getResponseProperty("Quantity"),this.interval=this.getResponseProperty("Interval"),this.sponsoredSubscriptionItem=this.getResponseProperty("SponsoredSubscriptionItem"),this.addonSubscriptionItem=this.getResponseProperty("AddonSubscriptionItem")}}class l extends n.r{constructor(e){super(e),this.date=this.getResponseProperty("Date"),this.amount=this.getResponseProperty("Amount")}}},53997:(e,t,i)=>{"use strict";i.d(t,{O:()=>p});var n=i(39180),r=i(37831),s=i(94573),o=i(83892),a=i(69194),l=i(62179),c=i(14803),d=i(33812),u=i(43380);const h=[{originX:"start",originY:"top",overlayX:"start",overlayY:"top"},{originX:"start",originY:"bottom",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"bottom"}];class p{get hasPopup(){var e;return(null===(e=this.menu())||void 0===e?void 0:e.ariaRole())||"menu"}constructor(e,t,i){this.elementRef=e,this.viewContainerRef=t,this.overlay=i,this.isOpen=!1,this.role=(0,s.hFB)("button"),this.menu=s.hFB.required({alias:"bitMenuTriggerFor"}),this.overlayRef=null,this.defaultMenuConfig={panelClass:"bit-menu-panel",hasBackdrop:!0,backdropClass:["cdk-overlay-transparent-backdrop","bit-menu-panel-backdrop"],scrollStrategy:this.overlay.scrollStrategies.reposition(),positionStrategy:this.overlay.position().flexibleConnectedTo(this.elementRef).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"}]).withLockedPosition(!0).withFlexibleDimensions(!1).withPush(!0)},this.closedEventsSub=null,this.keyDownEventsSub=null,this.menuCloseListenerSub=null}toggleMenu(){this.isOpen?this.destroyMenu():this.openMenu()}toggleMenuOnRightClick(e){e.preventDefault(),this.isOpen?this.updateMenuPosition(e):this.openMenu(e)}ngOnDestroy(){this.disposeAll()}openMenu(e){const t=this.menu();if(null==t)throw new Error("Cannot find bit-menu element");this.isOpen=!0;const i=e?this.overlay.position().flexibleConnectedTo({x:e.clientX,y:e.clientY}).withPositions(h).withLockedPosition(!1).withFlexibleDimensions(!1).withPush(!0):this.defaultMenuConfig.positionStrategy,n=Object.assign(Object.assign({},this.defaultMenuConfig),{positionStrategy:i,hasBackdrop:!e});this.overlayRef=this.overlay.create(n);const s=new r.VA(t.templateRef(),this.viewContainerRef);this.overlayRef.attach(s);const o=!!e;this.setupClosingActions(o),this.setupMenuCloseListener(),t.keyManager&&(t.keyManager.setFirstItemActive(),this.keyDownEventsSub=this.overlayRef.keydownEvents().subscribe(e=>{var t;return null===(t=this.menu().keyManager)||void 0===t?void 0:t.onKeydown(e)}))}updateMenuPosition(e){if(null==this.overlayRef)return;const t=this.overlay.position().flexibleConnectedTo({x:e.clientX,y:e.clientY}).withPositions([{originX:"start",originY:"top",overlayX:"start",overlayY:"top"}]);this.overlayRef.updatePositionStrategy(t)}destroyMenu(){null!=this.overlayRef&&this.isOpen&&(this.isOpen=!1,this.disposeAll(),this.menu().closed.emit())}setupClosingActions(e){if(!this.overlayRef)return;const t=this.overlayRef.keydownEvents().pipe((0,a.p)(e=>("menu"===this.menu().ariaRole()?["Escape","Tab"]:["Escape"]).includes(e.key))),i=this.menu().closed,r=this.overlayRef.detachments(),s=e?(0,o.h)(r,t,i):(0,o.h)(r,t,this.overlayRef.backdropClick(),i);this.closedEventsSub=s.pipe((0,c.Q)(this.overlayRef.detachments())).subscribe(e=>{e instanceof KeyboardEvent&&"Escape"===e.key&&!(0,n.rp)(e)&&e.preventDefault(),e instanceof KeyboardEvent&&("Tab"===e.key||"Escape"===e.key)&&this.elementRef.nativeElement.focus(),this.destroyMenu()})}setupMenuCloseListener(){this.overlayRef&&(this.menuCloseListenerSub=this.overlayRef.outsidePointerEvents().pipe((0,l.i)(1),(0,c.Q)(this.overlayRef.detachments())).subscribe(e=>{this.destroyMenu()}))}disposeAll(){var e,t,i,n;null===(e=this.closedEventsSub)||void 0===e||e.unsubscribe(),null===(t=this.keyDownEventsSub)||void 0===t||t.unsubscribe(),null===(i=this.menuCloseListenerSub)||void 0===i||i.unsubscribe(),null===(n=this.overlayRef)||void 0===n||n.dispose()}}p.ɵfac=function(e){return new(e||p)(d.rXU(d.aKT),d.rXU(d.c1b),d.rXU(u.hJ))},p.ɵdir=d.FsC({type:p,selectors:[["","bitMenuTriggerFor",""]],hostVars:3,hostBindings:function(e,t){1&e&&d.bIt("click",function(){return t.toggleMenu()}),2&e&&d.BMQ("role",t.role())("aria-expanded",t.isOpen)("aria-haspopup",t.hasPopup)},inputs:{role:[1,"role"],menu:[1,"bitMenuTriggerFor","menu"]},exportAs:["menuTrigger"]})},54006:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 60">
    <path class="tw-fill-illustration-bg-primary" d="M0 15a5 5 0 0 1 5-5h45a5 5 0 0 1 5 5v31.667a5 5 0 0 1-5 5H5a5 5 0 0 1-5-5V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50 11.667H5A3.333 3.333 0 0 0 1.667 15v31.667A3.333 3.333 0 0 0 5 50h45a3.333 3.333 0 0 0 3.333-3.333V15A3.333 3.333 0 0 0 50 11.667ZM5 10a5 5 0 0 0-5 5v31.667a5 5 0 0 0 5 5h45a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5H5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M19.167 30a2.5 2.5 0 0 1 2.5-2.5h11.666a2.5 2.5 0 0 1 2.5 2.5v8.333a2.5 2.5 0 0 1-2.5 2.5H21.667a2.5 2.5 0 0 1-2.5-2.5V30Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33.333 29.167H21.667a.833.833 0 0 0-.834.833v8.333c0 .46.373.834.834.834h11.666c.46 0 .834-.373.834-.834V30a.833.833 0 0 0-.834-.833ZM21.667 27.5a2.5 2.5 0 0 0-2.5 2.5v8.333a2.5 2.5 0 0 0 2.5 2.5h11.666a2.5 2.5 0 0 0 2.5-2.5V30a2.5 2.5 0 0 0-2.5-2.5H21.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M26.667 32.5a.833.833 0 0 1 1.666 0v3.334a.833.833 0 0 1-1.666 0V32.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M23.334 26.667a4.167 4.167 0 0 1 8.333 0v.833H30v-.833a2.5 2.5 0 0 0-5 0v.833h-1.666v-.833ZM54.167 20H.833v-1.666h53.334v1.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M51.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM46.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0ZM41.667 15a1.667 1.667 0 1 1-3.333 0 1.667 1.667 0 0 1 3.333 0Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M68.333 35c0 6.444-5.223 11.667-11.666 11.667C50.223 46.667 45 41.444 45 35.001c0-6.444 5.223-11.667 11.667-11.667 6.443 0 11.666 5.223 11.666 11.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M56.667 45c5.523 0 10-4.477 10-10 0-5.522-4.477-10-10-10s-10 4.478-10 10c0 5.523 4.477 10 10 10Zm0 1.667c6.443 0 11.666-5.223 11.666-11.666 0-6.444-5.223-11.667-11.666-11.667C50.223 23.334 45 28.557 45 35.001c0 6.443 5.223 11.666 11.667 11.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M78.256 59.98A22.918 22.918 0 0 1 80 68.75c0 .691-.56 1.25-1.25 1.25H35.417c-.69 0-1.25-.559-1.25-1.25a22.916 22.916 0 0 1 44.089-8.77Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M78.33 68.334a21.25 21.25 0 0 0-42.492 0h42.491Zm1.67.417a22.918 22.918 0 0 0-31.686-21.173 22.917 22.917 0 0 0-14.147 21.173c0 .69.56 1.25 1.25 1.25H78.75c.69 0 1.25-.56 1.25-1.25Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M9.167 50.834a6.667 6.667 0 0 1 6.666-6.667h22.5a6.667 6.667 0 0 1 0 13.333h-22.5a6.667 6.667 0 0 1-6.666-6.666Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M38.333 45.834h-22.5a5 5 0 1 0 0 10h22.5a5 5 0 0 0 0-10Zm-22.5-1.667a6.667 6.667 0 0 0 0 13.333h22.5a6.667 6.667 0 1 0 0-13.333h-22.5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16.67 47.977c.46 0 .834.374.834.834v1.166l1.093-.358a.833.833 0 1 1 .519 1.584l-1.108.363.694.972a.833.833 0 1 1-1.357.969l-.675-.945-.675.945a.833.833 0 0 1-1.356-.969l.694-.972-1.108-.363a.833.833 0 0 1 .518-1.584l1.094.359V48.81c0-.46.373-.834.833-.834Zm7.5 0c.46 0 .834.374.834.834v1.166l1.093-.358a.833.833 0 1 1 .519 1.584l-1.108.363.694.972a.833.833 0 1 1-1.357.969l-.675-.945-.675.945a.833.833 0 0 1-1.356-.969l.694-.972-1.108-.363a.833.833 0 0 1 .518-1.584l1.094.359V48.81c0-.46.373-.834.833-.834ZM29.167 52.5c0-.46.373-.833.833-.833h3.333a.833.833 0 1 1 0 1.667H30a.833.833 0 0 1-.833-.834ZM35.834 52.5c0-.46.373-.833.833-.833H40a.833.833 0 0 1 0 1.667h-3.333a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
  </svg>
  `},54306:(e,t,i)=>{"use strict";i.d(t,{o:()=>o});var n=i(20702),r=i(41347),s=i(62046);class o extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.accessId=this.getResponseProperty("AccessId"),this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.notes=this.getResponseProperty("Notes"),this.key=this.getResponseProperty("Key"),this.maxAccessCount=this.getResponseProperty("MaxAccessCount"),this.accessCount=this.getResponseProperty("AccessCount"),this.revisionDate=this.getResponseProperty("RevisionDate"),this.expirationDate=this.getResponseProperty("ExpirationDate"),this.deletionDate=this.getResponseProperty("DeletionDate"),this.password=this.getResponseProperty("Password"),this.emails=this.getResponseProperty("Emails"),this.disable=this.getResponseProperty("Disabled")||!1,this.hideEmail=this.getResponseProperty("HideEmail")||!1;const t=this.getResponseProperty("Text");null!=t&&(this.text=new s.Y(t));const i=this.getResponseProperty("File");null!=i&&(this.file=new r.h(i))}}},54351:(e,t,i)=>{"use strict";i.d(t,{S:()=>n});class n{}},54471:(e,t,i)=>{"use strict";i.d(t,{C:()=>a});var n=i(94573),r=i(33277),s=i(30634),o=i(33812);class a{constructor(e){this.el=e,this.title=n.hFB.required({alias:"appA11yTitle"});const t=this.el.nativeElement.getAttribute("title"),i=this.el.nativeElement.getAttribute("aria-label");(0,r.QZ)(()=>{(0,s.J)({element:this.el.nativeElement,title:null!=t?t:this.title(),label:null!=i?i:this.title()})})}}a.ɵfac=function(e){return new(e||a)(o.rXU(o.aKT))},a.ɵdir=o.FsC({type:a,selectors:[["","appA11yTitle",""]],inputs:{title:[1,"appA11yTitle","title"]}})},54607:(e,t,i)=>{"use strict";i.d(t,{WS:()=>Mt,PI:()=>Rt,WM:()=>se,sU:()=>Se,bS:()=>Gt});var n=i(83731),r=i(3204),s=i(33338),o=i(44500),a=i(93695),l=i(14928),c=i(67553),d=i(3633),u=i(15639),h=i(36801),p=i(72932),m=i(25065),v=i(33812),f=i(72245),g=i(69194),y=i(43978),b=i(25607),w=i(82468),S=i(81525),I=i(22848),k=i(88565),C=i(21274),T=i(51757);class F{constructor(){this.showDescription=!0}display$(e,t){return(0,a.of)(!0)}}class R{constructor(){this.enabled=new T.MJ(!1)}ngOnInit(){var e,t,i;this.enabled.setValue(null!==(t=null===(e=this.policyResponse)||void 0===e?void 0:e.enabled)&&void 0!==t&&t),null!=(null===(i=this.policyResponse)||void 0===i?void 0:i.data)&&this.loadData()}buildRequest(){var e;if(!this.policy)throw new Error("Policy was not found");const t={enabled:null!==(e=this.enabled.value)&&void 0!==e&&e,data:this.buildRequestData()};return Promise.resolve(t)}confirm(){return!0}loadData(){var e,t,i;null===(e=this.data)||void 0===e||e.patchValue(null!==(i=null===(t=this.policyResponse)||void 0===t?void 0:t.data)&&void 0!==i?i:{})}buildRequestData(){return null!=this.data?this.data.value:null}}R.ɵfac=function(e){return new(e||R)},R.ɵdir=v.FsC({type:R,inputs:{policyResponse:"policyResponse",policy:"policy"}});var P=i(50700),x=i(89105),$=i(56898),E=i(50352),A=i(7730),D=i(67311),O=i(90246),M=i(86226),U=i(59032),G=i(88016),j=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const N=["dialog"];function V(e,t){1&e&&(v.j41(0,"bit-simple-dialog",3)(1,"span",4),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.qex(4,5),v.j41(5,"div",6),v.EFF(6),v.nI1(7,"i18n"),v.j41(8,"div",7)(9,"ul",8)(10,"li"),v.EFF(11),v.nI1(12,"i18n"),v.k0s(),v.j41(13,"li"),v.EFF(14),v.nI1(15,"i18n"),v.k0s(),v.j41(16,"li"),v.EFF(17),v.nI1(18,"i18n"),v.k0s()()(),v.EFF(19),v.nI1(20,"i18n"),v.j41(21,"a",1),v.EFF(22),v.nI1(23,"i18n"),v.k0s()(),v.bVm(),v.qex(24,9),v.j41(25,"span",10)(26,"button",11),v.EFF(27),v.nI1(28,"i18n"),v.k0s(),v.j41(29,"button",12),v.EFF(30),v.nI1(31,"i18n"),v.k0s()(),v.bVm(),v.k0s()),2&e&&(v.R7$(2),v.JRh(v.bMT(3,11,"organizationDataOwnershipWarningTitle")),v.R7$(4),v.SpI(" ",v.bMT(7,13,"organizationDataOwnershipWarningContentTop")," "),v.R7$(5),v.SpI(" ",v.bMT(12,15,"organizationDataOwnershipWarning1")," "),v.R7$(3),v.SpI(" ",v.bMT(15,17,"organizationDataOwnershipWarning2")," "),v.R7$(3),v.SpI(" ",v.bMT(18,19,"organizationDataOwnershipWarning3")," "),v.R7$(2),v.SpI(" ",v.bMT(20,21,"organizationDataOwnershipWarningContentBottom")," "),v.R7$(3),v.SpI(" ",v.bMT(23,23,"organizationDataOwnershipContentAnchor"),". "),v.R7$(4),v.Y8G("bitDialogClose",!0),v.R7$(),v.SpI(" ",v.bMT(28,25,"continue")," "),v.R7$(2),v.Y8G("bitDialogClose",!1),v.R7$(),v.SpI(" ",v.bMT(31,27,"cancel")," "))}class B extends R{constructor(e,t,i){super(),this.dialogService=e,this.i18nService=t,this.encryptService=i}confirm(){return j(this,void 0,void 0,function*(){var e;if((null===(e=this.policyResponse)||void 0===e?void 0:e.enabled)&&!this.enabled.value){const e=this.dialogService.open(this.warningContent,{positionStrategy:new C.u3}),t=yield(0,k.s)(e.closed);return Boolean(t)}return!0})}buildVNextRequest(e){return j(this,void 0,void 0,function*(){var t;if(!this.policy)throw new Error("Policy was not found");const i=yield this.getEncryptedDefaultUserCollectionName(e);return{policy:{enabled:null!==(t=this.enabled.value)&&void 0!==t&&t,data:this.buildRequestData()},metadata:{defaultUserCollectionName:i}}})}getEncryptedDefaultUserCollectionName(e){return j(this,void 0,void 0,function*(){const t=this.i18nService.t("myItems"),i=yield this.encryptService.encryptString(t,e);if(!i.encryptedString)throw new Error("Encryption error");return i.encryptedString})}}B.ɵfac=function(e){return new(e||B)(v.rXU(C.o3),v.rXU(P.W),v.rXU(x.N))},B.ɵcmp=v.VBU({type:B,selectors:[["vnext-organization-data-ownership-policy-edit"]],viewQuery:function(e,t){if(1&e&&v.GBs(N,7),2&e){let e;v.mGM(e=v.lsd())&&(t.warningContent=e.first)}},features:[v.Vt3],decls:13,vars:10,consts:[["dialog",""],["bitLink","","href","https://bitwarden.com/resources/credential-lifecycle-management/","target","_blank"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],["background","alt"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-text-left","tw-overflow-hidden"],[1,"tw-flex","tw-flex-col","tw-p-2"],[1,"tw-list-disc","tw-pl-5","tw-space-y-2","tw-break-words","tw-mb-0"],["bitDialogFooter",""],[1,"tw-flex","tw-gap-2"],["bitButton","","buttonType","primary","type","submit",3,"bitDialogClose"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"]],template:function(e,t){1&e&&(v.j41(0,"p"),v.EFF(1),v.nI1(2,"i18n"),v.j41(3,"a",1),v.EFF(4),v.nI1(5,"i18n"),v.k0s()(),v.j41(6,"bit-form-control"),v.nrm(7,"input",2),v.j41(8,"bit-label"),v.EFF(9),v.nI1(10,"i18n"),v.k0s()(),v.DNE(11,V,32,29,"ng-template",null,0,v.C5r)),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,4,"organizationDataOwnershipDescContent")," "),v.R7$(3),v.SpI(" ",v.bMT(5,6,"organizationDataOwnershipContentAnchor"),". "),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(10,8,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,$.Q,E.P,A.I,D.o,O.f,M.j,U.L,G.$],encapsulation:2,changeDetection:0});var z=i(94573),L=i(35500),K=i(27866),q=i(69855),_=i(1601),X=i(77468),Y=i(26657),H=i(45154),W=i(68016),J=i(58806),Z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Q=["policyForm"];function ee(e,t){1&e&&(v.j41(0,"div"),v.nrm(1,"i",10),v.nI1(2,"i18n"),v.j41(3,"span",11),v.EFF(4),v.nI1(5,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.Y8G("title",v.mNQ(v.bMT(2,3,"loading"))),v.R7$(3),v.JRh(v.bMT(5,5,"loading")))}function te(e,t){if(1&e&&(v.j41(0,"p",6),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e){const e=v.XpG();v.R7$(),v.JRh(v.bMT(2,1,e.policy.description))}}function ie(e,t){}class ne{constructor(e,t,i,n,r,s,o,l,c,d){this.data=e,this.accountService=t,this.policyApiService=i,this.i18nService=n,this.cdr=r,this.formBuilder=s,this.dialogRef=o,this.toastService=l,this.configService=c,this.keyService=d,this.policyType=y.tt,this.loading=!0,this.enabled=!1,this.saveDisabled$=(0,a.of)(!1),this.formGroup=this.formBuilder.group({enabled:[this.enabled]}),this.submit=()=>Z(this,void 0,void 0,function*(){if(!this.policyComponent)throw new Error("PolicyComponent not initialized.");if(0!=(yield this.policyComponent.confirm()))try{this.policyComponent instanceof B&&(yield this.isVNextEnabled())?yield this.handleVNextSubmission(this.policyComponent):yield this.handleStandardSubmission(),this.toastService.showToast({variant:"success",message:this.i18nService.t("editedPolicyId",this.i18nService.t(this.data.policy.name))}),this.dialogRef.close("saved")}catch(e){this.toastService.showToast({variant:"error",message:e.message})}else this.dialogRef.close()})}get policy(){return this.data.policy}ngAfterViewInit(){return Z(this,void 0,void 0,function*(){const e=yield this.load();if(this.loading=!1,!this.policyFormRef)throw new Error("Template not initialized.");this.policyComponent=this.policyFormRef.createComponent(this.data.policy.component).instance,this.policyComponent.policy=this.data.policy,this.policyComponent.policyResponse=e,this.policyComponent.data&&(this.saveDisabled$=this.policyComponent.data.statusChanges.pipe((0,r.T)(t=>"VALID"!==t||!e.canToggleState))),this.cdr.detectChanges()})}load(){return Z(this,void 0,void 0,function*(){try{return yield this.policyApiService.getPolicy(this.data.organizationId,this.data.policy.type)}catch(e){if(404===e.statusCode)return new b.i({Enabled:!1});throw e}})}isVNextEnabled(){return Z(this,void 0,void 0,function*(){return yield(0,f._)(this.configService.getFeatureFlag$(w.TO.CreateDefaultLocation))})}handleStandardSubmission(){return Z(this,void 0,void 0,function*(){if(!this.policyComponent)throw new Error("PolicyComponent not initialized.");const e=yield this.policyComponent.buildRequest();yield this.policyApiService.putPolicy(this.data.organizationId,this.data.policy.type,e)})}handleVNextSubmission(e){return Z(this,void 0,void 0,function*(){const t=yield(0,f._)(this.accountService.activeAccount$.pipe(d.F6,(0,o.n)(e=>this.keyService.orgKeys$(e)),(0,g.p)(e=>null!=e),(0,r.T)(e=>{var t;return null!==(t=e[this.data.organizationId])&&void 0!==t?t:null})));if(null==t)throw new Error("No encryption key for this organization.");const i=yield e.buildVNextRequest(t);yield this.policyApiService.putPolicyVNext(this.data.organizationId,this.data.policy.type,i)})}}ne.open=(e,t)=>e.open(ne,t),ne.ɵfac=function(e){return new(e||ne)(v.rXU(S.Qs),v.rXU(L.Di),v.rXU(K.m),v.rXU(P.W),v.rXU(z.gRc),v.rXU(T.ok),v.rXU(C.ce),v.rXU(q.f),v.rXU(_.w),v.rXU(I.Lu))},ne.ɵcmp=v.VBU({type:ne,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&v.GBs(Q,7,v.c1b),2&e){let e;v.mGM(e=v.lsd())&&(t.policyFormRef=e.first)}},decls:18,vars:21,consts:[["policyForm",""],[3,"formGroup","bitSubmit"],[3,"loading","title","subtitle"],["bitDialogContent",""],[4,"ngIf"],[3,"hidden"],["bitTypography","body1"],["bitDialogFooter",""],["bitButton","","buttonType","primary","bitFormButton","","type","submit",3,"disabled"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(v.j41(0,"form",1)(1,"bit-dialog",2),v.nI1(2,"i18n"),v.nI1(3,"i18n"),v.qex(4,3),v.DNE(5,ee,6,7,"div",4),v.j41(6,"div",5),v.nVh(7,te,3,3,"p",6),v.DNE(8,ie,0,0,"ng-template",null,0,v.C5r),v.k0s(),v.bVm(),v.qex(10,7),v.j41(11,"button",8),v.nI1(12,"async"),v.EFF(13),v.nI1(14,"i18n"),v.k0s(),v.j41(15,"button",9),v.EFF(16),v.nI1(17,"i18n"),v.k0s(),v.bVm(),v.k0s()()),2&e&&(v.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),v.R7$(),v.Y8G("loading",t.loading)("title",v.bMT(2,11,"editPolicy"))("subtitle",v.bMT(3,13,t.policy.name)),v.R7$(4),v.Y8G("ngIf",t.loading),v.R7$(),v.Y8G("hidden",t.loading),v.R7$(),v.vxM(t.policy.showDescription?7:-1),v.R7$(4),v.Y8G("disabled",v.bMT(12,15,t.saveDisabled$)),v.R7$(2),v.SpI(" ",v.bMT(14,17,"save")," "),v.R7$(3),v.SpI(" ",v.bMT(17,19,"cancel")," "))},dependencies:[m.G,X.bT,T.qT,T.cb,T.j4,Y.$,H.L,$.Q,A.I,W.m,J.r,X.Jj,G.$],encapsulation:2});class re{constructor(e){this.policies=Object.freeze([...e])}getPolicies(){return this.policies}}const se=new h.aZ("POLICY_EDIT_REGISTER");var oe=i(74208),ae=i(23649),le=i(18499),ce=i(47696),de=i(10672),ue=i(38410),he=i(22466),pe=i(36572),me=i(93748);function ve(e,t){1&e&&(v.nrm(0,"i",0),v.nI1(1,"i18n"),v.j41(2,"span",1),v.EFF(3),v.nI1(4,"i18n"),v.k0s()),2&e&&(v.Y8G("title",v.mNQ(v.bMT(1,3,"loading"))),v.R7$(3),v.JRh(v.bMT(4,5,"loading")))}function fe(e,t){1&e&&(v.EFF(0,"\n                  "),v.j41(1,"span",7),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.EFF(4,"\n                ")),2&e&&(v.R7$(2),v.JRh(v.bMT(3,1,"on")))}function ge(e,t){if(1&e){const e=v.RV6();v.j41(0,"tr",3)(1,"td",4),v.EFF(2,"\n                "),v.j41(3,"button",5),v.bIt("click",function(){oe.eBV(e);const t=v.XpG().$implicit,i=v.XpG(3),n=v.r8f(5);return oe.Njj(i.edit(t,n))}),v.EFF(4),v.nI1(5,"i18n"),v.k0s(),v.EFF(6,"\n                "),v.nVh(7,fe,5,3),v.j41(8,"small",6),v.EFF(9),v.nI1(10,"i18n"),v.k0s(),v.EFF(11,"\n              "),v.k0s()()}if(2&e){const e=v.XpG().$implicit;v.XpG(3);const t=v.r8f(3);v.R7$(4),v.SpI("\n                  ",v.bMT(5,3,e.name),"\n                "),v.R7$(3),v.vxM(t.get(e.type)?7:-1),v.R7$(2),v.JRh(v.bMT(10,5,e.description))}}function ye(e,t){if(1&e&&(v.nVh(0,ge,12,7,"tr",3),v.nI1(1,"async")),2&e){const e=t.$implicit,i=v.XpG(3),n=v.r8f(1);v.vxM(v.bMT(1,1,e.display$(n,i.configService))?0:-1)}}function be(e,t){if(1&e&&(v.Z7z(0,ye,2,3,null,null,v.Vm6),v.nI1(2,"async")),2&e){const e=v.XpG(2);v.Dyx(v.bMT(2,0,e.policies$))}}function we(e,t){1&e&&(v.j41(0,"bit-table"),v.DNE(1,be,3,2,"ng-template",2),v.k0s())}class Se{constructor(e,t,i,n,l,c,h,p,m){this.route=e,this.organizationService=t,this.accountService=i,this.policyApiService=n,this.policyListService=l,this.dialogService=c,this.policyService=h,this.configService=p,this.destroyRef=m,this.userId$=this.accountService.activeAccount$.pipe(d.F6),this.organizationId$=this.route.params.pipe((0,r.T)(e=>e.organizationId)),this.organization$=(0,s.z)([this.userId$,this.organizationId$]).pipe((0,o.n)(([e,t])=>this.organizationService.organizations$(e).pipe((0,u.Hc)(t),(0,r.T)(e=>{if(null==e)throw new Error("No organization found for provided userId");return e})))),this.policies$=(0,a.of)(this.policyListService.getPolicies()),this.orgPolicies$=this.accountService.activeAccount$.pipe(d.F6,(0,o.n)(e=>this.policyService.policies$(e)),(0,o.n)(()=>this.organizationId$),(0,o.n)(e=>this.policyApiService.getPolicies(e)),(0,r.T)(e=>null!=e.data&&e.data.length>0?e.data:[])),this.policiesEnabledMap$=this.orgPolicies$.pipe((0,r.T)(e=>{const t=new Map;return e.forEach(e=>{t.set(e.type,e.enabled)}),t})),this.handleLaunchEvent()}handleLaunchEvent(){(0,s.z)([this.route.queryParams.pipe((0,l.$)()),this.policies$,this.organizationId$,this.orgPolicies$]).pipe((0,r.T)(([e,t,i,n])=>{if(null!=e.policyId){const r=e.policyId;for(const e of n)if(e.id===r){for(let n=0;n<t.length;n++)if(t[n].type===e.type){this.edit(t[n],i);break}break}}}),(0,n.pQ)(this.destroyRef)).subscribe()}edit(e,t){var i;(null!==(i=e.editDialogComponent)&&void 0!==i?i:ne).open(this.dialogService,{data:{policy:e,organizationId:t}})}}Se.ɵfac=function(e){return new(e||Se)(v.rXU(ae.nX),v.rXU(c.PV),v.rXU(L.Di),v.rXU(K.m),v.rXU(re),v.rXU(C.o3),v.rXU(le.m),v.rXU(_.w),v.rXU(oe.abz))},Se.ɵcmp=v.VBU({type:Se,selectors:[["ng-component"]],features:[v.Jv_([(0,h.F)({provide:re,deps:[se]})])],decls:10,vars:10,consts:[["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["body",""],["bitRow",""],["bitCell",""],["type","button","bitLink","",3,"click"],[1,"tw-text-muted","tw-block"],["bitBadge","","variant","success"]],template:function(e,t){if(1&e&&(v.nrm(0,"app-header"),v.SS7(1),v.nI1(2,"async"),v.SS7(3),v.nI1(4,"async"),v.SS7(5),v.nI1(6,"async"),v.j41(7,"bit-container"),v.nVh(8,ve,5,7)(9,we,2,0,"bit-table"),v.k0s()),2&e){v.R7$();const e=v.bH3(v.bMT(2,1,t.organization$));v.R7$(2);const i=v.bH3(v.bMT(4,4,t.policiesEnabledMap$));v.R7$(2);const n=v.bH3(v.bMT(6,7,t.organizationId$));v.R7$(3),v.vxM(e&&i&&n?9:8)}},dependencies:[m.G,ce.n,de.H,U.o,ue.Q,he.Y,pe._,pe.O,p.G,me.f,X.Jj,G.$],encapsulation:2,changeDetection:0});var Ie=i(44432);class ke extends R{}ke.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(ke)))(t||ke)}})(),ke.ɵcmp=v.VBU({type:ke,selectors:[["disable-send-policy-edit"]],features:[v.Vt3],decls:8,vars:7,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-callout",0),v.EFF(1),v.nI1(2,"i18n"),v.k0s(),v.j41(3,"bit-form-control"),v.nrm(4,"input",1),v.j41(5,"bit-label"),v.EFF(6),v.nI1(7,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,3,"disableSendExemption"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(7,5,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,Ie.G,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});class Ce extends R{}Ce.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(Ce)))(t||Ce)}})(),Ce.ɵcmp=v.VBU({type:Ce,selectors:[["autotype-policy-edit"]],features:[v.Vt3],decls:5,vars:4,consts:[["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-form-control"),v.nrm(1,"input",0),v.j41(2,"bit-label"),v.EFF(3),v.nI1(4,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(4,2,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});var Te=i(78781),Fe=i(97553),Re=i(43759),Pe=i(33886),xe=i(68923),$e=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ee(e,t){1&e&&(v.j41(0,"bit-callout",14),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,1,"keyConnectorPolicyRestriction"),"\n"))}function Ae(e,t){if(1&e&&v.nrm(0,"bit-option",15),2&e){const e=t.$implicit;v.Y8G("value",e.value)("label",e.name)}}class De extends R{constructor(e,t,i,n){super(),this.formBuilder=e,this.organizationService=i,this.accountService=n,this.MinPasswordLength=Te.A.minimumPasswordLength,this.data=this.formBuilder.group({minComplexity:[null],minLength:[this.MinPasswordLength,[T.k0.min(Te.A.minimumPasswordLength)]],requireUpper:[!1],requireLower:[!1],requireNumbers:[!1],requireSpecial:[!1],enforceOnLogin:[!1]}),this.showKeyConnectorInfo=!1,this.passwordScores=[{name:"-- "+t.t("select")+" --",value:null},{name:t.t("weak")+" (0)",value:0},{name:t.t("weak")+" (1)",value:1},{name:t.t("weak")+" (2)",value:2},{name:t.t("good")+" (3)",value:3},{name:t.t("strong")+" (4)",value:4}]}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return $e(this,void 0,void 0,function*(){e.ngOnInit.call(this);const t=yield(0,f._)((0,d.F6)(this.accountService.activeAccount$)),i=yield(0,f._)(this.organizationService.organizations$(t).pipe((0,c.Sw)(this.policyResponse.organizationId)));this.showKeyConnectorInfo=i.keyConnectorEnabled})}}De.ɵfac=function(e){return new(e||De)(v.rXU(T.ok),v.rXU(P.W),v.rXU(c.PV),v.rXU(L.Di))},De.ɵcmp=v.VBU({type:De,selectors:[["master-password-policy-edit"]],features:[v.Vt3],decls:40,vars:17,consts:[["type","info",4,"ngIf"],[3,"formGroup"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],["type","checkbox","bitCheckbox","","formControlName","enforceOnLogin","id","enforceOnLogin"],[1,"tw-flex","tw-space-x-4"],[1,"tw-flex-auto"],["formControlName","minComplexity","id","minComplexity"],[3,"value","label",4,"ngFor","ngForOf"],["bitInput","","type","number","formControlName","minLength","id","minLength",3,"min"],[1,"!tw-mb-2"],["type","checkbox","bitCheckbox","","formControlName","requireUpper","id","requireUpper"],["type","checkbox","bitCheckbox","","formControlName","requireLower","id","requireLower"],["type","checkbox","bitCheckbox","","formControlName","requireNumbers","id","requireNumbers"],["type","checkbox","bitCheckbox","","formControlName","requireSpecial","id","requireSpecial"],["type","info"],[3,"value","label"]],template:function(e,t){1&e&&(v.DNE(0,Ee,3,3,"bit-callout",0),v.j41(1,"div",1)(2,"bit-form-control"),v.nrm(3,"input",2),v.j41(4,"bit-label"),v.EFF(5),v.nI1(6,"i18n"),v.k0s()(),v.j41(7,"bit-form-control"),v.nrm(8,"input",3),v.j41(9,"bit-label"),v.EFF(10),v.nI1(11,"i18n"),v.k0s()(),v.j41(12,"div",4)(13,"bit-form-field",5)(14,"bit-label"),v.EFF(15),v.nI1(16,"i18n"),v.k0s(),v.j41(17,"bit-select",6),v.DNE(18,Ae,1,2,"bit-option",7),v.k0s()(),v.j41(19,"bit-form-field",5)(20,"bit-label"),v.EFF(21),v.nI1(22,"i18n"),v.k0s(),v.nrm(23,"input",8),v.k0s()(),v.j41(24,"bit-form-control",9),v.nrm(25,"input",10),v.j41(26,"bit-label"),v.EFF(27,"A-Z"),v.k0s()(),v.j41(28,"bit-form-control",9),v.nrm(29,"input",11),v.j41(30,"bit-label"),v.EFF(31,"a-z"),v.k0s()(),v.j41(32,"bit-form-control",9),v.nrm(33,"input",12),v.j41(34,"bit-label"),v.EFF(35,"0-9"),v.k0s()(),v.j41(36,"bit-form-control"),v.nrm(37,"input",13),v.j41(38,"bit-label"),v.EFF(39,"!@#$%^&*"),v.k0s()()()),2&e&&(v.Y8G("ngIf",t.showKeyConnectorInfo),v.R7$(),v.Y8G("formGroup",t.data),v.R7$(2),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(6,9,"turnOn")),v.R7$(5),v.JRh(v.bMT(11,11,"enforceOnLoginDesc")),v.R7$(5),v.JRh(v.bMT(16,13,"minComplexityScore")),v.R7$(3),v.Y8G("ngForOf",t.passwordScores),v.R7$(3),v.JRh(v.bMT(22,15,"minLength")),v.R7$(2),v.Y8G("min",t.MinPasswordLength))},dependencies:[m.G,X.Sq,X.bT,T.me,T.Q0,T.Zm,T.BC,T.cb,T.VZ,T.l_,T.j4,T.JD,Ie.G,E.P,O.f,M.j,Fe.J,Re.h,Pe.w,xe.P,G.$],encapsulation:2,changeDetection:0});class Oe extends R{}Oe.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(Oe)))(t||Oe)}})(),Oe.ɵcmp=v.VBU({type:Oe,selectors:[["organization-data-ownership-policy-edit"]],features:[v.Vt3],decls:8,vars:7,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-callout",0),v.EFF(1),v.nI1(2,"i18n"),v.k0s(),v.j41(3,"bit-form-control"),v.nrm(4,"input",1),v.j41(5,"bit-label"),v.EFF(6),v.nI1(7,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,3,"personalOwnershipExemption"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(7,5,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,Ie.G,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});var Me=i(16878),Ue=i(29776);function Ge(e,t){if(1&e&&v.nrm(0,"bit-option",7),2&e){const e=t.$implicit;v.Y8G("value",e.value)("label",e.name)}}function je(e,t){if(1&e&&(v.j41(0,"div")(1,"h3",8),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.j41(4,"div",2)(5,"bit-form-field",9)(6,"bit-label"),v.EFF(7),v.nI1(8,"i18n"),v.k0s(),v.nrm(9,"input",10),v.k0s()(),v.j41(10,"div",2)(11,"bit-form-field",9)(12,"bit-label"),v.EFF(13),v.nI1(14,"i18n"),v.k0s(),v.nrm(15,"input",11),v.k0s(),v.j41(16,"bit-form-field",9)(17,"bit-label"),v.EFF(18),v.nI1(19,"i18n"),v.k0s(),v.nrm(20,"input",12),v.k0s()(),v.j41(21,"bit-form-control"),v.nrm(22,"input",13),v.j41(23,"bit-label"),v.EFF(24),v.nI1(25,"i18n"),v.k0s()(),v.j41(26,"bit-form-control"),v.nrm(27,"input",14),v.j41(28,"bit-label"),v.EFF(29),v.nI1(30,"i18n"),v.k0s()(),v.j41(31,"bit-form-control"),v.nrm(32,"input",15),v.j41(33,"bit-label"),v.EFF(34),v.nI1(35,"i18n"),v.k0s()(),v.j41(36,"bit-form-control"),v.nrm(37,"input",16),v.j41(38,"bit-label"),v.EFF(39),v.k0s()()()),2&e){const e=v.XpG();v.R7$(2),v.JRh(v.bMT(3,14,"password")),v.R7$(5),v.JRh(v.bMT(8,16,"minLength")),v.R7$(2),v.Y8G("min",e.minLengthMin)("max",e.minLengthMax),v.R7$(4),v.JRh(v.bMT(14,18,"minNumbers")),v.R7$(2),v.Y8G("min",e.minNumbersMin)("max",e.minNumbersMax),v.R7$(3),v.JRh(v.bMT(19,20,"minSpecial")),v.R7$(2),v.Y8G("min",e.minSpecialMin)("max",e.minSpecialMax),v.R7$(4),v.JRh(v.bMT(25,22,"uppercaseLabel")),v.R7$(5),v.JRh(v.bMT(30,24,"lowercaseLabel")),v.R7$(5),v.JRh(v.bMT(35,26,"numbersLabel")),v.R7$(5),v.JRh("!@#$%^&*")}}function Ne(e,t){if(1&e&&(v.j41(0,"div")(1,"h3",8),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.j41(4,"div",2)(5,"bit-form-field",9)(6,"bit-label"),v.EFF(7),v.nI1(8,"i18n"),v.k0s(),v.nrm(9,"input",17),v.k0s()(),v.j41(10,"bit-form-control"),v.nrm(11,"input",18),v.j41(12,"bit-label"),v.EFF(13),v.nI1(14,"i18n"),v.k0s()(),v.j41(15,"bit-form-control"),v.nrm(16,"input",19),v.j41(17,"bit-label"),v.EFF(18),v.nI1(19,"i18n"),v.k0s()()()),2&e){const e=v.XpG();v.R7$(2),v.JRh(v.bMT(3,6,"passphrase")),v.R7$(5),v.JRh(v.bMT(8,8,"minimumNumberOfWords")),v.R7$(2),v.Y8G("min",e.minNumberWordsMin)("max",e.minNumberWordsMax),v.R7$(4),v.JRh(v.bMT(14,10,"capitalize")),v.R7$(5),v.JRh(v.bMT(19,12,"includeNumber"))}}class Ve extends R{get showPasswordPolicies$(){return this.showPasswordPolicies.asObservable()}get showPassphrasePolicies$(){return this.showPassphrasePolicies.asObservable()}constructor(e,t){super(),this.formBuilder=e,this.minLengthMin=Ue.qG.password.profiles[Ue.WV.account].constraints.default.length.min,this.minLengthMax=Ue.qG.password.profiles[Ue.WV.account].constraints.default.length.max,this.minNumbersMin=Ue.qG.password.profiles[Ue.WV.account].constraints.default.minNumber.min,this.minNumbersMax=Ue.qG.password.profiles[Ue.WV.account].constraints.default.minNumber.max,this.minSpecialMin=Ue.qG.password.profiles[Ue.WV.account].constraints.default.minSpecial.min,this.minSpecialMax=Ue.qG.password.profiles[Ue.WV.account].constraints.default.minSpecial.max,this.minNumberWordsMin=Ue.qG.passphrase.profiles[Ue.WV.account].constraints.default.numWords.min,this.minNumberWordsMax=Ue.qG.passphrase.profiles[Ue.WV.account].constraints.default.numWords.max,this.data=this.formBuilder.group({overridePasswordType:[null],minLength:[null,[T.k0.min(this.minLengthMin),T.k0.max(this.minLengthMax)]],useUpper:[null],useLower:[null],useNumbers:[null],useSpecial:[null],minNumbers:[null,[T.k0.min(this.minNumbersMin),T.k0.max(this.minNumbersMax)]],minSpecial:[null,[T.k0.min(this.minSpecialMin),T.k0.max(this.minSpecialMax)]],minNumberWords:[null,[T.k0.min(this.minNumberWordsMin),T.k0.max(this.minNumberWordsMax)]],capitalize:[null],includeNumber:[null]}),this.showPasswordPolicies=new Me.t(!0),this.showPassphrasePolicies=new Me.t(!0),this.overridePasswordTypeOptions=[{name:t.t("userPreference"),value:null},{name:t.t("password"),value:Be},{name:t.t("passphrase"),value:"passphrase"}],this.data.valueChanges.pipe(Le(Be),(0,n.pQ)()).subscribe(this.showPasswordPolicies),this.data.valueChanges.pipe(Le(ze),(0,n.pQ)()).subscribe(this.showPassphrasePolicies)}}Ve.ɵfac=function(e){return new(e||Ve)(v.rXU(T.ze),v.rXU(P.W))},Ve.ɵcmp=v.VBU({type:Ve,selectors:[["password-generator-policy-edit"]],features:[v.Vt3],decls:17,vars:15,consts:[[3,"formGroup"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6","tw-mb-0"],["formControlName","overridePasswordType","id","overrideType"],[3,"value","label",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"value","label"],["bitTypography","h3",1,"tw-mt-4"],[1,"tw-col-span-6"],["bitInput","","type","number","formControlName","minLength",3,"min","max"],["bitInput","","type","number","formControlName","minNumbers",3,"min","max"],["bitInput","","type","number","formControlName","minSpecial",3,"min","max"],["type","checkbox","bitCheckbox","","formControlName","useUpper","id","useUpper"],["type","checkbox","bitCheckbox","","formControlName","useLower","id","useLower"],["type","checkbox","bitCheckbox","","formControlName","useNumbers","id","useNumbers"],["type","checkbox","bitCheckbox","","formControlName","useSpecial","id","useSpecial"],["bitInput","","type","number","formControlName","minNumberWords",3,"min","max"],["type","checkbox","bitCheckbox","","formControlName","capitalize","id","capitalize"],["type","checkbox","bitCheckbox","","formControlName","includeNumber","id","includeNumber"]],template:function(e,t){1&e&&(v.j41(0,"div",0)(1,"bit-form-control"),v.nrm(2,"input",1),v.j41(3,"bit-label"),v.EFF(4),v.nI1(5,"i18n"),v.k0s()(),v.j41(6,"div",2)(7,"bit-form-field",3)(8,"bit-label"),v.EFF(9),v.nI1(10,"i18n"),v.k0s(),v.j41(11,"bit-select",4),v.DNE(12,Ge,1,2,"bit-option",5),v.k0s()()(),v.DNE(13,je,40,28,"div",6),v.nI1(14,"async"),v.DNE(15,Ne,20,14,"div",6),v.nI1(16,"async"),v.k0s()),2&e&&(v.Y8G("formGroup",t.data),v.R7$(2),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(5,7,"turnOn")),v.R7$(5),v.JRh(v.bMT(10,9,"overridePasswordTypePolicy")),v.R7$(3),v.Y8G("ngForOf",t.overridePasswordTypeOptions),v.R7$(),v.Y8G("ngIf",v.bMT(14,11,t.showPasswordPolicies$)),v.R7$(2),v.Y8G("ngIf",v.bMT(16,13,t.showPassphrasePolicies$)))},dependencies:[m.G,X.Sq,X.bT,T.me,T.Q0,T.Zm,T.BC,T.cb,T.VZ,T.zX,T.l_,T.j4,T.JD,E.P,O.f,M.j,Fe.J,Re.h,Pe.w,xe.P,J.r,X.Jj,G.$],encapsulation:2,changeDetection:0});const Be="password",ze="passphrase";function Le(e){return(0,r.T)(t=>{var i;return(null!==(i=null==t?void 0:t.overridePasswordType)&&void 0!==i?i:e)===e})}class Ke extends R{}Ke.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(Ke)))(t||Ke)}})(),Ke.ɵcmp=v.VBU({type:Ke,selectors:[["remove-unlock-with-pin-policy-edit"]],features:[v.Vt3],decls:5,vars:4,consts:[["type","checkbox","id","enabled","bitCheckbox","",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-form-control"),v.nrm(1,"input",0),v.j41(2,"bit-label"),v.EFF(3),v.nI1(4,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(4,2,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});class qe extends R{}qe.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(qe)))(t||qe)}})(),qe.ɵcmp=v.VBU({type:qe,selectors:[["require-sso-policy-edit"]],features:[v.Vt3],decls:12,vars:14,consts:[["type","info",3,"title"],["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-callout",0),v.nI1(1,"i18n"),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.j41(4,"bit-callout",1),v.EFF(5),v.nI1(6,"i18n"),v.k0s(),v.j41(7,"bit-form-control"),v.nrm(8,"input",2),v.j41(9,"bit-label"),v.EFF(10),v.nI1(11,"i18n"),v.k0s()()),2&e&&(v.Y8G("title",v.mNQ(v.bMT(1,6,"prerequisite"))),v.R7$(2),v.SpI(" ",v.bMT(3,8,"requireSsoPolicyReq"),"\n"),v.R7$(3),v.SpI(" ",v.bMT(6,10,"requireSsoExemption"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(11,12,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,Ie.G,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});var _e=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Xe(e,t){1&e&&(v.j41(0,"bit-callout",7),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,1,"keyConnectorPolicyRestriction"),"\n"))}class Ye extends R{constructor(e,t,i){super(),this.formBuilder=e,this.organizationService=t,this.accountService=i,this.data=this.formBuilder.group({autoEnrollEnabled:!1}),this.showKeyConnectorInfo=!1}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return _e(this,void 0,void 0,function*(){e.ngOnInit.call(this);const t=yield(0,f._)((0,d.F6)(this.accountService.activeAccount$));if(!t)throw new Error("No user found.");if(!this.policyResponse)throw new Error("Policies not found");const i=yield(0,f._)(this.organizationService.organizations$(t).pipe((0,c.Sw)(this.policyResponse.organizationId)));if(!i)throw new Error("No organization found.");this.showKeyConnectorInfo=i.keyConnectorEnabled})}}Ye.ɵfac=function(e){return new(e||Ye)(v.rXU(T.ok),v.rXU(c.PV),v.rXU(L.Di))},Ye.ɵcmp=v.VBU({type:Ye,selectors:[["reset-password-policy-edit"]],features:[v.Vt3],decls:19,vars:18,consts:[["type","info",4,"ngIf"],["type","info",3,"title"],["type","warning"],[1,"!tw-mb-1"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[3,"formGroup"],["type","checkbox","bitCheckbox","","formControlName","autoEnrollEnabled","id","autoEnrollEnabled"],["type","info"]],template:function(e,t){1&e&&(v.DNE(0,Xe,3,3,"bit-callout",0),v.j41(1,"bit-callout",1),v.nI1(2,"i18n"),v.EFF(3),v.nI1(4,"i18n"),v.k0s(),v.j41(5,"bit-callout",2),v.EFF(6),v.nI1(7,"i18n"),v.k0s(),v.j41(8,"bit-form-control",3),v.nrm(9,"input",4),v.j41(10,"bit-label"),v.EFF(11),v.nI1(12,"i18n"),v.k0s()(),v.qex(13,5),v.j41(14,"bit-form-control",3),v.nrm(15,"input",6),v.j41(16,"bit-label"),v.EFF(17),v.nI1(18,"i18n"),v.k0s()(),v.bVm()),2&e&&(v.Y8G("ngIf",t.showKeyConnectorInfo),v.R7$(),v.Y8G("title",v.bMT(2,8,"prerequisite")),v.R7$(2),v.SpI(" ",v.bMT(4,10,"accountRecoverySingleOrgRequirementDesc"),"\n"),v.R7$(3),v.SpI(" ",v.bMT(7,12,"accountRecoveryPolicyWarning"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(12,14,"turnOn")),v.R7$(2),v.Y8G("formGroup",t.data),v.R7$(4),v.JRh(v.bMT(18,16,"resetPasswordPolicyAutoEnrollCheckbox")))},dependencies:[m.G,X.bT,T.Zm,T.BC,T.cb,T.l_,T.j4,T.JD,Ie.G,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});class He extends R{constructor(){super()}}He.ɵfac=function(e){return new(e||He)},He.ɵcmp=v.VBU({type:He,selectors:[["restricted-item-types-policy-edit"]],features:[v.Vt3],decls:5,vars:4,consts:[["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-form-control"),v.nrm(1,"input",0),v.j41(2,"bit-label"),v.EFF(3),v.nI1(4,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(4,2,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});class We extends R{constructor(e){super(),this.formBuilder=e,this.data=this.formBuilder.group({disableHideEmail:!1})}}We.ɵfac=function(e){return new(e||We)(v.rXU(T.ze))},We.ɵcmp=v.VBU({type:We,selectors:[["send-options-policy-edit"]],features:[v.Vt3],decls:17,vars:14,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[3,"formGroup"],["bitTypography","h3",1,"tw-mt-4"],["type","checkbox","bitCheckbox","","formControlName","disableHideEmail","id","disableHideEmail"]],template:function(e,t){1&e&&(v.j41(0,"bit-callout",0),v.EFF(1),v.nI1(2,"i18n"),v.k0s(),v.j41(3,"bit-form-control"),v.nrm(4,"input",1),v.j41(5,"bit-label"),v.EFF(6),v.nI1(7,"i18n"),v.k0s()(),v.j41(8,"div",2)(9,"h3",3),v.EFF(10),v.nI1(11,"i18n"),v.k0s(),v.j41(12,"bit-form-control"),v.nrm(13,"input",4),v.j41(14,"bit-label"),v.EFF(15),v.nI1(16,"i18n"),v.k0s()()()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,6,"sendOptionsExemption"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(7,8,"turnOn")),v.R7$(2),v.Y8G("formGroup",t.data),v.R7$(2),v.JRh(v.bMT(11,10,"options")),v.R7$(5),v.JRh(v.bMT(16,12,"disableHideEmail")))},dependencies:[m.G,T.Zm,T.BC,T.cb,T.l_,T.j4,T.JD,Ie.G,E.P,O.f,M.j,J.r,G.$],encapsulation:2,changeDetection:0});var Je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ze extends R{ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Je(this,void 0,void 0,function*(){if(e.ngOnInit.call(this),!this.policyResponse)throw new Error("Policies not found");this.policyResponse.canToggleState||this.enabled.disable()})}}Ze.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(Ze)))(t||Ze)}})(),Ze.ɵcmp=v.VBU({type:Ze,selectors:[["single-org-policy-edit"]],features:[v.Vt3],decls:8,vars:7,consts:[["type","warning"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-callout",0),v.EFF(1),v.nI1(2,"i18n"),v.k0s(),v.j41(3,"bit-form-control"),v.nrm(4,"input",1),v.j41(5,"bit-label"),v.EFF(6),v.nI1(7,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,3,"singleOrgPolicyMemberWarning"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(7,5,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,Ie.G,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});class Qe extends R{}Qe.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(Qe)))(t||Qe)}})(),Qe.ɵcmp=v.VBU({type:Qe,selectors:[["two-factor-authentication-policy-edit"]],features:[v.Vt3],decls:8,vars:7,consts:[["type","warning"],["type","checkbox","id","enabled","bitCheckbox","",3,"formControl"]],template:function(e,t){1&e&&(v.j41(0,"bit-callout",0),v.EFF(1),v.nI1(2,"i18n"),v.k0s(),v.j41(3,"bit-form-control"),v.nrm(4,"input",1),v.j41(5,"bit-label"),v.EFF(6),v.nI1(7,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,3,"twoStepLoginPolicyWarning"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(7,5,"turnOn")))},dependencies:[m.G,T.Zm,T.BC,T.l_,Ie.G,E.P,O.f,M.j,G.$],encapsulation:2,changeDetection:0});var et=i(59777),tt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function it(e,t){if(1&e&&v.nrm(0,"bit-option",6),2&e){const e=t.$implicit;v.Y8G("label",e.label)("value",e.value)("disabled",e.disabled)}}class nt extends R{constructor(e,t){super(),this.formBuilder=e,this.i18nService=t,this.data=this.formBuilder.group({uriMatchDetection:new T.MJ(et.L.Domain,{validators:[T.k0.required],nonNullable:!0})}),this.uriMatchOptions=[{label:t.t("baseDomain"),value:et.L.Domain},{label:t.t("host"),value:et.L.Host},{label:t.t("exact"),value:et.L.Exact},{label:t.t("never"),value:et.L.Never}]}loadData(){var e,t,i;const n=null===(t=null===(e=this.policyResponse)||void 0===e?void 0:e.data)||void 0===t?void 0:t.uriMatchDetection;null===(i=this.data)||void 0===i||i.patchValue({uriMatchDetection:n})}buildRequestData(){var e,t;return{uriMatchDetection:null===(t=null===(e=this.data)||void 0===e?void 0:e.value)||void 0===t?void 0:t.uriMatchDetection}}buildRequest(){const e=Object.create(null,{buildRequest:{get:()=>super.buildRequest}});return tt(this,void 0,void 0,function*(){var t;const i=yield e.buildRequest.call(this);if(null==(null===(t=i.data)||void 0===t?void 0:t.uriMatchDetection))throw new Error(this.i18nService.t("invalidUriMatchDefaultPolicySetting"));return i})}}nt.ɵfac=function(e){return new(e||nt)(v.rXU(T.ok),v.rXU(P.W))},nt.ɵcmp=v.VBU({type:nt,selectors:[["uri-match-default-policy-edit"]],features:[v.Vt3],decls:16,vars:16,consts:[[3,"title"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[3,"formGroup"],[1,"tw-flex-auto"],["formControlName","uriMatchDetection","id","uriMatchDetection"],[3,"label","value","disabled",4,"ngFor","ngForOf"],[3,"label","value","disabled"]],template:function(e,t){1&e&&(v.j41(0,"bit-callout",0),v.nI1(1,"i18n"),v.EFF(2),v.nI1(3,"i18n"),v.k0s(),v.j41(4,"bit-form-control"),v.nrm(5,"input",1),v.j41(6,"bit-label"),v.EFF(7),v.nI1(8,"i18n"),v.k0s()(),v.j41(9,"div",2)(10,"bit-form-field",3)(11,"bit-label"),v.EFF(12),v.nI1(13,"i18n"),v.k0s(),v.j41(14,"bit-select",4),v.DNE(15,it,1,3,"bit-option",5),v.k0s()()()),2&e&&(v.Y8G("title",v.mNQ(v.bMT(1,8,"prerequisite"))),v.R7$(2),v.SpI(" ",v.bMT(3,10,"requireSsoPolicyReq"),"\n"),v.R7$(3),v.Y8G("formControl",t.enabled),v.R7$(2),v.JRh(v.bMT(8,12,"turnOn")),v.R7$(2),v.Y8G("formGroup",t.data),v.R7$(3),v.JRh(v.bMT(13,14,"uriMatchDetectionOptionsLabel")),v.R7$(3),v.Y8G("ngForOf",t.uriMatchOptions))},dependencies:[m.G,X.Sq,T.Zm,T.BC,T.cb,T.l_,T.j4,T.JD,Ie.G,E.P,O.f,M.j,Re.h,Pe.w,xe.P,G.$],encapsulation:2,changeDetection:0});const rt=i(13299).Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 197 232"><g filter="url(#a)"><path class="tw-fill-background-alt" d="M8 11a8 8 0 0 1 8-8h166a8 8 0 0 1 8 8v16.673H8z"/><path class="tw-fill-background" d="M8 26.686h182V229H8z"/><path class="tw-fill-illustration-logo" d="M153.366 8.3a2.31 2.31 0 0 1 2.31-2.31h11.687a2.31 2.31 0 0 1 2.309 2.31v11.472a2.31 2.31 0 0 1-2.31 2.31h-11.686a2.31 2.31 0 0 1-2.31-2.31z"/><g clip-path="url(#b)"><path class="tw-fill-background" d="M166.143 8.46a.46.46 0 0 0-.334-.143h-8.579a.46.46 0 0 0-.334.143.45.45 0 0 0-.143.335v5.718c.002.436.086.867.249 1.27q.232.602.618 1.118.395.516.879.95.448.411.941.767.429.304.901.577.471.272.666.368.197.097.315.149.094.045.198.043a.4.4 0 0 0 .193-.045q.12-.053.317-.149c.132-.064.357-.187.666-.368s.613-.374.901-.577q.494-.356.943-.767.484-.434.878-.95c.256-.343.464-.719.619-1.117.163-.404.247-.835.248-1.27v-5.72a.45.45 0 0 0-.142-.332m-1.106 6.106c0 2.073-3.517 3.853-3.517 3.853V9.542h3.517z"/></g><path class="tw-fill-secondary-500" d="M178.484 10.454c0 .577.474 1.044 1.059 1.044s1.059-.467 1.059-1.044-.474-1.045-1.059-1.045-1.059.468-1.059 1.045M179.543 14.633a1.05 1.05 0 0 1-1.059-1.045c0-.577.474-1.045 1.059-1.045s1.059.468 1.059 1.045-.474 1.045-1.059 1.045M179.543 17.767a1.05 1.05 0 0 1-1.059-1.045c0-.577.474-1.045 1.059-1.045s1.059.468 1.059 1.045-.474 1.045-1.059 1.045"/></g><g clip-path="url(#c)"><rect width="154" height="205" x="16" y="24" class="tw-fill-background-alt" rx="4.918"/><path class="tw-fill-background" d="M16 24h155v27.419H16z"/><path class="tw-fill-text-main" d="m24.595 40.71-2.107-5.739h1.057l1.648 4.73 1.664-4.73h1.041l-2.107 5.738zm4.891.098q-.492 0-.828-.18a1.2 1.2 0 0 1-.492-.484 1.4 1.4 0 0 1-.155-.656q0-.394.196-.689a1.33 1.33 0 0 1 .59-.459q.395-.164.951-.164h1.025q0-.36-.074-.598a.62.62 0 0 0-.254-.353q-.18-.123-.516-.123-.32 0-.533.148a.64.64 0 0 0-.262.418h-.968q.05-.426.279-.73a1.5 1.5 0 0 1 .623-.475q.386-.165.86-.164.6 0 1 .205.41.197.616.566.213.368.213.901v2.738h-.845l-.098-.664a1.3 1.3 0 0 1-.213.303 1.4 1.4 0 0 1-.287.246q-.165.099-.377.156a1.7 1.7 0 0 1-.45.058m.213-.78q.222 0 .402-.09a.9.9 0 0 0 .32-.253q.14-.164.22-.378.083-.213.1-.45v-.05h-.886q-.279 0-.46.082-.18.074-.27.213a.6.6 0 0 0-.082.312q0 .197.082.336a.56.56 0 0 0 .23.205.76.76 0 0 0 .344.074m4.787.78q-.491 0-.844-.18a1.3 1.3 0 0 1-.549-.558q-.189-.378-.189-.926v-2.747h.984v2.615q0 .493.238.73.246.237.672.238.27 0 .492-.115a.9.9 0 0 0 .352-.36 1.15 1.15 0 0 0 .14-.591v-2.517h.983v4.312h-.868l-.074-.656q-.165.352-.508.558-.345.197-.828.197m3.43-.099v-5.902h.983v5.902zm3.966 0a1.9 1.9 0 0 1-.73-.13 1 1 0 0 1-.476-.435q-.163-.304-.163-.82v-2.107h-.746v-.82h.746l.114-1.164h.87v1.164h1.139v.82h-1.14v2.107q0 .311.131.434.131.115.46.115h.565v.836z"/><path class="tw-fill-secondary-300" d="M102.538 37.71a7.38 7.38 0 0 1 7.378-7.378h27.871a7.378 7.378 0 0 1 0 14.755h-27.871a7.38 7.38 0 0 1-7.378-7.378"/><path class="tw-fill-secondary-100" d="M149.913 37.71a7.378 7.378 0 1 1 14.755 0 7.378 7.378 0 0 1-14.755 0"/><g clip-path="url(#d)"><path class="tw-fill-background" d="M21.874 64.308a6.56 6.56 0 0 1 6.558-6.558h130.137a6.56 6.56 0 0 1 6.558 6.558v1.23a6.56 6.56 0 0 1-6.558 6.558H28.432a6.56 6.56 0 0 1-6.558-6.558z"/></g><path class="tw-fill-secondary-100" d="M22.332 84.759a3.166 3.166 0 0 1 3.166-3.166H68.78a3.166 3.166 0 0 1 0 6.332H25.498a3.166 3.166 0 0 1-3.166-3.166M22.332 97.422a6.33 6.33 0 0 1 6.332-6.331h129.673a6.33 6.33 0 0 1 6.332 6.331v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332zM22.332 122.749a6.33 6.33 0 0 1 6.332-6.332h129.673a6.33 6.33 0 0 1 6.332 6.332v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332zM22.332 148.075a6.33 6.33 0 0 1 6.332-6.332h129.673a6.33 6.33 0 0 1 6.332 6.332v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332z"/><path class="tw-fill-secondary-100" d="M41.477 101.706a7.727 7.727 0 0 0-7.727-7.727h-.337a7.727 7.727 0 0 0 0 15.454h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 106.13a1.994 1.994 0 0 0-1.994-1.994H46.637a1.994 1.994 0 0 0 0 3.988H93.98a1.993 1.993 0 0 0 1.994-1.994M86.31 98.591a3.303 3.303 0 0 0-3.303-3.303h-35.06a3.303 3.303 0 1 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.304M161.816 101.706a5.84 5.84 0 0 0-5.84-5.84h-29.987a5.84 5.84 0 0 0 0 11.681h29.987a5.84 5.84 0 0 0 5.84-5.841M41.477 127.032a7.726 7.726 0 0 0-7.727-7.726h-.337a7.726 7.726 0 1 0 0 15.453h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 131.457a1.993 1.993 0 0 0-1.994-1.994H46.637a1.993 1.993 0 1 0 0 3.987H93.98a1.993 1.993 0 0 0 1.994-1.993M86.31 123.918a3.303 3.303 0 0 0-3.303-3.304h-35.06a3.303 3.303 0 0 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 127.032a5.84 5.84 0 0 0-5.84-5.84h-29.987a5.84 5.84 0 0 0 0 11.681h29.987a5.84 5.84 0 0 0 5.84-5.841M41.477 152.359a7.727 7.727 0 0 0-7.727-7.727h-.337a7.727 7.727 0 0 0 0 15.454h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 156.783a1.994 1.994 0 0 0-1.994-1.994H46.637a1.994 1.994 0 0 0 0 3.988H93.98a1.994 1.994 0 0 0 1.994-1.994M86.31 149.244a3.303 3.303 0 0 0-3.303-3.303h-35.06a3.303 3.303 0 1 0 0 6.606h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 152.359a5.84 5.84 0 0 0-5.84-5.841h-29.987a5.84 5.84 0 0 0 0 11.682h29.987a5.84 5.84 0 0 0 5.84-5.841M22.332 176.567a3.166 3.166 0 0 1 3.166-3.166H68.78a3.166 3.166 0 0 1 0 6.332H25.498a3.166 3.166 0 0 1-3.166-3.166M22.332 189.23a6.33 6.33 0 0 1 6.332-6.331h129.673a6.33 6.33 0 0 1 6.332 6.331v9.498a6.33 6.33 0 0 1-6.332 6.331H28.664a6.33 6.33 0 0 1-6.332-6.331z"/><path class="tw-fill-secondary-100" d="M41.477 193.514a7.726 7.726 0 0 0-7.727-7.726h-.337a7.726 7.726 0 1 0 0 15.453h.337a7.727 7.727 0 0 0 7.727-7.727M95.974 197.938a1.993 1.993 0 0 0-1.994-1.993H46.637a1.993 1.993 0 1 0 0 3.987H93.98a1.993 1.993 0 0 0 1.994-1.994M86.31 190.4a3.303 3.303 0 0 0-3.303-3.304h-35.06a3.303 3.303 0 0 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 193.514a5.84 5.84 0 0 0-5.84-5.841h-9.038a5.842 5.842 0 0 0 0 11.682h9.038a5.84 5.84 0 0 0 5.84-5.841M22.332 214.557a6.33 6.33 0 0 1 6.332-6.332h129.673a6.33 6.33 0 0 1 6.332 6.332v9.497a6.33 6.33 0 0 1-6.332 6.332H28.664a6.33 6.33 0 0 1-6.332-6.332z"/><path class="tw-fill-secondary-100" d="M41.477 220.424a7.727 7.727 0 0 0-7.727-7.727h-.337a7.727 7.727 0 1 0 0 15.453h.337a7.726 7.726 0 0 0 7.727-7.726M95.974 224.848a1.994 1.994 0 0 0-1.994-1.994H46.637a1.994 1.994 0 0 0 0 3.988H93.98a1.994 1.994 0 0 0 1.994-1.994M86.31 217.309a3.303 3.303 0 0 0-3.303-3.304h-35.06a3.303 3.303 0 0 0 0 6.607h35.06a3.303 3.303 0 0 0 3.303-3.303M161.816 220.423a5.84 5.84 0 0 0-5.84-5.84h-9.038a5.84 5.84 0 1 0 0 11.681h9.038a5.84 5.84 0 0 0 5.84-5.841"/></g><g clip-path="url(#e)"><rect width="154" height="205" x="16" y="24" class="tw-fill-primary-700" fill-opacity=".1" rx="4.918"/><g filter="url(#f)"><g clip-path="url(#g)"><path class="tw-fill-background" d="M20.84 73.484c0-5.577 4.521-10.098 10.098-10.098h124.125c5.577 0 10.098 4.521 10.098 10.098v106.032c0 5.577-4.521 10.098-10.098 10.098H30.938c-5.577 0-10.098-4.521-10.098-10.098z"/><path class="tw-fill-primary-100" d="M36.121 75.434h30.366a5.078 5.078 0 1 1 0 10.155H36.121a5.078 5.078 0 0 1 0-10.156"/><path class="tw-stroke-primary-700" stroke-width=".21" d="M36.121 75.434h30.366a5.078 5.078 0 1 1 0 10.155H36.121a5.078 5.078 0 0 1 0-10.156Z"/><path class="tw-fill-primary-700" d="m36.214 78.64-1.161 3.371h-.703l1.464-3.889h.448zm.973 3.371-1.165-3.37-.05-.519h.45l1.47 3.889zm-.057-1.442v.531h-2.115v-.531zm1.94.932.707-2.38h.668l-1.004 2.89h-.417zm-.543-2.38.721 2.39.035.5h-.416l-1.01-2.89zm3.902 2.31v-1.378a.6.6 0 0 0-.056-.267.4.4 0 0 0-.17-.173.6.6 0 0 0-.284-.062.64.64 0 0 0-.272.054.44.44 0 0 0-.18.144.35.35 0 0 0-.063.205h-.641q0-.17.083-.33a.9.9 0 0 1 .24-.286 1.2 1.2 0 0 1 .377-.198q.22-.072.491-.072.326 0 .577.11.254.109.398.33.147.22.147.55v1.285q0 .198.026.355.03.156.083.27v.043h-.66a1.2 1.2 0 0 1-.072-.264 2 2 0 0 1-.024-.316m.094-1.177.005.397h-.462q-.18 0-.315.035a.7.7 0 0 0-.227.096.42.42 0 0 0-.182.361q0 .114.054.211a.38.38 0 0 0 .155.147q.105.053.25.053a.7.7 0 0 0 .58-.28.44.44 0 0 0 .091-.227l.209.286a1 1 0 0 1-.11.235 1.1 1.1 0 0 1-.203.24 1 1 0 0 1-.692.256q-.283 0-.505-.112a.9.9 0 0 1-.347-.307.8.8 0 0 1-.125-.44.9.9 0 0 1 .085-.407.8.8 0 0 1 .257-.299q.17-.12.416-.181.246-.064.561-.064zm1.915-1.133v2.89h-.647v-2.89zm-.69-.758a.33.33 0 0 1 .097-.243.37.37 0 0 1 .272-.1q.171 0 .27.1a.33.33 0 0 1 .099.243.32.32 0 0 1-.099.24.37.37 0 0 1-.27.096.37.37 0 0 1-.272-.096.33.33 0 0 1-.096-.24m2.084-.454v4.102h-.646v-4.102zm2.334 3.522v-1.378a.6.6 0 0 0-.056-.267.4.4 0 0 0-.17-.173.6.6 0 0 0-.284-.062.64.64 0 0 0-.272.054.44.44 0 0 0-.18.144.35.35 0 0 0-.063.205H46.5q0-.17.083-.33a.9.9 0 0 1 .24-.286q.157-.126.377-.198.219-.072.491-.072.326 0 .577.11.254.109.398.33.147.22.147.55v1.285q0 .198.026.355.03.156.083.27v.043h-.66a1.2 1.2 0 0 1-.072-.264 2 2 0 0 1-.024-.316m.094-1.177.005.397h-.462q-.18 0-.315.035a.7.7 0 0 0-.227.096.42.42 0 0 0-.182.361q0 .114.054.211a.38.38 0 0 0 .155.147q.105.053.25.053a.7.7 0 0 0 .58-.28.44.44 0 0 0 .091-.227l.208.286a1 1 0 0 1-.11.235q-.075.125-.202.24a1 1 0 0 1-.692.256q-.282 0-.505-.112a.9.9 0 0 1-.347-.307.8.8 0 0 1-.125-.44.9.9 0 0 1 .085-.407.8.8 0 0 1 .257-.299q.17-.12.416-.181.246-.064.561-.064zm1.228-2.345h.644v3.485l-.061.617h-.583zm2.53 2.63v.056q0 .32-.072.59a1.4 1.4 0 0 1-.214.465 1 1 0 0 1-.353.308q-.209.105-.483.106-.27 0-.47-.101a.94.94 0 0 1-.337-.288 1.6 1.6 0 0 1-.216-.447 3 3 0 0 1-.117-.571v-.18q.034-.315.117-.57a1.6 1.6 0 0 1 .216-.447.93.93 0 0 1 .334-.29q.201-.103.468-.102.278 0 .488.106a.96.96 0 0 1 .356.305q.141.195.21.465.073.27.073.595m-.644.056v-.056q0-.195-.032-.366a1 1 0 0 0-.107-.304.54.54 0 0 0-.197-.206.57.57 0 0 0-.308-.077.7.7 0 0 0-.293.059.6.6 0 0 0-.206.16.8.8 0 0 0-.13.235q-.047.134-.062.288v.484q.024.2.101.368.08.166.224.267.145.1.372.1.179 0 .302-.073a.53.53 0 0 0 .195-.2 1 1 0 0 0 .106-.305q.035-.173.035-.374m1.878-2.686v4.102h-.647v-4.102zm1.979 4.155a1.5 1.5 0 0 1-.58-.104 1.3 1.3 0 0 1-.438-.296 1.3 1.3 0 0 1-.275-.446 1.6 1.6 0 0 1-.096-.553v-.107q0-.338.099-.614t.275-.47q.176-.198.416-.302.24-.105.521-.104.31 0 .543.104.232.104.384.294.155.186.23.446.077.258.077.571v.275h-2.233v-.462h1.598v-.05a.9.9 0 0 0-.07-.326.55.55 0 0 0-.19-.246.57.57 0 0 0-.341-.094.566.566 0 0 0-.491.264 1 1 0 0 0-.129.31 1.7 1.7 0 0 0-.043.404v.107q0 .19.051.352.054.16.155.28t.246.19a.8.8 0 0 0 .328.067.89.89 0 0 0 .73-.358l.339.329a1.215 1.215 0 0 1-.609.462 1.5 1.5 0 0 1-.497.077m3.659-2.326v2.273h-.644v-2.89h.606zm-.115.721-.208-.002a1.9 1.9 0 0 1 .085-.564 1.4 1.4 0 0 1 .235-.44q.153-.186.363-.284a1.1 1.1 0 0 1 .47-.101q.21 0 .377.058a.7.7 0 0 1 .291.185.8.8 0 0 1 .187.334q.064.202.064.5v1.866h-.646v-1.87a.7.7 0 0 0-.062-.328.34.34 0 0 0-.173-.174.65.65 0 0 0-.28-.053.62.62 0 0 0-.519.259.9.9 0 0 0-.136.278 1.2 1.2 0 0 0-.048.336m2.398.14v-.062q0-.313.091-.58.09-.27.262-.467.173-.2.422-.31.25-.112.566-.112.318 0 .566.112.252.11.425.31.174.198.264.467.091.267.091.58v.061q0 .313-.09.58-.092.267-.265.467a1.2 1.2 0 0 1-.422.31q-.248.11-.563.11a1.4 1.4 0 0 1-.57-.11 1.2 1.2 0 0 1-.421-.31 1.4 1.4 0 0 1-.265-.467 1.8 1.8 0 0 1-.09-.58m.644-.062v.061q0 .195.04.369a1 1 0 0 0 .126.304.6.6 0 0 0 .219.206.64.64 0 0 0 .318.075.61.61 0 0 0 .528-.28 1 1 0 0 0 .126-.305q.042-.174.043-.369v-.061q0-.193-.043-.364a1 1 0 0 0-.128-.307.61.61 0 0 0-.532-.285.6.6 0 0 0-.315.077.6.6 0 0 0-.216.208 1 1 0 0 0-.126.307 1.6 1.6 0 0 0-.04.364m3.368.833.668-2.249h.411l-.112.673-.673 2.217h-.369zm-.393-2.249.521 2.26.043.63h-.411l-.783-2.89zm2.097 2.233.505-2.233h.627l-.78 2.89h-.41zm-.555-2.233.66 2.222.082.668h-.369l-.68-2.22-.113-.67z"/><path class="tw-fill-text-main" d="m33.889 92.986-1.706 5.074h-1.195l2.235-5.983h.764zm1.426 5.074L33.6 92.986l-.103-.909h.769l2.247 5.983zm-.078-2.223v.892h-3.21v-.892zm4.408 1.167v-3.39h1.093v4.446h-1.027zm.14-.92.337-.008q0 .447-.099.825a1.9 1.9 0 0 1-.308.658 1.4 1.4 0 0 1-.522.431 1.7 1.7 0 0 1-.747.152q-.33 0-.6-.09a1.2 1.2 0 0 1-.469-.292 1.4 1.4 0 0 1-.3-.513 2.4 2.4 0 0 1-.106-.76v-2.873h1.084v2.88q0 .223.05.37.053.15.143.243.095.09.218.131a1 1 0 0 0 .271.037q.395 0 .62-.156a.88.88 0 0 0 .33-.427q.098-.271.098-.608m4.019-2.47v.781h-2.548v-.78zm-1.866-1.093h1.09v4.257q0 .198.053.304.053.108.16.144a.8.8 0 0 0 .255.037q.105 0 .197-.012.09-.012.152-.025l.004.814q-.135.045-.308.074-.17.028-.382.028-.366 0-.641-.123a.9.9 0 0 1-.428-.407q-.152-.284-.152-.747zm2.289 3.361v-.086q0-.489.14-.9a2.1 2.1 0 0 1 .407-.719q.266-.304.653-.472.385-.173.88-.173.5 0 .887.173.39.168.657.472t.407.72q.14.41.14.9v.085q0 .486-.14.9a2.1 2.1 0 0 1-.407.72q-.267.303-.653.472a2.2 2.2 0 0 1-.884.168 2.2 2.2 0 0 1-.883-.168q-.39-.168-.657-.473a2.1 2.1 0 0 1-.407-.719 2.8 2.8 0 0 1-.14-.9m1.085-.086v.086q0 .292.057.547.059.255.177.448.12.193.308.304a.94.94 0 0 0 .46.107.9.9 0 0 0 .452-.107.9.9 0 0 0 .309-.304q.123-.193.18-.448a2.5 2.5 0 0 0 .058-.547v-.086q0-.288-.058-.538a1.4 1.4 0 0 0-.18-.448.86.86 0 0 0-.769-.423.85.85 0 0 0-.76.423q-.12.193-.177.448a2.4 2.4 0 0 0-.057.538m4.955-1.27v3.534h-1.085v-4.446h1.023zm-.16 1.151h-.333q0-.465.111-.855.116-.39.337-.678a1.5 1.5 0 0 1 .547-.452q.328-.16.76-.16.3 0 .55.09.25.087.432.276.184.185.283.485.099.296.099.71v2.967h-1.085v-2.856q0-.312-.09-.488a.5.5 0 0 0-.251-.247 1 1 0 0 0-.395-.074.9.9 0 0 0-.44.103.85.85 0 0 0-.3.275 1.3 1.3 0 0 0-.172.407q-.053.23-.053.497m2.704-.201-.448.082q.003-.42.115-.785.111-.37.324-.645.219-.28.539-.436.324-.16.748-.16.328 0 .591.095.267.09.456.291.189.198.288.514.102.316.103.772v2.856h-1.093V95.2q0-.324-.09-.497a.47.47 0 0 0-.251-.238 1 1 0 0 0-.387-.07.808.808 0 0 0-.674.316q-.11.148-.168.346a1.6 1.6 0 0 0-.053.419m6.139 1.64v-2.051q0-.226-.079-.39a.56.56 0 0 0-.238-.255.8.8 0 0 0-.407-.09.9.9 0 0 0-.382.073.56.56 0 0 0-.246.21.54.54 0 0 0-.087.304h-1.089q0-.276.132-.522.132-.25.374-.444.246-.197.587-.308.345-.11.773-.11.506 0 .9.172.398.168.624.51.23.34.23.858v1.94q0 .332.042.57.045.235.131.407v.07H59.11a1.6 1.6 0 0 1-.12-.427 3.4 3.4 0 0 1-.04-.518m.151-1.764.009.645h-.687q-.255 0-.447.054a.8.8 0 0 0-.317.148.6.6 0 0 0-.185.23.7.7 0 0 0 .013.596.56.56 0 0 0 .222.21q.147.073.345.073.287 0 .501-.115a1 1 0 0 0 .333-.287.6.6 0 0 0 .127-.32l.313.468a2 2 0 0 1-.173.357 1.6 1.6 0 0 1-.296.353q-.18.165-.436.272a1.5 1.5 0 0 1-.591.106q-.431 0-.773-.172a1.37 1.37 0 0 1-.538-.473 1.2 1.2 0 0 1-.197-.682q0-.353.131-.624.132-.271.39-.457.26-.188.642-.283.386-.099.883-.099zm4.023-1.738v.781h-2.547v-.78zm-1.865-1.093h1.089v4.257q0 .198.053.304.054.108.16.144a.8.8 0 0 0 .255.037q.107 0 .197-.012t.152-.025l.004.814q-.135.045-.308.074-.169.028-.382.028-.366 0-.64-.123a.9.9 0 0 1-.428-.407q-.153-.284-.152-.747zm3.739 1.093v4.446h-1.089v-4.446zm-1.163-1.163A.54.54 0 0 1 64 92.05a.63.63 0 0 1 .452-.16q.285 0 .448.16a.53.53 0 0 1 .169.402.53.53 0 0 1-.169.399.61.61 0 0 1-.448.16.63.63 0 0 1-.452-.16.53.53 0 0 1-.164-.399m4.023 4.837q.23 0 .41-.09a.7.7 0 0 0 .288-.255.7.7 0 0 0 .12-.383h1.023a1.44 1.44 0 0 1-.255.81 1.75 1.75 0 0 1-.658.567 2 2 0 0 1-.912.205 2.2 2.2 0 0 1-.895-.172 1.74 1.74 0 0 1-.637-.481 2.1 2.1 0 0 1-.379-.715 3 3 0 0 1-.123-.871v-.132q0-.465.123-.87a2.1 2.1 0 0 1 .379-.716q.255-.308.636-.48.382-.173.892-.173.538 0 .945.21.411.21.641.591.234.382.243.9h-1.023a1 1 0 0 0-.107-.427.8.8 0 0 0-.28-.304.8.8 0 0 0-.44-.115.86.86 0 0 0-.46.115.8.8 0 0 0-.283.316q-.099.198-.14.444a3.4 3.4 0 0 0-.037.51v.131q0 .27.037.518.041.246.14.444a.8.8 0 0 0 .283.308q.186.114.469.115m5.013-.173v-2.05q0-.226-.078-.39a.56.56 0 0 0-.239-.255.8.8 0 0 0-.406-.09.9.9 0 0 0-.383.073.56.56 0 0 0-.246.21.54.54 0 0 0-.086.304h-1.09q0-.276.132-.522.132-.25.374-.444.246-.197.588-.308.345-.11.772-.11.505 0 .9.172.399.168.625.51.23.34.23.858v1.94q0 .332.04.57.047.235.132.407v.07h-1.105a1.6 1.6 0 0 1-.12-.427 3.4 3.4 0 0 1-.04-.518m.152-1.763.008.645h-.686q-.255 0-.448.054a.8.8 0 0 0-.317.148.6.6 0 0 0-.184.23.7.7 0 0 0 .012.596.57.57 0 0 0 .222.21q.148.073.345.073.288 0 .501-.115a1 1 0 0 0 .333-.287.6.6 0 0 0 .127-.32l.313.468a2 2 0 0 1-.173.357 1.6 1.6 0 0 1-.296.353q-.18.165-.435.272-.255.105-.592.106-.431 0-.772-.172a1.37 1.37 0 0 1-.539-.473 1.2 1.2 0 0 1-.197-.682q0-.353.132-.624.13-.271.39-.457.258-.188.64-.283.387-.099.884-.099zm3.07-3.603v6.311h-1.09V91.75zm2.185 0v6.311H77.19V91.75zm2.338 5.818 1.192-3.953h1.163l-1.784 5.12q-.06.165-.16.358-.094.192-.255.365a1.2 1.2 0 0 1-.402.288q-.239.11-.58.11-.147 0-.263-.02a3 3 0 0 1-.242-.053v-.814a1 1 0 0 0 .094.004q.059.005.099.005.238 0 .395-.058a.5.5 0 0 0 .25-.177 1 1 0 0 0 .164-.312zm-.587-3.953 1.006 3.275.177 1.147-.748.135-1.606-4.557zm7.388 3.674q.23 0 .41-.09a.7.7 0 0 0 .288-.255.7.7 0 0 0 .12-.383h1.022a1.44 1.44 0 0 1-.254.81 1.75 1.75 0 0 1-.658.567 2 2 0 0 1-.912.205 2.2 2.2 0 0 1-.896-.172 1.74 1.74 0 0 1-.637-.481 2.1 2.1 0 0 1-.378-.715 3 3 0 0 1-.123-.871v-.132q0-.465.123-.87a2.1 2.1 0 0 1 .378-.716q.255-.308.637-.48.382-.173.892-.173.539 0 .945.21.411.21.641.591.234.382.242.9h-1.023a1 1 0 0 0-.107-.427.8.8 0 0 0-.279-.304.8.8 0 0 0-.44-.115.86.86 0 0 0-.46.115.8.8 0 0 0-.283.316q-.1.198-.14.444a3.4 3.4 0 0 0-.037.51v.131q0 .27.037.518.04.246.14.444a.8.8 0 0 0 .283.308q.185.114.469.115m2.37-1.406v-.086q0-.489.14-.9a2.1 2.1 0 0 1 .407-.719q.267-.304.653-.472.386-.173.88-.173.501 0 .887.173.39.168.658.472.267.304.406.72.14.41.14.9v.085q0 .486-.14.9a2.1 2.1 0 0 1-.406.72q-.267.303-.654.472a2.2 2.2 0 0 1-.883.168 2.2 2.2 0 0 1-.884-.168q-.39-.168-.657-.473a2.1 2.1 0 0 1-.407-.719 2.8 2.8 0 0 1-.14-.9m1.085-.086v.086q0 .292.058.547.057.255.176.448.12.193.309.304a.94.94 0 0 0 .46.107.9.9 0 0 0 .452-.107.9.9 0 0 0 .308-.304q.123-.193.18-.448.059-.255.058-.547v-.086a2.4 2.4 0 0 0-.057-.538 1.4 1.4 0 0 0-.181-.448.86.86 0 0 0-.768-.423.85.85 0 0 0-.76.423q-.12.193-.177.448a2.4 2.4 0 0 0-.058.538m4.94-1.233v3.497h-1.085v-4.446h1.019zm-.173 1.114h-.32a3 3 0 0 1 .13-.88q.129-.393.358-.677.234-.285.555-.436.32-.152.715-.152.32 0 .58.09.258.09.443.288.189.197.288.518.102.316.102.78v2.852h-1.093V95.2q0-.304-.09-.48a.5.5 0 0 0-.255-.251 1 1 0 0 0-.407-.074.9.9 0 0 0-.44.103.9.9 0 0 0-.312.275 1.4 1.4 0 0 0-.189.407q-.065.23-.065.497m5.181 2.383h-1.093v-4.692q0-.55.222-.929.226-.382.645-.58.423-.196 1.007-.197.34 0 .657.07.32.066.658.173l-.161.88a7 7 0 0 0-.476-.132 2.6 2.6 0 0 0-.604-.062q-.432 0-.645.197-.21.198-.21.58zm.888-4.446v.781h-2.65v-.78zm1.717 0v4.446h-1.089v-4.446zm2.137.908v3.538h-1.085v-4.446h1.027zm1.352-.937-.017 1.011a2.894 2.894 0 0 0-.415-.033q-.25 0-.439.07a.8.8 0 0 0-.317.193.9.9 0 0 0-.189.313 1.4 1.4 0 0 0-.074.41l-.234-.028q0-.423.086-.785.087-.361.251-.633.165-.27.411-.419.25-.152.575-.152.09 0 .193.017.108.012.169.036m1.676.941v3.534h-1.085v-4.446h1.024zm-.16 1.151h-.333q0-.465.111-.855.115-.39.337-.678.222-.291.547-.452.328-.16.76-.16.3 0 .55.09.25.087.432.276.185.185.283.485.099.296.099.71v2.967h-1.085v-2.856q0-.312-.09-.488a.5.5 0 0 0-.251-.247 1 1 0 0 0-.394-.074.84.84 0 0 0-.74.378 1.3 1.3 0 0 0-.173.407q-.053.23-.053.497m2.704-.201-.448.082q.004-.42.115-.785.111-.37.324-.645a1.5 1.5 0 0 1 .539-.436q.324-.16.748-.16.329 0 .591.095.267.09.456.291.189.198.288.514.102.316.103.772v2.856h-1.093V95.2q0-.324-.091-.497a.47.47 0 0 0-.25-.238 1 1 0 0 0-.387-.07.85.85 0 0 0-.394.086.8.8 0 0 0-.279.23 1.1 1.1 0 0 0-.169.346 1.6 1.6 0 0 0-.053.419m6.849-.913v3.497h-1.084v-4.446h1.019zm-.172 1.114h-.321a3 3 0 0 1 .132-.88q.127-.393.357-.677.234-.285.555-.436.32-.152.715-.152.321 0 .579.09.26.09.444.288.189.197.288.518.102.316.102.78v2.852h-1.093V95.2q0-.304-.09-.48a.5.5 0 0 0-.255-.251 1 1 0 0 0-.406-.074.9.9 0 0 0-.44.103.9.9 0 0 0-.312.275 1.3 1.3 0 0 0-.189.407q-.066.23-.066.497m5.806 2.465q-.506 0-.908-.164a2 2 0 0 1-.686-.456 2.1 2.1 0 0 1-.432-.686 2.4 2.4 0 0 1-.148-.847v-.164q0-.514.148-.933a2.1 2.1 0 0 1 .419-.727q.271-.304.649-.469t.835-.164q.473 0 .834.16.361.156.604.444.242.288.365.69.124.399.124.884v.456h-3.485v-.748h2.416v-.082a1.3 1.3 0 0 0-.098-.473.76.76 0 0 0-.28-.345.84.84 0 0 0-.489-.131.8.8 0 0 0-.423.107.85.85 0 0 0-.296.295 1.5 1.5 0 0 0-.172.452q-.058.264-.058.584v.164q0 .28.074.518.078.238.226.415.152.172.362.271.213.095.485.095.34 0 .616-.132.28-.135.485-.398l.546.567a1.926 1.926 0 0 1-.945.703 2.4 2.4 0 0 1-.768.114m3.768-1.15.974-3.378h.69l-.206 1.167-.982 3.28h-.595zm-.539-3.378.732 3.386.066 1.06h-.687l-1.167-4.446zm3.107 3.337.715-3.337h1.052l-1.159 4.446h-.686zm-.797-3.337.965 3.345.128 1.101h-.596l-.99-3.279-.202-1.167zm7.947 3.39v-3.39h1.093v4.446h-1.028zm.139-.92.337-.008q0 .447-.098.825a1.9 1.9 0 0 1-.309.658 1.44 1.44 0 0 1-.521.431 1.7 1.7 0 0 1-.748.152q-.328 0-.6-.09a1.2 1.2 0 0 1-.469-.292 1.4 1.4 0 0 1-.3-.513 2.4 2.4 0 0 1-.106-.76v-2.873h1.084v2.88q0 .223.05.37.053.15.143.243.095.09.218.131a1 1 0 0 0 .271.037q.395 0 .621-.156a.9.9 0 0 0 .329-.427q.098-.271.098-.608m4.36.76a.44.44 0 0 0-.074-.25q-.074-.112-.279-.202a3 3 0 0 0-.592-.177q-.346-.074-.637-.185a2 2 0 0 1-.501-.267 1.2 1.2 0 0 1-.329-.374 1.05 1.05 0 0 1-.115-.501q0-.275.119-.518.119-.246.345-.431.226-.19.551-.296.324-.11.731-.11.567-.001.974.184.41.184.629.51.217.32.217.723h-1.084a.63.63 0 0 0-.083-.32.56.56 0 0 0-.242-.23.86.86 0 0 0-.415-.091.9.9 0 0 0-.382.074.56.56 0 0 0-.23.193.47.47 0 0 0-.078.263q0 .106.041.193.045.082.144.152.097.07.267.127.173.058.423.111.497.1.867.263.374.161.583.427.21.268.21.683 0 .296-.127.542a1.3 1.3 0 0 1-.37.423q-.243.18-.58.284a2.7 2.7 0 0 1-.76.098q-.612 0-1.035-.217a1.66 1.66 0 0 1-.641-.56 1.3 1.3 0 0 1-.218-.706h1.04q.012.259.139.415t.321.226q.197.066.415.066.246 0 .415-.066a.6.6 0 0 0 .255-.185.45.45 0 0 0 .086-.271m3.883 1.298q-.506 0-.908-.164a2 2 0 0 1-.686-.456 2.1 2.1 0 0 1-.432-.686 2.4 2.4 0 0 1-.148-.847v-.164q0-.514.148-.933a2.1 2.1 0 0 1 .419-.727q.271-.304.649-.469.379-.165.835-.164.472 0 .834.16.361.156.604.444.242.288.365.69.124.399.124.884v.456h-3.485v-.748h2.416v-.082a1.3 1.3 0 0 0-.098-.473.76.76 0 0 0-.28-.345.84.84 0 0 0-.489-.131.8.8 0 0 0-.423.107.85.85 0 0 0-.296.295 1.5 1.5 0 0 0-.172.452q-.058.264-.058.584v.164q0 .28.074.518.078.238.226.415.152.172.362.271.213.095.485.095.34 0 .616-.132.28-.135.485-.398l.546.567a1.926 1.926 0 0 1-.945.703 2.4 2.4 0 0 1-.768.114m3.616-3.62v3.538h-1.085v-4.446h1.027zm1.352-.937-.017 1.011a2.894 2.894 0 0 0-.415-.033q-.25 0-.439.07a.8.8 0 0 0-.317.193.9.9 0 0 0-.189.313 1.4 1.4 0 0 0-.074.41l-.234-.028q0-.423.086-.785.086-.361.251-.633.164-.27.411-.419.25-.152.575-.152.09 0 .193.017.107.012.169.036m3.04 3.259a.44.44 0 0 0-.074-.25q-.073-.112-.279-.202a3 3 0 0 0-.592-.177q-.345-.074-.637-.185a2 2 0 0 1-.501-.267 1.2 1.2 0 0 1-.329-.374 1.07 1.07 0 0 1-.115-.501q0-.275.119-.518a1.3 1.3 0 0 1 .346-.431q.226-.19.55-.296.325-.11.732-.11.567-.001.973.184.411.184.629.51.218.32.218.723h-1.085a.63.63 0 0 0-.082-.32.56.56 0 0 0-.243-.23.85.85 0 0 0-.415-.091.9.9 0 0 0-.382.074.56.56 0 0 0-.23.193.47.47 0 0 0-.037.456q.045.082.144.152t.267.127q.172.058.423.111.498.1.867.263.375.161.584.427.21.268.209.683 0 .296-.127.542a1.25 1.25 0 0 1-.37.423q-.242.18-.579.284a2.7 2.7 0 0 1-.76.098q-.612 0-1.036-.217a1.66 1.66 0 0 1-.641-.56 1.3 1.3 0 0 1-.218-.706h1.04q.012.259.14.415a.7.7 0 0 0 .32.226q.198.066.415.066.247 0 .415-.066a.6.6 0 0 0 .255-.185.45.45 0 0 0 .086-.271M34.646 104.555v4.188h-.558l-2.108-3.23v3.23h-.555v-4.188h.555l2.117 3.239v-3.239zm2.195 4.246q-.326 0-.59-.11a1.3 1.3 0 0 1-.452-.313 1.4 1.4 0 0 1-.287-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.111-.676.113-.3.305-.507.193-.207.437-.313.245-.107.507-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.325v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.431-.126a.71.71 0 0 0-.595.302 1.1 1.1 0 0 0-.17.365q-.06.216-.06.498v.12q0 .222.06.417.063.193.18.34.121.147.291.23a.9.9 0 0 0 .391.083.9.9 0 0 0 .478-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224 1.5 1.5 0 0 1-.532.087m2.62-.61.8-2.56h.35l-.069.509-.814 2.603h-.342zm-.538-2.56.682 2.589.049.523h-.36l-.903-3.112zm2.454 2.569.65-2.569h.529l-.903 3.112h-.357zm-.688-2.569.782 2.517.09.595h-.34l-.837-2.609-.069-.503zm5.779 2.393v-2.393h.535v3.112h-.51zm.1-.656.222-.005q0 .31-.066.575a1.2 1.2 0 0 1-.207.454 1 1 0 0 1-.377.302 1.4 1.4 0 0 1-.567.107q-.227 0-.417-.066a.85.85 0 0 1-.532-.564 1.7 1.7 0 0 1-.072-.532v-2.008h.532v2.013q0 .21.046.348a.6.6 0 0 0 .13.216.5.5 0 0 0 .184.109q.104.032.212.032.34 0 .538-.129a.74.74 0 0 0 .285-.354q.09-.225.09-.498m3.058.55a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.785.785 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.366-.199t.474-.072q.374 0 .639.133a1 1 0 0 1 .405.354q.141.218.141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.031.374.34.34 0 0 0 .109.124 1 1 0 0 0 .218.104q.141.049.36.097.382.087.63.207.248.121.368.297t.12.425a.837.837 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.491.066q-.412 0-.697-.147a1.1 1.1 0 0 1-.43-.38.9.9 0 0 1-.148-.492h.535q.012.219.127.349.115.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m2.522.883q-.324 0-.59-.11a1.3 1.3 0 0 1-.45-.313 1.4 1.4 0 0 1-.289-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.112-.3.305-.507.192-.207.437-.313t.506-.107q.334 0 .575.116.245.114.4.322.156.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.432-.126a.712.712 0 0 0-.595.302q-.11.149-.17.365t-.06.498v.12q0 .222.06.417.064.193.181.34a.9.9 0 0 0 .29.23.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.195-.114.343-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m2.365-2.681v2.623h-.532v-3.112h.517zm.972-.506-.003.494a1.289 1.289 0 0 0-.259-.023.9.9 0 0 0-.325.058.7.7 0 0 0-.239.161.8.8 0 0 0-.155.247 1.2 1.2 0 0 0-.072.311l-.15.086q0-.282.055-.529.057-.248.176-.437a.85.85 0 0 1 .299-.299.84.84 0 0 1 .673-.069m2.304 2.304a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.783.783 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.365-.199.213-.072.475-.072.374 0 .639.133a1 1 0 0 1 .405.354.87.87 0 0 1 .141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.032.374.34.34 0 0 0 .11.124 1 1 0 0 0 .218.104q.141.049.36.097.383.087.63.207.248.121.368.297t.12.425a.837.837 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.492.066q-.411 0-.696-.147a1.1 1.1 0 0 1-.431-.38.9.9 0 0 1-.147-.492h.535q.012.219.127.349.115.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m3.48.273.8-2.56h.35l-.069.509-.814 2.603h-.342zm-.538-2.56.682 2.589.049.523h-.36l-.903-3.112zm2.454 2.569.65-2.569h.529l-.903 3.112h-.357zm-.688-2.569.782 2.517.09.595h-.34l-.837-2.609-.069-.503zm2.992 0v3.112h-.535v-3.112zm-.576-.825a.32.32 0 0 1 .078-.219q.08-.09.236-.089.153 0 .233.089a.3.3 0 0 1 .083.219.3.3 0 0 1-.083.212q-.081.087-.233.087-.155 0-.236-.087a.3.3 0 0 1-.078-.212m2.008-.481v4.418h-.535v-4.418zm1.432 0v4.418h-.535v-4.418zm2.313 0h.535v3.814l-.046.604h-.49zm2.637 2.836v.061q0 .339-.08.63a1.6 1.6 0 0 1-.236.5q-.155.213-.38.331-.224.118-.514.118-.296 0-.521-.101a1 1 0 0 1-.374-.296 1.5 1.5 0 0 1-.244-.466q-.09-.273-.124-.616v-.264a3 3 0 0 1 .124-.619 1.5 1.5 0 0 1 .244-.466 1 1 0 0 1 .374-.296q.221-.104.515-.104.293 0 .52.116.228.112.38.322.155.21.236.503.08.29.08.647m-.535.061v-.061a2 2 0 0 0-.043-.437 1.1 1.1 0 0 0-.138-.362.69.69 0 0 0-.633-.34.8.8 0 0 0-.35.069.8.8 0 0 0-.25.187 1 1 0 0 0-.17.265 1.5 1.5 0 0 0-.095.305v.693q.045.201.15.388a.9.9 0 0 0 .281.302.8.8 0 0 0 .44.118.74.74 0 0 0 .368-.086.7.7 0 0 0 .25-.245q.099-.155.144-.359.046-.204.046-.437m2.5 1.579q-.325 0-.59-.11a1.3 1.3 0 0 1-.451-.313 1.4 1.4 0 0 1-.288-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.111-.3.305-.507.192-.207.437-.313.244-.107.506-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.087-.403.73.73 0 0 0-.23-.322q-.158-.126-.431-.126a.71.71 0 0 0-.595.302 1.1 1.1 0 0 0-.17.365q-.06.216-.06.498v.12q0 .222.06.417.063.193.181.34.12.147.29.23a.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.196-.114.342-.307l.323.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m5.128-.59v-1.602a.65.65 0 0 0-.074-.319.5.5 0 0 0-.219-.213.8.8 0 0 0-.362-.075.85.85 0 0 0-.354.069.6.6 0 0 0-.236.181.4.4 0 0 0-.084.242h-.532q0-.167.087-.331a1 1 0 0 1 .247-.296q.165-.135.391-.213.23-.081.512-.081.34 0 .599.116.261.114.408.348.15.23.15.578v1.449q0 .156.025.331.03.176.084.302v.046h-.555a1 1 0 0 1-.064-.244 2 2 0 0 1-.023-.288m.092-1.355.006.374h-.538a2 2 0 0 0-.405.038.9.9 0 0 0-.3.106.482.482 0 0 0-.247.431.55.55 0 0 0 .066.268.5.5 0 0 0 .199.193q.135.069.33.069a.894.894 0 0 0 .728-.357.54.54 0 0 0 .121-.29l.227.256a.8.8 0 0 1-.109.267 1.27 1.27 0 0 1-.59.503 1.1 1.1 0 0 1-.454.087q-.317 0-.555-.124a.95.95 0 0 1-.368-.331.9.9 0 0 1-.13-.469q0-.25.098-.44a.85.85 0 0 1 .282-.319q.184-.129.443-.196.258-.066.578-.066zm3.182 1.168v-2.393h.535v3.112h-.51zm.1-.656.222-.005q0 .31-.066.575a1.2 1.2 0 0 1-.207.454 1 1 0 0 1-.377.302 1.4 1.4 0 0 1-.567.107q-.227 0-.417-.066a.85.85 0 0 1-.532-.564 1.7 1.7 0 0 1-.072-.532v-2.008h.532v2.013q0 .21.046.348a.6.6 0 0 0 .13.216.5.5 0 0 0 .184.109q.103.032.213.032.339 0 .537-.129a.74.74 0 0 0 .285-.354q.09-.225.09-.498m2.549-1.737v.408h-1.683v-.408zm-1.114-.756h.533v3.097q0 .159.049.239a.23.23 0 0 0 .126.106.5.5 0 0 0 .167.026q.066 0 .138-.011l.112-.023.003.434a1 1 0 0 1-.167.038q-.1.02-.244.02a.8.8 0 0 1-.36-.078.58.58 0 0 1-.262-.259 1.1 1.1 0 0 1-.094-.495zm1.54 2.347v-.067q0-.336.097-.624a1.5 1.5 0 0 1 .282-.503 1.3 1.3 0 0 1 .446-.334q.261-.12.587-.121.327 0 .59.121.264.118.448.334.188.213.285.503.097.288.097.624v.067q0 .336-.097.624-.098.287-.285.503a1.3 1.3 0 0 1-.446.334 1.4 1.4 0 0 1-.587.118 1.4 1.4 0 0 1-.59-.118 1.3 1.3 0 0 1-.448-.334 1.5 1.5 0 0 1-.282-.503 2 2 0 0 1-.098-.624m.531-.067v.067q0 .233.055.44.055.204.164.362a.8.8 0 0 0 .28.25q.166.09.387.089a.8.8 0 0 0 .383-.089.8.8 0 0 0 .276-.25q.109-.158.164-.362a1.6 1.6 0 0 0 .058-.44v-.067q0-.23-.058-.434a1.1 1.1 0 0 0-.167-.365.768.768 0 0 0-.662-.345.8.8 0 0 0-.385.092.8.8 0 0 0-.276.253 1.2 1.2 0 0 0-.164.365 1.7 1.7 0 0 0-.055.434m3.498-.906v2.494h-.535v-3.112h.506zm-.11.82-.247-.008q.003-.32.084-.59.08-.273.239-.475.157-.2.394-.31.236-.113.546-.113.219 0 .403.064a.81.81 0 0 1 .529.532q.075.207.075.5v2.074h-.532v-2.048a.8.8 0 0 0-.084-.391.48.48 0 0 0-.23-.213.8.8 0 0 0-.35-.069.83.83 0 0 0-.395.084.66.66 0 0 0-.253.23q-.095.146-.138.336-.04.187-.04.397m2.017-.293-.357.109q.003-.257.084-.492.083-.236.239-.42.157-.183.388-.29.23-.11.526-.11.25 0 .443.067a.8.8 0 0 1 .328.204q.135.135.204.348.07.213.07.506v2.045h-.536v-2.051a.8.8 0 0 0-.083-.405.43.43 0 0 0-.23-.204.9.9 0 0 0-.351-.061q-.175 0-.31.061a.6.6 0 0 0-.228.166.7.7 0 0 0-.141.239.9.9 0 0 0-.046.288m4.565 1.435v-1.602a.65.65 0 0 0-.075-.319.5.5 0 0 0-.219-.213.8.8 0 0 0-.362-.075.85.85 0 0 0-.354.069.6.6 0 0 0-.236.181.4.4 0 0 0-.083.242h-.532q0-.167.086-.331a1 1 0 0 1 .247-.296q.165-.135.392-.213.23-.081.511-.081.34 0 .599.116.261.114.408.348.15.23.15.578v1.449q0 .156.026.331.029.176.083.302v.046h-.555a1 1 0 0 1-.063-.244 2 2 0 0 1-.023-.288m.092-1.355.006.374h-.538q-.228 0-.406.038a.9.9 0 0 0-.3.106.482.482 0 0 0-.247.431.55.55 0 0 0 .067.268.5.5 0 0 0 .198.193q.135.069.331.069a.895.895 0 0 0 .728-.357.54.54 0 0 0 .12-.29l.228.256a.8.8 0 0 1-.11.267 1.27 1.27 0 0 1-.59.503 1.1 1.1 0 0 1-.454.087q-.316 0-.555-.124a.95.95 0 0 1-.368-.331.9.9 0 0 1-.13-.469q0-.25.098-.44a.85.85 0 0 1 .282-.319q.184-.129.443-.196.259-.066.578-.066zm2.58-1.225v.408h-1.683v-.408zm-1.113-.756h.532v3.097q0 .159.049.239a.23.23 0 0 0 .126.106.5.5 0 0 0 .167.026q.066 0 .138-.011l.112-.023.003.434a1 1 0 0 1-.167.038q-.1.02-.244.02a.8.8 0 0 1-.36-.078.58.58 0 0 1-.261-.259 1.1 1.1 0 0 1-.095-.495zm2.315.756v3.112h-.535v-3.112zm-.575-.825q0-.13.077-.219.081-.09.236-.089.153 0 .233.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.08.087-.233.087-.155 0-.236-.087a.31.31 0 0 1-.077-.212m2.675 3.557a.8.8 0 0 0 .351-.077.7.7 0 0 0 .264-.213.6.6 0 0 0 .118-.314h.506a.94.94 0 0 1-.187.515 1.3 1.3 0 0 1-.445.383 1.3 1.3 0 0 1-.607.144 1.4 1.4 0 0 1-.613-.124 1.2 1.2 0 0 1-.431-.339 1.5 1.5 0 0 1-.256-.495 2 2 0 0 1-.084-.596v-.12q0-.314.084-.593.086-.282.256-.497.173-.216.431-.34a1.4 1.4 0 0 1 .613-.124q.365 0 .638.15.273.147.429.403.158.252.172.575h-.506a.8.8 0 0 0-.109-.348.7.7 0 0 0-.253-.247.7.7 0 0 0-.371-.095q-.244 0-.412.097a.7.7 0 0 0-.261.259q-.096.162-.138.36-.04.196-.041.4v.12q0 .205.041.403.04.198.135.36a.76.76 0 0 0 .262.259.83.83 0 0 0 .414.094m3.673-.152v-1.602a.65.65 0 0 0-.075-.319.5.5 0 0 0-.219-.213.8.8 0 0 0-.362-.075.85.85 0 0 0-.354.069.63.63 0 0 0-.236.181.4.4 0 0 0-.083.242h-.532a.7.7 0 0 1 .086-.331 1 1 0 0 1 .247-.296q.164-.135.392-.213.23-.081.512-.081.339 0 .598.116a.9.9 0 0 1 .408.348q.15.23.15.578v1.449q0 .156.026.331a1.3 1.3 0 0 0 .083.302v.046h-.555a1 1 0 0 1-.063-.244 2 2 0 0 1-.023-.288m.092-1.355.006.374h-.538a2 2 0 0 0-.406.038 1 1 0 0 0-.299.106.484.484 0 0 0-.247.431q0 .147.066.268t.198.193q.135.069.331.069a.9.9 0 0 0 .728-.357.55.55 0 0 0 .121-.29l.227.256a.8.8 0 0 1-.11.267 1.27 1.27 0 0 1-.589.503 1.1 1.1 0 0 1-.455.087q-.317 0-.555-.124a.95.95 0 0 1-.368-.331.9.9 0 0 1-.129-.469q0-.25.097-.44a.86.86 0 0 1 .282-.319q.185-.129.443-.196.26-.066.578-.066zm1.855-2.531v4.418h-.535v-4.418zm1.432 0v4.418h-.535v-4.418zm1.729 4.096.866-2.79h.569l-1.248 3.593a2 2 0 0 1-.115.247q-.069.135-.178.256a.84.84 0 0 1-.791.256 2 2 0 0 1-.138-.029l-.003-.431.072.005.072.006q.18 0 .307-.049a.45.45 0 0 0 .213-.158 1 1 0 0 0 .153-.302zm-.636-2.79.809 2.416.138.561-.383.196-1.145-3.173zm5.258 2.732a.8.8 0 0 0 .351-.077.7.7 0 0 0 .265-.213.6.6 0 0 0 .118-.314h.506a.95.95 0 0 1-.187.515 1.291 1.291 0 0 1-1.053.527q-.351 0-.612-.124a1.2 1.2 0 0 1-.432-.339 1.5 1.5 0 0 1-.256-.495 2.1 2.1 0 0 1-.083-.596v-.12q0-.314.083-.593.087-.282.256-.497.172-.216.432-.34.261-.123.612-.124.366 0 .639.15.273.147.428.403.158.252.173.575h-.506a.8.8 0 0 0-.11-.348.67.67 0 0 0-.253-.247.7.7 0 0 0-.371-.095q-.244 0-.411.097a.73.73 0 0 0-.262.259 1.2 1.2 0 0 0-.138.36q-.04.196-.04.4v.12q0 .205.04.403t.135.36a.8.8 0 0 0 .262.259.83.83 0 0 0 .414.094m1.697-1.141v-.067q0-.336.098-.624.098-.29.282-.503a1.3 1.3 0 0 1 .446-.334q.261-.12.587-.121.328 0 .589.121.265.118.449.334.187.213.285.503.097.288.097.624v.067q0 .336-.097.624a1.5 1.5 0 0 1-.285.503 1.3 1.3 0 0 1-1.033.452q-.328 0-.589-.118a1.3 1.3 0 0 1-.449-.334 1.5 1.5 0 0 1-.282-.503 2 2 0 0 1-.098-.624m.532-.067v.067q0 .233.055.44.055.204.164.362a.8.8 0 0 0 .279.25q.167.09.388.089a.8.8 0 0 0 .383-.089.8.8 0 0 0 .276-.25 1.1 1.1 0 0 0 .164-.362q.057-.207.057-.44v-.067q0-.23-.057-.434a1.1 1.1 0 0 0-.167-.365.767.767 0 0 0-.661-.345.8.8 0 0 0-.386.092.8.8 0 0 0-.276.253 1.2 1.2 0 0 0-.164.365 1.7 1.7 0 0 0-.055.434m3.501-.86v2.448h-.532v-3.112h.503zm-.127.774-.221-.008q.002-.32.095-.59.091-.273.259-.475.166-.2.397-.31.232-.113.514-.113.23 0 .415.064.183.06.313.195.132.135.201.351.069.213.069.521v2.039h-.534v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.76.76 0 0 0-.34-.069.8.8 0 0 0-.362.084.84.84 0 0 0-.279.23q-.115.146-.181.336a1.2 1.2 0 0 0-.064.397m3.561 1.674h-.532v-3.382q0-.354.138-.599a.9.9 0 0 1 .394-.371q.256-.126.607-.126.207 0 .406.052.198.048.408.123l-.089.449a3 3 0 0 0-.308-.098 1.4 1.4 0 0 0-.38-.049q-.342 0-.494.156-.15.152-.15.463zm.636-3.112v.408h-1.66v-.408zm1.047 0v3.112h-.532v-3.112zm1.406.489v2.623h-.532v-3.112h.518zm.973-.506-.003.494a1.277 1.277 0 0 0-.259-.023.9.9 0 0 0-.325.058.7.7 0 0 0-.239.161.8.8 0 0 0-.155.247 1.2 1.2 0 0 0-.072.311l-.15.086q0-.282.055-.529.058-.248.175-.437a.86.86 0 0 1 .299-.299.84.84 0 0 1 .674-.069m1.021.635v2.494h-.535v-3.112h.506zm-.11.82-.247-.008q.003-.32.083-.59.081-.273.239-.475.159-.2.394-.31.236-.113.547-.113.218 0 .402.064a.82.82 0 0 1 .53.532q.074.207.074.5v2.074h-.532v-2.048a.8.8 0 0 0-.083-.391.48.48 0 0 0-.23-.213.8.8 0 0 0-.351-.069.83.83 0 0 0-.394.084.65.65 0 0 0-.253.23 1 1 0 0 0-.138.336 2 2 0 0 0-.041.397m2.017-.293-.357.109q.003-.257.083-.492a1.4 1.4 0 0 1 .239-.42q.159-.183.388-.29.23-.11.527-.11.25 0 .443.067.195.066.328.204.135.135.204.348t.069.506v2.045h-.535v-2.051a.8.8 0 0 0-.084-.405.43.43 0 0 0-.23-.204.9.9 0 0 0-.351-.061.7.7 0 0 0-.31.061.6.6 0 0 0-.227.166.7.7 0 0 0-.141.239.9.9 0 0 0-.046.288m4.021 2.025q-.326 0-.59-.11a1.3 1.3 0 0 1-.452-.313 1.4 1.4 0 0 1-.287-.478 1.8 1.8 0 0 1-.101-.604v-.12q0-.38.112-.676.113-.3.305-.507a1.3 1.3 0 0 1 .437-.313q.245-.107.507-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.791v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.158-.126-.431-.126a.71.71 0 0 0-.596.302 1.1 1.1 0 0 0-.169.365q-.061.216-.061.498v.12q0 .222.061.417.063.193.181.34.12.147.29.23a.9.9 0 0 0 .391.083.93.93 0 0 0 .478-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224q-.225.087-.532.087m3.793-.662v-3.814h.535v4.418h-.489zm-2.093-.917v-.061q0-.356.086-.647a1.6 1.6 0 0 1 .25-.503q.164-.21.388-.322.228-.116.507-.116.293 0 .512.104a1 1 0 0 1 .373.296q.156.193.245.466.089.274.124.619v.264a2.7 2.7 0 0 1-.124.616 1.4 1.4 0 0 1-.245.466 1 1 0 0 1-.373.296 1.25 1.25 0 0 1-.518.101 1.08 1.08 0 0 1-.889-.449 1.6 1.6 0 0 1-.25-.5 2.2 2.2 0 0 1-.086-.63m.535-.061v.061q0 .233.046.437.048.204.149.359a.75.75 0 0 0 .256.245.76.76 0 0 0 .371.086.77.77 0 0 0 .434-.112.84.84 0 0 0 .277-.296q.103-.184.161-.4v-.693a1.5 1.5 0 0 0-.101-.305 1 1 0 0 0-.167-.265.7.7 0 0 0-.25-.187.8.8 0 0 0-.348-.069.74.74 0 0 0-.377.092.74.74 0 0 0-.256.248 1.1 1.1 0 0 0-.149.362 2 2 0 0 0-.046.437m-106.9 10.03.799-2.56h.35l-.068.509-.814 2.603h-.343zm-.539-2.56.682 2.589.049.523h-.36l-.903-3.112zm2.454 2.569.65-2.569h.529l-.903 3.112h-.357zm-.688-2.569.783 2.517.089.595h-.34l-.837-2.609-.069-.503zm2.946-1.306v4.418h-.532v-4.418zm-.127 2.744-.221-.008q.003-.32.095-.59.09-.273.258-.475a1.16 1.16 0 0 1 .912-.423q.231 0 .414.064.185.06.314.195a.9.9 0 0 1 .201.351q.07.213.07.521v2.039h-.536v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.75.75 0 0 0-.339-.069.8.8 0 0 0-.362.084.9.9 0 0 0-.28.23 1.15 1.15 0 0 0-.244.733m3.417-1.438v3.112h-.535v-3.112zm-.575-.825a.32.32 0 0 1 .078-.219q.08-.09.235-.089.153 0 .233.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.08.087-.233.087-.155 0-.236-.087a.3.3 0 0 1-.077-.212m2.008-.481v4.418h-.536v-4.418zm2.145 4.476q-.324 0-.59-.11a1.3 1.3 0 0 1-.451-.313 1.4 1.4 0 0 1-.288-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.112-.3.305-.507.192-.207.437-.313t.506-.107q.334 0 .576.116.244.114.4.322.155.204.23.483.075.276.074.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.432-.126a.71.71 0 0 0-.595.302 1.1 1.1 0 0 0-.17.365q-.06.216-.06.498v.12q0 .222.06.417.063.193.181.34.121.147.29.23a.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.196-.114.343-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m4.597-3.17v.408h-1.683v-.408zm-1.114-.756h.533v3.097q0 .159.048.239a.23.23 0 0 0 .127.106.5.5 0 0 0 .167.026q.066 0 .138-.011l.112-.023.003.434a1 1 0 0 1-.167.038q-.101.02-.244.02a.8.8 0 0 1-.36-.078.58.58 0 0 1-.262-.259 1.1 1.1 0 0 1-.095-.495zm2.27-.55v4.418h-.532v-4.418zm-.127 2.744-.221-.008a1.9 1.9 0 0 1 .095-.59q.091-.273.259-.475a1.16 1.16 0 0 1 .911-.423q.231 0 .414.064.185.06.314.195a.9.9 0 0 1 .201.351q.07.213.07.521v2.039h-.536v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.75.75 0 0 0-.339-.069.8.8 0 0 0-.362.084.9.9 0 0 0-.28.23 1.15 1.15 0 0 0-.244.733m3.417-1.438v3.112h-.535v-3.112zm-.575-.825a.32.32 0 0 1 .078-.219q.08-.09.236-.089.152 0 .232.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.08.087-.232.087-.156 0-.236-.087a.3.3 0 0 1-.078-.212m3.242 3.112a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.783.783 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.365-.199.213-.072.475-.072.374 0 .639.133a1 1 0 0 1 .405.354q.141.218.141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.032.374.34.34 0 0 0 .11.124 1 1 0 0 0 .218.104q.141.049.36.097.383.087.63.207.247.121.368.297.12.176.12.425a.838.838 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.491.066q-.412 0-.697-.147a1.1 1.1 0 0 1-.431-.38.9.9 0 0 1-.147-.492h.535q.012.219.127.349.115.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m4.654.221v-3.814h.535v4.418h-.49zm-2.094-.917v-.061q0-.356.086-.647.09-.294.25-.503.165-.21.388-.322a1.1 1.1 0 0 1 .507-.116q.293 0 .512.104a1 1 0 0 1 .373.296q.156.193.245.466.089.274.124.619v.264a2.7 2.7 0 0 1-.124.616q-.09.273-.245.466a1 1 0 0 1-.373.296q-.222.1-.518.101-.274 0-.5-.118a1.2 1.2 0 0 1-.389-.331 1.6 1.6 0 0 1-.25-.5 2.2 2.2 0 0 1-.087-.63m.534-.061v.061q0 .233.047.437.048.204.15.359a.75.75 0 0 0 .255.245.76.76 0 0 0 .371.086.77.77 0 0 0 .434-.112.84.84 0 0 0 .277-.296q.103-.184.16-.4v-.693a1.5 1.5 0 0 0-.1-.305 1 1 0 0 0-.167-.265.7.7 0 0 0-.25-.187.8.8 0 0 0-.348-.069.74.74 0 0 0-.377.092.74.74 0 0 0-.256.248 1.1 1.1 0 0 0-.15.362 2 2 0 0 0-.046.437m4.214 1.64q-.324 0-.59-.11a1.3 1.3 0 0 1-.45-.313 1.4 1.4 0 0 1-.289-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.112-.676.112-.3.305-.507.192-.207.437-.313t.506-.107q.335 0 .576.116.244.114.4.322.155.204.23.483.075.276.074.604v.239H61.08v-.435h1.792v-.04a1.3 1.3 0 0 0-.086-.403.73.73 0 0 0-.23-.322q-.159-.126-.432-.126a.71.71 0 0 0-.595.302q-.11.149-.17.365t-.06.498v.12q0 .222.06.417.064.193.181.34a.9.9 0 0 0 .29.23.9.9 0 0 0 .392.083.9.9 0 0 0 .478-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.383.224 1.5 1.5 0 0 1-.532.087m2.738-.538.852-2.632h.544l-1.12 3.112h-.356zm-.71-2.632.877 2.646.06.466h-.356l-1.127-3.112zm3.196 0v3.112h-.535v-3.112zm-.576-.825a.32.32 0 0 1 .078-.219q.08-.09.236-.089.153 0 .233.089a.3.3 0 0 1 .083.219.3.3 0 0 1-.083.212q-.081.087-.233.087-.155 0-.236-.087a.3.3 0 0 1-.078-.212m2.675 3.557a.8.8 0 0 0 .351-.077.7.7 0 0 0 .265-.213.6.6 0 0 0 .118-.314h.506a.95.95 0 0 1-.187.515 1.27 1.27 0 0 1-1.053.527q-.351 0-.612-.124a1.2 1.2 0 0 1-.432-.339 1.5 1.5 0 0 1-.256-.495 2 2 0 0 1-.083-.596v-.12q0-.314.083-.593a1.5 1.5 0 0 1 .256-.497 1.2 1.2 0 0 1 .432-.34q.261-.123.612-.124.366 0 .639.15.273.147.428.403.158.252.173.575h-.506a.8.8 0 0 0-.11-.348.7.7 0 0 0-.253-.247.7.7 0 0 0-.37-.095q-.245 0-.412.097a.73.73 0 0 0-.262.259q-.094.162-.138.36a2 2 0 0 0-.04.4v.12q0 .205.04.403t.135.36a.76.76 0 0 0 .262.259.83.83 0 0 0 .414.094m3.13.438q-.325 0-.59-.11a1.3 1.3 0 0 1-.452-.313 1.4 1.4 0 0 1-.287-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.111-.676.113-.3.305-.507.193-.207.438-.313.244-.107.506-.107.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.087-.403.73.73 0 0 0-.23-.322q-.159-.126-.431-.126a.71.71 0 0 0-.595.302q-.11.149-.17.365t-.06.498v.12q0 .222.06.417.063.193.18.34.121.147.291.23a.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.196-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224 1.5 1.5 0 0 1-.532.087m3.871-3.17v3.112h-.535v-3.112zm-.575-.825a.32.32 0 0 1 .078-.219q.08-.09.235-.089.153 0 .233.089a.3.3 0 0 1 .084.219.3.3 0 0 1-.084.212q-.079.087-.233.087t-.235-.087a.3.3 0 0 1-.078-.212m3.242 3.112a.45.45 0 0 0-.052-.213.44.44 0 0 0-.204-.181 1.7 1.7 0 0 0-.46-.144 4 4 0 0 1-.47-.13 1.4 1.4 0 0 1-.353-.181.8.8 0 0 1-.222-.25.783.783 0 0 1 .003-.685.9.9 0 0 1 .233-.29q.153-.127.365-.199.213-.072.475-.072.375 0 .638.133a1 1 0 0 1 .406.354q.141.218.141.486h-.532a.46.46 0 0 0-.078-.251.6.6 0 0 0-.221-.204.7.7 0 0 0-.354-.08.8.8 0 0 0-.36.069.46.46 0 0 0-.198.169.43.43 0 0 0-.032.374.34.34 0 0 0 .11.124 1 1 0 0 0 .218.104q.141.049.36.097.382.087.63.207.247.121.368.297.12.176.12.425a.837.837 0 0 1-.33.668q-.158.12-.38.19a1.7 1.7 0 0 1-.492.066q-.411 0-.696-.147a1.1 1.1 0 0 1-.431-.38.9.9 0 0 1-.147-.492h.535q.012.219.127.349.114.126.282.181.166.051.33.051.219 0 .366-.057a.5.5 0 0 0 .227-.158.37.37 0 0 0 .078-.23m4.596.106v-2.393h.535v3.112h-.51zm.1-.656.222-.005q0 .31-.066.575a1.2 1.2 0 0 1-.207.454 1 1 0 0 1-.377.302 1.4 1.4 0 0 1-.567.107q-.227 0-.417-.066a.85.85 0 0 1-.532-.564 1.7 1.7 0 0 1-.072-.532v-2.008h.532v2.013q0 .21.046.348a.6.6 0 0 0 .13.216.5.5 0 0 0 .184.109q.104.032.213.032.339 0 .538-.129a.74.74 0 0 0 .284-.354q.09-.225.09-.498m1.778-1.073v2.448h-.532v-3.112h.503zm-.126.774-.222-.008a1.9 1.9 0 0 1 .095-.59q.092-.273.259-.475a1.16 1.16 0 0 1 .912-.423q.23 0 .414.064.184.06.313.195.133.135.202.351.069.213.069.521v2.039h-.535v-2.045a.9.9 0 0 0-.072-.391.44.44 0 0 0-.21-.216.75.75 0 0 0-.34-.069.8.8 0 0 0-.362.084.9.9 0 0 0-.279.23 1.15 1.15 0 0 0-.244.733m3.428-2.744v4.418h-.535v-4.418zm.713 2.897v-.067q0-.336.098-.624a1.5 1.5 0 0 1 .282-.503 1.3 1.3 0 0 1 .446-.334q.261-.12.587-.121a1.4 1.4 0 0 1 .59.121q.264.118.448.334.188.213.285.503.098.288.098.624v.067q0 .336-.098.624a1.5 1.5 0 0 1-.285.503 1.3 1.3 0 0 1-.446.334 1.4 1.4 0 0 1-.587.118 1.4 1.4 0 0 1-.59-.118 1.3 1.3 0 0 1-.448-.334 1.5 1.5 0 0 1-.282-.503 2 2 0 0 1-.098-.624m.532-.067v.067q0 .233.055.44.055.204.164.362a.8.8 0 0 0 .28.25q.166.09.387.089a.8.8 0 0 0 .383-.089.8.8 0 0 0 .276-.25q.11-.158.164-.362.057-.207.058-.44v-.067q0-.23-.058-.434a1.1 1.1 0 0 0-.167-.365.768.768 0 0 0-.662-.345.8.8 0 0 0-.385.092.8.8 0 0 0-.276.253 1.2 1.2 0 0 0-.164.365 1.7 1.7 0 0 0-.055.434m4.214 1.208a.8.8 0 0 0 .351-.077.7.7 0 0 0 .265-.213.6.6 0 0 0 .118-.314h.506a.95.95 0 0 1-.187.515 1.293 1.293 0 0 1-1.053.527q-.351 0-.612-.124a1.2 1.2 0 0 1-.432-.339 1.5 1.5 0 0 1-.256-.495 2 2 0 0 1-.083-.596v-.12q0-.314.083-.593a1.5 1.5 0 0 1 .256-.497 1.2 1.2 0 0 1 .432-.34q.261-.123.612-.124.366 0 .639.15.273.147.428.403.158.252.173.575h-.506a.8.8 0 0 0-.11-.348.7.7 0 0 0-.253-.247.7.7 0 0 0-.37-.095q-.245 0-.412.097a.73.73 0 0 0-.262.259q-.095.162-.138.36-.04.196-.04.4v.12q0 .205.04.403t.135.36a.76.76 0 0 0 .262.259.83.83 0 0 0 .414.094m2.373-4.038v4.418h-.535v-4.418zm1.901 1.306-1.357 1.453-.76.788-.043-.567.544-.65.966-1.024zm-.486 3.112-1.11-1.484.276-.475 1.461 1.959zm2.27.058a1.5 1.5 0 0 1-.59-.11 1.3 1.3 0 0 1-.451-.313 1.4 1.4 0 0 1-.288-.478 1.8 1.8 0 0 1-.1-.604v-.12q0-.38.111-.676.113-.3.305-.507.194-.207.438-.313t.506-.107q.333 0 .575.116.244.114.4.322.155.204.23.483.075.276.075.604v.239h-2.324v-.435h1.792v-.04a1.3 1.3 0 0 0-.087-.403.73.73 0 0 0-.23-.322q-.158-.126-.431-.126a.711.711 0 0 0-.596.302q-.109.149-.17.365-.06.216-.06.498v.12q0 .222.06.417.064.193.182.34a.9.9 0 0 0 .29.23.9.9 0 0 0 .392.083.9.9 0 0 0 .477-.115q.195-.114.342-.307l.322.256a1.5 1.5 0 0 1-.256.29 1.2 1.2 0 0 1-.382.224q-.225.087-.532.087m3.794-.662v-3.814h.535v4.418h-.489zm-2.094-.917v-.061q0-.356.086-.647a1.6 1.6 0 0 1 .25-.503q.164-.21.388-.322.228-.116.507-.116.293 0 .512.104a1 1 0 0 1 .374.296q.155.193.244.466.09.274.124.619v.264a2.7 2.7 0 0 1-.124.616 1.5 1.5 0 0 1-.244.466 1.04 1.04 0 0 1-.374.296 1.25 1.25 0 0 1-.518.101 1.08 1.08 0 0 1-.889-.449 1.6 1.6 0 0 1-.25-.5 2.2 2.2 0 0 1-.086-.63m.535-.061v.061q0 .233.046.437.048.204.149.359a.75.75 0 0 0 .256.245.76.76 0 0 0 .371.086.77.77 0 0 0 .435-.112.84.84 0 0 0 .276-.296q.103-.184.161-.4v-.693a1.5 1.5 0 0 0-.101-.305 1 1 0 0 0-.167-.265.7.7 0 0 0-.25-.187.8.8 0 0 0-.348-.069.74.74 0 0 0-.377.092.74.74 0 0 0-.256.248 1.1 1.1 0 0 0-.149.362 2 2 0 0 0-.046.437m2.931 1.3q0-.135.083-.227a.32.32 0 0 1 .247-.095q.162 0 .245.095a.32.32 0 0 1 .086.227.32.32 0 0 1-.086.225q-.083.092-.245.092a.32.32 0 0 1-.247-.092.32.32 0 0 1-.083-.225"/><path class="tw-fill-background" d="M20.84 126.475h144.32v64.661H20.84z"/><rect width="124.124" height="16.049" x="30.939" y="129.842" class="tw-fill-secondary-500" rx="4.039"/><path class="tw-fill-background" d="M83.974 134.58v4.786h-.983v-4.786zm1.473 0v.772h-3.905v-.772zm2.357 3.935v-2.706h.947v3.557h-.891zm.105-.73.28-.007q0 .355-.083.661a1.6 1.6 0 0 1-.246.526q-.165.22-.414.345a1.3 1.3 0 0 1-.589.122q-.26 0-.48-.072a1 1 0 0 1-.374-.234 1.1 1.1 0 0 1-.244-.411 1.9 1.9 0 0 1-.085-.608v-2.298h.947v2.305q0 .158.036.266a.5.5 0 0 0 .108.177.4.4 0 0 0 .161.099q.096.03.21.03.294 0 .46-.119a.62.62 0 0 0 .24-.322q.073-.207.073-.46m2.511-1.2v2.781h-.946v-3.557h.89zm1.072-.799-.016.878a2 2 0 0 0-.168-.016 2 2 0 0 0-.174-.01q-.2 0-.349.052a.6.6 0 0 0-.243.148.65.65 0 0 0-.145.24 1.2 1.2 0 0 0-.052.322l-.19-.059q0-.345.068-.634.07-.293.2-.51.135-.216.33-.335a.83.83 0 0 1 .443-.118q.08 0 .161.013.082.01.135.029m1.374.783v2.797h-.947v-3.557h.888zm-.138.894h-.256q0-.395.102-.71.102-.32.286-.543.183-.227.437-.345a1.3 1.3 0 0 1 .572-.121q.25 0 .457.072a.9.9 0 0 1 .355.23q.15.158.23.417.082.26.082.635v2.268h-.953v-2.271a.84.84 0 0 0-.066-.369.37.37 0 0 0-.194-.184.8.8 0 0 0-.309-.055.7.7 0 0 0-.332.075.7.7 0 0 0-.23.21 1 1 0 0 0-.135.309q-.046.178-.046.382m4.51.161v-.069q0-.392.112-.72.111-.332.325-.575t.526-.378q.313-.138.717-.138.405 0 .72.138.315.135.529.378.217.243.329.575.111.328.112.72v.069q0 .387-.112.72a1.7 1.7 0 0 1-.329.575 1.46 1.46 0 0 1-.526.378q-.312.135-.717.135t-.72-.135a1.5 1.5 0 0 1-.529-.378 1.7 1.7 0 0 1-.325-.575 2.3 2.3 0 0 1-.112-.72m.947-.069v.069q0 .223.04.417.039.195.124.342a.65.65 0 0 0 .23.227q.142.082.346.082a.66.66 0 0 0 .338-.082.6.6 0 0 0 .227-.227q.086-.147.125-.342.043-.194.043-.417v-.069a2 2 0 0 0-.043-.408 1.1 1.1 0 0 0-.128-.342.64.64 0 0 0-.227-.236.65.65 0 0 0-.342-.086.65.65 0 0 0-.342.086.7.7 0 0 0-.227.236 1.1 1.1 0 0 0-.125.342 2 2 0 0 0-.04.408m3.931-.986v2.797h-.946v-3.557h.887zm-.138.894h-.256q0-.395.102-.71.102-.32.286-.543.184-.227.437-.345a1.3 1.3 0 0 1 .572-.121q.25 0 .457.072a.9.9 0 0 1 .355.23q.151.158.23.417.082.26.082.635v2.268h-.953v-2.271a.84.84 0 0 0-.066-.369.37.37 0 0 0-.194-.184.8.8 0 0 0-.309-.055.7.7 0 0 0-.332.075.7.7 0 0 0-.23.21 1 1 0 0 0-.135.309q-.046.178-.046.382"/><rect width="123.283" height="15.208" x="31.359" y="149.677" class="tw-stroke-secondary-500" stroke-width=".842" rx="3.619"/><path class="tw-fill-secondary-500" d="M87.663 157.194h.982q-.03.483-.266.857-.233.375-.654.586-.418.21-1.006.21-.46 0-.825-.158a1.76 1.76 0 0 1-.625-.46 2 2 0 0 1-.39-.723q-.136-.425-.136-.95v-.332q0-.526.139-.95.14-.427.4-.727a1.8 1.8 0 0 1 .629-.46q.364-.16.815-.161.598 0 1.009.217.414.217.64.598.23.382.277.868h-.986a1.3 1.3 0 0 0-.115-.49.65.65 0 0 0-.3-.305q-.196-.106-.525-.106a.96.96 0 0 0-.43.092.8.8 0 0 0-.31.28 1.4 1.4 0 0 0-.187.473q-.06.283-.06.664v.339q.001.371.056.654a1.5 1.5 0 0 0 .171.473.8.8 0 0 0 .303.29 1 1 0 0 0 .45.095q.309 0 .51-.099a.68.68 0 0 0 .305-.292q.109-.195.129-.483m2.57-3.462v5.049h-.95v-5.049zm.631 3.307v-.069q0-.391.112-.72.112-.332.326-.575.213-.243.525-.378.313-.138.717-.138.405 0 .72.138.315.135.53.378t.328.575q.111.329.112.72v.069q0 .388-.112.72a1.7 1.7 0 0 1-.329.575 1.5 1.5 0 0 1-.526.378 1.8 1.8 0 0 1-.716.135q-.405 0-.72-.135a1.5 1.5 0 0 1-.53-.378 1.7 1.7 0 0 1-.325-.575 2.2 2.2 0 0 1-.112-.72m.947-.069v.069q0 .223.04.418.039.194.124.341.09.145.23.227.142.082.346.082a.66.66 0 0 0 .338-.082.6.6 0 0 0 .227-.227q.086-.147.125-.341.042-.195.043-.418v-.069a2 2 0 0 0-.043-.408 1.1 1.1 0 0 0-.128-.341.64.64 0 0 0-.227-.237.65.65 0 0 0-.342-.086.65.65 0 0 0-.342.086.7.7 0 0 0-.227.237 1.1 1.1 0 0 0-.124.341 2 2 0 0 0-.04.408m4.927.828a.3.3 0 0 0-.059-.184.5.5 0 0 0-.22-.151 2 2 0 0 0-.457-.131 4 4 0 0 1-.503-.148 1.8 1.8 0 0 1-.4-.221.84.84 0 0 1-.358-.706q-.002-.224.094-.421.1-.198.28-.349.183-.155.447-.239.266-.09.598-.089.463 0 .796.148.335.147.512.407a1 1 0 0 1 .181.585h-.947a.5.5 0 0 0-.059-.246.4.4 0 0 0-.177-.174.63.63 0 0 0-.31-.066.6.6 0 0 0-.272.056.4.4 0 0 0-.178.144.35.35 0 0 0-.026.346q.037.062.115.115t.204.098q.127.043.316.079.384.08.686.207.303.125.48.342.178.214.178.562a.9.9 0 0 1-.105.434q-.105.198-.303.345-.197.145-.473.227a2.2 2.2 0 0 1-.615.079q-.496 0-.841-.178a1.33 1.33 0 0 1-.52-.45 1.05 1.05 0 0 1-.174-.565h.897a.53.53 0 0 0 .1.312.54.54 0 0 0 .24.171 1 1 0 0 0 .318.053.8.8 0 0 0 .306-.05.43.43 0 0 0 .184-.138.33.33 0 0 0 .066-.204m3.173 1.049q-.414 0-.743-.131a1.6 1.6 0 0 1-.56-.372 1.7 1.7 0 0 1-.348-.549 1.9 1.9 0 0 1-.121-.67v-.132q0-.404.115-.74t.329-.581a1.4 1.4 0 0 1 .526-.378q.309-.135.697-.135.377 0 .67.125.292.124.49.355.2.23.302.552.102.319.102.71v.394h-2.827v-.631h1.897v-.072a.8.8 0 0 0-.072-.352.57.57 0 0 0-.211-.25.65.65 0 0 0-.361-.092.6.6 0 0 0-.323.083.6.6 0 0 0-.22.23 1.2 1.2 0 0 0-.125.348 2.2 2.2 0 0 0-.04.434v.132q0 .213.06.394.063.18.174.312a.8.8 0 0 0 .276.204q.165.072.372.072.257 0 .476-.098a1 1 0 0 0 .385-.306l.46.5q-.111.16-.305.309a1.7 1.7 0 0 1-.461.243 1.9 1.9 0 0 1-.614.092"/><path class="tw-fill-secondary-700" d="m41.003 177.374.834-3.524h.466l.107.587-.889 3.601h-.5zm-.428-3.524.69 3.524-.057.664h-.558l-.93-4.188zm2.568 3.509.682-3.509h.854l-.926 4.188h-.558zm-.578-3.509.84 3.538-.023.65h-.5l-.895-3.604.115-.584zm3.34-.23v4.418h-.829v-4.418zm-.118 2.753h-.228q.003-.325.087-.599.083-.276.238-.477.156-.205.371-.316a1.04 1.04 0 0 1 .484-.113q.23 0 .417.067a.8.8 0 0 1 .325.207.9.9 0 0 1 .213.371q.074.23.074.558v1.967h-.834v-1.973a.7.7 0 0 0-.06-.325.33.33 0 0 0-.17-.17.6.6 0 0 0-.27-.052.65.65 0 0 0-.305.067.5.5 0 0 0-.199.184.8.8 0 0 0-.109.27 1.5 1.5 0 0 0-.034.334m4.291.963v-1.386q0-.15-.049-.256a.36.36 0 0 0-.152-.17.5.5 0 0 0-.262-.06.54.54 0 0 0-.239.049.34.34 0 0 0-.155.135.37.37 0 0 0-.055.204h-.828q0-.198.092-.377a.9.9 0 0 1 .267-.313q.175-.138.417-.216.246-.078.547-.078.362 0 .644.121a1 1 0 0 1 .443.363q.165.241.164.604v1.331q0 .257.032.42.031.162.092.282v.049h-.837q-.06-.126-.092-.316a3 3 0 0 1-.029-.386m.11-1.193.005.468h-.463a1 1 0 0 0-.285.038.5.5 0 0 0-.198.106.4.4 0 0 0-.115.156.5.5 0 0 0-.035.195q0 .106.05.193.048.083.14.132a.5.5 0 0 0 .216.046.7.7 0 0 0 .325-.075.6.6 0 0 0 .213-.184.4.4 0 0 0 .08-.207l.219.351q-.045.118-.127.245a1.024 1.024 0 0 1-.489.42 1.1 1.1 0 0 1-.402.069q-.297 0-.538-.118a1 1 0 0 1-.38-.331.87.87 0 0 1-.138-.483q0-.245.092-.435a.85.85 0 0 1 .27-.319 1.3 1.3 0 0 1 .452-.198q.27-.069.627-.069zm2.887-1.217v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .109.1.6.6 0 0 0 .181.026q.078 0 .138-.006.063-.008.107-.017l.002.61q-.105.035-.23.054a1.6 1.6 0 0 1-.273.021q-.273 0-.477-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm4.981 3.178v-1.386q0-.15-.048-.256a.36.36 0 0 0-.153-.17.5.5 0 0 0-.262-.06.54.54 0 0 0-.238.049.34.34 0 0 0-.156.135.37.37 0 0 0-.054.204h-.829q0-.198.092-.377a.9.9 0 0 1 .268-.313q.175-.138.417-.216.244-.078.546-.078.363 0 .645.121a1 1 0 0 1 .443.363q.164.241.164.604v1.331q0 .257.031.42.032.162.092.282v.049h-.837q-.06-.126-.092-.316a3 3 0 0 1-.029-.386m.11-1.193.006.468h-.463a1 1 0 0 0-.285.038.5.5 0 0 0-.199.106.4.4 0 0 0-.115.156.5.5 0 0 0-.034.195q0 .106.049.193.049.083.14.132a.5.5 0 0 0 .216.046.7.7 0 0 0 .325-.075.6.6 0 0 0 .213-.184.4.4 0 0 0 .08-.207l.22.351q-.047.118-.127.245a1.022 1.022 0 0 1-.489.42 1.1 1.1 0 0 1-.403.069q-.296 0-.538-.118a1 1 0 0 1-.38-.331.87.87 0 0 1-.138-.483q0-.245.093-.435a.85.85 0 0 1 .27-.319q.18-.132.451-.198.27-.069.627-.069zm2.192-.538v2.433h-.829v-3.112h.78zm.937-.699-.014.768a2 2 0 0 0-.147-.015 2 2 0 0 0-.152-.008.9.9 0 0 0-.305.046.55.55 0 0 0-.213.129.6.6 0 0 0-.127.21 1 1 0 0 0-.046.282l-.166-.052q0-.302.06-.555.06-.255.175-.446a.9.9 0 0 1 .288-.293.73.73 0 0 1 .388-.104q.069 0 .141.012a.5.5 0 0 1 .118.026m1.766 3.19q-.362 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.305-.481 1.6 1.6 0 0 1-.106-.587v-.115q0-.353.1-.647a1.5 1.5 0 0 1 .288-.509q.19-.216.46-.331.27-.118.61-.118.33 0 .587.11t.429.31q.175.202.264.484.09.279.09.621v.345h-2.474v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.11.305 2 2 0 0 0-.034.379v.115q0 .187.052.346a.9.9 0 0 0 .152.273.7.7 0 0 0 .242.178.8.8 0 0 0 .325.063q.225 0 .417-.086a.9.9 0 0 0 .337-.267l.402.437a1.2 1.2 0 0 1-.267.27 1.4 1.4 0 0 1-.403.213 1.7 1.7 0 0 1-.538.081m4.74-3.17v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .11.1.6.6 0 0 0 .18.026q.078 0 .139-.006.063-.008.106-.017l.003.61a1.638 1.638 0 0 1-.503.075q-.274 0-.478-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm2.643-.538v4.418h-.828v-4.418zm-.118 2.753h-.227q.002-.325.087-.599.083-.276.238-.477.156-.205.371-.316a1.04 1.04 0 0 1 .483-.113q.231 0 .417.067a.8.8 0 0 1 .326.207.9.9 0 0 1 .212.371q.075.23.075.558v1.967h-.834v-1.973a.7.7 0 0 0-.06-.325.33.33 0 0 0-.17-.17.6.6 0 0 0-.27-.052.65.65 0 0 0-.305.067.5.5 0 0 0-.199.184.8.8 0 0 0-.11.27 1.5 1.5 0 0 0-.034.334m4.044 1.723q-.362 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.304-.481 1.6 1.6 0 0 1-.107-.587v-.115q0-.353.1-.647a1.5 1.5 0 0 1 .288-.509q.19-.216.46-.331a1.5 1.5 0 0 1 .61-.118q.332 0 .587.11.256.11.429.31.175.202.264.484.09.279.09.621v.345h-2.474v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.11.305 2 2 0 0 0-.034.379v.115q0 .187.052.346a.9.9 0 0 0 .153.273.7.7 0 0 0 .241.178.8.8 0 0 0 .325.063 1 1 0 0 0 .417-.086.9.9 0 0 0 .337-.267l.403.437a1.2 1.2 0 0 1-.268.27 1.4 1.4 0 0 1-.403.213 1.7 1.7 0 0 1-.538.081m4.045-2.572v3.711h-.829v-4.309h.768zm1.97.923v.061q0 .339-.08.63a1.6 1.6 0 0 1-.23.506 1.1 1.1 0 0 1-.38.334q-.225.118-.518.118-.285 0-.495-.115a1.04 1.04 0 0 1-.354-.323 1.9 1.9 0 0 1-.227-.486 4 4 0 0 1-.132-.592v-.158q.046-.34.132-.622.087-.284.227-.492.144-.209.351-.325.21-.114.492-.115.297 0 .52.113.228.111.38.322.155.21.233.5.08.291.08.644m-.831.061v-.061q0-.198-.035-.365a1 1 0 0 0-.104-.296.51.51 0 0 0-.457-.268.7.7 0 0 0-.29.055.5.5 0 0 0-.193.158.7.7 0 0 0-.112.248q-.037.144-.046.325v.399q.015.213.08.383a.6.6 0 0 0 .204.265.6.6 0 0 0 .363.097.5.5 0 0 0 .276-.071.55.55 0 0 0 .181-.205 1 1 0 0 0 .1-.299q.033-.17.033-.365m1.213.006v-.061q0-.342.098-.63.097-.29.285-.503a1.3 1.3 0 0 1 .46-.331q.273-.12.627-.121.354 0 .63.121.276.118.463.331.19.213.288.503.098.288.098.63v.061q0 .339-.098.63a1.5 1.5 0 0 1-.288.503 1.3 1.3 0 0 1-.46.331 1.6 1.6 0 0 1-.627.118q-.354 0-.63-.118a1.3 1.3 0 0 1-.463-.331 1.5 1.5 0 0 1-.285-.503 2 2 0 0 1-.098-.63m.829-.061v.061q0 .195.034.365.035.17.11.299a.6.6 0 0 0 .2.199.6.6 0 0 0 .303.071.6.6 0 0 0 .296-.071.55.55 0 0 0 .199-.199 1 1 0 0 0 .109-.299 1.7 1.7 0 0 0 .037-.365v-.061a1.6 1.6 0 0 0-.037-.356 1 1 0 0 0-.112-.3.56.56 0 0 0-.199-.207.6.6 0 0 0-.299-.074.6.6 0 0 0-.299.074.6.6 0 0 0-.198.207 1 1 0 0 0-.11.3q-.034.167-.034.356m4.153-1.527v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .109.1.6.6 0 0 0 .181.026q.078 0 .138-.006.063-.008.107-.017l.002.61q-.105.035-.23.054a1.6 1.6 0 0 1-.273.021q-.273 0-.477-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm3.267 3.938q-.362 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.305-.481 1.6 1.6 0 0 1-.106-.587v-.115q0-.353.1-.647a1.5 1.5 0 0 1 .288-.509q.19-.216.46-.331.27-.118.61-.118.33 0 .587.11t.428.31q.177.202.265.484.09.279.09.621v.345H83.73v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.11.305 2 2 0 0 0-.034.379v.115q0 .187.052.346a.9.9 0 0 0 .152.273.7.7 0 0 0 .242.178.8.8 0 0 0 .325.063q.225 0 .417-.086a.9.9 0 0 0 .337-.267l.402.437a1.2 1.2 0 0 1-.267.27 1.4 1.4 0 0 1-.403.213 1.7 1.7 0 0 1-.538.081m2.56-2.506v2.448h-.828v-3.112h.776zm-.12.783h-.225q0-.345.09-.622.088-.279.25-.474.16-.198.382-.302.225-.107.5-.107.22 0 .4.064.182.063.31.201a.9.9 0 0 1 .202.365q.072.228.072.555v1.985h-.834v-1.987a.74.74 0 0 0-.058-.323.33.33 0 0 0-.17-.161.7.7 0 0 0-.27-.049.6.6 0 0 0-.29.067.6.6 0 0 0-.201.184.9.9 0 0 0-.118.27q-.04.156-.04.334m4.135-1.447v.587H89.69v-.587zm-1.363-.768h.828v2.942q0 .136.035.208a.2.2 0 0 0 .11.1.6.6 0 0 0 .18.026q.078 0 .138-.006.064-.008.107-.017l.003.61q-.107.035-.23.054a1.6 1.6 0 0 1-.273.021q-.274 0-.478-.09a.66.66 0 0 1-.31-.293 1.1 1.1 0 0 1-.11-.529zm2.71.768v3.112h-.832v-3.112zm-.883-.811a.4.4 0 0 1 .126-.299.48.48 0 0 1 .34-.118q.21 0 .336.118.13.117.13.299 0 .181-.13.299a.47.47 0 0 1-.337.118.48.48 0 0 1-.339-.118.4.4 0 0 1-.126-.299m3.247 3.221v-1.386q0-.15-.049-.256a.36.36 0 0 0-.153-.17.5.5 0 0 0-.261-.06.54.54 0 0 0-.239.049.34.34 0 0 0-.155.135.37.37 0 0 0-.055.204h-.828q0-.198.092-.377a.9.9 0 0 1 .267-.313q.175-.138.417-.216.245-.078.547-.078.362 0 .644.121a1 1 0 0 1 .443.363q.164.241.164.604v1.331q0 .257.032.42.03.162.092.282v.049h-.837a1.2 1.2 0 0 1-.092-.316 3 3 0 0 1-.03-.386m.11-1.193.005.468h-.463a1 1 0 0 0-.285.038.5.5 0 0 0-.198.106.4.4 0 0 0-.115.156.5.5 0 0 0-.035.195q0 .106.049.193.049.083.14.132a.5.5 0 0 0 .217.046.7.7 0 0 0 .325-.075.6.6 0 0 0 .213-.184.4.4 0 0 0 .08-.207l.219.351q-.046.118-.127.245a1.025 1.025 0 0 1-.489.42 1.1 1.1 0 0 1-.403.069q-.295 0-.538-.118a1 1 0 0 1-.38-.331.87.87 0 0 1-.137-.483q0-.245.092-.435a.85.85 0 0 1 .27-.319 1.3 1.3 0 0 1 .452-.198q.27-.069.627-.069zm2.237-2.523v4.418h-.831v-4.418zm3.834 3.558a.27.27 0 0 0-.052-.161.45.45 0 0 0-.192-.132 2 2 0 0 0-.4-.115 3 3 0 0 1-.44-.13 1.5 1.5 0 0 1-.351-.193.739.739 0 0 1-.313-.618q0-.195.083-.368a.95.95 0 0 1 .244-.305q.162-.135.391-.21.234-.078.524-.078.405 0 .696.13.293.129.449.357.158.224.158.511h-.829a.45.45 0 0 0-.051-.215.35.35 0 0 0-.156-.153.56.56 0 0 0-.27-.057.54.54 0 0 0-.239.049.36.36 0 0 0-.155.126.3.3 0 0 0-.023.302q.032.055.101.101a1 1 0 0 0 .178.086q.112.037.276.069.337.07.601.181.266.11.42.3.155.186.155.491 0 .207-.092.38a.9.9 0 0 1-.264.302 1.4 1.4 0 0 1-.414.199q-.24.069-.538.069-.434 0-.737-.156-.299-.155-.454-.394a.9.9 0 0 1-.153-.494h.786a.46.46 0 0 0 .086.273.47.47 0 0 0 .21.149.8.8 0 0 0 .279.046.7.7 0 0 0 .267-.043.37.37 0 0 0 .161-.121.3.3 0 0 0 .058-.178m2.776.918q-.363 0-.65-.115a1.4 1.4 0 0 1-.489-.325 1.5 1.5 0 0 1-.305-.481 1.6 1.6 0 0 1-.107-.587v-.115q0-.353.101-.647.1-.293.288-.509.19-.216.46-.331.27-.118.61-.118.33 0 .586.11t.429.31q.175.202.265.484.089.279.089.621v.345h-2.474v-.552h1.66v-.064a.7.7 0 0 0-.064-.307.5.5 0 0 0-.184-.219.57.57 0 0 0-.316-.08.54.54 0 0 0-.282.071.56.56 0 0 0-.193.202 1.1 1.1 0 0 0-.109.305 2 2 0 0 0-.034.379v.115q0 .187.051.346a.9.9 0 0 0 .153.273.7.7 0 0 0 .241.178.8.8 0 0 0 .325.063q.225 0 .417-.086a.9.9 0 0 0 .337-.267l.403.437a1.417 1.417 0 0 1-.67.483 1.7 1.7 0 0 1-.538.081m3.034-.648a.6.6 0 0 0 .271-.057.46.46 0 0 0 .255-.423h.78q-.003.328-.175.584-.173.253-.464.4a1.44 1.44 0 0 1-.65.144q-.362 0-.632-.121a1.2 1.2 0 0 1-.446-.334 1.5 1.5 0 0 1-.268-.5 2.1 2.1 0 0 1-.089-.616v-.083q0-.331.089-.616.09-.288.268-.5.178-.216.446-.337.267-.12.627-.121.382 0 .67.147.29.147.454.42.167.27.17.641h-.78a.6.6 0 0 0-.066-.281.497.497 0 0 0-.463-.279.5.5 0 0 0-.296.077.5.5 0 0 0-.178.207 1 1 0 0 0-.089.297 2.4 2.4 0 0 0-.024.345v.083q0 .182.024.348.023.167.086.296a.5.5 0 0 0 .181.205q.115.075.299.074m3.627-.155v-2.367h.829v3.112h-.78zm.092-.638.245-.006q0 .31-.072.578-.072.264-.216.46a1 1 0 0 1-.362.302 1.2 1.2 0 0 1-.515.107q-.228 0-.42-.064a.85.85 0 0 1-.328-.204 1 1 0 0 1-.213-.359 1.7 1.7 0 0 1-.075-.533v-2.01h.829v2.016q0 .138.031.233a.4.4 0 0 0 .095.156q.06.06.141.086a.6.6 0 0 0 .184.026.7.7 0 0 0 .403-.104q.15-.103.21-.282a1.2 1.2 0 0 0 .063-.402m2.198-1.05v2.433h-.829v-3.112h.78zm.937-.699-.014.768a2 2 0 0 0-.147-.015 2 2 0 0 0-.152-.008.9.9 0 0 0-.305.046.6.6 0 0 0-.213.129.56.56 0 0 0-.126.21 1 1 0 0 0-.046.282l-.167-.052q0-.302.06-.555.06-.255.176-.446a.9.9 0 0 1 .287-.293.73.73 0 0 1 .388-.104q.069 0 .141.012a.5.5 0 0 1 .118.026m1.266.02v3.112h-.831v-3.112zm-.883-.811a.4.4 0 0 1 .126-.299.48.48 0 0 1 .34-.118.47.47 0 0 1 .336.118q.13.117.13.299 0 .181-.13.299a.47.47 0 0 1-.336.118.48.48 0 0 1-.34-.118.4.4 0 0 1-.126-.299m3.092.811v.587h-1.812v-.587zm-1.363-.768h.828v2.942q0 .136.034.208a.2.2 0 0 0 .11.1.6.6 0 0 0 .181.026q.078 0 .138-.006.064-.008.106-.017l.003.61a1.629 1.629 0 0 1-.503.075q-.273 0-.478-.09a.66.66 0 0 1-.31-.293q-.11-.201-.109-.529zm2.758 3.529.825-2.761h.889l-1.251 3.581a2 2 0 0 1-.109.253 1 1 0 0 1-.182.256.8.8 0 0 1-.284.201 1 1 0 0 1-.417.078q-.118 0-.193-.014a3 3 0 0 1-.178-.041v-.607h.066l.066.003a.8.8 0 0 0 .267-.037.37.37 0 0 0 .167-.115.6.6 0 0 0 .101-.196zm-.345-2.761.676 2.255.118.877-.564.061-1.119-3.193zm4.685.679v2.433h-.828v-3.112h.779zm.938-.699-.014.768a2 2 0 0 0-.147-.015 2 2 0 0 0-.153-.008.9.9 0 0 0-.304.046.54.54 0 0 0-.213.129.6.6 0 0 0-.127.21 1 1 0 0 0-.046.282l-.167-.052q0-.302.061-.555.06-.255.175-.446a.9.9 0 0 1 .288-.293.73.73 0 0 1 .388-.104q.069 0 .141.012a.5.5 0 0 1 .118.026m1.265.02v3.112h-.831v-3.112zm-.883-.811q0-.182.127-.299a.48.48 0 0 1 .339-.118q.21 0 .337.118a.39.39 0 0 1 .129.299q0 .181-.129.299a.47.47 0 0 1-.337.118.48.48 0 0 1-.339-.118.4.4 0 0 1-.127-.299m3.251 3.063a.27.27 0 0 0-.052-.161.46.46 0 0 0-.193-.132 2 2 0 0 0-.4-.115 3 3 0 0 1-.44-.13 1.5 1.5 0 0 1-.351-.193.8.8 0 0 1-.23-.264.75.75 0 0 1-.083-.354.84.84 0 0 1 .328-.673q.161-.135.391-.21.233-.078.523-.078.406 0 .697.13.293.129.448.357a.86.86 0 0 1 .158.511h-.828a.44.44 0 0 0-.052-.215.34.34 0 0 0-.155-.153.56.56 0 0 0-.27-.057.54.54 0 0 0-.239.049.36.36 0 0 0-.155.126.3.3 0 0 0-.052.173q0 .072.029.129.031.055.1.101a1 1 0 0 0 .179.086q.111.037.276.069.336.07.601.181t.42.3a.74.74 0 0 1 .155.491.8.8 0 0 1-.092.38.9.9 0 0 1-.265.302 1.4 1.4 0 0 1-.414.199 2 2 0 0 1-.538.069q-.434 0-.736-.156a1.16 1.16 0 0 1-.454-.394.9.9 0 0 1-.153-.494h.785a.46.46 0 0 0 .087.273.46.46 0 0 0 .21.149.8.8 0 0 0 .279.046.7.7 0 0 0 .267-.043.37.37 0 0 0 .161-.121.3.3 0 0 0 .058-.178m2.171-3.561v4.421h-.828v-4.421zm1.962 1.309-1.352 1.542-.725.733-.302-.598.575-.731.809-.946zm-.86 3.112-.921-1.438.573-.501 1.303 1.939zm2.899-.86a.27.27 0 0 0-.052-.161.44.44 0 0 0-.192-.132 2 2 0 0 0-.4-.115 3 3 0 0 1-.44-.13 1.5 1.5 0 0 1-.351-.193.735.735 0 0 1-.314-.618.8.8 0 0 1 .084-.368.95.95 0 0 1 .244-.305q.162-.135.391-.21.233-.078.524-.078.405 0 .696.13.293.129.449.357.158.224.158.511h-.828a.45.45 0 0 0-.052-.215.35.35 0 0 0-.156-.153.56.56 0 0 0-.27-.057.54.54 0 0 0-.239.049.36.36 0 0 0-.155.126.31.31 0 0 0-.023.302q.032.055.101.101a1 1 0 0 0 .178.086q.112.037.276.069.337.07.601.181.266.11.42.3a.74.74 0 0 1 .156.491.8.8 0 0 1-.092.38.9.9 0 0 1-.265.302 1.4 1.4 0 0 1-.414.199 2 2 0 0 1-.538.069q-.435 0-.736-.156a1.17 1.17 0 0 1-.455-.394.9.9 0 0 1-.152-.494h.785a.46.46 0 0 0 .086.273.47.47 0 0 0 .21.149.8.8 0 0 0 .279.046.7.7 0 0 0 .268-.043.4.4 0 0 0 .161-.121.3.3 0 0 0 .057-.178m2.756-.42h-.734a2.5 2.5 0 0 1 .041-.446q.039-.189.135-.342.097-.153.259-.302.135-.121.235-.23a1 1 0 0 0 .159-.224.6.6 0 0 0 .057-.262.64.64 0 0 0-.052-.276.35.35 0 0 0-.149-.17.5.5 0 0 0-.248-.058.5.5 0 0 0-.23.055.43.43 0 0 0-.175.161.6.6 0 0 0-.069.288h-.834q.008-.395.181-.65.175-.259.469-.383a1.65 1.65 0 0 1 .658-.126q.403 0 .691.132a.96.96 0 0 1 .44.383q.152.25.152.609a1 1 0 0 1-.098.446q-.097.193-.256.36a8 8 0 0 1-.348.345.8.8 0 0 0-.224.308 1.2 1.2 0 0 0-.06.382m-.82.889q0-.184.127-.305a.47.47 0 0 1 .339-.124.46.46 0 0 1 .336.124q.13.121.13.305a.4.4 0 0 1-.13.302.46.46 0 0 1-.336.124.47.47 0 0 1-.339-.124.4.4 0 0 1-.127-.302"/><g class="tw-fill-secondary-700" clip-path="url(#h)"><path d="M141.027 174.75c0-.291.235-.526.526-.526h1.472a.315.315 0 1 0 0-.631h-1.472c-.639 0-1.157.518-1.157 1.157v3.576c0 .639.518 1.157 1.157 1.157h3.576c.639 0 1.157-.518 1.157-1.157v-1.472a.315.315 0 1 0-.631 0v1.472a.525.525 0 0 1-.526.526h-3.576a.525.525 0 0 1-.526-.526z"/><path d="M144.498 173.593a.316.316 0 1 0 0 .631h.711l-1.776 1.775a.317.317 0 0 0 .447.447l1.775-1.776v.711a.316.316 0 0 0 .631 0v-1.473a.315.315 0 0 0-.315-.315z"/></g></g><path class="tw-stroke-secondary-100" stroke-width=".421" d="M30.939 63.596h124.123c5.461 0 9.888 4.428 9.888 9.889v106.031c0 5.461-4.427 9.887-9.888 9.887H30.939c-5.461 0-9.89-4.426-9.89-9.887V73.485c0-5.461 4.429-9.89 9.89-9.89Z"/></g></g><defs><clipPath id="b"><path class="tw-fill-background" d="M155.801 8.317h11.438v11.438h-11.438z"/></clipPath><clipPath id="c"><rect width="154" height="205" x="16" y="24" class="tw-fill-background" rx="4.918"/></clipPath><clipPath id="d"><path class="tw-fill-background" d="M21.874 57.75h143.253v14.345H21.874z"/></clipPath><clipPath id="e"><rect width="154" height="205" x="16" y="24" class="tw-fill-background" rx="4.918"/></clipPath><clipPath id="g"><path class="tw-fill-background" d="M20.84 73.484c0-5.577 4.521-10.098 10.098-10.098h124.125c5.577 0 10.098 4.521 10.098 10.098v106.032c0 5.577-4.521 10.098-10.098 10.098H30.938c-5.577 0-10.098-4.521-10.098-10.098z"/></clipPath><clipPath id="h"><path class="tw-fill-background" d="M139.976 173.172h6.732v6.732h-6.732z"/></clipPath><filter id="a" width="184.857" height="228.234" x="6.26" y="1.883" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset/><feGaussianBlur stdDeviation=".558"/><feColorMatrix values="0 0 0 0 0.4 0 0 0 0 0.4 0 0 0 0 0.5 0 0 0 0.35 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_6463_20789"/><feBlend in="SourceGraphic" in2="effect1_dropShadow_6463_20789" result="shape"/></filter><filter id="f" width="161.152" height="143.059" x="12.425" y="63.386" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feMorphology in="SourceAlpha" radius="2.104" result="effect1_dropShadow_6463_20789"/><feOffset dy="8.415"/><feGaussianBlur stdDeviation="5.26"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend in2="BackgroundImageFix" result="effect1_dropShadow_6463_20789"/><feColorMatrix in="SourceAlpha" result="hardAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feMorphology in="SourceAlpha" radius="2.525" result="effect2_dropShadow_6463_20789"/><feOffset dy="3.366"/><feGaussianBlur stdDeviation="2.104"/><feComposite in2="hardAlpha" operator="out"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend in2="effect1_dropShadow_6463_20789" result="effect2_dropShadow_6463_20789"/><feBlend in="SourceGraphic" in2="effect2_dropShadow_6463_20789" result="shape"/></filter></defs></svg>
`;var st=i(12610),ot=i(36359),at=i(27442),lt=i(28202),ct=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const dt=["step0"],ut=["step1"],ht=["step0Title"],pt=["step1Title"];function mt(e,t){if(1&e&&v.eu8(0,8),2&e){v.XpG();const e=v.r8f(3);v.Y8G("ngTemplateOutlet",e)}}function vt(e,t){1&e&&(v.j41(0,"div"),v.nrm(1,"i",13),v.nI1(2,"i18n"),v.j41(3,"span",14),v.EFF(4),v.nI1(5,"i18n"),v.k0s()()),2&e&&(v.R7$(),v.Y8G("title",v.mNQ(v.bMT(2,3,"loading"))),v.R7$(3),v.JRh(v.bMT(5,5,"loading")))}function ft(e,t){if(1&e&&(v.j41(0,"p",11),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e){const e=v.XpG();v.R7$(),v.JRh(v.bMT(2,1,e.policy.description))}}function gt(e,t){}function yt(e,t){if(1&e&&v.eu8(0,8),2&e){v.XpG();const e=v.r8f(13);v.Y8G("ngTemplateOutlet",e)}}function bt(e,t){1&e&&(v.j41(0,"span",16),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,1,"availableNow")))}function wt(e,t){if(1&e&&(v.j41(0,"span",17),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e){const e=v.XpG(2);v.R7$(),v.SpI(" ",v.bMT(2,1,e.policy.name)," ")}}function St(e,t){if(1&e&&(v.j41(0,"div",15),v.nVh(1,bt,3,3,"span",16),v.j41(2,"span"),v.EFF(3),v.nI1(4,"i18n"),v.nVh(5,wt,3,3,"span",17),v.k0s()()),2&e){const e=v.XpG().firstTimeDialog();v.R7$(),v.vxM(e?1:-1),v.R7$(2),v.SpI(" ",v.bMT(4,3,e?"autoConfirm":"editPolicy")," "),v.R7$(2),v.vxM(e?-1:5)}}function It(e,t){1&e&&(v.EFF(0),v.nI1(1,"i18n")),2&e&&v.SpI(" ",v.bMT(1,1,"howToTurnOnAutoConfirm"),"\n")}function kt(e,t){1&e&&(v.EFF(0),v.nI1(1,"i18n")),2&e&&v.SpI(" ",v.bMT(1,1,"save")," ")}function Ct(e,t){1&e&&(v.EFF(0),v.nI1(1,"i18n")),2&e&&v.SpI(" ",v.bMT(1,1,"continue")," ")}function Tt(e,t){if(1&e&&(v.j41(0,"button",18),v.nI1(1,"async"),v.SS7(2),v.nI1(3,"async"),v.SS7(4),v.nI1(5,"async"),v.nVh(6,kt,2,3)(7,Ct,2,3),v.k0s(),v.j41(8,"button",19),v.EFF(9),v.nI1(10,"i18n"),v.k0s()),2&e){const e=v.XpG();v.Y8G("disabled",v.bMT(1,3,e.saveDisabled$));const t=v.bMT(3,5,e.autoConfirmEnabled$),i=v.bMT(5,7,e.managePoliciesOnly$);v.R7$(6),v.vxM(t||i?6:7),v.R7$(3),v.SpI(" ",v.bMT(10,9,"cancel")," ")}}function Ft(e,t){if(1&e&&(v.j41(0,"button",18),v.nI1(1,"async"),v.EFF(2),v.nI1(3,"i18n"),v.nrm(4,"i",20),v.k0s(),v.j41(5,"button",19),v.EFF(6),v.nI1(7,"i18n"),v.k0s()),2&e){const e=v.XpG();v.Y8G("disabled",v.bMT(1,3,e.saveDisabled$)),v.R7$(2),v.SpI(" ",v.bMT(3,5,"openExtension")," "),v.R7$(4),v.SpI(" ",v.bMT(7,7,"close")," ")}}class Rt extends ne{constructor(e,t,i,n,s,l,c,h,p,m,v,g,b,w){var S;super(e,t,i,n,s,l,c,h,p,m),this.data=e,this.organizationService=v,this.policyService=g,this.router=b,this.autoConfirmService=w,this.policyType=y.tt,this.firstTimeDialog=(0,oe.vPA)(!1),this.currentStep=(0,oe.vPA)(0),this.multiStepSubmit=(0,a.of)([]),this.autoConfirmEnabled$=this.accountService.activeAccount$.pipe(d.F6,(0,o.n)(e=>this.policyService.policies$(e)),(0,r.T)(e=>{var t,i;return null!==(i=null===(t=e.find(e=>e.type===y.tt.AutoConfirm))||void 0===t?void 0:t.enabled)&&void 0!==i&&i})),this.managePoliciesOnly$=this.accountService.activeAccount$.pipe(d.F6,(0,o.n)(e=>this.organizationService.organizations$(e)),(0,u.Hc)(this.data.organizationId),(0,r.T)(e=>{var t;return null!==(t=!(null==e?void 0:e.isAdmin)&&(null==e?void 0:e.canManagePolicies))&&void 0!==t&&t})),this.submitPolicy=(0,z.ebz)("step0"),this.openExtension=(0,z.ebz)("step1"),this.submitPolicyTitle=(0,z.ebz)("step0Title"),this.openExtensionTitle=(0,z.ebz)("step1Title"),this.submit=()=>ct(this,void 0,void 0,function*(){if(!this.policyComponent)throw new Error("PolicyComponent not initialized.");if(0!=(yield this.policyComponent.confirm()))try{const e=yield(0,f._)(this.multiStepSubmit);if(yield e[this.currentStep()].sideEffect(),this.currentStep()===e.length-1)return void this.dialogRef.close("saved");this.currentStep.update(e=>e+1),this.policyComponent.setStep(this.currentStep())}catch(e){this.toastService.showToast({variant:"error",message:e.message})}else this.dialogRef.close()}),this.firstTimeDialog.set(null!==(S=e.firstTimeDialog)&&void 0!==S&&S)}ngAfterViewInit(){const e=Object.create(null,{ngAfterViewInit:{get:()=>super.ngAfterViewInit}});return ct(this,void 0,void 0,function*(){yield e.ngAfterViewInit.call(this),this.policyComponent&&(this.saveDisabled$=(0,s.z)([this.autoConfirmEnabled$,this.policyComponent.enabled.valueChanges.pipe((0,st.Z)(this.policyComponent.enabled.value))]).pipe((0,r.T)(([e,t])=>!e&&!t))),this.multiStepSubmit=this.accountService.activeAccount$.pipe(d.F6,(0,o.n)(e=>this.policyService.policies$(e)),(0,r.T)(e=>{var t,i;return null!==(i=null===(t=e.find(e=>e.type===y.tt.SingleOrg))||void 0===t?void 0:t.enabled)&&void 0!==i&&i}),(0,ot.M)(e=>{var t;return null===(t=this.policyComponent)||void 0===t?void 0:t.setSingleOrgEnabled(e)}),(0,o.n)(e=>this.buildMultiStepSubmit(e)),(0,at.t)({bufferSize:1,refCount:!0}))})}buildMultiStepSubmit(e){return this.managePoliciesOnly$.pipe((0,r.T)(t=>{const i=[{sideEffect:()=>this.handleSubmit(null!=e&&e),footerContent:this.submitPolicy,titleContent:this.submitPolicyTitle}];return t||i.push({sideEffect:()=>this.openBrowserExtension(),footerContent:this.openExtension,titleContent:this.openExtensionTitle}),i}))}handleSubmit(e){return ct(this,void 0,void 0,function*(){e||(yield this.submitSingleOrg()),yield this.submitAutoConfirm()})}submitAutoConfirm(){return ct(this,void 0,void 0,function*(){if(!this.policyComponent)throw new Error("PolicyComponent not initialized.");const e=yield this.policyComponent.buildRequest();yield this.policyApiService.putPolicy(this.data.organizationId,this.data.policy.type,e);const t=yield(0,f._)(this.accountService.activeAccount$.pipe(d.F6)),i=yield(0,f._)(this.autoConfirmService.configuration$(t));yield this.autoConfirmService.upsert(t,Object.assign(Object.assign({},i),{showSetupDialog:!1})),this.toastService.showToast({variant:"success",message:this.i18nService.t("editedPolicyId",this.i18nService.t(this.data.policy.name))}),this.policyComponent.enabled.value||this.dialogRef.close("saved")})}submitSingleOrg(){return ct(this,void 0,void 0,function*(){yield this.policyApiService.putPolicy(this.data.organizationId,y.tt.SingleOrg,{enabled:!0,data:null})})}openBrowserExtension(){return ct(this,void 0,void 0,function*(){yield this.router.navigate(["/browser-extension-prompt"],{queryParams:{url:"AutoConfirm"}})})}}Rt.open=(e,t)=>e.open(Rt,t),Rt.ɵfac=function(e){return new(e||Rt)(v.rXU(S.Qs),v.rXU(L.Di),v.rXU(K.m),v.rXU(P.W),v.rXU(z.gRc),v.rXU(T.ok),v.rXU(C.ce),v.rXU(q.f),v.rXU(_.w),v.rXU(I.Lu),v.rXU(c.PV),v.rXU(le.m),v.rXU(ae.Ix),v.rXU(lt.zh))},Rt.ɵcmp=v.VBU({type:Rt,selectors:[["ng-component"]],viewQuery:function(e,t){1&e&&(v.wEZ(t.submitPolicy,dt,5),v.wEZ(t.openExtension,ut,5),v.wEZ(t.submitPolicyTitle,ht,5),v.wEZ(t.openExtensionTitle,pt,5)),2&e&&v.NyB(4)},features:[v.Vt3],decls:24,vars:14,consts:[["policyForm",""],["step0Title",""],["step1Title",""],["step0",""],["step1",""],[3,"formGroup","bitSubmit"],[3,"loading"],["bitDialogTitle",""],[3,"ngTemplateOutlet"],["bitDialogContent",""],[3,"hidden"],["bitTypography","body1"],["bitDialogFooter",""],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-flex","tw-flex-col"],["bitBadge","","variant","info",1,"tw-w-[99px]","tw-my-2"],[1,"tw-text-muted","tw-font-normal","tw-text-sm"],["bitButton","","buttonType","primary","bitFormButton","","type","submit",3,"disabled"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-1"]],template:function(e,t){if(1&e&&(v.j41(0,"form",5)(1,"bit-dialog",6),v.qex(2,7),v.SS7(3),v.nI1(4,"async"),v.nVh(5,mt,1,1,"ng-container",8),v.bVm(),v.qex(6,9),v.nVh(7,vt,6,7,"div"),v.j41(8,"div",10),v.nVh(9,ft,3,3,"p",11),v.k0s(),v.DNE(10,gt,0,0,"ng-template",null,0,v.C5r),v.bVm(),v.qex(12,12),v.SS7(13),v.nI1(14,"async"),v.nVh(15,yt,1,1,"ng-container",8),v.bVm(),v.k0s()(),v.DNE(16,St,6,5,"ng-template",null,1,v.C5r)(18,It,2,3,"ng-template",null,2,v.C5r)(20,Tt,11,11,"ng-template",null,3,v.C5r)(22,Ft,8,9,"ng-template",null,4,v.C5r)),2&e){let e,i;v.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),v.R7$(),v.Y8G("loading",t.loading),v.R7$(2);const n=v.bH3(null==(e=v.bMT(4,8,t.multiStepSubmit)[t.currentStep()])?null:e.titleContent());v.R7$(2),v.vxM(n?5:-1),v.R7$(2),v.vxM(t.loading?7:-1),v.R7$(),v.Y8G("hidden",t.loading),v.R7$(),v.vxM(t.policy.showDescription?9:-1),v.R7$(4);const r=v.bH3(null==(i=v.bMT(14,11,t.multiStepSubmit)[t.currentStep()])?null:i.footerContent());v.R7$(2),v.vxM(r?15:-1)}},dependencies:[m.G,X.T3,T.qT,T.cb,T.j4,Y.$,H.L,ce.n,$.Q,A.I,W.m,J.r,X.Jj,G.$],encapsulation:2});var Pt=i(58384);const xt=["step0"],$t=["step1"];function Et(e,t){1&e&&(v.j41(0,"span",5),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,1,"autoConfirmSingleOrgExemption")," "))}function At(e,t){1&e&&(v.j41(0,"span",5),v.EFF(1),v.nI1(2,"i18n"),v.k0s()),2&e&&(v.R7$(),v.SpI(" ",v.bMT(2,1,"autoConfirmSingleOrgRequired")," "))}function Dt(e,t){if(1&e&&(v.j41(0,"p",3),v.EFF(1),v.nI1(2,"i18n"),v.k0s(),v.j41(3,"ul",4)(4,"li")(5,"span",5),v.EFF(6),v.nI1(7,"i18n"),v.k0s(),v.EFF(8),v.nI1(9,"i18n"),v.j41(10,"a",6),v.EFF(11),v.nI1(12,"i18n"),v.nrm(13,"i",7),v.k0s()(),v.j41(14,"li"),v.nVh(15,Et,3,3,"span",5),v.nI1(16,"async"),v.vZN(17,At,3,3,"span",5),v.EFF(18),v.nI1(19,"i18n"),v.k0s(),v.j41(20,"li")(21,"span",5),v.EFF(22),v.nI1(23,"i18n"),v.k0s(),v.EFF(24),v.nI1(25,"i18n"),v.k0s()(),v.nrm(26,"input",8),v.j41(27,"bit-label"),v.EFF(28),v.nI1(29,"i18n"),v.k0s()),2&e){const e=v.XpG();v.R7$(),v.SpI(" ",v.bMT(2,10,"autoConfirmPolicyEditDescription")," "),v.R7$(5),v.SpI(" ",v.bMT(7,12,"autoConfirmAcceptSecurityRiskTitle")," "),v.R7$(2),v.SpI(" ",v.bMT(9,14,"autoConfirmAcceptSecurityRiskDescription")," "),v.R7$(3),v.SpI(" ",v.bMT(12,16,"autoConfirmAcceptSecurityRiskLearnMore")," "),v.R7$(4),v.vxM(v.bMT(16,18,e.singleOrgEnabled$)?15:17),v.R7$(3),v.SpI(" ",v.bMT(19,20,"autoConfirmSingleOrgRequiredDesc")," "),v.R7$(4),v.SpI(" ",v.bMT(23,22,"autoConfirmNoEmergencyAccess")," "),v.R7$(2),v.SpI(" ",v.bMT(25,24,"autoConfirmNoEmergencyAccessDescription")," "),v.R7$(2),v.Y8G("formControl",e.enabled),v.R7$(2),v.JRh(v.bMT(29,26,"autoConfirmCheckBoxLabel"))}}function Ot(e,t){if(1&e&&(v.j41(0,"div",9),v.nrm(1,"bit-icon",10),v.k0s(),v.j41(2,"ol")(3,"li"),v.EFF(4),v.nI1(5,"i18n"),v.k0s(),v.j41(6,"li"),v.EFF(7),v.nI1(8,"i18n"),v.j41(9,"strong"),v.EFF(10),v.nI1(11,"i18n"),v.k0s()()()),2&e){const e=v.XpG();v.R7$(),v.Y8G("icon",e.autoConfirmSvg),v.R7$(3),v.SpI("1. ",v.bMT(5,4,"autoConfirmExtension1")),v.R7$(3),v.SpI(" 2. ",v.bMT(8,6,"autoConfirmExtension2")," "),v.R7$(3),v.SpI(" ",v.bMT(11,8,"autoConfirmExtension3")," ")}}class Mt extends F{constructor(){super(...arguments),this.name="autoConfirm",this.description="autoConfirmDescription",this.type=y.tt.AutoConfirm,this.component=Ut,this.showDescription=!1,this.editDialogComponent=Rt}display$(e,t){return t.getFeatureFlag$(w.TO.AutoConfirm).pipe((0,r.T)(t=>t&&e.useAutomaticUserConfirmation))}}class Ut extends R{constructor(){super(...arguments),this.autoConfirmSvg=rt,this.policyForm=(0,z.ebz)("step0"),this.extensionButton=(0,z.ebz)("step1"),this.step=0,this.steps=[this.policyForm,this.extensionButton],this.singleOrgEnabled$=new Me.t(!1)}setSingleOrgEnabled(e){this.singleOrgEnabled$.next(e)}setStep(e){this.step=e}}Ut.ɵfac=(()=>{let e;return function(t){return(e||(e=v.xGo(Ut)))(t||Ut)}})(),Ut.ɵcmp=v.VBU({type:Ut,selectors:[["auto-confirm-policy-edit"]],viewQuery:function(e,t){1&e&&(v.wEZ(t.policyForm,xt,5),v.wEZ(t.extensionButton,$t,5)),2&e&&v.NyB(2)},features:[v.Vt3],decls:5,vars:1,consts:[["step0",""],["step1",""],[3,"ngTemplateOutlet"],[1,"tw-mb-6"],[1,"tw-mb-6","tw-pl-6"],[1,"tw-font-medium"],["bitLink","","href","https://bitwarden.com/help/automatic-confirmation/","target","_blank"],[1,"bwi","bwi-external-link","bwi-fw"],["type","checkbox","bitCheckbox","","id","enabled",3,"formControl"],[1,"tw-flex","tw-justify-center","tw-mb-6"],[1,"tw-w-[233px]",3,"icon"]],template:function(e,t){1&e&&(v.eu8(0,2),v.DNE(1,Dt,30,28,"ng-template",null,0,v.C5r)(3,Ot,12,10,"ng-template",null,1,v.C5r)),2&e&&v.Y8G("ngTemplateOutlet",t.steps[t.step]())},dependencies:[m.G,X.T3,T.Zm,T.BC,T.l_,E.P,M.j,Pt.i,U.L,X.Jj,G.$],encapsulation:2,changeDetection:0});const Gt=[new class extends F{constructor(){super(...arguments),this.name="twoStepLoginPolicyTitle",this.description="twoStepLoginPolicyDesc",this.type=y.tt.TwoFactorAuthentication,this.component=Qe}},new class extends F{constructor(){super(...arguments),this.name="masterPassPolicyTitle",this.description="masterPassPolicyDesc",this.type=y.tt.MasterPassword,this.component=De}},new class extends F{constructor(){super(...arguments),this.name="removeUnlockWithPinPolicyTitle",this.description="removeUnlockWithPinPolicyDesc",this.type=y.tt.RemoveUnlockWithPin,this.component=Ke}},new class extends F{constructor(){super(...arguments),this.name="accountRecoveryPolicy",this.description="accountRecoveryPolicyDesc",this.type=y.tt.ResetPassword,this.component=Ye}display$(e,t){return(0,a.of)(e.useResetPassword)}},new class extends F{constructor(){super(...arguments),this.name="passwordGenerator",this.description="passwordGeneratorPolicyDesc",this.type=y.tt.PasswordGenerator,this.component=Ve}},new class extends F{constructor(){super(...arguments),this.name="singleOrg",this.description="singleOrgPolicyDesc",this.type=y.tt.SingleOrg,this.component=Ze}},new class extends F{constructor(){super(...arguments),this.name="requireSso",this.description="requireSsoPolicyDesc",this.type=y.tt.RequireSso,this.component=qe}display$(e,t){return(0,a.of)(e.useSso)}},new class extends F{constructor(){super(...arguments),this.name="organizationDataOwnership",this.description="personalOwnershipPolicyDesc",this.type=y.tt.OrganizationDataOwnership,this.component=Oe}display$(e,t){return t.getFeatureFlag$(w.TO.CreateDefaultLocation).pipe((0,r.T)(e=>!e))}},new class extends F{constructor(){super(...arguments),this.name="organizationDataOwnership",this.description="organizationDataOwnershipDesc",this.type=y.tt.OrganizationDataOwnership,this.component=B,this.showDescription=!1}display$(e,t){return t.getFeatureFlag$(w.TO.CreateDefaultLocation)}},new class extends F{constructor(){super(...arguments),this.name="disableSend",this.description="disableSendPolicyDesc",this.type=y.tt.DisableSend,this.component=ke}},new class extends F{constructor(){super(...arguments),this.name="sendOptions",this.description="sendOptionsPolicyDesc",this.type=y.tt.SendOptions,this.component=We}},new class extends F{constructor(){super(...arguments),this.name="restrictedItemTypePolicy",this.description="restrictedItemTypePolicyDesc",this.type=y.tt.RestrictedItemTypes,this.component=He}},new class extends F{constructor(){super(...arguments),this.name="desktopAutotypePolicy",this.description="desktopAutotypePolicyDesc",this.type=y.tt.AutotypeDefaultSetting,this.component=Ce}display$(e,t){return t.getFeatureFlag$(w.TO.WindowsDesktopAutotype)}},new class extends F{constructor(){super(...arguments),this.name="uriMatchDetectionPolicy",this.description="uriMatchDetectionPolicyDesc",this.type=y.tt.UriMatchDefaults,this.component=nt}},new Mt]},54873:(e,t,i)=>{"use strict";i.d(t,{m:()=>n,t:()=>ae});var n,r=i(33812),s=i(51757),o=i(72245),a=i(58625),l=i(49355),c=(i(46217),i(68467)),d=i(78781),u=i(37579),h=i(47135),p=i(26411),m=i(22191),v=i(89479),f=i(29029),g=i(26477),y=i(71373),b=i(22848),w=i(89207),S=i(65113),I=i(91834),k=i(74208),C=i(72331),T=i(5556),F=i(69855),R=i(21274),P=i(50700),x=i(83541),$=i(37115),E=i(18499),A=i(2471),D=i(26657),O=i(45154),M=i(56898),U=i(50352),G=i(90246),j=i(86226),N=i(93199),V=i(97553),B=i(68466),z=i(43759),L=i(76356),K=i(69896),q=i(36288),_=i(54471),X=i(59032),Y=i(77468),H=i(25740),W=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function J(e,t){if(1&e&&r.nrm(0,"auth-password-callout",13),2&e){const e=r.XpG();r.Y8G("message",e.flow===e.InputPasswordFlow.ChangePasswordDelegation?"changePasswordDelegationMasterPasswordPolicyInEffect":"masterPasswordPolicyInEffect")("policy",e.masterPasswordPolicyOptions)}}function Z(e,t){if(1&e){const e=r.RV6();r.j41(0,"bit-form-field")(1,"bit-label"),r.EFF(2),r.nI1(3,"i18n"),r.k0s(),r.nrm(4,"input",14),r.j41(5,"button",8),r.mxI("toggledChange",function(t){k.eBV(e);const i=r.XpG();return r.DH7(i.showPassword,t)||(i.showPassword=t),k.Njj(t)}),r.k0s()()}if(2&e){const e=r.XpG();r.R7$(2),r.JRh(r.bMT(3,2,"currentMasterPass")),r.R7$(3),r.R50("toggled",e.showPassword)}}function Q(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",15),r.nI1(1,"i18n"),r.bIt("click",function(){k.eBV(e);const t=r.XpG();return k.Njj(t.generatePassword())}),r.k0s()}2&e&&r.Y8G("label",r.bMT(1,1,"generatePassword"))}function ee(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",16),r.nI1(1,"i18n"),r.bIt("click",function(){k.eBV(e);const t=r.XpG();return k.Njj(t.copy())}),r.k0s()}2&e&&r.Y8G("label",r.mNQ(r.bMT(1,2,"copyPassword")))}function te(e,t){if(1&e&&(r.j41(0,"bit-hint")(1,"span",17),r.EFF(2),r.nI1(3,"i18n"),r.k0s(),r.EFF(4),r.nI1(5,"i18n"),r.k0s()),2&e){const e=r.XpG();r.R7$(2),r.SpI("",r.bMT(3,3,"important")," "),r.R7$(2),r.Lme(" ",r.bMT(5,5,"masterPassImportant")," ",e.minPasswordLengthMsg,". ")}}function ie(e,t){if(1&e&&(r.qex(0),r.j41(1,"bit-form-field")(2,"bit-label"),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.nrm(5,"input",18),r.j41(6,"bit-hint"),r.EFF(7),r.nI1(8,"i18n"),r.k0s()(),r.j41(9,"bit-form-control"),r.nrm(10,"input",19),r.j41(11,"bit-label"),r.EFF(12),r.nI1(13,"i18n"),r.k0s()(),r.bVm()),2&e){const e=r.XpG();r.R7$(3),r.JRh(r.bMT(4,3,"masterPassHintLabel")),r.R7$(4),r.SpI(" ",r.brH(8,5,"masterPassHintText",e.formGroup.value.newPasswordHint.length.toString(),e.maxHintLength.toString())," "),r.R7$(5),r.JRh(r.bMT(13,9,"checkForBreaches"))}}function ne(e,t){if(1&e){const e=r.RV6();r.j41(0,"bit-form-control")(1,"input",20),r.bIt("change",function(){k.eBV(e);const t=r.XpG();return k.Njj(t.rotateUserKeyClicked())}),r.k0s(),r.j41(2,"bit-label"),r.EFF(3),r.nI1(4,"i18n"),r.j41(5,"a",21),r.nI1(6,"i18n"),r.nrm(7,"i",22),r.k0s()()()}2&e&&(r.R7$(3),r.SpI(" ",r.bMT(4,3,"rotateAccountEncKey")," "),r.R7$(2),r.Y8G("appA11yTitle",r.mNQ(r.bMT(6,5,"impactOfRotatingYourEncryptionKey"))))}function re(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",26),r.bIt("click",function(){k.eBV(e);const t=r.XpG(2);return k.Njj(t.onSecondaryButtonClick.emit())}),r.EFF(1),r.k0s()}if(2&e){const e=r.XpG(2);r.Y8G("loading",e.loading),r.R7$(),r.SpI(" ",e.secondaryButtonTextStr," ")}}function se(e,t){if(1&e&&(r.j41(0,"div",23)(1,"button",24),r.EFF(2),r.nI1(3,"i18n"),r.k0s(),r.DNE(4,re,2,2,"button",25),r.k0s()),2&e){const e=r.XpG();r.Y8G("ngClass",e.inlineButtons?"tw-flex-row":"tw-flex-col"),r.R7$(),r.Y8G("loading",e.loading),r.R7$(),r.SpI(" ",e.primaryButtonTextStr||r.bMT(3,4,"setMasterPassword")," "),r.R7$(2),r.Y8G("ngIf",e.secondaryButtonText)}}function oe(e,t){if(1&e&&r.nrm(0,"bit-error-summary",27),2&e){const e=r.XpG();r.Y8G("formGroup",e.formGroup)}}!function(e){e[e.SetInitialPasswordAccountRegistration=0]="SetInitialPasswordAccountRegistration",e[e.SetInitialPasswordAuthedUser=1]="SetInitialPasswordAuthedUser",e[e.ChangePassword=2]="ChangePassword",e[e.ChangePasswordWithOptionalUserKeyRotation=3]="ChangePasswordWithOptionalUserKeyRotation",e[e.ChangePasswordDelegation=4]="ChangePasswordDelegation"}(n||(n={}));class ae{get minPasswordLengthMsg(){return null!=this.masterPasswordPolicyOptions&&this.masterPasswordPolicyOptions.minLength>0?this.i18nService.t("characterMinimum",this.masterPasswordPolicyOptions.minLength):this.i18nService.t("characterMinimum",this.minPasswordLength)}constructor(e,t,i,a,l,u,h,p,m,v,f,g,y){this.auditService=e,this.cipherService=t,this.dialogService=i,this.formBuilder=a,this.i18nService=l,this.kdfConfigService=u,this.keyService=h,this.masterPasswordService=p,this.passwordGenerationService=m,this.platformUtilsService=v,this.policyService=f,this.toastService=g,this.validationService=y,this.passwordStrengthComponent=void 0,this.onPasswordFormSubmit=new r.bkB,this.onSecondaryButtonClick=new r.bkB,this.isSubmitting=new r.bkB,this.loading=!1,this.inlineButtons=!1,this.primaryButtonTextStr="",this.secondaryButtonTextStr="",this.InputPasswordFlow=n,this.kdfConfig=null,this.minHintLength=0,this.maxHintLength=50,this.minPasswordLength=d.A.minimumPasswordLength,this.minPasswordMsg="",this.passwordStrengthScore=0,this.showErrorSummary=!1,this.showPassword=!1,this.formGroup=this.formBuilder.nonNullable.group({newPassword:this.formBuilder.nonNullable.control("",[s.k0.required,s.k0.minLength(this.minPasswordLength)]),newPasswordConfirm:this.formBuilder.nonNullable.control("",s.k0.required)},{validators:[(0,I.R)(I.l.InputsShouldMatch,"newPassword","newPasswordConfirm",this.i18nService.t("masterPassDoesntMatch"))]}),this.submit=()=>W(this,void 0,void 0,function*(){var e,t,i,r,s,a,l;try{if(this.isSubmitting.emit(!0),this.verifyFlow(),this.formGroup.markAllAsTouched(),this.formGroup.invalid)return void(this.showErrorSummary=!0);const d=null!==(t=null===(e=this.formGroup.controls.currentPassword)||void 0===e?void 0:e.value)&&void 0!==t?t:"",u=this.formGroup.controls.newPassword.value,h=null!==(r=null===(i=this.formGroup.controls.newPasswordHint)||void 0===i?void 0:i.value)&&void 0!==r?r:"",p=null===(a=null===(s=this.formGroup.controls.checkForBreaches)||void 0===s?void 0:s.value)||void 0===a||a;if(this.flow===n.ChangePasswordDelegation)return yield this.handleChangePasswordDelegationFlow(u);if(!this.email)throw new Error("Email is required to create master key.");if(this.flow===n.SetInitialPasswordAccountRegistration)this.kdfConfig=b.fX;else{if(!this.userId)throw new Error("userId not passed down");this.kdfConfig=yield(0,o._)(this.kdfConfigService.getKdfConfig$(this.userId))}if(null==this.kdfConfig)throw new Error("KdfConfig is required to create master key.");const m=null!=this.userId?yield(0,o._)(this.masterPasswordService.saltForUser$(this.userId)):this.masterPasswordService.emailToSalt(this.email);if(null==m)throw new Error("Salt is required to create master key.");if(this.flow===n.ChangePassword||this.flow===n.ChangePasswordWithOptionalUserKeyRotation){if(!(yield this.verifyCurrentPassword(d,this.kdfConfig)))return}if(!(yield this.verifyNewPassword(u,this.passwordStrengthScore,p)))return;const v=yield this.keyService.makeMasterKey(u,this.email,this.kdfConfig),f=yield this.keyService.hashMasterKey(u,v,c.VK.ServerAuthorization),g={newPassword:u,salt:m,newMasterKey:v,newServerMasterKeyHash:f,newLocalMasterKeyHash:yield this.keyService.hashMasterKey(u,v,c.VK.LocalAuthorization),newPasswordHint:h,kdfConfig:this.kdfConfig};if(this.flow===n.ChangePassword||this.flow===n.ChangePasswordWithOptionalUserKeyRotation){const e=yield this.keyService.makeMasterKey(d,this.email,this.kdfConfig),t=yield this.keyService.hashMasterKey(d,e,c.VK.ServerAuthorization),i=yield this.keyService.hashMasterKey(d,e,c.VK.LocalAuthorization);g.currentPassword=d,g.currentMasterKey=e,g.currentServerMasterKeyHash=t,g.currentLocalMasterKeyHash=i}return this.flow===n.ChangePasswordWithOptionalUserKeyRotation&&(g.rotateUserKey=null===(l=this.formGroup.controls.rotateUserKey)||void 0===l?void 0:l.value),this.onPasswordFormSubmit.emit(g),g}catch(d){this.validationService.showError(d)}finally{this.isSubmitting.emit(!1)}})}ngOnInit(){this.addFormFieldsIfNecessary(),this.setButtonText()}addFormFieldsIfNecessary(){this.flow!==n.ChangePasswordDelegation&&(this.formGroup.addControl("newPasswordHint",this.formBuilder.nonNullable.control("",[s.k0.minLength(this.minHintLength),s.k0.maxLength(this.maxHintLength)])),this.formGroup.addValidators([(0,I.R)(I.l.InputsShouldNotMatch,"newPassword","newPasswordHint",this.i18nService.t("hintEqualsPassword"))]),this.formGroup.addControl("checkForBreaches",this.formBuilder.nonNullable.control(!0))),this.flow!==n.ChangePassword&&this.flow!==n.ChangePasswordWithOptionalUserKeyRotation||(this.formGroup.addControl("currentPassword",this.formBuilder.nonNullable.control("",s.k0.required)),this.formGroup.addValidators([(0,I.R)(I.l.InputsShouldNotMatch,"currentPassword","newPassword",this.i18nService.t("yourNewPasswordCannotBeTheSameAsYourCurrentPassword"))])),this.flow===n.ChangePasswordWithOptionalUserKeyRotation&&this.formGroup.addControl("rotateUserKey",this.formBuilder.nonNullable.control(!1))}setButtonText(){var e,t,i,n;this.primaryButtonText&&(this.primaryButtonTextStr=this.i18nService.t(this.primaryButtonText.key,...null!==(t=null===(e=this.primaryButtonText)||void 0===e?void 0:e.placeholders)&&void 0!==t?t:[])),this.secondaryButtonText&&(this.secondaryButtonTextStr=this.i18nService.t(this.secondaryButtonText.key,...null!==(n=null===(i=this.secondaryButtonText)||void 0===i?void 0:i.placeholders)&&void 0!==n?n:[]))}verifyFlow(){if((this.flow===n.SetInitialPasswordAccountRegistration||this.flow===n.ChangePasswordDelegation)&&this.userId)throw new Error("There should be no active account userId passed down in a this flow.");if(this.flow!==n.SetInitialPasswordAccountRegistration&&this.flow!==n.ChangePasswordDelegation&&!this.userId)throw new Error("This flow requires that an active account userId be passed down.");if(this.flow===n.ChangePasswordDelegation&&this.email)throw new Error("There should be no email passed down in this flow.");if(this.flow!==n.ChangePasswordDelegation&&!this.email)throw new Error("This flow requires that an email be passed down.")}handleChangePasswordDelegationFlow(e){return W(this,void 0,void 0,function*(){if(!(yield this.verifyNewPassword(e,this.passwordStrengthScore,!1)))return;const t={newPassword:e};return this.onPasswordFormSubmit.emit(t),t})}verifyCurrentPassword(e,t){return W(this,void 0,void 0,function*(){if(!this.email)throw new Error("Email is required to verify current password.");if(!this.userId)throw new Error("userId is required to verify current password.");const i=yield this.keyService.makeMasterKey(e,this.email,t);return null!=(yield this.masterPasswordService.decryptUserKeyWithMasterKey(i,this.userId))||(this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("invalidMasterPassword")}),!1)})}verifyNewPassword(e,t,i){return W(this,void 0,void 0,function*(){const n=i&&(yield this.auditService.passwordLeaked(e))>0,r=null!=t&&t<3;if(n&&r){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakAndExposedMasterPassword"},content:{key:"weakAndBreachedMasterPasswordDesc"},type:"warning"})))return!1}else if(r){if(!(yield this.dialogService.openSimpleDialog({title:{key:"weakMasterPassword"},content:{key:"weakMasterPasswordDesc"},type:"warning"})))return!1}else if(n){if(!(yield this.dialogService.openSimpleDialog({title:{key:"exposedMasterPassword"},content:{key:"exposedMasterPasswordDesc"},type:"warning"})))return!1}return!(null!=this.masterPasswordPolicyOptions&&!this.policyService.evaluateMasterPassword(this.passwordStrengthScore,e,this.masterPasswordPolicyOptions))||(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("masterPasswordPolicyRequirementsNotMet")}),!1)})}rotateUserKeyClicked(){return W(this,void 0,void 0,function*(){const e=this.formGroup.controls.rotateUserKey;if(null==e?void 0:e.value){if(!this.userId)throw new Error("userId not passed down");const t=yield this.cipherService.getAllDecrypted(this.userId);let i=!1;if(null!=t)for(let e=0;e<t.length;e++)if(null==t[e].organizationId&&t[e].hasOldAttachments){i=!0;break}if(i){return(yield this.dialogService.openSimpleDialog({title:{key:"warning"},content:{key:"oldAttachmentsNeedFixDesc"},acceptButtonText:{key:"learnMore"},cancelButtonText:{key:"close"},type:"warning"}))&&this.platformUtilsService.launchUri("https://bitwarden.com/help/attachments/#add-storage-space"),void e.setValue(!1)}(yield this.dialogService.openSimpleDialog({title:{key:"rotateEncKeyTitle"},content:this.i18nService.t("updateEncryptionKeyWarning")+" "+this.i18nService.t("updateEncryptionKeyAccountExportWarning")+" "+this.i18nService.t("rotateEncKeyConfirmation"),type:"warning"}))||e.setValue(!1)}})}getPasswordStrengthScore(e){this.passwordStrengthScore=e}generatePassword(){return W(this,void 0,void 0,function*(){var e,t;const i=null!==(t=null===(e=yield this.passwordGenerationService.getOptions())||void 0===e?void 0:e[0])&&void 0!==t?t:{};if(this.formGroup.patchValue({newPassword:yield this.passwordGenerationService.generatePassword(i)}),!this.passwordStrengthComponent)throw new Error("PasswordStrengthComponent is not initialized");this.passwordStrengthComponent.updatePasswordStrength(this.formGroup.controls.newPassword.value)})}copy(){const e=this.formGroup.value.newPassword;null!=e&&(this.platformUtilsService.copyToClipboard(e,{window}),this.toastService.showToast({variant:"info",title:"",message:this.i18nService.t("valueCopied",this.i18nService.t("password"))}))}}ae.ɵfac=function(e){return new(e||ae)(r.rXU(C.d),r.rXU(T.p),r.rXU(R.o3),r.rXU(s.ok),r.rXU(P.W),r.rXU(b.zZ),r.rXU(b.Lu),r.rXU(x.L),r.rXU(y.JJ),r.rXU($.y),r.rXU(E.m),r.rXU(F.f),r.rXU(A.B))},ae.ɵcmp=r.VBU({type:ae,selectors:[["auth-input-password"]],viewQuery:function(e,t){if(1&e&&r.GBs(l.k,5),2&e){let e;r.mGM(e=r.lsd())&&(t.passwordStrengthComponent=e.first)}},inputs:{flow:"flow",email:[2,"email","email",e=>null==e?void 0:e.trim().toLowerCase()],userId:"userId",loading:"loading",masterPasswordPolicyOptions:"masterPasswordPolicyOptions",inlineButtons:"inlineButtons",primaryButtonText:"primaryButtonText",secondaryButtonText:"secondaryButtonText"},outputs:{onPasswordFormSubmit:"onPasswordFormSubmit",onSecondaryButtonClick:"onSecondaryButtonClick",isSubmitting:"isSubmitting"},decls:26,vars:27,consts:[[3,"formGroup","bitSubmit"],[3,"message","policy",4,"ngIf"],[4,"ngIf"],[1,"tw-mb-6"],[3,"disableMargin"],["id","input-password-form_new-password","bitInput","","type","password","formControlName","newPassword"],["type","button","bitIconButton","bwi-generate","bitSuffix","",3,"label","click",4,"ngIf"],["type","button","bitSuffix","","bitIconButton","bwi-clone",3,"label","click",4,"ngIf"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggledChange","toggled"],[3,"passwordStrengthScore","showText","email","password"],["id","input-password-form_new-password-confirm","bitInput","","type","password","formControlName","newPasswordConfirm"],["class","tw-flex tw-gap-2",3,"ngClass",4,"ngIf"],[3,"formGroup",4,"ngIf"],[3,"message","policy"],["id","input-password-form_current-password","bitInput","","type","password","formControlName","currentPassword"],["type","button","bitIconButton","bwi-generate","bitSuffix","",3,"click","label"],["type","button","bitSuffix","","bitIconButton","bwi-clone",3,"click","label"],[1,"tw-font-medium"],["id","input-password-form_new-password-hint","bitInput","","formControlName","newPasswordHint"],["id","input-password-form_check-for-breaches","type","checkbox","bitCheckbox","","formControlName","checkForBreaches"],["id","input-password-form_rotate-user-key","type","checkbox","bitCheckbox","","formControlName","rotateUserKey",3,"change"],["bitLink","","href","https://bitwarden.com/help/account-encryption-key/#rotate-your-encryption-key","target","_blank","rel","noreferrer",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[1,"tw-flex","tw-gap-2",3,"ngClass"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"loading"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"loading","click",4,"ngIf"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click","loading"],[3,"formGroup"]],template:function(e,t){1&e&&(r.j41(0,"form",0),r.DNE(1,J,1,2,"auth-password-callout",1)(2,Z,6,4,"bit-form-field",2),r.j41(3,"div",3)(4,"bit-form-field",4)(5,"bit-label"),r.EFF(6),r.nI1(7,"i18n"),r.nI1(8,"i18n"),r.k0s(),r.nrm(9,"input",5),r.DNE(10,Q,2,3,"button",6)(11,ee,2,4,"button",7),r.j41(12,"button",8),r.mxI("toggledChange",function(e){return r.DH7(t.showPassword,e)||(t.showPassword=e),e}),r.k0s(),r.DNE(13,te,6,7,"bit-hint",2),r.k0s(),r.j41(14,"tools-password-strength",9),r.bIt("passwordStrengthScore",function(e){return t.getPasswordStrengthScore(e)}),r.k0s()(),r.j41(15,"bit-form-field")(16,"bit-label"),r.EFF(17),r.nI1(18,"i18n"),r.nI1(19,"i18n"),r.k0s(),r.nrm(20,"input",10),r.j41(21,"button",8),r.mxI("toggledChange",function(e){return r.DH7(t.showPassword,e)||(t.showPassword=e),e}),r.k0s()(),r.DNE(22,ie,14,11,"ng-container",2)(23,ne,8,7,"bit-form-control",2)(24,se,5,6,"div",11)(25,oe,1,1,"bit-error-summary",12),r.k0s()),2&e&&(r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(),r.Y8G("ngIf",t.masterPasswordPolicyOptions),r.R7$(),r.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePassword||t.flow===t.InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation),r.R7$(2),r.Y8G("disableMargin",!0),r.R7$(2),r.JRh(t.flow===t.InputPasswordFlow.SetInitialPasswordAccountRegistration||t.flow===t.InputPasswordFlow.SetInitialPasswordAuthedUser?r.bMT(7,19,"masterPassword"):r.bMT(8,21,"newMasterPass")),r.R7$(4),r.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePasswordDelegation),r.R7$(),r.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePasswordDelegation),r.R7$(),r.R50("toggled",t.showPassword),r.R7$(),r.Y8G("ngIf",t.flow!==t.InputPasswordFlow.ChangePasswordDelegation),r.R7$(),r.Y8G("showText",!0)("email",t.email)("password",t.formGroup.controls.newPassword.value),r.R7$(3),r.JRh(t.flow===t.InputPasswordFlow.SetInitialPasswordAccountRegistration||t.flow===t.InputPasswordFlow.SetInitialPasswordAuthedUser?r.bMT(18,23,"confirmMasterPassword"):r.bMT(19,25,"confirmNewMasterPass")),r.R7$(4),r.R50("toggled",t.showPassword),r.R7$(),r.Y8G("ngIf",t.flow!==t.InputPasswordFlow.ChangePasswordDelegation),r.R7$(),r.Y8G("ngIf",t.flow===t.InputPasswordFlow.ChangePasswordWithOptionalUserKeyRotation),r.R7$(),r.Y8G("ngIf",t.flow!==t.InputPasswordFlow.ChangePasswordDelegation),r.R7$(),r.Y8G("ngIf",t.showErrorSummary))},dependencies:[u.C,D.$,O.L,f.t,M.Q,h.q,U.P,p.L,G.f,j.j,N.I,V.J,B.L,z.h,L.e,K.a,m.Q,q.s,v.x,a.p,_.C,S.R,l.k,s.X1,s.qT,s.me,s.Zm,s.BC,s.cb,s.j4,s.JD,g.V,X.L,w.G,Y.YU,Y.bT,H.$],encapsulation:2})},54967:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});class n{constructor(e){null!=e&&(this.id=e.id,this.organizationId=e.organizationId,this.type=e.type,this.data=e.data,this.enabled=e.enabled,this.revisionDate=e.revisionDate)}static fromPolicy(e){return Object.assign(new n,e)}}},55393:(e,t,i)=>{"use strict";i.d(t,{K:()=>u});var n=i(66523),r=i(62963),s=i(33812);class o{transform(e,t){var i;return null===(i=t.find(t=>t.id===e))||void 0===i?void 0:i.name}}o.ɵfac=function(e){return new(e||o)},o.ɵpipe=s.EJ8({name:"collectionNameFromId",type:o,pure:!0});var a=i(77468),l=i(47696);function c(e,t){if(1&e&&(s.qex(0),s.j41(1,"span",2),s.EFF(2),s.nI1(3,"collectionNameFromId"),s.k0s(),s.bVm()),2&e){const e=t.$implicit,i=s.XpG();s.R7$(2),s.JRh(s.i5U(3,1,e,i.collections))}}function d(e,t){if(1&e&&(s.qex(0),s.j41(1,"span",2),s.EFF(2),s.k0s(),s.bVm()),2&e){const e=s.XpG();s.R7$(2),s.SpI("+ ",e.xMoreCount," more")}}class u{get shownCollections(){return(this.showXMore?this.collectionIds.slice(0,2):this.collectionIds).map(n.zw)}get showXMore(){return this.collectionIds.length>3}get xMoreCount(){return this.collectionIds.length-2}}u.ɵfac=function(e){return new(e||u)},u.ɵcmp=s.VBU({type:u,selectors:[["app-collection-badge"]],inputs:{collectionIds:"collectionIds",collections:"collections"},decls:2,vars:2,consts:[[4,"ngFor","ngForOf"],[4,"ngIf"],["bitBadge","","variant","secondary"]],template:function(e,t){1&e&&s.DNE(0,c,4,4,"ng-container",0)(1,d,3,1,"ng-container",1),2&e&&(s.Y8G("ngForOf",t.shownCollections),s.R7$(),s.Y8G("ngIf",t.showXMore))},dependencies:[r.G,a.Sq,a.bT,l.n,o],encapsulation:2})},55459:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{}},55542:(e,t,i)=>{"use strict";i.d(t,{s:()=>l});var n=i(54539),r=i(93585),s=i(16878),o=i(33338),a=i(3204);class l extends r.q{constructor(){super(),this._filter=new s.t(()=>!0),this._renderData=new s.t([]),this._renderChangesSubscription=null,this._data=new s.t([]),this._sort=new s.t({direction:"asc"})}get data(){return this._data.value}set data(e){e=Array.isArray(e)?e:[],this._data.next(e),this._renderChangesSubscription||this.filterData(e)}set sort(e){this._sort.next(e)}get sort(){return this._sort.value}get filter(){return this._filter.value}set filter(e){this._filter.next(e),this._renderChangesSubscription||this.filterData(this.data)}connect(){return this._renderChangesSubscription||this.updateChangeSubscription(),this._renderData}disconnect(){var e;null===(e=this._renderChangesSubscription)||void 0===e||e.unsubscribe(),this._renderChangesSubscription=null}updateChangeSubscription(){var e;const t=(0,o.z)([this._data,this._filter]).pipe((0,a.T)(([e])=>this.filterData(e))),i=(0,o.z)([t,this._sort]).pipe((0,a.T)(([e,t])=>this.orderData(e,t)));null===(e=this._renderChangesSubscription)||void 0===e||e.unsubscribe(),this._renderChangesSubscription=i.subscribe(e=>this._renderData.next(e))}filterData(e){const t="string"==typeof this.filter?l.simpleStringFilter(this.filter):this.filter;return this.filteredData=null==this.filter?e:e.filter(e=>t(e)),this.filteredData}orderData(e,t){return t?this.sortData(e,t):e}sortingDataAccessor(e,t){const i=e[t];if((0,n.o1)(i)){const e=Number(i);return e<Number.MAX_SAFE_INTEGER?e:i}return i}sortData(e,t){const i=t.column,n="asc"===t.direction?1:-1;return i?e.sort((e,r)=>{if(t.fn)return t.fn(e,r,t.direction)*n;let s=this.sortingDataAccessor(e,i),o=this.sortingDataAccessor(r,i);const a=typeof s,l=typeof o;if(a!==l&&("number"===a&&(s+=""),"number"===l&&(o+="")),"string"==typeof s&&"string"==typeof o)return s.localeCompare(o)*n;let c=0;return null!=s&&null!=o?s>o?c=1:s<o&&(c=-1):null!=s?c=1:null!=o&&(c=-1),c*n}):e}}l.simpleStringFilter=e=>t=>{if(!e)return!0;const i=Object.keys(t).reduce((e,i)=>e+t[i]+"◬","").toLowerCase(),n=e.trim().toLowerCase();return-1!=i.indexOf(n)}},55784:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{static fromJSON(e){return null==e?null:Object.assign(new n,e)}}},55807:(e,t,i)=>{"use strict";i.d(t,{o:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},56455:(e,t,i)=>{"use strict";i.d(t,{pU:()=>j,MA:()=>z,wG:()=>_});var n=i(39306),r=i(19488),s=i(6528);function o(e){return null==e?null:"string"==typeof e?e:null==e?void 0:e.encryptedString}class a{static template(){const e=new a;return e.cardholderName="John Doe",e.brand="visa",e.number="4242424242424242",e.expMonth="04",e.expYear="2023",e.code="123",e}static toView(e,t=new s.G){return t.cardholderName=e.cardholderName,t.brand=e.brand,t.number=e.number,t.expMonth=e.expMonth,t.expYear=e.expYear,t.code=e.code,t}static toDomain(e,t=new r.Z){return t.cardholderName=null!=e.cardholderName?new n.k(e.cardholderName):null,t.brand=null!=e.brand?new n.k(e.brand):null,t.number=null!=e.number?new n.k(e.number):null,t.expMonth=null!=e.expMonth?new n.k(e.expMonth):null,t.expYear=null!=e.expYear?new n.k(e.expYear):null,t.code=null!=e.code?new n.k(e.code):null,t}constructor(e){null!=e&&(this.cardholderName=o(e.cardholderName),this.brand=o(e.brand),this.number=o(e.number),this.expMonth=o(e.expMonth),this.expYear=o(e.expYear),this.code=o(e.code))}}var l=i(36501),c=i(7919),d=i(23293),u=i(75751),h=i(31442),p=i(77720),m=i(11766);class v{static template(){const e=new v;return e.name="Field name",e.value="Some value",e.type=h.PU.Text,e}static toView(e,t=new m.g){return t.type=e.type,t.value=e.value,t.name=e.name,t.linkedId=e.linkedId,t}static toDomain(e,t=new p.D){return t.type=e.type,t.value=null!=e.value?new n.k(e.value):null,t.name=null!=e.name?new n.k(e.name):null,t.linkedId=e.linkedId,t}constructor(e){null!=e&&(this.name=o(e.name),this.value=o(e.value),this.type=e.type,this.linkedId=e.linkedId)}}var f=i(32072),g=i(67036);class y{static template(){const e=new y;return e.title="Mr",e.firstName="John",e.middleName="William",e.lastName="Doe",e.address1="123 Any St",e.address2="Apt #123",e.address3=null,e.city="New York",e.state="NY",e.postalCode="10001",e.country="US",e.company="Acme Inc.",e.email="john@company.com",e.phone="5555551234",e.ssn="000-123-4567",e.username="jdoe",e.passportNumber="US-123456789",e.licenseNumber="D123-12-123-12333",e}static toView(e,t=new g.O){return t.title=e.title,t.firstName=e.firstName,t.middleName=e.middleName,t.lastName=e.lastName,t.address1=e.address1,t.address2=e.address2,t.address3=e.address3,t.city=e.city,t.state=e.state,t.postalCode=e.postalCode,t.country=e.country,t.company=e.company,t.email=e.email,t.phone=e.phone,t.ssn=e.ssn,t.username=e.username,t.passportNumber=e.passportNumber,t.licenseNumber=e.licenseNumber,t}static toDomain(e,t=new f.l){return t.title=null!=e.title?new n.k(e.title):null,t.firstName=null!=e.firstName?new n.k(e.firstName):null,t.middleName=null!=e.middleName?new n.k(e.middleName):null,t.lastName=null!=e.lastName?new n.k(e.lastName):null,t.address1=null!=e.address1?new n.k(e.address1):null,t.address2=null!=e.address2?new n.k(e.address2):null,t.address3=null!=e.address3?new n.k(e.address3):null,t.city=null!=e.city?new n.k(e.city):null,t.state=null!=e.state?new n.k(e.state):null,t.postalCode=null!=e.postalCode?new n.k(e.postalCode):null,t.country=null!=e.country?new n.k(e.country):null,t.company=null!=e.company?new n.k(e.company):null,t.email=null!=e.email?new n.k(e.email):null,t.phone=null!=e.phone?new n.k(e.phone):null,t.ssn=null!=e.ssn?new n.k(e.ssn):null,t.username=null!=e.username?new n.k(e.username):null,t.passportNumber=null!=e.passportNumber?new n.k(e.passportNumber):null,t.licenseNumber=null!=e.licenseNumber?new n.k(e.licenseNumber):null,t}constructor(e){null!=e&&(this.title=o(e.title),this.firstName=o(e.firstName),this.middleName=o(e.middleName),this.lastName=o(e.lastName),this.address1=o(e.address1),this.address2=o(e.address2),this.address3=o(e.address3),this.city=o(e.city),this.state=o(e.state),this.postalCode=o(e.postalCode),this.country=o(e.country),this.company=o(e.company),this.email=o(e.email),this.phone=o(e.phone),this.ssn=o(e.ssn),this.username=o(e.username),this.passportNumber=o(e.passportNumber),this.licenseNumber=o(e.licenseNumber))}}var b=i(21925),w=i(14093),S=i(84454),I=i(65918);class k{static template(){const e=new k;return e.credentialId="keyId",e.keyType="keyType",e.keyAlgorithm="keyAlgorithm",e.keyCurve="keyCurve",e.keyValue="keyValue",e.rpId="rpId",e.userHandle="userHandle",e.userName="userName",e.counter="counter",e.rpName="rpName",e.userDisplayName="userDisplayName",e.discoverable="false",e.creationDate=null,e}static toView(e,t=new I.X){return t.credentialId=e.credentialId,t.keyType=e.keyType,t.keyAlgorithm=e.keyAlgorithm,t.keyCurve=e.keyCurve,t.keyValue=e.keyValue,t.rpId=e.rpId,t.userHandle=e.userHandle,t.userName=e.userName,t.counter=parseInt(e.counter),t.rpName=e.rpName,t.userDisplayName=e.userDisplayName,t.discoverable="true"===e.discoverable,t.creationDate=new Date(e.creationDate),t}static toDomain(e,t=new S.U){return t.credentialId=null!=e.credentialId?new n.k(e.credentialId):null,t.keyType=null!=e.keyType?new n.k(e.keyType):null,t.keyAlgorithm=null!=e.keyAlgorithm?new n.k(e.keyAlgorithm):null,t.keyCurve=null!=e.keyCurve?new n.k(e.keyCurve):null,t.keyValue=null!=e.keyValue?new n.k(e.keyValue):null,t.rpId=null!=e.rpId?new n.k(e.rpId):null,t.userHandle=null!=e.userHandle?new n.k(e.userHandle):null,t.userName=null!=e.userName?new n.k(e.userName):null,t.counter=null!=e.counter?new n.k(e.counter):null,t.rpName=null!=e.rpName?new n.k(e.rpName):null,t.userDisplayName=null!=e.userDisplayName?new n.k(e.userDisplayName):null,t.discoverable=null!=e.discoverable?new n.k(e.discoverable):null,t.creationDate=e.creationDate,t}constructor(e){null!=e&&(this.credentialId=o(e.credentialId),this.keyType=o(e.keyType),this.keyAlgorithm=o(e.keyAlgorithm),this.keyCurve=o(e.keyCurve),this.keyValue=o(e.keyValue),this.rpId=o(e.rpId),this.userHandle=o(e.userHandle),this.userName=o(e.userName),this.counter=o(String(e.counter)),this.rpName=o(e.rpName),this.userDisplayName=o(e.userDisplayName),this.discoverable=o(String(e.discoverable)),this.creationDate=e.creationDate)}}var C=i(73386),T=i(16671);class F{static template(){const e=new F;return e.uri="https://google.com",e.match=null,e}static toView(e,t=new T.z){return t.uri=e.uri,t.match=e.match,t}static toDomain(e,t=new C.m){return t.uri=null!=e.uri?new n.k(e.uri):null,t.uriChecksum=null!=e.uriChecksum?new n.k(e.uriChecksum):null,t.match=e.match,t}constructor(e){var t;this.match=null,null!=e&&(this.uri=o(e.uri),"uriChecksum"in e&&(this.uriChecksum=null===(t=e.uriChecksum)||void 0===t?void 0:t.encryptedString),this.match=e.match)}}class R{static template(){const e=new R;return e.uris=[],e.username="jdoe",e.password="myp@ssword123",e.totp="JBSWY3DPEHPK3PXP",e.fido2Credentials=[],e}static toView(e,t=new w.r){return null!=e.uris&&(t.uris=e.uris.map(e=>F.toView(e))),t.username=e.username,t.password=e.password,t.totp=e.totp,null!=e.fido2Credentials&&(t.fido2Credentials=e.fido2Credentials.map(e=>k.toView(e))),t}static toDomain(e,t=new b.a){return null!=e.uris&&(t.uris=e.uris.map(e=>F.toDomain(e))),t.username=null!=e.username?new n.k(e.username):null,t.password=null!=e.password?new n.k(e.password):null,t.totp=null!=e.totp?new n.k(e.totp):null,t}constructor(e){null!=e&&(null!=e.uris&&(this.uris=e.uris.map(e=>new F(e))),null!=e.fido2Credentials&&(this.fido2Credentials=e.fido2Credentials.map(e=>new k(e))),this.username=o(e.username),this.password=o(e.password),this.totp=o(e.totp))}}var P=i(50751),x=i(12022);class ${static template(){const e=new $;return e.password=null,e.lastUsedDate=null,e}static toView(e,t=new x.j){return t.password=e.password,t.lastUsedDate=e.lastUsedDate?new Date(e.lastUsedDate):null,t}static toDomain(e,t=new P._){return t.password=null!=e.password?new n.k(e.password):null,t.lastUsedDate=e.lastUsedDate?new Date(e.lastUsedDate):null,t}constructor(e){this.lastUsedDate=null,null!=e&&(this.password=o(e.password),this.lastUsedDate=e.lastUsedDate)}}var E=i(47328),A=i(86346);class D{static template(){const e=new D;return e.type=h.ak.Generic,e}static toView(e,t=new A.Z){return t.type=e.type,t}static toDomain(e,t=new E.S){return t.type=e.type,t}constructor(e){null!=e&&(this.type=e.type)}}var O=i(67756),M=i(72142);class U{static template(){const e=new U;return e.privateKey="",e.publicKey="",e.keyFingerprint="",e}static toView(e,t=new M.H){if(null!=e){if(!e.privateKey||""===e.privateKey.trim())throw new Error("SSH key private key is required.");if(!e.publicKey||""===e.publicKey.trim())throw new Error("SSH key public key is required.");if(!e.keyFingerprint||""===e.keyFingerprint.trim())throw new Error("SSH key fingerprint is required.");return t.privateKey=e.privateKey,t.publicKey=e.publicKey,t.keyFingerprint=e.keyFingerprint,t}}static toDomain(e,t=new O.M){return t.privateKey=new n.k(e.privateKey),t.publicKey=new n.k(e.publicKey),t.keyFingerprint=new n.k(e.keyFingerprint),t}constructor(e){null!=e&&(this.privateKey=o(e.privateKey),this.publicKey=o(e.publicKey),this.keyFingerprint=o(e.keyFingerprint))}}class G{constructor(){this.passwordHistory=null,this.revisionDate=null,this.creationDate=null,this.deletedDate=null,this.archivedDate=null}static template(){const e=new G;return e.organizationId=null,e.collectionIds=null,e.folderId=null,e.type=c.gC.Login,e.name="Item name",e.notes="Some notes about this item.",e.favorite=!1,e.fields=[],e.login=null,e.secureNote=null,e.card=null,e.identity=null,e.sshKey=null,e.reprompt=l.b.None,e.passwordHistory=[],e.creationDate=null,e.revisionDate=null,e.deletedDate=null,e.archivedDate=null,e}static toView(e,t=new u.f){var i,r,s;if(t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.collectionIds||e.collectionIds){const n=new Set((null!==(i=t.collectionIds)&&void 0!==i?i:[]).concat(null!==(r=e.collectionIds)&&void 0!==r?r:[]));t.collectionIds=Array.from(n.values())}switch(t.name=e.name,t.notes=e.notes,t.favorite=e.favorite,t.reprompt=null!==(s=e.reprompt)&&void 0!==s?s:l.b.None,t.key=null!=e.key?new n.k(e.key):null,null!=e.fields&&(t.fields=e.fields.map(e=>v.toView(e))),e.type){case c.gC.Login:t.login=R.toView(e.login);break;case c.gC.SecureNote:t.secureNote=D.toView(e.secureNote);break;case c.gC.Card:t.card=a.toView(e.card);break;case c.gC.Identity:t.identity=y.toView(e.identity);break;case c.gC.SshKey:t.sshKey=U.toView(e.sshKey)}return null!=e.passwordHistory&&(t.passwordHistory=e.passwordHistory.map(e=>$.toView(e))),t.creationDate=e.creationDate?new Date(e.creationDate):t.creationDate,t.revisionDate=e.revisionDate?new Date(e.revisionDate):t.revisionDate,t.deletedDate=e.deletedDate?new Date(e.deletedDate):t.deletedDate,t.archivedDate=e.archivedDate?new Date(e.archivedDate):t.archivedDate,t}static toDomain(e,t=new d.o){var i;switch(t.type=e.type,t.folderId=e.folderId,null==t.organizationId&&(t.organizationId=e.organizationId),t.name=null!=e.name?new n.k(e.name):null,t.notes=null!=e.notes?new n.k(e.notes):null,t.favorite=e.favorite,t.reprompt=null!==(i=e.reprompt)&&void 0!==i?i:l.b.None,t.key=null!=e.key?new n.k(e.key):null,null!=e.fields&&(t.fields=e.fields.map(e=>v.toDomain(e))),e.type){case c.gC.Login:t.login=R.toDomain(e.login);break;case c.gC.SecureNote:t.secureNote=D.toDomain(e.secureNote);break;case c.gC.Card:t.card=a.toDomain(e.card);break;case c.gC.Identity:t.identity=y.toDomain(e.identity);break;case c.gC.SshKey:t.sshKey=U.toDomain(e.sshKey)}return null!=e.passwordHistory&&(t.passwordHistory=e.passwordHistory.map(e=>$.toDomain(e))),t.creationDate=e.creationDate?new Date(e.creationDate):null,t.revisionDate=e.revisionDate?new Date(e.revisionDate):null,t.deletedDate=e.deletedDate?new Date(e.deletedDate):null,t.archivedDate=e.archivedDate?new Date(e.archivedDate):null,t}build(e){var t;switch(this.organizationId=e.organizationId,this.folderId=e.folderId,this.type=e.type,this.reprompt=e.reprompt,this.name=o(e.name),this.notes=o(e.notes),"key"in e&&(this.key=null===(t=e.key)||void 0===t?void 0:t.encryptedString),this.favorite=e.favorite,null!=e.fields&&(this.fields=e.fields.map(e=>new v(e))),e.type){case c.gC.Login:this.login=new R(e.login);break;case c.gC.SecureNote:this.secureNote=new D(e.secureNote);break;case c.gC.Card:this.card=new a(e.card);break;case c.gC.Identity:this.identity=new y(e.identity);break;case c.gC.SshKey:this.sshKey=new U(e.sshKey)}null!=e.passwordHistory&&(this.passwordHistory=e.passwordHistory.map(e=>new $(e))),this.creationDate=e.creationDate,this.revisionDate=e.revisionDate,this.deletedDate=e.deletedDate,this.archivedDate=e.archivedDate}}class j extends G{build(e){this.id=e.id,super.build(e),this.collectionIds=e.collectionIds}}var N=i(28202),V=i(5076);class B{static template(){const e=new B;return e.organizationId=V.v,e.name="Collection name",e.externalId=null,e}static toView(e,t){const i=new N.iY({name:e.name,organizationId:e.organizationId,id:t});return i.externalId=e.externalId,i}static toDomain(e,t){return t.name=null!=e.name?new n.k(e.name):null,t.externalId=e.externalId,null==t.organizationId&&(t.organizationId=e.organizationId),t}build(e){this.organizationId=e.organizationId,this.name=o(e.name),this.externalId=e.externalId}}class z extends B{static toView(e){return super.toView(e,e.id)}static toDomain(e,t){return t.id=e.id,super.toDomain(e,t)}build(e){this.id=e.id,super.build(e)}}var L=i(84274),K=i(78078);class q{static template(){const e=new q;return e.name="Folder name",e}static toView(e,t=new K.u){return t.name=e.name,t}static toDomain(e,t=new L.v){return t.name=null!=e.name?new n.k(e.name):null,t}build(e){this.name=o(e.name)}}class _ extends q{static toView(e,t=new K.u){return t.id=e.id,super.toView(e,t)}static toDomain(e,t=new L.v){return t.id=e.id,super.toDomain(e,t)}build(e){this.id=e.id,super.build(e)}}},56615:(e,t,i)=>{"use strict";i.d(t,{V:()=>o});var n=i(1576),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.m]})},56634:(e,t,i)=>{"use strict";i.d(t,{q:()=>n});class n{}},56898:(e,t,i)=>{"use strict";i.d(t,{Q:()=>w});var n=i(77468),r=i(33277),s=i(94573),o=i(74208),a=i(33812),l=i(83731),c=i(25479),d=i(50147),u=i(53100),h=i(83632),p=i(6307),m=i(23542);const v=e=>({"tw-invisible":e});function f(e,t){1&e&&(a.j41(0,"span",2),a.nrm(1,"bit-spinner",3),a.k0s())}const g=["focus-visible:tw-ring-2","focus-visible:tw-ring-offset-2","focus-visible:tw-ring-primary-600","focus-visible:tw-z-10"],y={small:["tw-py-1","tw-px-3","tw-text-sm"],default:["tw-py-1.5","tw-px-3"]},b={primary:["tw-border-primary-600","tw-bg-primary-600","!tw-text-contrast","hover:tw-bg-primary-700","hover:tw-border-primary-700",...g],secondary:["tw-bg-transparent","tw-border-primary-600","!tw-text-primary-600","hover:tw-bg-hover-default",...g],danger:["tw-bg-transparent","tw-border-danger-600","!tw-text-danger","hover:tw-bg-danger-600","hover:tw-border-danger-600","hover:!tw-text-contrast",...g],dangerPrimary:["tw-border-danger-600","tw-bg-danger-600","!tw-text-contrast","hover:tw-bg-danger-700","hover:tw-border-danger-700",...g],unstyled:[]};class w{get classList(){var e;return["tw-font-medium","tw-rounded-full","tw-transition","tw-border-2","tw-border-solid","tw-text-center","tw-no-underline","hover:tw-no-underline","focus:tw-outline-none"].concat(this.block()?["tw-w-full","tw-block"]:["tw-inline-block"]).concat(b[null!==(e=this.buttonType())&&void 0!==e?e:"secondary"]).concat(this.showDisabledStyles()||this.disabled()?["aria-disabled:!tw-bg-secondary-300","hover:tw-bg-secondary-300","aria-disabled:tw-border-secondary-300","hover:tw-border-secondary-300","aria-disabled:!tw-text-muted","hover:!tw-text-muted","aria-disabled:tw-cursor-not-allowed","hover:tw-no-underline"]:[]).concat(y[this.size()||"default"])}constructor(){this.disabledAttr=(0,r.EW)(()=>null!=this.disabled()&&!1!==this.disabled()||this.loading()),this.showDisabledStyles=(0,r.EW)(()=>this.showLoadingStyle()||this.disabledAttr()&&!1===this.loading()),this.buttonType=(0,s.hFB)("secondary"),this.size=(0,s.hFB)("default"),this.block=(0,s.hFB)(!1,{transform:s.L39}),this.loading=(0,s.geq)(!1),this.showLoadingStyle=(0,l.ot)((0,l.br)(this.loading).pipe((0,d.s)(e=>(0,c.Y)(e?75:0)))),this.disabled=(0,s.geq)(!1),this.el=(0,o.WQX)(a.aKT),(0,p.m)(this.el.nativeElement,this.disabledAttr)}}w.ɵfac=function(e){return new(e||w)},w.ɵcmp=a.VBU({type:w,selectors:[["button","bitButton",""],["a","bitButton",""]],hostVars:2,hostBindings:function(e,t){2&e&&a.HbH(t.classList)},inputs:{buttonType:[1,"buttonType"],size:[1,"size"],block:[1,"block"],loading:[1,"loading"],disabled:[1,"disabled"]},outputs:{loading:"loadingChange",disabled:"disabledChange"},features:[a.Jv_([{provide:u.E,useExisting:w}]),a.nM4([m.v])],attrs:["bitButton",""],ngContentSelectors:["*"],decls:4,vars:4,consts:[[1,"tw-relative"],[3,"ngClass"],[1,"tw-absolute","tw-inset-0","tw-flex","tw-items-center","tw-justify-center"],["size","fill","noColor",""]],template:function(e,t){1&e&&(a.NAR(),a.j41(0,"span",0)(1,"span",1),a.SdG(2),a.k0s(),a.nVh(3,f,2,0,"span",2),a.k0s()),2&e&&(a.R7$(),a.Y8G("ngClass",a.eq3(2,v,t.showLoadingStyle())),a.R7$(2),a.vxM(t.showLoadingStyle()?3:-1))},dependencies:[n.YU,h.t],encapsulation:2})},56953:(e,t,i)=>{"use strict";i.d(t,{B:()=>r});var n=i(48541);class r extends n.G{constructor(e,t){super(e,t)}}},56962:(e,t,i)=>{"use strict";i.d(t,{K:()=>n.Kc});var n=i(90107)},57083:(e,t,i)=>{"use strict";i.d(t,{q:()=>r});var n=i(33812);class r{set appInputVerbatim(e){this.disableComplete=""===e||!0===e}constructor(e,t){this.el=e,this.renderer=t}ngOnInit(){this.disableComplete&&!this.el.nativeElement.hasAttribute("autocomplete")&&this.renderer.setAttribute(this.el.nativeElement,"autocomplete","off"),this.el.nativeElement.hasAttribute("autocapitalize")||this.renderer.setAttribute(this.el.nativeElement,"autocapitalize","none"),this.el.nativeElement.hasAttribute("autocorrect")||this.renderer.setAttribute(this.el.nativeElement,"autocorrect","none"),this.el.nativeElement.hasAttribute("spellcheck")||this.renderer.setAttribute(this.el.nativeElement,"spellcheck","false"),this.el.nativeElement.hasAttribute("inputmode")||this.renderer.setAttribute(this.el.nativeElement,"inputmode","verbatim")}}r.ɵfac=function(e){return new(e||r)(n.rXU(n.aKT),n.rXU(n.sFG))},r.ɵdir=n.FsC({type:r,selectors:[["","appInputVerbatim",""]],inputs:{appInputVerbatim:"appInputVerbatim"},standalone:!1})},57144:(e,t,i)=>{"use strict";i.d(t,{f:()=>d});var n=i(77468),r=i(94573),s=i(33277),o=i(78781),a=i(74208),l=i(33812);const c={xlarge:["tw-h-24","tw-w-24","tw-min-w-24"],large:["tw-h-16","tw-w-16","tw-min-w-16"],default:["tw-h-10","tw-w-10","tw-min-w-10"],small:["tw-h-7","tw-w-7","tw-min-w-7"],xsmall:["tw-h-6","tw-w-6","tw-min-w-6"]};class d{constructor(){this.border=(0,r.hFB)(!1),this.color=(0,r.hFB)(),this.id=(0,r.hFB)(),this.text=(0,r.hFB)(),this.title=(0,r.hFB)(),this.size=(0,r.hFB)("default"),this.svgCharCount=2,this.svgFontSize=20,this.svgFontWeight=300,this.svgSize=48,this.classList=(0,s.EW)(()=>{var e;return["tw-rounded-full"].concat(null!==(e=c[this.size()])&&void 0!==e?e:[]).concat(this.border()?["tw-border","tw-border-solid","tw-border-secondary-600"]:[])}),this.backgroundColor=(0,s.EW)(()=>{var e,t;const i=this.id(),n=null!==(t=null===(e=this.text())||void 0===e?void 0:e.toUpperCase())&&void 0!==t?t:"";return o.A.isNullOrWhitespace(this.color())?o.A.isNullOrWhitespace(i)?o.A.stringToColor(n):o.A.stringToColor(i.toString()):this.color()}),this.textColor=(0,s.EW)(()=>o.A.pickTextColorBasedOnBgColor(this.backgroundColor(),135,!0)),this.displayChars=(0,s.EW)(()=>{var e,t;const i=null!==(t=null===(e=this.text())||void 0===e?void 0:e.toUpperCase())&&void 0!==t?t:"";let n=this.getFirstLetters(i,this.svgCharCount);null==n&&(n=this.unicodeSafeSubstring(i,this.svgCharCount));const r=n.match(o.A.regexpEmojiPresentation);return r&&(n=r[0]),n})}getFirstLetters(e,t){const i=e.split(" ");if(i.length>1){let e="";for(let n=0;n<t;n++)e+=this.unicodeSafeSubstring(i[n],1);return e}}unicodeSafeSubstring(e,t){const i=e.match(/./gu);return null!=i?i.slice(0,t).join(""):""}}d.ɵfac=function(e){return new(e||d)},d.ɵcmp=l.VBU({type:d,selectors:[["bit-avatar"]],inputs:{border:[1,"border"],color:[1,"color"],id:[1,"id"],text:[1,"text"],title:[1,"title"],size:[1,"size"]},decls:4,vars:13,consts:[[3,"title"],["xmlns","http://www.w3.org/2000/svg","pointer-events","none",3,"ngClass"],["text-anchor","middle","y","50%","x","50%","dy","0.35em","pointer-events","auto","font-family",'Inter,"Helvetica Neue",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"']],template:function(e,t){1&e&&(l.j41(0,"span",0),a.qSk(),l.j41(1,"svg",1)(2,"text",2),l.EFF(3),l.k0s()()()),2&e&&(l.Y8G("title",t.title()||t.text()),l.R7$(),l.xc7("background-color",t.backgroundColor()),l.BMQ("viewBox",l.ai1("0 0 ",t.svgSize," ",t.svgSize)),l.Y8G("ngClass",t.classList()),l.R7$(),l.xc7("font-weight",t.svgFontWeight)("font-size",t.svgFontSize,"px"),l.BMQ("fill",t.textColor()),l.R7$(),l.SpI(" ",t.displayChars()," "))},dependencies:[n.YU],encapsulation:2,changeDetection:0})},57396:(e,t,i)=>{"use strict";i.d(t,{RR:()=>r,_1:()=>s,cY:()=>n});class n{constructor(e={}){Object.assign(this,e)}static fromResponse(e){return new n({id:e.id,granteeId:e.granteeId,name:e.name,email:e.email,type:e.type,status:e.status,waitTimeDays:e.waitTimeDays,creationDate:e.creationDate,avatarColor:e.avatarColor})}}class r{constructor(e={}){Object.assign(this,e)}static fromResponse(e){return new r({id:e.id,grantorId:e.grantorId,name:e.name,email:e.email,type:e.type,status:e.status,waitTimeDays:e.waitTimeDays,creationDate:e.creationDate,avatarColor:e.avatarColor})}}class s extends n{}},58270:(e,t,i)=>{"use strict";i.d(t,{c:()=>o});var n=i(43978),r=i(33812),s=i(50700);class o{constructor(e){this.i18nService=e}transform(e){if(null==e)return this.i18nService.t("unknown");switch(e){case n.D7.Owner:return this.i18nService.t("owner");case n.D7.Admin:return this.i18nService.t("admin");case n.D7.User:return this.i18nService.t("user");case n.D7.Custom:return this.i18nService.t("custom")}}}o.ɵfac=function(e){return new(e||o)(r.rXU(s.W,16))},o.ɵpipe=r.EJ8({name:"userType",type:o,pure:!0,standalone:!1})},58329:(e,t,i)=>{"use strict";i.d(t,{Q:()=>n});class n{}},58384:(e,t,i)=>{"use strict";i.d(t,{i:()=>l});var n=i(94573),r=i(33277),s=i(13299),o=i(33812),a=i(23197);class l{constructor(e){this.domSanitizer=e,this.innerHtml=null,this.icon=(0,n.hFB)(),this.ariaLabel=(0,n.hFB)(),(0,r.QZ)(()=>{const e=this.icon();if(!(0,s.If)(e))return;const t=e.svg;this.innerHtml=this.domSanitizer.bypassSecurityTrustHtml(t)})}}l.ɵfac=function(e){return new(e||l)(o.rXU(a.up))},l.ɵcmp=o.VBU({type:l,selectors:[["bit-icon"]],hostAttrs:[1,"tw-max-h-full","tw-flex","tw-justify-center"],hostVars:3,hostBindings:function(e,t){2&e&&(o.Avn("innerHTML",t.innerHtml,o.npT),o.BMQ("aria-hidden",!t.ariaLabel())("aria-label",t.ariaLabel()))},inputs:{icon:[1,"icon"],ariaLabel:[1,"ariaLabel"]},decls:0,vars:0,template:function(e,t){},encapsulation:2})},58389:(e,t,i)=>{"use strict";i.d(t,{Q:()=>n});class n{constructor(e){this.id=null,this.size=null,this.sizeName=null,this.fileName=null,e&&(this.id=e.id,this.size=e.size,this.sizeName=e.sizeName)}get fileSize(){try{if(null!=this.size)return parseInt(this.size,null)}catch(e){}return 0}static fromJSON(e){return null==e?null:Object.assign(new n,e)}}},58412:(e,t,i)=>{"use strict";i.d(t,{OU:()=>n,fQ:()=>s,ql:()=>r});const n={Premium:"premium",Families:"families"},r={Free:"free",Teams:"teams",Enterprise:"enterprise",Custom:"custom"},s={Annually:"annually",Monthly:"monthly"}},58503:(e,t,i)=>{"use strict";i.d(t,{b:()=>w});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(14803),d=i(8131),u=i(58625),h=i(26411),p=i(47135),m=i(29776),v=i(36801),f=i(90246),g=i(86226),y=i(50352),b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class w{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account=null,this.account$=new o.m(1),this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({wordCapitalize:[!1],wordIncludeNumber:[!1]}),this.saveSettings=new s.B,this.destroyed$=new s.B}ngOnChanges(e){return b(this,void 0,void 0,function*(){"account"in e&&this.account$.next(this.account)})}ngOnInit(){return b(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(m.qG.effWordList,{account$:this.account$});e.pipe((0,c.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,l.i)(1),(0,c.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,d.E)(this.settings.valueChanges),(0,a.T)(([,e])=>e),(0,c.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}w.ɵfac=function(e){return new(e||w)(n.rXU(r.ok),n.rXU(m.iE))},w.ɵcmp=n.VBU({type:w,selectors:[["tools-username-settings"]],inputs:{account:"account"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:11,vars:7,consts:[[1,"tw-container",3,"formGroup"],["bitCheckbox","","formControlName","wordCapitalize","type","checkbox",3,"change"],["bitCheckbox","","formControlName","wordIncludeNumber","type","checkbox",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0)(1,"bit-form-control")(2,"input",1),n.bIt("change",function(){return t.save("wordCapitalize")}),n.k0s(),n.j41(3,"bit-label"),n.EFF(4),n.nI1(5,"i18n"),n.k0s()(),n.j41(6,"bit-form-control")(7,"input",2),n.bIt("change",function(){return t.save("wordIncludeNumber")}),n.k0s(),n.j41(8,"bit-label"),n.EFF(9),n.nI1(10,"i18n"),n.k0s()()()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(4),n.JRh(n.bMT(5,3,"capitalize")),n.R7$(5),n.JRh(n.bMT(10,5,"includeNumber")))},dependencies:[r.X1,r.qT,r.Zm,r.BC,r.cb,r.j4,r.JD,h.L,f.f,g.j,p.q,y.P,u.p,v.$Z],encapsulation:2})},58605:(e,t,i)=>{"use strict";i.d(t,{Y:()=>n});class n{}},58625:(e,t,i)=>{"use strict";i.d(t,{p:()=>_});var n=i(77468),r=i(51757),s=i(82630),o=i(28846),a=i(94573),l=i(33812),c=i(22191),d=i(89207),u=i(75583),h=i(36288),p=i(58806),m=i(25740);function v(e,t){1&e&&(l.j41(0,"p",3),l.EFF(1),l.k0s()),2&e&&(l.R7$(),l.JRh(t))}function f(e,t){if(1&e&&(l.j41(0,"p",4),l.EFF(1),l.k0s()),2&e){const e=t.$implicit;l.R7$(),l.SpI(" ",e," ")}}const g={success:{icon:"bwi-check-circle",bgColor:"tw-bg-success-100"},error:{icon:"bwi-error",bgColor:"tw-bg-danger-100"},info:{icon:"bwi-info-circle",bgColor:"tw-bg-info-100"},warning:{icon:"bwi-exclamation-triangle",bgColor:"tw-bg-warning-100"}};class y{constructor(){this.variant=(0,a.hFB)("info"),this.message=a.hFB.required(),this.title=(0,a.hFB)(),this.progressWidth=(0,a.hFB)(0),this.onClose=new l.bkB}get iconClass(){return g[this.variant()].icon}get bgColor(){return g[this.variant()].bgColor}get messageArray(){const e=this.message();return Array.isArray(e)?e:[e]}}y.ɵfac=function(e){return new(e||y)},y.ɵcmp=l.VBU({type:y,selectors:[["bit-toast"]],inputs:{variant:[1,"variant"],message:[1,"message"],title:[1,"title"],progressWidth:[1,"progressWidth"]},outputs:{onClose:"onClose"},decls:13,vars:16,consts:[[1,"tw-flex","tw-items-center","tw-gap-4","tw-px-2","tw-pb-1","tw-pt-2"],["aria-hidden","true"],[1,"tw-sr-only"],["data-testid","toast-title",1,"tw-font-medium","tw-mb-0"],["bitTypography","body2","data-testid","toast-message",1,"tw-mb-2","last:tw-mb-0"],["bitIconButton","bwi-close","buttonType","main","type","button","size","small",1,"tw-ms-auto","hover:tw-border-text-main","focus-visible:before:tw-ring-text-main",3,"click","label"],[1,"tw-h-1","tw-w-full","tw-bg-text-main/30"]],template:function(e,t){if(1&e&&(l.j41(0,"div")(1,"div",0),l.nrm(2,"i",1),l.j41(3,"div")(4,"span",2),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.nVh(7,v,2,1,"p",3),l.Z7z(8,f,2,1,"p",4,l.fX1),l.k0s(),l.j41(10,"button",5),l.nI1(11,"i18n"),l.bIt("click",function(){return t.onClose.emit()}),l.k0s()(),l.nrm(12,"div",6),l.k0s()),2&e){let e;l.HbH(l.VkB("tw-mb-1 tw-min-w-[--bit-toast-width] tw-text-main tw-flex tw-flex-col tw-justify-between tw-rounded-md tw-pointer-events-auto tw-cursor-default tw-overflow-hidden tw-shadow-lg ",t.bgColor)),l.BMQ("role","error"===t.variant()?"alert":null),l.R7$(2),l.HbH(l.VkB("bwi tw-text-xl tw-py-1.5 tw-px-2.5 ",t.iconClass)),l.R7$(3),l.JRh(l.bMT(6,12,t.variant())),l.R7$(2),l.vxM((e=t.title())?7:-1,e),l.R7$(),l.Dyx(t.messageArray),l.R7$(2),l.Y8G("label",l.bMT(11,14,"close")),l.R7$(2),l.xc7("width",t.progressWidth()+"%")}},dependencies:[d.G,c.Q,h.s,u.E,p.r,m.$],encapsulation:2});class b extends s.y8{constructor(e,t){super(e,t)}}b.ɵfac=function(e){return new(e||b)(l.rXU(s.tw),l.rXU(s.sn))},b.ɵcmp=l.VBU({type:b,selectors:[["ng-component"]],features:[l.Vt3],decls:1,vars:4,consts:[[3,"onClose","title","variant","message","progressWidth"]],template:function(e,t){1&e&&(l.j41(0,"bit-toast",0),l.bIt("onClose",function(){return t.remove()}),l.k0s()),2&e&&l.Y8G("title",null==t.options||null==t.options.payload?null:t.options.payload.title)("variant",null==t.options||null==t.options.payload?null:t.options.payload.variant)("message",null==t.options||null==t.options.payload?null:t.options.payload.message)("progressWidth",t.width())},dependencies:[y],encapsulation:2,data:{animation:[(0,o.hZ)("flyInOut",[(0,o.wk)("inactive",(0,o.iF)({opacity:0})),(0,o.wk)("active",(0,o.iF)({opacity:1})),(0,o.wk)("removed",(0,o.iF)({opacity:0})),(0,o.kY)("inactive => active",(0,o.i0)("{{ easeTime }}ms {{ easing }}")),(0,o.kY)("active => removed",(0,o.i0)("{{ easeTime }}ms {{ easing }}"))])]}});var w=i(74208);class S{static forRoot(e={}){return{ngModule:S,providers:[{provide:s.lt,useValue:{default:I,config:e}}]}}}S.ɵfac=function(e){return new(e||S)},S.ɵmod=l.$C({type:S}),S.ɵinj=w.G2t({imports:[b]});const I=Object.assign(Object.assign({},s.H5),{toastComponent:b,tapToDismiss:!1,timeOut:5e3,extendedTimeOut:2e3,maxOpened:5,autoDismiss:!0,progressBar:!0});var k=i(37579),C=i(8297),T=i(26411),F=i(8433),R=i(29029),P=i(80351),x=i(47135),$=i(81573),E=i(47659),A=i(90647),D=i(59525),O=i(55807),M=i(26477),U=i(45674),G=i(2096),j=i(34530),N=i(90171),V=i(58270),B=i(78781),z=i(22848),L=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class K{constructor(e){this.keyService=e}transform(e,t){return L(this,void 0,void 0,function*(){try{"string"==typeof e&&(e=B.A.fromB64ToArray(e));const i=yield this.keyService.getFingerprint(t,e);return null!=i?i.join("-"):""}catch(i){return""}})}}K.ɵfac=function(e){return new(e||K)(l.rXU(z.Lu,16))},K.ɵpipe=l.EJ8({name:"fingerprint",type:K,pure:!0,standalone:!1});var q=i(88016);class _{}_.ɵfac=function(e){return new(e||_)},_.ɵmod=l.$C({type:_}),_.ɵinj=w.G2t({providers:[U.v,n.vh,q.$,j.R,N.b,V.c,K,G.n],imports:[S.forRoot({maxOpened:5,autoDismiss:!0,closeButton:!0}),n.MD,r.YN,r.X1,k.C,C.K,T.L,F.p,R.t,P.j,x.q,$.P,u.E,E.b,A.M,D.s,c.Q,O.o,M.V,O.o,S]})},58688:(e,t,i)=>{"use strict";i.d(t,{T:()=>g});var n=i(33812),r=i(72245),s=i(35500),o=i(77468),a=i(51757),l=i(86226),c=i(97553),d=i(43759),u=i(88016),h=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function p(e,t){if(1&e&&(n.j41(0,"form",2,0)(2,"bit-form-field")(3,"bit-label"),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.nrm(6,"input",3),n.k0s()()),2&e){const e=n.XpG();n.Y8G("formGroup",e.formGroup),n.R7$(4),n.JRh(n.bMT(5,2,"organizationName"))}}function m(e,t){1&e&&(n.j41(0,"bit-form-field",6)(1,"bit-label"),n.EFF(2),n.nI1(3,"i18n"),n.k0s(),n.nrm(4,"input",9),n.k0s()),2&e&&(n.R7$(2),n.JRh(n.bMT(3,1,"clientOwnerEmail")))}function v(e,t){if(1&e&&(n.j41(0,"div",5)(1,"bit-form-field",6)(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.nrm(5,"input",3),n.k0s(),n.j41(6,"bit-form-field",6)(7,"bit-label"),n.EFF(8),n.nI1(9,"i18n"),n.k0s(),n.nrm(10,"input",7),n.k0s(),n.DNE(11,m,5,3,"bit-form-field",8),n.k0s()),2&e){const e=n.XpG(2);n.R7$(3),n.JRh(n.bMT(4,3,"organizationName")),n.R7$(5),n.JRh(n.bMT(9,5,"email")),n.R7$(3),n.Y8G("ngIf",e.isProvider)}}function f(e,t){if(1&e&&(n.j41(0,"form",2,0)(2,"h2"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.DNE(5,v,12,7,"div",4),n.k0s()),2&e){const e=n.XpG();n.Y8G("formGroup",e.formGroup),n.R7$(3),n.JRh(n.bMT(4,3,"generalInformation")),n.R7$(2),n.Y8G("ngIf",e.createOrganization)}}class g{constructor(e){this.accountService=e,this.nameOnly=!1,this.createOrganization=!0,this.isProvider=!1,this.acceptingSponsorship=!1,this.changedBusinessOwned=new n.bkB}ngOnInit(){return h(this,void 0,void 0,function*(){var e,t,i;if(null===(i=null===(t=null===(e=this.formGroup)||void 0===e?void 0:e.controls)||void 0===t?void 0:t.billingEmail)||void 0===i?void 0:i.value)return;const n=yield(0,r._)(this.accountService.activeAccount$);(null==n?void 0:n.email)&&this.formGroup.controls.billingEmail.setValue(n.email)})}}g.ɵfac=function(e){return new(e||g)(n.rXU(s.Di))},g.ɵcmp=n.VBU({type:g,selectors:[["app-org-info"]],inputs:{nameOnly:"nameOnly",createOrganization:"createOrganization",isProvider:"isProvider",acceptingSponsorship:"acceptingSponsorship",formGroup:"formGroup"},outputs:{changedBusinessOwned:"changedBusinessOwned"},standalone:!1,decls:2,vars:2,consts:[["form",""],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["bitInput","","type","text","formControlName","name"],["class","tw-flex tw-w-full tw-space-x-4",4,"ngIf"],[1,"tw-flex","tw-w-full","tw-space-x-4"],[1,"tw-w-1/2"],["bitInput","","type","email","formControlName","billingEmail"],["class","tw-w-1/2",4,"ngIf"],["bitInput","","type","email","formControlName","clientOwnerEmail"]],template:function(e,t){1&e&&n.DNE(0,p,7,4,"form",1)(1,f,6,5,"form",1),2&e&&(n.Y8G("ngIf",t.nameOnly),n.R7$(),n.Y8G("ngIf",!t.nameOnly))},dependencies:[o.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,l.j,c.J,d.h,u.$],encapsulation:2})},58806:(e,t,i)=>{"use strict";i.d(t,{r:()=>a});var n=i(94573),r=i(33812);const s={h1:["!tw-text-3xl","tw-text-main","tw-font-medium"],h2:["!tw-text-2xl","tw-text-main","tw-font-medium"],h3:["!tw-text-xl","tw-text-main","tw-font-medium"],h4:["!tw-text-lg","tw-text-main","tw-font-medium"],h5:["!tw-text-base","tw-text-main","tw-font-medium"],h6:["!tw-text-sm","tw-text-main","tw-font-medium"],body1:["!tw-text-base"],body2:["!tw-text-sm"],helper:["!tw-text-xs"]},o={h1:["tw-mb-2"],h2:["tw-mb-2"],h3:["tw-mb-2"],h4:["tw-mb-2"],h5:["tw-mb-1.5"],h6:["tw-mb-1.5"],body1:[],body2:[],helper:[]};class a{constructor(){this.bitTypography=n.hFB.required(),this.noMargin=(0,n.hFB)(!1,{transform:n.L39})}get classList(){return s[this.bitTypography()].concat(this.noMargin()?[]:o[this.bitTypography()])}}a.ɵfac=function(e){return new(e||a)},a.ɵdir=r.FsC({type:a,selectors:[["","bitTypography",""]],hostVars:2,hostBindings:function(e,t){2&e&&r.HbH(t.classList)},inputs:{bitTypography:[1,"bitTypography"],noMargin:[1,"noMargin"]}})},58950:(e,t,i)=>{"use strict";i.d(t,{U:()=>o});var n=i(75583),r=i(33812);const s=["*",[["","slot","end"]]];class o{}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=r.VBU({type:o,selectors:[["bit-section-header"]],hostAttrs:[1,"tw-block","has-[+_*_bit-card]:tw-pb-1","has-[+_bit-card]:tw-pb-1","has-[+_*_bit-item]:tw-pb-1","has-[+_bit-item]:tw-pb-1","has-[+_*_bit-card]:tw-px-1","has-[+_bit-card]:tw-px-1","has-[+_*_bit-item]:tw-px-1","has-[+_bit-item]:tw-px-1"],ngContentSelectors:["*","[slot=end]"],decls:5,vars:0,consts:[[1,"tw-flex","tw-justify-between","tw-items-end","tw-gap-1"],[1,"[&>*]:tw-mb-0","[&>*]:tw-text-main","tw-flex","tw-items-center","tw-gap-1"],[1,"tw-text-muted","-tw-mb-0.5"]],template:function(e,t){1&e&&(r.NAR(s),r.rj2(0,"div",0)(1,"div",1),r.SdG(2),r.eux(),r.rj2(3,"div",2),r.SdG(4,1),r.eux()())},dependencies:[n.E],encapsulation:2})},59032:(e,t,i)=>{"use strict";i.d(t,{L:()=>u,o:()=>h});var n=i(94573),r=i(74208),s=i(33812),o=i(6307),a=i(23542);const l={primary:["!tw-text-primary-600","hover:!tw-text-primary-700","focus-visible:before:tw-ring-primary-600"],secondary:["!tw-text-main","hover:!tw-text-main","focus-visible:before:tw-ring-primary-600"],contrast:["!tw-text-contrast","hover:!tw-text-contrast","focus-visible:before:tw-ring-text-contrast"],light:["!tw-text-alt2","hover:!tw-text-alt2","focus-visible:before:tw-ring-text-alt2"]},c=["tw-text-unset","tw-leading-none","tw-px-0","tw-py-0.5","tw-font-semibold","tw-bg-transparent","tw-border-0","tw-border-none","tw-rounded","tw-transition","tw-no-underline","hover:tw-underline","hover:tw-decoration-1","disabled:tw-no-underline","disabled:tw-cursor-not-allowed","disabled:!tw-text-secondary-300","disabled:hover:!tw-text-secondary-300","disabled:hover:tw-no-underline","focus-visible:tw-outline-none","focus-visible:tw-underline","focus-visible:tw-decoration-1","tw-relative","before:tw-content-['']","before:tw-block","before:tw-absolute","before:-tw-inset-x-[0.1em]","before:tw-rounded-md","before:tw-transition","focus-visible:before:tw-ring-2","focus-visible:tw-z-10","aria-disabled:tw-no-underline","aria-disabled:tw-pointer-events-none","aria-disabled:!tw-text-secondary-300","aria-disabled:hover:!tw-text-secondary-300","aria-disabled:hover:tw-no-underline"];class d{constructor(){this.linkType=(0,n.hFB)("primary")}}d.ɵfac=function(e){return new(e||d)},d.ɵdir=s.FsC({type:d,inputs:{linkType:[1,"linkType"]}});class u extends d{get classList(){var e;return["before:-tw-inset-y-[0.125rem]"].concat(c).concat(null!==(e=l[this.linkType()])&&void 0!==e?e:[])}}u.ɵfac=(()=>{let e;return function(t){return(e||(e=s.xGo(u)))(t||u)}})(),u.ɵdir=s.FsC({type:u,selectors:[["a","bitLink",""]],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.classList)},features:[s.Vt3]});class h extends d{get classList(){var e;return["before:-tw-inset-y-[0.25rem]"].concat(c).concat(null!==(e=l[this.linkType()])&&void 0!==e?e:[])}constructor(){super(),this.el=(0,r.WQX)(s.aKT),this.disabled=(0,n.hFB)(!1,{transform:n.L39}),(0,o.m)(this.el.nativeElement,this.disabled)}}h.ɵfac=function(e){return new(e||h)},h.ɵdir=s.FsC({type:h,selectors:[["button","bitLink",""]],hostVars:2,hostBindings:function(e,t){2&e&&s.HbH(t.classList)},inputs:{disabled:[1,"disabled"]},features:[s.nM4([a.v]),s.Vt3]})},59257:(e,t,i)=>{"use strict";i.d(t,{m:()=>U,u:()=>j});var n=i(74208),r=i(3204),s=i(27442),o=i(33338),a=i(31857),l=i(84079),c=i(93695),d=i(75811),u=i(44500),h=i(11451),p=i(67553),m=i(18499),v=i(43978),f=i(84101),g=i(56962),y=i(22848),b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class w{constructor(){this.stateProvider=(0,n.WQX)(a.v2)}getNudgeStatus$(e,t){return this.stateProvider.getUser(t,G).state$.pipe((0,r.T)(t=>{var i;return null!==(i=null==t?void 0:t[e])&&void 0!==i?i:{hasBadgeDismissed:!1,hasSpotlightDismissed:!1}}))}nudgeStatus$(e,t){return this.getNudgeStatus$(e,t)}setNudgeStatus(e,t,i){return b(this,void 0,void 0,function*(){yield this.stateProvider.getUser(i,G).update(i=>(null!=i||(i={}),i[e]=t,i))})}}w.ɵfac=function(e){return new(e||w)},w.ɵprov=n.jDH({token:w,factory:w.ɵfac,providedIn:"root"});var S=i(33812),I=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class k extends w{constructor(){super(...arguments),this.vaultProfileService=(0,n.WQX)(h.r),this.logService=(0,n.WQX)(g.K),this.pinService=(0,n.WQX)(f.t),this.biometricStateService=(0,n.WQX)(y.vB),this.policyService=(0,n.WQX)(m.m),this.organizationService=(0,n.WQX)(p.PV)}nudgeStatus$(e,t){const i=(0,l.H)(this.vaultProfileService.getProfileCreationDate(t)).pipe((0,d.W)(()=>(this.logService.error("Failed to load profile date:"),(0,c.of)(new Date))));return(0,o.z)([i,this.getNudgeStatus$(e,t),(0,c.of)(Date.now()-2592e6),(0,l.H)(this.pinService.isPinSet(t)),this.biometricStateService.biometricUnlockEnabled$,this.organizationService.organizations$(t),this.policyService.policiesByType$(v.tt.RemoveUnlockWithPin,t)]).pipe((0,u.n)(i=>I(this,[i],void 0,function*([i,n,r,s,o,a,l]){const c=i.getTime()<r,d=a.some(e=>l.some(t=>t.type===v.tt.RemoveUnlockWithPin&&t.organizationId===e.id)),u=c||s||o||d,h={hasBadgeDismissed:n.hasBadgeDismissed||u,hasSpotlightDismissed:n.hasSpotlightDismissed||u};return(s||o||d)&&!n.hasSpotlightDismissed&&(yield this.setNudgeStatus(e,h,t)),h})))}}k.ɵfac=(()=>{let e;return function(t){return(e||(e=S.xGo(k)))(t||k)}})(),k.ɵprov=n.jDH({token:k,factory:k.ɵfac,providedIn:"root"});var C=i(5556),T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class F extends w{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(C.p),this.vaultProfileService=(0,n.WQX)(h.r),this.logService=(0,n.WQX)(g.K)}nudgeStatus$(e,t){const i=(0,l.H)(this.vaultProfileService.getProfileCreationDate(t)).pipe((0,d.W)(()=>(this.logService.error("Error getting profile creation date"),(0,c.of)(new Date))));return(0,o.z)([this.cipherService.cipherViews$(t),this.getNudgeStatus$(e,t),i,(0,c.of)(Date.now()-2592e6)]).pipe((0,u.n)(i=>T(this,[i],void 0,function*([i,n,r,s]){const o=r.getTime()<s,a=null==i?void 0:i.filter(e=>null==e.deletedDate);if(o&&a.length>0&&!n.hasSpotlightDismissed){const i={hasSpotlightDismissed:!0,hasBadgeDismissed:!0};return yield this.setNudgeStatus(e,i,t),yield this.setNudgeStatus(U.EmptyVaultNudge,i,t),i}return n.hasSpotlightDismissed?n:{hasBadgeDismissed:null==a||0===a.length,hasSpotlightDismissed:null==a||0===a.length}})))}}F.ɵfac=(()=>{let e;return function(t){return(e||(e=S.xGo(F)))(t||F)}})(),F.ɵprov=n.jDH({token:F,factory:F.ɵfac,providedIn:"root"});var R=i(28202);class P extends w{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(C.p),this.organizationService=(0,n.WQX)(p.PV),this.collectionService=(0,n.WQX)(R.YD)}nudgeStatus$(e,t){return(0,o.z)([this.getNudgeStatus$(e,t),this.cipherService.cipherListViews$(t),this.organizationService.organizations$(t),this.collectionService.decryptedCollections$(t)]).pipe((0,u.n)(([e,t,i,n])=>{const r=!(null==t||0===t.length);if(null==i||0===i.length)return e.hasBadgeDismissed||e.hasSpotlightDismissed?(0,c.of)(e):(0,c.of)({hasSpotlightDismissed:r,hasBadgeDismissed:r});const s=new Set(i.map(e=>e.id)),o=i.some(e=>e.canCreateNewCollections),a=n.some(e=>e.manage&&s.has(e.organizationId));return e.hasBadgeDismissed||e.hasSpotlightDismissed?(0,c.of)(e):a||o?(0,c.of)({hasSpotlightDismissed:r,hasBadgeDismissed:r}):(0,c.of)({hasSpotlightDismissed:!0,hasBadgeDismissed:!0})}))}}P.ɵfac=(()=>{let e;return function(t){return(e||(e=S.xGo(P)))(t||P)}})(),P.ɵprov=n.jDH({token:P,factory:P.ɵfac,providedIn:"root"});class x extends w{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(C.p),this.organizationService=(0,n.WQX)(p.PV),this.collectionService=(0,n.WQX)(R.YD)}nudgeStatus$(e,t){return(0,o.z)([this.getNudgeStatus$(e,t),this.cipherService.cipherViews$(t),this.organizationService.organizations$(t),this.collectionService.decryptedCollections$(t)]).pipe((0,u.n)(([e,t,i,n])=>{var r,s;const o=(null!==(r=null==t?void 0:t.length)&&void 0!==r?r:0)>1,{hasBadgeDismissed:a,hasSpotlightDismissed:l}=e;if(0===(null!==(s=null==i?void 0:i.length)&&void 0!==s?s:0))return a||l?(0,c.of)(e):(0,c.of)({hasSpotlightDismissed:o,hasBadgeDismissed:o});const d=new Set(i.map(e=>e.id)),u=i.some(e=>e.canCreateNewCollections),h=n.some(e=>e.manage&&d.has(e.organizationId));return a||l?(0,c.of)(e):h||u?(0,c.of)({hasSpotlightDismissed:o,hasBadgeDismissed:o}):(0,c.of)({hasSpotlightDismissed:!0,hasBadgeDismissed:!0})}))}}x.ɵfac=(()=>{let e;return function(t){return(e||(e=S.xGo(x)))(t||x)}})(),x.ɵprov=n.jDH({token:x,factory:x.ɵfac,providedIn:"root"});var $=i(69194),E=i(31442),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class D extends w{constructor(){super(...arguments),this.cipherService=(0,n.WQX)(C.p)}nudgeStatus$(e,t){return(0,o.z)([this.getNudgeStatus$(e,t),this.cipherService.cipherViews$(t).pipe((0,$.p)(e=>null!=e))]).pipe((0,u.n)(i=>A(this,[i],void 0,function*([i,n]){if(i.hasSpotlightDismissed)return i;let r;switch(e){case U.NewLoginItemStatus:r=E.gC.Login;break;case U.NewCardItemStatus:r=E.gC.Card;break;case U.NewIdentityItemStatus:r=E.gC.Identity;break;case U.NewNoteItemStatus:r=E.gC.SecureNote;break;case U.NewSshItemStatus:r=E.gC.SshKey}if(n.some(e=>e.type===r)&&!i.hasSpotlightDismissed){const i={hasSpotlightDismissed:!0,hasBadgeDismissed:!0};return yield this.setNudgeStatus(e,i,t),i}return i})))}}D.ɵfac=(()=>{let e;return function(t){return(e||(e=S.xGo(D)))(t||D)}})(),D.ɵprov=n.jDH({token:D,factory:D.ɵfac,providedIn:"root"});class O extends w{constructor(){super(...arguments),this.vaultProfileService=(0,n.WQX)(h.r),this.logService=(0,n.WQX)(g.K)}nudgeStatus$(e,t){const i=(0,l.H)(this.vaultProfileService.getProfileCreationDate(t)).pipe((0,d.W)(()=>(this.logService.error("Error getting profile creation date"),(0,c.of)(new Date))));return(0,o.z)([i,this.getNudgeStatus$(e,t),(0,c.of)(Date.now()-2592e6)]).pipe((0,r.T)(([e,t,i])=>{const n=e.getTime()<i;return{hasBadgeDismissed:t.hasBadgeDismissed||n,hasSpotlightDismissed:t.hasSpotlightDismissed||n}}))}}O.ɵfac=(()=>{let e;return function(t){return(e||(e=S.xGo(O)))(t||O)}})(),O.ɵprov=n.jDH({token:O,factory:O.ɵfac,providedIn:"root"});var M=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const U={EmptyVaultNudge:"empty-vault-nudge",VaultSettingsImportNudge:"vault-settings-import-nudge",HasVaultItems:"has-vault-items",AutofillNudge:"autofill-nudge",AccountSecurity:"account-security",DownloadBitwarden:"download-bitwarden",NewLoginItemStatus:"new-login-item-status",NewCardItemStatus:"new-card-item-status",NewIdentityItemStatus:"new-identity-item-status",NewNoteItemStatus:"new-note-item-status",NewSshItemStatus:"new-ssh-item-status",GeneratorNudgeStatus:"generator-nudge-status",PremiumUpgrade:"premium-upgrade"},G=new a.Ok(a.bI,"vaultNudgeDismissed",{deserializer:e=>e,clearOn:[]});class j{constructor(){this.newItemNudgeService=(0,n.WQX)(D),this.newAcctNudgeService=(0,n.WQX)(O),this.customNudgeServices={[U.HasVaultItems]:(0,n.WQX)(F),[U.EmptyVaultNudge]:(0,n.WQX)(P),[U.VaultSettingsImportNudge]:(0,n.WQX)(x),[U.AccountSecurity]:(0,n.WQX)(k),[U.AutofillNudge]:this.newAcctNudgeService,[U.DownloadBitwarden]:this.newAcctNudgeService,[U.GeneratorNudgeStatus]:this.newAcctNudgeService,[U.NewLoginItemStatus]:this.newItemNudgeService,[U.NewCardItemStatus]:this.newItemNudgeService,[U.NewIdentityItemStatus]:this.newItemNudgeService,[U.NewNoteItemStatus]:this.newItemNudgeService,[U.NewSshItemStatus]:this.newItemNudgeService},this.defaultNudgeService=(0,n.WQX)(w)}getNudgeService(e){var t;return null!==(t=this.customNudgeServices[e])&&void 0!==t?t:this.defaultNudgeService}showNudgeSpotlight$(e,t){return this.getNudgeService(e).nudgeStatus$(e,t).pipe((0,r.T)(e=>!e.hasSpotlightDismissed))}showNudgeBadge$(e,t){return this.getNudgeService(e).nudgeStatus$(e,t).pipe((0,r.T)(e=>!e.hasBadgeDismissed))}showNudgeStatus$(e,t){return this.getNudgeService(e).nudgeStatus$(e,t)}dismissNudge(e,t){return M(this,arguments,void 0,function*(e,t,i=!1){const n=i?{hasBadgeDismissed:!0,hasSpotlightDismissed:!1}:{hasBadgeDismissed:!0,hasSpotlightDismissed:!0};yield this.getNudgeService(e).setNudgeStatus(e,n,t)})}hasActiveBadges$(e){const t=[U.EmptyVaultNudge,U.DownloadBitwarden,U.AutofillNudge].map(t=>this.getNudgeService(t).nudgeStatus$(t,e).pipe((0,r.T)(e=>!(null==e?void 0:e.hasBadgeDismissed)),(0,s.t)({refCount:!1,bufferSize:1})));return(0,o.z)(t).pipe((0,r.T)(e=>e.some(e=>!0===e)))}}j.ɵfac=function(e){return new(e||j)},j.ɵprov=n.jDH({token:j,factory:j.ɵfac,providedIn:"root"})},59281:(e,t,i)=>{"use strict";i.d(t,{e:()=>n});class n{constructor(e){null!=e&&(this.id=e.id,this.url=e.url,this.fileName=e.fileName,this.key=e.key,this.size=e.size,this.sizeName=e.sizeName)}}},59303:(e,t,i)=>{"use strict";i.d(t,{e:()=>s,k:()=>o});var n=i(16878);const r=new Proxy(Object.freeze({}),{get:()=>({})});class s{constructor(){this.constraints=r}calibrate(){return this}adjust(e){return e}fix(e){return e}}function o(){const e=new s;return new n.t(e)}},59333:(e,t,i)=>{"use strict";i.d(t,{J:()=>m});var n=i(25607),r=i(12277),s=i(20702),o=i(42700);class a extends s.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.granteeId=this.getResponseProperty("GranteeId"),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.waitTimeDays=this.getResponseProperty("WaitTimeDays"),this.creationDate=this.getResponseProperty("CreationDate"),this.avatarColor=this.getResponseProperty("AvatarColor")}}class l extends s.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.grantorId=this.getResponseProperty("GrantorId"),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.waitTimeDays=this.getResponseProperty("WaitTimeDays"),this.creationDate=this.getResponseProperty("CreationDate"),this.avatarColor=this.getResponseProperty("AvatarColor")}}class c extends s.r{constructor(e){super(e),this.keyEncrypted=this.getResponseProperty("KeyEncrypted"),this.kdf=this.getResponseProperty("Kdf"),this.kdfIterations=this.getResponseProperty("KdfIterations"),this.kdfMemory=this.getResponseProperty("KdfMemory"),this.kdfParallelism=this.getResponseProperty("KdfParallelism")}}class d extends s.r{constructor(e){super(e),this.ciphers=[],this.keyEncrypted=this.getResponseProperty("KeyEncrypted");const t=this.getResponseProperty("Ciphers");null!=t&&(this.ciphers=t.map(e=>new o.N(e)))}}var u=i(74208),h=i(12012),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class m{constructor(e){this.apiService=e}getEmergencyAccessTrusted(){return p(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/emergency-access/trusted",null,!0,!0);return new r.s(e,a)})}getEmergencyAccessGranted(){return p(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/emergency-access/granted",null,!0,!0);return new r.s(e,l)})}getEmergencyAccess(e){return p(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/emergency-access/"+e,null,!0,!0);return new a(t)})}getEmergencyGrantorPolicies(e){return p(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/emergency-access/"+e+"/policies",null,!0,!0);return new r.s(t,n.i)})}putEmergencyAccess(e,t){return this.apiService.send("PUT","/emergency-access/"+e,t,!0,!1)}deleteEmergencyAccess(e){return this.apiService.send("DELETE","/emergency-access/"+e,null,!0,!1)}postEmergencyAccessInvite(e){return this.apiService.send("POST","/emergency-access/invite",e,!0,!1)}postEmergencyAccessReinvite(e){return this.apiService.send("POST","/emergency-access/"+e+"/reinvite",null,!0,!1)}postEmergencyAccessAccept(e,t){return this.apiService.send("POST","/emergency-access/"+e+"/accept",t,!0,!1)}postEmergencyAccessConfirm(e,t){return this.apiService.send("POST","/emergency-access/"+e+"/confirm",t,!0,!1)}postEmergencyAccessInitiate(e){return this.apiService.send("POST","/emergency-access/"+e+"/initiate",null,!0,!1)}postEmergencyAccessApprove(e){return this.apiService.send("POST","/emergency-access/"+e+"/approve",null,!0,!1)}postEmergencyAccessReject(e){return this.apiService.send("POST","/emergency-access/"+e+"/reject",null,!0,!1)}postEmergencyAccessTakeover(e){return p(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/emergency-access/"+e+"/takeover",null,!0,!0);return new c(t)})}postEmergencyAccessPassword(e,t){return p(this,void 0,void 0,function*(){yield this.apiService.send("POST","/emergency-access/"+e+"/password",t,!0,!0)})}postEmergencyAccessView(e){return p(this,void 0,void 0,function*(){const t=yield this.apiService.send("POST","/emergency-access/"+e+"/view",null,!0,!0);return new d(t)})}}m.ɵfac=function(e){return new(e||m)(u.KVO(h.G))},m.ɵprov=u.jDH({token:m,factory:m.ɵfac})},59525:(e,t,i)=>{"use strict";i.d(t,{s:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},59557:(e,t,i)=>{"use strict";i.d(t,{K:()=>h});var n=i(77468),r=i(94573),s=i(6056);const o=i(13299).Sm`
<svg version="1.1" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg">
<title>Vaultwarden</title>
<g clip-path="url(#bitwarden-shield-clip)" class="tw-fill-text-alt2">
 <path d="m18 11-5.6.00073 15 42h5.3l15-42h-5.6l-9.5 27c-.63 1.7-1.2 3.4-1.6 4.9-.43 1.5-.79 2.9-1.1 4.3-.28-1.4-.63-2.8-1.1-4.4-.43-1.5-.97-3.2-1.6-5l-9.5-27z"/>
 <path d="m30 0.05c-0.19 0.068-0.34 0.2-0.44 0.37l-1.5 2.5c-0.27 0.022-0.53 0.046-0.8 0.076l-2-2.2c-0.43-0.44-1.2-0.29-1.4 0.29l-1 2.8c-0.26 0.074-0.51 0.15-0.77 0.23l-2.4-1.8c-0.52-0.45-1.3-0.12-1.4 0.56l-0.44 2.9c-0.23 0.12-0.47 0.24-0.7 0.37l-2.7-1.3c-0.58-0.26-1.2 0.18-1.2 0.81l0.14 3c-0.2 0.16-0.4 0.33-0.6 0.49l-2.9-0.72c-0.59-0.12-1.1 0.41-1 1l0.72 2.9c-0.17 0.2-0.33 0.4-0.49 0.6l-3-0.14c-0.63-0.027-1.1 0.62-0.81 1.2l1.3 2.7c-0.13 0.23-0.25 0.46-0.37 0.7l-2.9 0.44c-0.68 0.068-1 0.88-0.56 1.4l1.8 2.4c-0.081 0.25-0.16 0.51-0.23 0.77l-2.8 1c-0.58 0.22-0.73 0.97-0.29 1.4l2.2 2c-0.03 0.26-0.054 0.53-0.076 0.8l-2.5 1.5c-0.6 0.32-0.6 1.2 0 1.5l2.5 1.5c0.022 0.27 0.046 0.53 0.076 0.8l-2.2 2c-0.44 0.43-0.29 1.2 0.29 1.4l2.8 1c0.074 0.26 0.15 0.51 0.23 0.77l-1.8 2.4c-0.45 0.52-0.12 1.3 0.56 1.4l2.9 0.44c0.12 0.23 0.24 0.47 0.37 0.7l-1.3 2.7c-0.26 0.58 0.18 1.2 0.81 1.2l3-0.14c0.16 0.2 0.33 0.4 0.49 0.6l-0.72 2.9c-0.12 0.59 0.41 1.1 1 1l2.9-0.72c0.2 0.17 0.4 0.33 0.6 0.49l-0.14 3c-0.027 0.63 0.62 1.1 1.2 0.81l2.7-1.3c0.23 0.13 0.46 0.25 0.7 0.37l0.44 2.9c0.068 0.68 0.88 1 1.4 0.56l2.4-1.8c0.25 0.081 0.51 0.16 0.77 0.23l1 2.8c0.22 0.58 0.97 0.73 1.4 0.29l2-2.2c0.26 0.03 0.53 0.054 0.8 0.076l1.5 2.5c0.32 0.6 1.2 0.6 1.5 0l1.5-2.5c0.27-0.022 0.53-0.046 0.8-0.076l2 2.2c0.43 0.44 1.2 0.29 1.4-0.29l1-2.8c0.26-0.074 0.51-0.15 0.77-0.23l2.4 1.8c0.52 0.45 1.3 0.12 1.4-0.56l0.44-2.9c0.23-0.12 0.47-0.24 0.7-0.37l2.7 1.3c0.58 0.26 1.2-0.18 1.2-0.81l-0.14-3c0.2-0.16 0.4-0.33 0.6-0.49l2.9 0.72c0.59 0.12 1.1-0.41 1-1l-0.72-2.9c0.17-0.2 0.33-0.4 0.49-0.6l3 0.14c0.63 0.027 1.1-0.62 0.81-1.2l-1.3-2.7c0.13-0.23 0.25-0.46 0.37-0.7l2.9-0.44c0.68-0.068 1-0.88 0.56-1.4l-1.8-2.4c0.081-0.25 0.16-0.51 0.23-0.77l2.8-1c0.58-0.22 0.73-0.97 0.29-1.4l-2.2-2c0.03-0.26 0.054-0.53 0.076-0.8l2.5-1.5c0.6-0.32 0.6-1.2 0-1.5l-2.5-1.5c-0.022-0.27-0.046-0.53-0.076-0.8l2.2-2c0.44-0.43 0.29-1.2-0.29-1.4l-2.8-1c-0.074-0.26-0.15-0.51-0.23-0.77l1.8-2.4c0.45-0.52 0.12-1.3-0.56-1.4l-2.9-0.44c-0.12-0.23-0.24-0.47-0.37-0.7l1.3-2.7c0.26-0.58-0.18-1.2-0.81-1.2l-3 0.14c-0.16-0.2-0.33-0.4-0.49-0.6l0.72-2.9c0.12-0.59-0.41-1.1-1-1l-2.9 0.72c-0.2-0.17-0.4-0.33-0.6-0.49l0.14-3c0.027-0.63-0.62-1.1-1.2-0.81l-2.7 1.3c-0.23-0.13-0.46-0.25-0.7-0.37l-0.44-2.9c-0.068-0.68-0.88-1-1.4-0.56l-2.4 1.8c-0.25-0.081-0.51-0.16-0.77-0.23l-1-2.8c-0.22-0.58-0.97-0.73-1.4-0.29l-2 2.2c-0.26-0.03-0.53-0.054-0.8-0.076l-1.5-2.5c-0.2-0.34-0.62-0.5-1-0.37zm0.29 5.4c0.94 0 1.7 0.76 1.7 1.7s-0.76 1.7-1.7 1.7-1.7-0.76-1.7-1.7 0.76-1.7 1.7-1.7zm-4 2.9 2.8 2.8c0.66 0.66 1.7 0.66 2.4 0l2.8-2.8c6.6 1.2 12 5.4 15 11l-1.8 3.6c-0.43 0.84-0.097 1.9 0.75 2.3l3.6 1.8c0.12 0.92 0.18 1.9 0.18 2.8 0 5.8-2.3 11-6 15l-4-0.63c-0.94-0.18-1.8 0.45-2 1.4l-0.63 4c-2.8 1.3-6 2.1-9.4 2.1s-6.5-0.76-9.4-2.1l-0.63-4c-0.15-0.95-1.1-1.6-2-1.4l-4 0.63c-3.7-3.9-6-9.2-6-15 0-0.96 0.064-1.9 0.18-2.8l3.6-1.8c0.85-0.42 1.2-1.5 0.75-2.3l-1.8-3.6c3.1-5.7 8.6-9.8 15-11zm-18 13c0.16 0.0045 0.32 0.032 0.48 0.083 0.93 0.29 1.4 1.3 1.1 2.2-0.29 0.93-1.3 1.4-2.2 1.1-0.93-0.29-1.4-1.3-1.1-2.2 0.23-0.74 0.93-1.2 1.7-1.2zm43 0c0.77-0.034 1.5 0.46 1.7 1.2 0.33 0.91-0.17 1.9-1.1 2.2-0.91 0.33-1.9-0.17-2.2-1.1-0.33-0.91 0.17-1.9 1.1-2.2 0.16-0.051 0.32-0.079 0.48-0.083zm-35 25c0.33 0.017 0.64 0.13 0.91 0.32 0.78 0.55 0.95 1.6 0.38 2.4-0.55 0.78-1.6 0.95-2.4 0.38-0.78-0.55-0.95-1.6-0.38-2.4 0.34-0.48 0.91-0.74 1.5-0.7zm27 0c0.59-0.042 1.2 0.22 1.5 0.7 0.57 0.77 0.4 1.8-0.38 2.4-0.77 0.57-1.8 0.4-2.4-0.38-0.57-0.77-0.4-1.8 0.38-2.4 0.27-0.19 0.58-0.3 0.91-0.32z"/>
</g>
<defs>
  <clipPath id="bitwarden-shield-clip">
    <path class="tw-fill-text-alt2" d="M0 0h60v60H0z"/>
  </clipPath>
</defs>
</svg>
`;var a=i(58384),l=i(33812),c=i(21823);const d=(e,t)=>({"tw-sticky tw-top-0 tw-z-50 tw-pb-4":e,"tw-pb-[calc(theme(spacing.8)_+_2px)]":t}),u=(e,t)=>({"!tw-h-[55px] [&_svg]:!tw-w-[26px] [&_svg]:tw-inset-y-[theme(spacing.3)]":e,"tw-w-56":t});class h{constructor(e){this.sideNavService=e,this.closedIcon=(0,r.hFB)(o),this.openIcon=r.hFB.required(),this.route=r.hFB.required(),this.label=r.hFB.required()}}h.ɵfac=function(e){return new(e||h)(l.rXU(c.G))},h.ɵcmp=l.VBU({type:h,selectors:[["bit-nav-logo"]],inputs:{closedIcon:[1,"closedIcon"],openIcon:[1,"openIcon"],route:[1,"route"],label:[1,"label"]},decls:3,vars:13,consts:[[1,"tw-px-2","tw-pt-2",3,"ngClass"],["routerLinkActive","",1,"tw-relative","tw-p-3","tw-block","tw-rounded-md","tw-bg-background-alt3","tw-outline-none","focus-visible:tw-ring","focus-visible:tw-ring-inset","focus-visible:tw-ring-text-alt2","hover:tw-bg-hover-contrast","tw-h-[73px]","[&_svg]:tw-absolute","[&_svg]:tw-inset-[theme(spacing.3)]","[&_svg]:tw-w-[calc(100%_-_theme(spacing.6))]","[&_svg]:tw-transition-[inline-start-inset]",3,"routerLink","ngClass","title","ariaCurrentWhenActive"],[3,"icon"]],template:function(e,t){1&e&&(l.j41(0,"div",0)(1,"a",1),l.nrm(2,"bit-icon",2),l.k0s()()),2&e&&(l.Y8G("ngClass",l.l_i(7,d,t.sideNavService.open,!t.sideNavService.open)),l.R7$(),l.Y8G("routerLink",t.route())("ngClass",l.l_i(10,u,!t.sideNavService.open,t.sideNavService.open))("title",t.label())("ariaCurrentWhenActive","page"),l.BMQ("aria-label",t.label()),l.R7$(),l.Y8G("icon",t.sideNavService.open?t.openIcon():t.closedIcon()))},dependencies:[n.MD,n.YU,s.wQ,s.Wk,a.i],encapsulation:2})},59777:(e,t,i)=>{"use strict";i.d(t,{D:()=>r,L:()=>n});const n={Domain:0,Host:1,StartsWith:2,Exact:3,RegularExpression:4,Never:5};function r(e){if(null!=e)switch(e){case 0:case 1:case 2:case 3:case 4:case 5:return e;default:return}}},60276:(e,t,i)=>{"use strict";i.d(t,{G:()=>w,V:()=>b});var n=i(33338),r=i(3204),s=i(27442),o=i(44500),a=i(1036),l=i(685),c=i(3633),d=i(59777),u=i(78781),h=i(31857),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const m=new h.Zs(h.XH,"showFavicons",{deserializer:e=>null==e||e}),v=new h.Zs(h.XH,"neverDomains",{deserializer:e=>null!=e?e:null}),f=new h.Zs(h.XH,"blockedInteractionsUris",{deserializer:e=>null!=e?e:{}}),g=new h.Ok(h.XH,"equivalentDomains",{deserializer:e=>null!=e?e:null,clearOn:["logout"]}),y=new h.Ok(h.XH,"defaultUriMatchStrategy",{deserializer:e=>null!=e?e:d.L.Domain,clearOn:[]});class b{}class w{constructor(e,t,i){this.stateProvider=e,this.policyService=t,this.accountService=i,this.showFaviconsState=this.stateProvider.getGlobal(m),this.showFavicons$=this.showFaviconsState.state$.pipe((0,r.T)(e=>null==e||e)),this.neverDomainsState=this.stateProvider.getGlobal(v),this.neverDomains$=this.neverDomainsState.state$.pipe((0,r.T)(e=>null!=e?e:null)),this.blockedInteractionsUrisState=this.stateProvider.getGlobal(f),this.blockedInteractionsUris$=this.blockedInteractionsUrisState.state$.pipe((0,r.T)(e=>null!=e?e:{})),this.equivalentDomainsState=this.stateProvider.getActive(g),this.equivalentDomains$=this.equivalentDomainsState.state$.pipe((0,r.T)(e=>null!=e?e:null)),this.defaultUriMatchStrategyState=this.stateProvider.getActive(y),this.defaultUriMatchStrategy$=this.defaultUriMatchStrategyState.state$.pipe((0,r.T)(e=>null!=e?e:d.L.Domain)),this.defaultUriMatchStrategyPolicy$=this.accountService.activeAccount$.pipe(c.F6,(0,o.n)(e=>this.policyService.policiesByType$(a.t.UriMatchDefaults,e)),l.Zc,(0,r.T)(e=>{var t;if(!(null==e?void 0:e.enabled)||null==(null==e?void 0:e.data))return null;const i=null===(t=e.data)||void 0===t?void 0:t.uriMatchDetection;return Object.values(d.L).includes(i)?i:null}),(0,s.t)({bufferSize:1,refCount:!0})),this.resolvedDefaultUriMatchStrategy$=(0,n.z)([this.defaultUriMatchStrategy$,this.defaultUriMatchStrategyPolicy$]).pipe((0,r.T)(([e,t])=>t||e),(0,s.t)({bufferSize:1,refCount:!0}))}setShowFavicons(e){return p(this,void 0,void 0,function*(){yield this.showFaviconsState.update(()=>e)})}setNeverDomains(e){return p(this,void 0,void 0,function*(){yield this.neverDomainsState.update(()=>e)})}setBlockedInteractionsUris(e){return p(this,void 0,void 0,function*(){yield this.blockedInteractionsUrisState.update(()=>e)})}setEquivalentDomains(e,t){return p(this,void 0,void 0,function*(){yield this.stateProvider.getUser(t,g).update(()=>e)})}setDefaultUriMatchStrategy(e){return p(this,void 0,void 0,function*(){yield this.defaultUriMatchStrategyState.update(()=>e)})}getUrlEquivalentDomains(e){return this.equivalentDomains$.pipe((0,r.T)(t=>{const i=u.A.getDomain(e);if(null==i||null==t)return new Set;const n=t.filter(e=>e.includes(i)).flat();return new Set(n)}))}}},60512:(e,t,i)=>{"use strict";function n(e,t,i){if(null==e)throw new Error(`${t} is null or undefined.${i?` ${i}`:""}`)}i.d(t,{x:()=>n})},60893:(e,t,i)=>{"use strict";i.d(t,{t:()=>o});var n=i(5520),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.S]})},60954:(e,t,i)=>{"use strict";i.d(t,{u:()=>n,x:()=>r});class n{}class r extends n{}},61182:(e,t,i)=>{"use strict";i.d(t,{d:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.type=this.getResponseProperty("Type"),this.name=this.getResponseProperty("Name"),this.value=this.getResponseProperty("Value"),this.linkedId=this.getResponseProperty("linkedId"))}}},61325:(e,t,i)=>{"use strict";i.d(t,{n:()=>a});var n,r=i(59777),s=i(31442),o=i(16671);class a{}n=a,a.isCipherListView=e=>"object"==typeof e.type||"string"==typeof e.type,a.getLogin=e=>n.isCipherListView(e)?"object"!=typeof e.type?null:"login"in e.type?e.type.login:null:e.type===s.gC.Login?e.login:null,a.uri=e=>{var t;const i=n.getLogin(e);return i?"uri"in i?i.uri:(null===(t=i.uris)||void 0===t?void 0:t.length)?i.uris[0].uri:null:null},a.getCard=e=>n.isCipherListView(e)?"object"!=typeof e.type?null:"card"in e.type?e.type.card:null:e.type===s.gC.Card?e.card:null,a.isArchived=e=>n.isCipherListView(e)?!!e.archivedDate:e.isArchived,a.isDeleted=e=>n.isCipherListView(e)?!!e.deletedDate:e.isDeleted,a.isUnassigned=e=>n.isCipherListView(e)?null!=e.organizationId&&(null==e.collectionIds||0===e.collectionIds.length):e.isUnassigned,a.canAssignToCollections=e=>n.isCipherListView(e)?!e.organizationId||e.edit&&e.viewPassword:e.canAssignToCollections,a.getType=e=>{if(!n.isCipherListView(e))return e.type;switch(!0){case"secureNote"===e.type:return s.gC.SecureNote;case"sshKey"===e.type:return s.gC.SshKey;case"identity"===e.type:return s.gC.Identity;case"object"==typeof e.type&&"card"in e.type:return s.gC.Card;case"object"==typeof e.type&&"login"in e.type:return s.gC.Login;default:throw new Error(`Unknown cipher type: ${e.type}`)}},a.subtitle=e=>n.isCipherListView(e)?e.subtitle:e.subTitle,a.hasAttachments=e=>n.isCipherListView(e)?"number"==typeof e.attachments&&e.attachments>0:e.hasAttachments,a.canLaunch=e=>{var t;const i=n.getLogin(e);return!!i&&!!(null===(t=i.uris)||void 0===t?void 0:t.map(e=>c(e)).some(e=>e.canLaunch))},a.getLaunchUri=e=>{var t,i;const r=n.getLogin(e);if(r)return null===(i=null===(t=r.uris)||void 0===t?void 0:t.map(e=>c(e)).find(e=>e.canLaunch))||void 0===i?void 0:i.launchUri},a.matchesUri=(e,t,i,a=r.L.Domain,l)=>{var c;if(n.getType(e)!==s.gC.Login)return!1;if(!n.isCipherListView(e))return e.login.matchesUri(t,i,a,l);const d=n.getLogin(e);if(!(null===(c=null==d?void 0:d.uris)||void 0===c?void 0:c.length))return!1;const u=d.uris.filter(e=>!!e.uri).map(e=>{var t;const i=new o.z;return i.match=null!==(t=e.match)&&void 0!==t?t:a,i.uri=e.uri,i});return u.some(e=>e.matchesUri(t,i,a,l))},a.hasCopyableValue=(e,t)=>{var i,r,o,a,c,d,u,h,p,m,v,f;if(n.isCipherListView(e)){let i=t;return"username"===i&&n.getType(e)===s.gC.Login?i="usernameLogin":"username"===i&&n.getType(e)===s.gC.Identity&&(i="usernameIdentity"),e.copyableFields.includes(l[i])}switch(t){case"username":return!!(null===(i=e.login)||void 0===i?void 0:i.username)||!!(null===(r=e.identity)||void 0===r?void 0:r.username);case"password":return!!(null===(o=e.login)||void 0===o?void 0:o.password);case"totp":return!!(null===(a=e.login)||void 0===a?void 0:a.totp);case"cardNumber":return!!(null===(c=e.card)||void 0===c?void 0:c.number);case"securityCode":return!!(null===(d=e.card)||void 0===d?void 0:d.code);case"email":return!!(null===(u=e.identity)||void 0===u?void 0:u.email);case"phone":return!!(null===(h=e.identity)||void 0===h?void 0:h.phone);case"address":return!!(null===(p=e.identity)||void 0===p?void 0:p.fullAddressForCopy);case"secureNote":return!!e.notes;case"privateKey":return!!(null===(m=e.sshKey)||void 0===m?void 0:m.privateKey);case"publicKey":return!!(null===(v=e.sshKey)||void 0===v?void 0:v.publicKey);case"keyFingerprint":return!!(null===(f=e.sshKey)||void 0===f?void 0:f.keyFingerprint);default:return!1}},a.hasFido2Credentials=e=>{var t;const i=n.getLogin(e);return!!(null===(t=null==i?void 0:i.fido2Credentials)||void 0===t?void 0:t.length)},a.decryptionFailure=e=>"decryptionFailure"in e&&e.decryptionFailure;const l={usernameLogin:"LoginUsername",password:"LoginPassword",totp:"LoginTotp",cardNumber:"CardNumber",securityCode:"CardSecurityCode",usernameIdentity:"IdentityUsername",email:"IdentityEmail",phone:"IdentityPhone",address:"IdentityAddress",secureNote:"SecureNotes",privateKey:"SshKey",publicKey:"SshKey",keyFingerprint:"SshKey"},c=e=>{if(e instanceof o.z)return e;const t=new o.z;return e.match&&(t.match=e.match),e.uri&&(t.uri=e.uri),t}},61465:(e,t,i)=>{"use strict";i.d(t,{i:()=>o});var n=i(406),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.b]})},61782:(e,t,i)=>{"use strict";i.d(t,{j:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.cardholderName=this.getResponseProperty("CardholderName"),this.brand=this.getResponseProperty("Brand"),this.number=this.getResponseProperty("Number"),this.expMonth=this.getResponseProperty("ExpMonth"),this.expYear=this.getResponseProperty("ExpYear"),this.code=this.getResponseProperty("Code"))}}},62046:(e,t,i)=>{"use strict";i.d(t,{Y:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){super(e),null!=e&&(this.text=this.getResponseProperty("Text"),this.hidden=this.getResponseProperty("Hidden")||!1)}}},62166:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});class n{}},62316:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{}},62602:(e,t,i)=>{"use strict";i.d(t,{t:()=>r});var n=i(3204);class r{constructor(e){this.configService=e}getSettings$(){return this.configService.serverSettings$}get isUserRegistrationDisabled$(){return this.getSettings$().pipe((0,n.T)(e=>e.disableUserRegistration))}}},62627:(e,t,i)=>{"use strict";i.d(t,{V:()=>n.V$});var n=i(90107)},62819:(e,t,i)=>{"use strict";i.d(t,{l:()=>I});var n=i(74208),r=i(72245),s=i(33338),o=i(69194),a=i(3204),l=i(44500),c=i(28202),d=i(12012),u=i(67553),h=i(18499),p=i(43978),m=i(35500),v=i(3633),f=i(5556),g=i(31442),y=i(50451),b=i(23293),w=(i(22166),i(8144)),S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class I{constructor(){this.policyService=(0,n.WQX)(h.m),this.organizationService=(0,n.WQX)(u.PV),this.routedVaultFilterService=(0,n.WQX)(w.B),this.collectionAdminService=(0,n.WQX)(c.vE),this.cipherService=(0,n.WQX)(f.p),this.apiService=(0,n.WQX)(d.G),this.accountService=(0,n.WQX)(m.Di),this.userId$=this.accountService.activeAccount$.pipe(v.F6),this.organizationDataOwnershipDisabled$=this.userId$.pipe((0,l.n)(e=>this.policyService.policyAppliesToUser$(p.tt.OrganizationDataOwnership,e)),(0,a.T)(e=>!e)),this.organizationId$=this.routedVaultFilterService.filter$.pipe((0,a.T)(e=>e.organizationId),(0,o.p)(e=>void 0!==e)),this.allOrganizations$=this.userId$.pipe((0,l.n)(e=>this.organizationService.organizations$(e).pipe((0,a.T)(e=>e.filter(e=>e.isMember&&e.enabled&&e.status===p.Zx.Confirmed))))),this.organization$=(0,s.z)([this.allOrganizations$,this.organizationId$]).pipe((0,a.T)(([e,t])=>e.find(e=>e.id===t))),this.allCollections$=(0,s.z)([this.organization$,this.userId$]).pipe((0,l.n)(([e,t])=>this.collectionAdminService.collectionAdminViews$(e.id,t)))}buildConfig(e,t,i){return S(this,void 0,void 0,function*(){var n,o,a;const[l,c,d,u]=yield(0,r._)((0,s.z)([this.organization$,this.organizationDataOwnershipDisabled$,this.allOrganizations$,this.allCollections$])),h="clone"===e?d:[l],p="clone"===e&&c,m=yield this.getCipher(t,l);return{mode:e,cipherType:null!==(o=null!==(n=null==m?void 0:m.type)&&void 0!==n?n:i)&&void 0!==o?o:g.gC.Login,admin:null!==(a=l.canEditAllCiphers)&&void 0!==a&&a,organizationDataOwnershipDisabled:p,originalCipher:m,collections:u,organizations:h,folders:[],hideIndividualVaultFields:!0,isAdminConsole:!0}})}getCipher(e,t){return S(this,void 0,void 0,function*(){if(null==e)return null;const i=yield this.cipherService.get(e,t.userId);return t.canEditAllCiphers||null==i?yield this.getCipherFromAdminApi(e):i})}getCipherFromAdminApi(e){return S(this,void 0,void 0,function*(){const t=yield this.apiService.getCipherAdmin(e);t.edit=!0,t.viewPassword=!0;const i=new y.A(t);return new b.o(i)})}}I.ɵfac=function(e){return new(e||I)},I.ɵprov=n.jDH({token:I,factory:I.ɵfac})},62870:(e,t,i)=>{"use strict";i.d(t,{B:()=>o});var n=i(82781),r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s extends Error{constructor(e){super(`SDK loading failed: ${e}`)}}class o{loadAndInit(){return r(this,void 0,void 0,function*(){try{yield this.load(),(0,n.init_sdk)(o.logLevel),o.markAsReady()}catch(e){o.markAsFailed(e)}})}}o.logLevel=n.LogLevel.Info,o.Ready=new Promise((e,t)=>{o.markAsReady=e,o.markAsFailed=e=>t(new s(e))})},62963:(e,t,i)=>{"use strict";i.d(t,{G:()=>U});var n=i(34003),r=i(77468),s=i(51757),o=i(6056),a=i(58625),l=i(37579),c=i(79703),d=i(94438),u=i(33812),h=i(74208);class p{}p.ɵfac=function(e){return new(e||p)},p.ɵmod=u.$C({type:p}),p.ɵinj=h.G2t({imports:[d.p]});var m=i(639),v=i(29029),f=i(80351),g=i(47135),y=i(98479),b=i(81573),w=i(26411),S=i(22191),I=i(55807),k=i(26477),C=i(90647),T=i(61465),F=i(59525),R=i(83691),P=i(8297),x=i(88832),$=i(47659),E=i(97560);class A{}A.ɵfac=function(e){return new(e||A)},A.ɵmod=u.$C({type:A}),A.ɵinj=h.G2t({imports:[r.MD,E.T]});var D=i(92697),O=i(75583),M=i(8433);class U{}U.ɵfac=function(e){return new(e||U)},U.ɵmod=u.$C({type:U}),U.ɵinj=h.G2t({providers:[r.vh],imports:[r.MD,n.ad,s.YN,s.X1,o.iI,a.p,l.C,c.m,p,m.E,v.t,f.j,g.q,y.p,b.P,w.L,S.Q,I.o,k.V,C.M,T.i,F.s,R.E,P.K,x.n,$.b,A,D.E,O.E,r.MD,n.ad,s.YN,s.X1,o.iI,a.p,l.C,c.m,p,m.E,v.t,f.j,g.q,y.p,b.P,w.L,S.Q,I.o,k.V,C.M,T.i,F.s,R.E,P.K,M.p,$.b,A,D.E,O.E]})},63098:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});class n{}},63344:(e,t,i)=>{"use strict";i.d(t,{r:()=>a});var n=i(27442),r=i(89222),s=i(31857),o=i(48312);class a{constructor(e,t){this.registry=e,this.providers=t,this.log=t.log({type:"ExtensionService"})}settings(e,t,i){const a=this.registry.extension(e.site,t);a||this.log.panic({site:e.site,vendor:t},"extension not defined");const l=function(e,t){const i=new o.r;return Object.assign(Object.assign({},e.storage),{target:"object",key:`${t.site.id}.${t.product.vendor.id}.${e.storage.key}`,state:s.OB,classifier:i,format:"classified"})}(e,a),c=i.account$.pipe((0,n.t)({bufferSize:1,refCount:!0}));return new r.p(l,this.providers,{account$:c})}site(e){return this.registry.build(e)}}},63457:(e,t,i)=>{"use strict";i.d(t,{y:()=>s,Q:()=>n});class n{}var r=i(77789);class s{getPasswordStrength(e,t=null,i=null){if(null==e||0===e.length)return null;const n=["bitwarden","bit","warden",...null!=i?i:[],...this.emailToUserInputs(t)],s=Array.from(new Set(n));return r(e,s)}emailToUserInputs(e){if(null==e||0===e.length)return[];const t=e.indexOf("@");return t<0?[]:e.substring(0,t).trim().toLowerCase().split(/[^A-Za-z0-9]/)}}},63580:(e,t,i)=>{"use strict";i.d(t,{O:()=>r});var n=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class r{showLoginRequestedAlertIfWindowNotVisible(e){return n(this,void 0,void 0,function*(){})}}},63629:(e,t,i)=>{"use strict";i.d(t,{i:()=>d});var n=i(74208),r=i(23649),s=i(68455),o=i(84110),a=i(78781),l=i(51971),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function d(){return(t,i)=>c(this,void 0,void 0,function*(){const t=(0,n.WQX)(s.u),c=(0,n.WQX)(r.Ix),d=(0,n.WQX)(l.H),u=i.url,h=d.getPreviousUrl();if((yield t.getAuthStatus())===o.J.Unlocked){const e=yield d.getAndClearLoginRedirectUrl();return void 0===e||(!!a.A.isNullOrEmpty(e)||c.navigateByUrl(e))}return e(u)?yield d.persistLoginRedirectUrl(u):e(h)&&void 0!==h&&(yield d.persistLoginRedirectUrl(h)),!0});function e(e){if(null==e)return!1;if(a.A.isNullOrEmpty(e))return!1;const t=e.toLocaleLowerCase();return!t.includes("/login-initiated")&&!t.includes("/lock")}}},63734:(e,t,i)=>{"use strict";i.d(t,{tD:()=>G,I$:()=>B,M0:()=>ae,H8:()=>we,ve:()=>J,vU:()=>q.vU,Pu:()=>D.P,kx:()=>q.kx,c3:()=>q.c3});var n=i(81525),r=i(33812),s=i(51757),o=i(3204),a=i(98221),l=i(25065),c=i(74208),d=i(1601),u=i(21274),h=i(69855),p=i(50700),m=i(37115),v=i(26657),f=i(45154),g=i(56898),y=i(7730),b=i(68016),w=i(86226),S=i(97553),I=i(43759),k=i(36288);class C{constructor(e){this.iconButtonComponent=e,this.classList=["tw-text-muted"]}ngOnInit(){this.iconButtonComponent&&this.iconButtonComponent.size.set("small")}}C.ɵfac=function(e){return new(e||C)(r.rXU(k.s,8))},C.ɵdir=r.FsC({type:C,selectors:[["","bitPrefix",""]],hostVars:2,hostBindings:function(e,t){2&e&&r.HbH(t.classList)}});var T=i(24374),F=i(17721),R=i(58806),P=i(77468),x=i(88016),$=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const E=["payPalForm"];class A{constructor(e,t,i,n,r,a,l){var c;this.billingClient=e,this.configService=t,this.dialogParams=i,this.dialogRef=n,this.i18nService=r,this.platformUtilsService=a,this.toastService=l,this.payPalConfig={},this.redirectUrl=window.location.href,this.formGroup=new s.gE({paymentMethod:new s.MJ("payPal"),amount:new s.MJ("0.00",[s.k0.required,(c=this.i18nService.t("mustBePositiveNumber"),e=>{if(!e.value)return null;const t=parseFloat(e.value);return isNaN(t)||t<=0?{notPositiveNumber:{message:c}}:null})])}),this.payPalCustom$=this.configService.cloudRegion$.pipe((0,o.T)(e=>{switch(this.dialogParams.subscriber.type){case"account":return`user_id:${this.dialogParams.subscriber.data.id},account_credit:1,region:${e}`;case"organization":return`organization_id:${this.dialogParams.subscriber.data.id},account_credit:1,region:${e}`;case"provider":return`provider_id:${this.dialogParams.subscriber.data.id},account_credit:1,region:${e}`}})),this.submit=()=>$(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.valid){if("bitPay"===this.formGroup.value.paymentMethod){const e=yield this.billingClient.addCreditWithBitPay(this.dialogParams.subscriber,{amount:this.amount,redirectUrl:this.redirectUrl});switch(e.type){case"success":this.platformUtilsService.launchUri(e.value),this.dialogRef.close("launched");break;case"error":this.toastService.showToast({variant:"error",title:"",message:e.message}),this.dialogRef.close("error")}}this.payPalForm.nativeElement.submit(),this.dialogRef.close("launched")}}),this.formatAmount=()=>{if(this.formGroup.value.amount){const e=parseFloat(this.formGroup.value.amount);isNaN(e)?this.formGroup.controls.amount.setValue(null):this.formGroup.controls.amount.setValue(e.toFixed(2).toString())}}}get amount(){if(this.formGroup.value.amount){const e=parseFloat(this.formGroup.value.amount);return isNaN(e)?null:e}return null}get payPalSubject(){switch(this.dialogParams.subscriber.type){case"account":return this.dialogParams.subscriber.data.email;case"organization":case"provider":return this.dialogParams.subscriber.data.name}}}A.open=(e,t)=>e.open(A,t),A.ɵfac=function(e){return new(e||A)(r.rXU(a.Hd),r.rXU(d.w),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(p.W),r.rXU(m.y),r.rXU(h.f))},A.ɵcmp=r.VBU({type:A,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&r.GBs(E,7,r.aKT),2&e){let e;r.mGM(e=r.lsd())&&(t.payPalForm=e.first)}},features:[r.Jv_([a.Hd])],decls:52,vars:38,consts:[["payPalForm",""],[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],["bitTypography","body1"],[1,"tw-grid","tw-grid-cols-2"],[3,"formControl"],["id","credit-method-paypal",3,"value"],[1,"bwi","bwi-paypal"],["id","credit-method-bitcoin",3,"value"],[1,"bwi","bwi-bitcoin"],["bitInput","","type","text","required","",3,"blur","formControl"],["bitPrefix",""],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"bitDialogClose"],["method","post","target","_top",3,"action"],["type","hidden","name","cmd","value","_xclick"],["type","hidden","name","business",3,"value"],["type","hidden","name","button_subtype","value","services"],["type","hidden","name","no_note","value","1"],["type","hidden","name","no_shipping","value","1"],["type","hidden","name","rm","value","1"],["type","hidden","name","return",3,"value"],["type","hidden","name","cancel_return",3,"value"],["type","hidden","name","currency_code","value","USD"],["type","hidden","name","image_url","value","https://bitwarden.com/images/paypal-banner.png"],["type","hidden","name","bn","value","PP-BuyNowBF:btn_buynow_LG.gif:NonHosted"],["type","hidden","name","amount",3,"value"],["type","hidden","name","custom",3,"value"],["type","hidden","name","item_name","value","Bitwarden Account Credit"],["type","hidden","name","item_number",3,"value"]],template:function(e,t){if(1&e){const e=r.RV6();r.j41(0,"form",1)(1,"bit-dialog")(2,"span",2),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",3)(6,"p",4),r.EFF(7),r.nI1(8,"i18n"),r.k0s(),r.j41(9,"div",5)(10,"bit-radio-group",6)(11,"bit-radio-button",7)(12,"bit-label"),r.nrm(13,"i",8),r.EFF(14,"PayPal"),r.k0s()(),r.j41(15,"bit-radio-button",9)(16,"bit-label"),r.nrm(17,"i",10),r.EFF(18,"Bitcoin"),r.k0s()()()(),r.j41(19,"div",5)(20,"bit-form-field")(21,"bit-label"),r.EFF(22),r.nI1(23,"i18n"),r.k0s(),r.j41(24,"input",11),r.bIt("blur",function(){return c.eBV(e),c.Njj(t.formatAmount())}),r.k0s(),r.j41(25,"span",12),r.EFF(26,"$USD"),r.k0s()()()(),r.qex(27,13),r.j41(28,"button",14),r.EFF(29),r.nI1(30,"i18n"),r.k0s(),r.j41(31,"button",15),r.EFF(32),r.nI1(33,"i18n"),r.k0s(),r.bVm(),r.k0s()(),r.j41(34,"form",16,0),r.nrm(36,"input",17)(37,"input",18)(38,"input",19)(39,"input",20)(40,"input",21)(41,"input",22)(42,"input",23)(43,"input",24)(44,"input",25)(45,"input",26)(46,"input",27)(47,"input",28)(48,"input",29),r.nI1(49,"async"),r.nrm(50,"input",30)(51,"input",31),r.k0s()}2&e&&(r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,26,"addCredit")," "),r.R7$(4),r.JRh(r.bMT(8,28,"creditDelayed")),r.R7$(3),r.Y8G("formControl",t.formGroup.controls.paymentMethod),r.R7$(),r.Y8G("value","payPal"),r.R7$(4),r.Y8G("value","bitPay"),r.R7$(7),r.JRh(r.bMT(23,30,"amount")),r.R7$(2),r.Y8G("formControl",t.formGroup.controls.amount),r.R7$(5),r.SpI(" ",r.bMT(30,32,"submit")," "),r.R7$(2),r.Y8G("bitDialogClose","cancelled"),r.R7$(),r.SpI(" ",r.bMT(33,34,"cancel")," "),r.R7$(2),r.Y8G("action",r.mNQ(t.payPalConfig.buttonAction),r.B4B),r.R7$(3),r.Y8G("value",r.mNQ(t.payPalConfig.businessId)),r.R7$(5),r.Y8G("value",r.mNQ(t.redirectUrl)),r.R7$(),r.Y8G("value",r.mNQ(t.redirectUrl)),r.R7$(4),r.Y8G("value",r.mNQ(t.amount)),r.R7$(),r.Y8G("value",r.mNQ(r.bMT(49,36,t.payPalCustom$))),r.R7$(3),r.Y8G("value",r.mNQ(t.payPalSubject)))},dependencies:[l.G,s.qT,s.me,s.BC,s.cb,s.YS,s.cV,s.l_,s.j4,v.$,f.L,g.Q,y.I,b.m,w.j,S.J,I.h,C,T.d,F.Y,R.r,P.Jj,x.$],encapsulation:2});var D=i(21587),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class M{constructor(e,t,i,n){this.billingClient=e,this.dialogRef=t,this.i18nService=i,this.toastService=n,this.formGroup=D.P.getFormGroup(),this.submit=()=>O(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.valid)return;const e=yield this.enterPaymentMethodComponent.tokenize();if(!e)return;const t="payPal"!==this.formGroup.value.type?this.formGroup.controls.billingAddress.getRawValue():null,i=yield this.billingClient.updatePaymentMethod(this.subscriber,e,t);switch(i.type){case"success":this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("paymentMethodUpdated")}),this.dialogRef.close({type:"success",paymentMethod:i.value});break;case"error":this.toastService.showToast({variant:"error",title:"",message:i.message}),this.dialogRef.close({type:"error"})}})}}M.ɵfac=function(e){return new(e||M)(r.rXU(a.Hd),r.rXU(u.ce),r.rXU(p.W),r.rXU(h.f))},M.ɵcmp=r.VBU({type:M,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&r.GBs(D.P,5),2&e){let e;r.mGM(e=r.lsd())&&(t.enterPaymentMethodComponent=e.first)}},decls:0,vars:0,template:function(e,t){},encapsulation:2});const U=()=>({type:"cancelled"});class G extends M{constructor(e,t,i,n,r){super(e,i,n,r),this.dialogParams=t,this.subscriber=this.dialogParams.subscriber}}G.open=(e,t)=>e.open(G,t),G.ɵfac=function(e){return new(e||G)(r.rXU(a.Hd),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(p.W),r.rXU(h.f))},G.ɵcmp=r.VBU({type:G,selectors:[["ng-component"]],features:[r.Jv_([a.Hd]),r.Vt3],decls:14,vars:16,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"group","showBankAccount","includeBillingAddress"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"]],template:function(e,t){1&e&&(r.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",2),r.nrm(6,"app-enter-payment-method",3),r.k0s(),r.qex(7,4),r.j41(8,"button",5),r.EFF(9),r.nI1(10,"i18n"),r.k0s(),r.j41(11,"button",6),r.EFF(12),r.nI1(13,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e&&(r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,9,"changePaymentMethod")," "),r.R7$(3),r.Y8G("group",t.formGroup)("showBankAccount","account"!==t.dialogParams.subscriber.type)("includeBillingAddress",!0),r.R7$(3),r.SpI(" ",r.bMT(10,11,"save")," "),r.R7$(2),r.Y8G("bitDialogClose",r.lJ4(15,U)),r.R7$(),r.SpI(" ",r.bMT(13,13,"cancel")," "))},dependencies:[D.P,l.G,s.qT,s.cb,s.j4,v.$,f.L,g.Q,y.I,b.m,x.$],encapsulation:2});var j=i(3892),N=i(88832),V=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class B{constructor(e,t,i,n,r){this.billingClient=e,this.currencyPipe=t,this.dialogService=i,this.i18nService=n,this.toastService=r,this.addAccountCredit=()=>V(this,void 0,void 0,function*(){if("account"!==this.subscriber.type){(yield this.billingClient.getBillingAddress(this.subscriber))||this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("billingAddressRequiredToAddCredit")})}A.open(this.dialogService,{data:{subscriber:this.subscriber}})})}get formattedCredit(){var e;const t=null!==(e=this.credit)&&void 0!==e?e:0;return this.currencyPipe.transform(t,"$")}}B.ɵfac=function(e){return new(e||B)(r.rXU(a.Hd),r.rXU(P.oe),r.rXU(u.o3),r.rXU(p.W),r.rXU(h.f))},B.ɵcmp=r.VBU({type:B,selectors:[["app-display-account-credit"]],inputs:{subscriber:"subscriber",credit:"credit"},features:[r.Jv_([a.Hd,P.oe])],decls:10,vars:11,consts:[["bitTypography","h2"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"]],template:function(e,t){1&e&&(r.j41(0,"bit-section")(1,"h2",0),r.EFF(2),r.nI1(3,"i18n"),r.k0s(),r.j41(4,"p"),r.EFF(5),r.nI1(6,"i18n"),r.k0s(),r.j41(7,"button",1),r.EFF(8),r.nI1(9,"i18n"),r.k0s()()),2&e&&(r.R7$(2),r.Lme("",r.bMT(3,5,"accountCredit"),": ",t.formattedCredit),r.R7$(3),r.JRh(r.bMT(6,7,"availableCreditAppliedToInvoice")),r.R7$(2),r.Y8G("bitAction",t.addAccountCredit),r.R7$(),r.SpI(" ",r.bMT(9,9,"addCredit")," "))},dependencies:[l.G,j.p,g.Q,N.n,R.r,x.$],encapsulation:2});var z=i(88565),L=i(88083),K=i(47438),q=i(34923),_=i(44432),X=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Y=(e,t,i)=>({type:"update",existing:e,supportsTaxId:t,taxIdWarning:i}),H=()=>({type:"cancelled"});function W(e,t){if(1&e&&(r.j41(0,"bit-callout",3),r.EFF(1),r.k0s()),2&e){r.XpG();const e=r.r8f(6);r.Y8G("type",e.type)("title",e.title),r.R7$(),r.SpI(" ",e.message," ")}}class J{constructor(e,t,i,n,r){var s;this.billingClient=e,this.dialogParams=t,this.dialogRef=i,this.i18nService=n,this.toastService=r,this.formGroup=q.vU.getFormGroup(),this.submit=()=>X(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=(0,q.c3)(this.formGroup),t=yield this.billingClient.updateBillingAddress(this.dialogParams.subscriber,e);switch(t.type){case"success":this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("billingAddressUpdated")}),this.dialogRef.close({type:"success",billingAddress:t.value});break;case"error":this.toastService.showToast({variant:"error",title:"",message:t.message}),this.dialogRef.close({type:"error"})}}),t.billingAddress&&this.formGroup.patchValue(Object.assign(Object.assign({},t.billingAddress),{taxId:null===(s=t.billingAddress.taxId)||void 0===s?void 0:s.value}))}get supportsTaxId(){switch(this.dialogParams.subscriber.type){case"account":return!1;case"organization":return[L.K_.TeamsStarter,L.K_.Teams,L.K_.Enterprise].includes(this.dialogParams.subscriber.data.productTierType);case"provider":return!0}}get taxIdWarningCallout(){if(!this.supportsTaxId||!this.dialogParams.taxIdWarning||this.dialogParams.taxIdWarning===K.e.PendingVerification)return null;switch(this.dialogParams.taxIdWarning){case K.e.Missing:return{type:"warning",title:this.i18nService.t("missingTaxIdCalloutTitle"),message:this.i18nService.t("missingTaxIdCalloutDescription")};case K.e.FailedVerification:return{type:"warning",title:this.i18nService.t("unverifiedTaxIdCalloutTitle"),message:this.i18nService.t("unverifiedTaxIdCalloutDescription")}}}}J.open=(e,t)=>e.open(J,t),J.ɵfac=function(e){return new(e||J)(r.rXU(a.Hd),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(p.W),r.rXU(h.f))},J.ɵcmp=r.VBU({type:J,selectors:[["ng-component"]],features:[r.Jv_([a.Hd])],decls:16,vars:21,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"type","title"],[3,"scenario","group"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","buttonType","secondary","type","button",3,"bitDialogClose"]],template:function(e,t){if(1&e&&(r.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",2),r.SS7(6),r.nVh(7,W,2,3,"bit-callout",3),r.nrm(8,"app-enter-billing-address",4),r.k0s(),r.qex(9,5),r.j41(10,"button",6),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.j41(13,"button",7),r.EFF(14),r.nI1(15,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e){r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,9,"editBillingAddress")," "),r.R7$(3);const e=r.bH3(t.taxIdWarningCallout);r.R7$(),r.vxM(e?7:-1),r.R7$(),r.Y8G("scenario",r.sMw(16,Y,t.dialogParams.billingAddress,t.supportsTaxId,t.dialogParams.taxIdWarning))("group",t.formGroup),r.R7$(3),r.SpI(" ",r.bMT(12,12,"save")," "),r.R7$(2),r.Y8G("bitDialogClose",r.lJ4(20,H)),r.R7$(),r.SpI(" ",r.bMT(15,14,"cancel")," ")}},dependencies:[q.vU,l.G,s.qT,s.cb,s.j4,v.$,f.L,g.Q,_.G,y.I,b.m,x.$],encapsulation:2});class Z{transform(e){const t=[];return e.line1&&t.push(e.line1),e.line2&&t.push(e.line2),e.city&&t.push(e.city),e.state&&t.push(e.state),t.push(e.postalCode,e.country),t.join(", ")}}Z.ɵfac=function(e){return new(e||Z)},Z.ɵpipe=r.EJ8({name:"address",type:Z,pure:!0});var Q=i(47696),ee=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function te(e,t){1&e&&(r.j41(0,"span",1),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"missingTaxId")))}function ie(e,t){1&e&&(r.j41(0,"span",4),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"pendingVerification")))}function ne(e,t){1&e&&(r.j41(0,"span",1),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"unverified")))}function re(e,t){if(1&e&&(r.j41(0,"p",3),r.EFF(1),r.nI1(2,"i18n"),r.nVh(3,ie,3,3,"span",4),r.nVh(4,ne,3,3,"span",1),r.k0s()),2&e){const e=r.XpG(2);r.R7$(),r.SpI(" ",r.i5U(2,3,"taxId",e.billingAddress.taxId.value)," "),r.R7$(2),r.vxM(e.showTaxIdPendingVerificationBadge?3:-1),r.R7$(),r.vxM(e.showUnverifiedTaxIdBadge?4:-1)}}function se(e,t){if(1&e&&(r.j41(0,"p"),r.EFF(1),r.nI1(2,"address"),r.k0s(),r.nVh(3,re,5,6,"p",3)),2&e){const e=r.XpG();r.R7$(),r.JRh(r.bMT(2,2,e.billingAddress)),r.R7$(2),r.vxM(e.billingAddress.taxId?3:-1)}}function oe(e,t){1&e&&(r.j41(0,"p"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"noBillingAddress")))}class ae{constructor(e){this.dialogService=e,this.updated=new r.bkB,this.editBillingAddress=()=>ee(this,void 0,void 0,function*(){const e=J.open(this.dialogService,{data:{subscriber:this.subscriber,billingAddress:this.billingAddress,taxIdWarning:this.taxIdWarning}}),t=yield(0,z.s)(e.closed);"success"===(null==t?void 0:t.type)&&this.updated.emit(t.billingAddress)})}get showMissingTaxIdBadge(){return"account"!==this.subscriber.type&&this.taxIdWarning===K.e.Missing}get showTaxIdPendingVerificationBadge(){return"account"!==this.subscriber.type&&this.taxIdWarning===K.e.PendingVerification}get showUnverifiedTaxIdBadge(){return"account"!==this.subscriber.type&&this.taxIdWarning===K.e.FailedVerification}}ae.ɵfac=function(e){return new(e||ae)(r.rXU(u.o3))},ae.ɵcmp=r.VBU({type:ae,selectors:[["app-display-billing-address"]],inputs:{subscriber:"subscriber",billingAddress:"billingAddress",taxIdWarning:"taxIdWarning"},outputs:{updated:"updated"},decls:10,vars:9,consts:[["bitTypography","h2"],["bitBadge","","variant","warning"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"],[1,"tw-flex","tw-items-center","tw-gap-2"],["bitBadge","","variant","secondary"]],template:function(e,t){if(1&e&&(r.j41(0,"bit-section")(1,"h2",0),r.EFF(2),r.nI1(3,"i18n"),r.nVh(4,te,3,3,"span",1),r.k0s(),r.nVh(5,se,4,4)(6,oe,3,3,"p"),r.j41(7,"button",2),r.EFF(8),r.nI1(9,"i18n"),r.k0s()()),2&e){r.R7$(2),r.SpI(" ",r.bMT(3,5,"billingAddress")," "),r.R7$(2),r.vxM(t.showMissingTaxIdBadge?4:-1),r.R7$(),r.vxM(t.billingAddress?5:6);const e=t.billingAddress?"editBillingAddress":"addBillingAddress";r.R7$(2),r.Y8G("bitAction",t.editBillingAddress),r.R7$(),r.SpI(" ",r.bMT(9,7,e)," ")}},dependencies:[l.G,j.p,Q.n,g.Q,N.n,R.r,Z,x.$],encapsulation:2});var le=i(14055),ce=i(59032),de=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ue(e,t){if(1&e&&(r.j41(0,"p"),r.EFF(1),r.nI1(2,"i18n"),r.j41(3,"a",5),r.EFF(4),r.nI1(5,"i18n"),r.k0s()()),2&e){const e=r.XpG(3);r.R7$(),r.SpI(" ",r.bMT(2,3,"verifyBankAccountWithStripe")," "),r.R7$(2),r.BMQ("href",e.paymentMethod.hostedVerificationUrl,r.B4B),r.R7$(),r.JRh(r.bMT(5,5,"verifyNow"))}}function he(e,t){1&e&&(r.j41(0,"span"),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.SpI("- ",r.bMT(2,1,"unverified")))}function pe(e,t){if(1&e&&(r.nVh(0,ue,6,7,"p"),r.j41(1,"p"),r.nrm(2,"i",4),r.EFF(3),r.nVh(4,he,3,3,"span"),r.k0s()),2&e){const e=r.XpG(2);r.vxM(e.paymentMethod.hostedVerificationUrl?0:-1),r.R7$(3),r.Lme(" ",e.paymentMethod.bankName,", *",e.paymentMethod.last4," "),r.R7$(),r.vxM(e.paymentMethod.hostedVerificationUrl?4:-1)}}function me(e,t){if(1&e&&r.nrm(0,"i"),2&e){r.XpG();const e=r.r8f(1);r.HbH(r.VkB("bwi bwi-fw credit-card-icon ",e))}}function ve(e,t){1&e&&r.nrm(0,"i",7)}function fe(e,t){if(1&e&&(r.j41(0,"p",3),r.SS7(1),r.nVh(2,me,1,3,"i",6)(3,ve,1,0,"i",7),r.EFF(4),r.nI1(5,"titlecase"),r.k0s()),2&e){const e=r.XpG(2);r.R7$();const t=r.bH3(e.getCardBrandIcon());r.R7$(),r.vxM(null!==t?2:3),r.R7$(2),r.E5c(" ",r.bMT(5,5,e.paymentMethod.brand),", *",e.paymentMethod.last4,", ",e.paymentMethod.expiration," ")}}function ge(e,t){if(1&e&&(r.j41(0,"p"),r.nrm(1,"i",8),r.EFF(2),r.k0s()),2&e){const e=r.XpG(2);r.R7$(2),r.SpI(" ",e.paymentMethod.email," ")}}function ye(e,t){if(1&e&&r.nVh(0,pe,5,4)(1,fe,6,7,"p",3)(2,ge,3,1,"p"),2&e){let e;const t=r.XpG();r.vxM("bankAccount"===(e=t.paymentMethod.type)?0:"card"===e?1:"payPal"===e?2:-1)}}function be(e,t){1&e&&(r.j41(0,"p",1),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"noPaymentMethod")))}class we{constructor(e){this.dialogService=e,this.updated=new r.bkB,this.changePaymentMethod=()=>de(this,void 0,void 0,function*(){const e=G.open(this.dialogService,{data:{subscriber:this.subscriber}}),t=yield(0,z.s)(e.closed);"success"===(null==t?void 0:t.type)&&this.updated.emit(t.paymentMethod)}),this.getCardBrandIcon=()=>(0,le.nS)(this.paymentMethod)}}we.ɵfac=function(e){return new(e||we)(r.rXU(u.o3))},we.ɵcmp=r.VBU({type:we,selectors:[["app-display-payment-method"]],inputs:{subscriber:"subscriber",paymentMethod:"paymentMethod"},outputs:{updated:"updated"},decls:9,vars:8,consts:[["bitTypography","h2"],["bitTypography","body1"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"],[1,"tw-flex","tw-items-center","tw-gap-2"],[1,"bwi","bwi-fw","bwi-billing"],["bitLink","","rel","noreferrer","target","_blank"],[3,"class"],[1,"bwi","bwi-fw","bwi-credit-card"],[1,"bwi","bwi-fw","bwi-paypal","tw-text-primary-600"]],template:function(e,t){if(1&e&&(r.j41(0,"bit-section")(1,"h2",0),r.EFF(2),r.nI1(3,"i18n"),r.k0s(),r.nVh(4,ye,3,1)(5,be,3,3,"p",1),r.j41(6,"button",2),r.EFF(7),r.nI1(8,"i18n"),r.k0s()()),2&e){r.R7$(2),r.JRh(r.bMT(3,4,"paymentMethod")),r.R7$(2),r.vxM(t.paymentMethod?4:5);const e=t.paymentMethod?"changePaymentMethod":"addPaymentMethod";r.R7$(2),r.Y8G("bitAction",t.changePaymentMethod),r.R7$(),r.SpI(" ",r.bMT(8,6,e)," ")}},dependencies:[l.G,j.p,g.Q,ce.L,N.n,R.r,P.PV,x.$],encapsulation:2});i(32287);class Se extends M{constructor(e,t,i,n,r){super(e,i,n,r),this.dialogParams=t,this.subscriber=this.dialogParams.subscriber}}Se.open=(e,t)=>e.open(Se,Object.assign(Object.assign({},t),{disableClose:!0})),Se.ɵfac=function(e){return new(e||Se)(r.rXU(a.Hd),r.rXU(n.Qs),r.rXU(u.ce),r.rXU(p.W),r.rXU(h.f))},Se.ɵcmp=r.VBU({type:Se,selectors:[["ng-component"]],features:[r.Jv_([a.Hd]),r.Vt3],decls:13,vars:13,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle","",1,"tw-font-medium"],["bitDialogContent",""],[3,"type","title"],[3,"group","includeBillingAddress"],["bitDialogFooter",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"]],template:function(e,t){1&e&&(r.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"div",2)(6,"bit-callout",3),r.EFF(7),r.k0s(),r.nrm(8,"app-enter-payment-method",4),r.k0s(),r.qex(9,5),r.j41(10,"button",6),r.EFF(11),r.nI1(12,"i18n"),r.k0s(),r.bVm(),r.k0s()()),2&e&&(r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.SpI(" ",r.bMT(4,9,"addPaymentMethod")," "),r.R7$(3),r.Y8G("type",t.dialogParams.callout.type)("title",t.dialogParams.callout.title),r.R7$(),r.SpI(" ",t.dialogParams.callout.message," "),r.R7$(),r.Y8G("group",t.formGroup)("includeBillingAddress",!0),r.R7$(3),r.SpI(" ",r.bMT(12,11,"save")," "))},dependencies:[D.P,l.G,s.qT,s.cb,s.j4,v.$,f.L,g.Q,_.G,b.m,x.$],encapsulation:2});var Ie=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ke{constructor(e,t,i){this.billingClient=e,this.i18nService=t,this.toastService=i,this.verified=new r.bkB,this.formGroup=new s.gE({descriptorCode:new s.MJ("",[s.k0.required,s.k0.minLength(6),s.k0.maxLength(6)])}),this.submit=()=>Ie(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),!this.formGroup.valid)return;const e=yield this.billingClient.verifyBankAccount(this.subscriber,this.formGroup.value.descriptorCode);switch(e.type){case"success":this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("bankAccountVerified")}),this.verified.emit(e.value);break;case"error":this.toastService.showToast({variant:"error",title:"",message:e.message})}})}}ke.ɵfac=function(e){return new(e||ke)(r.rXU(a.Hd),r.rXU(p.W),r.rXU(h.f))},ke.ɵcmp=r.VBU({type:ke,selectors:[["app-verify-bank-account"]],inputs:{subscriber:"subscriber"},outputs:{verified:"verified"},features:[r.Jv_([a.Hd])],decls:14,vars:16,consts:[["type","warning",3,"title"],[3,"formGroup","bitSubmit"],[1,"tw-mr-2","tw-w-48"],["bitInput","","type","text","placeholder","SMAB12",3,"formControl"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"]],template:function(e,t){1&e&&(r.j41(0,"bit-callout",0),r.nI1(1,"i18n"),r.j41(2,"p"),r.EFF(3),r.nI1(4,"i18n"),r.k0s(),r.j41(5,"form",1)(6,"bit-form-field",2)(7,"bit-label"),r.EFF(8),r.nI1(9,"i18n"),r.k0s(),r.nrm(10,"input",3),r.k0s(),r.j41(11,"button",4),r.EFF(12),r.nI1(13,"i18n"),r.k0s()()()),2&e&&(r.Y8G("title",r.mNQ(r.bMT(1,8,"verifyBankAccount"))),r.R7$(3),r.JRh(r.bMT(4,10,"verifyBankAccountWithStatementDescriptorInstructions")),r.R7$(2),r.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),r.R7$(3),r.JRh(r.bMT(9,12,"descriptorCode")),r.R7$(2),r.Y8G("formControl",t.formGroup.controls.descriptorCode),r.R7$(2),r.SpI(" ",r.bMT(13,14,"submit")," "))},dependencies:[l.G,s.qT,s.me,s.BC,s.cb,s.l_,s.j4,v.$,f.L,g.Q,_.G,w.j,S.J,I.h,x.$],encapsulation:2})},63968:(e,t,i)=>{"use strict";i.d(t,{q:()=>G});var n=i(93161),r=i(77468),s=i(33812),o=i(51757),a=i(66046),l=i(72737),c=i(69194),d=i(3204),u=i(62179),h=i(14803),p=i(36359),m=i(8131),v=i(58625),f=i(88832),g=i(75583),y=i(26411),b=i(47135),w=i(58950),S=i(14318),I=i(29776),k=i(36801),C=i(18030),T=i(50700),F=i(58806),R=i(90246),P=i(86226),x=i(93199),$=i(97553),E=i(43759),A=i(50352),D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function O(e,t){1&e&&(s.j41(0,"bit-section-header")(1,"h2",18),s.EFF(2),s.nI1(3,"i18n"),s.k0s()()),2&e&&(s.R7$(2),s.JRh(s.bMT(3,1,"options")))}function M(e,t){1&e&&(s.j41(0,"p",17),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e&&(s.R7$(),s.JRh(s.bMT(2,1,"generatorPolicyInEffect")))}const U=Object.freeze({length:"length",uppercase:"uppercase",lowercase:"lowercase",number:"number",special:"special",minNumber:"minNumber",minSpecial:"minSpecial",avoidAmbiguous:"avoidAmbiguous"});class G{constructor(e,t,i){this.formBuilder=e,this.generatorService=t,this.i18nService=i,this.account=null,this.account$=new l.m(1),this.showHeader=!0,this.waitMs=100,this.disableMargin=!1,this.onUpdated=new s.bkB,this.settings=this.formBuilder.group({[U.length]:[0],[U.uppercase]:[!1],[U.lowercase]:[!1],[U.number]:[!1],[U.special]:[!1],[U.minNumber]:[0],[U.minSpecial]:[0],[U.avoidAmbiguous]:[!1]}),this.saveSettings=new a.B,this.policyInEffect=!1,this.lengthBoundariesHint=new l.m(1),this.lengthBoundariesHint$=this.lengthBoundariesHint.asObservable(),this.destroyed$=new a.B}ngOnChanges(e){return D(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}get numbers(){return this.settings.get(U.number)}get special(){return this.settings.get(U.special)}get minNumber(){return this.settings.get(U.minNumber)}get minSpecial(){return this.settings.get(U.minSpecial)}ngOnInit(){return D(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(I.qG.password,{account$:this.account$});e.withConstraints$.pipe((0,d.T)(({state:e,constraints:t})=>{const i=Object.assign({},e);return i.avoidAmbiguous=!i.ambiguous,delete i.ambiguous,[i,t]}),(0,h.Q)(this.destroyed$)).subscribe(([e,t])=>{var i,n,r,s,o,a,l,c;let d=this.i18nService.t("spinboxBoundariesHint",null===(n=null===(i=t.length)||void 0===i?void 0:i.min)||void 0===n?void 0:n.toString(),null===(s=null===(r=t.length)||void 0===r?void 0:r.max)||void 0===s?void 0:s.toString());e.length<=(null!==(a=null===(o=t.length)||void 0===o?void 0:o.recommendation)&&void 0!==a?a:0)&&(d+=this.i18nService.t("passwordLengthRecommendationHint",null===(c=null===(l=t.length)||void 0===l?void 0:l.recommendation)||void 0===c?void 0:c.toString())),this.lengthBoundariesHint.next(d),this.settings.patchValue(e,{emitEvent:!1})}),this.generatorService.policy$(I.qG.password,{account$:this.account$}).pipe((0,h.Q)(this.destroyed$)).subscribe(({constraints:e})=>{var t,i,n,r,s,o,a,l,c,d,u;this.policyInEffect=null!==(t=e.policyInEffect)&&void 0!==t&&t;const h=[[U.length,(0,C.jo)(null===(i=e.length)||void 0===i?void 0:i.min,null===(n=e.length)||void 0===n?void 0:n.max)],[U.uppercase,!(null===(r=e.uppercase)||void 0===r?void 0:r.readonly)],[U.lowercase,!(null===(s=e.lowercase)||void 0===s?void 0:s.readonly)],[U.number,!(null===(o=e.number)||void 0===o?void 0:o.readonly)],[U.special,!(null===(a=e.special)||void 0===a?void 0:a.readonly)],[U.minNumber,(0,C.jo)(null===(l=e.minNumber)||void 0===l?void 0:l.min,null===(c=e.minNumber)||void 0===c?void 0:c.max)],[U.minSpecial,(0,C.jo)(null===(d=e.minSpecial)||void 0===d?void 0:d.min,null===(u=e.minSpecial)||void 0===u?void 0:u.max)]];for(const[p,m]of h)this.toggleEnabled(p,m)});let t=1;this.numbers.valueChanges.pipe((0,c.p)(e=>{var t;return!(e&&(null!==(t=this.minNumber.value)&&void 0!==t?t:0)>0)}),(0,d.T)(e=>e?t:0),(0,h.Q)(this.destroyed$)).subscribe(e=>this.minNumber.setValue(e,{emitEvent:!1})),this.minNumber.valueChanges.pipe((0,d.T)(e=>[e,(null!=e?e:0)>0]),(0,p.M)(([e,i])=>t=i&&e?e:t),(0,h.Q)(this.destroyed$)).subscribe(([,e])=>this.numbers.setValue(e,{emitEvent:!1}));let i=1;this.special.valueChanges.pipe((0,c.p)(e=>{var t;return!(e&&(null!==(t=this.minSpecial.value)&&void 0!==t?t:0)>0)}),(0,d.T)(e=>e?i:0),(0,h.Q)(this.destroyed$)).subscribe(e=>this.minSpecial.setValue(e,{emitEvent:!1})),this.minSpecial.valueChanges.pipe((0,d.T)(e=>[e,(null!=e?e:0)>0]),(0,p.M)(([e,t])=>i=t&&e?e:i),(0,h.Q)(this.destroyed$)).subscribe(([,e])=>this.special.setValue(e,{emitEvent:!1})),e.pipe((0,u.i)(1),(0,h.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,m.E)(this.settings.valueChanges),(0,d.T)(([,e])=>{const t=Object.assign({},e);return t.ambiguous=!t.avoidAmbiguous,delete t.avoidAmbiguous,t}),(0,h.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}toggleEnabled(e,t){var i,n;t?null===(i=this.settings.get(e))||void 0===i||i.enable({emitEvent:!1}):null===(n=this.settings.get(e))||void 0===n||n.disable({emitEvent:!1})}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}G.ɵfac=function(e){return new(e||G)(s.rXU(o.ok),s.rXU(I.iE),s.rXU(T.W))},G.ɵcmp=s.VBU({type:G,selectors:[["tools-password-settings"]],inputs:{account:"account",showHeader:"showHeader",waitMs:"waitMs",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onUpdated:"onUpdated"},features:[s.OA$],decls:63,vars:61,consts:[[3,"disableMargin"],[1,"tw-container",3,"formGroup"],[1,"tw-mb-4"],["disableMargin",""],["bitInput","","formControlName","length","type","number",3,"change"],[1,"tw-mb-4","tw-flex","tw-flex-wrap","tw-gap-4","sm:tw-gap-8"],[1,"!tw-mb-0",3,"title"],["bitCheckbox","","type","checkbox","formControlName","uppercase",3,"change"],["bitCheckbox","","type","checkbox","formControlName","lowercase",3,"change"],["bitCheckbox","","type","checkbox","formControlName","number",3,"change"],["bitCheckbox","","type","checkbox","formControlName","special",3,"change"],[1,"tw-flex"],[1,"tw-w-full","tw-basis-1/2","tw-mr-4"],["bitInput","","type","number","formControlName","minNumber",3,"change"],[1,"tw-w-full","tw-basis-1/2"],["bitInput","","type","number","formControlName","minSpecial",3,"change"],["bitCheckbox","","type","checkbox","formControlName","avoidAmbiguous",3,"change"],["bitTypography","helper"],["bitTypography","h6"]],template:function(e,t){1&e&&(s.j41(0,"bit-section",0),s.nVh(1,O,4,3,"bit-section-header"),s.j41(2,"form",1)(3,"div",2)(4,"bit-card")(5,"bit-form-field",3)(6,"bit-label"),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.j41(9,"input",4),s.bIt("change",function(){return t.save("length")}),s.k0s(),s.j41(10,"bit-hint"),s.EFF(11),s.nI1(12,"async"),s.k0s()()()(),s.j41(13,"div")(14,"bit-card")(15,"div",2),s.EFF(16),s.nI1(17,"i18n"),s.k0s(),s.j41(18,"div",5)(19,"bit-form-control",6),s.nI1(20,"i18n"),s.nI1(21,"i18n"),s.j41(22,"input",7),s.bIt("change",function(){return t.save("uppercase")}),s.k0s(),s.j41(23,"bit-label"),s.EFF(24),s.nI1(25,"i18n"),s.k0s()(),s.j41(26,"bit-form-control",6),s.nI1(27,"i18n"),s.nI1(28,"i18n"),s.j41(29,"input",8),s.bIt("change",function(){return t.save("lowercase")}),s.k0s(),s.j41(30,"bit-label"),s.EFF(31),s.nI1(32,"i18n"),s.k0s()(),s.j41(33,"bit-form-control",6),s.nI1(34,"i18n"),s.nI1(35,"i18n"),s.j41(36,"input",9),s.bIt("change",function(){return t.save("number")}),s.k0s(),s.j41(37,"bit-label"),s.EFF(38),s.nI1(39,"i18n"),s.k0s()(),s.j41(40,"bit-form-control",6),s.nI1(41,"i18n"),s.nI1(42,"i18n"),s.j41(43,"input",10),s.bIt("change",function(){return t.save("special")}),s.k0s(),s.j41(44,"bit-label"),s.EFF(45),s.k0s()()(),s.j41(46,"div",11)(47,"bit-form-field",12)(48,"bit-label"),s.EFF(49),s.nI1(50,"i18n"),s.k0s(),s.j41(51,"input",13),s.bIt("change",function(){return t.save("minNumbers")}),s.k0s()(),s.j41(52,"bit-form-field",14)(53,"bit-label"),s.EFF(54),s.nI1(55,"i18n"),s.k0s(),s.j41(56,"input",15),s.bIt("change",function(){return t.save("minSpecial")}),s.k0s()()(),s.j41(57,"bit-form-control",0)(58,"input",16),s.bIt("change",function(){return t.save("avoidAmbiguous")}),s.k0s(),s.j41(59,"bit-label"),s.EFF(60),s.nI1(61,"i18n"),s.k0s()(),s.nVh(62,M,3,3,"p",17),s.k0s()()()()),2&e&&(s.Y8G("disableMargin",t.disableMargin),s.R7$(),s.vxM(t.showHeader?1:-1),s.R7$(),s.Y8G("formGroup",t.settings),s.R7$(5),s.JRh(s.bMT(8,27,"length")),s.R7$(4),s.JRh(s.bMT(12,29,t.lengthBoundariesHint$)),s.R7$(5),s.JRh(s.bMT(17,31,"include")),s.R7$(3),s.Y8G("title",s.mNQ(s.bMT(20,33,"uppercaseDescription"))),s.BMQ("aria-description",s.bMT(21,35,"uppercaseDescription")),s.R7$(5),s.JRh(s.bMT(25,37,"uppercaseLabel")),s.R7$(2),s.Y8G("title",s.mNQ(s.bMT(27,39,"lowercaseDescription"))),s.BMQ("aria-description",s.bMT(28,41,"lowercaseDescription")),s.R7$(5),s.JRh(s.bMT(32,43,"lowercaseLabel")),s.R7$(2),s.Y8G("title",s.mNQ(s.bMT(34,45,"numbersDescription"))),s.BMQ("aria-description",s.bMT(35,47,"numbersDescription")),s.R7$(5),s.JRh(s.bMT(39,49,"numbersLabel")),s.R7$(2),s.Y8G("title",s.mNQ(s.bMT(41,51,"specialCharactersDescription"))),s.BMQ("aria-description",s.bMT(42,53,"specialCharactersDescription")),s.R7$(5),s.JRh("!@#$%^&*"),s.R7$(4),s.JRh(s.bMT(50,55,"minNumbers")),s.R7$(5),s.JRh(s.bMT(55,57,"minSpecial")),s.R7$(3),s.Y8G("disableMargin",!t.policyInEffect),s.R7$(3),s.JRh(s.bMT(61,59,"avoidAmbiguous")),s.R7$(2),s.vxM(t.policyInEffect?62:-1))},dependencies:[f.n,w.U,g.E,F.r,o.X1,o.qT,o.me,o.Q0,o.Zm,o.BC,o.cb,o.j4,o.JD,S.i,y.L,R.f,P.j,x.I,$.J,E.h,b.q,A.P,v.p,r.Jj,k.$Z],encapsulation:2})},64194:(e,t,i)=>{"use strict";i.d(t,{p:()=>n});class n{constructor(e){this.name=null==e?void 0:e.name,this.id=null==e?void 0:e.id,this.revisionDate=null==e?void 0:e.revisionDate}static fromJSON(e){return Object.assign(new n({}),e)}}},65067:(e,t,i)=>{"use strict";i.d(t,{H:()=>F,u:()=>R});var n=i(77468),r=i(94573),s=i(33277),o=i(6056),a=i(16878),l=i(3204),c=i(22191),d=i(34465),u=i(74208),h=i(33812),p=i(21823);const m=[[["","slot","start"]],[["","slot","end"]]];function v(e,t){1&e&&(h.j41(0,"div",7),h.SdG(1),h.k0s())}function f(e,t){1&e&&h.eu8(0)}function g(e,t){if(1&e&&h.nrm(0,"i"),2&e){const e=h.XpG(3),t=h.r8f(1);h.HbH(h.VkB("!tw-m-0 tw-w-4 tw-shrink-0 bwi bwi-fw tw-text-alt2 ",e.icon())),h.BMQ("aria-hidden",t)("aria-label",e.text())}}function y(e,t){if(1&e&&(h.j41(0,"span",12),h.EFF(1),h.k0s()),2&e){const e=h.XpG(3);h.R7$(),h.JRh(e.text())}}function b(e,t){if(1&e&&(h.j41(0,"div",10),h.nVh(1,g,1,5,"i",11),h.nVh(2,y,2,1,"span",12),h.k0s()),2&e){const e=h.XpG(2),t=h.r8f(1);h.AVh("tw-py-0","tree"===e.variant()||e.treeDepth()>0)("tw-py-2","tree"!==e.variant()&&0===e.treeDepth())("tw-text-center",!t)("tw-justify-center",!t),h.Y8G("title",e.text()),h.R7$(),h.vxM(e.icon()?1:-1),h.R7$(),h.vxM(t?2:-1)}}function w(e,t){1&e&&h.eu8(0)}function S(e,t){if(1&e){const e=h.RV6();h.j41(0,"a",13),h.bIt("isActiveChange",function(t){u.eBV(e);const i=h.XpG(2);return u.Njj(i.setIsActive(t))})("click",function(){u.eBV(e);const t=h.XpG(2);return u.Njj(t.mainContentClicked.emit())}),h.DNE(1,w,1,0,"ng-container",14),h.k0s()}if(2&e){h.XpG();const e=h.sdS(6),t=h.XpG();h.AVh("!tw-ps-0","tree"===t.variant()||t.treeDepth()>0),h.Y8G("routerLink",t.route())("relativeTo",t.relativeTo())("routerLinkActiveOptions",t.routerLinkActiveOptions())("ariaCurrentWhenActive",t.ariaCurrentWhenActive()),h.BMQ("aria-label",t.ariaLabel()||t.text()),h.R7$(),h.Y8G("ngTemplateOutlet",e)}}function I(e,t){1&e&&h.eu8(0)}function k(e,t){if(1&e){const e=h.RV6();h.j41(0,"button",15),h.bIt("click",function(){u.eBV(e);const t=h.XpG(2);return u.Njj(t.mainContentClicked.emit())}),h.DNE(1,I,1,0,"ng-container",14),h.k0s()}if(2&e){h.XpG();const e=h.sdS(6),t=h.XpG();h.AVh("!tw-ps-0","tree"===t.variant()||t.treeDepth()>0),h.R7$(),h.Y8G("ngTemplateOutlet",e)}}function C(e,t){1&e&&(h.j41(0,"div",9),h.SdG(1,1),h.k0s())}function T(e,t){if(1&e&&(h.j41(0,"div",5),h.nI1(1,"async"),h.j41(2,"div",6),h.nVh(3,v,2,0,"div",7),h.DNE(4,f,1,0,"ng-container",8)(5,b,3,11,"ng-template",null,0,h.C5r)(7,S,2,8,"ng-template",null,1,h.C5r)(9,k,2,3,"ng-template",null,2,h.C5r),h.nVh(11,C,2,0,"div",9),h.k0s()()),2&e){const e=h.sdS(8),t=h.sdS(10),i=h.XpG(),n=h.r8f(1);h.HbH(h.bMT(1,15,i.fvwStyles$)),h.xc7("padding-inline-start",i.navItemIndentationPadding()),h.AVh("tw-bg-background-alt4",i.showActiveStyles)("tw-bg-background-alt3",!i.showActiveStyles)("hover:tw-bg-hover-contrast",!i.showActiveStyles),h.R7$(3),h.vxM(n?3:-1),h.R7$(),h.Y8G("ngIf",i.route())("ngIfThen",e)("ngIfElse",t),h.R7$(7),h.vxM(n?11:-1)}}class F{}class R extends d.S{setIsActive(e){this._isActive=e,this._isActive&&this.parentNavGroup&&this.parentNavGroup.setOpen(!0)}get showActiveStyles(){return this.forceActiveStyles()||this._isActive&&!this.hideActiveStyles()}onFocusIn(e){this.focusVisibleWithin$.next(e.matches("[data-fvw]:focus-visible"))}onFocusOut(){this.focusVisibleWithin$.next(!1)}constructor(e,t){super(),this.sideNavService=e,this.parentNavGroup=t,this.TREE_BASE_PADDING=2.5,this.TREE_DEPTH_PADDING=1.75,this.forceActiveStyles=(0,r.hFB)(!1),this._isActive=!1,this.navItemIndentationPadding=(0,s.EW)(()=>{var e;const t=this.sideNavService.open,i=null!==(e=this.treeDepth())&&void 0!==e?e:0;return t&&"tree"===this.variant()?1===i?`${this.TREE_BASE_PADDING}rem`:`${this.TREE_BASE_PADDING+(i-1)*this.TREE_DEPTH_PADDING}rem`:this.TREE_BASE_PADDING*i+"rem"}),this.ariaCurrentWhenActive=(0,r.hFB)("page"),this.focusVisibleWithin$=new a.t(!1),this.fvwStyles$=this.focusVisibleWithin$.pipe((0,l.T)(e=>e?"tw-z-10 tw-rounded tw-outline-none tw-ring tw-ring-inset tw-ring-text-alt2":"")),this.parentNavGroup&&this.treeDepth.set(this.parentNavGroup.treeDepth()+1)}}R.ɵfac=function(e){return new(e||R)(h.rXU(p.G),h.rXU(F,8))},R.ɵcmp=h.VBU({type:R,selectors:[["bit-nav-item"]],hostBindings:function(e,t){1&e&&h.bIt("focusin",function(e){return t.onFocusIn(e.target)})("focusout",function(){return t.onFocusOut()})},inputs:{forceActiveStyles:[1,"forceActiveStyles"],ariaCurrentWhenActive:[1,"ariaCurrentWhenActive"]},features:[h.Jv_([{provide:d.S,useExisting:R}]),h.Vt3],ngContentSelectors:["[slot=start]","[slot=end]"],decls:4,vars:4,consts:[["anchorAndButtonContent",""],["isAnchor",""],["isButton",""],[1,"tw-ps-2","tw-pe-2"],[1,"tw-relative","tw-rounded-md","tw-h-10",3,"padding-inline-start","tw-bg-background-alt4","tw-bg-background-alt3","hover:tw-bg-hover-contrast","class"],[1,"tw-relative","tw-rounded-md","tw-h-10"],[1,"tw-relative","tw-flex","tw-items-center","tw-h-full"],[1,"tw-absolute","tw-left-[0px]","tw-transform","tw--translate-x-[calc(100%_+_4px)]","[&>*:focus-visible::before]:!tw-ring-text-alt2","[&>*:hover]:!tw-border-text-alt2","[&>*]:tw-text-alt2"],[4,"ngIf","ngIfThen","ngIfElse"],[1,"tw-flex","tw-items-center","tw-pe-1","tw-gap-1","[&>*:focus-visible::before]:!tw-ring-text-alt2","[&>*:hover]:!tw-border-text-alt2","[&>*]:tw-text-alt2","empty:tw-hidden"],[1,"tw-gap-2","tw-flex","tw-items-center","tw-font-medium","tw-h-full",3,"title"],[3,"class"],[1,"tw-truncate"],["data-fvw","","routerLinkActive","",1,"tw-size-full","tw-px-4","tw-block","tw-truncate","tw-border-none","tw-bg-transparent","tw-text-start","!tw-text-alt2","hover:tw-text-alt2","hover:tw-no-underline","focus:tw-outline-none","[&_i]:tw-leading-[1.5rem]",3,"isActiveChange","click","routerLink","relativeTo","routerLinkActiveOptions","ariaCurrentWhenActive"],[4,"ngTemplateOutlet"],["type","button","data-fvw","",1,"tw-size-full","tw-px-4","tw-truncate","tw-border-none","tw-bg-transparent","tw-text-start","!tw-text-alt2","hover:tw-text-alt2","hover:tw-no-underline","focus:tw-outline-none","[&_i]:tw-leading-[1.5rem]",3,"click"]],template:function(e,t){if(1&e&&(h.NAR(m),h.j41(0,"div",3),h.SS7(1),h.nI1(2,"async"),h.nVh(3,T,12,17,"div",4),h.k0s()),2&e){h.R7$();const e=h.bH3(h.bMT(2,1,t.sideNavService.open$));h.R7$(2),h.vxM(e||t.icon()?3:-1)}},dependencies:[n.MD,n.bT,n.T3,c.Q,o.iI,o.Wk,o.wQ,n.Jj],encapsulation:2})},65071:(e,t,i)=>{"use strict";i.d(t,{S:()=>n.S,p:()=>r.p});var n=i(9413),r=i(80755)},65113:(e,t,i)=>{"use strict";i.d(t,{R:()=>g});var n=i(77468),r=i(58625),s=(i(46217),i(80351)),o=i(33812),a=i(50700),l=i(44432),c=i(88016);function d(e,t){if(1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e){const e=o.XpG(2);o.R7$(),o.SpI(" ",o.i5U(2,1,"policyInEffectMinComplexity",e.getPasswordScoreAlertDisplay())," ")}}function u(e,t){if(1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e){const e=o.XpG(2);o.R7$(),o.SpI(" ",o.i5U(2,1,"policyInEffectMinLength",null==e.policy?null:e.policy.minLength.toString())," ")}}function h(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,1,"policyInEffectUppercase")," "))}function p(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,1,"policyInEffectLowercase")," "))}function m(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,1,"policyInEffectNumbers")," "))}function v(e,t){1&e&&(o.j41(0,"li"),o.EFF(1),o.nI1(2,"i18n"),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.i5U(2,1,"policyInEffectSpecial","!@#$%^&*")," "))}function f(e,t){if(1&e&&(o.j41(0,"ul",1),o.DNE(1,d,3,4,"li",2)(2,u,3,4,"li",2)(3,h,3,3,"li",2)(4,p,3,3,"li",2)(5,m,3,3,"li",2)(6,v,3,4,"li",2),o.k0s()),2&e){const e=o.XpG();o.R7$(),o.Y8G("ngIf",(null==e.policy?null:e.policy.minComplexity)>0),o.R7$(),o.Y8G("ngIf",(null==e.policy?null:e.policy.minLength)>0),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireUpper),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireLower),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireNumbers),o.R7$(),o.Y8G("ngIf",null==e.policy?null:e.policy.requireSpecial)}}class g{constructor(e){this.i18nService=e,this.message="masterPasswordPolicyInEffect"}getPasswordScoreAlertDisplay(){let e;switch(this.policy.minComplexity){case 4:e=this.i18nService.t("strong");break;case 3:e=this.i18nService.t("good");break;default:e=this.i18nService.t("weak")}return e+" ("+this.policy.minComplexity+")"}}g.ɵfac=function(e){return new(e||g)(o.rXU(a.W))},g.ɵcmp=o.VBU({type:g,selectors:[["auth-password-callout"]],inputs:{message:"message",policy:"policy"},decls:4,vars:4,consts:[["class","tw-mb-0 tw-ml-8 tw-ps-0",4,"ngIf"],[1,"tw-mb-0","tw-ml-8","tw-ps-0"],[4,"ngIf"]],template:function(e,t){1&e&&(o.j41(0,"bit-callout"),o.EFF(1),o.nI1(2,"i18n"),o.DNE(3,f,7,6,"ul",0),o.k0s()),2&e&&(o.R7$(),o.SpI(" ",o.bMT(2,2,t.message)," "),o.R7$(2),o.Y8G("ngIf",t.policy))},dependencies:[n.MD,n.bT,r.p,s.j,l.G,c.$],encapsulation:2})},65485:(e,t,i)=>{"use strict";i.d(t,{i:()=>o});var n=i(9997),r=i(68881),s=i(6912);class o extends s.D{constructor(e,t,i,n){super(i,n),this.clientId=e,this.clientSecret=t,this.twoFactor=i}toIdentityToken(){const e=super.toIdentityToken(this.clientId);return e.scope=this.clientId.startsWith("organization")?"api.organization":"api",e.grant_type="client_credentials",e.client_secret=this.clientSecret,e}static fromJSON(e){return Object.assign(Object.create(o.prototype),e,{device:e.device?n.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new r.i,e.twoFactor):void 0})}}},65551:(e,t,i)=>{"use strict";i.d(t,{i:()=>r});var n=i(28202);class r{constructor(){this.collections=[],this.groups=[],this.groupNames=[],this.collectionNames=[]}static fromResponse(e){const t=Object.assign(new r,e);return null!=e.collections&&(t.collections=e.collections.map(e=>new n.sK(e))),null!=e.groups&&(t.groups=e.groups),t}}},65731:(e,t,i)=>{"use strict";i.d(t,{Oo:()=>M,UJ:()=>U.U,Y2:()=>T});var n=i(77468),r=i(94573),s=i(33812),o=i(639),a=i(29029),l=i(55807),c=i(75583),d=i(14318),u=i(74208),h=i(47696),p=i(56898),m=i(58806);const v=[[["","slot","title"]]];function f(e,t){if(1&e&&(s.j41(0,"span",2),s.EFF(1),s.k0s()),2&e){const e=t;s.Y8G("variant",e.variant||"primary"),s.R7$(),s.SpI(" ",e.text," ")}}function g(e,t){1&e&&s.EFF(0," per user ")}function y(e,t){if(1&e&&(s.j41(0,"div",5)(1,"div",9)(2,"span",10),s.EFF(3),s.nI1(4,"currency"),s.k0s(),s.j41(5,"span",11),s.EFF(6),s.nVh(7,g,1,0),s.k0s()()()),2&e){const e=t;s.R7$(3),s.JRh(s.i5U(4,3,e.amount,"$")),s.R7$(3),s.SpI(" / ",e.cadence," "),s.R7$(),s.vxM(e.showPerUser?7:-1)}}function b(e,t){if(1&e&&s.nrm(0,"i",14),2&e){const e=s.XpG();s.HbH(s.VkB("bwi ",e.icon.type," tw-me-2"))}}function w(e,t){if(1&e&&s.nrm(0,"i",14),2&e){const e=s.XpG();s.HbH(s.VkB("bwi ",e.icon.type," tw-ms-2"))}}function S(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",12),s.bIt("click",function(){u.eBV(e);const t=s.XpG();return u.Njj(t.onButtonClick())}),s.nVh(1,b,1,3,"i",13),s.EFF(2),s.nVh(3,w,1,3,"i",13),s.k0s()}if(2&e){const e=t;s.Y8G("buttonType",e.type)("block",!0)("disabled",e.disabled),s.R7$(),s.vxM("before"===(null==e.icon?null:e.icon.position)?1:-1),s.R7$(),s.SpI(" ",e.text," "),s.R7$(),s.vxM(!e.icon||"after"!==e.icon.position&&e.icon.position?-1:3)}}function I(e,t){if(1&e&&(s.j41(0,"li",16),s.nrm(1,"i",17),s.j41(2,"span",18),s.EFF(3),s.k0s()()),2&e){const e=t.$implicit;s.R7$(3),s.JRh(e)}}function k(e,t){if(1&e&&(s.j41(0,"ul",15),s.Z7z(1,I,4,1,"li",16,s.fX1),s.k0s()),2&e){const e=s.XpG();s.R7$(),s.Dyx(e)}}function C(e,t){1&e&&s.nVh(0,k,3,0,"ul",15),2&e&&s.vxM(t.length>0?0:-1)}class T{constructor(){this.tagline=r.hFB.required(),this.price=(0,r.hFB)(),this.button=(0,r.hFB)(),this.features=(0,r.hFB)(),this.activeBadge=(0,r.hFB)(),this.buttonClick=new s.bkB}onButtonClick(){this.buttonClick.emit()}}T.ɵfac=function(e){return new(e||T)},T.ɵcmp=s.VBU({type:T,selectors:[["billing-pricing-card"]],inputs:{tagline:[1,"tagline"],price:[1,"price"],button:[1,"button"],features:[1,"features"],activeBadge:[1,"activeBadge"]},outputs:{buttonClick:"buttonClick"},ngContentSelectors:["[slot=title]"],decls:12,vars:5,consts:[[1,"tw-size-full","tw-flex","tw-flex-col"],[1,"tw-flex","tw-items-center","tw-justify-between","tw-mb-2"],["bitBadge","",1,"tw-ml-3",3,"variant"],[1,"tw-mb-6","tw-h-6"],["bitTypography","helper",1,"tw-text-muted","tw-m-0","tw-leading-relaxed","tw-line-clamp-2"],[1,"tw-mb-6"],[1,"tw-mb-6","tw-h-12"],["bitButton","","type","button",3,"buttonType","block","disabled"],[1,"tw-flex-grow"],[1,"tw-flex","tw-items-baseline","tw-gap-1","tw-flex-wrap"],[1,"tw-text-3xl","tw-font-medium","tw-leading-none","tw-m-0"],["bitTypography","helper",1,"tw-text-muted"],["bitButton","","type","button",3,"click","buttonType","block","disabled"],["aria-hidden","true",3,"class"],["aria-hidden","true"],[1,"tw-list-none","tw-p-0","tw-m-0"],[1,"tw-flex","tw-items-start","tw-gap-2","tw-mb-2","last:tw-mb-0"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-primary-600","tw-mt-0.5","tw-flex-shrink-0"],["bitTypography","helper",1,"tw-text-muted","tw-leading-relaxed"]],template:function(e,t){if(1&e&&(s.NAR(v),s.j41(0,"bit-card",0)(1,"div",1),s.SdG(2),s.nVh(3,f,2,2,"span",2),s.k0s(),s.j41(4,"div",3)(5,"p",4),s.EFF(6),s.k0s()(),s.nVh(7,y,8,6,"div",5),s.j41(8,"div",6),s.nVh(9,S,4,6,"button",7),s.k0s(),s.j41(10,"div",8),s.nVh(11,C,1,1),s.k0s()()),2&e){let e,i,n,r;s.R7$(3),s.vxM((e=t.activeBadge())?3:-1,e),s.R7$(3),s.SpI(" ",t.tagline()," "),s.R7$(),s.vxM((i=t.price())?7:-1,i),s.R7$(2),s.vxM((n=t.button())?9:-1,n),s.R7$(2),s.vxM((r=t.features())?11:-1,r)}},dependencies:[o.E,h.n,a.t,p.Q,l.o,c.E,m.r,d.i,n.oe],encapsulation:2});var F=i(33277),R=i(83731),P=i(22191),x=i(36801),$=i(36288);function E(e,t){if(1&e&&(s.j41(0,"div",15)(1,"div",12)(2,"div",13),s.EFF(3),s.nI1(4,"i18n"),s.nI1(5,"currency"),s.nI1(6,"i18n"),s.k0s()(),s.j41(7,"div",21),s.EFF(8),s.nI1(9,"currency"),s.k0s()()),2&e){const e=s.XpG(2),t=s.r8f(1);s.R7$(3),s.LHq(" ",t.quantity," ",s.bMT(4,5,t.name)," x ",s.brH(5,7,t.cost,"USD","symbol")," / ",s.bMT(6,11,t.cadence)," "),s.R7$(5),s.SpI(" ",s.brH(9,13,e.additionalStorageTotal(),"USD","symbol")," ")}}function A(e,t){if(1&e&&(s.j41(0,"div",25)(1,"div",13),s.EFF(2),s.nI1(3,"i18n"),s.nI1(4,"currency"),s.nI1(5,"i18n"),s.k0s(),s.j41(6,"div",26),s.EFF(7),s.nI1(8,"currency"),s.k0s()()),2&e){const e=s.XpG(3),t=s.r8f(3);s.R7$(2),s.LHq(" ",t.quantity," ",s.bMT(3,5,t.name)," x ",s.brH(4,7,t.cost,"USD","symbol")," / ",s.bMT(5,11,t.cadence)," "),s.R7$(5),s.SpI(" ",s.brH(8,13,e.additionalServiceAccountsTotal(),"USD","symbol")," ")}}function D(e,t){if(1&e&&(s.j41(0,"div",16)(1,"div",22)(2,"h3",10),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"div",23)(6,"div",13),s.EFF(7),s.nI1(8,"i18n"),s.nI1(9,"currency"),s.nI1(10,"i18n"),s.k0s(),s.j41(11,"div",24),s.EFF(12),s.nI1(13,"currency"),s.k0s()(),s.nVh(14,A,9,17,"div",25),s.k0s()),2&e){const e=s.XpG(2),t=s.r8f(2),i=s.r8f(3);s.R7$(3),s.JRh(s.bMT(4,7,"secretsManager")),s.R7$(4),s.LHq(" ",t.seats.quantity," ",s.bMT(8,9,t.seats.name)," x ",s.brH(9,11,t.seats.cost,"USD","symbol")," / ",s.bMT(10,15,t.seats.cadence)," "),s.R7$(5),s.SpI(" ",s.brH(13,17,e.secretsManagerSeatsTotal(),"USD","symbol")," "),s.R7$(2),s.vxM(i?14:-1)}}function O(e,t){if(1&e&&(s.j41(0,"div",7)(1,"div",8)(2,"div",9)(3,"h3",10),s.EFF(4),s.nI1(5,"i18n"),s.k0s()(),s.j41(6,"div",11)(7,"div",12)(8,"div",13),s.EFF(9),s.nI1(10,"i18n"),s.nI1(11,"currency"),s.nI1(12,"i18n"),s.k0s()(),s.j41(13,"div",14),s.EFF(14),s.nI1(15,"currency"),s.k0s()(),s.nVh(16,E,10,17,"div",15),s.k0s(),s.nVh(17,D,15,21,"div",16),s.j41(18,"div",17)(19,"h3",10),s.EFF(20),s.nI1(21,"i18n"),s.k0s(),s.j41(22,"div",18),s.EFF(23),s.nI1(24,"currency"),s.k0s()(),s.j41(25,"div",19)(26,"h3",10),s.EFF(27),s.nI1(28,"i18n"),s.k0s(),s.j41(29,"div",20),s.EFF(30),s.nI1(31,"currency"),s.nI1(32,"i18n"),s.k0s()()()),2&e){const e=s.XpG(),t=s.r8f(0),i=s.r8f(1),n=s.r8f(2);s.R7$(4),s.JRh(s.bMT(5,13,"passwordManager")),s.R7$(5),s.LHq(" ",t.quantity," ",s.bMT(10,15,t.name)," x ",s.brH(11,17,t.cost,"USD","symbol")," / ",s.bMT(12,21,t.cadence)," "),s.R7$(5),s.SpI(" ",s.brH(15,23,e.passwordManagerTotal(),"USD","symbol")," "),s.R7$(2),s.vxM(i?16:-1),s.R7$(),s.vxM(n?17:-1),s.R7$(3),s.JRh(s.bMT(21,27,"estimatedTax")),s.R7$(3),s.SpI(" ",s.brH(24,29,e.estimatedTax(),"USD","symbol")," "),s.R7$(4),s.JRh(s.bMT(28,33,"total")),s.R7$(3),s.Lme(" ",s.brH(31,35,e.total(),"USD","symbol")," / ",s.bMT(32,39,t.cadence)," ")}}class M{constructor(){this.passwordManager=r.hFB.required(),this.additionalStorage=(0,r.hFB)(),this.secretsManager=(0,r.hFB)(),this.estimatedTax=r.hFB.required(),this.isExpanded=(0,u.vPA)(!0),this.passwordManagerTotal=(0,F.EW)(()=>this.passwordManager().quantity*this.passwordManager().cost),this.additionalStorageTotal=(0,F.EW)(()=>{const e=this.additionalStorage();return e?e.quantity*e.cost:0}),this.secretsManagerSeatsTotal=(0,F.EW)(()=>{const e=this.secretsManager();return(null==e?void 0:e.seats)?e.seats.quantity*e.seats.cost:0}),this.additionalServiceAccountsTotal=(0,F.EW)(()=>{const e=this.secretsManager();return(null==e?void 0:e.additionalServiceAccounts)?e.additionalServiceAccounts.quantity*e.additionalServiceAccounts.cost:0}),this.total=(0,F.EW)(()=>this.getTotalCost()),this.total$=(0,R.br)(this.total)}toggleExpanded(){this.isExpanded.update(e=>!e)}getTotalCost(){return this.passwordManagerTotal()+this.additionalStorageTotal()+this.secretsManagerSeatsTotal()+this.additionalServiceAccountsTotal()+this.estimatedTax()}}M.ɵfac=function(e){return new(e||M)},M.ɵcmp=s.VBU({type:M,selectors:[["billing-cart-summary"]],inputs:{passwordManager:[1,"passwordManager"],additionalStorage:[1,"additionalStorage"],secretsManager:[1,"secretsManager"],estimatedTax:[1,"estimatedTax"]},decls:20,vars:24,consts:[[1,"tw-size-full"],[1,"tw-flex","tw-items-center","tw-pb-2"],[1,"tw-flex","tw-items-center"],["bitTypography","h4","id","purchase-summary-heading","data-testid","purchase-summary-heading-total",1,"!tw-m-0"],["bitTypography","h3"],["bitTypography","body1",1,"tw-text-main"],["type","button","size","small","data-testid","toggle-purchase-summary-details",3,"click","bitIconButton","label"],["id","purchase-summary-details",1,"tw-pb-2"],["id","password-manager",1,"tw-border-b","tw-border-secondary-100","tw-pb-2"],[1,"tw-flex","tw-justify-between","tw-mb-1"],["bitTypography","h5",1,"tw-text-muted"],["id","password-manager-members",1,"tw-flex","tw-justify-between"],[1,"tw-flex-1"],["bitTypography","body1",1,"tw-text-muted"],["bitTypography","body1","data-testid","password-manager-total",1,"tw-text-muted"],["id","additional-storage",1,"tw-flex","tw-justify-between"],["id","secrets-manager",1,"tw-border-b","tw-border-secondary-100","tw-py-2"],["id","estimated-tax-section",1,"tw-flex","tw-justify-between","tw-border-b","tw-border-secondary-100","tw-pt-2","tw-pb-0.5"],["bitTypography","body1","data-testid","estimated-tax",1,"tw-text-muted"],["id","total-section",1,"tw-flex","tw-justify-between","tw-items-center","tw-pt-2"],["bitTypography","body1","data-testid","final-total",1,"tw-text-muted"],["bitTypography","body1","data-testid","additional-storage-total",1,"tw-text-muted"],[1,"tw-flex","tw-justify-between"],["id","secrets-manager-members",1,"tw-flex","tw-justify-between"],["bitTypography","body1","data-testid","secrets-manager-seats-total",1,"tw-text-muted"],["id","additional-service-accounts",1,"tw-flex","tw-justify-between"],["bitTypography","body1","data-testid","additional-service-accounts-total",1,"tw-text-muted"]],template:function(e,t){if(1&e){const e=s.RV6();s.SS7(0)(1)(2)(3),s.j41(4,"div",0)(5,"div",1)(6,"div",2)(7,"h2",3),s.EFF(8),s.nI1(9,"i18n"),s.nI1(10,"currency"),s.k0s(),s.j41(11,"span",4),s.EFF(12," "),s.k0s(),s.j41(13,"span",5),s.EFF(14),s.nI1(15,"i18n"),s.k0s()(),s.j41(16,"button",6),s.nI1(17,"i18n"),s.nI1(18,"i18n"),s.bIt("click",function(){return u.eBV(e),u.Njj(t.toggleExpanded())}),s.k0s()(),s.nVh(19,O,33,41,"div",7),s.k0s()}if(2&e){let e;const i=s.bH3(t.passwordManager());s.R7$(),s.bH3(t.additionalStorage()),s.R7$(),s.bH3(t.secretsManager()),s.R7$(),s.bH3(null==(e=t.secretsManager())?null:e.additionalServiceAccounts),s.R7$(5),s.Lme(" ",s.bMT(9,12,"total"),": ",s.brH(10,14,t.total(),"USD","symbol")," USD "),s.R7$(6),s.SpI("/ ",s.bMT(15,18,i.cadence)),s.R7$(2),s.Y8G("bitIconButton",t.isExpanded()?"bwi-angle-up":"bwi-angle-down")("label",t.isExpanded()?s.bMT(17,20,"Collapse purchase details"):s.bMT(18,22,"Expand purchase details")),s.BMQ("aria-expanded",t.isExpanded())("aria-controls","purchase-summary-details"),s.R7$(3),s.vxM(t.isExpanded()?19:-1)}},dependencies:[c.E,m.r,P.Q,$.s,n.oe,x.$Z],encapsulation:2});var U=i(47593)},65791:(e,t,i)=>{"use strict";i.d(t,{X:()=>s});var n=i(20702);class r extends n.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.domains=this.getResponseProperty("Domains"),this.excluded=this.getResponseProperty("Excluded")}}class s extends n.r{constructor(e){super(e),this.globalEquivalentDomains=[],this.equivalentDomains=this.getResponseProperty("EquivalentDomains");const t=this.getResponseProperty("GlobalEquivalentDomains");this.globalEquivalentDomains=null!=t?t.map(e=>new r(e)):[]}}},65802:(e,t,i)=>{"use strict";i.d(t,{s:()=>n});class n{}},65861:(e,t,i)=>{"use strict";i.d(t,{L:()=>h});var n=i(22848),r=i(39306),s=i(20702),o=i(81387),a=i(67097);class l extends s.r{constructor(e){super(e),this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl")}}class c extends s.r{constructor(e){super(e),this.hasAdminApproval=this.getResponseProperty("HasAdminApproval"),this.hasLoginApprovingDevice=this.getResponseProperty("HasLoginApprovingDevice"),this.hasManageResetPasswordPermission=this.getResponseProperty("HasManageResetPasswordPermission"),this.isTdeOffboarding=this.getResponseProperty("IsTdeOffboarding"),e.EncryptedPrivateKey&&(this.encryptedPrivateKey=new r.k(this.getResponseProperty("EncryptedPrivateKey"))),e.EncryptedUserKey&&(this.encryptedUserKey=new r.k(this.getResponseProperty("EncryptedUserKey")))}}class d extends s.r{constructor(e){super(e),e.EncryptedPrivateKey&&(this.encryptedPrivateKey=new r.k(this.getResponseProperty("EncryptedPrivateKey"))),e.EncryptedUserKey&&(this.encryptedUserKey=new r.k(this.getResponseProperty("EncryptedUserKey")))}}class u extends s.r{constructor(e){super(e),this.hasMasterPassword=this.getResponseProperty("HasMasterPassword");const t=this.getResponseProperty("MasterPasswordUnlock");null!=t&&"object"==typeof t&&(this.masterPasswordUnlock=new a.v(t)),e.TrustedDeviceOption&&(this.trustedDeviceOption=new c(this.getResponseProperty("TrustedDeviceOption"))),e.KeyConnectorOption&&(this.keyConnectorOption=new l(this.getResponseProperty("KeyConnectorOption"))),e.WebAuthnPrfOption&&(this.webAuthnPrfOption=new d(this.getResponseProperty("WebAuthnPrfOption")))}}class h extends s.r{constructor(e){super(e);const t=this.getResponseProperty("access_token");if(null==t||"string"!=typeof t)throw new Error("Identity response does not contain a valid access token");const i=this.getResponseProperty("token_type");if(null==i||"string"!=typeof i)throw new Error("Identity response does not contain a valid token type");this.accessToken=t,this.tokenType=i;const s=this.getResponseProperty("expires_in");null!=s&&"number"==typeof s&&(this.expiresIn=s);const a=this.getResponseProperty("refresh_token");null!=a&&"string"==typeof a&&(this.refreshToken=a),this.resetMasterPassword=this.getResponseProperty("ResetMasterPassword"),this.privateKey=this.getResponseProperty("PrivateKey");const l=this.getResponseProperty("Key");l&&(this.key=new r.k(l)),this.twoFactorToken=this.getResponseProperty("TwoFactorToken");const c=this.getResponseProperty("Kdf"),d=this.getResponseProperty("KdfIterations"),h=this.getResponseProperty("KdfMemory"),p=this.getResponseProperty("KdfParallelism");this.kdfConfig=c==n.ao.PBKDF2_SHA256?new n.n1(d):new n.hU(d,h,p),this.forcePasswordReset=this.getResponseProperty("ForcePasswordReset"),this.apiUseKeyConnector=this.getResponseProperty("ApiUseKeyConnector"),this.masterPasswordPolicy=new o.$(this.getResponseProperty("MasterPasswordPolicy"));const m=this.getResponseProperty("UserDecryptionOptions");null!=m&&"object"==typeof m&&(this.userDecryptionOptions=new u(m))}hasMasterKeyEncryptedUserKey(){return Boolean(this.key)}}},65918:(e,t,i)=>{"use strict";i.d(t,{X:()=>r});var n=i(8583);class r extends n.n{constructor(e){var t;super(),this.discoverable=!1,null!=e&&(this.credentialId=e.credentialId,this.keyType=e.keyType,this.keyAlgorithm=e.keyAlgorithm,this.keyCurve=e.keyCurve,this.keyValue=e.keyValue,this.rpId=e.rpId,this.userHandle=e.userHandle,this.userName=e.userName,this.counter=e.counter,this.rpName=e.rpName,this.userDisplayName=e.userDisplayName,this.discoverable=null!==(t=e.discoverable)&&void 0!==t&&t,this.creationDate=e.creationDate)}get subTitle(){return this.userDisplayName}static fromJSON(e){const t=null!=e.creationDate?new Date(e.creationDate):null;return Object.assign(new r,e,{creationDate:t})}static fromSdkFido2CredentialView(e){var t;if(e)return new r({credentialId:e.credentialId,keyType:e.keyType,keyAlgorithm:e.keyAlgorithm,keyCurve:e.keyCurve,keyValue:e.keyValue,rpId:e.rpId,userHandle:e.userHandle,userName:e.userName,counter:parseInt(e.counter),rpName:e.rpName,userDisplayName:e.userDisplayName,discoverable:"true"===(null===(t=e.discoverable)||void 0===t?void 0:t.toLowerCase()),creationDate:new Date(e.creationDate)})}toSdkFido2CredentialFullView(){var e;return{credentialId:this.credentialId,keyType:this.keyType,keyAlgorithm:this.keyAlgorithm,keyCurve:this.keyCurve,keyValue:this.keyValue,rpId:this.rpId,userHandle:this.userHandle,userName:this.userName,counter:this.counter.toString(),rpName:this.rpName,userDisplayName:this.userDisplayName,discoverable:this.discoverable?"true":"false",creationDate:null===(e=this.creationDate)||void 0===e?void 0:e.toISOString()}}}},65963:(e,t,i)=>{"use strict";i.d(t,{J:()=>s});var n=i(33812),r=i(51757);class s{constructor(e,t){this.el=e,this.ngControl=t}onInput(){const e=this.el.nativeElement.value.replace(/\s+/g,"");this.ngControl.control.setValue(e)}}s.ɵfac=function(e){return new(e||s)(n.rXU(n.aKT),n.rXU(r.vO,2))},s.ɵdir=n.FsC({type:s,selectors:[["input","appInputStripSpaces",""]],hostBindings:function(e,t){1&e&&n.bIt("input",function(){return t.onInput()})},standalone:!1})},66387:(e,t,i)=>{"use strict";i.d(t,{Rf:()=>M,n_:()=>x,DX:()=>F,zo:()=>T,to:()=>d,SF:()=>$,C8:()=>c,Os:()=>n});class n{}var r=i(93695),s=i(72245),o=i(3633),a=i(78781),l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class c{constructor(e,t,i){this.individualVaultExportService=e,this.organizationVaultExportService=t,this.accountService=i}getExport(e){return l(this,arguments,void 0,function*(e,t="csv",i=""){if(yield this.checkForImpersonation(e),!a.A.isNullOrWhitespace(i)){if("csv"==t)throw new Error("CSV does not support password protected export");return this.individualVaultExportService.getPasswordProtectedExport(e,i)}return this.individualVaultExportService.getExport(e,t)})}getOrganizationExport(e,t,i,n){return l(this,arguments,void 0,function*(e,t,i,n,r=!1){if(yield this.checkForImpersonation(e),!a.A.isNullOrWhitespace(n)){if("csv"==i)throw new Error("CSV does not support password protected export");return this.organizationVaultExportService.getPasswordProtectedExport(e,t,n,r)}return this.organizationVaultExportService.getOrganizationExport(e,t,i,r)})}formats$(e){const t=[{name:".json",format:"json"},{name:".csv",format:"csv"},{name:".json (Encrypted)",format:"encrypted_json"}];return e.isMyVault?(0,r.of)([...t,{name:".zip (with attachments)",format:"zip"}]):(0,r.of)(t)}checkForImpersonation(e){return l(this,void 0,void 0,function*(){const t=yield(0,s._)(this.accountService.activeAccount$.pipe(o.F6));if(e!==t)throw new Error("UserId does not match the currently authenticated user")})}}class d{}var u=i(98869),h=i(69194),p=i(3204),m=i(28202),v=i(56455),f=i(31442),g=i(50451),y=i(23293),b=i(53323),w=i(22848),S=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class I{constructor(e,t,i,n){this.keyGenerationService=e,this.encryptService=t,this.cryptoFunctionService=i,this.kdfConfigService=n}buildPasswordExport(e,t,i){return S(this,void 0,void 0,function*(){const n=yield this.kdfConfigService.getKdfConfig(e),r=a.A.fromBufferToB64(yield this.cryptoFunctionService.randomBytes(16)),s=yield this.keyGenerationService.deriveVaultExportKey(i,r,n),o=yield this.encryptService.encryptString(a.A.newGuid(),s),l=yield this.encryptService.encryptString(t,s),c={encrypted:!0,passwordProtected:!0,salt:r,kdfType:n.kdfType,kdfIterations:n.iterations,encKeyValidation_DO_NOT_EDIT:o.encryptedString,data:l.encryptedString};return n.kdfType===w.ao.Argon2id&&(c.kdfMemory=n.memory,c.kdfParallelism=n.parallelism),JSON.stringify(c,null,"  ")})}buildCommonCipher(e,t){switch(e.type=null,e.name=t.name,e.notes=t.notes,e.fields=null,e.reprompt=t.reprompt,e.login_uri=null,e.login_username=null,e.login_password=null,e.login_totp=null,t.fields&&t.fields.forEach(t=>{e.fields?e.fields+="\n":e.fields="",e.fields+=(t.name||"")+": "+t.value}),t.type){case f.gC.Login:e.type="login",e.login_username=t.login.username,e.login_password=t.login.password,e.login_totp=t.login.totp,t.login.uris&&(e.login_uri=[],t.login.uris.forEach(t=>{e.login_uri.push(t.uri)}));break;case f.gC.SecureNote:e.type="note";break;default:return}return e}}class k{static getFileName(e="",t="csv"){"encrypted_json"===t&&(e=""==e?"encrypted":"encrypted_"+e,t="json");const i=new Date;return"bitwarden"+(e?"_"+e:"")+"_export_"+(i.getFullYear()+""+this.padNumber(i.getMonth()+1,2)+this.padNumber(i.getDate(),2)+this.padNumber(i.getHours(),2)+this.padNumber(i.getMinutes(),2)+this.padNumber(i.getSeconds(),2))+"."+t}static padNumber(e,t,i="0"){const n=e.toString();return n.length>=t?n:new Array(t-n.length+1).join(i)+n}}var C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T extends I{constructor(e,t,i,n,r,s,o,a,l){super(i,r,s,a),this.cipherService=e,this.vaultExportApiService=t,this.keyService=n,this.collectionService=o,this.restrictedItemTypesService=l}getPasswordProtectedExport(e,t,i,n){return C(this,void 0,void 0,function*(){const r=yield this.getOrganizationExport(e,t,"json",n);return{type:"text/plain",data:yield this.buildPasswordExport(e,r.data,i),fileName:k.getFileName("org","encrypted_json")}})}getOrganizationExport(e,t){return C(this,arguments,void 0,function*(e,t,i="csv",n){if(a.A.isNullOrWhitespace(t))throw new Error("OrganizationId must be set");if("zip"===i)throw new Error("Zip export not supported for organization");return"encrypted_json"===i?{type:"text/plain",data:n?yield this.getEncryptedManagedExport(e,t):yield this.getOrganizationEncryptedExport(e,t),fileName:k.getFileName("org","encrypted_json")}:{type:"text/plain",data:n?yield this.getDecryptedManagedExport(e,t,i):yield this.getOrganizationDecryptedExport(e,t,i),fileName:k.getFileName("org",i)}})}getOrganizationDecryptedExport(e,t,i){return C(this,void 0,void 0,function*(){const n=[],r=[],o=[],a=yield(0,s._)(this.keyService.orgKeys$(e).pipe((0,h.p)(e=>null!=e))),l=yield(0,s._)(this.restrictedItemTypesService.restricted$);return o.push(this.vaultExportApiService.getOrganizationExport(t).then(i=>{const s=[];return null!=i&&(null!=i.collections&&i.collections.length>0&&i.collections.forEach(e=>{const i=m.pM.fromCollectionData(new m.Fw(e)),r=a[t];s.push(i.decrypt(r,this.encryptService).then(e=>{n.push(e)}))}),null!=i.ciphers&&i.ciphers.length>0&&i.ciphers.filter(e=>null===e.deletedDate).forEach(t=>C(this,void 0,void 0,function*(){const i=new y.o(new g.A(t));s.push(this.cipherService.decrypt(i,e).then(e=>{this.restrictedItemTypesService.isCipherRestricted(e,l)||r.push(e)}))}))),Promise.all(s)})),yield Promise.all(o),"csv"===i?this.buildCsvExport(n,r):this.buildJsonExport(n,r)})}getOrganizationEncryptedExport(e,t){return C(this,void 0,void 0,function*(){const i=[],n=[],r=yield(0,s._)(this.restrictedItemTypesService.restricted$),o=yield this.vaultExportApiService.getOrganizationExport(t);if(null!=o)return null!=o.collections&&o.collections.length>0&&o.collections.forEach(e=>{const t=m.pM.fromCollectionData(new m.Fw(e));i.push(t)}),null!=o.ciphers&&o.ciphers.length>0&&o.ciphers.filter(e=>null===e.deletedDate).forEach(e=>{const t=new y.o(new g.A(e));this.restrictedItemTypesService.isCipherRestricted(t,r)||n.push(t)}),this.BuildEncryptedExport(e,t,i,n)})}getDecryptedManagedExport(e,t,i){return C(this,void 0,void 0,function*(){let n=[],r=[];const o=[];o.push(this.cipherService.getAllDecrypted(e).then(e=>{r=e})),yield Promise.all(o);const a=yield(0,s._)(this.collectionService.decryptedCollections$(e).pipe((0,p.T)(e=>e.filter(e=>e.organizationId==t&&e.manage)))),l=yield(0,s._)(this.restrictedItemTypesService.restricted$);return n=r.filter(e=>null==e.deletedDate&&e.organizationId==t&&a.some(t=>e.collectionIds.some(e=>t.id===e))&&!this.restrictedItemTypesService.isCipherRestricted(e,l)),"csv"===i?this.buildCsvExport(a,n):this.buildJsonExport(a,n)})}getEncryptedManagedExport(e,t){return C(this,void 0,void 0,function*(){let i=[],n=[];const r=[];r.push(this.cipherService.getAll(e).then(e=>{n=e})),yield Promise.all(r);const o=yield(0,s._)(this.collectionService.encryptedCollections$(e).pipe((0,p.T)(e=>null!=e?e:[]),(0,p.T)(e=>e.filter(e=>e.organizationId==t&&e.manage)))),a=yield(0,s._)(this.restrictedItemTypesService.restricted$);return i=n.filter(e=>null==e.deletedDate&&e.organizationId==t&&o.some(t=>e.collectionIds.some(e=>t.id===e))&&!this.restrictedItemTypesService.isCipherRestricted(e,a)),this.BuildEncryptedExport(e,t,o,i)})}BuildEncryptedExport(e,t,i,n){return C(this,void 0,void 0,function*(){const r=yield(0,s._)(this.keyService.orgKeys$(e)),o=null==r?void 0:r[t];if(null==o)throw new Error("No encryption key found for organization");const a={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.encryptService.encryptString((0,b.aq)(),o)).encryptedString,collections:[],items:[]};return i.forEach(e=>{const t=new v.MA;t.build(e),a.collections.push(t)}),n.forEach(e=>{const t=new v.pU;t.build(e),a.items.push(t)}),JSON.stringify(a,null,"  ")})}buildCsvExport(e,t){const i=new Map;e.forEach(e=>{i.set(e.id,e)});const n=[];return t.forEach(e=>{if(e.type!==f.gC.Login&&e.type!==f.gC.SecureNote)return;const t={collections:[]};null!=e.collectionIds&&(t.collections=e.collectionIds.filter(e=>i.has(e)).map(e=>i.get(e).name)),this.buildCommonCipher(t,e),n.push(t)}),u.unparse(n)}buildJsonExport(e,t){const i={encrypted:!1,collections:[],items:[]};return e.forEach(e=>{const t=new v.MA;t.build(e),i.collections.push(t)}),t.forEach(e=>{const t=new v.pU;t.build(e),i.items.push(t)}),JSON.stringify(i,null,"  ")}}class F{}var R=i(74794),P=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class x extends I{constructor(e,t,i,n,r,s,o,a,l){super(i,r,s,o),this.folderService=e,this.cipherService=t,this.keyService=n,this.apiService=a,this.restrictedItemTypesService=l}getExport(e){return P(this,arguments,void 0,function*(e,t="csv"){return"encrypted_json"===t?this.getEncryptedExport(e):"zip"===t?this.getDecryptedExportZip(e):this.getDecryptedExport(e,t)})}getPasswordProtectedExport(e,t){return P(this,void 0,void 0,function*(){const i=yield this.getExport(e,"json");if("text/plain"!==i.type)throw new Error("Unexpected export type");return{type:"text/plain",data:yield this.buildPasswordExport(e,i.data,t),fileName:k.getFileName("","encrypted_json")}})}getDecryptedExportZip(e){return P(this,void 0,void 0,function*(){const t=new R,i=yield this.getDecryptedExport(e,"json");t.file("data.json",i.data);const n=t.folder("attachments");if(null==n)throw new Error("Error creating attachments folder");for(const s of yield this.cipherService.getAllDecrypted(e)){if(!s.attachments||0===s.attachments.length||null!=s.deletedDate||null!=s.organizationId)continue;const t=n.folder(s.id);for(const i of s.attachments){const n=yield this.downloadAttachment(s.id,i.id);try{const r=yield this.cipherService.getDecryptedAttachmentBuffer(s.id,i,n,e);t.file(i.fileName,r)}catch(r){throw new Error("Error decrypting attachment")}}}return{type:"application/zip",data:yield t.generateAsync({type:"blob"}),fileName:k.getFileName("","zip")}})}downloadAttachment(e,t){return P(this,void 0,void 0,function*(){const i=(yield this.apiService.getAttachmentData(e,t)).url,n=yield fetch(new Request(i,{cache:"no-store"}));if(200!==n.status)throw new Error("Error downloading attachment");return n})}getDecryptedExport(e,t){return P(this,void 0,void 0,function*(){let i=[],n=[];const r=[];r.push((0,s._)(this.folderService.folderViews$(e)).then(e=>{i=e}));const o=yield(0,s._)(this.restrictedItemTypesService.restricted$);return r.push(this.cipherService.getAllDecrypted(e).then(e=>{n=e.filter(e=>null==e.deletedDate&&!this.restrictedItemTypesService.isCipherRestricted(e,o))})),yield Promise.all(r),"csv"===t?{type:"text/plain",data:this.buildCsvExport(i,n),fileName:k.getFileName("","csv")}:{type:"text/plain",data:this.buildJsonExport(i,n),fileName:k.getFileName("","json")}})}getEncryptedExport(e){return P(this,void 0,void 0,function*(){if(!e)throw new Error("User ID must not be null or undefined");let t=[],i=[];const n=[];n.push((0,s._)(this.folderService.folders$(e)).then(e=>{t=e}));const r=yield(0,s._)(this.restrictedItemTypesService.restricted$);n.push(this.cipherService.getAll(e).then(e=>{i=e.filter(e=>null==e.deletedDate&&!this.restrictedItemTypesService.isCipherRestricted(e,r))})),yield Promise.all(n);const o=yield(0,s._)(this.keyService.userKey$(e)),l={encrypted:!0,encKeyValidation_DO_NOT_EDIT:(yield this.encryptService.encryptString(a.A.newGuid(),o)).encryptedString,folders:[],items:[]};return t.forEach(e=>{if(null==e.id)return;const t=new v.wG;t.build(e),l.folders.push(t)}),i.forEach(e=>{if(null!=e.organizationId)return;const t=new v.pU;t.build(e),t.collectionIds=null,l.items.push(t)}),{type:"text/plain",data:JSON.stringify(l,null,"  "),fileName:k.getFileName("","encrypted_json")}})}buildCsvExport(e,t){const i=new Map;e.forEach(e=>{null!=e.id&&i.set(e.id,e)});const n=[];return t.forEach(e=>{if(e.type!==f.gC.Login&&e.type!==f.gC.SecureNote)return;if(null!=e.organizationId)return;const t={};t.folder=null!=e.folderId&&i.has(e.folderId)?i.get(e.folderId).name:null,t.favorite=e.favorite?1:null,this.buildCommonCipher(t,e),n.push(t)}),u.unparse(n)}buildJsonExport(e,t){const i={encrypted:!1,folders:[],items:[]};return e.forEach(e=>{if(null==e.id)return;const t=new v.wG;t.build(e),i.folders.push(t)}),t.forEach(e=>{if(null!=e.organizationId)return;const t=new v.pU;t.build(e),t.collectionIds=null,i.items.push(t)}),JSON.stringify(i,null,"  ")}}class ${}var E=i(20702),A=i(42700);class D extends E.r{constructor(e){super(e);const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map(e=>new m.uF(e)));const i=this.getResponseProperty("Ciphers");null!=i&&(this.ciphers=i.map(e=>new A.N(e)))}}var O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class M{constructor(e){this.apiService=e}getOrganizationExport(e){return O(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/export",void 0,!0,!0);return new D(t)})}}},66523:(e,t,i)=>{"use strict";i.d(t,{K5:()=>d,WD:()=>l,m8:()=>s,yL:()=>a,zw:()=>c});var n=i(11573),r=i(78781);class s extends Error{constructor(e){super(`User (${e}) is not logged in`)}}class o extends Error{constructor(e){super(`Invalid UUID: ${e}`)}}function a(e){switch(e){case n.bq.Android:return"Android";case n.bq.iOS:return"iOS";case n.bq.ChromeExtension:return"ChromeExtension";case n.bq.FirefoxExtension:return"FirefoxExtension";case n.bq.OperaExtension:return"OperaExtension";case n.bq.EdgeExtension:return"EdgeExtension";case n.bq.WindowsDesktop:return"WindowsDesktop";case n.bq.MacOsDesktop:return"MacOsDesktop";case n.bq.LinuxDesktop:return"LinuxDesktop";case n.bq.ChromeBrowser:return"ChromeBrowser";case n.bq.FirefoxBrowser:return"FirefoxBrowser";case n.bq.OperaBrowser:return"OperaBrowser";case n.bq.EdgeBrowser:return"EdgeBrowser";case n.bq.IEBrowser:return"IEBrowser";case n.bq.UnknownBrowser:return"UnknownBrowser";case n.bq.AndroidAmazon:return"AndroidAmazon";case n.bq.UWP:return"UWP";case n.bq.SafariBrowser:return"SafariBrowser";case n.bq.VivaldiBrowser:return"VivaldiBrowser";case n.bq.VivaldiExtension:return"VivaldiExtension";case n.bq.SafariExtension:return"SafariExtension";case n.bq.Server:return"Server";case n.bq.WindowsCLI:return"WindowsCLI";case n.bq.MacOsCLI:return"MacOsCLI";case n.bq.LinuxCLI:return"LinuxCLI";default:return"SDK"}}function l(e){if(r.A.isGuid(e))return e;throw new o(e)}function c(e){return e}class d{}},66827:(e,t,i)=>{"use strict";i.d(t,{y:()=>n});class n{}},66983:(e,t,i)=>{"use strict";i.d(t,{b:()=>m});var n=i(33338),r=i(93695),s=i(3204),o=i(34040),a=i(27442),l=i(44500),c=i(43978),d=i(3633),u=i(31442),h=i(66523),p=i(61325);class m{constructor(e,t,i){this.accountService=e,this.organizationService=t,this.policyService=i,this.restricted$=this.accountService.activeAccount$.pipe(d.bB,(0,l.n)(e=>null==e?(0,r.of)([]):(0,n.z)([this.organizationService.organizations$(e),this.policyService.policiesByType$(c.tt.RestrictedItemTypes,e)]).pipe((0,s.T)(([e,t])=>{const i=e=>{var t;return null!==(t=e.data)&&void 0!==t?t:[u.gC.Card]};return Array.from(new Set(t.flatMap(i))).map(n=>{const r=e.filter(e=>{const r=t.find(t=>t.organizationId===e.id);return!r||!i(r).includes(n)}).map(e=>e.id);return{cipherType:n,allowViewOrgIds:r}})}))),(0,o.F)(),(0,a.t)({bufferSize:1,refCount:!0}))}isCipherRestricted(e,t){const i=t.find(t=>t.cipherType===p.n.getType(e));return!!i&&(!e.organizationId||!i.allowViewOrgIds.includes((0,h.zw)(e.organizationId)))}isCipherRestricted$(e){return this.restricted$.pipe((0,s.T)(t=>this.isCipherRestricted(e,t)))}}},67036:(e,t,i)=>{"use strict";i.d(t,{O:()=>c});var n=i(78781),r=i(31442),s=i(69473),o=i(8583),a=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(s<3?r(o):s>3?r(t,i,o):r(t,i))||o);return s>3&&o&&Object.defineProperty(t,i,o),o},l=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class c extends o.n{constructor(){super()}get firstName(){return this._firstName}set firstName(e){this._firstName=e,this._subTitle=void 0}get lastName(){return this._lastName}set lastName(e){this._lastName=e,this._subTitle=void 0}get subTitle(){return null!=this._subTitle||null==this.firstName&&null==this.lastName||(this._subTitle="",null!=this.firstName&&(this._subTitle=this.firstName),null!=this.lastName&&(""!==this._subTitle&&(this._subTitle+=" "),this._subTitle+=this.lastName)),this._subTitle}get fullName(){if(null!=this.title||null!=this.firstName||null!=this.middleName||null!=this.lastName){let e="";return n.A.isNullOrWhitespace(this.title)||(e+=this.title+" "),n.A.isNullOrWhitespace(this.firstName)||(e+=this.firstName+" "),n.A.isNullOrWhitespace(this.middleName)||(e+=this.middleName+" "),n.A.isNullOrWhitespace(this.lastName)||(e+=this.lastName),e.trim()}}get fullAddress(){var e;let t=null!==(e=this.address1)&&void 0!==e?e:"";return n.A.isNullOrWhitespace(this.address2)||(n.A.isNullOrWhitespace(t)||(t+=", "),t+=this.address2),n.A.isNullOrWhitespace(this.address3)||(n.A.isNullOrWhitespace(t)||(t+=", "),t+=this.address3),t}get fullAddressPart2(){const e=!n.A.isNullOrWhitespace(this.city),t=!n.A.isNullOrWhitespace(this.state),i=!n.A.isNullOrWhitespace(this.postalCode);if(!e&&!t&&!i)return;const r=e?this.city:"-",s=this.state;let o=r;return t&&(o+=", "+s),o+=", "+(i?this.postalCode:"-"),o}get fullAddressForCopy(){let e=this.fullAddress;return null==this.city&&null==this.state&&null==this.postalCode||(e+="\n"+this.fullAddressPart2),null!=this.country&&(e+="\n"+this.country),e}static fromJSON(e){return Object.assign(new c,e)}static fromSdkIdentityView(e){const t=new c;return t.title=e.title,t.firstName=e.firstName,t.middleName=e.middleName,t.lastName=e.lastName,t.address1=e.address1,t.address2=e.address2,t.address3=e.address3,t.city=e.city,t.state=e.state,t.postalCode=e.postalCode,t.country=e.country,t.company=e.company,t.email=e.email,t.phone=e.phone,t.ssn=e.ssn,t.username=e.username,t.passportNumber=e.passportNumber,t.licenseNumber=e.licenseNumber,t}toSdkIdentityView(){return this}}a([(0,s.V)(r.ZX.Title,{sortPosition:0}),l("design:type",String)],c.prototype,"title",void 0),a([(0,s.V)(r.ZX.MiddleName,{sortPosition:2}),l("design:type",String)],c.prototype,"middleName",void 0),a([(0,s.V)(r.ZX.Address1,{sortPosition:12}),l("design:type",String)],c.prototype,"address1",void 0),a([(0,s.V)(r.ZX.Address2,{sortPosition:13}),l("design:type",String)],c.prototype,"address2",void 0),a([(0,s.V)(r.ZX.Address3,{sortPosition:14}),l("design:type",String)],c.prototype,"address3",void 0),a([(0,s.V)(r.ZX.City,{sortPosition:15,i18nKey:"cityTown"}),l("design:type",String)],c.prototype,"city",void 0),a([(0,s.V)(r.ZX.State,{sortPosition:16,i18nKey:"stateProvince"}),l("design:type",String)],c.prototype,"state",void 0),a([(0,s.V)(r.ZX.PostalCode,{sortPosition:17,i18nKey:"zipPostalCodeLabel"}),l("design:type",String)],c.prototype,"postalCode",void 0),a([(0,s.V)(r.ZX.Country,{sortPosition:18}),l("design:type",String)],c.prototype,"country",void 0),a([(0,s.V)(r.ZX.Company,{sortPosition:6}),l("design:type",String)],c.prototype,"company",void 0),a([(0,s.V)(r.ZX.Email,{sortPosition:10}),l("design:type",String)],c.prototype,"email",void 0),a([(0,s.V)(r.ZX.Phone,{sortPosition:11}),l("design:type",String)],c.prototype,"phone",void 0),a([(0,s.V)(r.ZX.Ssn,{sortPosition:7}),l("design:type",String)],c.prototype,"ssn",void 0),a([(0,s.V)(r.ZX.Username,{sortPosition:5}),l("design:type",String)],c.prototype,"username",void 0),a([(0,s.V)(r.ZX.PassportNumber,{sortPosition:8}),l("design:type",String)],c.prototype,"passportNumber",void 0),a([(0,s.V)(r.ZX.LicenseNumber,{sortPosition:9}),l("design:type",String)],c.prototype,"licenseNumber",void 0),a([(0,s.V)(r.ZX.FirstName,{sortPosition:1}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"firstName",null),a([(0,s.V)(r.ZX.LastName,{sortPosition:4}),l("design:type",String),l("design:paramtypes",[String])],c.prototype,"lastName",null),a([(0,s.V)(r.ZX.FullName,{sortPosition:3}),l("design:type",String),l("design:paramtypes",[])],c.prototype,"fullName",null)},67097:(e,t,i)=>{"use strict";i.d(t,{v:()=>a});var n=i(20702),r=i(22848);class s extends n.r{constructor(e){super(e);const t=this.getResponseProperty("KdfType");if(null==t||"number"!=typeof t)throw new Error("KDF config response does not contain a valid KDF type");this.kdfType=t;const i=this.getResponseProperty("Iterations");if(null==i||"number"!=typeof i)throw new Error("KDF config response does not contain a valid number of iterations");if(this.iterations=i,this.kdfType===r.ao.Argon2id){const e=this.getResponseProperty("Memory");if(null==e||"number"!=typeof e)throw new Error("KDF config response does not contain a valid memory size for Argon2id");const t=this.getResponseProperty("Parallelism");if(null==t||"number"!=typeof t)throw new Error("KDF config response does not contain a valid parallelism for Argon2id");this.memory=e,this.parallelism=t}}toKdfConfig(){switch(this.kdfType){case r.ao.Argon2id:return new r.hU(this.iterations,this.memory,this.parallelism);case r.ao.PBKDF2_SHA256:return new r.n1(this.iterations)}}}var o=i(10459);class a extends n.r{constructor(e){super(e);const t=this.getResponseProperty("Salt");if(null==t||"string"!=typeof t)throw new Error("MasterPasswordUnlockResponse does not contain a valid salt");this.salt=t,this.kdf=new s(this.getResponseProperty("Kdf"));const i=this.getResponseProperty("MasterKeyEncryptedUserKey");if(null==i||"string"!=typeof i)throw new Error("MasterPasswordUnlockResponse does not contain a valid master key encrypted user key");this.masterKeyWrappedUserKey=i}toMasterPasswordUnlockData(){return new o.k(this.salt,this.kdf.toKdfConfig(),this.masterKeyWrappedUserKey)}}},67311:(e,t,i)=>{"use strict";i.d(t,{L:()=>p,o:()=>m});var n=i(94573),r=i(58806),s=i(28846);const o=(0,s.hZ)("fadeIn",[(0,s.kY)(":enter",[(0,s.iF)({opacity:0,transform:"translateY(-50px)"}),(0,s.Os)([(0,s.i0)("0.15s linear",(0,s.iF)({opacity:1})),(0,s.i0)("0.3s ease-out",(0,s.iF)({transform:"none"}))])])]);var a=i(35042),l=i(33812);const c=[[["","bitDialogTitle",""]],[["","bitDialogContent",""]],[["","bitDialogFooter",""]],[["","bitDialogIcon",""]]];function d(e,t){1&e&&l.SdG(0,3)}function u(e,t){1&e&&l.nrm(0,"i",5)}function h(e,t){if(1&e&&l.nVh(0,d,1,0)(1,u,1,0,"i",5),2&e){const e=l.XpG();l.vxM(e.hasIcon?0:1)}}class p{}p.ɵfac=function(e){return new(e||p)},p.ɵdir=l.FsC({type:p,selectors:[["","bitDialogIcon",""]]});class m{constructor(){this.hideIcon=(0,n.hFB)(!1,{transform:n.L39})}get hasIcon(){return null!=this.icon}}m.ɵfac=function(e){return new(e||m)},m.ɵcmp=l.VBU({type:m,selectors:[["bit-simple-dialog"]],contentQueries:function(e,t,i){if(1&e&&l.wni(i,p,5),2&e){let e;l.mGM(e=l.lsd())&&(t.icon=e.first)}},inputs:{hideIcon:[1,"hideIcon"]},ngContentSelectors:["[bitDialogTitle]","[bitDialogContent]","[bitDialogFooter]","[bitDialogIcon]"],decls:9,vars:2,consts:[[1,"tw-my-4","tw-pb-6","tw-pt-8","tw-flex","tw-max-h-screen","tw-w-96","tw-max-w-90vw","tw-flex-col","tw-overflow-hidden","tw-rounded-3xl","tw-border","tw-border-solid","tw-border-secondary-100","tw-shadow-lg","tw-bg-text-contrast","tw-text-main"],[1,"tw-flex","tw-px-6","tw-flex-col","tw-items-center","tw-gap-2","tw-text-center"],["bitDialogTitleContainer","","bitTypography","h3","noMargin","",1,"tw-w-full","tw-text-main","tw-break-words","tw-hyphens-auto"],[1,"tw-overflow-y-auto","tw-px-6","tw-mb-6","tw-text-center","tw-text-base","tw-break-words","tw-hyphens-auto"],[1,"tw-flex","tw-flex-col","tw-gap-2","tw-px-6"],["aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-text-3xl","tw-text-warning"]],template:function(e,t){1&e&&(l.NAR(c),l.j41(0,"div",0)(1,"div",1),l.nVh(2,h,2,1),l.j41(3,"h1",2),l.SdG(4),l.k0s()(),l.j41(5,"div",3),l.SdG(6,1),l.k0s(),l.j41(7,"div",4),l.SdG(8,2),l.k0s()()),2&e&&(l.Y8G("@fadeIn",void 0),l.R7$(2),l.vxM(t.hideIcon()?-1:2))},dependencies:[a.h,r.r],encapsulation:2,data:{animation:[o]}})},67379:(e,t,i)=>{"use strict";i.d(t,{f:()=>s});var n=i(33812),r=i(7421);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵcmp=n.VBU({type:s,selectors:[["bit-base-card"]],features:[n.nM4([r.T])],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2})},67529:(e,t,i)=>{"use strict";i.d(t,{B:()=>n});class n{constructor(e,t,i){this.encapsulatedDownstreamKey=e,this.encryptedPublicKey=t,this.encryptedPrivateKey=i}}},67553:(e,t,i)=>{"use strict";i.d(t,{Dl:()=>l,KP:()=>v,OV:()=>m,PV:()=>g,Sw:()=>f,Ue:()=>u,Vc:()=>h,ex:()=>d,k4:()=>y,o2:()=>p,of:()=>a,pe:()=>c});var n=i(33338),r=i(3204),s=i(82468),o=i(43978);function a(e){return e.canViewAllCollections}function l(e){return e.isOwner||e.canManagePolicies||e.canManageSso||e.canManageScim||e.canAccessImport||e.canAccessExport||e.canManageDeviceApprovals}function c(e){return e.canManageUsers||e.canManageUsersPassword}function d(e){return e.canManageGroups}function u(e){return e.canAccessReports||e.canAccessEventLogs}function h(e){return!1}function p(e){return e.canUseAccessIntelligence&&e.canAccessReports}function m(e){return!(!e.enabled&&!e.isOwner)&&(c(e)||d(e)||u(e)||l(e)||a(e))}function v(e,t,i){return(0,n.z)([t.getFeatureFlag$(s.TO.AutoConfirm),i.policiesByType$(o.tt.AutoConfirm,e)]).pipe((0,r.T)(([e,t])=>!e||!t.some(e=>e.enabled)))}function f(e){return(0,r.T)(t=>t.find(t=>t.id===e))}class g{}class y extends g{}},67756:(e,t,i)=>{"use strict";i.d(t,{M:()=>a});var n=i(39306),r=i(17989),s=i(96540),o=i(72142);class a extends r.A{constructor(e){super(),null!=e&&(this.privateKey=new n.k(e.privateKey),this.publicKey=new n.k(e.publicKey),this.keyFingerprint=new n.k(e.keyFingerprint))}decrypt(e,t="No Cipher Context"){return this.decryptObj(this,new o.H,["privateKey","publicKey","keyFingerprint"],e,"DomainType: SshKey; "+t)}toSshKeyData(){const e=new s.E;return this.buildDataModel(this,e,{privateKey:null,publicKey:null,keyFingerprint:null}),e}static fromJSON(e){if(null==e)return;const t=new a;return t.privateKey=n.k.fromJSON(e.privateKey),t.publicKey=n.k.fromJSON(e.publicKey),t.keyFingerprint=n.k.fromJSON(e.keyFingerprint),t}toSdkSshKey(){return{privateKey:this.privateKey.toSdk(),publicKey:this.publicKey.toSdk(),fingerprint:this.keyFingerprint.toSdk()}}static fromSdkSshKey(e){if(null==e)return;const t=new a;return t.privateKey=n.k.fromJSON(e.privateKey),t.publicKey=n.k.fromJSON(e.publicKey),t.keyFingerprint=n.k.fromJSON(e.fingerprint),t}}},68016:(e,t,i)=>{"use strict";i.d(t,{m:()=>N});var n=i(60989),r=i(94251),s=i(77468),o=i(74208),a=i(94573),l=i(33277),c=i(83731),d=i(33338),u=i(44500),h=i(36801),p=i(36288),m=i(83632),v=i(58806),f=i(79026),g=i(12610),y=i(50037),b=i(79243),w=i(3204),S=i(34040),I=i(48479);const k=(e,t,i=1)=>((e,t)=>new I.c(i=>{const n=new IntersectionObserver(e=>{for(const t of e)i.next(t)},t);return n.observe(e),()=>n.disconnect()}))(t,{root:e,threshold:i}).pipe((0,g.Z)(null),(0,y.Z)(0,f.X),(0,b.Q)(f.X),(0,w.T)(t=>t?!t.isIntersecting:e.scrollHeight>e.clientHeight),(0,S.F)());var C=i(21274),T=i(7730),F=i(35042),R=i(33812);const P=["scrollBottom"],x=[[["","bitDialogTitle",""]],[["","bitDialogContent",""]],[["","bitDialogFooter",""]]],$=(e,t)=>[e,t],E=(e,t,i,n)=>({"tw-p-4 has-[[biticonbutton]]:tw-pe-2":e,"tw-px-6 tw-py-4 has-[[biticonbutton]]:tw-pe-4":t,"tw-border-secondary-100":i,"tw-border-transparent":n}),A=(e,t,i)=>({"tw-min-h-60":e,"tw-bg-background":t,"tw-bg-background-alt":i}),D=(e,t,i,n)=>({"tw-py-2 tw-ps-6 tw-pe-6":e,"tw-overflow-y-auto":t,"tw-invisible tw-overflow-y-hidden":i,"tw-py-4":n}),O=(e,t)=>({"tw-border-transparent":e,"tw-border-secondary-100":t}),M=(e,t)=>({"tw-px-6 tw-py-4":e,"tw-p-4 has-[[biticonbutton]]:tw-pe-2":t});function U(e,t){1&e&&(R.j41(0,"span",4),R.EFF(1),R.k0s()),2&e&&(R.R7$(),R.SpI(" ",t," "))}function G(e,t){1&e&&(R.nrm(0,"button",5),R.nI1(1,"i18n")),2&e&&R.Y8G("label",R.bMT(1,1,"close"))}function j(e,t){1&e&&(R.j41(0,"div",7),R.nrm(1,"bit-spinner"),R.k0s())}class N{constructor(){this.destroyRef=(0,o.WQX)(o.abz),this.scrollableBody=a.ebz.required(r.uv),this.scrollBottom=a.ebz.required("scrollBottom"),this.dialogRef=(0,o.WQX)(C.ce,{optional:!0}),this.bodyHasScrolledFrom=(e=>{const t=null!=e?e:(0,o.vPA)((0,o.WQX)(r.uv)),i=(0,c.br)(t).pipe((0,u.n)(e=>e.elementScrolled().pipe((0,g.Z)(null),(0,w.T)(()=>({top:e.measureScrollOffset("top")>0,bottom:e.measureScrollOffset("bottom")>1})))));return(0,c.ot)(i,{initialValue:{top:!1,bottom:!1}})})(this.scrollableBody),this.scrollableBody$=(0,c.br)(this.scrollableBody),this.scrollBottom$=(0,c.br)(this.scrollBottom),this.isScrollable$=(0,d.z)([this.scrollableBody$,this.scrollBottom$]).pipe((0,u.n)(([e,t])=>k(e.getElementRef().nativeElement,t.nativeElement))),this.background=(0,a.hFB)("default"),this.dialogSize=(0,a.hFB)("default"),this.title=(0,a.hFB)(),this.subtitle=(0,a.hFB)(),this.disablePadding=(0,a.hFB)(!1,{transform:a.L39}),this.disableAnimations=(0,a.hFB)(!1,{transform:a.L39}),this.loading=(0,a.hFB)(!1),this.animationCompleted=(0,o.vPA)(!1),this.classes=(0,l.EW)(()=>{var e,t;const i=(null===(e=this.dialogRef)||void 0===e?void 0:e.isDrawer)?["tw-h-full","md:tw-w-[23rem]"]:["md:tw-p-4","tw-w-screen","tw-max-h-[90vh]"],n=this.disableAnimations()||this.animationCompleted()||(null===(t=this.dialogRef)||void 0===t?void 0:t.isDrawer)?[]:"small"===this.dialogSize()?["tw-animate-slide-down"]:["tw-animate-slide-up","md:tw-animate-slide-down"];return["tw-flex","tw-flex-col","tw-w-screen",this.width,...i,...n]})}handleEsc(e){var t,i;(null===(t=this.dialogRef)||void 0===t?void 0:t.disableClose)||(null===(i=this.dialogRef)||void 0===i||i.close(),e.stopPropagation())}get width(){switch(this.dialogSize()){case"small":return"md:tw-max-w-sm";case"large":return"md:tw-max-w-3xl";default:return"md:tw-max-w-xl"}}onAnimationEnd(){this.animationCompleted.set(!0)}}N.ɵfac=function(e){return new(e||N)},N.ɵcmp=R.VBU({type:N,selectors:[["bit-dialog"]],viewQuery:function(e,t){1&e&&(R.wEZ(t.scrollableBody,r.uv,5),R.wEZ(t.scrollBottom,P,5)),2&e&&R.NyB(2)},hostVars:2,hostBindings:function(e,t){1&e&&R.bIt("keydown.esc",function(e){return t.handleEsc(e)})("animationend",function(){return t.onAnimationEnd()}),2&e&&R.HbH(t.classes())},inputs:{background:[1,"background"],dialogSize:[1,"dialogSize"],title:[1,"title"],subtitle:[1,"subtitle"],disablePadding:[1,"disablePadding"],disableAnimations:[1,"disableAnimations"],loading:[1,"loading"]},ngContentSelectors:["[bitDialogTitle]","[bitDialogContent]","[bitDialogFooter]"],decls:18,vars:35,consts:[["scrollBottom",""],["cdkTrapFocus","","cdkTrapFocusAutoCapture","",1,"tw-flex","tw-w-full","tw-flex-col","tw-self-center","tw-overflow-hidden","tw-border","tw-border-solid","tw-border-secondary-100","tw-bg-background","tw-text-main",3,"ngClass"],[1,"tw-flex","tw-justify-between","tw-items-center","tw-gap-4","tw-border-0","tw-border-b","tw-border-solid","tw-py-3","tw-ps-6","tw-pe-4",3,"ngClass"],["bitDialogTitleContainer","","bitTypography","h3","noMargin","","cdkFocusInitial","","tabindex","-1",1,"tw-text-main","tw-mb-0","tw-line-clamp-2","tw-text-ellipsis","tw-break-words","focus-visible:tw-outline-none"],[1,"tw-text-muted","tw-font-normal","tw-text-sm"],["type","button","bitIconButton","bwi-close","buttonType","main","size","default","bitDialogClose","",3,"label"],[1,"tw-relative","tw-flex-1","tw-flex","tw-flex-col","tw-overflow-hidden",3,"ngClass"],[1,"tw-absolute","tw-flex","tw-size-full","tw-items-center","tw-justify-center"],["cdkScrollable","",3,"ngClass"],["data-chromatic","ignore",1,"tw-border-0","tw-border-t","tw-border-solid",3,"ngClass"],[1,"tw-flex","tw-flex-row","tw-items-center","tw-gap-2","tw-bg-background","tw-py-5","tw-ps-6","tw-pe-4",3,"ngClass"]],template:function(e,t){if(1&e&&(R.NAR(x),R.j41(0,"section",1)(1,"header",2)(2,"h2",3),R.EFF(3),R.nVh(4,U,2,1,"span",4),R.SdG(5),R.k0s(),R.nVh(6,G,2,3,"button",5),R.k0s(),R.j41(7,"div",6),R.nVh(8,j,2,0,"div",7),R.j41(9,"div",8),R.SdG(10,1),R.nrm(11,"div",null,0),R.k0s()(),R.SS7(13),R.nI1(14,"async"),R.nrm(15,"div",9),R.j41(16,"footer",10),R.SdG(17,2),R.k0s()()),2&e){let e;const i=null==t.dialogRef?null:t.dialogRef.isDrawer;R.Y8G("ngClass",R.l_i(12,$,t.width,i?"tw-h-full tw-border-t-0":"tw-rounded-t-xl md:tw-rounded-xl tw-shadow-lg"));const n=t.bodyHasScrolledFrom().top;R.R7$(),R.Y8G("ngClass",R.ziG(15,E,!i,i,n,!n)),R.R7$(2),R.SpI(" ",t.title()," "),R.R7$(),R.vxM((e=t.subtitle())?4:-1,e),R.R7$(2),R.vxM(null!=t.dialogRef&&t.dialogRef.disableClose?-1:6),R.R7$(),R.Y8G("ngClass",R.sMw(20,A,t.loading(),"default"===t.background(),"alt"===t.background())),R.R7$(),R.vxM(t.loading()?8:-1),R.R7$(),R.Y8G("ngClass",R.ziG(24,D,!t.disablePadding(),!t.loading(),t.loading(),"alt"===t.background()));const r=R.bMT(14,10,t.isScrollable$),s=!t.bodyHasScrolledFrom().top&&r||t.bodyHasScrolledFrom().bottom;R.R7$(6),R.Y8G("ngClass",R.l_i(29,O,!s,s)),R.R7$(),R.Y8G("ngClass",R.l_i(32,M,i,!i))}},dependencies:[s.MD,s.YU,F.h,v.r,p.s,T.I,n.kB,r.uv,m.t,s.Jj,h.$Z],encapsulation:2})},68333:(e,t,i)=>{"use strict";var n;i.d(t,{k:()=>n}),function(e){e[e.MasterPassword=0]="MasterPassword",e[e.OTP=1]="OTP",e[e.PIN=2]="PIN",e[e.Biometrics=3]="Biometrics"}(n||(n={}))},68455:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{}},68466:(e,t,i)=>{"use strict";i.d(t,{L:()=>l});var n=i(94573),r=i(51757),s=i(36801),o=i(33812);function a(e,t){if(1&e&&(o.Hgh(0,"i",0),o.EFF(1),o.nI1(2,"i18n")),2&e){const e=o.XpG();o.R7$(),o.SpI(" ",o.i5U(2,1,"fieldsNeedAttention",e.errorString)," ")}}class l{constructor(){this.formGroup=(0,n.hFB)()}get errorCount(){const e=this.formGroup();return e?this.getErrorCount(e):0}get errorString(){return this.errorCount.toString()}getErrorCount(e){return Object.values(e.controls).reduce((e,t)=>t instanceof r.J3?e+this.getErrorCount(t):null==t.errors||!t.dirty&&t.untouched?e:e+Object.keys(t.errors).length,0)}}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["bit-error-summary"]],hostAttrs:["aria-live","assertive",1,"tw-block","tw-text-danger","tw-mt-2"],inputs:{formGroup:[1,"formGroup"]},decls:1,vars:1,consts:[[1,"bwi","bwi-error"]],template:function(e,t){1&e&&o.nVh(0,a,3,4),2&e&&o.vxM(t.errorCount>0?0:-1)},dependencies:[s.$Z],encapsulation:2})},68467:(e,t,i)=>{"use strict";var n;i.d(t,{iS:()=>r,Qd:()=>n,K9:()=>s,VK:()=>o,EO:()=>l.EO,hq:()=>a,xk:()=>d.$b,$B:()=>l.Kg,NJ:()=>u}),function(e){e[e.AesCbc256_B64=0]="AesCbc256_B64",e[e.AesCbc256_HmacSha256_B64=2]="AesCbc256_HmacSha256_B64",e[e.CoseEncrypt0=7]="CoseEncrypt0",e[e.Rsa2048_OaepSha256_B64=3]="Rsa2048_OaepSha256_B64",e[e.Rsa2048_OaepSha1_B64=4]="Rsa2048_OaepSha1_B64",e[e.Rsa2048_OaepSha256_HmacSha256_B64=5]="Rsa2048_OaepSha256_HmacSha256_B64",e[e.Rsa2048_OaepSha1_HmacSha256_B64=6]="Rsa2048_OaepSha1_HmacSha256_B64"}(n||(n={}));const r={[n.AesCbc256_B64]:2,[n.AesCbc256_HmacSha256_B64]:3,[n.Rsa2048_OaepSha256_B64]:1,[n.Rsa2048_OaepSha1_B64]:1,[n.Rsa2048_OaepSha256_HmacSha256_B64]:2,[n.Rsa2048_OaepSha1_HmacSha256_B64]:2,[n.CoseEncrypt0]:1};var s,o;!function(e){e[e.Direct=0]="Direct",e[e.Azure=1]="Azure"}(s||(s={})),function(e){e[e.ServerAuthorization=1]="ServerAuthorization",e[e.LocalAuthorization=2]="LocalAuthorization"}(o||(o={}));var a,l=i(21551);!function(e){e.Auto="auto",e.Pin="pin"}(a||(a={}));var c,d=i(90107);!function(e){e.System="system",e.Light="light",e.Dark="dark"}(c||(c={}));const u={System:"system",Light:"light",Dark:"dark"}},68881:(e,t,i)=>{"use strict";i.d(t,{i:()=>n});class n{constructor(e=null,t=null,i=!1){this.provider=e,this.token=t,this.remember=i}}},68923:(e,t,i)=>{"use strict";i.d(t,{P:()=>o});var n=i(94573),r=i(33812);function s(e,t){1&e&&r.SdG(0)}class o{constructor(){this.icon=(0,n.hFB)(),this.value=n.hFB.required(),this.label=n.hFB.required(),this.disabled=(0,n.hFB)(void 0,{transform:n.L39})}}o.ɵfac=function(e){return new(e||o)},o.ɵcmp=r.VBU({type:o,selectors:[["bit-option"]],inputs:{icon:[1,"icon"],value:[1,"value"],label:[1,"label"],disabled:[1,"disabled"]},ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(r.NAR(),r.PeT(0,s,1,0,"ng-template"))},encapsulation:2})},69138:(e,t,i)=>{"use strict";i.d(t,{P:()=>a,_:()=>o});var n=i(77788),r=i(20702),s=i(53674);class o extends n.t{constructor(e){super(e),this.storageName=this.getResponseProperty("StorageName"),this.storageGb=this.getResponseProperty("StorageGb");const t=this.getResponseProperty("Subscription");this.subscription=null==t?null:new s.y7(t);const i=this.getResponseProperty("UpcomingInvoice");this.upcomingInvoice=null==i?null:new s.V8(i);const n=this.getResponseProperty("CustomerDiscount");this.customerDiscount=null==n?null:new a(n),this.expiration=this.getResponseProperty("Expiration"),this.expirationWithoutGracePeriod=this.getResponseProperty("ExpirationWithoutGracePeriod")}}class a extends r.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.active=this.getResponseProperty("Active"),this.percentOff=this.getResponseProperty("PercentOff"),this.amountOff=this.getResponseProperty("AmountOff"),this.appliesTo=this.getResponseProperty("AppliesTo")||[]}}},69473:(e,t,i)=>{"use strict";i.d(t,{V:()=>r});class n{constructor(e,t){this.propertyKey=e,this._i18nKey=null==t?void 0:t.i18nKey,this.sortPosition=t.sortPosition}get i18nKey(){var e;return null!==(e=this._i18nKey)&&void 0!==e?e:this.propertyKey}}function r(e,t){return(i,r)=>{null==i.linkedFieldOptions&&(i.linkedFieldOptions=new Map),i.linkedFieldOptions.set(e,new n(r,t))}}},69554:(e,t,i)=>{"use strict";i.d(t,{T:()=>n});class n{}},69580:(e,t,i)=>{"use strict";i.d(t,{tQ:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.type=this.getResponseProperty("Type"),this.productTier=this.getResponseProperty("ProductTier"),this.name=this.getResponseProperty("Name"),this.isAnnual=this.getResponseProperty("IsAnnual"),this.nameLocalizationKey=this.getResponseProperty("NameLocalizationKey"),this.descriptionLocalizationKey=this.getResponseProperty("DescriptionLocalizationKey"),this.canBeUsedByBusiness=this.getResponseProperty("CanBeUsedByBusiness"),this.trialPeriodDays=this.getResponseProperty("TrialPeriodDays"),this.hasSelfHost=this.getResponseProperty("HasSelfHost"),this.hasPolicies=this.getResponseProperty("HasPolicies"),this.hasGroups=this.getResponseProperty("HasGroups"),this.hasDirectory=this.getResponseProperty("HasDirectory"),this.hasEvents=this.getResponseProperty("HasEvents"),this.hasTotp=this.getResponseProperty("HasTotp"),this.has2fa=this.getResponseProperty("Has2fa"),this.hasApi=this.getResponseProperty("HasApi"),this.hasSso=this.getResponseProperty("HasSso"),this.hasResetPassword=this.getResponseProperty("HasResetPassword"),this.usersGetPremium=this.getResponseProperty("UsersGetPremium"),this.upgradeSortOrder=this.getResponseProperty("UpgradeSortOrder"),this.displaySortOrder=this.getResponseProperty("DisplaySortOrder"),this.legacyYear=this.getResponseProperty("LegacyYear"),this.disabled=this.getResponseProperty("Disabled");const t=this.getResponseProperty("PasswordManager"),i=this.getResponseProperty("SecretsManager");this.PasswordManager=null==t?null:new o(t),this.SecretsManager=null==i?null:new s(i)}}class s extends n.r{constructor(e){super(e),this.stripeSeatPlanId=this.getResponseProperty("StripeSeatPlanId"),this.baseSeats=this.getResponseProperty("BaseSeats"),this.basePrice=this.getResponseProperty("BasePrice"),this.seatPrice=this.getResponseProperty("SeatPrice"),this.hasAdditionalSeatsOption=this.getResponseProperty("HasAdditionalSeatsOption"),this.maxAdditionalSeats=this.getResponseProperty("MaxAdditionalSeats"),this.maxSeats=this.getResponseProperty("MaxSeats"),this.stripeServiceAccountPlanId=this.getResponseProperty("StripeServiceAccountPlanId"),this.additionalPricePerServiceAccount=this.getResponseProperty("AdditionalPricePerServiceAccount"),this.baseServiceAccount=this.getResponseProperty("BaseServiceAccount"),this.maxServiceAccount=this.getResponseProperty("MaxServiceAccount"),this.hasAdditionalServiceAccountOption=this.getResponseProperty("HasAdditionalServiceAccountOption"),this.maxAdditionalServiceAccounts=this.getResponseProperty("MaxAdditionalServiceAccounts"),this.maxProjects=this.getResponseProperty("MaxProjects")}}class o extends n.r{constructor(e){super(e),this.stripePlanId=this.getResponseProperty("StripePlanId"),this.stripeSeatPlanId=this.getResponseProperty("StripeSeatPlanId"),this.stripeProviderPortalSeatPlanId=this.getResponseProperty("StripeProviderPortalSeatPlanId"),this.stripeStoragePlanId=this.getResponseProperty("StripeStoragePlanId"),this.stripePremiumAccessPlanId=this.getResponseProperty("StripePremiumAccessPlanId"),this.basePrice=this.getResponseProperty("BasePrice"),this.seatPrice=this.getResponseProperty("SeatPrice"),this.providerPortalSeatPrice=this.getResponseProperty("ProviderPortalSeatPrice"),this.baseSeats=this.getResponseProperty("BaseSeats"),this.maxAdditionalSeats=this.getResponseProperty("MaxAdditionalSeats"),this.premiumAccessOptionPrice=this.getResponseProperty("PremiumAccessOptionPrice"),this.maxSeats=this.getResponseProperty("MaxSeats"),this.additionalStoragePricePerGb=this.getResponseProperty("AdditionalStoragePricePerGb"),this.hasAdditionalSeatsOption=this.getResponseProperty("HasAdditionalSeatsOption"),this.baseStorageGb=this.getResponseProperty("BaseStorageGb"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.hasAdditionalStorageOption=this.getResponseProperty("HasAdditionalStorageOption"),this.maxAdditionalStorage=this.getResponseProperty("MaxAdditionalStorage"),this.hasPremiumAccessOption=this.getResponseProperty("HasPremiumAccessOption")}}},69588:(e,t,i)=>{"use strict";i.d(t,{L:()=>n});class n{}},69592:(e,t,i)=>{"use strict";i.d(t,{w:()=>m});var n=i(72245),r=i(3633),s=i(66523),o=i(61325),a=i(22166),l=i(33812),c=i(35500),d=i(5556),u=i(36288),h=i(78952),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class m{constructor(e,t,i,n,r){this.copyCipherFieldService=e,this.accountService=t,this.cipherService=i,this.menuItemComponent=n,this.iconButtonComponent=r,this.disabled=null}get hidden(){return this.disabled&&this.menuItemComponent}copy(){return p(this,void 0,void 0,function*(){const e=yield this.getValueToCopy();yield this.copyCipherFieldService.copy(null!=e?e:"",this.action,this.cipher)})}ngOnChanges(){return p(this,void 0,void 0,function*(){yield this.updateDisabledState()})}updateDisabledState(){return p(this,void 0,void 0,function*(){var e,t;this.disabled=!this.cipher||!this.hasValueToCopy()||"totp"===this.action&&!(yield this.copyCipherFieldService.totpAllowed(this.cipher))||null,this.iconButtonComponent&&this.iconButtonComponent.disabled.set(null!==(e=this.disabled)&&void 0!==e&&e),this.menuItemComponent&&(this.menuItemComponent.disabled=null!==(t=this.disabled)&&void 0!==t&&t)})}hasValueToCopy(){return o.n.hasCopyableValue(this.cipher,this.action)}getValueToCopy(){return p(this,void 0,void 0,function*(){var e,t,i,a,l,c,d,u,h,p,m,v;let f;if(o.n.isCipherListView(this.cipher)){const e=yield(0,n._)(this.accountService.activeAccount$.pipe(r.F6)),t=yield this.cipherService.get((0,s.zw)(this.cipher.id),e);f=yield this.cipherService.decrypt(t,e)}else f=this.cipher;switch(this.action){case"username":return(null===(e=f.login)||void 0===e?void 0:e.username)||(null===(t=f.identity)||void 0===t?void 0:t.username);case"password":return null===(i=f.login)||void 0===i?void 0:i.password;case"totp":return null===(a=f.login)||void 0===a?void 0:a.totp;case"cardNumber":return null===(l=f.card)||void 0===l?void 0:l.number;case"securityCode":return null===(c=f.card)||void 0===c?void 0:c.code;case"email":return null===(d=f.identity)||void 0===d?void 0:d.email;case"phone":return null===(u=f.identity)||void 0===u?void 0:u.phone;case"address":return null===(h=f.identity)||void 0===h?void 0:h.fullAddressForCopy;case"secureNote":return f.notes;case"privateKey":return null===(p=f.sshKey)||void 0===p?void 0:p.privateKey;case"publicKey":return null===(m=f.sshKey)||void 0===m?void 0:m.publicKey;case"keyFingerprint":return null===(v=f.sshKey)||void 0===v?void 0:v.keyFingerprint;default:return null}})}}m.ɵfac=function(e){return new(e||m)(l.rXU(a.nR),l.rXU(c.Di),l.rXU(d.p),l.rXU(h.S,8),l.rXU(u.s,8))},m.ɵdir=l.FsC({type:m,selectors:[["","appCopyField",""]],hostVars:3,hostBindings:function(e,t){1&e&&l.bIt("click",function(){return t.copy()}),2&e&&(l.BMQ("disabled",t.disabled),l.AVh("tw-hidden",t.hidden))},inputs:{action:[0,"appCopyField","action"],cipher:"cipher"},features:[l.OA$]})},69650:(e,t,i)=>{"use strict";i.d(t,{Sb:()=>F,Wn:()=>s,RB:()=>d});const n=0,r=1,s={UpdateAtRiskCredential:0};class o{constructor(e){this.id=e.id,this.organizationId=e.organizationId,this.cipherId=e.cipherId,this.type=e.type,this.status=e.status,this.creationDate=e.creationDate,this.revisionDate=e.revisionDate}}class a{constructor(e){this.id=e.id,this.organizationId=e.organizationId,this.cipherId=e.cipherId,this.type=e.type,this.status=e.status,this.creationDate=e.creationDate,this.revisionDate=e.revisionDate}static fromJSON(e){return Object.assign(new a({}),e,{creationDate:new Date(e.creationDate),revisionDate:new Date(e.revisionDate)})}}var l=i(20702);class c extends l.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.cipherId=this.getResponseProperty("CipherId")||void 0,this.type=this.getResponseProperty("Type"),this.status=this.getResponseProperty("Status"),this.creationDate=this.getResponseProperty("CreationDate"),this.revisionDate=this.getResponseProperty("RevisionDate")}}class d{}var u=i(3204),h=i(34040),p=i(44500),m=i(93695),v=i(33338),f=i(69194),g=i(83892),y=i(84110),b=i(11573),w=i(12277),S=i(97432),I=i(31857);const k=I.Ok.array(I.k2,"securityTasks",{deserializer:e=>a.fromJSON(e),clearOn:["logout","lock"]});var C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const T=(0,u.T)(e=>Object.entries(null!=e?e:{}).filter(([,e])=>e>=y.J.Unlocked).map(([e])=>e));class F{constructor(e,t,i,s,a,l){this.stateProvider=e,this.apiService=t,this.organizationService=i,this.authService=s,this.notificationService=a,this.messageListener=l,this.tasksEnabled$=(0,S.j)(e=>this.organizationService.organizations$(e).pipe((0,u.T)(e=>e.some(e=>e.canUseAccessIntelligence)),(0,h.F)())),this.tasks$=(0,S.j)(e=>this.tasksEnabled$(e).pipe((0,p.n)(t=>t?this.taskState(e).state$.pipe((0,p.n)(t=>C(this,void 0,void 0,function*(){return null==t?(yield this.fetchTasksFromApi(e),null):t})),(0,S.w)(),(0,u.T)(e=>e.map(e=>new o(e)))):(0,m.of)([])))),this.pendingTasks$=(0,S.j)(e=>this.tasks$(e).pipe((0,u.T)(e=>e.filter(e=>e.status===n)))),this.completedTasks$=(0,S.j)(e=>this.tasks$(e).pipe((0,u.T)(e=>e.filter(e=>e.status===r)))),this.getOnlyTaskEnabledUsers=(0,p.n)(e=>0===e.length?(0,m.of)([]):(0,v.z)(e.map(e=>this.tasksEnabled$(e).pipe((0,u.T)(t=>t?e:null)))).pipe((0,u.T)(e=>e.filter(e=>null!==e))))}refreshTasks(e){return C(this,void 0,void 0,function*(){yield this.fetchTasksFromApi(e)})}clear(e){return C(this,void 0,void 0,function*(){yield this.updateTaskState(e,[])})}markAsComplete(e,t){return C(this,void 0,void 0,function*(){yield this.apiService.send("PATCH",`/tasks/${e}/complete`,null,!0,!1),yield this.refreshTasks(t)})}fetchTasksFromApi(e){return C(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/tasks",null,!0,!0),i=new w.s(t,c).data.map(e=>new a(e));yield this.updateTaskState(e,i)})}taskState(e){return this.stateProvider.getUser(e,k)}updateTaskState(e,t){return this.taskState(e).update(()=>t)}securityTaskNotifications$(e){return this.notificationService.notifications$.pipe((0,f.p)(([t,i])=>t.type===b._n.RefreshSecurityTasks&&e.includes(i)),(0,u.T)(([,e])=>e))}syncCompletedMessage$(e){return this.messageListener.allMessages$.pipe((0,f.p)(e=>"syncCompleted"===e.command&&!!e.successfully&&!!e.userId),(0,u.T)(e=>e.userId),(0,f.p)(t=>e.includes(t)))}listenForTaskNotifications(){return this.authService.authStatuses$.pipe(T,this.getOnlyTaskEnabledUsers,(0,f.p)(e=>e.length>0),(0,p.n)(e=>(0,g.h)(this.securityTaskNotifications$(e),this.syncCompletedMessage$(e))),(0,p.n)(e=>this.refreshTasks(e))).subscribe()}}},69672:(e,t,i)=>{"use strict";i.d(t,{TT:()=>h,lp:()=>p});var n=i(94251),r=i(74208),s=i(33812),o=i(33277),a=i(83731),l=i(31436),c=i(69194),d=i(44500);class u{constructor(){this.scrollableRef=(0,r.vPA)(null),this.scrollableRef$=(0,a.br)(this.scrollableRef)}}u.ɵfac=function(e){return new(e||u)},u.ɵprov=r.jDH({token:u,factory:u.ɵfac,providedIn:"root"});class h{constructor(){this.ref=(0,r.WQX)(s.aKT),this.service=(0,r.WQX)(u),this.service.scrollableRef.set(this.ref)}ngOnDestroy(){this.service.scrollableRef.set(null)}}h.ɵfac=function(e){return new(e||h)},h.ɵdir=s.FsC({type:h,selectors:[["","bitScrollLayoutHost",""]],hostAttrs:[1,"cdk-virtual-scrollable"]});class p extends n.fI{constructor(){super(),this.service=(0,r.WQX)(u),(0,o.QZ)(()=>{const e=this.service.scrollableRef();e?this.elementRef=e:console.error("ScrollLayoutDirective can't find scroll host")})}elementScrolled(){return this.service.scrollableRef$.pipe((0,c.p)(e=>null!==e),(0,d.n)(e=>(0,l.R)(e.nativeElement,"scroll")))}getElementRef(){return this.service.scrollableRef()}measureBoundingClientRectWithScrollOffset(e){return this.service.scrollableRef().nativeElement.getBoundingClientRect()[e]-this.measureScrollOffset(e)}}p.ɵfac=function(e){return new(e||p)},p.ɵdir=s.FsC({type:p,selectors:[["","bitScrollLayout",""]],features:[s.Jv_([{provide:n.qy,useExisting:p}]),s.Vt3]})},69855:(e,t,i)=>{"use strict";i.d(t,{f:()=>o});const n=e=>{const t=(Array.isArray(e)?e:[e]).map(e=>e.split(/\s+/).filter(e=>""!==e)).flat().length;return 5e3+1e3*Math.floor(t/120)};var r=i(74208),s=i(82630);class o{constructor(e){this.toastrService=e}showToast(e){const t={payload:{message:e.message,variant:e.variant,title:e.title},timeOut:null!=e.timeout&&e.timeout>0?e.timeout:n(e.message)};this.toastrService.show(void 0,e.title,t)}_showToast(e){var t;this.showToast({message:e.text,variant:e.type,title:e.title,timeout:null===(t=e.options)||void 0===t?void 0:t.timeout})}}o.ɵfac=function(e){return new(e||o)(r.KVO(s.tw))},o.ɵprov=r.jDH({token:o,factory:o.ɵfac,providedIn:"root"})},69886:(e,t,i)=>{"use strict";i.d(t,{w:()=>n});class n{constructor(e){null!=e&&(this.credentialId=e.credentialId,this.keyType=e.keyType,this.keyAlgorithm=e.keyAlgorithm,this.keyCurve=e.keyCurve,this.keyValue=e.keyValue,this.rpId=e.rpId,this.userHandle=e.userHandle,this.userName=e.userName,this.counter=e.counter,this.rpName=e.rpName,this.userDisplayName=e.userDisplayName,this.discoverable=e.discoverable,this.creationDate=e.creationDate)}}},69896:(e,t,i)=>{"use strict";i.d(t,{a:()=>s});var n=i(33812),r=i(36288);class s{constructor(e){this.iconButtonComponent=e,this.classList=["tw-text-muted"]}ngOnInit(){this.iconButtonComponent&&this.iconButtonComponent.size.set("small")}}s.ɵfac=function(e){return new(e||s)(n.rXU(r.s,8))},s.ɵdir=n.FsC({type:s,selectors:[["","bitSuffix",""]],hostVars:2,hostBindings:function(e,t){2&e&&n.HbH(t.classList)}})},70171:(e,t,i)=>{"use strict";i.d(t,{H:()=>n});class n{}},70342:(e,t,i)=>{"use strict";i.d(t,{N:()=>k,h:()=>I});var n=i(33338),r=i(3204),s=i(44500),o=i(31442),a=i(43978),l=i(3633),c=i(31857),d=i(97440),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const h=new c.Ok(c.dp,"autofillOnPageLoad",{deserializer:e=>null!=e&&e,clearOn:[]}),p=new c.Ok(c.dp,"autofillOnPageLoadDefault",{deserializer:e=>null!=e&&e,clearOn:[]}),m=new c.Ok(c.dp,"autofillOnPageLoadCalloutIsDismissed",{deserializer:e=>null!=e&&e,clearOn:[]}),v=new c.Ok(c.dp,"autofillOnPageLoadPolicyToastHasDisplayed",{deserializer:e=>null!=e&&e,clearOn:[]}),f=new c.Ok(c.dp,"autoCopyTotp",{deserializer:e=>null==e||e,clearOn:[]}),g=new c.Zs(c.Vl,"inlineMenuVisibility",{deserializer:e=>null!=e?e:d.bZ.Off}),y=new c.Ok(c.dp,"showInlineMenuIdentities",{deserializer:e=>null==e||e,clearOn:[]}),b=new c.Ok(c.dp,"showInlineMenuCards",{deserializer:e=>null==e||e,clearOn:[]}),w=new c.Zs(c.dp,"enableContextMenu",{deserializer:e=>null==e||e}),S=new c.Ok(c.Vl,"clearClipboardDelay",{deserializer:e=>null!=e?e:d.j8.Never,clearOn:[]});class I{}class k{constructor(e,t,i,c){this.stateProvider=e,this.policyService=t,this.accountService=i,this.restrictedItemTypesService=c,this.autofillOnPageLoadState=this.stateProvider.getActive(h),this.autofillOnPageLoad$=this.autofillOnPageLoadState.state$.pipe((0,r.T)(e=>null!=e&&e)),this.autofillOnPageLoadDefaultState=this.stateProvider.getActive(p),this.autofillOnPageLoadDefault$=this.autofillOnPageLoadDefaultState.state$.pipe((0,r.T)(e=>null==e||e)),this.autofillOnPageLoadCalloutIsDismissedState=this.stateProvider.getActive(m),this.autofillOnPageLoadCalloutIsDismissed$=this.autofillOnPageLoadCalloutIsDismissedState.state$.pipe((0,r.T)(e=>null!=e&&e)),this.activateAutofillOnPageLoadFromPolicy$=this.accountService.activeAccount$.pipe(l.F6,(0,s.n)(e=>this.policyService.policyAppliesToUser$(a.tt.ActivateAutofill,e))),this.autofillOnPageLoadPolicyToastHasDisplayedState=this.stateProvider.getActive(v),this.autofillOnPageLoadPolicyToastHasDisplayed$=this.autofillOnPageLoadPolicyToastHasDisplayedState.state$.pipe((0,r.T)(e=>null!=e&&e)),this.autoCopyTotpState=this.stateProvider.getActive(f),this.autoCopyTotp$=this.autoCopyTotpState.state$.pipe((0,r.T)(e=>null==e||e)),this.inlineMenuVisibilityState=this.stateProvider.getGlobal(g),this.inlineMenuVisibility$=this.inlineMenuVisibilityState.state$.pipe((0,r.T)(e=>null!=e?e:d.bZ.Off)),this.showInlineMenuIdentitiesState=this.stateProvider.getActive(y),this.showInlineMenuIdentities$=this.showInlineMenuIdentitiesState.state$.pipe((0,r.T)(e=>null==e||e)),this.showInlineMenuCardsState=this.stateProvider.getActive(b),this.showInlineMenuCards$=(0,n.z)([this.showInlineMenuCardsState.state$.pipe((0,r.T)(e=>null==e||e)),this.restrictedItemTypesService.restricted$]).pipe((0,r.T)(([e,t])=>e&&!t.some(e=>e.cipherType===o.gC.Card))),this.enableContextMenuState=this.stateProvider.getGlobal(w),this.enableContextMenu$=this.enableContextMenuState.state$.pipe((0,r.T)(e=>null==e||e)),this.clearClipboardDelayState=this.stateProvider.getActive(S),this.clearClipboardDelay$=this.clearClipboardDelayState.state$.pipe((0,r.T)(e=>null!=e?e:d.j8.Never))}setAutofillOnPageLoad(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadState.update(()=>e)})}setAutofillOnPageLoadDefault(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadDefaultState.update(()=>e)})}setAutofillOnPageLoadCalloutIsDismissed(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadCalloutIsDismissedState.update(()=>e)})}setAutofillOnPageLoadPolicyToastHasDisplayed(e){return u(this,void 0,void 0,function*(){yield this.autofillOnPageLoadPolicyToastHasDisplayedState.update(()=>e)})}setAutoCopyTotp(e){return u(this,void 0,void 0,function*(){yield this.autoCopyTotpState.update(()=>e)})}setInlineMenuVisibility(e){return u(this,void 0,void 0,function*(){yield this.inlineMenuVisibilityState.update(()=>e)})}setShowInlineMenuIdentities(e){return u(this,void 0,void 0,function*(){yield this.showInlineMenuIdentitiesState.update(()=>e)})}setShowInlineMenuCards(e){return u(this,void 0,void 0,function*(){yield this.showInlineMenuCardsState.update(()=>e)})}setEnableContextMenu(e){return u(this,void 0,void 0,function*(){yield this.enableContextMenuState.update(()=>e)})}setClearClipboardDelay(e){return u(this,void 0,void 0,function*(){yield this.clearClipboardDelayState.update(()=>e)})}}},71364:(e,t,i)=>{"use strict";i.d(t,{k:()=>h});var n=i(37831),r=i(94573),s=i(69194),o=i(65023);const a=14,l=24,c=[{id:"right-start",offsetX:a,offsetY:-24,originX:"end",originY:"center",overlayX:"start",overlayY:"top",panelClass:["bit-popover-right","bit-popover-right-start"]},{id:"right-center",offsetX:a,originX:"end",originY:"center",overlayX:"start",overlayY:"center",panelClass:["bit-popover-right","bit-popover-right-center"]},{id:"right-end",offsetX:a,offsetY:l,originX:"end",originY:"center",overlayX:"start",overlayY:"bottom",panelClass:["bit-popover-right","bit-popover-right-end"]},{id:"left-start",offsetX:-14,offsetY:-24,originX:"start",originY:"center",overlayX:"end",overlayY:"top",panelClass:["bit-popover-left","bit-popover-left-start"]},{id:"left-center",offsetX:-14,originX:"start",originY:"center",overlayX:"end",overlayY:"center",panelClass:["bit-popover-left","bit-popover-left-center"]},{id:"left-end",offsetX:-14,offsetY:l,originX:"start",originY:"center",overlayX:"end",overlayY:"bottom",panelClass:["bit-popover-left","bit-popover-left-end"]},{id:"below-center",offsetY:a,originX:"center",originY:"bottom",overlayX:"center",overlayY:"top",panelClass:["bit-popover-below","bit-popover-below-center"]},{id:"below-start",offsetX:-24,offsetY:a,originX:"center",originY:"bottom",overlayX:"start",overlayY:"top",panelClass:["bit-popover-below","bit-popover-below-start"]},{id:"below-end",offsetX:l,offsetY:a,originX:"center",originY:"bottom",overlayX:"end",overlayY:"top",panelClass:["bit-popover-below","bit-popover-below-end"]},{id:"above-center",offsetY:-14,originX:"center",originY:"top",overlayX:"center",overlayY:"bottom",panelClass:["bit-popover-above","bit-popover-above-center"]},{id:"above-start",offsetX:-24,offsetY:-14,originX:"center",originY:"top",overlayX:"start",overlayY:"bottom",panelClass:["bit-popover-above","bit-popover-above-start"]},{id:"above-end",offsetX:l,offsetY:-14,originX:"center",originY:"top",overlayX:"end",overlayY:"bottom",panelClass:["bit-popover-above","bit-popover-above-end"]}];var d=i(33812),u=i(43380);class h{get positions(){if(!this.position())return c;const e=c.find(e=>e.id===this.position());return e?[e,...c]:c}get defaultPopoverConfig(){return{hasBackdrop:!0,backdropClass:"cdk-overlay-transparent-backdrop",scrollStrategy:this.overlay.scrollStrategies.reposition(),positionStrategy:this.overlay.position().flexibleConnectedTo(this.elementRef).withPositions(this.positions).withLockedPosition(!0).withFlexibleDimensions(!1).withPush(!0)}}constructor(e,t,i){this.elementRef=e,this.viewContainerRef=t,this.overlay=i,this.popoverOpen=(0,r.geq)(!1),this.popover=r.hFB.required({alias:"bitPopoverTriggerFor"}),this.position=(0,r.hFB)(),this.overlayRef=null,this.closedEventsSub=null}togglePopover(){this.popoverOpen()?this.closePopover():this.openPopover()}openPopover(){this.popoverOpen.set(!0),this.overlayRef=this.overlay.create(this.defaultPopoverConfig);const e=new n.VA(this.popover().templateRef(),this.viewContainerRef);this.overlayRef.attach(e),this.closedEventsSub=this.getClosedEvents().subscribe(()=>{this.destroyPopover()})}getClosedEvents(){if(!this.overlayRef)throw new Error("Overlay reference is not available");const e=this.overlayRef.detachments(),t=this.overlayRef.keydownEvents().pipe((0,s.p)(e=>"Escape"===e.key)),i=this.overlayRef.backdropClick(),n=this.popover().closed;return e.pipe((0,o.X)(t,i,n))}destroyPopover(){this.overlayRef&&this.popoverOpen()&&(this.popoverOpen.set(!1),this.disposeAll())}disposeAll(){var e,t;null===(e=this.closedEventsSub)||void 0===e||e.unsubscribe(),this.closedEventsSub=null,null===(t=this.overlayRef)||void 0===t||t.dispose(),this.overlayRef=null}ngAfterViewInit(){this.popoverOpen()&&this.openPopover()}ngOnDestroy(){this.disposeAll()}closePopover(){this.destroyPopover()}}h.ɵfac=function(e){return new(e||h)(d.rXU(d.aKT),d.rXU(d.c1b),d.rXU(u.hJ))},h.ɵdir=d.FsC({type:h,selectors:[["","bitPopoverTriggerFor",""]],hostVars:1,hostBindings:function(e,t){1&e&&d.bIt("click",function(){return t.togglePopover()}),2&e&&d.BMQ("aria-expanded",t.popoverOpen())},inputs:{popoverOpen:[1,"popoverOpen"],popover:[1,"bitPopoverTriggerFor","popover"],position:[1,"position"]},outputs:{popoverOpen:"popoverOpenChange"},exportAs:["popoverTrigger"]})},71373:(e,t,i)=>{"use strict";i.d(t,{JJ:()=>n,GL:()=>j,Im:()=>G,pV:()=>Q});class n{}var r=i(29776),s=i(192);const o=Object.freeze({type:"password",username:"word",forwarder:""});var a=i(16878),l=i(3204),c=i(72245),d=i(43978),u=i(20377);class h{constructor(e){this.policy=e}get policyInEffect(){var e;return r.I4[r.ZU.password].includes(null===(e=this.policy)||void 0===e?void 0:e.overridePasswordType)}applyPolicy(e){var t;const i=Object.assign({},e);return this.policyInEffect&&(i.type=null!==(t=this.policy.overridePasswordType)&&void 0!==t?t:i.type),i}sanitize(e){var t;return Object.assign(Object.assign({},e),{type:null!==(t=e.type)&&void 0!==t?t:o.type})}}function p(e,t){if(!(t.type===d.tt.PasswordGenerator&&t.enabled))return e;return"password"!==e.overridePasswordType&&t.data.overridePasswordType?Object.assign(Object.assign({},e),{overridePasswordType:t.data.overridePasswordType}):e}const m=Object.freeze({overridePasswordType:null});var v=i(31857);const f=new v.Ok(v.qd,"generatorSettings",{deserializer:e=>e,clearOn:["logout"]});var g=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class y{constructor(e,t){this.stateProvider=e,this.policy=t}options$(e){return this.stateProvider.getUserState$(f,e)}defaults$(e){return new a.t(Object.assign({},o))}evaluator$(e){return this.policy.policiesByType$(d.tt.PasswordGenerator,e).pipe((0,u.pP)(p,m),(0,u.LA)(),(0,l.T)(e=>new h(e)))}enforcePolicy(e,t){return g(this,void 0,void 0,function*(){const i=yield(0,c._)(this.evaluator$(e)),n=i.applyPolicy(t);return i.sanitize(n)})}saveOptions(e,t){return g(this,void 0,void 0,function*(){yield this.stateProvider.setUserState(f,t,e)})}}var b=i(93695),w=i(73276),S=i(56986),I=i(33338),k=i(39444),C=i(88507),T=i(22485),F=i(69194),R=i(17989);class P extends R.A{constructor(){super(...arguments),this.overridePasswordType="",this.minLength=0,this.useUppercase=!1,this.useLowercase=!1,this.useNumbers=!1,this.numberCount=0,this.useSpecial=!1,this.specialCount=0,this.minNumberWords=0,this.capitalize=!1,this.includeNumber=!1}inEffect(){return this.overridePasswordType||this.minLength>0||this.numberCount>0||this.specialCount>0||this.useUppercase||this.useLowercase||this.useNumbers||this.useSpecial||this.minNumberWords>0||this.capitalize||this.includeNumber}clone(){const e=new P;return Object.assign(e,this),e}}var x=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ${constructor(e,t,i,n,r){this.accountService=e,this.navigation=t,this.passwords=i,this.passphrases=n,this.history=r}generatePassword(e){return"password"===e.type?this.passwords.generate(e):this.passphrases.generate(e)}generatePassphrase(e){return this.passphrases.generate(e)}getRawOptions$(){function e(e){return e.pipe((0,l.T)((e,t)=>[e,t]))}return this.accountService.activeAccount$.pipe((0,w.H)(t=>(0,S.x)((0,b.of)([null,null,[null,-1],null,null,[null,-1],null,null,[null,-1]]),(0,I.z)([this.passwords.options$(t.id),this.passwords.defaults$(t.id),e(this.passwords.evaluator$(t.id)),this.passphrases.options$(t.id),this.passphrases.defaults$(t.id),e(this.passphrases.evaluator$(t.id)),this.navigation.options$(t.id),this.navigation.defaults$(t.id),e(this.navigation.evaluator$(t.id))]))),(0,k.J)(),(0,l.T)(function([e,t]){const[,,[,i],,,[,n],,,[,r]]=e,[s,o,[a,l],c,d,[u,h],p,m,[v,f]]=t;return[s,o,a,c,d,u,p,m,v,i<l||n<h||r<f]}))}getOptions$(){return this.getRawOptions$().pipe((0,l.T)(([e,t,i,n,r,s,o,a,l,c])=>{const d=i.applyPolicy(null!=e?e:t),u=s.applyPolicy(null!=n?n:r),h=l.applyPolicy(null!=o?o:a);return[this.toPasswordGeneratorOptions({password:i.sanitize(d),passphrase:s.sanitize(u),generator:l.sanitize(h),policyUpdated:c}),Object.assign(new P,i.policy,s.policy,l.policy)]}))}getOptions(){return x(this,void 0,void 0,function*(){return yield(0,c._)(this.getOptions$())})}enforcePasswordGeneratorPoliciesOnOptions(e){return x(this,void 0,void 0,function*(){const t=this.accountService.activeAccount$.pipe((0,w.H)(e=>(0,C.y)(this.passwords.evaluator$(e.id),this.passphrases.evaluator$(e.id),this.navigation.evaluator$(e.id))),(0,l.T)(([t,i,n])=>{const r=Object.assign(new P,t.policy,i.policy,n.policy),s=n.applyPolicy(e),o=Object.assign(Object.assign({},e),n.sanitize(s));if("password"===o.type){const e=t.applyPolicy(o);return[t.sanitize(e),r]}{const e=i.applyPolicy(o);return[i.sanitize(e),r]}})),[i,n]=yield(0,c._)(t);return[Object.assign(e,i),n]})}saveOptions(e){return x(this,void 0,void 0,function*(){const t=this.toStoredOptions(e),i=yield(0,c._)(this.accountService.activeAccount$),n=(0,C.y)(this.navigation.options$(i.id),this.navigation.defaults$(i.id)).pipe((0,l.T)(([e,t])=>null!=e?e:t));let r=yield(0,c._)(n);r=Object.assign(r,t.generator),yield this.navigation.saveOptions(i.id,r),yield this.passwords.saveOptions(i.id,t.password),yield this.passphrases.saveOptions(i.id,t.passphrase)})}toStoredOptions(e){return{generator:{type:e.type},password:{length:e.length,minLength:e.minLength,ambiguous:e.ambiguous,uppercase:e.uppercase,minUppercase:e.minUppercase,lowercase:e.lowercase,minLowercase:e.minLowercase,number:e.number,minNumber:e.minNumber,special:e.special,minSpecial:e.minSpecial},passphrase:{numWords:e.numWords,wordSeparator:e.wordSeparator,capitalize:e.capitalize,includeNumber:e.includeNumber},policyUpdated:!1}}toPasswordGeneratorOptions(e){return{type:e.generator.type,length:e.password.length,minLength:e.password.minLength,ambiguous:e.password.ambiguous,uppercase:e.password.uppercase,minUppercase:e.password.minUppercase,lowercase:e.password.lowercase,minLowercase:e.password.minLowercase,number:e.password.number,minNumber:e.password.minNumber,special:e.password.special,minSpecial:e.password.minSpecial,numWords:e.passphrase.numWords,wordSeparator:e.passphrase.wordSeparator,capitalize:e.passphrase.capitalize,includeNumber:e.passphrase.includeNumber,policyUpdated:e.policyUpdated}}getHistory(){const e=this.accountService.activeAccount$.pipe((0,w.H)(e=>this.history.credentials$(e.id)),(0,T.w)({each:1e3,with:()=>[]}),(0,l.T)(e=>e.map(E)));return(0,c._)(e)}addHistory(e){return x(this,void 0,void 0,function*(){const t=yield(0,c._)(this.accountService.activeAccount$);(null==t?void 0:t.id)&&(yield this.history.track(t.id,e,"password"))})}clear(){const e=this.accountService.activeAccount$.pipe((0,F.p)(e=>!!(null==e?void 0:e.id)),(0,w.H)(e=>this.history.clear(e.id)),(0,T.w)({each:1e3,with:()=>[]}),(0,l.T)(e=>e.map(E)));return(0,c._)(e)}}function E(e){return new s.ZG(e.credential,e.generationDate.valueOf())}const{jK:A,gb:D}=r.Wy,{q4:O,Zx:M}=r.Hi,U=r.$p.q;function G(e,t,i,n,r){const o=new O(t),a=new M(o,Date.now),l=new U(new D(a,r),i),c=new U(new A(a,r),i),d=new y(r,i),u=new s.Kt(e,t,r);return new $(n,d,l,c,u)}class j{}var N=i(39307),V=i(19638);const B=Object.freeze({AddyIo:Object.freeze({id:"anonaddy",name:"Addy.io",validForSelfHosted:!0}),DuckDuckGo:Object.freeze({id:"duckduckgo",name:"DuckDuckGo",validForSelfHosted:!1}),Fastmail:Object.freeze({id:"fastmail",name:"Fastmail",validForSelfHosted:!0}),FirefoxRelay:Object.freeze({id:"firefoxrelay",name:"Firefox Relay",validForSelfHosted:!1}),ForwardEmail:Object.freeze({id:"forwardemail",name:"Forward Email",validForSelfHosted:!0}),SimpleLogin:Object.freeze({id:"simplelogin",name:"SimpleLogin",validForSelfHosted:!0})});var z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class L{constructor(e,t,i,n,r,s,o,a,l,c,d){this.accountService=e,this.navigation=t,this.catchall=i,this.effUsername=n,this.subaddress=r,this.addyIo=s,this.duckDuckGo=o,this.fastmail=a,this.firefoxRelay=l,this.forwardEmail=c,this.simpleLogin=d}generateUsername(e){return"catchall"===e.type?this.generateCatchall(e):"subaddress"===e.type?this.generateSubaddress(e):"forwarded"===e.type?this.generateForwarded(e):this.generateWord(e)}generateWord(e){return this.effUsername.generate(e)}generateSubaddress(e){return this.subaddress.generate(e)}generateCatchall(e){return this.catchall.generate(e)}generateForwarded(e){if(!e.forwardedService)return null;const t=this.toStoredOptions(e);switch(e.forwardedService){case B.AddyIo.id:case V.N.addyio:return this.addyIo.generate(t.forwarders.addyIo);case B.DuckDuckGo.id:return this.duckDuckGo.generate(t.forwarders.duckDuckGo);case B.Fastmail.id:return this.fastmail.generate(t.forwarders.fastmail);case B.FirefoxRelay.id:case V.N.mozilla:return this.firefoxRelay.generate(t.forwarders.firefoxRelay);case B.ForwardEmail.id:return this.forwardEmail.generate(t.forwarders.forwardEmail);case B.SimpleLogin.id:return this.simpleLogin.generate(t.forwarders.simpleLogin)}}getOptions$(){return this.accountService.activeAccount$.pipe((0,w.H)(e=>(0,I.z)([this.navigation.options$(e.id),this.navigation.defaults$(e.id),this.catchall.options$(e.id),this.catchall.defaults$(e.id),this.effUsername.options$(e.id),this.effUsername.defaults$(e.id),this.subaddress.options$(e.id),this.subaddress.defaults$(e.id),this.addyIo.options$(e.id),this.addyIo.defaults$(e.id),this.duckDuckGo.options$(e.id),this.duckDuckGo.defaults$(e.id),this.fastmail.options$(e.id),this.fastmail.defaults$(e.id),this.firefoxRelay.options$(e.id),this.firefoxRelay.defaults$(e.id),this.forwardEmail.options$(e.id),this.forwardEmail.defaults$(e.id),this.simpleLogin.options$(e.id),this.simpleLogin.defaults$(e.id)])),(0,l.T)(([e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g,y,b])=>this.toUsernameOptions({generator:null!=e?e:t,algorithms:{catchall:null!=i?i:n,effUsername:null!=r?r:s,subaddress:null!=o?o:a},forwarders:{addyIo:null!=l?l:c,duckDuckGo:null!=d?d:u,fastmail:null!=h?h:p,firefoxRelay:null!=m?m:v,forwardEmail:null!=f?f:g,simpleLogin:null!=y?y:b}})))}getOptions(){return(0,c._)(this.getOptions$())}saveOptions(e){return z(this,void 0,void 0,function*(){const t=this.toStoredOptions(e),i=yield(0,c._)(this.accountService.activeAccount$);(yield this.saveGeneratorOptions(i.id,e.type,t))||(yield this.saveForwarderOptions(i.id,e.forwardedService,t)),yield this.saveNavigationOptions(i.id,t)})}saveNavigationOptions(e,t){return z(this,void 0,void 0,function*(){const i=(0,C.y)(this.navigation.options$(e),this.navigation.defaults$(e)).pipe((0,l.T)(([e,t])=>null!=e?e:t));let n=yield(0,c._)(i);n=Object.assign(n,t.generator),yield this.navigation.saveOptions(e,n)})}saveGeneratorOptions(e,t,i){return z(this,void 0,void 0,function*(){switch(t){case"word":return yield this.effUsername.saveOptions(e,i.algorithms.effUsername),!0;case"subaddress":return yield this.subaddress.saveOptions(e,i.algorithms.subaddress),!0;case"catchall":return yield this.catchall.saveOptions(e,i.algorithms.catchall),!0;default:return!1}})}saveForwarderOptions(e,t,i){return z(this,void 0,void 0,function*(){switch(t){case B.AddyIo.id:case V.N.addyio:return yield this.addyIo.saveOptions(e,i.forwarders.addyIo),!0;case B.DuckDuckGo.id:return yield this.duckDuckGo.saveOptions(e,i.forwarders.duckDuckGo),!0;case B.Fastmail.id:return yield this.fastmail.saveOptions(e,i.forwarders.fastmail),!0;case B.FirefoxRelay.id:case V.N.mozilla:return yield this.firefoxRelay.saveOptions(e,i.forwarders.firefoxRelay),!0;case B.ForwardEmail.id:return yield this.forwardEmail.saveOptions(e,i.forwarders.forwardEmail),!0;case B.SimpleLogin.id:return yield this.simpleLogin.saveOptions(e,i.forwarders.simpleLogin),!0;default:return!1}})}toStoredOptions(e){const t={addyIo:{baseUrl:e.forwardedAnonAddyBaseUrl,token:e.forwardedAnonAddyApiToken,domain:e.forwardedAnonAddyDomain,website:e.website},duckDuckGo:{token:e.forwardedDuckDuckGoToken,website:e.website},fastmail:{token:e.forwardedFastmailApiToken,website:e.website},firefoxRelay:{token:e.forwardedFirefoxApiToken,website:e.website},forwardEmail:{token:e.forwardedForwardEmailApiToken,domain:e.forwardedForwardEmailDomain,website:e.website},simpleLogin:{token:e.forwardedSimpleLoginApiKey,baseUrl:e.forwardedSimpleLoginBaseUrl,website:e.website}};return{generator:{username:e.type,forwarder:e.forwardedService},algorithms:{effUsername:{wordCapitalize:e.wordCapitalize,wordIncludeNumber:e.wordIncludeNumber,website:e.website},subaddress:{subaddressType:e.subaddressType,subaddressEmail:e.subaddressEmail,website:e.website},catchall:{catchallType:e.catchallType,catchallDomain:e.catchallDomain,website:e.website}},forwarders:t}}toUsernameOptions(e){return{type:e.generator.username,wordCapitalize:e.algorithms.effUsername.wordCapitalize,wordIncludeNumber:e.algorithms.effUsername.wordIncludeNumber,subaddressType:e.algorithms.subaddress.subaddressType,subaddressEmail:e.algorithms.subaddress.subaddressEmail,catchallType:e.algorithms.catchall.catchallType,catchallDomain:e.algorithms.catchall.catchallDomain,forwardedService:e.generator.forwarder,forwardedAnonAddyApiToken:e.forwarders.addyIo.token,forwardedAnonAddyDomain:e.forwarders.addyIo.domain,forwardedAnonAddyBaseUrl:e.forwarders.addyIo.baseUrl,forwardedDuckDuckGoToken:e.forwarders.duckDuckGo.token,forwardedFirefoxApiToken:e.forwarders.firefoxRelay.token,forwardedFastmailApiToken:e.forwarders.fastmail.token,forwardedForwardEmailApiToken:e.forwarders.forwardEmail.token,forwardedForwardEmailDomain:e.forwarders.forwardEmail.domain,forwardedSimpleLoginApiKey:e.forwarders.simpleLogin.token,forwardedSimpleLoginBaseUrl:e.forwarders.simpleLogin.baseUrl}}}const{q4:K,QS:q,Mt:_,Lq:X}=r.Hi,Y=r.$p.q,{B:H,Vm:W,KQ:J,ji:Z}=r.Wy;function Q(e,t,i,n,s,o,a){const l=new K(i),c=new N.e(e,t),d=new q(l),u=new _(l),h=new X,p=new Y(new J(d,a),s),m=new Y(new W(h,u,a),s),v=new Y(new H(h,u,a),s),f=new Y(new Z(r.IQ.AddyIo,c,t,n,i,a),s),g=new Y(new Z(r.IQ.DuckDuckGo,c,t,n,i,a),s),b=new Y(new Z(r.IQ.Fastmail,c,t,n,i,a),s),w=new Y(new Z(r.IQ.FirefoxRelay,c,t,n,i,a),s),S=new Y(new Z(r.IQ.ForwardEmail,c,t,n,i,a),s),I=new Y(new Z(r.IQ.SimpleLogin,c,t,n,i,a),s),k=new y(a,s);return new L(o,k,v,p,m,f,g,b,w,S,I)}},71613:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});class n{}},71687:(e,t,i)=>{"use strict";i.d(t,{U:()=>H});var n=i(28202),r=i(67553),s=i(39488),o=i(31442),a=i(22166),l=i(24593),c=i(62819),d=i(77723),u=i(74208),h=i(33812),p=i(5556),m=i(21274),v=i(35500),f=i(50700),g=i(77468),y=i(26333),b=i(93103),w=i(47428),S=i(47696),I=i(44432),k=i(10672),C=i(59032),T=i(38410),F=i(22466),R=i(36572),P=i(12694),x=i(16496),$=i(71944),E=i(93748),A=i(88016),D=i(91975),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function M(e,t){1&e&&(h.j41(0,"div"),h.nrm(1,"i",3),h.nI1(2,"i18n"),h.j41(3,"span",4),h.EFF(4),h.nI1(5,"i18n"),h.k0s()()),2&e&&(h.R7$(),h.Y8G("title",h.mNQ(h.bMT(2,3,"loading"))),h.R7$(3),h.JRh(h.bMT(5,5,"loading")))}function U(e,t){1&e&&(h.j41(0,"bit-callout",7),h.nI1(1,"i18n"),h.EFF(2),h.nI1(3,"i18n"),h.k0s()),2&e&&(h.Y8G("title",h.mNQ(h.bMT(1,3,"goodNews"))),h.R7$(2),h.SpI(" ",h.bMT(3,5,"noUnsecuredWebsites")," "))}function G(e,t){if(1&e&&(h.qex(0),h.j41(1,"bit-toggle",15),h.EFF(2),h.j41(3,"span",16),h.EFF(4),h.k0s()(),h.bVm()),2&e){const e=t.$implicit,i=h.XpG(4);h.R7$(),h.Y8G("value",e),h.R7$(),h.SpI(" ",i.getName(e)," "),h.R7$(2),h.SpI(" ",i.getCount(e)," ")}}function j(e,t){if(1&e){const e=h.RV6();h.j41(0,"bit-toggle-group",13),h.nI1(1,"async"),h.nI1(2,"i18n"),h.bIt("selectedChange",function(t){u.eBV(e);const i=h.XpG(3);return u.Njj(i.filterOrgToggle(t))}),h.DNE(3,G,5,3,"ng-container",14),h.k0s()}if(2&e){const e=h.XpG(3);h.Y8G("selected",h.bMT(1,3,e.filterOrgStatus$)),h.BMQ("aria-label",h.bMT(2,5,"addAccessFilter")),h.R7$(3),h.Y8G("ngForOf",e.filterStatus)}}function N(e,t){1&e&&(h.qex(0,17),h.j41(1,"tr",18),h.nrm(2,"th",19),h.j41(3,"th",19),h.EFF(4),h.nI1(5,"i18n"),h.k0s(),h.j41(6,"th",19),h.EFF(7),h.nI1(8,"i18n"),h.k0s(),h.nrm(9,"th",19),h.k0s(),h.bVm()),2&e&&(h.R7$(4),h.JRh(h.bMT(5,2,"name")),h.R7$(3),h.JRh(h.bMT(8,4,"owner")))}function V(e,t){if(1&e){const e=h.RV6();h.qex(0),h.j41(1,"a",24),h.nI1(2,"i18n"),h.bIt("click",function(){u.eBV(e);const t=h.XpG().$implicit,i=h.XpG(4);return u.Njj(i.selectCipher(t))}),h.EFF(3),h.k0s(),h.bVm()}if(2&e){const e=h.XpG().$implicit;h.R7$(),h.Y8G("title",h.mNQ(h.i5U(2,3,"editItemWithName",e.name))),h.R7$(2),h.JRh(e.name)}}function B(e,t){if(1&e&&(h.j41(0,"span"),h.EFF(1),h.k0s()),2&e){const e=h.XpG().$implicit;h.R7$(),h.JRh(e.name)}}function z(e,t){1&e&&(h.qex(0),h.nrm(1,"i",25),h.nI1(2,"i18n"),h.j41(3,"span",4),h.EFF(4),h.nI1(5,"i18n"),h.k0s(),h.bVm()),2&e&&(h.R7$(),h.Y8G("title",h.mNQ(h.bMT(2,3,"shared"))),h.R7$(3),h.JRh(h.bMT(5,5,"shared")))}function L(e,t){1&e&&(h.qex(0),h.nrm(1,"i",26),h.nI1(2,"i18n"),h.j41(3,"span",4),h.EFF(4),h.nI1(5,"i18n"),h.k0s(),h.bVm()),2&e&&(h.R7$(),h.Y8G("title",h.mNQ(h.bMT(2,3,"attachments"))),h.R7$(3),h.JRh(h.bMT(5,5,"attachments")))}function K(e,t){if(1&e&&(h.nrm(0,"app-org-badge",27),h.nI1(1,"async"),h.nI1(2,"orgNameFromId")),2&e){const e=h.XpG().$implicit,t=h.XpG(4);h.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",h.i5U(2,5,e.organizationId,h.bMT(1,3,t.organizations$)))}}function q(e,t){if(1&e&&(h.j41(0,"tr",18)(1,"td",19),h.nrm(2,"app-vault-icon",21),h.k0s(),h.j41(3,"td",19),h.DNE(4,V,4,6,"ng-container",22)(5,B,2,1,"ng-template",null,0,h.C5r)(7,z,6,7,"ng-container",1)(8,L,6,7,"ng-container",1),h.nrm(9,"br"),h.j41(10,"small"),h.EFF(11),h.k0s()(),h.j41(12,"td",19),h.DNE(13,K,3,8,"app-org-badge",23),h.k0s()()),2&e){const e=t.$implicit,i=h.sdS(6),n=h.XpG(4);h.R7$(2),h.Y8G("cipher",e),h.R7$(2),h.Y8G("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),h.R7$(3),h.Y8G("ngIf",!n.organization&&e.organizationId),h.R7$(),h.Y8G("ngIf",e.hasAttachments),h.R7$(3),h.JRh(e.subTitle),h.R7$(2),h.Y8G("ngIf",!n.organization)}}function _(e,t){if(1&e&&(h.DNE(0,q,14,7,"tr",20),h.nI1(1,"async")),2&e){const e=t.$implicit;h.Y8G("ngForOf",h.bMT(1,1,e))}}function X(e,t){if(1&e&&(h.qex(0),h.j41(1,"bit-callout",8),h.nI1(2,"i18n"),h.EFF(3),h.nI1(4,"number"),h.nI1(5,"i18n"),h.k0s(),h.DNE(6,j,4,7,"bit-toggle-group",9),h.j41(7,"bit-table",10),h.DNE(8,N,10,6,"ng-container",11)(9,_,2,3,"ng-template",12),h.k0s(),h.bVm()),2&e){const e=h.XpG(2);h.R7$(),h.Y8G("title",h.mNQ(h.bMT(2,6,"unsecuredWebsitesFound"))),h.R7$(2),h.SpI(" ",h.brH(5,10,"unsecuredWebsitesFoundReportDesc",h.bMT(4,8,e.ciphers.length),e.vaultMsg)," "),h.R7$(3),h.Y8G("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),h.R7$(),h.Y8G("dataSource",e.dataSource),h.R7$(),h.Y8G("ngIf",!e.isAdminConsoleActive)}}function Y(e,t){if(1&e&&(h.j41(0,"div",5),h.DNE(1,U,4,7,"bit-callout",6)(2,X,10,14,"ng-container",1),h.k0s()),2&e){const e=h.XpG();h.R7$(),h.Y8G("ngIf",!e.ciphers.length),h.R7$(),h.Y8G("ngIf",e.ciphers.length)}}class H extends d.n{constructor(e,t,i,n,r,s,o,a,l,c){super(e,i,r,t,n,s,o,l,c),this.cipherService=e,this.organizationService=t,this.collectionService=a,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return O(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return O(this,void 0,void 0,function*(){const e=yield this.getAllCiphers();this.filterStatus=[0];const t=e.filter(e=>this.cipherContainsUnsecured(e));this.filterCiphersByOrg(t)})}cipherContainsUnsecured(e){if(e.type!==o.gC.Login||!e.login.hasUris||e.isDeleted||!this.organization&&!e.edit)return!1;return e.login.uris.some(e=>null!=e.uri&&0===e.uri.indexOf("http://"))}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return O(this,void 0,void 0,function*(){return e===l.r.Deleted?null:this.cipherContainsUnsecured(t)?t:null})}}H.ɵfac=function(e){return new(e||H)(h.rXU(p.p),h.rXU(r.PV),h.rXU(m.o3),h.rXU(v.Di),h.rXU(a.qX),h.rXU(f.W),h.rXU(s.H),h.rXU(n.YD),h.rXU(a.hI),h.rXU(c.l))},H.ɵcmp=h.VBU({type:H,selectors:[["app-unsecured-websites-report"]],standalone:!1,features:[h.Vt3],decls:7,vars:5,consts:[["cantManage",""],[4,"ngIf"],["class","tw-mt-4",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[3,"dataSource"],["header","",4,"ngIf"],["body",""],[3,"selectedChange","selected"],[4,"ngFor","ngForOf"],[3,"value"],["bitBadge","","variant","info"],["header",""],["bitRow",""],["bitCell",""],["bitRow","",4,"ngFor","ngForOf"],[3,"cipher"],[4,"ngIf","ngIfElse"],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(h.nrm(0,"app-header"),h.j41(1,"bit-container")(2,"p"),h.EFF(3),h.nI1(4,"i18n"),h.k0s(),h.DNE(5,M,6,7,"div",1)(6,Y,3,2,"div",2),h.k0s()),2&e&&(h.R7$(3),h.JRh(h.bMT(4,3,"unsecuredWebsitesReportDesc")),h.R7$(2),h.Y8G("ngIf",!t.hasLoaded&&t.loading),h.R7$(),h.Y8G("ngIf",t.hasLoaded))},dependencies:[g.Sq,g.bT,y.R,b.Y,w.x,S.n,I.G,k.H,C.L,T.Q,F.Y,R._,R.O,P.H,x.a,$.P,E.f,g.Jj,g.QX,A.$,D.t],encapsulation:2})},71804:(e,t,i)=>{"use strict";var n;i.d(t,{R:()=>n}),function(e){e[e.Authenticator=0]="Authenticator",e[e.Email=1]="Email",e[e.Duo=2]="Duo",e[e.Yubikey=3]="Yubikey",e[e.U2f=4]="U2f",e[e.Remember=5]="Remember",e[e.OrganizationDuo=6]="OrganizationDuo",e[e.WebAuthn=7]="WebAuthn",e[e.RecoveryCode=8]="RecoveryCode"}(n||(n={}))},71901:(e,t,i)=>{"use strict";i.d(t,{ay:()=>n,f$:()=>L});var n,r=i(51757),s=i(66046),o=i(72245),a=i(33338),l=i(14803),c=i(67553),d=i(3633),u=i(78781),h=i(31442),p=i(81525),m=i(50866),v=i(62963),f=i(33812),g=i(21274),y=i(69855),b=i(50700),w=i(37115),S=i(62166),I=i(5556),k=i(35500),C=i(11224),T=i(77468),F=i(26657),R=i(45154),P=i(56898),x=i(44432),$=i(7730),E=i(68016),A=i(7855),D=i(88016),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function M(e,t){1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"i18n"),f.bVm()),2&e&&(f.R7$(),f.SpI(" ",f.bMT(2,1,"orgCreatedSponsorshipInvalid")," "))}function U(e,t){if(1&e&&(f.j41(0,"li"),f.EFF(1),f.nI1(2,"i18n"),f.k0s()),2&e){const e=t.$implicit;f.R7$(),f.Lme(" ",e.count," ",f.bMT(2,2,e.localizationKey)," ")}}function G(e,t){if(1&e&&(f.qex(0),f.EFF(1),f.nI1(2,"i18n"),f.j41(3,"ul"),f.DNE(4,U,3,4,"li",13),f.k0s(),f.EFF(5),f.nI1(6,"i18n"),f.bVm()),2&e){const e=f.XpG(2);f.R7$(),f.SpI(" ",f.i5U(2,3,"deletingOrganizationContentWarning",null==e.organization?null:e.organization.name)," "),f.R7$(3),f.Y8G("ngForOf",e.organizationContentSummary.itemCountByType),f.R7$(),f.SpI(" ",f.bMT(6,6,"deletingOrganizationActiveUserAccountsWarning")," ")}}function j(e,t){if(1&e&&f.DNE(0,G,7,8,"ng-container",12),2&e){const e=f.XpG();f.Y8G("ngIf",e.organizationContentSummary.totalItemCount>0)}}class N{getKey(e){return 1==e?this.singular:this.plural}constructor(e,t){this.singular=e,this.plural=t}}class V{get localizationKey(){return this.localizationKeyOptions.getKey(this.count)}constructor(e,t){this.count=e,this.localizationKeyOptions=t}}class B{constructor(){this.totalItemCount=0,this.itemCountByType=[]}}!function(e){e.Deleted="deleted",e.Canceled="canceled"}(n||(n={}));class z{constructor(e,t,i,o,a,l,c,d,u,h,p){this.params=e,this.dialogRef=t,this.i18nService=i,this.platformUtilsService=o,this.userVerificationService=a,this.cipherService=l,this.organizationService=c,this.accountService=d,this.organizationApiService=u,this.formBuilder=h,this.toastService=p,this.destroy$=new s.B,this.deleteOrganizationRequestType="RegularDelete",this.organizationContentSummary=new B,this.formGroup=this.formBuilder.group({secret:new r.MJ(null,[r.k0.required])}),this.submit=()=>O(this,void 0,void 0,function*(){yield this.userVerificationService.buildRequest(this.formGroup.value.secret).then(e=>this.organizationApiService.delete(this.organization.id,e)),this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationDeleted"),message:this.i18nService.t("organizationDeletedDesc")}),this.dialogRef.close(n.Deleted)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngOnInit(){return O(this,void 0,void 0,function*(){this.deleteOrganizationRequestType=this.params.requestType;const e=yield(0,o._)((0,d.F6)(this.accountService.activeAccount$));(0,a.z)([this.organizationService.organizations$(e).pipe((0,c.Sw)(this.params.organizationId)),this.cipherService.getAllFromApiForOrganization(this.params.organizationId)]).pipe((0,l.Q)(this.destroy$)).subscribe(([e,t])=>{this.organization=e,this.organizationContentSummary=this.buildOrganizationContentSummary(t),this.loaded=!0})})}buildOrganizationContentSummary(e){const t=new B,i=e.filter(e=>null==e.deletedDate);if(i.length<1)return t;t.totalItemCount=i.length;for(const n of u.A.iterateEnum(h.gC)){const e=this.getOrganizationItemCountByType(i,n);e>0&&t.itemCountByType.push(new V(e,this.getOrganizationItemLocalizationKeysByType((0,h.g7)(n))))}return t}getOrganizationItemCountByType(e,t){return e.filter(e=>e.type==t).length}getOrganizationItemLocalizationKeysByType(e){return new N(`type${e}`,`type${e}Plural`)}}function L(e,t){return e.open(z,t)}z.ɵfac=function(e){return new(e||z)(f.rXU(p.Qs),f.rXU(g.ce),f.rXU(b.W),f.rXU(w.y),f.rXU(S.i),f.rXU(I.p),f.rXU(c.PV),f.rXU(k.Di),f.rXU(C.X),f.rXU(r.ok),f.rXU(y.f))},z.ɵcmp=f.VBU({type:z,selectors:[["app-delete-organization"]],decls:21,vars:19,consts:[["regularDelete",""],[3,"formGroup","bitSubmit"],[3,"loading"],["bitDialogTitle",""],["bitDialogContent",""],["type","warning"],["id","organizationDeleteDescription"],[4,"ngIf","ngIfElse"],["formControlName","secret"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","danger",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],[4,"ngIf"],[4,"ngFor","ngForOf"]],template:function(e,t){if(1&e&&(f.j41(0,"form",1)(1,"bit-dialog",2)(2,"span",3),f.EFF(3),f.nI1(4,"i18n"),f.k0s(),f.j41(5,"div",4)(6,"bit-callout",5),f.EFF(7),f.nI1(8,"i18n"),f.k0s(),f.j41(9,"p",6),f.DNE(10,M,3,3,"ng-container",7)(11,j,1,1,"ng-template",null,0,f.C5r),f.k0s(),f.nrm(13,"app-user-verification",8),f.k0s(),f.qex(14,9),f.j41(15,"button",10),f.EFF(16),f.nI1(17,"i18n"),f.k0s(),f.j41(18,"button",11),f.EFF(19),f.nI1(20,"i18n"),f.k0s(),f.bVm(),f.k0s()()),2&e){const e=f.sdS(12);f.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),f.R7$(),f.Y8G("loading",!t.loaded),f.R7$(2),f.JRh(f.bMT(4,10,"deleteOrganization")),f.R7$(4),f.SpI(" ",f.i5U(8,12,"deletingOrganizationIsPermanentWarning",null==t.organization?null:t.organization.name)," "),f.R7$(3),f.Y8G("ngIf","InvalidFamiliesForEnterprise"===t.deleteOrganizationRequestType)("ngIfElse",e),f.R7$(5),f.Y8G("disabled",!t.loaded),f.R7$(),f.SpI(" ",f.bMT(17,15,"deleteOrganization")," "),f.R7$(3),f.SpI(" ",f.bMT(20,17,"cancel")," ")}},dependencies:[v.G,T.Sq,T.bT,r.qT,r.BC,r.cb,r.j4,r.JD,F.$,R.L,P.Q,x.G,$.I,E.m,m.R6,A.q,D.$],encapsulation:2})},71944:(e,t,i)=>{"use strict";i.d(t,{P:()=>f});var n=i(72245),r=i(28202),s=i(78781),o=i(33812),a=i(50700),l=i(86388),c=i(83078),d=i(6056),u=i(54471),h=i(47696);class p{transform(e,t=25,i=!1,n="..."){return e.length<=t?e:(t-=n.length,i&&e.length>t&&e.indexOf(" ")>0&&(t=e.substring(0,t).lastIndexOf(" ")),e.substring(0,t)+n)}}p.ɵfac=function(e){return new(e||p)},p.ɵpipe=o.EJ8({name:"ellipsis",type:p,pure:!0,standalone:!1});var m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const v=e=>({organizationId:e});class f{constructor(e,t,i){this.i18nService=e,this.avatarService=t,this.tokenService=i}ngOnChanges(){return m(this,void 0,void 0,function*(){var e;if(this.isMe=null==this.organizationName||""===this.organizationName,this.isMe){if(this.name=this.i18nService.t("me"),this.color=yield(0,n._)(this.avatarService.avatarColor$),null==this.color){const t=yield this.tokenService.getUserId();if(null!=t)this.color=s.A.stringToColor(t);else{const t=null!==(e=yield this.tokenService.getName())&&void 0!==e?e:yield this.tokenService.getEmail();this.color=s.A.stringToColor(t.toUpperCase())}}}else this.name=this.organizationName,this.color=s.A.stringToColor(this.organizationName.toUpperCase());this.textColor=s.A.pickTextColorBasedOnBgColor(this.color,135,!0)+"!important"})}get organizationIdLink(){var e;return null!==(e=this.organizationId)&&void 0!==e?e:r.I_}}f.ɵfac=function(e){return new(e||f)(o.rXU(a.W),o.rXU(l.v),o.rXU(c.B))},f.ɵcmp=o.VBU({type:f,selectors:[["app-org-badge"]],inputs:{organizationId:"organizationId",organizationName:"organizationName",disabled:"disabled"},standalone:!1,features:[o.OA$],decls:3,vars:14,consts:[["bitBadge","","type","button","routerLink","","queryParamsHandling","merge",3,"disabled","appA11yTitle","queryParams"]],template:function(e,t){1&e&&(o.j41(0,"button",0),o.EFF(1),o.nI1(2,"ellipsis"),o.k0s()),2&e&&(o.xc7("color",t.textColor)("background-color",t.color),o.Y8G("appA11yTitle",o.mNQ(t.organizationName))("disabled",t.disabled)("queryParams",o.eq3(12,v,t.organizationIdLink)),o.R7$(),o.SpI(" ",o.i5U(2,9,t.name,13),"\n"))},dependencies:[d.Wk,u.C,h.n,p],encapsulation:2})},72142:(e,t,i)=>{"use strict";i.d(t,{H:()=>r});var n=i(8583);class r extends n.n{get maskedPrivateKey(){if(!this.privateKey||0===this.privateKey.length)return"";let e=this.privateKey.split("\n").filter(e=>""!==e.trim());return e=e.map((t,i)=>0===i||i===e.length-1?t:this.maskLine(t)),e.join("\n")}maskLine(e){return"•".repeat(32)}get subTitle(){return this.keyFingerprint}static fromJSON(e){return Object.assign(new r,e)}static fromSdkSshKeyView(e){const t=new r;return t.privateKey=e.privateKey,t.publicKey=e.publicKey,t.keyFingerprint=e.fingerprint,t}toSdkSshKeyView(){return{privateKey:this.privateKey,publicKey:this.publicKey,fingerprint:this.keyFingerprint}}}},72331:(e,t,i)=>{"use strict";i.d(t,{d:()=>n});class n{}},72523:(e,t,i)=>{"use strict";i.d(t,{w:()=>W});var n=i(67553),r=i(78781),s=i(63457),o=i(39488),a=i(31442),l=i(22166),c=i(24593),d=i(62819),u=i(77723),h=i(74208),p=i(33812),m=i(5556),v=i(21274),f=i(35500),g=i(50700),y=i(77468),b=i(26333),w=i(93103),S=i(47428),I=i(47696),k=i(44432),C=i(10672),T=i(59032),F=i(30930),R=i(38410),P=i(32316),x=i(12694),$=i(16496),E=i(71944),A=i(93748),D=i(88016),O=i(91975),M=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function U(e,t){1&e&&(p.j41(0,"div"),p.nrm(1,"i",3),p.nI1(2,"i18n"),p.j41(3,"span",4),p.EFF(4),p.nI1(5,"i18n"),p.k0s()()),2&e&&(p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,3,"loading"))),p.R7$(3),p.JRh(p.bMT(5,5,"loading")))}function G(e,t){1&e&&(p.j41(0,"bit-callout",7),p.nI1(1,"i18n"),p.EFF(2),p.nI1(3,"i18n"),p.k0s()),2&e&&(p.Y8G("title",p.mNQ(p.bMT(1,3,"goodNews"))),p.R7$(2),p.SpI(" ",p.bMT(3,5,"noWeakPasswords")," "))}function j(e,t){if(1&e&&(p.qex(0),p.j41(1,"bit-toggle",19),p.EFF(2),p.j41(3,"span",20),p.EFF(4),p.k0s()(),p.bVm()),2&e){const e=t.$implicit,i=p.XpG(4);p.R7$(),p.Y8G("value",e),p.R7$(),p.SpI(" ",i.getName(e)," "),p.R7$(2),p.SpI(" ",i.getCount(e)," ")}}function N(e,t){if(1&e){const e=p.RV6();p.j41(0,"bit-toggle-group",17),p.nI1(1,"async"),p.nI1(2,"i18n"),p.bIt("selectedChange",function(t){h.eBV(e);const i=p.XpG(3);return h.Njj(i.filterOrgToggle(t))}),p.DNE(3,j,5,3,"ng-container",18),p.k0s()}if(2&e){const e=p.XpG(3);p.Y8G("selected",p.bMT(1,3,e.filterOrgStatus$)),p.BMQ("aria-label",p.bMT(2,5,"addAccessFilter")),p.R7$(3),p.Y8G("ngForOf",e.filterStatus)}}function V(e,t){1&e&&(p.j41(0,"th",21),p.EFF(1),p.nI1(2,"i18n"),p.k0s()),2&e&&(p.R7$(),p.SpI(" ",p.bMT(2,1,"owner")," "))}function B(e,t){if(1&e){const e=p.RV6();p.qex(0),p.j41(1,"a",27),p.nI1(2,"i18n"),p.bIt("click",function(){h.eBV(e);const t=p.XpG().$implicit,i=p.XpG(3);return h.Njj(i.selectCipher(t))}),p.EFF(3),p.k0s(),p.bVm()}if(2&e){const e=p.XpG().$implicit;p.R7$(),p.Y8G("title",p.mNQ(p.i5U(2,3,"editItemWithName",e.name))),p.R7$(2),p.JRh(e.name)}}function z(e,t){if(1&e&&(p.j41(0,"span"),p.EFF(1),p.k0s()),2&e){const e=p.XpG().$implicit;p.R7$(),p.JRh(e.name)}}function L(e,t){1&e&&(p.qex(0),p.nrm(1,"i",28),p.nI1(2,"i18n"),p.j41(3,"span",4),p.EFF(4),p.nI1(5,"i18n"),p.k0s(),p.bVm()),2&e&&(p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,3,"shared"))),p.R7$(3),p.JRh(p.bMT(5,5,"shared")))}function K(e,t){1&e&&(p.qex(0),p.nrm(1,"i",29),p.nI1(2,"i18n"),p.j41(3,"span",4),p.EFF(4),p.nI1(5,"i18n"),p.k0s(),p.bVm()),2&e&&(p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,3,"attachments"))),p.R7$(3),p.JRh(p.bMT(5,5,"attachments")))}function q(e,t){if(1&e&&(p.nrm(0,"app-org-badge",31),p.nI1(1,"async"),p.nI1(2,"orgNameFromId")),2&e){const e=p.XpG(2).$implicit,t=p.XpG(3);p.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",p.i5U(2,5,e.organizationId,p.bMT(1,3,t.organizations$)))}}function _(e,t){if(1&e&&(p.j41(0,"td",12),p.DNE(1,q,3,8,"app-org-badge",30),p.k0s()),2&e){const e=p.XpG(4);p.R7$(),p.Y8G("ngIf",!e.organization)}}function X(e,t){if(1&e&&(p.j41(0,"td",12),p.nrm(1,"app-vault-icon",22),p.k0s(),p.j41(2,"td",12),p.DNE(3,B,4,6,"ng-container",23)(4,z,2,1,"ng-template",null,0,p.C5r)(6,L,6,7,"ng-container",1)(7,K,6,7,"ng-container",1),p.nrm(8,"br"),p.j41(9,"small"),p.EFF(10),p.k0s()(),p.DNE(11,_,2,1,"td",24),p.j41(12,"td",25)(13,"span",26),p.EFF(14),p.nI1(15,"i18n"),p.k0s()()),2&e){const e=t.$implicit,i=p.sdS(5),n=p.XpG(3);p.R7$(),p.Y8G("cipher",e),p.R7$(2),p.Y8G("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),p.R7$(3),p.Y8G("ngIf",!n.organization&&e.organizationId),p.R7$(),p.Y8G("ngIf",e.hasAttachments),p.R7$(3),p.JRh(e.subTitle),p.R7$(),p.Y8G("ngIf",!n.isAdminConsoleActive),p.R7$(2),p.Y8G("variant",e.reportValue.badgeVariant),p.R7$(),p.SpI(" ",p.bMT(15,9,e.reportValue.label)," ")}}function Y(e,t){if(1&e&&(p.qex(0),p.j41(1,"bit-callout",8),p.nI1(2,"i18n"),p.EFF(3),p.nI1(4,"number"),p.nI1(5,"i18n"),p.k0s(),p.DNE(6,N,4,7,"bit-toggle-group",9),p.j41(7,"bit-table-scroll",10),p.qex(8,11),p.nrm(9,"th",12),p.j41(10,"th",13),p.EFF(11),p.nI1(12,"i18n"),p.k0s(),p.DNE(13,V,3,3,"th",14),p.j41(14,"th",15),p.EFF(15),p.nI1(16,"i18n"),p.k0s(),p.bVm(),p.DNE(17,X,16,11,"ng-template",16),p.k0s(),p.bVm()),2&e){const e=p.XpG(2);p.R7$(),p.Y8G("title",p.mNQ(p.bMT(2,9,"weakPasswordsFound"))),p.R7$(2),p.SpI(" ",p.brH(5,13,"weakPasswordsFoundReportDesc",p.bMT(4,11,e.ciphers.length),e.vaultMsg)," "),p.R7$(3),p.Y8G("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),p.R7$(),p.Y8G("dataSource",e.dataSource)("rowSize",53),p.R7$(4),p.JRh(p.bMT(12,17,"name")),p.R7$(2),p.Y8G("ngIf",!e.isAdminConsoleActive),p.R7$(2),p.SpI(" ",p.bMT(16,19,"weakness")," ")}}function H(e,t){if(1&e&&(p.j41(0,"div",5),p.DNE(1,G,4,7,"bit-callout",6)(2,Y,18,21,"ng-container",1),p.k0s()),2&e){const e=p.XpG();p.R7$(),p.Y8G("ngIf",!e.ciphers.length),p.R7$(),p.Y8G("ngIf",e.ciphers.length)}}class W extends u.n{constructor(e,t,i,n,r,s,o,a,l,c){super(e,n,s,i,r,o,a,l,c),this.cipherService=e,this.passwordStrengthService=t,this.organizationService=i,this.accountService=r,this.adminConsoleCipherFormConfigService=c,this.disabled=!0,this.weakPasswordCiphers=[]}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return M(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return M(this,void 0,void 0,function*(){const e=yield this.getAllCiphers();this.weakPasswordCiphers=[],this.filterStatus=[0],this.findWeakPasswords(e)})}determinedUpdatedCipherReportStatus(e,t){return M(this,void 0,void 0,function*(){if(e===c.r.Deleted)return this.weakPasswordCiphers=this.weakPasswordCiphers.filter(e=>e.id!==t.id),null;const i=yield this.determineWeakPasswordScore(t),n=this.weakPasswordCiphers.findIndex(e=>e.id===t.id);return-1!==n&&(this.weakPasswordCiphers[n]=i),i})}findWeakPasswords(e){e.forEach(e=>{const t=this.determineWeakPasswordScore(e);null!=t&&this.weakPasswordCiphers.push(t)}),this.filterCiphersByOrg(this.weakPasswordCiphers)}determineWeakPasswordScore(e){const{type:t,login:i,isDeleted:n,edit:r,viewPassword:s}=e;if(t!==a.gC.Login||null==i.password||""===i.password||n||!this.organization&&!r||!s)return;let o=[];if(this.isUserNameNotEmpty(e)){const e=i.username.indexOf("@");o=e>-1?o.concat(i.username.substr(0,e).trim().toLowerCase().split(/[^A-Za-z0-9]/)).filter(e=>e.length>=3):i.username.trim().toLowerCase().split(/[^A-Za-z0-9]/).filter(e=>e.length>=3)}const l=this.passwordStrengthService.getPasswordStrength(i.password,null,o.length>0?o:null);if(null!=l.score&&l.score<=2){const t=this.scoreKey(l.score);return Object.assign(Object.assign({},e),{score:l.score,reportValue:t,scoreKey:t.sortOrder})}return null}canManageCipher(e){return!0}isUserNameNotEmpty(e){return!r.A.isNullOrWhitespace(e.login.username)}scoreKey(e){switch(e){case 4:return{label:"strong",badgeVariant:"success",sortOrder:1};case 3:return{label:"good",badgeVariant:"primary",sortOrder:2};case 2:return{label:"weak",badgeVariant:"warning",sortOrder:3};default:return{label:"veryWeak",badgeVariant:"danger",sortOrder:4}}}}W.ɵfac=function(e){return new(e||W)(p.rXU(m.p),p.rXU(s.Q),p.rXU(n.PV),p.rXU(v.o3),p.rXU(f.Di),p.rXU(l.qX),p.rXU(g.W),p.rXU(o.H),p.rXU(l.hI),p.rXU(d.l))},W.ɵcmp=p.VBU({type:W,selectors:[["app-weak-passwords-report"]],standalone:!1,features:[p.Vt3],decls:7,vars:5,consts:[["cantManage",""],[4,"ngIf"],["class","tw-mt-4",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mt-4"],["type","success",3,"title",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[3,"selected","selectedChange",4,"ngIf"],[3,"dataSource","rowSize"],["header",""],["bitCell",""],["bitCell","","bitSortable","name"],["bitCell","","bitSortable","organizationId",4,"ngIf"],["bitCell","","bitSortable","scoreKey","default","",1,"tw-text-right"],["bitRowDef",""],[3,"selectedChange","selected"],[4,"ngFor","ngForOf"],[3,"value"],["bitBadge","","variant","info"],["bitCell","","bitSortable","organizationId"],[3,"cipher"],[4,"ngIf","ngIfElse"],["bitCell","",4,"ngIf"],["bitCell","",1,"tw-text-right"],["bitBadge","",3,"variant"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(p.nrm(0,"app-header"),p.j41(1,"bit-container")(2,"p"),p.EFF(3),p.nI1(4,"i18n"),p.k0s(),p.DNE(5,U,6,7,"div",1)(6,H,3,2,"div",2),p.k0s()),2&e&&(p.R7$(3),p.JRh(p.bMT(4,3,"weakPasswordsReportDesc")),p.R7$(2),p.Y8G("ngIf",!t.hasLoaded&&t.loading),p.R7$(),p.Y8G("ngIf",t.hasLoaded))},dependencies:[y.Sq,y.bT,b.R,w.Y,S.x,I.n,k.G,C.H,T.L,F.a,R.Q,P.O,F.N,x.H,$.a,E.P,A.f,y.Jj,y.QX,D.$,O.t],encapsulation:2})},72868:(e,t,i)=>{"use strict";i.d(t,{C:()=>s});var n=i(20702),r=i(95919);class s extends n.r{constructor(e){var t,i,n,s,o,a;super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.usePolicies=this.getResponseProperty("UsePolicies"),this.useGroups=this.getResponseProperty("UseGroups"),this.useDirectory=this.getResponseProperty("UseDirectory"),this.useEvents=this.getResponseProperty("UseEvents"),this.useTotp=this.getResponseProperty("UseTotp"),this.use2fa=this.getResponseProperty("Use2fa"),this.useApi=this.getResponseProperty("UseApi"),this.useSso=this.getResponseProperty("UseSso"),this.useOrganizationDomains=this.getResponseProperty("UseOrganizationDomains"),this.useKeyConnector=null!==(t=this.getResponseProperty("UseKeyConnector"))&&void 0!==t&&t,this.useScim=null!==(i=this.getResponseProperty("UseScim"))&&void 0!==i&&i,this.useCustomPermissions=null!==(n=this.getResponseProperty("UseCustomPermissions"))&&void 0!==n&&n,this.useResetPassword=this.getResponseProperty("UseResetPassword"),this.useSecretsManager=this.getResponseProperty("UseSecretsManager"),this.usePasswordManager=this.getResponseProperty("UsePasswordManager"),this.useActivateAutofillPolicy=this.getResponseProperty("UseActivateAutofillPolicy"),this.useAutomaticUserConfirmation=this.getResponseProperty("UseAutomaticUserConfirmation"),this.selfHost=this.getResponseProperty("SelfHost"),this.usersGetPremium=this.getResponseProperty("UsersGetPremium"),this.seats=this.getResponseProperty("Seats"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.maxStorageGb=this.getResponseProperty("MaxStorageGb"),this.key=this.getResponseProperty("Key"),this.hasPublicAndPrivateKeys=this.getResponseProperty("HasPublicAndPrivateKeys"),this.status=this.getResponseProperty("Status"),this.type=this.getResponseProperty("Type"),this.enabled=this.getResponseProperty("Enabled"),this.ssoBound=this.getResponseProperty("SsoBound"),this.identifier=this.getResponseProperty("Identifier"),this.permissions=new r.n(this.getResponseProperty("permissions")),this.resetPasswordEnrolled=this.getResponseProperty("ResetPasswordEnrolled"),this.userId=this.getResponseProperty("UserId"),this.organizationUserId=this.getResponseProperty("OrganizationUserId"),this.providerId=this.getResponseProperty("ProviderId"),this.providerName=this.getResponseProperty("ProviderName"),this.providerType=this.getResponseProperty("ProviderType"),this.familySponsorshipFriendlyName=this.getResponseProperty("FamilySponsorshipFriendlyName"),this.familySponsorshipAvailable=this.getResponseProperty("FamilySponsorshipAvailable"),this.productTierType=this.getResponseProperty("ProductTierType"),this.keyConnectorEnabled=null!==(s=this.getResponseProperty("KeyConnectorEnabled"))&&void 0!==s&&s,this.keyConnectorUrl=this.getResponseProperty("KeyConnectorUrl");const l=this.getResponseProperty("FamilySponsorshipLastSyncDate");l&&(this.familySponsorshipLastSyncDate=new Date(l));const c=this.getResponseProperty("FamilySponsorshipValidUntil");c&&(this.familySponsorshipValidUntil=new Date(c)),this.familySponsorshipToDelete=this.getResponseProperty("FamilySponsorshipToDelete"),this.accessSecretsManager=this.getResponseProperty("AccessSecretsManager"),this.limitCollectionCreation=this.getResponseProperty("LimitCollectionCreation"),this.limitCollectionDeletion=this.getResponseProperty("LimitCollectionDeletion"),this.limitItemDeletion=this.getResponseProperty("LimitItemDeletion"),this.allowAdminAccessToAllCollectionItems=this.getResponseProperty("AllowAdminAccessToAllCollectionItems"),this.userIsManagedByOrganization=this.getResponseProperty("UserIsManagedByOrganization"),this.useAccessIntelligence=this.getResponseProperty("UseRiskInsights"),this.useAdminSponsoredFamilies=this.getResponseProperty("UseAdminSponsoredFamilies"),this.isAdminInitiated=this.getResponseProperty("IsAdminInitiated"),this.ssoEnabled=null!==(o=this.getResponseProperty("SsoEnabled"))&&void 0!==o&&o,this.ssoMemberDecryptionType=this.getResponseProperty("SsoMemberDecryptionType"),this.usePhishingBlocker=null!==(a=this.getResponseProperty("UsePhishingBlocker"))&&void 0!==a&&a}}},72932:(e,t,i)=>{"use strict";i.d(t,{G:()=>c});var n=i(90097),r=i(23490),s=i(25065),o=i(87916),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[s.G,r.O,o.V,n.H]})},73386:(e,t,i)=>{"use strict";i.d(t,{m:()=>d});var n=i(59777),r=i(78781),s=i(17989),o=i(24072),a=i(76506),l=i(16671),c=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class d extends s.A{constructor(e){var t;super(),null!=e&&(this.uri=(0,o.e)(e.uri),this.uriChecksum=(0,o.e)(e.uriChecksum),this.match=null!==(t=e.match)&&void 0!==t?t:void 0)}decrypt(e,t="No Cipher Context"){return this.decryptObj(this,new l.z(this),["uri"],e,t)}validateChecksum(e,t){return c(this,void 0,void 0,function*(){if(null==this.uriChecksum)return!1;const i=r.A.getContainerService().getEncryptService(),n=yield i.hash(e,"sha256");return(yield i.decryptString(this.uriChecksum,t))===n})}toLoginUriData(){const e=new a.S;return this.buildDataModel(this,e,{uri:null,uriChecksum:null,match:null},["match"]),e}static fromJSON(e){var t;if(null==e)return;const i=new d;return i.uri=(0,o.u)(e.uri),i.match=null!==(t=e.match)&&void 0!==t?t:void 0,i.uriChecksum=(0,o.u)(e.uriChecksum),i}toSdkLoginUri(){var e,t;return{uri:null===(e=this.uri)||void 0===e?void 0:e.toSdk(),uriChecksum:null===(t=this.uriChecksum)||void 0===t?void 0:t.toSdk(),match:(0,n.D)(this.match)}}static fromSdkLoginUri(e){if(null==e)return;const t=new d;return t.uri=(0,o.u)(e.uri),t.uriChecksum=(0,o.u)(e.uriChecksum),t.match=e.match,t}}},73409:(e,t,i)=>{"use strict";i.d(t,{U:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.readOnly=this.getResponseProperty("ReadOnly"),this.hidePasswords=this.getResponseProperty("HidePasswords"),this.manage=this.getResponseProperty("Manage")}}},73556:(e,t,i)=>{"use strict";i.d(t,{Jq:()=>a,j:()=>s});var n=i(20702),r=i(78781);class s extends n.r{constructor(e){super(e),this.enabled=this.getResponseProperty("Enabled");const t=this.getResponseProperty("Keys");this.keys=null==t?null:t.map(e=>new o(e))}}class o extends n.r{constructor(e){super(e),this.name=this.getResponseProperty("Name"),this.id=this.getResponseProperty("Id"),this.migrated=this.getResponseProperty("Migrated")}}class a extends n.r{constructor(e){super(e),this.attestation=this.getResponseProperty("attestation"),this.authenticatorSelection=this.getResponseProperty("authenticatorSelection"),this.challenge=r.A.fromUrlB64ToArray(this.getResponseProperty("challenge")),this.excludeCredentials=this.getResponseProperty("excludeCredentials").map(e=>(e.id=r.A.fromUrlB64ToArray(e.id).buffer,e)),this.extensions=this.getResponseProperty("extensions"),this.pubKeyCredParams=this.getResponseProperty("pubKeyCredParams"),this.rp=this.getResponseProperty("rp"),this.timeout=this.getResponseProperty("timeout");const t=this.getResponseProperty("user");t.id=r.A.fromUrlB64ToArray(t.id),this.user=t}}},74199:(e,t,i)=>{"use strict";i.d(t,{v:()=>r});var n=i(7248);class r extends n.V{}},74269:(e,t,i)=>{"use strict";i.d(t,{K:()=>a});var n=i(77468),r=i(33812),s=i(21823);function o(e,t){1&e&&r.Hgh(0,"div",0)}class a{constructor(e){this.sideNavService=e}}a.ɵfac=function(e){return new(e||a)(r.rXU(s.G))},a.ɵcmp=r.VBU({type:a,selectors:[["bit-nav-divider"]],decls:2,vars:3,consts:[[1,"tw-h-px","tw-w-full","tw-my-2","tw-bg-secondary-300"]],template:function(e,t){1&e&&(r.nVh(0,o,1,0,"div",0),r.nI1(1,"async")),2&e&&r.vxM(r.bMT(1,1,t.sideNavService.open$)?0:-1)},dependencies:[n.MD,n.Jj],encapsulation:2})},74526:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r,k:()=>n});class n{}class r extends n{}},74683:(e,t,i)=>{"use strict";i.d(t,{k:()=>n});class n{}},74865:(e,t,i)=>{"use strict";i.d(t,{l:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.url=this.getResponseProperty("Url"),this.fileName=this.getResponseProperty("FileName"),this.key=this.getResponseProperty("Key"),this.size=this.getResponseProperty("Size"),this.sizeName=this.getResponseProperty("SizeName")}}},74867:(e,t,i)=>{"use strict";i.d(t,{M:()=>n});class n{}},74956:(e,t,i)=>{"use strict";i.d(t,{u:()=>N});var n=i(44500),r=i(3204),s=i(33338),o=i(16878),a=i(69194),l=i(72245),c=i(93695),d=i(28202),u=i(58363),h=i(55159),p=i(84079),m=i(67553),v=i(43978),f=i(3633),g=i(82468),y=i(31857),b=i(78078),w=i(23567);const S=y.Ok.array(y.km,"collapsedGroupings",{deserializer:e=>e,clearOn:["logout","lock"]});class I{hasId(e){return null!=this.fullList&&this.fullList.filter(t=>t.id===e).length>0}constructor(e){Object.assign(this,e)}}var k=i(74208),C=i(74526),T=i(5556),F=i(18499),R=i(35500),P=i(1601),x=i(50700),$=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class E{collapsedGroupingsState(e){return this.stateProvider.getUser(e,S)}constructor(e,t,i,n,r,s,o,a,l){this.organizationService=e,this.folderService=t,this.cipherService=i,this.collectionService=n,this.policyService=r,this.stateProvider=s,this.accountService=o,this.configService=a,this.i18nService=l}storeCollapsedFilterNodes(e,t){return $(this,void 0,void 0,function*(){yield this.collapsedGroupingsState(t).update(()=>Array.from(e))})}buildCollapsedFilterNodes(e){return $(this,void 0,void 0,function*(){return yield(0,l._)(this.collapsedGroupingsState(e).state$.pipe((0,r.T)(e=>new Set(e))))})}buildOrganizations(){return $(this,void 0,void 0,function*(){const e=yield(0,l._)((0,f.F6)(this.accountService.activeAccount$));let t=yield(0,l._)(this.organizationService.organizations$(e));return null!=t&&(t=t.filter(e=>e.isMember).sort((e,t)=>e.name.localeCompare(t.name))),t})}buildNestedFolders(e){const t=(t,i)=>$(this,void 0,void 0,function*(){let n;if(null==e||"MyVault"==e)n=t;else{const r=(yield this.cipherService.getAllDecrypted(i)).filter(t=>t.organizationId==e);n=t.filter(e=>r.some(t=>t.folderId==e.id)||null==e.id)}const r=yield this.getAllFoldersNested(n);return new I({fullList:n,nestedList:r})});return this.accountService.activeAccount$.pipe((0,u.s)(1),f.F6,(0,n.n)(e=>this.folderService.folderViews$(e).pipe((0,h.Z)(i=>(0,p.H)(t(i,e))))))}buildCollections(e){return $(this,void 0,void 0,function*(){const t=yield(0,l._)(this.accountService.activeAccount$.pipe(f.F6,(0,n.n)(e=>this.collectionService.decryptedCollections$(e)))),i=yield this.buildOrganizations(),r=yield this.configService.getFeatureFlag(g.TO.CreateDefaultLocation);let s=null==e?t:t.filter(t=>t.organizationId===e);r&&(s=A(s,i,this.i18nService.collator));const o=yield this.collectionService.getAllNested(s);return new I({fullList:s,nestedList:o})})}checkForSingleOrganizationPolicy(){return $(this,void 0,void 0,function*(){return yield(0,l._)(this.accountService.activeAccount$.pipe(f.F6,(0,n.n)(e=>this.policyService.policyAppliesToUser$(v.tt.SingleOrg,e))))})}checkForOrganizationDataOwnershipPolicy(){return $(this,void 0,void 0,function*(){return yield(0,l._)(this.accountService.activeAccount$.pipe(f.F6,(0,n.n)(e=>this.policyService.policyAppliesToUser$(v.tt.OrganizationDataOwnership,e))))})}getAllFoldersNested(e){return $(this,void 0,void 0,function*(){const t=[];return e.forEach(e=>{const i=new b.u;i.id=e.id,i.revisionDate=e.revisionDate;const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split("/"):[];w.F.nestedTraverse(t,0,n,i,void 0,"/")}),t})}getFolderNested(e){return $(this,void 0,void 0,function*(){const t=yield(0,l._)(this.accountService.activeAccount$.pipe(f.F6)),i=yield this.getAllFoldersNested(yield(0,l._)(this.folderService.folderViews$(t)));return w.F.getTreeNodeObjectFromList(i,e)})}}function A(e,t=[],i){return[...e.filter(e=>e.type===d.it.DefaultUserCollection).sort((e,n)=>{var r,s,o,a;const l=null!==(s=null===(r=t.find(t=>t.id===e.organizationId))||void 0===r?void 0:r.name)&&void 0!==s?s:e.organizationId,c=null!==(a=null===(o=t.find(e=>e.id===n.organizationId))||void 0===o?void 0:o.name)&&void 0!==a?a:n.organizationId;if(!l||!c)throw new Error("Collection does not have an organizationId.");return i.compare(l,c)}),...e.filter(e=>e.type!==d.it.DefaultUserCollection)]}E.ɵfac=function(e){return new(e||E)(k.KVO(m.PV),k.KVO(C.k),k.KVO(T.p),k.KVO(d.YD),k.KVO(F.m),k.KVO(y.v2),k.KVO(R.Di),k.KVO(P.w),k.KVO(x.W))},E.ɵprov=k.jDH({token:E,factory:E.ɵfac});var D=i(84488),O=i(31442),M=i(84175),U=i(20798),G=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const j="/";class N{collapsedGroupingsState(e){return this.stateProvider.getUser(e,S)}constructor(e,t,i,l,c,d,u,h,p){this.organizationService=e,this.folderService=t,this.cipherService=i,this.policyService=l,this.i18nService=c,this.stateProvider=d,this.collectionService=u,this.accountService=h,this.configService=p,this.activeUserId$=this.accountService.activeAccount$.pipe(f.F6),this.memberOrganizations$=this.activeUserId$.pipe((0,n.n)(e=>this.organizationService.memberOrganizations$(e))),this.collapsedFilterNodes$=this.activeUserId$.pipe((0,n.n)(e=>this.collapsedGroupingsState(e).state$),(0,r.T)(e=>new Set(e))),this.organizationTree$=(0,s.z)([this.memberOrganizations$,this.activeUserId$.pipe((0,n.n)(e=>this.policyService.policyAppliesToUser$(v.tt.SingleOrg,e))),this.activeUserId$.pipe((0,n.n)(e=>this.policyService.policyAppliesToUser$(v.tt.OrganizationDataOwnership,e)))]).pipe((0,n.n)(([e,t,i])=>this.buildOrganizationTree(e,t,i))),this._organizationFilter=new o.t(null),this.filteredFolders$=this.activeUserId$.pipe((0,n.n)(e=>(0,s.z)([this.folderService.folderViews$(e),this.cipherService.cipherListViews$(e),this._organizationFilter])),(0,a.p)(([e,t,i])=>!!t),(0,n.n)(([e,t,i])=>this.filterFolders(e,t,i))),this.folderTree$=this.filteredFolders$.pipe((0,r.T)(e=>this.buildFolderTree(e))),this.filteredCollections$=(0,s.z)([this.accountService.activeAccount$.pipe(f.F6,(0,n.n)(e=>this.collectionService.decryptedCollections$(e))),this._organizationFilter]).pipe((0,n.n)(([e,t])=>this.filterCollections(e,t))),this.collectionTree$=(0,s.z)([this.filteredCollections$,this.memberOrganizations$,this.configService.getFeatureFlag$(g.TO.CreateDefaultLocation)]).pipe((0,r.T)(([e,t,i])=>this.buildCollectionTree(e,t,i))),this.cipherTypeTree$=this.buildCipherTypeTree()}getCollectionNodeFromTree(e){return G(this,void 0,void 0,function*(){const t=yield(0,l._)(this.collectionTree$);return w.F.getTreeNodeObject(t,e)})}setCollapsedFilterNodes(e,t){return G(this,void 0,void 0,function*(){yield this.collapsedGroupingsState(t).update(()=>Array.from(e))})}getCollapsedFilterNodes(){return G(this,void 0,void 0,function*(){return yield(0,l._)(this.collapsedFilterNodes$)})}getOrganizationFilter(){return this._organizationFilter}clearOrganizationFilter(){this._organizationFilter.next(null)}setOrganizationFilter(e){"AllVaults"!=(null==e?void 0:e.id)?this._organizationFilter.next(e):this._organizationFilter.next(null)}expandOrgFilter(e){return G(this,void 0,void 0,function*(){const t=yield(0,l._)(this.collapsedFilterNodes$);t.has("AllVaults")&&(t.delete("AllVaults"),yield this.setCollapsedFilterNodes(t,e))})}buildOrganizationTree(e,t,i){return G(this,void 0,void 0,function*(){const n=this.getOrganizationFilterHead();if(!i){const e=this.getOrganizationFilterMyVault();n.children.push(e)}if(t&&(e=e.slice(0,1)),e){const t=[];e.forEach(e=>{const i=e;i.icon="bwi-business";const r=new M.n(i,n,i.name);t.push(r)}),t.sort((e,t)=>e.node.name.localeCompare(t.node.name)),n.children.push(...t)}return n})}getOrganizationFilterHead(){const e=new D.y;return e.enabled=!0,new M.n(e,null,"allVaults","AllVaults")}getOrganizationFilterMyVault(){const e=new D.y;return e.id="MyVault",e.icon="bwi-user",e.enabled=!0,e.hideOptions=!0,new M.n(e,null,this.i18nService.t("myVault"))}buildTypeTree(e,t){const i=new M.n(e,null);return null==t||t.forEach(e=>{const t=new M.n(e,i,e.name);i.children.push(t)}),(0,c.of)(i)}filterCollections(e,t){return G(this,void 0,void 0,function*(){return null!=(null==t?void 0:t.id)?e.filter(e=>e.organizationId===t.id):e})}buildCollectionTree(e,t,i){const n=this.getCollectionFilterHead();if(!e)return n;const r=[];i&&(e=A(e,t,this.i18nService.collator));const s=this.collectionService.groupByOrganization(e);for(const o of s.values()){const e=[];for(const t of o){const i=(0,U.sE)(new d.iY(Object.assign(Object.assign({},t),{name:t.name})));i.icon=t.type===d.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared";const n=t.name?t.name.replace(/^\/+|\/+$/g,"").split(j):[];w.F.nestedTraverse(e,0,n,i,void 0,j)}r.push(...e)}return r.forEach(e=>{e.parent=n,n.children.push(e)}),n}getCollectionFilterHead(){const e=d.iY.vaultFilterHead();return new M.n(e,null,"collections","AllCollections")}filterFolders(e,t,i){return G(this,void 0,void 0,function*(){if(null==(null==i?void 0:i.id)||"MyVault"==(null==i?void 0:i.id))return e;const n=t.filter(e=>e.organizationId==(null==i?void 0:i.id));return e.filter(e=>n.some(t=>t.folderId==e.id)||null==e.id)})}buildFolderTree(e){const t=this.getFolderFilterHead();if(!e)return t;const i=[];return e.forEach(e=>{const t=new b.u;t.id=e.id,t.revisionDate=e.revisionDate,t.icon="bwi-folder",t.fullName=e.name;const n=null!=e.name?e.name.replace(/^\/+|\/+$/g,"").split(j):[];w.F.nestedTraverse(i,0,n,t,null,j)}),i.forEach(e=>{e.parent=t,t.children.push(e)}),t}getFolderFilterHead(){const e=new b.u;return new M.n(e,null,"folders","AllFolders")}buildCipherTypeTree(){const e=[{id:"favorites",name:this.i18nService.t("favorites"),type:"favorites",icon:"bwi-star"},{id:"login",name:this.i18nService.t("typeLogin"),type:O.gC.Login,icon:"bwi-globe"},{id:"card",name:this.i18nService.t("typeCard"),type:O.gC.Card,icon:"bwi-credit-card"},{id:"identity",name:this.i18nService.t("typeIdentity"),type:O.gC.Identity,icon:"bwi-id-card"},{id:"note",name:this.i18nService.t("typeSecureNote"),type:O.gC.SecureNote,icon:"bwi-sticky-note"},{id:"sshKey",name:this.i18nService.t("typeSshKey"),type:O.gC.SshKey,icon:"bwi-key"}];return this.buildTypeTree({id:"AllItems",name:"allItems",type:"all",icon:""},e)}}N.ɵfac=function(e){return new(e||N)(k.KVO(m.PV),k.KVO(C.k),k.KVO(T.p),k.KVO(F.m),k.KVO(x.W),k.KVO(y.v2),k.KVO(d.YD),k.KVO(R.Di),k.KVO(P.w))},N.ɵprov=k.jDH({token:N,factory:N.ɵfac})},75174:(e,t,i)=>{"use strict";i.d(t,{O:()=>n});class n{constructor(e){this.name=e.name?e.name.encryptedString:null}}},75421:(e,t,i)=>{"use strict";i.d(t,{Q:()=>n});class n{}},75441:(e,t,i)=>{"use strict";i.d(t,{L:()=>c});var n=i(51757),r=i(47135),s=i(62963),o=i(50866),a=i(33812),l=i(74208);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=a.$C({type:c}),c.ɵinj=l.G2t({imports:[s.G,n.YN,n.X1,o.R6,r.q]})},75556:(e,t,i)=>{"use strict";i.d(t,{J:()=>a});var n=i(74208),r=i(4017),s=i(33812);const o=["*",[["","slot","end"]]];class a{constructor(){this.focusVisibleWithin=(0,n.vPA)(!1)}onFocusIn(e){this.focusVisibleWithin.set(e.matches("[data-fvw-target]:focus-visible"))}onFocusOut(){this.focusVisibleWithin.set(!1)}get classList(){return[this.focusVisibleWithin()?"tw-z-10 tw-rounded tw-outline-none tw-ring-2 bit-compact:tw-ring-inset tw-ring-primary-600 tw-border-transparent".split(" "):"tw-border-b-shadow"].flat()}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=s.VBU({type:a,selectors:[["bit-item"]],hostAttrs:[1,"tw-block","tw-box-border","tw-overflow-hidden","tw-flex","tw-bg-background","[&:has([data-item-main-content]_button:hover,[data-item-main-content]_a:hover)]:tw-cursor-pointer","[&:has([data-item-main-content]_button:enabled:hover,[data-item-main-content]_a:hover)]:tw-bg-hover-default","tw-text-main","tw-border-solid","tw-border-b","tw-border-0","[&:not(bit-layout_*)]:tw-rounded-lg","bit-compact:[&:not(bit-layout_*)]:tw-rounded-none","bit-compact:[&:not(bit-layout_*)]:last-of-type:tw-rounded-b-lg","bit-compact:[&:not(bit-layout_*)]:first-of-type:tw-rounded-t-lg","tw-min-h-9","tw-mb-1.5","bit-compact:tw-mb-0"],hostVars:2,hostBindings:function(e,t){1&e&&s.bIt("focusin",function(e){return t.onFocusIn(e.target)})("focusout",function(){return t.onFocusOut()}),2&e&&s.HbH(t.classList)},ngContentSelectors:["*","[slot=end]"],decls:5,vars:1,consts:[["endSlot",""],["data-item-main-content","",1,"tw-flex","tw-flex-1","tw-overflow-hidden"],[1,"tw-px-2","tw-flex","tw-items-center","tw-gap-2","[&_button[biticonbutton]]:-tw-mx-1",3,"hidden"]],template:function(e,t){if(1&e&&(s.NAR(o),s.j41(0,"bit-item-action",1),s.SdG(1),s.k0s(),s.j41(2,"div",2,0),s.SdG(4,1),s.k0s()),2&e){const e=s.sdS(3);s.R7$(2),s.Y8G("hidden",0===e.childElementCount)}},dependencies:[r.D],encapsulation:2,changeDetection:0})},75583:(e,t,i)=>{"use strict";i.d(t,{E:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},75633:(e,t,i)=>{"use strict";i.d(t,{p:()=>n});class n{}},75751:(e,t,i)=>{"use strict";i.d(t,{f:()=>y});var n=i(39306),r=i(66523),s=i(34693),o=i(31442),a=i(36501),l=i(42234),c=i(38453),d=i(34461),u=i(6528),h=i(11766),p=i(67036),m=i(14093),v=i(12022),f=i(86346),g=i(72142);class y{constructor(e){var t;this.initializerKey=s.M.CipherView,this.id="",this.name="",this.type=o.gC.Login,this.favorite=!1,this.organizationUseTotp=!1,this.permissions=new l.a,this.edit=!1,this.viewPassword=!0,this.login=new m.r,this.identity=new p.O,this.card=new u.G,this.secureNote=new f.Z,this.sshKey=new g.H,this.attachments=[],this.fields=[],this.passwordHistory=[],this.collectionIds=[],this.reprompt=a.b.None,this.decryptionFailure=!1,e?(this.id=e.id,this.organizationId=e.organizationId,this.folderId=e.folderId,this.favorite=e.favorite,this.organizationUseTotp=e.organizationUseTotp,this.edit=e.edit,this.viewPassword=e.viewPassword,this.permissions=e.permissions,this.type=e.type,this.localData=e.localData,this.collectionIds=e.collectionIds,this.revisionDate=e.revisionDate,this.creationDate=e.creationDate,this.deletedDate=e.deletedDate,this.archivedDate=e.archivedDate,this.reprompt=null!==(t=e.reprompt)&&void 0!==t?t:a.b.None,this.key=e.key):this.creationDate=this.revisionDate=new Date}get item(){switch(this.type){case o.gC.Login:return this.login;case o.gC.SecureNote:return this.secureNote;case o.gC.Card:return this.card;case o.gC.Identity:return this.identity;case o.gC.SshKey:return this.sshKey}}get subTitle(){var e;return null===(e=this.item)||void 0===e?void 0:e.subTitle}get hasPasswordHistory(){return this.passwordHistory&&this.passwordHistory.length>0}get hasLoginPassword(){var e;return this.type===o.gC.Login&&null!=(null===(e=this.login)||void 0===e?void 0:e.password)&&""!==this.login.password}get hasAttachments(){return!!this.attachments&&this.attachments.length>0}get hasOldAttachments(){if(this.hasAttachments)for(let e=0;e<this.attachments.length;e++)if(null==this.attachments[e].key&&null==this.attachments[e].encryptedKey)return!0;return!1}get hasFields(){return this.fields&&this.fields.length>0}get passwordRevisionDisplayDate(){if(this.type===o.gC.Login&&null!=this.login&&null!=this.login.password&&""!==this.login.password)return this.login.passwordRevisionDate}get isDeleted(){return null!=this.deletedDate}get isArchived(){return null!=this.archivedDate}get linkedFieldOptions(){var e;return null===(e=this.item)||void 0===e?void 0:e.linkedFieldOptions}get isUnassigned(){return null!=this.organizationId&&(null==this.collectionIds||0===this.collectionIds.length)}get canAssignToCollections(){return null==this.organizationId||this.edit&&this.viewPassword}get canLaunch(){return this.type===o.gC.Login&&this.login.canLaunch}linkedFieldValue(e){var t;const i=null===(t=this.linkedFieldOptions)||void 0===t?void 0:t.get(e),n=this.item;if(null!=i&&null!=n)return n[i.propertyKey]}toJSON(){return this}static fromJSON(e){var t,i,r,s,c,b,w,S,I,k,C,T,F,R,P,x,$,E;if(null==e)return null;const A=new y;if(A.type=null!==(t=e.type)&&void 0!==t?t:o.gC.Login,A.id=null!==(i=e.id)&&void 0!==i?i:"",A.organizationId=null!==(r=e.organizationId)&&void 0!==r?r:void 0,A.folderId=null!==(s=e.folderId)&&void 0!==s?s:void 0,A.collectionIds=null!==(c=e.collectionIds)&&void 0!==c?c:[],A.name=null!==(b=e.name)&&void 0!==b?b:"",A.notes=e.notes,A.edit=null!==(w=e.edit)&&void 0!==w&&w,A.viewPassword=null===(S=e.viewPassword)||void 0===S||S,A.favorite=null!==(I=e.favorite)&&void 0!==I&&I,A.organizationUseTotp=null!==(k=e.organizationUseTotp)&&void 0!==k&&k,A.localData=e.localData?e.localData:void 0,A.permissions=e.permissions?l.a.fromJSON(e.permissions):void 0,A.reprompt=null!==(C=e.reprompt)&&void 0!==C?C:a.b.None,A.decryptionFailure=null!==(T=e.decryptionFailure)&&void 0!==T&&T,e.creationDate&&(A.creationDate=new Date(e.creationDate)),e.revisionDate&&(A.revisionDate=new Date(e.revisionDate)),A.deletedDate=null==e.deletedDate?void 0:new Date(e.deletedDate),A.archivedDate=null==e.archivedDate?void 0:new Date(e.archivedDate),A.attachments=null!==(R=null===(F=e.attachments)||void 0===F?void 0:F.map(e=>d.$.fromJSON(e)))&&void 0!==R?R:[],A.fields=null!==(x=null===(P=e.fields)||void 0===P?void 0:P.map(e=>h.g.fromJSON(e)))&&void 0!==x?x:[],A.passwordHistory=null!==(E=null===($=e.passwordHistory)||void 0===$?void 0:$.map(e=>v.j.fromJSON(e)))&&void 0!==E?E:[],null!=e.key){let t;"string"==typeof e.key?t=n.k.fromJSON(e.key):e.key instanceof n.k&&(t=e.key),A.key=t}switch(e.type){case o.gC.Card:A.card=u.G.fromJSON(e.card);break;case o.gC.Identity:A.identity=p.O.fromJSON(e.identity);break;case o.gC.Login:A.login=m.r.fromJSON(e.login);break;case o.gC.SecureNote:A.secureNote=f.Z.fromJSON(e.secureNote);break;case o.gC.SshKey:A.sshKey=g.H.fromJSON(e.sshKey)}return A}static fromSdkCipherView(e){var t,i,s,b,w,S,I,k,C;if(null==e)return;const T=new y;switch(T.id=(0,r.zw)(e.id),T.organizationId=(0,r.zw)(e.organizationId),T.folderId=(0,r.zw)(e.folderId),T.name=e.name,T.notes=e.notes,T.type=e.type,T.favorite=e.favorite,T.organizationUseTotp=e.organizationUseTotp,T.permissions=e.permissions?l.a.fromSdkCipherPermissions(e.permissions):void 0,T.edit=e.edit,T.viewPassword=e.viewPassword,T.localData=(0,c.e)(e.localData),T.attachments=null!==(i=null===(t=e.attachments)||void 0===t?void 0:t.map(e=>d.$.fromSdkAttachmentView(e)))&&void 0!==i?i:[],T.fields=null!==(b=null===(s=e.fields)||void 0===s?void 0:s.map(e=>h.g.fromSdkFieldView(e)))&&void 0!==b?b:[],T.passwordHistory=null!==(S=null===(w=e.passwordHistory)||void 0===w?void 0:w.map(e=>v.j.fromSdkPasswordHistoryView(e)))&&void 0!==S?S:[],T.collectionIds=null!==(k=null===(I=e.collectionIds)||void 0===I?void 0:I.map(e=>(0,r.zw)(e)))&&void 0!==k?k:[],T.revisionDate=new Date(e.revisionDate),T.creationDate=new Date(e.creationDate),T.deletedDate=null==e.deletedDate?void 0:new Date(e.deletedDate),T.archivedDate=null==e.archivedDate?void 0:new Date(e.archivedDate),T.reprompt=null!==(C=e.reprompt)&&void 0!==C?C:a.b.None,T.key=e.key?n.k.fromJSON(e.key):void 0,e.type){case o.gC.Card:T.card=e.card?u.G.fromSdkCardView(e.card):new u.G;break;case o.gC.Identity:T.identity=e.identity?p.O.fromSdkIdentityView(e.identity):new p.O;break;case o.gC.Login:T.login=e.login?m.r.fromSdkLoginView(e.login):new m.r;break;case o.gC.SecureNote:T.secureNote=e.secureNote?f.Z.fromSdkSecureNoteView(e.secureNote):new f.Z;break;case o.gC.SshKey:T.sshKey=e.sshKey?g.H.fromSdkSshKeyView(e.sshKey):new g.H}return T}toSdkCipherView(){var e,t,i,n,s,l,d,u,h,p,m,v,f,g,y,b,w,S,I,k,C,T,F;const R={id:this.id?(0,r.WD)(this.id):void 0,organizationId:this.organizationId?(0,r.WD)(this.organizationId):void 0,folderId:this.folderId?(0,r.WD)(this.folderId):void 0,name:null!==(e=this.name)&&void 0!==e?e:"",notes:this.notes,type:null!==(t=this.type)&&void 0!==t?t:o.gC.Login,favorite:null!==(i=this.favorite)&&void 0!==i&&i,organizationUseTotp:null!==(n=this.organizationUseTotp)&&void 0!==n&&n,permissions:null===(s=this.permissions)||void 0===s?void 0:s.toSdkCipherPermissions(),edit:null===(l=this.edit)||void 0===l||l,viewPassword:null===(d=this.viewPassword)||void 0===d||d,localData:(0,c.H)(this.localData),attachments:null===(u=this.attachments)||void 0===u?void 0:u.map(e=>e.toSdkAttachmentView()),fields:null===(h=this.fields)||void 0===h?void 0:h.map(e=>e.toSdkFieldView()),passwordHistory:null===(p=this.passwordHistory)||void 0===p?void 0:p.map(e=>e.toSdkPasswordHistoryView()),collectionIds:null!==(v=null===(m=this.collectionIds)||void 0===m?void 0:m.map(e=>(0,r.WD)(e)))&&void 0!==v?v:[],revisionDate:(null!==(f=this.revisionDate)&&void 0!==f?f:new Date).toISOString(),creationDate:(null!==(g=this.creationDate)&&void 0!==g?g:new Date).toISOString(),deletedDate:null===(y=this.deletedDate)||void 0===y?void 0:y.toISOString(),archivedDate:null===(b=this.archivedDate)||void 0===b?void 0:b.toISOString(),reprompt:null!==(w=this.reprompt)&&void 0!==w?w:a.b.None,key:null===(S=this.key)||void 0===S?void 0:S.toSdk(),login:void 0,card:void 0,identity:void 0,secureNote:void 0,sshKey:void 0};switch(this.type){case o.gC.Card:R.card=null===(I=this.card)||void 0===I?void 0:I.toSdkCardView();break;case o.gC.Identity:R.identity=null===(k=this.identity)||void 0===k?void 0:k.toSdkIdentityView();break;case o.gC.Login:R.login=null===(C=this.login)||void 0===C?void 0:C.toSdkLoginView();break;case o.gC.SecureNote:R.secureNote=null===(T=this.secureNote)||void 0===T?void 0:T.toSdkSecureNoteView();break;case o.gC.SshKey:R.sshKey=null===(F=this.sshKey)||void 0===F?void 0:F.toSdkSshKeyView()}return R}}},76356:(e,t,i)=>{"use strict";i.d(t,{e:()=>l});var n=i(94573),r=i(33812),s=i(36288),o=i(43759),a=i(50700);class l{onClick(){this.toggled.update(e=>!e),this.toggledChange.emit(this.toggled()),this.update()}constructor(e,t,i){this.button=e,this.formField=t,this.i18nService=i,this.toggled=(0,n.geq)(!1),this.toggledChange=new r.bkB,this.title=this.i18nService.t("toggleVisibility"),this.label=this.i18nService.t("toggleVisibility")}get icon(){return this.toggled()?"bwi-eye-slash":"bwi-eye"}ngOnChanges(){this.update()}ngAfterContentInit(){const e=this.formField.input();(null==e?void 0:e.type)&&this.toggled.set("password"!==e.type()),this.button.icon.set(this.icon)}update(){var e;this.button.icon.set(this.icon);const t=this.formField.input();null!=(null==t?void 0:t.type)&&(t.type.set(this.toggled()?"text":"password"),null===(e=null==t?void 0:t.spellcheck)||void 0===e||e.set(!this.toggled()&&void 0))}}l.ɵfac=function(e){return new(e||l)(r.rXU(s.s,1),r.rXU(o.h),r.rXU(a.W))},l.ɵdir=r.FsC({type:l,selectors:[["","bitPasswordInputToggle",""]],hostVars:3,hostBindings:function(e,t){1&e&&r.bIt("click",function(){return t.onClick()}),2&e&&r.BMQ("aria-pressed",t.toggled())("title",t.title)("aria-label",t.label)},inputs:{toggled:[1,"toggled"]},outputs:{toggled:"toggledChange",toggledChange:"toggledChange"},features:[r.OA$]})},76506:(e,t,i)=>{"use strict";i.d(t,{S:()=>n});class n{constructor(e){null!=e&&(this.uri=e.uri,this.uriChecksum=e.uriChecksum,this.match=e.match)}}},76599:(e,t,i)=>{"use strict";i.d(t,{Y:()=>n});class n{}},77312:(e,t,i)=>{"use strict";i.d(t,{d:()=>n});class n{}},77665:(e,t,i)=>{"use strict";i.d(t,{L:()=>r});var n=i(55459);class r extends n.J{}},77720:(e,t,i)=>{"use strict";i.d(t,{D:()=>l});var n=i(17989),r=i(31442),s=i(24072),o=i(91304),a=i(11766);class l extends n.A{constructor(e){var t;super(),this.type=r.PU.Text,null!=e&&(this.type=e.type,this.linkedId=null!==(t=e.linkedId)&&void 0!==t?t:void 0,this.name=(0,s.e)(e.name),this.value=(0,s.e)(e.value))}decrypt(e){return this.decryptObj(this,new a.g(this),["name","value"],e)}toFieldData(){const e=new o.N;return this.buildDataModel(this,e,{name:null,value:null,type:null,linkedId:null},["type","linkedId"]),e}static fromJSON(e){var t,i;if(null==e)return;const n=new l;return n.type=null!==(t=e.type)&&void 0!==t?t:r.PU.Text,n.linkedId=null!==(i=e.linkedId)&&void 0!==i?i:void 0,n.name=(0,s.u)(e.name),n.value=(0,s.u)(e.value),n}toSdkField(){var e,t;return{name:null===(e=this.name)||void 0===e?void 0:e.toSdk(),value:null===(t=this.value)||void 0===t?void 0:t.toSdk(),type:(0,r.D1)(this.type),linkedId:(0,r.NI)(this.linkedId)}}static fromSdkField(e){if(null==e)return;const t=new l;return t.name=(0,s.u)(e.name),t.value=(0,s.u)(e.value),t.type=e.type,t.linkedId=e.linkedId,t}}},77723:(e,t,i)=>{"use strict";i.d(t,{n:()=>k});var n=i(66046),r=i(16878),s=i(88565),o=i(72245),a=i(44500),l=i(14803),c=i(67553),d=i(3633),u=i(39488),h=i(36501),p=i(55542),m=i(22166),v=i(24593),f=i(62819),g=i(33812),y=i(5556),b=i(21274),w=i(35500),S=i(50700),I=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class k{constructor(e,t,i,s,o,c,u,h,m){this.cipherService=e,this.dialogService=t,this.passwordRepromptService=i,this.organizationService=s,this.accountService=o,this.i18nService=c,this.syncService=u,this.cipherFormConfigService=h,this.adminConsoleCipherFormConfigService=m,this.isAdminConsoleActive=!1,this.loading=!1,this.hasLoaded=!1,this.ciphers=[],this.allCiphers=[],this.dataSource=new p.s,this.organization=void 0,this.organizations=[],this.filterStatus=[0],this.showFilterToggle=!1,this.vaultMsg="vault",this.currentFilterStatus=0,this.filterOrgStatus$=new r.t(0),this.destroyed$=new n.B,this.organizations$=this.accountService.activeAccount$.pipe(d.F6,(0,a.n)(e=>this.organizationService.organizations$(e))),this.organizations$.pipe((0,l.Q)(this.destroyed$)).subscribe(e=>{this.organizations=e})}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}getName(e){let t;return 0===e?t=this.i18nService.t("all"):1===e?t=this.i18nService.t("me"):this.organizations.filter(i=>{if(i.id===e)return t=i.name,i}),t}getCount(e){let t,i;return 0===e?i=this.allCiphers.length:1===e?i=this.allCiphers.filter(e=>!e.organizationId).length:(this.organizations.filter(i=>{if(i.id===e)return t=i.id,i}),i=this.allCiphers.filter(e=>e.organizationId===t).length),i}filterOrgToggle(e){return I(this,void 0,void 0,function*(){let t=e=>!0;if("number"==typeof e&&1===e)t=e=>!e.organizationId;else if("string"==typeof e){const i=e;t=e=>e.organizationId===i}this.dataSource.filter=t})}load(){return I(this,void 0,void 0,function*(){this.loading=!0,yield this.syncService.fullSync(!1),this.currentFilterStatus?this.ciphers.length>2?(this.filterOrgStatus$.next(this.currentFilterStatus),yield this.filterOrgToggle(this.currentFilterStatus)):(this.filterOrgStatus$.next(0),yield this.filterOrgToggle(0)):yield this.setCiphers(),this.loading=!1,this.hasLoaded=!0})}selectCipher(e){return I(this,void 0,void 0,function*(){if(yield this.repromptCipher(e))if(this.organization){const t=yield this.adminConsoleCipherFormConfigService.buildConfig("edit",e.id,e.type);yield this.openVaultItemDialog("view",t,e)}else{const t=yield this.cipherFormConfigService.buildConfig("edit",e.id,e.type);yield this.openVaultItemDialog("view",t,e)}})}openVaultItemDialog(e,t,i,n){return I(this,void 0,void 0,function*(){var r;const o=!!i&&(!i.edit&&!(null===(r=this.organization)||void 0===r?void 0:r.canEditAllCiphers));this.vaultItemDialogRef=v.V.open(this.dialogService,{mode:e,formConfig:t,activeCollectionId:n,disableForm:o});const a=yield(0,s.s)(this.vaultItemDialogRef.closed);this.vaultItemDialogRef=void 0,a!==v.r.PremiumUpgrade&&(a!==v.r.Deleted&&a!==v.r.Saved||(yield this.refresh(a,i)))})}setCiphers(){return I(this,void 0,void 0,function*(){this.allCiphers=[]})}refresh(e,t){return I(this,void 0,void 0,function*(){var i;if(e===v.r.Deleted)return yield this.determinedUpdatedCipherReportStatus(e,t),this.ciphers=this.ciphers.filter(e=>e.id!==t.id),void this.filterCiphersByOrg(this.ciphers);if(e==v.r.Saved){const n=yield(0,o._)(this.accountService.activeAccount$.pipe(d.F6));let r=yield this.cipherService.get(t.id,n);this.isAdminConsoleActive&&(r=null!==(i=yield this.adminConsoleCipherFormConfigService.getCipher(t.id,this.organization))&&void 0!==i?i:r);const s=yield r.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(r,n)),a=yield this.determinedUpdatedCipherReportStatus(e,s),l=this.ciphers.findIndex(e=>e.id===s.id);null===a&&this.ciphers.splice(l,1),null!==a&&l>-1&&(this.ciphers[l]=a),this.filterCiphersByOrg(this.ciphers)}})}determinedUpdatedCipherReportStatus(e,t){return I(this,void 0,void 0,function*(){return t})}repromptCipher(e){return I(this,void 0,void 0,function*(){return e.reprompt===h.b.None||(yield this.passwordRepromptService.showPasswordPrompt())})}getAllCiphers(){return I(this,void 0,void 0,function*(){const e=yield(0,o._)(this.accountService.activeAccount$.pipe(d.F6));return yield this.cipherService.getAllDecrypted(e)})}filterCiphersByOrg(e){this.allCiphers=[...e],this.ciphers=e.map(e=>(-1===this.filterStatus.indexOf(e.organizationId)&&null!=e.organizationId?this.filterStatus.push(e.organizationId):-1===this.filterStatus.indexOf(1)&&null==e.organizationId&&this.filterStatus.splice(1,0,1),e)),this.dataSource.data=this.ciphers,this.filterStatus.length>2?(this.showFilterToggle=!0,this.vaultMsg="vaults"):(this.showFilterToggle=!1,this.vaultMsg="vault")}}k.ɵfac=function(e){return new(e||k)(g.rXU(y.p),g.rXU(b.o3),g.rXU(m.qX),g.rXU(c.PV),g.rXU(w.Di),g.rXU(S.W),g.rXU(u.H),g.rXU(m.hI),g.rXU(f.l))},k.ɵdir=g.FsC({type:k})},77788:(e,t,i)=>{"use strict";i.d(t,{t:()=>s});var n=i(69580),r=i(20702);class s extends r.r{constructor(e){var t;super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.businessName=this.getResponseProperty("BusinessName"),this.businessAddress1=this.getResponseProperty("BusinessAddress1"),this.businessAddress2=this.getResponseProperty("BusinessAddress2"),this.businessAddress3=this.getResponseProperty("BusinessAddress3"),this.businessCountry=this.getResponseProperty("BusinessCountry"),this.businessTaxNumber=this.getResponseProperty("BusinessTaxNumber"),this.billingEmail=this.getResponseProperty("BillingEmail");const i=this.getResponseProperty("Plan");this.plan=null==i?null:new n.tQ(i),this.planType=this.getResponseProperty("PlanType"),this.seats=this.getResponseProperty("Seats"),this.maxAutoscaleSeats=this.getResponseProperty("MaxAutoscaleSeats"),this.maxCollections=this.getResponseProperty("MaxCollections"),this.maxStorageGb=this.getResponseProperty("MaxStorageGb"),this.useGroups=this.getResponseProperty("UseGroups"),this.useDirectory=this.getResponseProperty("UseDirectory"),this.useEvents=this.getResponseProperty("UseEvents"),this.useTotp=this.getResponseProperty("UseTotp"),this.use2fa=this.getResponseProperty("Use2fa"),this.useApi=this.getResponseProperty("UseApi"),this.useResetPassword=this.getResponseProperty("UseResetPassword"),this.useSecretsManager=this.getResponseProperty("UseSecretsManager"),this.hasPublicAndPrivateKeys=this.getResponseProperty("HasPublicAndPrivateKeys"),this.usePasswordManager=this.getResponseProperty("UsePasswordManager"),this.smSeats=this.getResponseProperty("SmSeats"),this.smServiceAccounts=this.getResponseProperty("SmServiceAccounts"),this.maxAutoscaleSmSeats=this.getResponseProperty("MaxAutoscaleSmSeats"),this.maxAutoscaleSmServiceAccounts=this.getResponseProperty("MaxAutoscaleSmServiceAccounts"),this.limitCollectionCreation=this.getResponseProperty("LimitCollectionCreation"),this.limitCollectionDeletion=this.getResponseProperty("LimitCollectionDeletion"),this.limitItemDeletion=this.getResponseProperty("LimitItemDeletion"),this.allowAdminAccessToAllCollectionItems=this.getResponseProperty("AllowAdminAccessToAllCollectionItems"),this.useAccessIntelligence=this.getResponseProperty("UseRiskInsights"),this.usePhishingBlocker=null!==(t=this.getResponseProperty("UsePhishingBlocker"))&&void 0!==t&&t}}},78070:(e,t,i)=>{"use strict";i.d(t,{G:()=>r,z:()=>s});var n=i(31857);const r=new n.Ok(n.dr,"vaultTimeoutAction",{deserializer:e=>e,clearOn:[]}),s=new n.Ok(n.dr,"vaultTimeout",{deserializer:e=>e,clearOn:[]})},78078:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{constructor(e){this.id=null,this.name=null,this.revisionDate=null,e&&(this.id=e.id,this.revisionDate=e.revisionDate)}static fromJSON(e){const t=null==e.revisionDate?null:new Date(e.revisionDate);return Object.assign(new n,e,{revisionDate:t})}}},78107:(e,t,i)=>{"use strict";i.d(t,{H:()=>r});var n=i(20702);class r extends n.r{constructor(e){var t;super(e),this.deviceVerified=null!==(t=this.getResponseProperty("DeviceVerified"))&&void 0!==t&&t}}},78212:(e,t,i)=>{"use strict";i.d(t,{QY:()=>He,O0:()=>gt,$t:()=>Qe,Fh:()=>Le,jN:()=>Me,qi:()=>O,jg:()=>dt,Yz:()=>oi,C7:()=>Qt,TP:()=>Mt});var n=i(77468),r=i(51757),s=i(66046),o=i(16878),a=i(25479),l=i(55159),c=i(72245),d=i(14803),u=i(36359),h=i(69194),p=i(44500),m=i(58363),v=i(58625),f=i(93241),g=i(46217),y=i(68333),b=i(81441),w=i(3633),S=i(11573),I=i(82468),k=i(56962),C=i(83516),T=i(49272),F=i(63457),R=i(29029),P=i(26411),x=i(37579),$=i(22191),E=i(5513),A=i(22848);const D=Object.freeze({MasterPassword:"masterPassword",Pin:"pin",Biometrics:"biometrics"});class O{}var M=i(74208),U=i(94573),G=i(33277),j=i(35500),N=i(17898),V=i(50700),B=i(69855),z=i(90107),L=i(33812),K=i(49519),q=i(57083),_=i(56898),X=i(86226),Y=i(97553),H=i(43759),W=i(76356),J=i(69896),Z=i(26657),Q=i(45154),ee=i(36288),te=i(88016),ie=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ne(e,t){if(1&e){const e=L.RV6();L.j41(0,"button",9),L.bIt("click",function(){M.eBV(e);const t=L.XpG();return M.Njj(t.activeUnlockOption.set(t.UnlockOption.Biometrics))}),L.j41(1,"span"),L.EFF(2),L.nI1(3,"i18n"),L.k0s()()}if(2&e){const e=L.XpG();L.Y8G("disabled",!e.biometricsAvailable()),L.R7$(2),L.SpI(" ",L.bMT(3,2,e.biometricUnlockBtnText()))}}function re(e,t){if(1&e){const e=L.RV6();L.j41(0,"button",10),L.bIt("click",function(){M.eBV(e);const t=L.XpG();return M.Njj(t.activeUnlockOption.set(t.UnlockOption.Pin))}),L.EFF(1),L.nI1(2,"i18n"),L.k0s()}2&e&&(L.R7$(),L.SpI(" ",L.bMT(2,1,"unlockWithPin")," "))}class se{constructor(){this.accountService=(0,M.WQX)(j.Di),this.masterPasswordUnlockService=(0,M.WQX)(N.b),this.i18nService=(0,M.WQX)(V.W),this.toastService=(0,M.WQX)(B.f),this.logService=(0,M.WQX)(z.Kc),this.UnlockOption=D,this.activeUnlockOption=U.geq.required(),this.unlockOptions=U.hFB.required(),this.biometricUnlockBtnText=U.hFB.required(),this.showPinSwap=(0,G.EW)(()=>{var e;return null!==(e=this.unlockOptions().pin.enabled)&&void 0!==e&&e}),this.biometricsAvailable=(0,G.EW)(()=>{var e;return null!==(e=this.unlockOptions().biometrics.enabled)&&void 0!==e&&e}),this.showBiometricsSwap=(0,G.EW)(()=>{const e=this.unlockOptions().biometrics.biometricsStatus;return e!==A.cR.PlatformUnsupported&&e!==A.cR.NotEnabledLocally}),this.successfulUnlock=(0,U.CGW)(),this.logOut=(0,U.CGW)(),this.formGroup=new r.gE({masterPassword:new r.MJ("",{validators:[r.k0.required],updateOn:"submit"})}),this.submit=()=>ie(this,void 0,void 0,function*(){this.formGroup.markAllAsTouched();const e=this.formGroup.controls.masterPassword.value;if(this.formGroup.invalid||!e)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("masterPasswordRequired")});const t=yield(0,c._)((0,w.F6)(this.accountService.activeAccount$));yield this.unlockViaMasterPassword(e,t)})}unlockViaMasterPassword(e,t){return ie(this,void 0,void 0,function*(){try{const i=yield this.masterPasswordUnlockService.unlockWithMasterPassword(e,t);this.successfulUnlock.emit({userKey:i,masterPassword:e})}catch(i){this.logService.error("[MasterPasswordLockComponent] Failed to unlock via master password",i),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidMasterPassword")})}})}}se.ɵfac=function(e){return new(e||se)},se.ɵcmp=L.VBU({type:se,selectors:[["bit-master-password-lock"]],inputs:{activeUnlockOption:[1,"activeUnlockOption"],unlockOptions:[1,"unlockOptions"],biometricUnlockBtnText:[1,"biometricUnlockBtnText"]},outputs:{activeUnlockOption:"activeUnlockOptionChange",successfulUnlock:"successfulUnlock",logOut:"logOut"},decls:19,vars:16,consts:[[3,"formGroup","bitSubmit"],["type","password","formControlName","masterPassword","bitInput","","appAutofocus","","name","masterPassword","required","","appInputVerbatim","",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],[1,"tw-flex","tw-flex-col","tw-space-y-3"],["type","submit","bitButton","","bitFormButton","","buttonType","primary","block",""],[1,"tw-text-center"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block",""],["type","button","bitButton","","bitFormButton","","block","",3,"click"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click","disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click"]],template:function(e,t){1&e&&(L.j41(0,"form",0)(1,"bit-form-field")(2,"bit-label"),L.EFF(3),L.nI1(4,"i18n"),L.k0s(),L.nrm(5,"input",1)(6,"button",2),L.k0s(),L.j41(7,"div",3)(8,"button",4),L.EFF(9),L.nI1(10,"i18n"),L.k0s(),L.j41(11,"p",5),L.EFF(12),L.nI1(13,"i18n"),L.k0s(),L.nVh(14,ne,4,4,"button",6),L.nVh(15,re,3,3,"button",7),L.j41(16,"button",8),L.bIt("click",function(){return t.logOut.emit()}),L.EFF(17),L.nI1(18,"i18n"),L.k0s()()()),2&e&&(L.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),L.R7$(3),L.JRh(L.bMT(4,8,"masterPass")),L.R7$(6),L.SpI(" ",L.bMT(10,10,"unlock")," "),L.R7$(3),L.JRh(L.bMT(13,12,"or")),L.R7$(2),L.vxM(t.showBiometricsSwap()?14:-1),L.R7$(),L.vxM(t.showPinSwap()?15:-1),L.R7$(2),L.SpI(" ",L.bMT(18,14,"logOut")," "))},dependencies:[v.p,K.B,q.q,r.X1,r.qT,r.me,r.BC,r.cb,r.YS,r.j4,r.JD,R.t,_.Q,P.L,X.j,Y.J,H.h,W.e,J.a,x.C,Z.$,Q.L,$.Q,ee.s,te.$],encapsulation:2});var oe=i(84101),ae=i(62166),le=i(37115),ce=i(23649),de=i(21274),ue=i(1221),he=i(83541),pe=i(39935),me=i(18499),ve=i(27650),fe=i(1601),ge=i(52396),ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function be(e,t){1&e&&(L.j41(0,"div",2),L.nrm(1,"i",3),L.k0s())}function we(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"button",10),L.bIt("click",function(){M.eBV(e);const t=L.XpG(3);return M.Njj(t.activeUnlockOption=t.UnlockOption.Pin)}),L.EFF(2),L.nI1(3,"i18n"),L.k0s(),L.bVm()}2&e&&(L.R7$(2),L.SpI(" ",L.bMT(3,1,"unlockWithPin")," "))}function Se(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"button",10),L.bIt("click",function(){M.eBV(e);const t=L.XpG(3);return M.Njj(t.activeUnlockOption=t.UnlockOption.MasterPassword)}),L.EFF(2),L.nI1(3,"i18n"),L.k0s(),L.bVm()}2&e&&(L.R7$(2),L.SpI(" ",L.bMT(3,1,"unlockWithMasterPassword")," "))}function Ie(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"button",6),L.bIt("click",function(){M.eBV(e);const t=L.XpG(2);return M.Njj(t.unlockViaBiometrics())}),L.j41(2,"span"),L.EFF(3),L.nI1(4,"i18n"),L.k0s()(),L.j41(5,"div",7)(6,"p",8),L.EFF(7),L.nI1(8,"i18n"),L.k0s(),L.DNE(9,we,4,3,"ng-container",4)(10,Se,4,3,"ng-container",4),L.j41(11,"button",9),L.bIt("click",function(){M.eBV(e);const t=L.XpG(2);return M.Njj(t.logOut())}),L.EFF(12),L.nI1(13,"i18n"),L.k0s()(),L.bVm()}if(2&e){const e=L.XpG(2);L.R7$(),L.Y8G("disabled",e.unlockingViaBiometrics||!e.biometricsAvailable)("loading",e.unlockingViaBiometrics)("bitTooltip",e.biometricUnavailabilityReason),L.R7$(2),L.SpI(" ",L.bMT(4,8,e.biometricUnlockBtnText)),L.R7$(4),L.JRh(L.bMT(8,10,"or")),L.R7$(2),L.Y8G("ngIf",e.unlockOptions.pin.enabled),L.R7$(),L.Y8G("ngIf",e.unlockOptions.masterPassword.enabled),L.R7$(2),L.SpI(" ",L.bMT(13,12,"logOut")," ")}}function ke(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"button",17),L.bIt("click",function(){M.eBV(e);const t=L.XpG(3);return M.Njj(t.activeUnlockOption=t.UnlockOption.Biometrics)}),L.j41(2,"span"),L.EFF(3),L.nI1(4,"i18n"),L.k0s()(),L.bVm()}if(2&e){const e=L.XpG(3);L.R7$(),L.Y8G("disabled",!e.biometricsAvailable),L.R7$(2),L.SpI(" ",L.bMT(4,2,e.biometricUnlockBtnText))}}function Ce(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"button",18),L.bIt("click",function(){M.eBV(e);const t=L.XpG(3);return M.Njj(t.activeUnlockOption=t.UnlockOption.MasterPassword)}),L.EFF(2),L.nI1(3,"i18n"),L.k0s(),L.bVm()}2&e&&(L.R7$(2),L.SpI(" ",L.bMT(3,1,"unlockWithMasterPassword")," "))}function Te(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"form",11)(2,"bit-form-field")(3,"bit-label"),L.EFF(4),L.nI1(5,"i18n"),L.k0s(),L.nrm(6,"input",12),L.j41(7,"button",13),L.mxI("toggledChange",function(t){M.eBV(e);const i=L.XpG(2);return L.DH7(i.showPassword,t)||(i.showPassword=t),M.Njj(t)}),L.k0s()(),L.j41(8,"div",7)(9,"button",14),L.EFF(10),L.nI1(11,"i18n"),L.k0s(),L.j41(12,"p",15),L.EFF(13),L.nI1(14,"i18n"),L.k0s(),L.DNE(15,ke,5,4,"ng-container",4)(16,Ce,4,3,"ng-container",4),L.j41(17,"button",16),L.bIt("click",function(){M.eBV(e);const t=L.XpG(2);return M.Njj(t.logOut())}),L.EFF(18),L.nI1(19,"i18n"),L.k0s()()(),L.bVm()}if(2&e){const e=L.XpG(2);L.R7$(),L.Y8G("bitSubmit",e.submit)("formGroup",e.formGroup),L.R7$(3),L.JRh(L.bMT(5,9,"pin")),L.R7$(3),L.R50("toggled",e.showPassword),L.R7$(3),L.SpI(" ",L.bMT(11,11,"unlock")," "),L.R7$(3),L.JRh(L.bMT(14,13,"or")),L.R7$(2),L.Y8G("ngIf",e.showBiometrics),L.R7$(),L.Y8G("ngIf",e.unlockOptions.masterPassword.enabled),L.R7$(2),L.SpI(" ",L.bMT(19,15,"logOut")," ")}}function Fe(e,t){if(1&e){const e=L.RV6();L.j41(0,"bit-master-password-lock",19),L.mxI("activeUnlockOptionChange",function(t){M.eBV(e);const i=L.XpG(2);return L.DH7(i.activeUnlockOption,t)||(i.activeUnlockOption=t),M.Njj(t)}),L.bIt("successfulUnlock",function(t){M.eBV(e);const i=L.XpG(2);return M.Njj(i.successfulMasterPasswordUnlock(t))})("logOut",function(){M.eBV(e);const t=L.XpG(2);return M.Njj(t.logOut())}),L.k0s()}if(2&e){const e=L.XpG(2);L.R50("activeUnlockOption",e.activeUnlockOption),L.Y8G("unlockOptions",e.unlockOptions)("biometricUnlockBtnText",e.biometricUnlockBtnText)}}function Re(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"button",17),L.bIt("click",function(){M.eBV(e);const t=L.XpG(4);return M.Njj(t.activeUnlockOption=t.UnlockOption.Biometrics)}),L.j41(2,"span"),L.EFF(3),L.nI1(4,"i18n"),L.k0s()(),L.bVm()}if(2&e){const e=L.XpG(4);L.R7$(),L.Y8G("disabled",!e.biometricsAvailable),L.R7$(2),L.SpI(" ",L.bMT(4,2,e.biometricUnlockBtnText))}}function Pe(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"button",18),L.bIt("click",function(){M.eBV(e);const t=L.XpG(4);return M.Njj(t.activeUnlockOption=t.UnlockOption.Pin)}),L.EFF(2),L.nI1(3,"i18n"),L.k0s(),L.bVm()}2&e&&(L.R7$(2),L.SpI(" ",L.bMT(3,1,"unlockWithPin")," "))}function xe(e,t){if(1&e){const e=L.RV6();L.qex(0),L.j41(1,"form",11)(2,"bit-form-field")(3,"bit-label"),L.EFF(4),L.nI1(5,"i18n"),L.k0s(),L.nrm(6,"input",20),L.j41(7,"button",13),L.mxI("toggledChange",function(t){M.eBV(e);const i=L.XpG(3);return L.DH7(i.showPassword,t)||(i.showPassword=t),M.Njj(t)}),L.k0s()(),L.j41(8,"div",7)(9,"button",14),L.EFF(10),L.nI1(11,"i18n"),L.k0s(),L.j41(12,"p",15),L.EFF(13),L.nI1(14,"i18n"),L.k0s(),L.DNE(15,Re,5,4,"ng-container",4)(16,Pe,4,3,"ng-container",4),L.j41(17,"button",16),L.bIt("click",function(){M.eBV(e);const t=L.XpG(3);return M.Njj(t.logOut())}),L.EFF(18),L.nI1(19,"i18n"),L.k0s()()(),L.bVm()}if(2&e){const e=L.XpG(3);L.R7$(),L.Y8G("bitSubmit",e.submit)("formGroup",e.formGroup),L.R7$(3),L.JRh(L.bMT(5,9,"masterPass")),L.R7$(3),L.R50("toggled",e.showPassword),L.R7$(3),L.SpI(" ",L.bMT(11,11,"unlock")," "),L.R7$(3),L.JRh(L.bMT(14,13,"or")),L.R7$(2),L.Y8G("ngIf",e.showBiometrics),L.R7$(),L.Y8G("ngIf",e.unlockOptions.pin.enabled),L.R7$(2),L.SpI(" ",L.bMT(19,15,"logOut")," ")}}function $e(e,t){if(1&e&&L.DNE(0,xe,20,17,"ng-container",4),2&e){const e=L.XpG(2);L.Y8G("ngIf",e.unlockOptions.masterPassword.enabled&&e.activeUnlockOption===e.UnlockOption.MasterPassword)}}function Ee(e,t){if(1&e&&(L.qex(0),L.DNE(1,Ie,14,14,"ng-container",4)(2,Te,20,17,"ng-container",4),L.nVh(3,Fe,1,3,"bit-master-password-lock",5),L.nI1(4,"async"),L.vZN(5,$e,1,1,"ng-container"),L.bVm()),2&e){const e=L.XpG();L.R7$(),L.Y8G("ngIf",e.activeUnlockOption===e.UnlockOption.Biometrics),L.R7$(),L.Y8G("ngIf",e.unlockOptions.pin.enabled&&e.activeUnlockOption===e.UnlockOption.Pin),L.R7$(),L.vxM(L.bMT(4,3,e.unlockWithMasterPasswordUnlockDataFlag$)&&e.unlockOptions.masterPassword.enabled&&e.activeUnlockOption===e.UnlockOption.MasterPassword?3:5)}}const Ae="LockComponent",De={[S.sK.Web]:"vault",[S.sK.Desktop]:"vault",[S.sK.Browser]:"/tabs/current"},Oe=[A.cR.HardwareUnavailable,A.cR.DesktopDisconnected,A.cR.NotEnabledInConnectedDesktopApp];class Me{set activeUnlockOption(e){this._activeUnlockOptionBSubject.next(e)}get activeUnlockOption(){return this._activeUnlockOptionBSubject.value}constructor(e,t,i,n,r,a,l,c,d,u,h,p,m,v,f,g,y,b,w,S,k,C,T,F,R,P,x,$){this.accountService=e,this.pinService=t,this.userVerificationService=i,this.keyService=n,this.platformUtilsService=r,this.router=a,this.activatedRoute=l,this.dialogService=c,this.messagingService=d,this.biometricStateService=u,this.ngZone=h,this.i18nService=p,this.masterPasswordService=m,this.logService=v,this.deviceTrustService=f,this.syncService=g,this.policyService=y,this.passwordStrengthService=b,this.formBuilder=w,this.toastService=S,this.userAsymmetricKeysRegenerationService=k,this.biometricService=C,this.logoutService=T,this.lockComponentService=F,this.anonLayoutWrapperDataService=R,this.encryptedMigrator=P,this.configService=x,this.broadcasterService=$,this.destroy$=new s.B,this.loading=!0,this.unlockWithMasterPasswordUnlockDataFlag$=this.configService.getFeatureFlag$(I.TO.UnlockWithMasterPasswordUnlockData),this.activeAccount=null,this.unlockOptions=null,this.UnlockOption=D,this._activeUnlockOptionBSubject=new o.t(null),this.activeUnlockOption$=this._activeUnlockOptionBSubject.asObservable(),this.invalidPinAttempts=0,this.showPassword=!1,this.enforcedMasterPasswordOptions=void 0,this.formGroup=null,this.shouldClosePopout=!1,this.deferFocus=null,this.biometricAsked=!1,this.defaultUnlockOptionSetForUser=!1,this.unlockingViaBiometrics=!1,this.submit=()=>ye(this,void 0,void 0,function*(){if(this.activeUnlockOption===D.Pin)return yield this.unlockViaPin();yield this.unlockViaMasterPassword()})}ngOnInit(){return ye(this,void 0,void 0,function*(){this.listenForActiveUnlockOptionChanges(),this.listenForActiveAccountChanges(),this.listenForUnlockOptionsChanges(),this.clientType=this.platformUtilsService.getClientType(),this.clientType===S.sK.Desktop?yield this.desktopOnInit():this.clientType===S.sK.Browser&&(this.biometricUnlockBtnText=this.lockComponentService.getBiometricsUnlockBtnText())})}listenForUnlockOptionsChanges(){(0,a.Y)(1e3).pipe((0,l.Z)(()=>ye(this,void 0,void 0,function*(){var e;null!=(null===(e=this.activeAccount)||void 0===e?void 0:e.id)&&(this.unlockOptions=yield(0,c._)(this.lockComponentService.getAvailableUnlockOptions$(this.activeAccount.id)),null==this.activeUnlockOption&&(this.loading=!1,yield this.setDefaultActiveUnlockOption(this.unlockOptions)))})),(0,d.Q)(this.destroy$)).subscribe()}listenForActiveUnlockOptionChanges(){this.activeUnlockOption$.pipe((0,d.Q)(this.destroy$)).subscribe(e=>{e===D.Pin?this.buildPinForm():e===D.MasterPassword&&this.buildMasterPasswordForm()})}buildMasterPasswordForm(){this.formGroup=this.formBuilder.group({masterPassword:["",[r.k0.required]]},{updateOn:"submit"})}buildPinForm(){this.formGroup=this.formBuilder.group({pin:["",[r.k0.required]]},{updateOn:"submit"})}listenForActiveAccountChanges(){this.accountService.activeAccount$.pipe((0,u.M)(e=>{this.loading=!0,this.activeAccount=e,this.resetDataOnActiveAccountChange()}),(0,h.p)(e=>null!=e),(0,p.n)(e=>ye(this,void 0,void 0,function*(){yield this.handleActiveAccountChange(e),this.loading=!1})),(0,d.Q)(this.destroy$)).subscribe()}handleActiveAccountChange(e){return ye(this,void 0,void 0,function*(){var t,i,n;if(yield this.keyService.hasUserKey(e.id))return;this.setEmailAsPageSubtitle(e.email),this.unlockOptions=yield(0,c._)(this.lockComponentService.getAvailableUnlockOptions$(e.id));const r=[A.cR.Available,...Oe].includes(yield this.biometricService.getBiometricsStatusForUser(e.id));if(!(null===(t=this.unlockOptions)||void 0===t?void 0:t.masterPassword.enabled)&&!(null===(i=this.unlockOptions)||void 0===i?void 0:i.pin.enabled)&&!r)return this.logService.warning("[LockComponent] User cannot unlock again. Logging out!"),void(yield this.logoutService.logout(e.id));yield this.setDefaultActiveUnlockOption(this.unlockOptions),(null===(n=this.unlockOptions)||void 0===n?void 0:n.biometrics.enabled)&&(yield this.handleBiometricsUnlockEnabled())})}resetDataOnActiveAccountChange(){this.defaultUnlockOptionSetForUser=!1,this.unlockOptions=null,this.activeUnlockOption=null,this.formGroup=null,this.biometricAsked=!1}setEmailAsPageSubtitle(e){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:e})}setDefaultActiveUnlockOption(e){return ye(this,void 0,void 0,function*(){(null==e?void 0:e.biometrics.enabled)?this.activeUnlockOption=D.Biometrics:(null==e?void 0:e.pin.enabled)?this.activeUnlockOption=D.Pin:(null==e?void 0:e.masterPassword.enabled)?this.activeUnlockOption=D.MasterPassword:null!=e&&Oe.includes(e.biometrics.biometricsStatus)&&(this.activeUnlockOption=D.Biometrics)})}handleBiometricsUnlockEnabled(){return ye(this,void 0,void 0,function*(){var e;this.biometricUnlockBtnText=this.lockComponentService.getBiometricsUnlockBtnText();const t=yield(0,c._)(this.biometricStateService.promptAutomatically$);if("desktop"===this.clientType&&t&&(this.loading=!1,yield this.desktopAutoPromptBiometrics()),"browser"===this.clientType&&(null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics.enabled)&&t&&(yield this.biometricService.getShouldAutopromptNow())){yield this.biometricService.setShouldAutopromptNow(!1);const e=yield this.biometricStateService.getLastProcessReload();(null==e||isNaN(e.getTime())||Date.now()-e.getTime()>5e3)&&(this.platformUtilsService.getDevice()===S.bq.FirefoxExtension&&(yield this.lockComponentService.popOutBrowserExtension(),this.shouldClosePopout=!0),this.loading=!1,yield this.unlockViaBiometrics())}})}logOut(){return ye(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}))&&null!=this.activeAccount&&(yield this.logoutService.logout(this.activeAccount.id),yield this.router.navigate(["/"]))})}unlockViaBiometrics(){return ye(this,void 0,void 0,function*(){if(this.unlockingViaBiometrics=!0,null!=this.unlockOptions&&this.unlockOptions.biometrics.enabled&&null!=this.activeAccount)try{yield this.biometricStateService.setUserPromptCancelled();const e=yield this.biometricService.unlockWithBiometricsForUser(this.activeAccount.id);e&&(yield this.setUserKeyAndContinue(e)),this.unlockingViaBiometrics=!1}catch(e){if(e instanceof Error&&"canceled"===e.message)return void(this.unlockingViaBiometrics=!1);let t;if(this.logService.error("[LockComponent] Failed to unlock via biometrics.",e),"browser"===this.clientType){const i=this.lockComponentService.getBiometricsError(e);i&&(t=this.i18nService.t(i))}t||(t=this.i18nService.t("unexpectedError"));(yield this.dialogService.openSimpleDialog({title:{key:"error"},content:t,acceptButtonText:{key:"tryAgain"},type:"danger"}))&&(yield this.unlockViaBiometrics()),this.unlockingViaBiometrics=!1}else this.unlockingViaBiometrics=!1})}togglePassword(){var e;this.showPassword=!this.showPassword;const t=document.getElementById((null===(e=this.unlockOptions)||void 0===e?void 0:e.pin.enabled)?"pin":"masterPassword");null!=t&&(this.ngZone.isStable?t.focus():this.ngZone.onStable.pipe((0,m.s)(1)).subscribe(()=>t.focus()))}validatePin(){var e;return!(null===(e=this.formGroup)||void 0===e?void 0:e.invalid)||(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("pinRequired")}),!1)}unlockViaPin(){return ye(this,void 0,void 0,function*(){if(!this.validatePin()||null==this.formGroup||null==this.activeAccount)return;const e=this.formGroup.controls.pin.value;try{const t=yield this.pinService.decryptUserKeyWithPin(e,this.activeAccount.id);if(t)return void(yield this.setUserKeyAndContinue(t));if(this.invalidPinAttempts++,this.invalidPinAttempts>=5)return this.toastService.showToast({variant:"error",message:this.i18nService.t("tooManyInvalidPinEntryAttemptsLoggingOut")}),void this.messagingService.send("logout");this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidPin")})}catch(t){this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("unexpectedError")})}})}validateMasterPassword(){var e;return!(null===(e=this.formGroup)||void 0===e?void 0:e.invalid)||(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("masterPasswordRequired")}),!1)}unlockViaMasterPassword(){return ye(this,void 0,void 0,function*(){if(!this.validateMasterPassword()||null==this.formGroup||null==this.activeAccount)return;const e=this.formGroup.controls.masterPassword.value,t={type:y.k.MasterPassword,secret:e};let i=!1,n=null;try{n=yield this.userVerificationService.verifyUserByMasterPassword(t,this.activeAccount.id,this.activeAccount.email),null!=(null==n?void 0:n.policyOptions)?this.enforcedMasterPasswordOptions=g.U.fromResponse(n.policyOptions):this.enforcedMasterPasswordOptions=void 0,i=!0}catch(s){this.logService.error(s)}if(!i)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidMasterPassword")});const r=yield this.masterPasswordService.decryptUserKeyWithMasterKey(n.masterKey,this.activeAccount.id);null!=r?yield this.setUserKeyAndContinue(r,{passwordEvaluation:{masterPassword:e}}):this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidMasterPassword")})})}successfulMasterPasswordUnlock(e){return ye(this,void 0,void 0,function*(){null!=e.userKey&&e.masterPassword?yield this.setUserKeyAndContinue(e.userKey,{passwordEvaluation:{masterPassword:e.masterPassword}}):this.logService.error("[LockComponent] successfulMasterPasswordUnlock called with invalid data.")})}setUserKeyAndContinue(e){return ye(this,arguments,void 0,function*(e,t={}){if(null==this.activeAccount)throw new Error("No active user.");this.logService.mark("Vault unlocked"),yield this.keyService.setUserKey(e,this.activeAccount.id),yield this.pinService.userUnlocked(this.activeAccount.id),yield this.deviceTrustService.trustDeviceIfRequired(this.activeAccount.id),yield this.doContinue(t)})}doContinue(e){return ye(this,void 0,void 0,function*(){var t,i,n;if(null==this.activeAccount)throw new Error("No active user.");yield this.biometricStateService.resetUserPromptCancelled();try{yield this.encryptedMigrator.runMigrations(this.activeAccount.id,null!==(i=null===(t=e.passwordEvaluation)||void 0===t?void 0:t.masterPassword)&&void 0!==i?i:null)}catch(o){}if(this.messagingService.send("unlocked"),e.passwordEvaluation){const t=null===(n=yield(0,c._)(this.accountService.activeAccount$))||void 0===n?void 0:n.id;if(null==t)throw new Error("No active user.");try{null==this.enforcedMasterPasswordOptions&&(this.enforcedMasterPasswordOptions=yield(0,c._)(this.accountService.activeAccount$.pipe(w.F6,(0,p.n)(e=>this.policyService.masterPasswordPolicyOptions$(e))))),this.requirePasswordChange(e.passwordEvaluation.masterPassword)&&(yield this.masterPasswordService.setForceSetPasswordReason(b.n.WeakMasterPassword,t))}catch(a){this.logService.error(a)}}const r=(new Date).getTime();yield this.syncService.fullSync(!1),this.logService.info(`[LockComponent] Sync took ${(new Date).getTime()-r}ms`);const s=(new Date).getTime();if(yield this.userAsymmetricKeysRegenerationService.regenerateIfNeeded(this.activeAccount.id),this.logService.info(`[LockComponent] Private key regeneration took ${(new Date).getTime()-s}ms`),"browser"===this.clientType){const e=this.lockComponentService.getPreviousUrl();if(e)return void(yield this.router.navigateByUrl(e))}if(null!=this.clientType&&null===this.activatedRoute.snapshot.paramMap.get("disable-redirect")){const e=De[this.clientType];yield this.router.navigate([e])}this.shouldClosePopout&&this.platformUtilsService.getDevice()===S.bq.FirefoxExtension&&this.lockComponentService.closeBrowserExtensionPopout()})}requirePasswordChange(e){var t;if(null==this.enforcedMasterPasswordOptions||!this.enforcedMasterPasswordOptions.enforceOnLogin||null==this.activeAccount)return!1;const i=null===(t=this.passwordStrengthService.getPasswordStrength(e,this.activeAccount.email))||void 0===t?void 0:t.score;return!this.policyService.evaluateMasterPassword(i,e,this.enforcedMasterPasswordOptions)}desktopOnInit(){return ye(this,void 0,void 0,function*(){this.biometricUnlockBtnText=this.lockComponentService.getBiometricsUnlockBtnText(),this.broadcasterService.subscribe(Ae,e=>ye(this,void 0,void 0,function*(){this.ngZone.run(()=>{switch(e.command){case"windowHidden":this.onWindowHidden();break;case"windowIsFocused":null===this.deferFocus?(this.deferFocus=!e.windowIsFocused,this.deferFocus||this.focusInput()):this.deferFocus&&e.windowIsFocused&&(this.focusInput(),this.deferFocus=!1)}})})),this.messagingService.send("getWindowIsFocused")})}desktopAutoPromptBiometrics(){return ye(this,void 0,void 0,function*(){var e,t;if(!(null===(t=null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics)||void 0===t?void 0:t.enabled)||this.biometricAsked)return;if(!(yield this.biometricService.getShouldAutopromptNow()))return;if(yield(0,c._)(this.biometricStateService.promptCancelled$))return;(yield this.lockComponentService.isWindowVisible())&&(this.biometricAsked=!0,yield this.unlockViaBiometrics())})}onWindowHidden(){this.showPassword=!1}focusInput(){var e;this.unlockOptions&&(null===(e=document.getElementById(this.unlockOptions.pin.enabled?"pin":"masterPassword"))||void 0===e||e.focus())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),"desktop"===this.clientType&&this.broadcasterService.unsubscribe(Ae)}get biometricsAvailable(){var e,t;return null!==(t=null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics.enabled)&&void 0!==t&&t}get showBiometrics(){return null!=this.unlockOptions&&(this.unlockOptions.biometrics.biometricsStatus!==A.cR.PlatformUnsupported&&this.unlockOptions.biometrics.biometricsStatus!==A.cR.NotEnabledLocally)}get biometricUnavailabilityReason(){var e,t,i,n;switch(null===(e=this.unlockOptions)||void 0===e?void 0:e.biometrics.biometricsStatus){case A.cR.Available:return"";case A.cR.UnlockNeeded:return this.i18nService.t("biometricsStatusHelptextUnlockNeeded");case A.cR.HardwareUnavailable:return this.i18nService.t("biometricsStatusHelptextHardwareUnavailable");case A.cR.AutoSetupNeeded:return this.i18nService.t("biometricsStatusHelptextAutoSetupNeeded");case A.cR.ManualSetupNeeded:return this.i18nService.t("biometricsStatusHelptextManualSetupNeeded");case A.cR.NotEnabledInConnectedDesktopApp:return this.i18nService.t("biometricsStatusHelptextNotEnabledInDesktop",null===(t=this.activeAccount)||void 0===t?void 0:t.email);case A.cR.NotEnabledLocally:return this.i18nService.t("biometricsStatusHelptextNotEnabledInDesktop",null===(i=this.activeAccount)||void 0===i?void 0:i.email);case A.cR.DesktopDisconnected:return this.i18nService.t("biometricsStatusHelptextDesktopDisconnected");default:return this.i18nService.t("biometricsStatusHelptextUnavailableReasonUnknown")+(null===(n=this.unlockOptions)||void 0===n?void 0:n.biometrics.biometricsStatus)}}}Me.ɵfac=function(e){return new(e||Me)(L.rXU(j.Di),L.rXU(oe.t),L.rXU(ae.i),L.rXU(A.Lu),L.rXU(le.y),L.rXU(ce.Ix),L.rXU(ce.nX),L.rXU(de.o3),L.rXU(C.U),L.rXU(A.vB),L.rXU(L.SKi),L.rXU(V.W),L.rXU(he.O),L.rXU(k.K),L.rXU(pe.M),L.rXU(T.H),L.rXU(me.N),L.rXU(F.Q),L.rXU(r.ok),L.rXU(B.f),L.rXU(A.wM),L.rXU(A.Zm),L.rXU(f.k4),L.rXU(O),L.rXU(ue.f),L.rXU(ve.G),L.rXU(fe.w),L.rXU(ge.y))},Me.ɵcmp=L.VBU({type:Me,selectors:[["bit-lock"]],decls:3,vars:2,consts:[["spinner",""],[4,"ngIf","ngIfElse"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[4,"ngIf"],[3,"activeUnlockOption","unlockOptions","biometricUnlockBtnText"],["type","button","bitButton","","appAutofocus","","buttonType","primary","block","",1,"tw-mb-3",3,"click","disabled","loading","bitTooltip"],[1,"tw-flex","tw-flex-col","tw-space-y-3"],[1,"tw-text-center","tw-mb-0"],["type","button","bitButton","","block","",3,"click"],["type","button","bitButton","","buttonType","secondary","block","",3,"click"],[3,"bitSubmit","formGroup"],["type","password","formControlName","pin","bitInput","","appAutofocus","","name","pin","required","","appInputVerbatim","",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggledChange","toggled"],["type","submit","bitButton","","bitFormButton","","buttonType","primary","block",""],[1,"tw-text-center"],["type","button","bitButton","","bitFormButton","","block","",3,"click"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click","disabled"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","block","",3,"click"],[3,"activeUnlockOptionChange","successfulUnlock","logOut","activeUnlockOption","unlockOptions","biometricUnlockBtnText"],["type","password","formControlName","masterPassword","bitInput","","appAutofocus","","name","masterPassword","required","","appInputVerbatim","",1,"tw-font-mono"]],template:function(e,t){if(1&e&&L.DNE(0,be,2,0,"ng-template",null,0,L.C5r)(2,Ee,6,5,"ng-container",1),2&e){const e=L.sdS(1);L.R7$(2),L.Y8G("ngIf",t.unlockOptions&&!t.loading)("ngIfElse",e)}},dependencies:[n.MD,n.bT,v.p,K.B,q.q,r.X1,r.qT,r.me,r.BC,r.cb,r.YS,r.j4,r.JD,R.t,_.Q,P.L,X.j,Y.J,H.h,W.e,J.a,x.C,Z.$,Q.L,$.Q,ee.s,se,E.d,n.Jj,te.$],encapsulation:2});var Ue=i(81525),Ge=i(81573),je=i(7730),Ne=i(68016),Ve=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Be(e,t){if(1&e&&(L.j41(0,"li"),L.EFF(1),L.nI1(2,"i18n"),L.k0s()),2&e){const e=L.XpG();L.R7$(),L.SpI(" ",L.i5U(2,1,"userkeyRotationDisclaimerAccountRecoveryOrgsText",e.params.orgName)," ")}}function ze(e,t){if(1&e&&(L.j41(0,"li"),L.EFF(1),L.nI1(2,"i18n"),L.k0s()),2&e){const e=L.XpG();L.R7$(),L.SpI(" ",L.i5U(2,1,"userkeyRotationDisclaimerEmergencyAccessText",e.params.numberOfEmergencyAccessUsers)," ")}}class Le{constructor(e,t,i){this.params=e,this.logService=t,this.dialogRef=i}submit(){return Ve(this,void 0,void 0,function*(){try{this.dialogRef.close(!0)}catch(e){this.logService.error(e)}})}static open(e,t){return e.open(Le,{data:t})}}Le.ɵfac=function(e){return new(e||Le)(L.rXU(Ue.Qs),L.rXU(k.K),L.rXU(Ue.ce))},Le.ɵcmp=L.VBU({type:Le,selectors:[["key-rotation-trust-info"]],decls:18,vars:14,consts:[["dialogSize","large"],["bitDialogTitle",""],["bitDialogContent",""],[1,"tw-mt-2","tw-mb-0","tw-pl-4"],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","target","_blank","rel","noreferrer","buttonType","primary",3,"click"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(L.j41(0,"bit-dialog",0)(1,"span",1)(2,"strong"),L.EFF(3),L.nI1(4,"i18n"),L.k0s()(),L.j41(5,"span",2),L.EFF(6),L.nI1(7,"i18n"),L.j41(8,"ul",3),L.DNE(9,Be,3,4,"li",4)(10,ze,3,4,"li",4),L.k0s()(),L.qex(11,5),L.j41(12,"a",6),L.bIt("click",function(){return t.submit()}),L.EFF(13),L.nI1(14,"i18n"),L.k0s(),L.j41(15,"button",7),L.EFF(16),L.nI1(17,"i18n"),L.k0s(),L.bVm(),L.k0s()),2&e&&(L.R7$(3),L.SpI(" ",L.bMT(4,6,"userkeyRotationDisclaimerTitle")," "),L.R7$(3),L.SpI(" ",L.bMT(7,8,"userkeyRotationDisclaimerDescription")," "),L.R7$(3),L.Y8G("ngIf",null!=t.params.orgName),L.R7$(),L.Y8G("ngIf",t.params.numberOfEmergencyAccessUsers>0),L.R7$(3),L.SpI(" ",L.bMT(14,10,"continue")," "),L.R7$(3),L.SpI(" ",L.bMT(17,12,"close")," "))},dependencies:[n.MD,n.bT,v.p,Ge.P,je.I,Ne.m,R.t,_.Q,r.X1,x.C,r.YN,te.$],encapsulation:2});var Ke=i(26477),qe=i(75583),_e=i(80351),Xe=i(58806),Ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class He{constructor(e,t,i,n,r){this.params=e,this.formBuilder=t,this.keyService=i,this.logService=n,this.dialogRef=r,this.loading=!0,this.fingerprint="",this.confirmForm=this.formBuilder.group({})}ngOnInit(){return Ye(this,void 0,void 0,function*(){try{const e=yield this.keyService.getFingerprint(this.params.orgId,this.params.publicKey);null!=e&&(this.fingerprint=e.join("-"))}catch(e){this.logService.error(e)}this.loading=!1})}submit(){return Ye(this,void 0,void 0,function*(){this.loading||this.dialogRef.close(!0)})}static open(e,t){return e.open(He,{data:t})}}He.ɵfac=function(e){return new(e||He)(L.rXU(Ue.Qs),L.rXU(r.ok),L.rXU(A.Lu),L.rXU(k.K),L.rXU(Ue.ce))},He.ɵcmp=L.VBU({type:He,selectors:[["account-recovery-trust"]],decls:20,vars:18,consts:[["dialogSize","large",3,"loading","title","subtitle"],["bitDialogContent",""],["bitTypography","body1"],["bitDialogFooter",""],["buttonType","primary","bitButton","","bitFormButton","","type","button",3,"click"],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""]],template:function(e,t){1&e&&(L.j41(0,"bit-dialog",0),L.nI1(1,"i18n"),L.qex(2,1),L.j41(3,"p",2),L.EFF(4),L.nI1(5,"i18n"),L.nrm(6,"br")(7,"br"),L.EFF(8),L.nI1(9,"i18n"),L.j41(10,"code"),L.EFF(11),L.k0s()(),L.bVm(),L.qex(12,3),L.j41(13,"button",4),L.bIt("click",function(){return t.submit()}),L.j41(14,"span"),L.EFF(15),L.nI1(16,"i18n"),L.k0s()(),L.j41(17,"button",5),L.EFF(18),L.nI1(19,"i18n"),L.k0s(),L.bVm(),L.k0s()),2&e&&(L.Y8G("loading",t.loading)("title",L.bMT(1,8,"trustOrganization"))("subtitle",t.params.name),L.R7$(4),L.SpI(" ",L.bMT(5,10,"orgTrustWarning1")," "),L.R7$(4),L.SpI(" ",L.bMT(9,12,"fingerprintPhrase")," "),L.R7$(3),L.JRh(t.fingerprint),L.R7$(4),L.JRh(L.bMT(16,14,"trust")),L.R7$(3),L.SpI(" ",L.bMT(19,16,"doNotTrust")," "))},dependencies:[n.MD,v.p,Ge.P,je.I,Ne.m,R.t,_.Q,Ke.V,qe.E,Xe.r,r.X1,P.L,x.C,Z.$,r.YN,_e.j,te.$],encapsulation:2});var We=i(59032),Je=i(44432),Ze=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Qe{constructor(e,t,i,n,r){this.params=e,this.formBuilder=t,this.keyService=i,this.logService=n,this.dialogRef=r,this.loading=!0,this.fingerprint="",this.confirmForm=this.formBuilder.group({})}ngOnInit(){return Ze(this,void 0,void 0,function*(){try{const e=yield this.keyService.getFingerprint(this.params.userId,this.params.publicKey);null!=e&&(this.fingerprint=e.join("-"))}catch(e){this.logService.error(e)}this.loading=!1})}submit(){return Ze(this,void 0,void 0,function*(){this.loading||this.dialogRef.close(!0)})}static open(e,t){return e.open(Qe,{data:t})}}Qe.ɵfac=function(e){return new(e||Qe)(L.rXU(Ue.Qs),L.rXU(r.ok),L.rXU(A.Lu),L.rXU(k.K),L.rXU(Ue.ce))},Qe.ɵcmp=L.VBU({type:Qe,selectors:[["emergency-access-trust"]],decls:23,vars:21,consts:[["dialogSize","large",3,"loading","title","subtitle"],["bitDialogContent",""],["type","warning"],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noopener"],["bitDialogFooter",""],["buttonType","primary","bitButton","","bitFormButton","","type","button",3,"click"],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""]],template:function(e,t){1&e&&(L.j41(0,"bit-dialog",0),L.nI1(1,"i18n"),L.qex(2,1),L.j41(3,"bit-callout",2),L.EFF(4),L.nI1(5,"i18n"),L.k0s(),L.j41(6,"p",3),L.EFF(7),L.nI1(8,"i18n"),L.j41(9,"a",4),L.EFF(10),L.nI1(11,"i18n"),L.k0s()(),L.j41(12,"p",3)(13,"code"),L.EFF(14),L.k0s()(),L.bVm(),L.qex(15,5),L.j41(16,"button",6),L.bIt("click",function(){return t.submit()}),L.j41(17,"span"),L.EFF(18),L.nI1(19,"i18n"),L.k0s()(),L.j41(20,"button",7),L.EFF(21),L.nI1(22,"i18n"),L.k0s(),L.bVm(),L.k0s()),2&e&&(L.Y8G("loading",t.loading)("title",L.bMT(1,9,"trustUser"))("subtitle",t.params.name),L.R7$(4),L.JRh(L.bMT(5,11,"emergencyAccessTrustWarning")),L.R7$(3),L.SpI(" ",L.bMT(8,13,"fingerprintEnsureIntegrityVerify")," "),L.R7$(3),L.SpI(" ",L.bMT(11,15,"learnMore")),L.R7$(4),L.JRh(t.fingerprint),L.R7$(4),L.JRh(L.bMT(19,17,"trust")),L.R7$(3),L.SpI(" ",L.bMT(22,19,"doNotTrust")," "))},dependencies:[n.MD,v.p,Ge.P,je.I,Ne.m,R.t,_.Q,Ke.V,We.L,qe.E,Xe.r,r.X1,P.L,x.C,Z.$,r.YN,_e.j,Je.G,te.$],encapsulation:2});var et=i(7861),tt=i(78781),it=i(39488),nt=i(3892),rt=i(36801),st=i(52057),ot=i(11224),at=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function lt(e,t){1&e&&(L.j41(0,"div",0),L.nrm(1,"i",1),L.nI1(2,"i18n"),L.j41(3,"span",2),L.EFF(4),L.nI1(5,"i18n"),L.k0s()()),2&e&&(L.R7$(),L.Y8G("title",L.mNQ(L.bMT(2,3,"loading"))),L.R7$(3),L.JRh(L.bMT(5,5,"loading")))}function ct(e,t){if(1&e&&(L.j41(0,"p"),L.EFF(1),L.nI1(2,"i18n"),L.k0s(),L.j41(3,"p",3),L.EFF(4),L.nI1(5,"i18n"),L.k0s(),L.j41(6,"p",4),L.EFF(7),L.k0s(),L.j41(8,"p",5),L.EFF(9),L.nI1(10,"i18n"),L.nrm(11,"button",6),L.nI1(12,"i18n"),L.k0s(),L.j41(13,"p",7),L.EFF(14),L.k0s(),L.j41(15,"div",8)(16,"button",9),L.EFF(17),L.nI1(18,"i18n"),L.k0s(),L.j41(19,"button",10),L.EFF(20),L.nI1(21,"i18n"),L.k0s()()),2&e){const e=L.XpG();L.R7$(),L.JRh(L.bMT(2,12,"removeMasterPasswordForOrgUserKeyConnector")),L.R7$(3),L.JRh(L.bMT(5,14,"organization")),L.R7$(3),L.JRh(e.organization.name),L.R7$(2),L.SpI(" ",L.bMT(10,16,"domain")," "),L.R7$(2),L.Y8G("label",L.bMT(12,18,"keyConnectorDomainTooltip")),L.R7$(3),L.JRh(e.keyConnectorHostName),L.R7$(2),L.Y8G("block",!0)("bitAction",e.convert),L.R7$(),L.SpI(" ",L.bMT(18,20,"continueWithLogIn")," "),L.R7$(2),L.Y8G("block",!0)("bitAction",e.leave),L.R7$(),L.SpI(" ",L.bMT(21,22,"doNotContinue")," ")}}class dt{constructor(e,t,i,n,r,s,o,a,l){this.logService=e,this.router=t,this.accountService=i,this.syncService=n,this.i18nService=r,this.keyConnectorService=s,this.organizationApiService=o,this.dialogService=a,this.toastService=l,this.continuing=!1,this.leaving=!1,this.loading=!0,this.convert=()=>at(this,void 0,void 0,function*(){this.continuing=!0;try{yield this.keyConnectorService.migrateUser(this.organization.keyConnectorUrl,this.activeUserId),this.toastService.showToast({variant:"success",message:this.i18nService.t("organizationVerified")}),yield this.router.navigate(["/"])}catch(e){this.continuing=!1,this.handleActionError(e)}}),this.leave=()=>at(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"leaveOrganization"},content:{key:"leaveOrganizationContent"},type:"warning",acceptButtonText:{key:"leaveNow"},cancelButtonText:{key:"cancel"}})))return!1;this.leaving=!0;try{yield this.organizationApiService.leave(this.organization.id),this.toastService.showToast({variant:"success",message:this.i18nService.t("leftOrganization")}),yield this.router.navigate(["/"])}catch(e){this.leaving=!1,this.handleActionError(e)}})}ngOnInit(){return at(this,void 0,void 0,function*(){const e=yield(0,c._)(this.accountService.activeAccount$);return null==e?(this.logService.info("[Key Connector remove password] No active account found, redirecting to login."),void(yield this.router.navigate(["/"]))):(this.activeUserId=e.id,yield this.syncService.fullSync(!1),this.organization=yield this.keyConnectorService.getManagingOrganization(this.activeUserId),null==this.organization?(this.logService.info("[Key Connector remove password] No organization found, redirecting to login."),void(yield this.router.navigate(["/"]))):(this.keyConnectorHostName=tt.A.getHostname(this.organization.keyConnectorUrl),void(this.loading=!1)))})}get action(){return this.continuing||this.leaving}handleActionError(e){let t="";(e instanceof et._||e instanceof Error)&&(t=e.message),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:t})}}dt.ɵfac=function(e){return new(e||dt)(L.rXU(k.K),L.rXU(ce.Ix),L.rXU(j.Di),L.rXU(it.H),L.rXU(V.W),L.rXU(st.K),L.rXU(ot.X),L.rXU(de.o3),L.rXU(B.f))},dt.ɵcmp=L.VBU({type:dt,selectors:[["km-ui-remove-password"]],decls:2,vars:1,consts:[[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mb-0","tw-font-bold"],[1,"tw-mb-6"],[1,"tw-mb-0","tw-font-bold","tw-inline-flex","tw-items-center"],["type","button","tooltipPosition","above-center","bitIconButton","bwi-info-circle","size","small",3,"label"],[1,"tw-mb-6","tw-font-mono"],[1,"tw-flex","tw-flex-col","tw-gap-2"],["bitButton","","type","button","buttonType","primary",3,"block","bitAction"],["bitButton","","type","button","buttonType","secondary",3,"block","bitAction"]],template:function(e,t){1&e&&L.nVh(0,lt,6,7,"div",0)(1,ct,22,24),2&e&&L.vxM(t.loading?0:1)},dependencies:[n.MD,R.t,_.Q,nt.p,$.Q,ee.s,rt.$Z],encapsulation:2});var ut=i(31944),ht=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function pt(e,t){1&e&&(L.j41(0,"div",0),L.nrm(1,"i",1),L.nI1(2,"i18n"),L.j41(3,"span",2),L.EFF(4),L.nI1(5,"i18n"),L.k0s()()),2&e&&(L.R7$(),L.Y8G("title",L.mNQ(L.bMT(2,3,"loading"))),L.R7$(3),L.JRh(L.bMT(5,5,"loading")))}function mt(e,t){if(1&e&&(L.j41(0,"p"),L.EFF(1),L.nI1(2,"i18n"),L.k0s(),L.j41(3,"p",9),L.EFF(4),L.nI1(5,"i18n"),L.k0s(),L.j41(6,"p",10),L.EFF(7),L.k0s()),2&e){const e=L.XpG(2);L.R7$(),L.JRh(L.bMT(2,3,"confirmKeyConnectorOrganizationUserDescription")),L.R7$(3),L.JRh(L.bMT(5,5,"organization")),L.R7$(3),L.JRh(e.organizationName)}}function vt(e,t){1&e&&(L.j41(0,"p"),L.EFF(1),L.nI1(2,"i18n"),L.k0s()),2&e&&(L.R7$(),L.JRh(L.bMT(2,1,"verifyYourDomainDescription")))}function ft(e,t){if(1&e&&(L.nVh(0,mt,8,7)(1,vt,3,3,"p"),L.j41(2,"p",3),L.EFF(3),L.nI1(4,"i18n"),L.nrm(5,"button",4),L.nI1(6,"i18n"),L.k0s(),L.j41(7,"p",5),L.EFF(8),L.k0s(),L.j41(9,"div",6)(10,"button",7),L.EFF(11),L.nI1(12,"i18n"),L.k0s(),L.j41(13,"button",8),L.EFF(14),L.nI1(15,"i18n"),L.k0s()()),2&e){const e=L.XpG();L.vxM(e.organizationName?0:1),L.R7$(3),L.SpI(" ",L.bMT(4,10,"domain")," "),L.R7$(2),L.Y8G("label",L.bMT(6,12,"keyConnectorDomainTooltip")),L.R7$(3),L.JRh(e.keyConnectorHostName),L.R7$(2),L.Y8G("bitAction",e.confirm)("block",!0),L.R7$(),L.SpI(" ",L.bMT(12,14,"continueWithLogIn")," "),L.R7$(2),L.Y8G("bitAction",e.cancel)("block",!0),L.R7$(),L.SpI(" ",L.bMT(15,16,"doNotContinue")," ")}}class gt{constructor(e,t,i,n,r,s,o,a,l,c){this.router=e,this.logService=t,this.keyConnectorService=i,this.messagingService=n,this.syncService=r,this.accountService=s,this.keyConnectorApiService=o,this.toastService=a,this.i18nService=l,this.anonLayoutWrapperDataService=c,this.loading=!0,this.onBeforeNavigation=()=>ht(this,void 0,void 0,function*(){}),this.confirm=()=>ht(this,void 0,void 0,function*(){yield this.keyConnectorService.convertNewSsoUserToKeyConnector(this.userId),this.organizationName?this.toastService.showToast({variant:"success",message:this.i18nService.t("organizationVerified")}):this.toastService.showToast({variant:"success",message:this.i18nService.t("domainVerified")}),yield this.syncService.fullSync(!0),this.messagingService.send("loggedIn"),yield this.onBeforeNavigation(),yield this.router.navigate(["/"])}),this.cancel=()=>ht(this,void 0,void 0,function*(){this.messagingService.send("logout")})}ngOnInit(){return ht(this,void 0,void 0,function*(){try{this.userId=yield(0,c._)((0,w.F6)(this.accountService.activeAccount$))}catch(t){return this.logService.info("[confirm-key-connector-domain] no active account"),void this.messagingService.send("logout")}const e=yield(0,c._)(this.keyConnectorService.requiresDomainConfirmation$(this.userId));if(null==e)return this.logService.info("[confirm-key-connector-domain] missing required parameters"),void this.messagingService.send("logout");this.organizationName=yield this.getOrganizationName(e.organizationSsoIdentifier),null==this.organizationName&&this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"verifyYourDomainToLogin"}}),this.keyConnectorUrl=e.keyConnectorUrl,this.keyConnectorHostName=tt.A.getHostname(e.keyConnectorUrl),this.loading=!1})}getOrganizationName(e){return ht(this,void 0,void 0,function*(){try{return(yield this.keyConnectorApiService.getConfirmationDetails(e)).organizationName}catch(t){return void this.logService.warning(`[ConfirmKeyConnectorDomainComponent] Unable to get key connector confirmation details for organizationSsoIdentifier ${e}:`,t)}})}}gt.ɵfac=function(e){return new(e||gt)(L.rXU(ce.Ix),L.rXU(k.K),L.rXU(st.K),L.rXU(C.U),L.rXU(T.H),L.rXU(j.Di),L.rXU(ut.E),L.rXU(B.f),L.rXU(V.W),L.rXU(ue.f))},gt.ɵcmp=L.VBU({type:gt,selectors:[["confirm-key-connector-domain"]],inputs:{onBeforeNavigation:"onBeforeNavigation"},decls:2,vars:1,consts:[[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-mb-0","tw-font-bold","tw-inline-flex","tw-items-center"],["type","button","tooltipPosition","above-center","bitIconButton","bwi-info-circle","size","small",3,"label"],[1,"tw-mb-6","tw-font-mono"],[1,"tw-flex","tw-flex-col","tw-gap-2"],["bitButton","","type","button","buttonType","primary",3,"bitAction","block"],["bitButton","","type","button","buttonType","secondary",3,"bitAction","block"],[1,"tw-mb-0","tw-font-bold"],[1,"tw-mb-6"]],template:function(e,t){1&e&&L.nVh(0,pt,6,7,"div",0)(1,ft,16,18),2&e&&L.vxM(t.loading?0:1)},dependencies:[n.MD,R.t,_.Q,nt.p,$.Q,ee.s,rt.$Z],encapsulation:2});var yt=i(83731),bt=i(6056),wt=i(3204),St=i(12610),It=i(33338),kt=i(34040),Ct=i(39444),Tt=i(73276),Ft=i(2738),Rt=i(43978),Pt=i(685),xt=i(16184),$t=i(47135),Et=i(98403),At=i(8433),Dt=i(43008),Ot=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Mt{constructor(e,t,i){this.i18nService=e,this.sessionTimeoutTypeService=t,this.policyService=i,this.availableTimeoutOptions$=(0,Dt.v)(()=>Ot(this,void 0,void 0,function*(){const e=this.getAllTimeoutOptions();return(yield Promise.all(e.map(e=>Ot(this,void 0,void 0,function*(){return{option:e,available:yield this.sessionTimeoutTypeService.isAvailable(e.value)}})))).filter(e=>e.available).map(e=>e.option)}))}onTimeoutSave(e){}policyFilteredTimeoutOptions$(e){const t=this.policyService.policiesByType$(Rt.tt.MaximumVaultTimeout,e).pipe(Pt.Zc,(0,wt.T)(e=>{var t;return null!==(t=null==e?void 0:e.data)&&void 0!==t?t:null}));return(0,It.z)([this.availableTimeoutOptions$,t,t.pipe((0,Tt.H)(e=>Ot(this,void 0,void 0,function*(){if(null==e)return null;switch(e.type){case"immediately":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(xt.BF.Immediately);case"onSystemLock":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(xt.Lw.OnLocked)}return null})))]).pipe((0,Tt.H)(e=>Ot(this,[e],void 0,function*([e,t,i]){return null==t?e:e.filter(e=>{switch(t.type){case"immediately":return e.value===i;case"onSystemLock":return!(e.value!==xt.BF.Immediately&&!(0,xt.ft)(e.value)&&e.value!==xt.Lw.Custom&&e.value!==xt.Lw.OnLocked&&e.value!==xt.Lw.OnIdle&&e.value!==xt.Lw.OnSleep)||e.value===i;case"onAppRestart":return e.value===xt.BF.Immediately||(0,xt.ft)(e.value)||e.value===xt.Lw.Custom||e.value===xt.Lw.OnRestart;case"custom":case null:case void 0:return e.value===xt.BF.Immediately||e.value===xt.Lw.Custom||(0,xt.ft)(e.value)&&e.value<=t.minutes;case"never":return!0;default:throw Error(`Unsupported policy type: ${t.type}`)}})})))}getAllTimeoutOptions(){return[{name:"immediately",value:xt.BF.Immediately},{name:"oneMinute",value:xt.BF.OnMinute},{name:"fiveMinutes",value:5},{name:"fifteenMinutes",value:15},{name:"thirtyMinutes",value:30},{name:"oneHour",value:60},{name:"fourHours",value:240},{name:"onIdle",value:xt.Lw.OnIdle},{name:"onSleep",value:xt.Lw.OnSleep},{name:"onLocked",value:xt.Lw.OnLocked},{name:"sessionTimeoutOnRestart",value:xt.Lw.OnRestart},{name:"never",value:xt.Lw.Never},{name:"custom",value:xt.Lw.Custom}]}}var Ut=i(69554),Gt=i(93199),jt=i(33886),Nt=i(68923),Vt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Bt=(e,t)=>t.value;function zt(e,t){if(1&e&&(L.nrm(0,"bit-option",3),L.nI1(1,"i18n")),2&e){const e=t.$implicit;L.Y8G("value",e.value)("label",L.bMT(1,2,e.name))}}function Lt(e,t){if(1&e&&(L.j41(0,"div",4)(1,"bit-form-field",6),L.nrm(2,"input",7),L.j41(3,"bit-label"),L.EFF(4),L.nI1(5,"i18n"),L.k0s()(),L.j41(6,"bit-form-field",8),L.nrm(7,"input",9),L.j41(8,"bit-label"),L.EFF(9),L.nI1(10,"i18n"),L.k0s()()()),2&e){const e=L.XpG();L.R7$(4),L.JRh(L.bMT(5,3,"hours")),L.R7$(3),L.Y8G("min",e.customMinutesMin),L.R7$(2),L.JRh(L.bMT(10,5,"minutes"))}}function Kt(e,t){if(1&e&&(L.j41(0,"div",5),L.nrm(1,"i",10),L.EFF(2),L.nI1(3,"i18n"),L.k0s()),2&e){const e=L.XpG();L.R7$(2),L.SpI(" ",L.brH(3,1,"sessionTimeoutSettingsPolicyMaximumError",e.maxSessionTimeoutPolicyHours,e.maxSessionTimeoutPolicyMinutes)," ")}}function qt(e,t){if(1&e&&(L.j41(0,"bit-hint",11),L.EFF(1),L.k0s()),2&e){L.XpG();const e=L.r8f(0);L.R7$(),L.SpI(" ",e," ")}}function _t(e,t){if(1&e&&(L.SS7(0),L.nI1(1,"async"),L.nVh(2,qt,2,1,"bit-hint",11)),2&e){const e=L.bH3(L.bMT(1,1,L.XpG().policyTimeoutMessage$));L.R7$(2),L.vxM(null!=e?2:-1)}}class Xt{constructor(){this.formBuilder=(0,M.WQX)(r.ok),this.policyService=(0,M.WQX)(me.m),this.i18nService=(0,M.WQX)(V.W),this.accountService=(0,M.WQX)(j.Di),this.destroyRef=(0,M.WQX)(M.abz),this.sessionTimeoutTypeService=(0,M.WQX)(Ut.T),this.logService=(0,M.WQX)(z.Kc),this.availableTimeoutOptions=U.hFB.required(),this.maxSessionTimeoutPolicyData=null,this.form=this.formBuilder.group({vaultTimeout:[null],custom:this.formBuilder.group({hours:[0,[r.k0.required,r.k0.min(0)]],minutes:[0,[r.k0.required,r.k0.min(0),r.k0.max(59)]]})},{validators:[this.formValidator.bind(this)]}),this.onChange=null,this.validatorChange=null}get isCustomTimeoutType(){return this.form.controls.vaultTimeout.value===xt.Lw.Custom}get customMinutesMin(){return 0===this.form.controls.custom.controls.hours.value?1:0}get exceedsPolicyMaximumTimeout(){var e;return(null===(e=this.maxSessionTimeoutPolicyData)||void 0===e?void 0:e.type)===xt.Lw.Custom&&this.isCustomTimeoutType&&this.getTotalMinutesFromCustomValue(this.form.value.custom)>this.maxSessionTimeoutPolicyMinutes+60*this.maxSessionTimeoutPolicyHours}ngOnInit(){const e=this.accountService.activeAccount$.pipe(w.F6,(0,p.n)(e=>this.policyService.policiesByType$(Rt.tt.MaximumVaultTimeout,e)),Pt.Zc,(0,h.p)(e=>null!=e),(0,wt.T)(e=>e.data));this.policyTimeoutMessage$=e.pipe((0,p.n)(e=>this.getPolicyTimeoutMessage(e))),e.pipe((0,yt.pQ)(this.destroyRef)).subscribe(e=>{this.maxSessionTimeoutPolicyData=e,this.form.controls.custom.updateValueAndValidity(),this.validatorChange&&this.validatorChange()}),this.form.valueChanges.pipe((0,yt.pQ)(this.destroyRef)).subscribe(e=>{if(this.onChange){const t=this.getVaultTimeout(e);if(null!=t){(!this.isCustomTimeoutType||this.form.controls.custom.valid)&&this.onChange(t)}}}),this.form.controls.vaultTimeout.valueChanges.pipe((0,h.p)(e=>null!=e&&e!==xt.Lw.Custom),(0,yt.pQ)(this.destroyRef)).subscribe(e=>{const t=(0,xt.ft)(e)?e:xt.BF.EightHours;this.form.patchValue({custom:{hours:Math.floor(t/60),minutes:t%60}},{emitEvent:!1}),this.form.controls.custom.markAllAsTouched()})}get maxSessionTimeoutPolicyHours(){var e,t;return Math.floor((null!==(t=null===(e=this.maxSessionTimeoutPolicyData)||void 0===e?void 0:e.minutes)&&void 0!==t?t:0)/60)}get maxSessionTimeoutPolicyMinutes(){var e,t;return(null!==(t=null===(e=this.maxSessionTimeoutPolicyData)||void 0===e?void 0:e.minutes)&&void 0!==t?t:0)%60}writeValue(e){if(null==e)return;if(!this.availableTimeoutOptions().some(t=>t.value===e))return this.logService.debug(`[SessionTimeoutInputComponent] form control write value as custom ${e}`),void this.form.setValue({vaultTimeout:xt.Lw.Custom,custom:{hours:Math.floor(e/60),minutes:e%60}});this.logService.debug(`[SessionTimeoutInputComponent] form control write value as preset ${e}`),this.form.patchValue({vaultTimeout:e})}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}validate(e){return this.form.errors}registerOnValidatorChange(e){this.validatorChange=e}getTotalMinutesFromCustomValue(e){var t,i;return 60*(null!==(t=null==e?void 0:e.hours)&&void 0!==t?t:0)+(null!==(i=null==e?void 0:e.minutes)&&void 0!==i?i:0)}formValidator(e){var t,i;const n=e.value;if(!(n.vaultTimeout===xt.Lw.Custom))return null;const r=null===(t=n.custom)||void 0===t?void 0:t.hours,s=null===(i=n.custom)||void 0===i?void 0:i.minutes;if(null==r||null==s)return{required:!0};return 0===this.getTotalMinutesFromCustomValue(n.custom)?{minTimeoutError:!0}:this.exceedsPolicyMaximumTimeout?{maxTimeoutError:!0}:null}getVaultTimeout(e){var t;return e.vaultTimeout!==xt.Lw.Custom?null!==(t=e.vaultTimeout)&&void 0!==t?t:null:this.getTotalMinutesFromCustomValue(e.custom)}getPolicyTimeoutMessage(e){return Vt(this,void 0,void 0,function*(){const t=yield this.getPolicyAppliedTimeout(e);switch(t){case null:return null;case xt.BF.Immediately:return this.i18nService.t("sessionTimeoutSettingsPolicySetDefaultTimeoutToImmediately");case xt.Lw.OnLocked:return this.i18nService.t("sessionTimeoutSettingsPolicySetDefaultTimeoutToOnLocked");case xt.Lw.OnRestart:return this.i18nService.t("sessionTimeoutSettingsPolicySetDefaultTimeoutToOnRestart");default:if((0,xt.ft)(t)){const e=Math.floor(t/60),i=t%60;return this.i18nService.t("sessionTimeoutSettingsPolicySetMaximumTimeoutToHoursMinutes",e,i)}throw new Error("Invalid timeout parameter")}})}getPolicyAppliedTimeout(e){return Vt(this,void 0,void 0,function*(){switch(e.type){case"immediately":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(xt.BF.Immediately);case"onSystemLock":return yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(xt.Lw.OnLocked);case"onAppRestart":return xt.Lw.OnRestart;case"never":{const e=yield this.sessionTimeoutTypeService.getOrPromoteToAvailable(xt.Lw.Never);return e==xt.Lw.Never?null:e}default:return e.minutes}})}}Xt.MIN_CUSTOM_MINUTES=0,Xt.ɵfac=function(e){return new(e||Xt)},Xt.ɵcmp=L.VBU({type:Xt,selectors:[["bit-session-timeout-input"]],inputs:{availableTimeoutOptions:[1,"availableTimeoutOptions"]},features:[L.Jv_([{provide:r.kq,multi:!0,useExisting:Xt},{provide:r.cz,multi:!0,useExisting:Xt}])],decls:11,vars:7,consts:[[1,"tw-mb-4",3,"formGroup"],[3,"disableMargin"],["formControlName","vaultTimeout"],[3,"value","label"],["formGroupName","custom",1,"tw-grid","tw-grid-cols-12","tw-gap-4"],["id","session-timeout-maximum-error",1,"tw-mt-1","tw-text-danger","tw-text-xs"],["disableMargin","",1,"tw-col-span-6"],["bitInput","","type","number","min","0","formControlName","hours","aria-describedby","session-timeout-maximum-error"],["disableMargin","",1,"tw-col-span-6","tw-self-start"],["bitInput","","type","number","max","59","formControlName","minutes","aria-describedby","session-timeout-maximum-error",3,"min"],["aria-hidden","true",1,"bwi","bwi-error"],["id","session-timeout-maximum-error",1,"tw-mb-1"]],template:function(e,t){1&e&&(L.j41(0,"div",0)(1,"bit-form-field",1)(2,"bit-label"),L.EFF(3),L.nI1(4,"i18n"),L.k0s(),L.j41(5,"bit-select",2),L.Z7z(6,zt,2,4,"bit-option",3,Bt),L.k0s()(),L.nVh(8,Lt,11,7,"div",4),L.nVh(9,Kt,4,5,"div",5)(10,_t,3,4),L.k0s()),2&e&&(L.Y8G("formGroup",t.form),L.R7$(),L.Y8G("disableMargin",!t.isCustomTimeoutType),L.R7$(2),L.JRh(L.bMT(4,5,"vaultTimeout1")),L.R7$(3),L.Dyx(t.availableTimeoutOptions()),L.R7$(2),L.vxM(t.isCustomTimeoutType?8:-1),L.R7$(),L.vxM(t.form.hasError("maxTimeoutError")?9:null!=t.maxSessionTimeoutPolicyData?10:-1))},dependencies:[n.MD,v.p,r.X1,r.me,r.Q0,r.BC,r.cb,r.VZ,r.zX,r.j4,r.JD,r.$R,P.L,X.j,Gt.I,Y.J,H.h,At.p,jt.w,Nt.P,n.Jj,te.$],encapsulation:2,changeDetection:0});var Yt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ht(e,t){if(1&e&&L.nrm(0,"bit-session-timeout-input",1),2&e){const e=L.XpG();L.Y8G("availableTimeoutOptions",t)("formControl",e.formGroup.controls.timeout)}}function Wt(e,t){if(1&e&&(L.nrm(0,"bit-option",4),L.nI1(1,"i18n")),2&e){const e=t.$implicit;L.Y8G("value",e)("label",L.bMT(1,2,e))}}function Jt(e,t){1&e&&(L.j41(0,"bit-hint"),L.EFF(1),L.nI1(2,"i18n"),L.k0s()),2&e&&(L.R7$(),L.JRh(L.bMT(2,1,"sessionTimeoutSettingsSetUnlockMethodToChangeTimeoutAction")))}function Zt(e,t){1&e&&(L.j41(0,"bit-hint"),L.EFF(1),L.nI1(2,"i18n"),L.k0s()),2&e&&(L.R7$(),L.JRh(L.bMT(2,1,"sessionTimeoutSettingsManagedByOrganization")))}class Qt{constructor(){this.refreshTimeoutActionSettings=(0,U.hFB)(new o.t(void 0)),this.vaultTimeoutSettingsService=(0,M.WQX)(xt.ep),this.sessionTimeoutSettingsComponentService=(0,M.WQX)(Mt),this.i18nService=(0,M.WQX)(V.W),this.toastService=(0,M.WQX)(B.f),this.policyService=(0,M.WQX)(me.m),this.accountService=(0,M.WQX)(j.Di),this.dialogService=(0,M.WQX)(de.o3),this.logService=(0,M.WQX)(z.Kc),this.destroyRef=(0,M.WQX)(M.abz),this.platformUtilsService=(0,M.WQX)(le.y),this.formGroup=new r.gE({timeout:new r.MJ(null,[r.k0.required]),timeoutAction:new r.MJ(xt.W4.Lock,[r.k0.required])}),this.availableTimeoutActions=(0,M.vPA)([]),this.availableTimeoutOptions$=this.accountService.activeAccount$.pipe(w.F6,(0,p.n)(e=>this.sessionTimeoutSettingsComponentService.policyFilteredTimeoutOptions$(e)),(0,u.M)(e=>{this.logService.debug("[SessionTimeoutSettings] Available timeout options",e)})),this.sessionTimeoutActionFromPolicy$=this.accountService.activeAccount$.pipe(w.F6,(0,p.n)(e=>this.policyService.policiesByType$(Rt.tt.MaximumVaultTimeout,e)),Pt.Zc,(0,wt.T)(e=>null==e?void 0:e.data),(0,wt.T)(e=>{var t;return null!==(t=null==e?void 0:e.action)&&void 0!==t?t:null})),this.sessionTimeoutActionFromPolicy=(0,yt.ot)(this.sessionTimeoutActionFromPolicy$)}get canLock(){return this.availableTimeoutActions().includes(xt.W4.Lock)}get supportsLock(){return this.platformUtilsService.getClientType()!==Ft.s.Web&&"logOut"!==this.sessionTimeoutActionFromPolicy()}ngOnInit(){return Yt(this,void 0,void 0,function*(){this.userId=yield(0,c._)((0,w.F6)(this.accountService.activeAccount$));const e=yield(0,c._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(this.userId));this.formGroup.patchValue({timeout:e,timeoutAction:yield(0,c._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(this.userId))},{emitEvent:!1}),this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(this.userId).pipe((0,h.p)(e=>this.formGroup.controls.timeout.value!==e),(0,u.M)(e=>this.logService.debug(`[SessionTimeoutSettings] Updating initial form timeout from ${this.formGroup.controls.timeout.value} to ${e}`)),(0,yt.pQ)(this.destroyRef)).subscribe(e=>{this.formGroup.controls.timeout.setValue(e,{emitEvent:!1})}),this.refreshTimeoutActionSettings().pipe((0,St.Z)(void 0),(0,p.n)(()=>(0,It.z)([this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(this.userId),this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(this.userId),this.sessionTimeoutActionFromPolicy$])),(0,yt.pQ)(this.destroyRef)).subscribe(([e,t,i])=>{this.availableTimeoutActions.set(e),this.formGroup.controls.timeoutAction.setValue(t,{emitEvent:!1}),null!=i||e.length<=1?this.formGroup.controls.timeoutAction.disable({emitEvent:!1}):this.formGroup.controls.timeoutAction.enable({emitEvent:!1})}),this.formGroup.controls.timeout.valueChanges.pipe((0,St.Z)(e),(0,h.p)(e=>null!=e),(0,kt.F)(),(0,Ct.J)(),(0,Tt.H)(e=>Yt(this,[e],void 0,function*([e,t]){yield this.saveTimeout(e,t)})),(0,yt.pQ)(this.destroyRef)).subscribe(),this.formGroup.controls.timeoutAction.valueChanges.pipe((0,h.p)(e=>null!=e),(0,wt.T)(e=>Yt(this,void 0,void 0,function*(){yield this.saveTimeoutAction(e)})),(0,yt.pQ)(this.destroyRef)).subscribe()})}saveTimeout(e,t){return Yt(this,void 0,void 0,function*(){if(this.formGroup.controls.timeout.markAllAsTouched(),this.formGroup.controls.timeout.invalid)return;if(this.logService.debug("[SessionTimeoutSettings] Saving timeout",{previousValue:e,newValue:t}),t===xt.Lw.Never){if(!(yield this.dialogService.openSimpleDialog({title:{key:"warning"},content:{key:"neverLockWarning"},type:"warning"})))return void this.formGroup.controls.timeout.setValue(e,{emitEvent:!1})}const i=yield(0,c._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(this.userId));yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(this.userId,t,i),this.sessionTimeoutSettingsComponentService.onTimeoutSave(t)})}saveTimeoutAction(e){return Yt(this,void 0,void 0,function*(){if(this.logService.debug("[SessionTimeoutSettings] Saving timeout action",e),e===xt.W4.LogOut){if(!(yield this.dialogService.openSimpleDialog({title:{key:"vaultTimeoutLogOutConfirmationTitle"},content:{key:"vaultTimeoutLogOutConfirmation"},type:"warning"})))return void this.formGroup.controls.timeoutAction.setValue(xt.W4.Lock,{emitEvent:!1})}this.formGroup.controls.timeout.hasError("policyError")?this.toastService.showToast({variant:"error",message:this.i18nService.t("vaultTimeoutTooLarge")}):yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(this.userId,this.formGroup.controls.timeout.value,e)})}}Qt.ɵfac=function(e){return new(e||Qt)},Qt.ɵcmp=L.VBU({type:Qt,selectors:[["bit-session-timeout-settings"]],inputs:{refreshTimeoutActionSettings:[1,"refreshTimeoutActionSettings"]},decls:13,vars:13,consts:[[3,"formGroup"],[3,"availableTimeoutOptions","formControl"],[3,"disableMargin"],["id","timeoutAction",3,"formControl","required"],[3,"value","label"]],template:function(e,t){if(1&e&&(L.j41(0,"div",0),L.nVh(1,Ht,1,2,"bit-session-timeout-input",1),L.nI1(2,"async"),L.j41(3,"bit-form-field",2)(4,"bit-label"),L.EFF(5),L.nI1(6,"i18n"),L.k0s(),L.j41(7,"bit-select",3),L.Z7z(8,Wt,2,4,"bit-option",4,L.fX1),L.k0s(),L.nVh(10,Jt,3,3,"bit-hint"),L.nI1(11,"async"),L.vZN(12,Zt,3,3,"bit-hint"),L.k0s()()),2&e){let e;L.Y8G("formGroup",t.formGroup),L.R7$(),L.vxM((e=L.bMT(2,7,t.availableTimeoutOptions$))?1:-1,e),L.R7$(2),L.Y8G("disableMargin",!0),L.R7$(2),L.JRh(L.bMT(6,9,"sessionTimeoutSettingsAction")),L.R7$(2),L.Y8G("formControl",t.formGroup.controls.timeoutAction)("required",!1),L.R7$(),L.Dyx(t.availableTimeoutActions()),L.R7$(2),L.vxM(!t.canLock&&t.supportsLock?10:null!=L.bMT(11,11,t.sessionTimeoutActionFromPolicy$)?12:-1)}},dependencies:[$t.q,n.MD,P.L,X.j,Gt.I,H.h,r.YN,r.BC,r.cb,r.YS,r.X1,r.l_,r.j4,$.Q,Et.k,v.p,Ke.V,bt.iI,At.p,jt.w,Nt.P,qe.E,Xt,n.Jj,te.$],encapsulation:2});var ei=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ti(e,t){if(1&e&&L.nrm(0,"bit-option",8),2&e){const e=t.$implicit;L.Y8G("value",e.value)("label",e.name)}}function ii(e,t){1&e&&(L.j41(0,"div",9)(1,"bit-form-field",10),L.nrm(2,"input",11),L.j41(3,"bit-label"),L.EFF(4),L.nI1(5,"i18n"),L.k0s()(),L.j41(6,"bit-form-field",12),L.nrm(7,"input",13),L.j41(8,"bit-label"),L.EFF(9),L.nI1(10,"i18n"),L.k0s()()()),2&e&&(L.R7$(4),L.JRh(L.bMT(5,2,"hours")),L.R7$(5),L.JRh(L.bMT(10,4,"minutes")))}function ni(e,t){if(1&e&&(L.j41(0,"bit-hint"),L.EFF(1),L.nI1(2,"i18n"),L.k0s()),2&e){const e=L.XpG();L.R7$(),L.SpI(" ",L.brH(2,1,"vaultTimeoutPolicyInEffect1",e.vaultTimeoutPolicyHours,e.vaultTimeoutPolicyMinutes)," ")}}function ri(e,t){1&e&&(L.j41(0,"small",14),L.nrm(1,"i",15),L.EFF(2),L.nI1(3,"i18n"),L.k0s()),2&e&&(L.R7$(2),L.SpI(" ",L.bMT(3,1,"vaultCustomTimeoutMinimum")," "))}function si(e,t){if(1&e&&(L.j41(0,"small",16),L.nrm(1,"i",15),L.EFF(2),L.nI1(3,"i18n"),L.k0s()),2&e){const e=L.XpG();L.R7$(2),L.SpI(" ",L.brH(3,1,"vaultTimeoutPolicyMaximumError",e.vaultTimeoutPolicyHours,e.vaultTimeoutPolicyMinutes)," ")}}class oi{constructor(e,t,i,n,r){this.formBuilder=e,this.policyService=t,this.vaultTimeoutSettingsService=i,this.i18nService=n,this.accountService=r,this.form=this.formBuilder.group({vaultTimeout:[null],custom:this.formBuilder.group({hours:[null],minutes:[null]})}),this.VaultTimeoutAction=xt.W4,this.destroy$=new s.B}get showCustom(){return this.form.get("vaultTimeout").value===oi.CUSTOM_VALUE}get exceedsMinimumTimeout(){return!this.showCustom||this.customTimeInMinutes()>oi.MIN_CUSTOM_MINUTES}get exceedsMaximumTimeout(){return this.showCustom&&this.customTimeInMinutes()>this.vaultTimeoutPolicyMinutes+60*this.vaultTimeoutPolicyHours}get filteredVaultTimeoutOptions(){return null==this.vaultTimeoutPolicy||null==this.vaultTimeoutPolicy.data?this.vaultTimeoutOptions:this.vaultTimeoutOptions.filter(e=>"number"==typeof e.value&&e.value<=this.vaultTimeoutPolicy.data.minutes)}ngOnInit(){return ei(this,void 0,void 0,function*(){this.accountService.activeAccount$.pipe(w.F6,(0,p.n)(e=>this.policyService.policiesByType$(Rt.tt.MaximumVaultTimeout,e)),Pt.Zc,(0,h.p)(e=>null!=e),(0,d.Q)(this.destroy$)).subscribe(e=>{this.vaultTimeoutPolicy=e,this.applyVaultTimeoutPolicy()}),this.form.valueChanges.pipe((0,d.Q)(this.destroy$)).subscribe(e=>{this.onChange&&this.onChange(this.getVaultTimeout(e))}),this.form.controls.vaultTimeout.valueChanges.pipe((0,h.p)(e=>e!==oi.CUSTOM_VALUE),(0,d.Q)(this.destroy$)).subscribe(e=>{const t="string"==typeof e?0:Math.max(e,0);this.form.patchValue({custom:{hours:Math.floor(t/60),minutes:t%60}},{emitEvent:!1})}),this.canLockVault$=this.vaultTimeoutSettingsService.availableVaultTimeoutActions$().pipe((0,wt.T)(e=>e.includes(xt.W4.Lock)))})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}ngOnChanges(){this.vaultTimeoutOptions.find(e=>e.value===oi.CUSTOM_VALUE)||this.vaultTimeoutOptions.push({name:this.i18nService.t("custom"),value:oi.CUSTOM_VALUE})}getVaultTimeout(e){return e.vaultTimeout!==oi.CUSTOM_VALUE?e.vaultTimeout:60*e.custom.hours+e.custom.minutes}writeValue(e){null!=e&&(this.vaultTimeoutOptions.every(t=>t.value!==e)?this.form.setValue({vaultTimeout:oi.CUSTOM_VALUE,custom:{hours:Math.floor(e/60),minutes:e%60}}):this.form.patchValue({vaultTimeout:e}))}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){}validate(e){var t,i;return this.vaultTimeoutPolicy&&(null===(i=null===(t=this.vaultTimeoutPolicy)||void 0===t?void 0:t.data)||void 0===i?void 0:i.minutes)<e.value?{policyError:!0}:this.exceedsMinimumTimeout?null:{minTimeoutError:!0}}registerOnValidatorChange(e){this.validatorChange=e}customTimeInMinutes(){return 60*this.form.value.custom.hours+this.form.value.custom.minutes}applyVaultTimeoutPolicy(){this.vaultTimeoutPolicyHours=Math.floor(this.vaultTimeoutPolicy.data.minutes/60),this.vaultTimeoutPolicyMinutes=this.vaultTimeoutPolicy.data.minutes%60,this.vaultTimeoutOptions=this.vaultTimeoutOptions.filter(e=>e.value===oi.CUSTOM_VALUE||"number"==typeof e.value&&e.value<=this.vaultTimeoutPolicy.data.minutes),this.validatorChange&&this.validatorChange()}}oi.CUSTOM_VALUE=-100,oi.MIN_CUSTOM_MINUTES=0,oi.ɵfac=function(e){return new(e||oi)(L.rXU(r.ok),L.rXU(me.m),L.rXU(xt.ep),L.rXU(V.W),L.rXU(j.Di))},oi.ɵcmp=L.VBU({type:oi,selectors:[["bit-session-timeout-input-legacy"]],inputs:{vaultTimeoutOptions:"vaultTimeoutOptions"},features:[L.Jv_([{provide:r.kq,multi:!0,useExisting:oi},{provide:r.cz,multi:!0,useExisting:oi}]),L.OA$],decls:11,vars:10,consts:[[1,"tw-mb-4",3,"formGroup"],[3,"disableMargin"],["formControlName","vaultTimeout"],[3,"value","label",4,"ngFor","ngForOf"],["class","tw-grid tw-grid-cols-12 tw-gap-4","formGroupName","custom",4,"ngIf"],[4,"ngIf"],["class","tw-text-danger",4,"ngIf"],["class","tw-text-danger","id","maximum-error",4,"ngIf"],[3,"value","label"],["formGroupName","custom",1,"tw-grid","tw-grid-cols-12","tw-gap-4"],["disableMargin","",1,"tw-col-span-6"],["bitInput","","type","number","min","0","formControlName","hours","aria-labelledby","maximum-error"],["disableMargin","",1,"tw-col-span-6","tw-self-end"],["bitInput","","type","number","min","0","name","minutes","formControlName","minutes","aria-labelledby","maximum-error"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-error"],["id","maximum-error",1,"tw-text-danger"]],template:function(e,t){1&e&&(L.j41(0,"div",0)(1,"bit-form-field",1)(2,"bit-label"),L.EFF(3),L.nI1(4,"i18n"),L.k0s(),L.j41(5,"bit-select",2),L.DNE(6,ti,1,2,"bit-option",3),L.k0s()(),L.DNE(7,ii,11,6,"div",4)(8,ni,3,5,"bit-hint",5)(9,ri,4,3,"small",6)(10,si,4,5,"small",7),L.k0s()),2&e&&(L.Y8G("formGroup",t.form),L.R7$(),L.Y8G("disableMargin",!t.showCustom),L.R7$(2),L.JRh(L.bMT(4,8,"vaultTimeout1")),L.R7$(3),L.Y8G("ngForOf",t.filteredVaultTimeoutOptions),L.R7$(),L.Y8G("ngIf",t.showCustom),L.R7$(),L.Y8G("ngIf",null!=t.vaultTimeoutPolicy&&!t.exceedsMaximumTimeout),L.R7$(),L.Y8G("ngIf",!t.exceedsMinimumTimeout),L.R7$(),L.Y8G("ngIf",t.exceedsMaximumTimeout))},dependencies:[n.MD,n.Sq,n.bT,v.p,r.X1,r.me,r.Q0,r.BC,r.cb,r.VZ,r.j4,r.JD,r.$R,P.L,X.j,Gt.I,Y.J,H.h,At.p,jt.w,Nt.P,te.$],encapsulation:2})},78510:(e,t,i)=>{"use strict";i.d(t,{a:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 4.5 91.63 88">
    <path class="tw-fill-illustration-bg-secondary" d="M62 12.5a2 2 0 0 1 2 2v76a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-76a2 2 0 0 1 2-2h56Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M62 90.5v-76H6v76h56Zm2-76a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v76a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2v-76Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M72 82.5v-76a2 2 0 0 0-2-2H27.328c-.53 0-1.034.206-1.41.581L12.585 18.416A1.993 1.993 0 0 0 12 19.828V82.5a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 82.5v-76H27.328L14 19.828V82.5h56ZM27.333 6.495ZM72 6.5v76a2 2 0 0 1-2 2H14a2 2 0 0 1-2-2V19.828c0-.53.209-1.037.584-1.412L25.919 5.081c.375-.375.879-.581 1.41-.581H70a2 2 0 0 1 2 2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M84 48.5c0 11.046-8.954 20-20 20s-20-8.954-20-20 8.954-20 20-20 20 8.954 20 20Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M64 66.5c9.941 0 18-8.059 18-18s-8.059-18-18-18-18 8.059-18 18 8.059 18 18 18Zm0 2c11.046 0 20-8.954 20-20s-8.954-20-20-20-20 8.954-20 20 8.954 20 20 20Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M79 48.5c0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15 0-8.284 6.716-15 15-15 8.284 0 15 6.716 15 15Z"/>
    <path class="tw-fill-illustration-outline" d="M95.004 77.587 78.5 62l-2 2 15.587 16.504a2 2 0 0 0 2.868.04l.09-.089a2 2 0 0 0-.041-2.868Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 5.5a1 1 0 0 1 1 1v15H14a1 1 0 1 1 0-2h13v-13a1 1 0 0 1 1-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M20 28.5a1 1 0 1 0 0 2h10a1 1 0 1 0 0-2H20Zm14 0a1 1 0 1 0 0 2h10a1 1 0 1 0 0-2H34Zm16.983 4.815A1 1 0 0 0 50 32.5H40a1 1 0 1 0 0 2h9.717c.405-.413.827-.808 1.266-1.185ZM44.025 49.5c.033.676.1 1.343.199 2H40a1 1 0 1 1 0-2h4.025Zm.199-4a20.086 20.086 0 0 0-.2 2H37a1 1 0 1 1 0-2h7.224Zm3.775-9c-.48.638-.922 1.306-1.323 2H38a1 1 0 1 1 0-2h9.998ZM64 28.5c-3.13 0-6.09.719-8.728 2H54a1 1 0 1 1 0-2h10Zm-16 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2h-2Zm-11 5a1 1 0 0 0-1-1h-2a1 1 0 1 0 0 2h2a1 1 0 0 0 1-1Zm-3 5a1 1 0 1 0 0-2h-4a1 1 0 1 0 0 2h4Zm0 8a1 1 0 0 1-1 1h-6a1 1 0 1 1 0-2h6a1 1 0 0 1 1 1Zm2 5a1 1 0 1 0 0-2H20a1 1 0 1 0 0 2h16Zm-5-18a1 1 0 0 0-1-1H20a1 1 0 1 0 0 2h10a1 1 0 0 0 1-1Zm-5 5a1 1 0 1 0 0-2h-6a1 1 0 1 0 0 2h6Zm-2 8a1 1 0 0 1-1 1h-3a1 1 0 1 1 0-2h3a1 1 0 0 1 1 1Z" clip-rule="evenodd"/>
  </svg>
`},78781:(e,t,i)=>{"use strict";i.d(t,{A:()=>d});var n=i(58803),r=i(97763),s=i(93695),o=i(44500),a=i(76144),l=i(45202);const c="undefined"==typeof self?i(10967):null;class d{static init(){d.inited||(d.inited=!0,d.isNode=void 0!==l&&null!=l.release&&"node"===l.release.name,d.isBrowser="undefined"!=typeof window,d.isMobileBrowser=d.isBrowser&&this.isMobile(window),d.isAppleMobileBrowser=d.isBrowser&&this.isAppleMobile(window),d.isNode?d.global=i.g:d.isBrowser?d.global=window:d.global=self)}static fromB64ToArray(e){if(null==e)return null;if(d.isNode)return new Uint8Array(Buffer.from(e,"base64"));{const t=d.global.atob(e),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromUrlB64ToArray(e){return d.fromB64ToArray(d.fromUrlB64ToB64(e))}static fromHexToArray(e){if(d.isNode)return new Uint8Array(Buffer.from(e,"hex"));{const t=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)t[i/2]=parseInt(e.substr(i,2),16);return t}}static fromUtf8ToArray(e){if(d.isNode)return new Uint8Array(Buffer.from(e,"utf8"));{const t=unescape(encodeURIComponent(e)),i=new Uint8Array(t.length);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return i}}static fromByteStringToArray(e){if(null==e)return null;const t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t}static fromBufferToB64(e){if(null==e)return null;const t=d.normalizeToUint8Array(e);if(0===t.length)return"";if(d.isNode)return Buffer.from(t).toString("base64");{let e="";for(let i=0;i<t.byteLength;i++)e+=String.fromCharCode(t[i]);return d.global.btoa(e)}}static normalizeToUint8Array(e){if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);{const t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}}static fromBufferToUrlB64(e){return d.fromB64toUrlB64(d.fromBufferToB64(e))}static fromB64toUrlB64(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static fromBufferToUtf8(e){return r.hp.from(e).toString("utf8")}static fromBufferToByteString(e){return String.fromCharCode.apply(null,new Uint8Array(e))}static fromBufferToHex(e){if(d.isNode)return Buffer.from(e).toString("hex");{const t=new Uint8Array(e);return Array.prototype.map.call(t,e=>("00"+e.toString(16)).slice(-2)).join("")}}static hexStringToArrayBuffer(e){if(e.length%2!=0)throw"HexString has to be an even length";const t=new ArrayBuffer(e.length/2),i=new Uint8Array(t);for(let n=0;n<i.length;n++){const t=e.substr(2*n,2),r=parseInt(t,16);i[n]=r}return t}static fromUrlB64ToB64(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("Illegal base64url string!")}return t}static fromUrlB64ToUtf8(e){return d.fromB64ToUtf8(d.fromUrlB64ToB64(e))}static fromUtf8ToB64(e){return d.isNode?Buffer.from(e,"utf8").toString("base64"):r.hp.from(e,"utf8").toString("base64")}static fromUtf8ToUrlB64(e){return d.fromBufferToUrlB64(d.fromUtf8ToArray(e))}static fromB64ToUtf8(e){return d.isNode?Buffer.from(e,"base64").toString("utf8"):r.hp.from(e,"base64").toString("utf8")}static newGuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}static isGuid(e){return RegExp(d.guidRegex,"i").test(e)}static getHostname(e){if(d.isNullOrWhitespace(e))return null;if((e=e.trim()).startsWith("data:"))return null;if(e.startsWith("about:"))return null;if(e.startsWith("file:"))return null;if(e.indexOf("!")>0)return null;try{const t=(0,a.EW)(e,{validHosts:this.validHosts});if(null!=t)return t}catch(t){return null}return null}static getHost(e){const t=d.getUrl(e);try{return null!=t&&""!==t.host?t.host:null}catch(i){return null}}static getDomain(e){if(d.isNullOrWhitespace(e))return null;if((e=e.trim()).startsWith("data:"))return null;if(e.startsWith("about:"))return null;try{const t=(0,a.qg)(e,{validHosts:this.validHosts,allowPrivateDomains:!0});if(null!=t&&null!=t.hostname)return"localhost"===t.hostname||t.isIp?t.hostname:null!=t.domain?t.domain:null}catch(t){return null}return null}static getQueryParams(e){const t=d.getUrl(e);if(null==t||null==t.search||""===t.search)return null;const i=new Map;return("?"===t.search[0]?t.search.substr(1):t.search).split("&").forEach(e=>{const t=e.split("=");t.length<1||i.set(decodeURIComponent(t[0]).toLowerCase(),null==t[1]?"":decodeURIComponent(t[1]))}),i}static getSortFunction(e,t){return(i,n)=>null==i[t]&&null!=n[t]?-1:null!=i[t]&&null==n[t]?1:null==i[t]&&null==n[t]?0:e.collator?e.collator.compare(i[t],n[t]):i[t].localeCompare(n[t])}static isNullOrWhitespace(e){return null==e||"string"!=typeof e||""===e.trim()}static isNullOrEmpty(e){return null==e||"string"!=typeof e||""==e}static isPromise(e){return null!=e&&"function"==typeof e.then&&"function"==typeof e.catch}static nameOf(e){return e}static assign(e,t){return Object.assign(e,t)}static iterateEnum(e){return Object.keys(e).filter(e=>Number.isNaN(+e)).map(t=>e[t])}static getUrl(e){return this.isNullOrWhitespace(e)?null:(e=e.trim(),d.getUrlObject(e))}static camelToPascalCase(e){return e.charAt(0).toUpperCase()+e.slice(1)}static pickTextColorBasedOnBgColor(e,t=186,i=!1){const n="#"===e.charAt(0)?e.substring(1,7):e;return.299*parseInt(n.substring(0,2),16)+.587*parseInt(n.substring(2,4),16)+.114*parseInt(n.substring(4,6),16)>t?i?"black":"black !important":i?"white":"white !important"}static stringToColor(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let i="#";for(let n=0;n<3;n++){i+=("00"+(t>>8*n&255).toString(16)).substr(-2)}return i}static getContainerService(){if(null==this.global.bitwardenContainerService)throw new Error("global bitwardenContainerService not initialized.");return this.global.bitwardenContainerService}static validateHexColor(e){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(e)}static mapToRecord(e){return null==e?null:e instanceof Map?Object.fromEntries(e):e}static recordToMap(e){if(null==e)return null;if(e instanceof Map)return e;const t=Object.entries(e);return 0===t.length?new Map:isNaN(Number(t[0][0]))?new Map(t):new Map(t.map(e=>[Number(e[0]),e[1]]))}static merge(e,t){return Object.assign(e,t)}static encodeRFC3986URIComponent(e){return encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}static normalizePath(e){return n.normalize(decodeURIComponent(e)).replace(/^(\.\.(\/|\\|$))+/,"")}static invalidUrlPatterns(e){const t=decodeURIComponent(e.toLocaleLowerCase());if(["..","%2e","\\","%5c"].some(e=>t.includes(e)))return!0;if(t.includes("?")){if(this.validateQueryParameters(t))return!0}return!1}static validateQueryParameters(e){try{let t;if(!e.includes("?"))return!1;t=e.split("?")[1];return["/","%2f","#","%23"].some(e=>t.includes(e))}catch(t){throw new Error(`Error validating query parameters: ${t}`)}}static isMobile(e){let t=!1;var i;return i=e.navigator.userAgent||e.navigator.vendor||e.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(i)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(i.substr(0,4)))&&(t=!0),t||null!=e.navigator.userAgent.match(/iPad/i)}static delay(e){return new Promise(t=>setTimeout(t,e))}static asyncToObservable(e){return(0,s.of)(void 0).pipe((0,o.n)(()=>e()))}static daysRemaining(e){const t=e.getTime()-Date.now();return Math.max(0,Math.floor(t/864e5))}static isAppleMobile(e){return null!=e.navigator.userAgent.match(/iPhone/i)||null!=e.navigator.userAgent.match(/iPad/i)}static getUrlObject(e){const t=e.indexOf("://")>-1;if(!t&&e.indexOf(".")>-1)e="http://"+e;else if(!t)return null;try{return null!=c?new c.URL(e):new URL(e)}catch(i){}return null}}d.inited=!1,d.isNode=!1,d.isBrowser=!0,d.isMobileBrowser=!1,d.isAppleMobileBrowser=!1,d.global=null,d.regexpEmojiPresentation=/(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])/g,d.validHosts=["localhost"],d.originalMinimumPasswordLength=8,d.minimumPasswordLength=12,d.DomainMatchBlacklist=new Map([["google.com",new Set(["script.google.com"])]]),d.guidRegex=/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/,d.init()},78867:(e,t,i)=>{"use strict";i.d(t,{Y:()=>T});var n=i(23649),r=i(72737),s=i(33338),o=i(93695),a=i(69194),l=i(3204),c=i(12610),d=i(44500),u=i(67553),h=i(43978),p=i(3633),m=i(82468),v=i(49272),f=i(74208),g=i(13417),y=i(35500),b=i(37115),w=i(18499),S=i(50700),I=i(58329),k=i(1601),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T{constructor(e,t,i,v,f,g,y,b,w,S,I){this.organizationService=e,this.providerService=t,this.route=i,this.router=v,this.syncService=f,this.accountService=g,this.platformUtilsService=y,this.policyService=b,this.i18nService=w,this.billingAccountProfileStateService=S,this.configService=I,this.syncCompleted$=new r.m(1),this.triggerProductUpdate$=(0,s.z)([this.syncCompleted$,this.router.events.pipe((0,c.Z)(null),(0,a.p)(e=>e instanceof n.wF||e instanceof n.Z||null===e))]).pipe((0,l.T)(()=>null)),this.organizations$=this.accountService.activeAccount$.pipe((0,l.T)(e=>null==e?void 0:e.id),(0,d.n)(e=>this.organizationService.organizations$(e))),this.providers$=this.accountService.activeAccount$.pipe(p.F6,(0,d.n)(e=>this.providerService.providers$(e))),this.userHasSingleOrgPolicy$=this.accountService.activeAccount$.pipe(p.F6,(0,d.n)(e=>this.policyService.policyAppliesToUser$(h.tt.SingleOrg,e))),this.shouldShowPremiumUpgradeButton$=(0,s.z)([this.configService.getFeatureFlag$(m.TO.PM24032_NewNavigationPremiumUpgradeButton),this.accountService.activeAccount$]).pipe((0,d.n)(([e,t])=>e&&t?this.billingAccountProfileStateService.hasPremiumFromAnySource$(t.id).pipe((0,l.T)(e=>!e)):(0,o.of)(!1))),this.products$=(0,s.z)([this.organizations$,this.providers$,this.userHasSingleOrgPolicy$,this.route.paramMap,this.triggerProductUpdate$]).pipe((0,l.T)(([e,t,i,n])=>{var r,s,o;e.sort((e,t)=>e.name.localeCompare(t.name));let a=e.find(e=>e.id===n.get("organizationId")),l=null;["/sm/","/organizations/"].some(e=>this.router.url.includes(e))&&(l=null!==(r=this.router.url.split("/")[2])&&void 0!==r?r:null),l&&!a&&(a=e.find(e=>e.id===l));const c=(null==a?void 0:a.canAccessSecretsManager)&&1==(null==a?void 0:a.enabled)?a:e.find(e=>e.canAccessSecretsManager&&1==e.enabled),d=null!=a&&(0,u.OV)(a)?a:e.find(e=>(0,u.OV)(e)),p=(null===(s=t[0])||void 0===s?void 0:s.providerType)===h.cp.BusinessUnit?"Business Unit Portal":"Provider Portal",m=this.platformUtilsService.isSelfHost()?{route:"https://bitwarden.com/products/business/",external:!0}:{route:"/create-organization",external:!1},v={pm:{name:"Password Manager",icon:"bwi-lock",appRoute:"/vault",marketingRoute:{route:"https://bitwarden.com/products/personal/",external:!0},isActive:!this.router.url.includes("/sm/")&&!this.router.url.includes("/organizations/")&&!this.router.url.includes("/providers/")},sm:{name:"Secrets Manager",icon:"bwi-cli",appRoute:["/sm",null==c?void 0:c.id],marketingRoute:{route:"/sm-landing",external:!1},isActive:this.router.url.includes("/sm/"),otherProductOverrides:{supportingText:this.i18nService.t("secureYourInfrastructure")}},ac:{name:"Admin Console",icon:"bwi-business",appRoute:["/organizations",null==d?void 0:d.id],marketingRoute:{route:"https://bitwarden.com/products/business/",external:!0},isActive:this.router.url.includes("/organizations/")},provider:{name:p,icon:"bwi-provider",appRoute:["/providers",null===(o=t[0])||void 0===o?void 0:o.id],isActive:this.router.url.includes("/providers/")},orgs:{name:"Organizations",icon:"bwi-business",marketingRoute:m,otherProductOverrides:{name:"Share your passwords",supportingText:this.i18nService.t("protectYourFamilyOrBusiness")}}},f=[v.pm];return c&&f.push(v.sm),d&&f.push(v.ac),t.length>0&&f.push(v.provider),{bento:f,other:[]}})),this.pollUntilSynced()}pollUntilSynced(){const e=setInterval(()=>C(this,void 0,void 0,function*(){null!==(yield this.syncService.getLastSync())&&(clearInterval(e),this.syncCompleted$.next())}),200)}}T.ɵfac=function(e){return new(e||T)(f.KVO(u.PV),f.KVO(g.$),f.KVO(n.nX),f.KVO(n.Ix),f.KVO(v.H),f.KVO(y.Di),f.KVO(b.y),f.KVO(w.m),f.KVO(S.W),f.KVO(I.Q),f.KVO(k.w))},T.ɵprov=f.jDH({token:T,factory:T.ɵfac,providedIn:"root"})},78952:(e,t,i)=>{"use strict";i.d(t,{S:()=>l});var n=i(93161),r=i(77468),s=i(33812);const o=[[["","slot","start"]],"*",[["","slot","end"]]],a=e=>({"tw-hidden":e});class l{get disabledAttr(){return this.disabled||null}constructor(e){this.elementRef=e,this.classList=["tw-block","tw-w-full","tw-py-1.5","tw-px-3","!tw-text-main","!tw-no-underline","tw-cursor-pointer","tw-border-none","tw-bg-background","tw-text-left","hover:tw-bg-hover-default","focus-visible:tw-z-50","focus-visible:tw-outline-none","focus-visible:tw-ring-2","focus-visible:tw-rounded-lg","focus-visible:tw-ring-inset","focus-visible:tw-ring-primary-600","active:!tw-ring-0","active:!tw-ring-offset-0","disabled:!tw-text-muted","disabled:hover:tw-bg-background","disabled:tw-cursor-not-allowed"],this.role="menuitem",this.tabIndex="-1",this.disabled=!1}focus(){this.elementRef.nativeElement.focus()}}l.ɵfac=function(e){return new(e||l)(s.rXU(s.aKT))},l.ɵcmp=s.VBU({type:l,selectors:[["","bitMenuItem",""]],hostVars:5,hostBindings:function(e,t){2&e&&(s.Avn("tabIndex",t.tabIndex),s.BMQ("role",t.role)("disabled",t.disabledAttr),s.HbH(t.classList))},inputs:{disabled:[2,"disabled","disabled",n.he]},attrs:["bitMenuItem",""],ngContentSelectors:["[slot=start]","*","[slot=end]"],decls:10,vars:6,consts:[["startSlot",""],["endSlot",""],[1,"tw-flex","tw-w-full","tw-justify-between","tw-items-center","tw-gap-2"],[1,"tw-flex","tw-gap-2","tw-items-center","tw-overflow-hidden"],[3,"ngClass"],[1,"tw-truncate"]],template:function(e,t){if(1&e&&(s.NAR(o),s.j41(0,"div",2)(1,"span",3)(2,"span",4,0),s.SdG(4),s.k0s(),s.j41(5,"span",5),s.SdG(6,1),s.k0s()(),s.j41(7,"span",4,1),s.SdG(9,2),s.k0s()()),2&e){const e=s.sdS(3),t=s.sdS(8);s.R7$(2),s.Y8G("ngClass",s.eq3(2,a,0===e.childElementCount)),s.R7$(5),s.Y8G("ngClass",s.eq3(4,a,0===t.childElementCount))}},dependencies:[r.YU],encapsulation:2})},78991:(e,t,i)=>{"use strict";function n(e){const t=Reflect.ownKeys(e);for(const i of t){const t=e[i];t&&"object"==typeof t&&n(t)}return Object.freeze(e)}function r(e){return"string"==typeof e}i.d(t,{_g:()=>r,ol:()=>n})},79303:(e,t,i)=>{"use strict";i.d(t,{B:()=>a});var n=i(62963),r=i(10840),s=i(74208),o=i(33812);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=o.$C({type:a}),a.ɵinj=s.G2t({imports:[n.G,r.Y]})},79667:(e,t,i)=>{"use strict";i.d(t,{v:()=>n});class n{}},79703:(e,t,i)=>{"use strict";i.d(t,{m:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},79783:(e,t,i)=>{"use strict";i.d(t,{k:()=>o});var n=i(85800),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.r]})},80351:(e,t,i)=>{"use strict";i.d(t,{j:()=>o});var n=i(44432),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.G]})},80378:(e,t,i)=>{"use strict";var n;i.d(t,{C:()=>n}),function(e){e.Enabled="Enabled",e.RequiresPremium="RequiresPremium",e.RequiresUpgrade="RequiresUpgrade",e.RequiresEnterprise="RequiresEnterprise"}(n||(n={}))},80504:(e,t,i)=>{"use strict";i.d(t,{nI:()=>ne,C0:()=>oe.C,AX:()=>Se,DF:()=>ce,uE:()=>se});var n=i(77468),r=i(22166),s=i(72932),o=i(25065),a=i(14092),l=i(10840),c=i(39738),d=i(8144),u=i(62819),h=i(6056),p=i(2780),m=i(74208),v=i(23649),f=i(93695),g=i(84079),y=i(44500),b=i(36359),w=i(35500),S=i(58329),I=i(43090);function k(){return(e,t)=>{const i=(0,m.WQX)(v.Ix),n=(0,m.WQX)(I.l),r=(0,m.WQX)(S.Q);return(0,m.WQX)(w.Di).activeAccount$.pipe((0,y.n)(e=>e?r.hasPremiumFromAnySource$(e.id):(0,f.of)(!1)),(0,y.n)(e=>e?(0,f.of)(e):(0,g.H)(n.promptForPremium()).pipe((0,y.n)(()=>(0,f.of)(e)))),(0,b.M)(e=>{if(!e&&"/login"===i.url)return i.createUrlTree(["/"])}))}}var C=i(51757),T=i(72245),F=i(3204),R=i(33812),P=i(72331),x=i(45154),$=i(56898),E=i(44432),A=i(10672),D=i(86226),O=i(97553),M=i(43759),U=i(93748),G=i(88016),j=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function N(e,t){1&e&&(R.j41(0,"p"),R.EFF(1),R.nI1(2,"i18n"),R.k0s()),2&e&&(R.R7$(),R.SpI("",R.bMT(2,1,"reportError"),"..."))}function V(e,t){if(1&e&&(R.j41(0,"bit-callout",11),R.nI1(1,"i18n"),R.EFF(2),R.nI1(3,"i18n"),R.k0s()),2&e){const e=R.XpG(3);R.Y8G("title",R.mNQ(R.bMT(1,3,"goodNews"))),R.R7$(2),R.SpI(" ",R.i5U(3,5,"breachUsernameNotFound",e.checkedUsername)," ")}}function B(e,t){if(1&e&&(R.j41(0,"bit-callout",12),R.nI1(1,"i18n"),R.EFF(2),R.nI1(3,"i18n"),R.k0s()),2&e){const e=R.XpG(3);R.Y8G("title",R.mNQ(R.bMT(1,3,"breachFound"))),R.R7$(2),R.SpI(" ",R.brH(3,5,"breachUsernameFound",e.checkedUsername,e.breachedAccounts.length)," ")}}function z(e,t){if(1&e&&(R.j41(0,"li"),R.EFF(1),R.k0s()),2&e){const e=t.$implicit;R.R7$(),R.JRh(e)}}function L(e,t){if(1&e&&(R.j41(0,"li",15)(1,"div",16),R.nrm(2,"img",17),R.k0s(),R.j41(3,"div",18)(4,"h3",19),R.EFF(5),R.k0s(),R.nrm(6,"p",20),R.j41(7,"p",21),R.EFF(8),R.nI1(9,"i18n"),R.k0s(),R.j41(10,"ul"),R.DNE(11,z,2,1,"li",22),R.k0s()(),R.j41(12,"div",23)(13,"dl")(14,"dt"),R.EFF(15),R.nI1(16,"i18n"),R.k0s(),R.j41(17,"dd"),R.EFF(18),R.k0s(),R.j41(19,"dt"),R.EFF(20),R.nI1(21,"i18n"),R.k0s(),R.j41(22,"dd"),R.EFF(23),R.nI1(24,"number"),R.k0s(),R.j41(25,"dt"),R.EFF(26),R.nI1(27,"i18n"),R.k0s(),R.j41(28,"dd"),R.EFF(29),R.nI1(30,"date"),R.k0s(),R.j41(31,"dt"),R.EFF(32),R.nI1(33,"i18n"),R.k0s(),R.j41(34,"dd"),R.EFF(35),R.nI1(36,"date"),R.k0s()()()()),2&e){const e=t.$implicit;R.R7$(2),R.Y8G("src",e.logoPath,R.B4B),R.R7$(3),R.JRh(e.title),R.R7$(),R.Y8G("innerHTML",e.description,R.npT),R.R7$(2),R.SpI("",R.bMT(9,13,"compromisedData"),":"),R.R7$(3),R.Y8G("ngForOf",e.dataClasses),R.R7$(4),R.JRh(R.bMT(16,15,"website")),R.R7$(3),R.JRh(e.domain),R.R7$(2),R.JRh(R.bMT(21,17,"affectedUsers")),R.R7$(3),R.JRh(R.bMT(24,19,e.pwnCount)),R.R7$(3),R.JRh(R.bMT(27,21,"breachOccurred")),R.R7$(3),R.JRh(R.i5U(30,23,e.breachDate,"mediumDate")),R.R7$(3),R.JRh(R.bMT(33,26,"breachReported")),R.R7$(3),R.JRh(R.i5U(36,28,e.addedDate,"mediumDate"))}}function K(e,t){if(1&e&&(R.j41(0,"ul",13),R.DNE(1,L,37,31,"li",14),R.k0s()),2&e){const e=R.XpG(3);R.R7$(),R.Y8G("ngForOf",e.breachedAccounts)}}function q(e,t){if(1&e&&(R.qex(0),R.DNE(1,V,4,8,"bit-callout",8)(2,B,4,9,"bit-callout",9)(3,K,2,1,"ul",10),R.bVm()),2&e){const e=R.XpG(2);R.R7$(),R.Y8G("ngIf",!e.breachedAccounts.length),R.R7$(),R.Y8G("ngIf",e.breachedAccounts.length),R.R7$(),R.Y8G("ngIf",e.breachedAccounts.length)}}function _(e,t){if(1&e&&(R.j41(0,"div",6),R.DNE(1,N,3,3,"p",7)(2,q,4,3,"ng-container",7),R.k0s()),2&e){const e=R.XpG();R.R7$(),R.Y8G("ngIf",e.error),R.R7$(),R.Y8G("ngIf",!e.error)}}class X{constructor(e,t,i){this.auditService=e,this.accountService=t,this.formBuilder=i,this.loading=!1,this.error=!1,this.breachedAccounts=[],this.formGroup=this.formBuilder.group({username:["",{validators:[C.k0.required],updateOn:"change"}]}),this.submit=()=>j(this,void 0,void 0,function*(){if(this.formGroup.markAsTouched(),this.formGroup.invalid)return;this.error=!1,this.loading=!0;const e=this.formGroup.value.username.toLowerCase();try{this.breachedAccounts=yield this.auditService.breachedAccounts(e)}catch(t){this.error=!0}finally{this.loading=!1}this.checkedUsername=e})}ngOnInit(){return j(this,void 0,void 0,function*(){this.formGroup.get("username").setValue(yield(0,T._)(this.accountService.activeAccount$.pipe((0,F.T)(e=>null==e?void 0:e.email))))})}}X.ɵfac=function(e){return new(e||X)(R.rXU(P.d),R.rXU(w.Di),R.rXU(C.ok))},X.ɵcmp=R.VBU({type:X,selectors:[["app-breach-report"]],standalone:!1,decls:18,vars:16,consts:[[3,"bitSubmit","formGroup"],["disableMargin","",1,"tw-w-1/2"],["id","username","type","text","formControlName","username","bitInput",""],[1,"tw-mb-4","tw-block","tw-text-muted"],["type","submit","buttonType","primary","bitButton","",3,"loading"],["class","tw-mt-4",4,"ngIf"],[1,"tw-mt-4"],[4,"ngIf"],["type","success",3,"title",4,"ngIf"],["type","danger",3,"title",4,"ngIf"],["class","tw-list-none tw-flex-col tw-divide-x-0 tw-divide-y tw-divide-solid tw-divide-secondary-300 tw-rounded tw-border tw-border-solid tw-border-secondary-300 tw-p-0",4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title"],[1,"tw-list-none","tw-flex-col","tw-divide-x-0","tw-divide-y","tw-divide-solid","tw-divide-secondary-300","tw-rounded","tw-border","tw-border-solid","tw-border-secondary-300","tw-p-0"],["class","tw-flex tw-gap-4 tw-p-4",4,"ngFor","ngForOf"],[1,"tw-flex","tw-gap-4","tw-p-4"],[1,"tw-w-32","tw-flex-none"],["alt","",1,"tw-max-w-32","tw-items-stretch",3,"src"],[1,"tw-flex-auto"],[1,"tw-text-lg"],[3,"innerHTML"],[1,"tw-mb-1"],[4,"ngFor","ngForOf"],[1,"tw-w-48","tw-flex-none"]],template:function(e,t){1&e&&(R.nrm(0,"app-header"),R.j41(1,"bit-container")(2,"p"),R.EFF(3),R.nI1(4,"i18n"),R.k0s(),R.j41(5,"form",0)(6,"bit-form-field",1)(7,"bit-label"),R.EFF(8),R.nI1(9,"i18n"),R.k0s(),R.nrm(10,"input",2),R.k0s(),R.j41(11,"small",3),R.EFF(12),R.nI1(13,"i18n"),R.k0s(),R.j41(14,"button",4),R.EFF(15),R.nI1(16,"i18n"),R.k0s()(),R.DNE(17,_,3,2,"div",5),R.k0s()),2&e&&(R.R7$(3),R.JRh(R.bMT(4,8,"breachDesc")),R.R7$(2),R.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),R.R7$(3),R.JRh(R.bMT(9,10,"username")),R.R7$(4),R.JRh(R.bMT(13,12,"breachCheckUsernameEmail")),R.R7$(2),R.Y8G("loading",t.loading),R.R7$(),R.SpI(" ",R.bMT(16,14,"checkBreaches")," "),R.R7$(2),R.Y8G("ngIf",!t.loading&&t.checkedUsername))},dependencies:[n.Sq,n.bT,C.qT,C.me,C.BC,C.cb,C.j4,C.JD,x.L,$.Q,E.G,A.H,D.j,O.J,M.h,U.f,n.QX,n.vh,G.$],encapsulation:2});var Y=i(85037),H=i(30414),W=i(13299);const J=W.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.7 2.4 79.3 77.2">
    <path class="tw-fill-illustration-bg-primary" d="M17.6 26.8a4.8 4.8 0 0 1 4.8-4.8h52.8a4.8 4.8 0 0 1 4.8 4.8v33.6a4.8 4.8 0 0 1-4.8 4.8H22.4a4.8 4.8 0 0 1-4.8-4.8V26.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75.2 23.6H22.4a3.2 3.2 0 0 0-3.2 3.2v33.6a3.2 3.2 0 0 0 3.2 3.2h52.8a3.2 3.2 0 0 0 3.2-3.2V26.8a3.2 3.2 0 0 0-3.2-3.2ZM22.4 22a4.8 4.8 0 0 0-4.8 4.8v33.6a4.8 4.8 0 0 0 4.8 4.8h52.8a4.8 4.8 0 0 0 4.8-4.8V26.8a4.8 4.8 0 0 0-4.8-4.8H22.4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M17.6 26.8H80v33.6H17.6V26.8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M78.4 28.4H19.2v30.4h59.2V28.4Zm-60.8-1.6v33.6H80V26.8H17.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M41.6 64.4H56v14.4H41.6V64.4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M40.8 63.6h16V78h6.4a.8.8 0 0 1 0 1.6H34.4a.8.8 0 0 1 0-1.6h6.4V63.6ZM42.4 78h12.8V65.2H42.4V78Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M42.4 65.2h12.8V70H42.4v-4.8Z"/>
    <path class="tw-fill-illustration-tertiary" d="M56.8 43.6a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48.8 50a6.4 6.4 0 1 0 0-12.8 6.4 6.4 0 0 0 0 12.8Zm0 1.6a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M11.496 20.793c0 10.158 8.235 18.392 18.393 18.392 10.158 0 18.392-8.234 18.392-18.392S40.047 2.4 29.89 2.4s-18.393 8.235-18.393 18.393Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.889 37.585c-9.274 0-16.793-7.518-16.793-16.792C13.096 11.519 20.614 4 29.89 4 39.163 4 46.68 11.52 46.68 20.793S39.163 37.585 29.89 37.585Zm0 1.6c-10.158 0-18.393-8.234-18.393-18.392S19.731 2.4 29.89 2.4c10.158 0 18.392 8.235 18.392 18.393 0 10.158-8.234 18.392-18.392 18.392Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M16.093 20.792c0 7.619 6.176 13.795 13.794 13.795 7.619 0 13.795-6.176 13.795-13.795 0-7.618-6.176-13.794-13.795-13.794-7.618 0-13.794 6.176-13.794 13.794Z"/>
    <path class="tw-fill-illustration-outline" d="m1.197 47.71 15.356-14.503 1.84 1.84L3.889 50.402a1.6 1.6 0 0 1-2.294.032l-.43-.43a1.6 1.6 0 0 1 .032-2.295Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M22.402 18.041c.445 0 .806.36.806.806v2.232a.806.806 0 1 1-1.612 0v-2.232c0-.445.36-.806.806-.806Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M25.407 20.22a.794.794 0 0 1-.543.994l-2.232.638a.819.819 0 0 1-1.006-.55.793.793 0 0 1 .543-.995l2.232-.637a.819.819 0 0 1 1.006.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M24.465 23.968a.828.828 0 0 1-1.134-.204l-1.594-2.232a.785.785 0 0 1 .195-1.11.828.828 0 0 1 1.134.204l1.595 2.232c.259.363.171.86-.196 1.11Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M19.395 20.22a.794.794 0 0 0 .544.994l2.231.638a.819.819 0 0 0 1.007-.551.793.793 0 0 0-.543-.994l-2.232-.637a.819.819 0 0 0-1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20.338 23.968a.828.828 0 0 0 1.134-.204l1.594-2.232a.785.785 0 0 0-.195-1.11.828.828 0 0 0-1.135.204l-1.594 2.232a.785.785 0 0 0 .196 1.11ZM29.954 18.041c.446 0 .807.36.807.806v2.232a.806.806 0 1 1-1.613 0v-2.232c0-.445.361-.806.806-.806Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M32.96 20.22a.793.793 0 0 1-.543.994l-2.232.638a.819.819 0 0 1-1.006-.55.794.794 0 0 1 .543-.995l2.231-.637a.819.819 0 0 1 1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M32.018 23.968a.828.828 0 0 1-1.135-.204l-1.594-2.232a.785.785 0 0 1 .196-1.11.828.828 0 0 1 1.134.204l1.594 2.232c.26.363.172.86-.195 1.11Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M26.948 20.22a.793.793 0 0 0 .543.994l2.232.638a.82.82 0 0 0 1.006-.551.794.794 0 0 0-.543-.994l-2.231-.637a.819.819 0 0 0-1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M27.89 23.968a.828.828 0 0 0 1.135-.204l1.594-2.232a.785.785 0 0 0-.195-1.11.828.828 0 0 0-1.135.204l-1.594 2.232a.785.785 0 0 0 .195 1.11ZM37.505 18.041c.445 0 .806.36.806.806v2.232a.806.806 0 1 1-1.612 0v-2.232c0-.445.361-.806.806-.806Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M40.513 20.22a.793.793 0 0 1-.543.994l-2.232.638a.819.819 0 0 1-1.007-.55.793.793 0 0 1 .543-.995l2.232-.637a.819.819 0 0 1 1.007.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M39.569 23.968a.828.828 0 0 1-1.135-.204l-1.594-2.232a.785.785 0 0 1 .195-1.11.828.828 0 0 1 1.135.204l1.594 2.232c.26.363.172.86-.195 1.11Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M34.5 20.22a.793.793 0 0 0 .542.994l2.232.638a.82.82 0 0 0 1.006-.551.794.794 0 0 0-.543-.994l-2.232-.637a.819.819 0 0 0-1.006.55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35.443 23.968a.828.828 0 0 0 1.135-.204l1.594-2.232a.785.785 0 0 0-.196-1.11.828.828 0 0 0-1.134.204l-1.594 2.232a.785.785 0 0 0 .195 1.11Z" clip-rule="evenodd"/>
  </svg>
`;var Z=i(9171);const Q=W.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0.99 80 73.35">
    <path class="tw-fill-illustration-bg-primary" d="M11.666 32.667c0-5.523 3.806-10 8.5-10h39.667c4.694 0 8.5 4.477 8.5 10v31.667c0 5.522-3.806 10-8.5 10H20.166c-4.694 0-8.5-4.478-8.5-10V32.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.833 24.334H20.166c-3.912 0-7.083 3.73-7.083 8.333v31.667c0 4.602 3.171 8.333 7.083 8.333h39.667c3.912 0 7.083-3.731 7.083-8.333V32.667c0-4.602-3.171-8.333-7.083-8.333Zm-39.667-1.667c-4.694 0-8.5 4.477-8.5 10v31.667c0 5.522 3.806 10 8.5 10h39.667c4.694 0 8.5-4.478 8.5-10V32.667c0-5.523-3.806-10-8.5-10H20.166Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M13.334 56.833h53.333V63.5H13.334v-6.667Z"/>
    <path class="tw-fill-illustration-tertiary" d="M0 48.5c0-5.523 4.477-10 10-10h60c5.523 0 10 4.477 10 10s-4.477 10-10 10H10c-5.523 0-10-4.477-10-10Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 40.167H10a8.333 8.333 0 1 0 0 16.666h60a8.333 8.333 0 1 0 0-16.666ZM10 38.5c-5.523 0-10 4.477-10 10s4.477 10 10 10h60c5.523 0 10-4.477 10-10s-4.477-10-10-10H10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16.667 43.5c.46 0 .834.389.834.868v3.48l3.117-1.658c.423-.225.942-.078 1.158.328.216.407.047.919-.376 1.144l-3.364 1.789 2.69 2.885c.327.35.319.89-.018 1.203-.336.314-.874.284-1.201-.067l-2.84-3.045-2.84 3.045c-.326.351-.864.38-1.2.067-.337-.314-.345-.853-.018-1.203l2.69-2.885-3.364-1.79c-.424-.224-.592-.736-.376-1.143.216-.406.735-.553 1.158-.328l3.117 1.658v-3.48c0-.48.373-.868.833-.868Zm13.334 0c.46 0 .833.389.833.868v3.48l3.117-1.658c.423-.225.942-.078 1.158.328.216.407.048.919-.376 1.144L31.37 49.45l2.69 2.885c.327.35.32.89-.017 1.203-.337.314-.875.284-1.202-.067L30 50.427l-2.839 3.045c-.327.351-.865.38-1.201.067-.337-.314-.345-.853-.018-1.203l2.69-2.885-3.364-1.79c-.424-.224-.592-.736-.376-1.143.216-.406.735-.553 1.158-.328l3.117 1.658v-3.48c0-.48.373-.868.834-.868Zm14.166.868c0-.48-.373-.868-.833-.868-.46 0-.833.389-.833.868v3.48l-3.117-1.658c-.424-.225-.942-.078-1.158.328-.216.407-.048.919.375 1.144l3.365 1.789-2.69 2.885c-.328.35-.32.89.017 1.203.337.314.874.284 1.202-.067l2.839-3.045 2.84 3.045c.327.351.864.38 1.201.067.337-.314.344-.853.017-1.203l-2.69-2.885 3.365-1.79c.423-.224.591-.736.375-1.143-.216-.406-.734-.553-1.158-.328l-3.117 1.657v-3.479Zm6.667 8.299c0-.46.373-.834.833-.834h6.667a.833.833 0 0 1 0 1.667h-6.667a.833.833 0 0 1-.833-.833Zm10.833-.834a.833.833 0 0 0 0 1.667h6.667a.833.833 0 0 0 0-1.667h-6.667Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M55.833 17.644v-.025c0-8.745-7.09-15.834-15.834-15.834S24.166 8.874 24.166 17.62v5.833h5v-5.834c0-5.983 4.85-10.833 10.833-10.833 5.983 0 10.834 4.85 10.834 10.834v.025h5Z"/>
    <path class="tw-fill-illustration-bg-primary" d="M24.785 19.488h3.775v3.333h-3.775z"/>
    <path class="tw-fill-illustration-outline" d="M28.367 17.618c0-6.424 5.208-11.632 11.633-11.633 6.164 0 11.206 4.795 11.605 10.859h3.409C54.61 8.9 48.043 2.585 40 2.585c-8.302 0-15.033 6.73-15.033 15.033v5.033h3.4v-5.033Zm1.6 5.834a.8.8 0 0 1-.8.8h-5a.8.8 0 0 1-.8-.8v-5.834C23.367 8.432 30.814.986 40 .985c9.186 0 16.634 7.447 16.634 16.633v.027a.8.8 0 0 1-.8.8h-5a.802.802 0 0 1-.8-.8v-.027C50.032 12.078 45.54 7.585 40 7.585s-10.033 4.492-10.033 10.033v5.834Z"/>
  </svg>
`,ee=W.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.4 10.07 79.2 60">
    <path class="tw-fill-illustration-bg-primary" d="M.4 14.872a4.8 4.8 0 0 1 4.8-4.8h69.6a4.8 4.8 0 0 1 4.8 4.8v50.4a4.8 4.8 0 0 1-4.8 4.8H5.2a4.8 4.8 0 0 1-4.8-4.8v-50.4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M74.8 11.672H5.2a3.2 3.2 0 0 0-3.2 3.2v50.4a3.2 3.2 0 0 0 3.2 3.2h69.6a3.2 3.2 0 0 0 3.2-3.2v-50.4a3.2 3.2 0 0 0-3.2-3.2Zm-69.6-1.6a4.8 4.8 0 0 0-4.8 4.8v50.4a4.8 4.8 0 0 0 4.8 4.8h69.6a4.8 4.8 0 0 0 4.8-4.8v-50.4a4.8 4.8 0 0 0-4.8-4.8H5.2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M79.6 24.166H.4v-1.6h79.2v1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M75.176 17.323a2.415 2.415 0 0 1-2.412 2.417 2.415 2.415 0 0 1-2.412-2.417 2.415 2.415 0 0 1 2.412-2.417 2.415 2.415 0 0 1 2.412 2.417ZM67.94 17.323a2.415 2.415 0 0 1-2.413 2.417 2.415 2.415 0 0 1-2.412-2.417 2.415 2.415 0 0 1 2.412-2.417 2.415 2.415 0 0 1 2.412 2.417ZM60.705 17.323a2.415 2.415 0 0 1-2.412 2.417 2.415 2.415 0 0 1-2.412-2.417 2.415 2.415 0 0 1 2.412-2.417 2.415 2.415 0 0 1 2.412 2.417Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M40.104 65.54c10.696 0 19.367-8.67 19.367-19.367 0-10.696-8.671-19.367-19.367-19.367-10.697 0-19.368 8.67-19.368 19.367 0 10.696 8.671 19.367 19.368 19.367Zm-9.705-26.63a2.4 2.4 0 0 0-2.4 2.4v14.568a2.4 2.4 0 0 0 2.4 2.4h19.41a2.4 2.4 0 0 0 2.4-2.4V41.31a2.4 2.4 0 0 0-2.4-2.4h-19.41Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M28 41.31a2.4 2.4 0 0 1 2.4-2.4h19.41a2.4 2.4 0 0 1 2.4 2.4v14.568a2.4 2.4 0 0 1-2.4 2.4H30.4a2.4 2.4 0 0 1-2.4-2.4V41.31Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M49.81 40.51H30.4a.8.8 0 0 0-.8.8v14.568a.8.8 0 0 0 .8.8h19.41a.8.8 0 0 0 .8-.8V41.31a.8.8 0 0 0-.8-.8Zm-19.41-1.6a2.4 2.4 0 0 0-2.4 2.4v14.568a2.4 2.4 0 0 0 2.4 2.4h19.41a2.4 2.4 0 0 0 2.4-2.4V41.31a2.4 2.4 0 0 0-2.4-2.4H30.4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M38.895 46.172a1.21 1.21 0 0 1 2.42 0v4.842a1.21 1.21 0 0 1-2.42 0v-4.842Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M34.928 39.108a5.642 5.642 0 0 1 9.772-5.642l.605 1.048a.8.8 0 1 1-1.385.8l-.605-1.048a4.042 4.042 0 0 0-7.001 4.042l.605 1.048a.8.8 0 0 1-1.385.8l-.606-1.048Z" clip-rule="evenodd"/>
  </svg>
`;var te=i(90005);const ie=W.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="11.6 3.33 56.67 73.33">
    <path class="tw-fill-illustration-bg-secondary" d="M60 10a1.6 1.6 0 0 1 1.6 1.6v63.467a1.6 1.6 0 0 1-1.6 1.6H13.2a1.6 1.6 0 0 1-1.6-1.6V11.6a1.6 1.6 0 0 1 1.6-1.6H60Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60 75.067V11.6H13.2v63.467H60ZM61.6 11.6A1.6 1.6 0 0 0 60 10H13.2a1.6 1.6 0 0 0-1.6 1.6v63.467a1.6 1.6 0 0 0 1.6 1.6H60a1.6 1.6 0 0 0 1.6-1.6V11.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M68.266 68.4V4.933a1.6 1.6 0 0 0-1.6-1.6H31.012c-.425 0-.827.164-1.127.464L18.733 14.95c-.3.3-.467.706-.467 1.13V68.4a1.6 1.6 0 0 0 1.6 1.6h46.8a1.6 1.6 0 0 0 1.6-1.6Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M66.666 68.4V4.933H31.012L19.866 16.079V68.4h46.8Zm1.6-63.467V68.4a1.6 1.6 0 0 1-1.6 1.6h-46.8a1.6 1.6 0 0 1-1.6-1.6V16.08c0-.425.167-.83.467-1.13L29.885 3.796c.3-.3.702-.464 1.127-.464h35.654a1.6 1.6 0 0 1 1.6 1.6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M31.6 4.2a.8.8 0 0 1 .8.8v11.666a.8.8 0 0 1-.8.8H19.932a.8.8 0 0 1 0-1.6h10.866V4.999a.8.8 0 0 1 .8-.8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M39.617 22.914c1.642-2.825 5.723-2.825 7.365 0l10.896 18.741c1.651 2.84-.397 6.401-3.682 6.401H32.403c-3.285 0-5.334-3.56-3.683-6.4l10.897-18.742Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M38.925 22.51c1.951-3.355 6.798-3.355 8.75 0L58.57 41.254c1.962 3.373-.472 7.603-4.374 7.603H32.403c-3.901 0-6.335-4.23-4.374-7.603L38.925 22.51Zm7.366.805c-1.334-2.295-4.648-2.295-5.982 0L29.412 42.057c-1.34 2.306.323 5.199 2.991 5.199h21.793c2.668 0 4.332-2.893 2.991-5.2L46.291 23.316Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M44.764 42.2a1.464 1.464 0 1 1-2.928 0 1.464 1.464 0 0 1 2.928 0ZM41.155 29.495a.426.426 0 0 1 .423-.472h3.444c.254 0 .45.22.424.472l-1.007 9.396a.426.426 0 0 1-.423.38h-1.43a.426.426 0 0 1-.424-.38l-.509-4.743-.498-4.653Z"/>
  </svg>
`;var ne,re=i(54006);!function(e){e.ExposedPasswords="exposedPasswords",e.ReusedPasswords="reusedPasswords",e.WeakPasswords="weakPasswords",e.UnsecuredWebsites="unsecuredWebsites",e.Inactive2fa="inactive2fa",e.DataBreach="dataBreach",e.MemberAccessReport="memberAccessReport"}(ne||(ne={}));const se={[ne.ExposedPasswords]:{title:"exposedPasswordsReport",description:"exposedPasswordsReportDesc",route:"exposed-passwords-report",icon:J},[ne.ReusedPasswords]:{title:"reusedPasswordsReport",description:"reusedPasswordsReportDesc",route:"reused-passwords-report",icon:Z.R},[ne.WeakPasswords]:{title:"weakPasswordsReport",description:"weakPasswordsReportDesc",route:"weak-passwords-report",icon:Q},[ne.UnsecuredWebsites]:{title:"unsecuredWebsitesReport",description:"unsecuredWebsitesReportDesc",route:"unsecured-websites-report",icon:ee},[ne.Inactive2fa]:{title:"inactive2faReport",description:"inactive2faReportDesc",route:"inactive-two-factor-report",icon:te.f},[ne.DataBreach]:{title:"dataBreachReport",description:"breachDesc",route:"breach-report",icon:ie},[ne.MemberAccessReport]:{title:"memberAccessReport",description:"memberAccessReportDesc",route:"member-access-report",icon:re.u}};var oe=i(80378),ae=i(30675),le=i(62963);class ce{}ce.ɵfac=function(e){return new(e||ce)},ce.ɵmod=R.$C({type:ce}),ce.ɵinj=m.G2t({imports:[n.MD,le.G,ae.a]});var de=i(25219),ue=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class he{constructor(e,t){this.billingAccountProfileStateService=e,this.accountService=t}ngOnInit(){return ue(this,void 0,void 0,function*(){const e=yield(0,T._)(this.accountService.activeAccount$),t=(yield(0,T._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id)))?oe.C.Enabled:oe.C.RequiresPremium;this.reports=[Object.assign(Object.assign({},se[ne.ExposedPasswords]),{variant:t}),Object.assign(Object.assign({},se[ne.ReusedPasswords]),{variant:t}),Object.assign(Object.assign({},se[ne.WeakPasswords]),{variant:t}),Object.assign(Object.assign({},se[ne.UnsecuredWebsites]),{variant:t}),Object.assign(Object.assign({},se[ne.Inactive2fa]),{variant:t}),Object.assign(Object.assign({},se[ne.DataBreach]),{variant:oe.C.Enabled})]})}}he.ɵfac=function(e){return new(e||he)(R.rXU(S.Q),R.rXU(w.Di))},he.ɵcmp=R.VBU({type:he,selectors:[["app-reports-home"]],standalone:!1,decls:6,vars:4,consts:[[3,"reports"]],template:function(e,t){1&e&&(R.nrm(0,"app-header"),R.j41(1,"bit-container")(2,"p"),R.EFF(3),R.nI1(4,"i18n"),R.k0s(),R.nrm(5,"app-report-list",0),R.k0s()),2&e&&(R.R7$(3),R.JRh(R.bMT(4,2,"reportsDesc")),R.R7$(2),R.Y8G("reports",t.reports))},dependencies:[A.H,de.i,U.f,G.$],encapsulation:2});var pe=i(17343),me=i(71687),ve=i(72523),fe=i(69194);function ge(e,t){1&e&&(R.j41(0,"a",3),R.EFF(1),R.nI1(2,"i18n"),R.k0s()),2&e&&(R.R7$(),R.SpI(" ",R.bMT(2,1,"backToReports")," "))}class ye{constructor(e){this.homepage=!0,this.subscription=e.events.pipe((0,fe.p)(e=>e instanceof v.wF)).subscribe(e=>{this.homepage="/reports"==e.url})}ngOnDestroy(){var e;null===(e=this.subscription)||void 0===e||e.unsubscribe()}}ye.ɵfac=function(e){return new(e||ye)(R.rXU(v.Ix))},ye.ɵcmp=R.VBU({type:ye,selectors:[["app-reports-layout"]],standalone:!1,decls:4,vars:1,consts:[[1,"tw-flex","tw-flex-wrap","tw-gap-4","tw-mt-4"],[1,"tw-w-full"],["bitButton","","routerLink","./",4,"ngIf"],["bitButton","","routerLink","./"]],template:function(e,t){1&e&&(R.nrm(0,"router-outlet"),R.j41(1,"div",0)(2,"div",1),R.DNE(3,ge,3,3,"a",2),R.k0s()()),2&e&&(R.R7$(3),R.Y8G("ngIf",!t.homepage))},dependencies:[n.bT,v.n3,h.Wk,$.Q,G.$],encapsulation:2});const be=[{path:"",component:ye,canActivate:[p.W_],children:[{path:"",pathMatch:"full",component:he,data:{titleId:"reports",homepage:!0}},{path:"breach-report",component:X,data:{titleId:"dataBreachReport"}},{path:"reused-passwords-report",component:pe.A,data:{titleId:"reusedPasswordsReport"},canActivate:[k()]},{path:"unsecured-websites-report",component:me.U,data:{titleId:"unsecuredWebsitesReport"},canActivate:[k()]},{path:"weak-passwords-report",component:ve.w,data:{titleId:"weakPasswordsReport"},canActivate:[k()]},{path:"exposed-passwords-report",component:Y.y,data:{titleId:"exposedPasswordsReport"},canActivate:[k()]},{path:"inactive-two-factor-report",component:H.O,data:{titleId:"inactive2faReport"},canActivate:[k()]}]}];class we{}we.ɵfac=function(e){return new(e||we)},we.ɵmod=R.$C({type:we}),we.ɵinj=m.G2t({imports:[h.iI.forChild(be),h.iI]});class Se{}Se.ɵfac=function(e){return new(e||Se)},Se.ɵmod=R.$C({type:Se}),Se.ɵinj=m.G2t({providers:[{provide:r.hI,useClass:r.Ws},d.B,u.l,c.a],imports:[n.MD,o.G,ce,we,a.t,l.Y,s.G]})},80755:(e,t,i)=>{"use strict";i.d(t,{p:()=>T});var n=i(72245),r=i(54967),s=i(38449),o=i(39306),a=i(56962),l=i(78781),c=i(23293),d=i(22848),u=i(15740),h=i(57396);class p{}class m{}class v{}class f{}class g{}class y extends g{}var b=i(59333),w=i(74208),S=i(12012),I=i(89105),k=i(5556),C=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class T{constructor(e,t,i,n,r,s){this.emergencyAccessApiService=e,this.apiService=t,this.keyService=i,this.encryptService=n,this.cipherService=r,this.logService=s}getEmergencyAccess(e){return this.emergencyAccessApiService.getEmergencyAccess(e)}getEmergencyAccessTrusted(){return C(this,void 0,void 0,function*(){const e=yield this.emergencyAccessApiService.getEmergencyAccessTrusted();return e&&0!==e.data.length?e.data.map(e=>h.cY.fromResponse(e)):[]})}getEmergencyAccessGranted(){return C(this,void 0,void 0,function*(){const e=yield this.emergencyAccessApiService.getEmergencyAccessGranted();return e&&0!==e.data.length?e.data.map(e=>h.RR.fromResponse(e)):[]})}getGrantorPolicies(e){return C(this,void 0,void 0,function*(){const t=yield this.emergencyAccessApiService.getEmergencyGrantorPolicies(e);let i=[];return null!=t.data&&t.data.length>0&&(i=t.data.map(e=>new s.P(new r.L(e)))),i})}invite(e,t,i){return C(this,void 0,void 0,function*(){const n=new v;n.email=e.trim(),n.type=t,n.waitTimeDays=i,yield this.emergencyAccessApiService.postEmergencyAccessInvite(n)})}reinvite(e){return this.emergencyAccessApiService.postEmergencyAccessReinvite(e)}update(e,t,i){return C(this,void 0,void 0,function*(){const n=new g;n.type=t,n.waitTimeDays=i,yield this.emergencyAccessApiService.putEmergencyAccess(e,n)})}accept(e,t){return C(this,void 0,void 0,function*(){const i=new p;i.token=t,yield this.emergencyAccessApiService.postEmergencyAccessAccept(e,i)})}confirm(e,t,i,r){return C(this,void 0,void 0,function*(){const s=yield(0,n._)(this.keyService.userKey$(r));if(!s)throw new Error("No user key found");try{this.logService.debug("User's fingerprint: "+(yield this.keyService.getFingerprint(t,i)).join("-"))}catch(a){}const o=new m;o.key=yield this.encryptKey(s,i),yield this.emergencyAccessApiService.postEmergencyAccessConfirm(e,o)})}delete(e){return this.emergencyAccessApiService.deleteEmergencyAccess(e)}requestAccess(e){return this.emergencyAccessApiService.postEmergencyAccessInitiate(e)}approve(e){return this.emergencyAccessApiService.postEmergencyAccessApprove(e)}reject(e){return this.emergencyAccessApiService.postEmergencyAccessReject(e)}getViewOnlyCiphers(e,t){return C(this,void 0,void 0,function*(){const i=yield this.emergencyAccessApiService.postEmergencyAccessView(e),r=yield(0,n._)(this.keyService.userPrivateKey$(t));if(null==r)throw new Error("Active user does not have a private key, cannot get view only ciphers.");const s=yield this.encryptService.decapsulateKeyUnsigned(new o.k(i.keyEncrypted),r);let a=[];const l=i.ciphers.map(e=>new c.o(e));return a=yield Promise.all(l.map(e=>C(this,void 0,void 0,function*(){return e.decrypt(s)}))),a.sort(this.cipherService.getLocaleSortingFunction())})}takeover(e,t,i,r){return C(this,void 0,void 0,function*(){const s=yield this.emergencyAccessApiService.postEmergencyAccessTakeover(e),a=yield(0,n._)(this.keyService.userPrivateKey$(r));if(null==a)throw new Error("Active user does not have a private key, cannot complete a takeover.");const l=yield this.encryptService.decapsulateKeyUnsigned(new o.k(s.keyEncrypted),a);if(null==l)throw new Error("Failed to decrypt grantor key");const c=l;let u;switch(s.kdf){case d.ao.PBKDF2_SHA256:u=new d.n1(s.kdfIterations);break;case d.ao.Argon2id:u=new d.hU(s.kdfIterations,s.kdfMemory,s.kdfParallelism)}const h=yield this.keyService.makeMasterKey(t,i,u),p=yield this.keyService.hashMasterKey(t,h),m=yield this.keyService.encryptUserKeyWithMasterKey(h,c);if(null==m||!m[1].encryptedString)throw new Error("masterKeyEncryptedUserKey not found");const v=new f;v.newMasterPasswordHash=p,v.key=m[1].encryptedString,yield this.emergencyAccessApiService.postEmergencyAccessPassword(e,v)})}getEmergencyAccessData(){return C(this,void 0,void 0,function*(){const e=yield this.emergencyAccessApiService.getEmergencyAccessTrusted();if(!e||0===e.data.length)return[];const t=new Set([u.c.Confirmed,u.c.RecoveryInitiated,u.c.RecoveryApproved]);return e.data.filter(e=>t.has(e.status))})}getPublicKeys(){return C(this,void 0,void 0,function*(){const e=yield this.getEmergencyAccessData();return yield Promise.all(e.map(e=>C(this,void 0,void 0,function*(){const t=new h._1;return t.id=e.id,t.granteeId=e.granteeId,t.name=e.name,t.email=e.email,t.type=e.type,t.status=e.status,t.waitTimeDays=e.waitTimeDays,t.creationDate=e.creationDate,t.avatarColor=e.avatarColor,t.publicKey=l.A.fromB64ToArray((yield this.apiService.getUserPublicKey(e.granteeId)).publicKey),t})))})}getRotatedData(e,t,i){return C(this,void 0,void 0,function*(){if(null==e)throw new Error("New user key is required for rotation.");const i=[];this.logService.info("Starting emergency access rotation, with trusted keys: ",t);const n=yield this.getPublicKeys();for(const r of n){if(null==t.find(e=>l.A.fromBufferToHex(e)===l.A.fromBufferToHex(r.publicKey)))throw this.logService.info(`Public key for user ${r.granteeId} is not trusted, skipping rotation.`),new Error("Public key for user is not trusted.");const n=yield this.encryptKey(e,r.publicKey),s=new y;s.id=r.id,s.type=r.type,s.waitTimeDays=r.waitTimeDays,s.keyEncrypted=n,i.push(s)}return i})}encryptKey(e,t){return C(this,void 0,void 0,function*(){const i=yield this.encryptService.encapsulateKeyUnsigned(e,t);if(null==i||!i.encryptedString)throw new Error("publicKeyEncryptedUserKey not found");return i.encryptedString})}}T.ɵfac=function(e){return new(e||T)(w.KVO(b.J),w.KVO(S.G),w.KVO(d.Lu),w.KVO(I.N),w.KVO(k.p),w.KVO(a.K))},T.ɵprov=w.jDH({token:T,factory:T.ɵfac})},80885:(e,t,i)=>{"use strict";i.d(t,{X:()=>v});var n=i(66046),r=i(72245),s=i(14928),o=i(44500),a=i(14803),l=i(84110),c=i(33812),d=i(23649),u=i(37115),h=i(50700),p=i(68455),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class v{constructor(e,t,i,r,s){this.router=e,this.platformUtilService=t,this.i18nService=i,this.route=r,this.authService=s,this.loading=!0,this.authed=!1,this.requiredParameters=[],this.failedShortMessage="inviteAcceptFailedShort",this.failedMessage="inviteAcceptFailed",this.destroy$=new n.B}ngOnInit(){return m(this,void 0,void 0,function*(){this.route.queryParams.pipe((0,s.$)(),(0,o.n)(e=>m(this,void 0,void 0,function*(){let t=this.requiredParameters.some(t=>null==(null==e?void 0:e[t])||""===e[t]),i=null;if(!t){this.email=e.email;if((yield(0,r._)(this.authService.activeAccountStatus$))!==l.J.LoggedOut)try{yield this.authedHandler(e)}catch(n){t=!0,i=n.message}else yield this.unauthedHandler(e)}if(t){const e=null!=i?this.i18nService.t(this.failedShortMessage,i):this.i18nService.t(this.failedMessage);this.platformUtilService.showToast("error",null,e,{timeout:1e4}),this.router.navigate(["/"])}this.loading=!1})),(0,a.Q)(this.destroy$)).subscribe()})}}v.ɵfac=function(e){return new(e||v)(c.rXU(d.Ix),c.rXU(u.y),c.rXU(h.W),c.rXU(d.nX),c.rXU(p.u))},v.ɵdir=c.FsC({type:v})},81285:(e,t,i)=>{"use strict";i.d(t,{nF:()=>Re,dl:()=>ot,$w:()=>ns,v2:()=>Ui,FX:()=>Mn,NH:()=>Gn,jr:()=>Hr,tu:()=>m.t,m5:()=>m.m,XJ:()=>Ie,qG:()=>W,K3:()=>nt,Ak:()=>Be,O_:()=>Te,Mf:()=>xt,l$:()=>is,o:()=>Zr,Rz:()=>$t.R,s7:()=>Nt,el:()=>Pi,mZ:()=>Si,MP:()=>Ei,dz:()=>bi,Xj:()=>Di,r0:()=>On,C5:()=>Pn,Yi:()=>_r,yX:()=>Un,Ms:()=>Hn,lA:()=>Yr,ag:()=>sr,GA:()=>Cn,wV:()=>pn});var n=i(58625),r=i(21274),s=i(81525),o=i(29029),a=i(81573),l=i(33812),c=i(56898),d=i(7730),u=i(67311),h=i(88016);class p{constructor(e){this.data=e}static open(e,t){return e.open(p,{data:t,positionStrategy:new r.u3})}}p.ɵfac=function(e){return new(e||p)(l.rXU(s.Qs))},p.ɵcmp=l.VBU({type:p,selectors:[["ng-component"]],decls:16,vars:10,consts:[["bitDialogIcon","","aria-hidden","true",1,"bwi","bwi-info-circle","tw-text-info","tw-text-3xl"],["bitDialogTitle",""],["bitDialogContent",""],["bitDialogFooter",""],["bitButton","","href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer","buttonType","primary","bitDialogClose",""],["aria-hidden","true",1,"bwi","bwi-external-link","bwi-fw"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(l.j41(0,"bit-simple-dialog"),l.nrm(1,"i",0),l.j41(2,"span",1)(3,"strong"),l.EFF(4),l.nI1(5,"i18n"),l.k0s()(),l.j41(6,"span",2),l.EFF(7),l.k0s(),l.qex(8,3),l.j41(9,"a",4),l.EFF(10),l.nI1(11,"i18n"),l.nrm(12,"i",5),l.k0s(),l.j41(13,"button",6),l.EFF(14),l.nI1(15,"i18n"),l.k0s(),l.bVm(),l.k0s()),2&e&&(l.R7$(4),l.SpI("",l.bMT(5,4,"yourAccountsFingerprint"),":"),l.R7$(3),l.SpI(" ",t.data.fingerprint.join("-")," "),l.R7$(3),l.SpI(" ",l.bMT(11,6,"learnMore")," "),l.R7$(4),l.SpI(" ",l.bMT(15,8,"close")," "))},dependencies:[n.p,o.t,c.Q,a.P,d.I,u.L,u.o,h.$],encapsulation:2});var m=i(54873),v=i(77468),f=i(83731),g=i(51757),y=i(6056),b=i(66046),w=i(72245),S=i(58363),I=i(14803),k=i(13299);const C=k.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 3.33 73.33 73.33">
    <path class="tw-fill-illustration-bg-primary" d="m16.921 66.662-1.673-1.674a17.425 17.425 0 0 1-3.735-19.09l3.215-7.627c.717-1.7 1.283-3.46 1.692-5.26l3.285-14.46a2.222 2.222 0 0 1 2.666-1.673 5.079 5.079 0 0 1 3.855 5.857l-2.025 11.138a4.14 4.14 0 0 0 .58 2.963c.433.68 1.443.626 1.8-.097l9.292-18.772L41.46 8.09a2.163 2.163 0 0 1 2.85-.87 4.944 4.944 0 0 1 2.158 6.735l-3.95 7.46-4.144 10.261a3.619 3.619 0 0 0 .252 3.218.905.905 0 0 0 1.478.105l9.44-11.595 10.003-10.718a2.359 2.359 0 0 1 3.474.026 5.392 5.392 0 0 1-.048 7.287l-7.595 8.178-8.34 10.405a3.512 3.512 0 0 0-.649 3.12.878.878 0 0 0 1.344.493l11.092-7.608 11.191-5.598a2.29 2.29 0 0 1 3.215 1.375 5.236 5.236 0 0 1-2.74 6.26l-8.625 4.14c-.26.124-.51.267-.749.428l-9.414 6.322a3.73 3.73 0 0 0-1.64 3.383.933.933 0 0 0 1.284.792l8.651-3.544 8.318-2.138a1.731 1.731 0 0 1 2.057 1.084 3.957 3.957 0 0 1-2.402 5.088l-6.886 2.428-9.987 4.926c-.446.22-.863.495-1.241.818l-8.522 7.274c-7.143 6.098-17.774 5.68-24.415-.962Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M24.185 36.4a.833.833 0 0 1 1.175-.082c6.917 6.003 7.658 16.477 1.655 23.394a.833.833 0 1 1-1.259-1.093c5.4-6.221 4.734-15.643-1.488-21.043a.833.833 0 0 1-.083-1.175Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M75.833 61.667c.46 0 .834.373.834.833 0 7.824-6.343 14.167-14.167 14.167a.833.833 0 1 1 0-1.667C69.403 75 75 69.404 75 62.5c0-.46.373-.833.833-.833ZM4.167 18.334a.833.833 0 0 1-.834-.833c0-7.824 6.343-14.167 14.167-14.167a.833.833 0 0 1 0 1.667C10.596 5 5 10.597 5 17.5c0 .46-.373.833-.833.833Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M71.667 61.667c.46 0 .833.373.833.833 0 5.523-4.477 10-10 10a.833.833 0 0 1 0-1.666 8.333 8.333 0 0 0 8.333-8.334c0-.46.373-.833.834-.833ZM8.333 18.334a.833.833 0 0 1-.833-.833c0-5.523 4.477-10 10-10a.833.833 0 0 1 0 1.666 8.333 8.333 0 0 0-8.333 8.334c0 .46-.373.833-.834.833Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M58.968 12.05a3.16 3.16 0 0 1 4.632.058 6.15 6.15 0 0 1-.164 8.427l-7.431 7.597-8.351 10.945a2.74 2.74 0 0 0-.466 2.384c.004.014.01.02.014.025a.063.063 0 0 0 .024.015c.01.004.02.005.028.004a.056.056 0 0 0 .027-.01l11.12-7.63 11.244-5.622a3.124 3.124 0 0 1 4.383 1.875 6.07 6.07 0 0 1-3.175 7.257l-7.942 3.811c-.678.325-1.332.7-1.957 1.119l-8.785 5.9a2.898 2.898 0 0 0-1.274 2.628.1.1 0 0 0 .137.084l8.705-3.565 8.372-2.153a2.565 2.565 0 0 1 3.048 1.605 4.79 4.79 0 0 1-2.907 6.16l-6.84 2.41-9.942 4.905c-.384.19-.743.426-1.069.704l-8.522 7.275c-7.474 6.38-18.597 5.942-25.545-1.007l-1.674-1.673a18.259 18.259 0 0 1-3.913-20.004l3.215-7.627a30.676 30.676 0 0 0 1.647-5.12l3.285-14.461a3.055 3.055 0 0 1 3.667-2.3 5.912 5.912 0 0 1 4.487 6.818l-2.025 11.138a3.306 3.306 0 0 0 .463 2.366c.085.133.281.122.351-.018l9.301-18.793 5.6-9.899a2.996 2.996 0 0 1 3.947-1.204 5.777 5.777 0 0 1 2.522 7.87l-3.93 7.422-4.128 10.223a2.782 2.782 0 0 0 .194 2.473.07.07 0 0 0 .115.008l10.415-12.856 9.096-9.564Zm3.396 1.176a1.493 1.493 0 0 0-2.189-.027l-9.05 9.516L40.75 35.52a1.737 1.737 0 0 1-2.84-.2 4.45 4.45 0 0 1-.31-3.955l4.16-10.302 3.971-7.499a4.11 4.11 0 0 0-1.794-5.6 1.33 1.33 0 0 0-1.752.535l-5.576 9.859-9.281 18.75c-.646 1.305-2.47 1.403-3.25.175a4.972 4.972 0 0 1-.698-3.559l2.025-11.138a4.246 4.246 0 0 0-3.222-4.896 1.389 1.389 0 0 0-1.667 1.045l-3.284 14.461c-.42 1.847-1.001 3.654-1.737 5.399l-3.215 7.627a16.592 16.592 0 0 0 3.556 18.177l1.674 1.674c6.333 6.333 16.472 6.733 23.284.918l8.522-7.275c.43-.368.906-.68 1.414-.931l10.031-4.949 6.933-2.444a3.124 3.124 0 0 0 1.897-4.017.898.898 0 0 0-1.068-.562l-8.261 2.124-8.6 3.522a1.766 1.766 0 0 1-2.43-1.499 4.564 4.564 0 0 1 2.007-4.139l8.785-5.9c.691-.464 1.414-.877 2.165-1.237l7.942-3.812a4.403 4.403 0 0 0 2.303-5.264 1.457 1.457 0 0 0-2.045-.875l-11.14 5.572-11.027 7.564c-.98.672-2.33.177-2.642-.97a4.407 4.407 0 0 1 .748-3.833l8.413-11.026 7.502-7.67a4.483 4.483 0 0 0 .12-6.144Z" clip-rule="evenodd"/>
  </svg>
`;var T=i(9045),F=i(93241),R=i(54967),P=i(11573),x=i(82468),$=i(7861),E=i(29377),A=i(56962),D=i(83516),O=i(78781),M=i(63457),U=i(37579),G=i(47135),j=i(26411),N=i(22191),V=i(26477),B=i(5513),z=i(74208),L=i(23649),K=i(1221),q=i(69855),_=i(91059),X=i(52396),Y=i(40271),H=i(50700);class W{}var J=i(37115),Z=i(18499),Q=i(2471),ee=i(1601),te=i(86214),ie=i(26657),ne=i(45154),re=i(50352),se=i(90246),oe=i(86226),ae=i(97553),le=i(43759),ce=i(76356),de=i(69896),ue=i(36288),he=i(59032),pe=i(49519),me=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ve=["masterPasswordInputRef"],fe=e=>({"tw-hidden":e});function ge(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"button",18),l.nI1(2,"i18n"),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.handleLoginWithPasskeyClick())}),l.nrm(3,"i",19),l.EFF(4),l.nI1(5,"i18n"),l.k0s(),l.bVm()}if(2&e){const e=l.XpG();l.R7$(),l.Y8G("bitTooltip",e.ssoRequired?l.bMT(2,4,"yourOrganizationRequiresSingleSignOn"):"")("addTooltipToDescribedby",e.ssoRequired)("disabled",e.ssoRequired),l.R7$(3),l.SpI(" ",l.bMT(5,6,"logInWithPasskey")," ")}}function ye(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"div",20),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"button",21),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.startAuthRequestLogin())}),l.nrm(5,"i",22),l.EFF(6),l.nI1(7,"i18n"),l.k0s(),l.bVm()}2&e&&(l.R7$(2),l.JRh(l.bMT(3,2,"or")),l.R7$(4),l.SpI(" ",l.bMT(7,4,"loginWithDevice")," "))}function be(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"button",21),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.backButtonClicked())}),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.bVm()}2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,1,"back")," "))}const we="LoginComponent";var Se;!function(e){e.EMAIL_ENTRY="EmailEntry",e.MASTER_PASSWORD_ENTRY="MasterPasswordEntry"}(Se||(Se={}));class Ie{get emailFormControl(){return this.formGroup.controls.email}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,y,w,S,I,k,R,x){this.activatedRoute=e,this.anonLayoutWrapperDataService=t,this.appIdService=i,this.broadcasterService=n,this.destroyRef=r,this.devicesApiService=s,this.formBuilder=o,this.i18nService=a,this.loginEmailService=l,this.loginComponentService=c,this.loginStrategyService=d,this.messagingService=u,this.ngZone=h,this.passwordStrengthService=p,this.platformUtilsService=m,this.policyService=v,this.router=f,this.toastService=y,this.logService=w,this.validationService=S,this.loginSuccessHandlerService=I,this.configService=k,this.ssoLoginService=R,this.environmentService=x,this.destroy$=new b.B,this.Icons={WaveIcon:C,VaultIcon:T.E},this.ClientType=P.sK,this.orgPoliciesFromInvite=null,this.LoginUiState=Se,this.isKnownDevice=!1,this.loginUiState=Se.EMAIL_ENTRY,this.ssoRequired=!1,this.formGroup=this.formBuilder.group({email:["",[g.k0.required,g.k0.email]],masterPassword:["",[g.k0.required,g.k0.minLength(O.A.originalMinimumPasswordLength)]],rememberEmail:[!1]},{updateOn:"submit"}),this.deferFocus=null,this.submit=()=>me(this,void 0,void 0,function*(){var e;if(this.clientType===P.sK.Desktop&&this.loginUiState!==Se.MASTER_PASSWORD_ENTRY)return;const{email:t,masterPassword:i}=this.formGroup.value;if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;if(!t||!i)return void this.logService.error("Email and master password are required");this.orgPoliciesFromInvite=this.loginComponentService.getOrgPoliciesFromOrgInvite?yield this.loginComponentService.getOrgPoliciesFromOrgInvite(t):null;const n=null===(e=this.orgPoliciesFromInvite)||void 0===e?void 0:e.enforcedPasswordPolicyOptions,r=new F.F2(t,i,void 0,n);try{const e=yield this.loginStrategyService.logIn(r);yield this.handleAuthResult(e)}catch(s){this.logService.error(s),yield this.handleSubmitError(s)}}),this.handlePopState=e=>me(this,void 0,void 0,function*(){this.loginUiState===Se.MASTER_PASSWORD_ENTRY?(e.preventDefault(),this.toggleLoginUiState(Se.EMAIL_ENTRY)):this.loginUiState===Se.EMAIL_ENTRY&&(e.preventDefault(),yield this.continue())}),this.clientType=this.platformUtilsService.getClientType()}ngOnInit(){return me(this,void 0,void 0,function*(){window.addEventListener("popstate",this.handlePopState),yield this.defaultOnInit(),this.clientType===P.sK.Desktop&&(yield this.desktopOnInit())})}ngOnDestroy(){window.removeEventListener("popstate",this.handlePopState),this.clientType===P.sK.Desktop&&this.broadcasterService.unsubscribe(we),this.destroy$.next(),this.destroy$.complete()}defaultOnInit(){return me(this,void 0,void 0,function*(){let e=!1;const t=yield(0,w._)(this.activatedRoute.queryParams);if(t){const i=t.email;null!=i&&i.indexOf("@")>-1&&(this.formGroup.controls.email.setValue(i),e=!0)}e||(yield this.loadRememberedEmail()),this.emailFormControl.value&&(yield this.getKnownDevice(this.emailFormControl.value)),this.activatedRoute||(yield this.loadRememberedEmail()),yield this.determineIfSsoRequired()})}desktopOnInit(){return me(this,void 0,void 0,function*(){this.broadcasterService.subscribe(we,e=>me(this,void 0,void 0,function*(){this.ngZone.run(()=>{if("windowIsFocused"===e.command)null===this.deferFocus?(this.deferFocus=!e.windowIsFocused,this.deferFocus||this.focusInput()):this.deferFocus&&e.windowIsFocused&&(this.focusInput(),this.deferFocus=!1)})})),this.messagingService.send("getWindowIsFocused")})}determineIfSsoRequired(){return me(this,void 0,void 0,function*(){const e=yield(0,w._)(this.ssoLoginService.ssoRequiredCache$);null!=e&&e.size>0&&(this.emailFormControl.value&&e.has(this.emailFormControl.value.toLowerCase())&&(this.ssoRequired=!0),this.listenForEmailChanges(e))})}listenForEmailChanges(e){this.formGroup.controls.email.valueChanges.pipe((0,f.pQ)(this.destroyRef)).subscribe(()=>{this.emailFormControl.value&&e.has(this.emailFormControl.value.toLowerCase())?this.ssoRequired=!0:this.ssoRequired=!1})}handleSubmitError(e){return me(this,void 0,void 0,function*(){var t;if(e instanceof $._)if(e.statusCode===P.kG.BadRequest)if(null===(t=e.message)||void 0===t?void 0:t.toLowerCase().includes("username or password is incorrect")){const e=yield(0,w._)(this.environmentService.environment$),t=O.A.getHost(e.getWebVaultUrl());this.formGroup.controls.masterPassword.setErrors({error:{message:this.i18nService.t("invalidMasterPasswordConfirmEmailAndHost",t)}})}else this.validationService.showError(e);else this.validationService.showError(e);else this.validationService.showError(e)})}handleAuthResult(e){return me(this,void 0,void 0,function*(){var t,i;if(e.requiresEncryptionKeyMigration)this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("legacyEncryptionUnsupported")});else if(e.requiresTwoFactor)yield this.router.navigate(["2fa"]);else if(e.requiresDeviceVerification)yield this.router.navigate(["device-verification"]);else{if(e.requiresSso){const n=null===(i=null===(t=this.formGroup)||void 0===t?void 0:t.value)||void 0===i?void 0:i.email;return n?void(yield this.loginComponentService.redirectToSsoLoginWithOrganizationSsoIdentifier(n,e.ssoOrganizationIdentifier)):void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("emailRequiredForSsoLogin")})}if(yield this.loginSuccessHandlerService.run(e.userId,e.masterPassword),this.orgPoliciesFromInvite){yield this.setPoliciesIntoState(e.userId,this.orgPoliciesFromInvite.policies);if(yield this.isPasswordChangeRequiredByOrgPolicy(this.orgPoliciesFromInvite.enforcedPasswordPolicyOptions))return void(yield this.router.navigate(["change-password"]))}this.clientType===P.sK.Browser?yield this.router.navigate(["/tabs/vault"]):yield this.router.navigate(["vault"])}})}isPasswordChangeRequiredByOrgPolicy(e){return me(this,void 0,void 0,function*(){var t,i;try{if(null==e)return!1;const n=this.formGroup.controls.masterPassword.value;if(!n)return!1;const r=null===(i=this.passwordStrengthService.getPasswordStrength(n,null!==(t=this.formGroup.value.email)&&void 0!==t?t:void 0))||void 0===i?void 0:i.score;return!this.policyService.evaluateMasterPassword(r,n,e)}catch(n){return this.logService.error(n),!1}})}setPoliciesIntoState(e,t){return me(this,void 0,void 0,function*(){const i={};t.map(e=>i[e.id]=R.L.fromPolicy(e)),yield this.policyService.replace(i,e)})}startAuthRequestLogin(){return me(this,void 0,void 0,function*(){var e,t;null===(e=this.formGroup.get("masterPassword"))||void 0===e||e.clearValidators(),null===(t=this.formGroup.get("masterPassword"))||void 0===t||t.updateValueAndValidity(),this.formGroup.valid&&(yield this.router.navigate(["/login-with-device"]))})}toggleLoginUiState(e){return me(this,void 0,void 0,function*(){var t,i;if(this.loginUiState=e,this.loginUiState===Se.EMAIL_ENTRY)this.loginComponentService.showBackButton(!1),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"logIn"},pageIcon:this.Icons.VaultIcon,pageSubtitle:null}),this.formGroup.controls.masterPassword.reset(),this.isKnownDevice=!1;else if(this.loginUiState===Se.MASTER_PASSWORD_ENTRY){this.loginComponentService.showBackButton(!0),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"welcomeBack"},pageSubtitle:this.emailFormControl.value,pageIcon:this.Icons.WaveIcon}),this.formGroup.controls.masterPassword.markAsUntouched(),this.ngZone.isStable?null===(i=null===(t=this.masterPasswordInputRef)||void 0===t?void 0:t.nativeElement)||void 0===i||i.focus():this.ngZone.onStable.pipe((0,S.s)(1),(0,I.Q)(this.destroy$)).subscribe(()=>{var e,t;null===(t=null===(e=this.masterPasswordInputRef)||void 0===e?void 0:e.nativeElement)||void 0===t||t.focus()});const e=this.emailFormControl.value;e&&(yield this.getKnownDevice(e))}})}isLoginWithPasskeySupported(){return this.loginComponentService.isLoginWithPasskeySupported()}goToHint(){return me(this,void 0,void 0,function*(){yield this.router.navigateByUrl("/hint")})}continuePressed(){return me(this,void 0,void 0,function*(){history.pushState({},"",window.location.href),yield this.continue()})}continue(){return me(this,void 0,void 0,function*(){this.validateEmail()&&(yield this.makePasswordPreloginCall(),yield this.toggleLoginUiState(Se.MASTER_PASSWORD_ENTRY))})}handleLoginWithPasskeyClick(){return me(this,void 0,void 0,function*(){yield this.router.navigate(["/login-with-passkey"])})}handleSsoClick(){return me(this,void 0,void 0,function*(){if(!this.validateEmail())return;const e=this.formGroup.value.email;e?yield this.loginComponentService.redirectToSsoLogin(e):this.logService.error("Email is required for SSO")})}getKnownDevice(e){return me(this,void 0,void 0,function*(){if(e)try{const t=yield this.appIdService.getAppId();this.isKnownDevice=yield this.devicesApiService.getKnownDevice(e,t)}catch(t){this.isKnownDevice=!1}else this.isKnownDevice=!1})}loadRememberedEmail(){return me(this,void 0,void 0,function*(){const e=yield(0,w._)(this.loginEmailService.rememberedEmail$);e?(this.formGroup.controls.email.setValue(e),this.formGroup.controls.rememberEmail.setValue(!0),yield this.loginEmailService.setLoginEmail(e)):this.formGroup.controls.rememberEmail.setValue(!1)})}focusInput(){var e;null===(e=document.getElementById(null==this.emailFormControl.value||""===this.emailFormControl.value?"email":"masterPassword"))||void 0===e||e.focus()}shouldShowBackButton(){return this.loginUiState===Se.MASTER_PASSWORD_ENTRY&&this.clientType!==P.sK.Browser}backButtonClicked(){return me(this,void 0,void 0,function*(){history.back()})}makePasswordPreloginCall(){return me(this,void 0,void 0,function*(){try{if(yield this.configService.getFeatureFlag(x.TO.PM23801_PrefetchPasswordPrelogin)){const e=this.formGroup.value.email;e&&this.loginStrategyService.getPasswordPrelogin(e)}}catch(e){this.logService.error("Failed to prefetch prelogin data.",e)}})}validateEmail(){return this.formGroup.controls.email.markAsTouched(),this.formGroup.controls.email.updateValueAndValidity({onlySelf:!0,emitEvent:!0}),this.formGroup.controls.email.valid}persistEmailIfValid(){return me(this,void 0,void 0,function*(){var e;if(this.formGroup.controls.email.valid){const t=this.formGroup.value.email,i=null!==(e=this.formGroup.value.rememberEmail)&&void 0!==e&&e;if(!t)return;yield this.loginEmailService.setLoginEmail(t),yield this.loginEmailService.setRememberedEmailChoice(t,i)}else yield this.loginEmailService.clearLoginEmail(),yield this.loginEmailService.clearRememberedEmail()})}onEmailInput(e){return me(this,void 0,void 0,function*(){const t=e.target;this.formGroup.controls.email.setValue(t.value),yield this.persistEmailIfValid()})}onRememberEmailInput(e){return me(this,void 0,void 0,function*(){const t=e.target;this.formGroup.controls.rememberEmail.setValue(t.checked),yield this.persistEmailIfValid()})}}Ie.ɵfac=function(e){return new(e||Ie)(l.rXU(L.nX),l.rXU(K.f),l.rXU(_.Y),l.rXU(X.y),l.rXU(z.abz),l.rXU(Y.T),l.rXU(g.ok),l.rXU(H.W),l.rXU(F.DS),l.rXU(W),l.rXU(F.sg),l.rXU(D.U),l.rXU(l.SKi),l.rXU(M.Q),l.rXU(J.y),l.rXU(Z.N),l.rXU(L.Ix),l.rXU(q.f),l.rXU(A.K),l.rXU(Q.B),l.rXU(F.aJ),l.rXU(ee.w),l.rXU(te._),l.rXU(E.v))},Ie.ɵcmp=l.VBU({type:Ie,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&l.GBs(ve,5),2&e){let e;l.mGM(e=l.lsd())&&(t.masterPasswordInputRef=e.first)}},decls:46,vars:45,consts:[["masterPasswordInputRef",""],[3,"bitSubmit","formGroup"],[3,"ngClass"],["type","email","formControlName","email","bitInput","","appAutofocus","",1,"vw-email-continue",3,"input","keyup.enter","disabled"],["type","email","formControlName","email","bitInput","","appAutofocus","",1,"vw-email-sso",3,"input","keyup.enter"],["type","checkbox","formControlName","rememberEmail","bitCheckbox","",3,"input"],[1,"tw-grid","tw-gap-3"],["type","button","bitButton","","block","","buttonType","primary",1,"vw-continue-login",3,"click","bitTooltip","addTooltipToDescribedby"],["type","button","bitButton","","block","",1,"vw-sso-login",3,"click","buttonType"],["aria-hidden","true",1,"bwi","bwi-provider","tw-mr-1"],[1,"tw-text-center","vw-or-text"],[4,"ngIf"],["type","button","bitButton","","block","","buttonType","secondary",1,"vw-other-login",3,"click","disabled"],[1,"!tw-mb-1"],["type","password","formControlName","masterPassword","bitInput",""],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["bitLink","","routerLink","/hint",1,"tw-inline-block","tw-mb-4",3,"click"],["type","submit","bitButton","","bitFormButton","","block","","buttonType","primary"],["type","button","bitButton","","block","","buttonType","secondary",1,"vw-passkey-login",3,"click","bitTooltip","addTooltipToDescribedby","disabled"],["aria-hidden","true",1,"bwi","bwi-passkey","tw-mr-1"],[1,"tw-text-center"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"],["aria-hidden","true",1,"bwi","bwi-mobile"]],template:function(e,t){if(1&e){const e=l.RV6();l.j41(0,"form",1)(1,"div",2)(2,"bit-form-field")(3,"bit-label"),l.EFF(4),l.nI1(5,"i18n"),l.k0s(),l.j41(6,"input",3),l.bIt("input",function(i){return z.eBV(e),z.Njj(t.onEmailInput(i))})("keyup.enter",function(){return z.eBV(e),z.Njj(t.continuePressed())}),l.k0s(),l.j41(7,"input",4),l.bIt("input",function(i){return z.eBV(e),z.Njj(t.onEmailInput(i))})("keyup.enter",function(){return z.eBV(e),z.Njj(t.handleSsoClick())}),l.k0s()(),l.j41(8,"bit-form-control")(9,"input",5),l.bIt("input",function(i){return z.eBV(e),z.Njj(t.onRememberEmailInput(i))}),l.k0s(),l.j41(10,"bit-label"),l.EFF(11),l.nI1(12,"i18n"),l.k0s()(),l.j41(13,"div",6)(14,"button",7),l.nI1(15,"i18n"),l.bIt("click",function(){return z.eBV(e),z.Njj(t.continuePressed())}),l.EFF(16),l.nI1(17,"i18n"),l.k0s(),l.j41(18,"button",8),l.bIt("click",function(){return z.eBV(e),z.Njj(t.handleSsoClick())}),l.nrm(19,"i",9),l.EFF(20),l.nI1(21,"i18n"),l.k0s(),l.j41(22,"div",10),l.EFF(23),l.nI1(24,"i18n"),l.k0s(),l.DNE(25,ge,6,8,"ng-container",11),l.j41(26,"button",12),l.bIt("click",function(){return z.eBV(e),z.Njj(t.continuePressed())}),l.EFF(27),l.nI1(28,"i18n"),l.k0s()()(),l.j41(29,"div",2)(30,"bit-form-field",13)(31,"bit-label"),l.EFF(32),l.nI1(33,"i18n"),l.k0s(),l.nrm(34,"input",14,0)(36,"button",15),l.k0s(),l.j41(37,"a",16),l.bIt("click",function(){return z.eBV(e),z.Njj(t.goToHint())}),l.EFF(38),l.nI1(39,"i18n"),l.k0s(),l.j41(40,"div",6)(41,"button",17),l.EFF(42),l.nI1(43,"i18n"),l.k0s(),l.DNE(44,ye,8,6,"ng-container",11)(45,be,4,3,"ng-container",11),l.k0s()()()}2&e&&(l.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),l.R7$(),l.Y8G("ngClass",l.eq3(41,fe,t.loginUiState!==t.LoginUiState.EMAIL_ENTRY)),l.R7$(3),l.JRh(l.bMT(5,21,"emailAddress")),l.R7$(2),l.Y8G("disabled",t.ssoRequired),l.R7$(5),l.JRh(l.bMT(12,23,"rememberEmail")),l.R7$(3),l.Y8G("bitTooltip",t.ssoRequired?l.bMT(15,25,"yourOrganizationRequiresSingleSignOn"):"")("addTooltipToDescribedby",t.ssoRequired),l.R7$(2),l.SpI(" ",l.bMT(17,27,"continue")," "),l.R7$(2),l.Y8G("buttonType",t.ssoRequired?"primary":"secondary"),l.R7$(2),l.SpI(" ",l.bMT(21,29,"useSingleSignOn")," "),l.R7$(3),l.JRh(l.bMT(24,31,"or")),l.R7$(2),l.Y8G("ngIf",t.isLoginWithPasskeySupported()),l.R7$(),l.Y8G("disabled",t.ssoRequired),l.R7$(),l.SpI(" ",l.bMT(28,33,"other")," "),l.R7$(2),l.Y8G("ngClass",l.eq3(43,fe,t.loginUiState!==t.LoginUiState.MASTER_PASSWORD_ENTRY)),l.R7$(3),l.JRh(l.bMT(33,35,"masterPass")),l.R7$(6),l.SpI(" ",l.bMT(39,37,"getMasterPasswordHint")," "),l.R7$(4),l.SpI(" ",l.bMT(43,39,"loginWithMasterPassword")," "),l.R7$(2),l.Y8G("ngIf",t.isKnownDevice),l.R7$(),l.Y8G("ngIf",t.shouldShowBackButton()))},dependencies:[U.C,ie.$,ne.L,o.t,c.Q,G.q,re.P,v.MD,v.YU,v.bT,j.L,se.f,oe.j,ae.J,le.h,ce.e,de.a,N.Q,ue.s,V.V,he.L,n.p,pe.B,g.X1,g.qT,g.me,g.Zm,g.BC,g.cb,g.j4,g.JD,y.iI,y.Wk,B.d,h.$],encapsulation:2});var ke=i(62602);function Ce(e,t){1&e&&(l.j41(0,"div",1)(1,"a",2),l.EFF(2),l.nI1(3,"i18n"),l.k0s()()),2&e&&(l.R7$(2),l.JRh(l.bMT(3,1,"createAccount")))}class Te{constructor(){this.serverSettingsService=(0,z.WQX)(ke.t),this.isUserRegistrationDisabled$=this.serverSettingsService.isUserRegistrationDisabled$}}Te.ɵfac=function(e){return new(e||Te)},Te.ɵcmp=l.VBU({type:Te,selectors:[["ng-component"]],decls:2,vars:3,consts:[["class","tw-text-center vw-signup-link",4,"ngIf"],[1,"tw-text-center","vw-signup-link"],["bitLink","","routerLink","/signup"]],template:function(e,t){1&e&&(l.DNE(0,Ce,4,3,"div",0),l.nI1(1,"async")),2&e&&l.Y8G("ngIf",!l.bMT(1,1,t.isUserRegistrationDisabled$))},dependencies:[v.MD,v.bT,n.p,V.V,he.L,y.iI,y.Wk,v.Jj,h.$],encapsulation:2});var Fe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Re{constructor(e,t,i,n,r){this.cryptoFunctionService=e,this.environmentService=t,this.passwordGenerationService=i,this.platformUtilsService=n,this.ssoLoginService=r,this.clientType=this.platformUtilsService.getClientType()}isLoginWithPasskeySupported(){return this.clientType===P.sK.Web}redirectToSsoLogin(e){return Fe(this,void 0,void 0,function*(){const[t,i]=yield this.setSsoPreLoginState(e);yield this.redirectToSso(e,t,i)})}redirectToSsoLoginWithOrganizationSsoIdentifier(e,t){return Fe(this,void 0,void 0,function*(){const[i,n]=yield this.setSsoPreLoginState(e);yield this.redirectToSso(e,i,n,t)})}redirectToSso(e,t,i,n){return Fe(this,void 0,void 0,function*(){})}showBackButton(e){}setSsoPreLoginState(e){return Fe(this,void 0,void 0,function*(){const t={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1};let i=yield this.passwordGenerationService.generatePassword(t);this.clientType===P.sK.Browser&&(i+=":clientId=browser");const n=yield this.passwordGenerationService.generatePassword(t),r=yield this.cryptoFunctionService.hash(n,"sha256"),s=O.A.fromBufferToUrlB64(r);return yield this.ssoLoginService.setSsoState(i),yield this.ssoLoginService.setCodeVerifier(n),yield this.ssoLoginService.setSsoEmail(e),[i,s]})}}var Pe=i(3204),xe=i(44500),$e=i(43008),Ee=i(37567),Ae=i(84079),De=i(75811),Oe=i(93695),Me=i(48541),Ue=i(75583),Ge=i(22848),je=i(35500),Ne=i(12012),Ve=i(39935);class Be{}var ze,Le=i(11224),Ke=i(45891),qe=i(3892),_e=i(93199),Xe=i(58806),Ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function He(e,t){1&e&&(l.qex(0),l.j41(1,"div",2),l.nrm(2,"i",3),l.nI1(3,"i18n"),l.j41(4,"span",4),l.EFF(5),l.nI1(6,"i18n"),l.k0s()(),l.bVm()),2&e&&(l.R7$(2),l.Y8G("title",l.mNQ(l.bMT(3,3,"loading"))),l.R7$(3),l.JRh(l.bMT(6,5,"loading")))}function We(e,t){if(1&e&&(l.j41(0,"form",5)(1,"bit-form-control"),l.nrm(2,"input",6),l.j41(3,"bit-label"),l.EFF(4),l.nI1(5,"i18n"),l.k0s(),l.j41(6,"bit-hint",7),l.EFF(7),l.nI1(8,"i18n"),l.k0s()()()),2&e){const e=l.XpG();l.Y8G("formGroup",e.formGroup),l.R7$(4),l.JRh(l.bMT(5,3,"rememberThisDevice")),l.R7$(3),l.JRh(l.bMT(8,5,"uncheckIfPublicDevice"))}}function Je(e,t){if(1&e&&(l.qex(0),l.j41(1,"button",8),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.bVm()),2&e){const e=l.XpG();l.R7$(),l.Y8G("bitAction",e.createUser),l.R7$(),l.SpI(" ",l.bMT(3,2,"continue")," ")}}function Ze(e,t){1&e&&(l.j41(0,"div",2),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"or")," "))}function Qe(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"button",12),l.bIt("click",function(){z.eBV(e);const t=l.XpG(2);return z.Njj(t.approveFromOtherDevice())}),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.DNE(4,Ze,3,3,"div",13),l.bVm()}if(2&e){const e=l.XpG(2);l.R7$(2),l.SpI(" ",l.bMT(3,2,"approveFromYourOtherDevice")," "),l.R7$(2),l.Y8G("ngIf",e.canApproveWithMasterPassword||e.canRequestAdminApproval)}}function et(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",14),l.bIt("click",function(){z.eBV(e);const t=l.XpG(2);return z.Njj(t.approveWithMasterPassword())}),l.EFF(1),l.nI1(2,"i18n"),l.k0s()}2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"useMasterPassword")," "))}function tt(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",14),l.bIt("click",function(){z.eBV(e);const t=l.XpG(2);return z.Njj(t.requestAdminApproval())}),l.EFF(1),l.nI1(2,"i18n"),l.k0s()}2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"requestAdminApproval")," "))}function it(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"div",9),l.DNE(2,Qe,5,4,"ng-container",0)(3,et,3,3,"button",10)(4,tt,3,3,"button",10),l.j41(5,"button",11),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.logOut())}),l.EFF(6),l.nI1(7,"i18n"),l.k0s()(),l.bVm()}if(2&e){const e=l.XpG();l.R7$(2),l.Y8G("ngIf",e.canApproveFromOtherDevice),l.R7$(),l.Y8G("ngIf",e.canApproveWithMasterPassword),l.R7$(),l.Y8G("ngIf",e.canRequestAdminApproval),l.R7$(2),l.SpI(" ",l.bMT(7,4,"logOut")," ")}}!function(e){e[e.NewUser=0]="NewUser",e[e.ExistingUserUntrustedDevice=1]="ExistingUserUntrustedDevice"}(ze||(ze={}));class nt{get rememberDeviceControl(){return this.formGroup.controls.rememberDevice}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g,y,b,w){this.accountService=e,this.anonLayoutWrapperDataService=t,this.apiService=i,this.destroyRef=n,this.deviceTrustService=r,this.dialogService=s,this.formBuilder=o,this.i18nService=a,this.keyService=l,this.loginDecryptionOptionsService=c,this.loginEmailService=d,this.messagingService=u,this.organizationApiService=h,this.passwordResetEnrollmentService=p,this.platformUtilsService=m,this.router=v,this.ssoLoginService=f,this.toastService=g,this.userDecryptionOptionsService=y,this.validationService=b,this.logoutService=w,this.loading=!1,this.State=ze,this.formGroup=this.formBuilder.group({rememberDevice:[!0]}),this.canApproveFromOtherDevice=!1,this.canRequestAdminApproval=!1,this.canApproveWithMasterPassword=!1,this.createUser=()=>Ye(this,void 0,void 0,function*(){if(this.state===ze.NewUser)try{const{publicKey:e,privateKey:t}=yield this.keyService.initAccount(this.activeAccountId),i=new Me.G(e,t.encryptedString);yield this.apiService.postAccountKeys(i),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("accountSuccessfullyCreated")}),yield this.passwordResetEnrollmentService.enroll(this.newUserOrgId),this.formGroup.value.rememberDevice&&(yield this.deviceTrustService.trustDevice(this.activeAccountId)),yield this.loginDecryptionOptionsService.handleCreateUserSuccess(),this.clientType===P.sK.Desktop&&this.messagingService.send("redrawMenu"),yield this.handleCreateUserSuccessNavigation()}catch(e){this.validationService.showError(e)}}),this.clientType=this.platformUtilsService.getClientType()}ngOnInit(){return Ye(this,void 0,void 0,function*(){var e,t;if(this.loading=!0,this.activeAccountId=null===(e=yield(0,w._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id,this.email=yield(0,w._)(this.accountService.activeAccount$.pipe((0,Pe.T)(e=>null==e?void 0:e.email))),this.email){this.observeAndPersistRememberDeviceValueChanges(),yield this.setRememberDeviceDefaultValueFromState();try{const e=yield(0,w._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(this.activeAccountId));(null===(t=null==e?void 0:e.trustedDeviceOption)||void 0===t?void 0:t.hasAdminApproval)||(null==e?void 0:e.hasMasterPassword)?this.loadExistingUserUntrustedDeviceData(e):yield this.loadNewUserData()}catch(i){this.validationService.showError(i)}finally{this.loading=!1}}else yield this.handleMissingEmail()})}handleMissingEmail(){return Ye(this,void 0,void 0,function*(){this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("activeUserEmailNotFoundLoggingYouOut")}),yield this.logoutService.logout(this.activeAccountId),yield this.router.navigate(["/"])})}observeAndPersistRememberDeviceValueChanges(){this.rememberDeviceControl.valueChanges.pipe((0,f.pQ)(this.destroyRef),(0,xe.n)(e=>(0,$e.v)(()=>this.deviceTrustService.setShouldTrustDevice(this.activeAccountId,e)))).subscribe()}setRememberDeviceDefaultValueFromState(){return Ye(this,void 0,void 0,function*(){const e=yield this.deviceTrustService.getShouldTrustDevice(this.activeAccountId),t=null==e||e;this.rememberDeviceControl.setValue(t)})}loadNewUserData(){return Ye(this,void 0,void 0,function*(){this.state=ze.NewUser,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"loggedInExclamation"},pageSubtitle:{key:"rememberThisDeviceToMakeFutureLoginsSeamless"}});const e=(0,$e.v)(()=>this.ssoLoginService.getActiveUserOrganizationSsoIdentifier(this.activeAccountId)).pipe((0,xe.n)(e=>null==e?(0,Ee.$)(()=>new Error(this.i18nService.t("ssoIdentifierRequired"))):(0,Ae.H)(this.organizationApiService.getAutoEnrollStatus(e))),(0,De.W)(e=>(this.validationService.showError(e),(0,Oe.of)(void 0)))),t=yield(0,w._)(e);this.newUserOrgId=t.id})}loadExistingUserUntrustedDeviceData(e){var t,i;this.state=ze.ExistingUserUntrustedDevice,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"deviceApprovalRequiredV2"},pageSubtitle:{key:"selectAnApprovalOptionBelow"}}),this.canApproveFromOtherDevice=(null===(t=null==e?void 0:e.trustedDeviceOption)||void 0===t?void 0:t.hasLoginApprovingDevice)||!1,this.canRequestAdminApproval=(null===(i=null==e?void 0:e.trustedDeviceOption)||void 0===i?void 0:i.hasAdminApproval)||!1,this.canApproveWithMasterPassword=(null==e?void 0:e.hasMasterPassword)||!1}handleCreateUserSuccessNavigation(){return Ye(this,void 0,void 0,function*(){this.clientType===P.sK.Browser?yield this.router.navigate(["/tabs/vault"]):yield this.router.navigate(["/vault"])})}approveFromOtherDevice(){return Ye(this,void 0,void 0,function*(){yield this.router.navigate(["/login-with-device"])})}approveWithMasterPassword(){return Ye(this,void 0,void 0,function*(){yield this.router.navigate(["/lock"],{queryParams:{from:"login-initiated"}})})}requestAdminApproval(){return Ye(this,void 0,void 0,function*(){yield this.router.navigate(["/admin-approval-requested"])})}logOut(){return Ye(this,void 0,void 0,function*(){var e;const t=yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}),i=null===(e=yield(0,w._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id;t&&(yield this.logoutService.logout(i),yield this.router.navigate(["/"]))})}}nt.ɵfac=function(e){return new(e||nt)(l.rXU(je.Di),l.rXU(K.f),l.rXU(Ne.G),l.rXU(z.abz),l.rXU(Ve.M),l.rXU(r.o3),l.rXU(g.ok),l.rXU(H.W),l.rXU(Ge.Lu),l.rXU(Be),l.rXU(F.DS),l.rXU(D.U),l.rXU(Le.X),l.rXU(Ke._),l.rXU(J.y),l.rXU(L.Ix),l.rXU(te._),l.rXU(q.f),l.rXU(F.Ym),l.rXU(Q.B),l.rXU(F.k4))},nt.ɵcmp=l.VBU({type:nt,selectors:[["ng-component"]],decls:4,vars:4,consts:[[4,"ngIf"],[3,"formGroup",4,"ngIf"],[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"formGroup"],["type","checkbox","bitCheckbox","","formControlName","rememberDevice"],["bitTypography","body2"],["type","button","bitButton","","block","","buttonType","primary",3,"bitAction"],[1,"tw-grid","tw-gap-3"],["type","button","bitButton","","block","","buttonType","secondary",3,"click",4,"ngIf"],["type","button","bitButton","","bitFormButton","","block","",3,"click"],["type","button","bitButton","","block","","buttonType","primary",3,"click"],["class","tw-text-center",4,"ngIf"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&l.DNE(0,He,7,7,"ng-container",0)(1,We,9,7,"form",1)(2,Je,4,4,"ng-container",0)(3,it,8,6,"ng-container",0),2&e&&(l.Y8G("ngIf",t.loading),l.R7$(),l.Y8G("ngIf",!t.loading),l.R7$(),l.Y8G("ngIf",t.state===t.State.NewUser),l.R7$(),l.Y8G("ngIf",t.state===t.State.ExistingUserUntrustedDevice))},dependencies:[U.C,qe.p,ie.$,o.t,c.Q,G.q,re.P,v.MD,v.bT,j.L,se.f,oe.j,_e.I,n.p,g.X1,g.qT,g.Zm,g.BC,g.cb,g.j4,g.JD,Ue.E,Xe.r,h.$],encapsulation:2});var rt,st=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ot{constructor(e){this.messagingService=e}handleCreateUserSuccess(){return null}logOut(){return st(this,void 0,void 0,function*(){this.messagingService.send("logout")})}}!function(e){e[e.AuthenticateAndUnlock=0]="AuthenticateAndUnlock",e[e.Unlock=1]="Unlock",e[e.AdminApproval=2]="AdminApproval"}(rt||(rt={}));var at=i(84110),lt=i(99352);class ct{constructor(e,t,i,n,r){this.email=e,this.deviceIdentifier=t,this.publicKey=i,this.type=n,this.accessCode=r}}var dt=i(71373),ut=i(47836);class ht{constructor(){this.id=void 0,this.accessCode=void 0,this.privateKey=void 0}static fromJSON(e){return null==e?null:Object.assign(new ht,e)}}class pt{constructor(){this.viewCacheService=(0,z.WQX)(ut.Z),this.defaultLoginViaAuthRequestCache=this.viewCacheService.signal({key:"login-via-auth-request-form-cache",initialValue:null,deserializer:ht.fromJSON})}cacheLoginView(e,t,i){this.defaultLoginViaAuthRequestCache.set({id:e,privateKey:O.A.fromBufferToB64(t.buffer),accessCode:i})}clearCacheLoginView(){this.defaultLoginViaAuthRequestCache.set(null)}getCachedLoginViaAuthRequestView(){return this.defaultLoginViaAuthRequestCache()}}pt.ɵfac=function(e){return new(e||pt)},pt.ɵprov=z.jDH({token:pt,factory:pt.ɵfac});var mt,vt=i(29744),ft=i(77312),gt=i(68455),yt=i(45872),bt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function wt(e,t){1&e&&(l.qex(0),l.j41(1,"div",1),l.nrm(2,"i",2),l.k0s(),l.bVm())}function St(e,t){if(1&e&&(l.j41(0,"p"),l.EFF(1),l.nI1(2,"i18n"),l.j41(3,"a",8),l.EFF(4),l.nI1(5,"i18n"),l.k0s(),l.EFF(6),l.nI1(7,"i18n"),l.k0s()),2&e){const e=l.XpG(3);l.R7$(),l.SpI(" ",l.bMT(2,4,"notificationSentDevicePart1")," "),l.R7$(2),l.Y8G("href",e.deviceManagementUrl,l.B4B),l.R7$(),l.JRh(l.bMT(5,6,"notificationSentDeviceAnchor")),l.R7$(2),l.SpI(". ",l.bMT(7,8,"notificationSentDevicePart2")," ")}}function It(e,t){1&e&&(l.j41(0,"p"),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"notificationSentDeviceComplete")," "))}function kt(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",9),l.bIt("click",function(){z.eBV(e);const t=l.XpG(3);return z.Njj(t.handleNewStandardAuthRequestLogin())}),l.EFF(1),l.nI1(2,"i18n"),l.k0s()}2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"resendNotification")," "))}function Ct(e,t){if(1&e&&(l.j41(0,"div",10)(1,"span"),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.EFF(4,"  "),l.j41(5,"a",11),l.EFF(6),l.nI1(7,"i18n"),l.k0s()()),2&e){const e=l.XpG(3);l.R7$(2),l.JRh(l.bMT(3,3,"needAnotherOptionV1")),l.R7$(3),l.Y8G("routerLink",e.backToRoute),l.R7$(),l.JRh(l.bMT(7,5,"viewAllLogInOptions"))}}function Tt(e,t){if(1&e&&(l.qex(0),l.DNE(1,St,8,10,"p",0)(2,It,3,3,"p",0),l.j41(3,"div",4),l.EFF(4),l.nI1(5,"i18n"),l.k0s(),l.j41(6,"code",5),l.EFF(7),l.k0s(),l.DNE(8,kt,3,3,"button",6)(9,Ct,8,7,"div",7),l.bVm()),2&e){const e=l.XpG(2);l.R7$(),l.Y8G("ngIf",e.clientType!==e.ClientType.Web),l.R7$(),l.Y8G("ngIf",e.clientType===e.ClientType.Web),l.R7$(2),l.JRh(l.bMT(5,6,"fingerprintPhraseHeader")),l.R7$(3),l.JRh(e.fingerprintPhrase),l.R7$(),l.Y8G("ngIf",e.showResendNotification),l.R7$(),l.Y8G("ngIf",e.clientType!==e.ClientType.Browser)}}function Ft(e,t){if(1&e&&(l.qex(0),l.j41(1,"p"),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"div",4),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.j41(7,"code",5),l.EFF(8),l.k0s(),l.j41(9,"div",10)(10,"span"),l.EFF(11),l.nI1(12,"i18n"),l.k0s(),l.EFF(13,"  "),l.j41(14,"a",11),l.EFF(15),l.nI1(16,"i18n"),l.k0s()(),l.bVm()),2&e){const e=l.XpG(2);l.R7$(2),l.JRh(l.bMT(3,6,"youWillBeNotifiedOnceTheRequestIsApproved")),l.R7$(3),l.JRh(l.bMT(6,8,"fingerprintPhraseHeader")),l.R7$(3),l.JRh(e.fingerprintPhrase),l.R7$(3),l.JRh(l.bMT(12,10,"troubleLoggingIn")),l.R7$(3),l.Y8G("routerLink",e.backToRoute),l.R7$(),l.JRh(l.bMT(16,12,"viewAllLogInOptions"))}}function Rt(e,t){if(1&e&&(l.qex(0),l.j41(1,"div",3),l.DNE(2,Tt,10,8,"ng-container",0)(3,Ft,17,14,"ng-container",0),l.k0s(),l.bVm()),2&e){const e=l.XpG();l.R7$(2),l.Y8G("ngIf",e.flow===e.Flow.StandardAuthRequest),l.R7$(),l.Y8G("ngIf",e.flow===e.Flow.AdminAuthRequest)}}!function(e){e[e.StandardAuthRequest=0]="StandardAuthRequest",e[e.AdminAuthRequest=1]="AdminAuthRequest"}(mt||(mt={}));const Pt={paths:"exact",queryParams:"ignored",fragment:"ignored",matrixParams:"ignored"};class xt{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,g,y,b,w){this.accountService=e,this.anonymousHubService=t,this.appIdService=i,this.authRequestApiService=n,this.authRequestService=r,this.authService=s,this.cryptoFunctionService=o,this.deviceTrustService=a,this.environmentService=l,this.i18nService=c,this.logService=d,this.loginEmailService=u,this.loginStrategyService=h,this.passwordGenerationService=p,this.platformUtilsService=m,this.router=v,this.toastService=g,this.validationService=y,this.loginSuccessHandlerService=b,this.loginViaAuthRequestCacheService=w,this.authRequestKeyPair=void 0,this.accessCode=void 0,this.authStatus=void 0,this.showResendNotificationTimeoutSeconds=12,this.loading=!0,this.backToRoute="/login",this.ClientType=P.sK,this.email=void 0,this.fingerprintPhrase=void 0,this.showResendNotification=!1,this.Flow=mt,this.flow=mt.StandardAuthRequest,this.webVaultUrl=void 0,this.clientType=this.platformUtilsService.getClientType(),this.authRequestService.authRequestPushNotification$.pipe((0,f.pQ)()).subscribe(e=>{this.loading=!0,this.handleExistingAuthRequestLogin(e).catch(e=>{this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:e.message}),this.loading=!1,this.logService.error("Failed to use approved auth request: "+e.message)})}),this.environmentService.environment$.pipe((0,f.pQ)()).subscribe(e=>{this.webVaultUrl=e.getWebVaultUrl(),this.deviceManagementUrl=`${this.webVaultUrl}/#/settings/security/device-management`})}ngOnInit(){return bt(this,void 0,void 0,function*(){this.authStatus=yield(0,w._)(this.authService.activeAccountStatus$);this.authStatus===at.J.Locked&&(this.backToRoute="/login-initiated"),this.router.isActive("admin-approval-requested",Pt)?yield this.initAdminAuthRequestFlow():yield this.initStandardAuthRequestFlow(),this.loading=!1})}initAdminAuthRequestFlow(){return bt(this,void 0,void 0,function*(){var e;this.flow=mt.AdminAuthRequest;const t=null===(e=yield(0,w._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id;if(!t)return void this.logService.error("Not able to get a user id from the account service active account observable.");const i=yield this.reloadCachedAdminAuthRequest(t);i?yield this.handleExistingAdminAuthRequestLogin(i,t):yield this.handleNewAdminAuthRequestLogin()})}initStandardAuthRequestFlow(){return bt(this,void 0,void 0,function*(){var e,t;this.flow=mt.StandardAuthRequest;const i=this.accountService.activeAccount$.pipe((0,Pe.T)(e=>null==e?void 0:e.email)),n=this.loginEmailService.loginEmail$;let r=null!==(e=yield(0,w._)(n))&&void 0!==e?e:void 0;if(r||(r=null!==(t=yield(0,w._)(i))&&void 0!==t?t:void 0),this.email=r,!this.email)return void(yield this.handleMissingEmail());const s=this.loginViaAuthRequestCacheService.getCachedLoginViaAuthRequestView();if(s){if(this.logService.info("Found cached auth request."),!s.id)return void this.logService.error("No id on the cached auth request when in the standard auth request flow.");yield this.reloadCachedStandardAuthRequest(s),yield this.handleExistingAuthRequestLogin(s.id)}else yield this.handleNewStandardAuthRequestLogin()})}handleMissingEmail(){return bt(this,void 0,void 0,function*(){this.toastService.showToast({variant:"error",message:this.i18nService.t("userEmailMissing")}),yield this.router.navigate([this.backToRoute])})}ngOnDestroy(){return bt(this,void 0,void 0,function*(){yield this.anonymousHubService.stopHubConnection(),this.loginViaAuthRequestCacheService.clearCacheLoginView()})}handleNewAdminAuthRequestLogin(){return bt(this,void 0,void 0,function*(){var e;try{if(!this.email)return void this.logService.error("No email when starting admin auth request login.");const t=yield this.buildAuthRequest(this.email,rt.AdminApproval);if(!t)return void this.logService.error("Auth request failed to build.");if(!this.authRequestKeyPair)return void this.logService.error("Key pairs failed to initialize from buildAuthRequest.");const i=yield this.authRequestApiService.postAdminAuthRequest(t),n=new lt.x({id:i.id,privateKey:this.authRequestKeyPair.privateKey}),r=null===(e=yield(0,w._)(this.accountService.activeAccount$))||void 0===e?void 0:e.id;if(!r)return void this.logService.error("Not able to get a user id from the account service active account observable.");yield this.authRequestService.setAdminAuthRequest(n,r),i.id&&(yield this.anonymousHubService.createHubConnection(i.id))}catch(t){this.logService.error(t)}})}reloadCachedAdminAuthRequest(e){return bt(this,void 0,void 0,function*(){return this.email=yield(0,w._)(this.accountService.activeAccount$.pipe((0,Pe.T)(e=>null==e?void 0:e.email))),this.email?yield this.authRequestService.getAdminAuthRequest(e):(yield this.handleMissingEmail(),null)})}reloadCachedStandardAuthRequest(e){return bt(this,void 0,void 0,function*(){if(e){if(!this.email)return void this.logService.error("Email not defined when trying to reload cached standard auth request.");if(!e.privateKey)return void this.logService.error("No private key on the cached auth request when trying to reload cached standard auth request.");if(!e.accessCode)return void this.logService.error("No access code on the cached auth request when trying to reload cached standard auth request.");const t=O.A.fromB64ToArray(e.privateKey),i=yield this.cryptoFunctionService.rsaExtractPublicKey(t);this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(this.email,i),this.authRequestKeyPair={privateKey:t,publicKey:void 0},this.accessCode=e.accessCode}})}handleNewStandardAuthRequestLogin(){return bt(this,void 0,void 0,function*(){this.showResendNotification=!1;try{if(!this.email)return void this.logService.error("Email not defined when starting standard auth request login.");const e=yield this.buildAuthRequest(this.email,rt.AuthenticateAndUnlock);if(!e)return void this.logService.error("AuthRequest failed to initialize from buildAuthRequest.");if(!this.fingerprintPhrase)return void this.logService.error("FingerprintPhrase failed to initialize from buildAuthRequest.");if(!this.authRequestKeyPair)return void this.logService.error("KeyPair failed to initialize from buildAuthRequest.");const t=yield this.authRequestApiService.postAuthRequest(e);if(!this.authRequestKeyPair.privateKey)return void this.logService.error("No private key when trying to cache the login view.");if(!this.accessCode)return void this.logService.error("No access code when trying to cache the login view.");this.loginViaAuthRequestCacheService.cacheLoginView(t.id,this.authRequestKeyPair.privateKey,this.accessCode),t.id&&(yield this.anonymousHubService.createHubConnection(t.id))}catch(e){this.logService.error(e)}setTimeout(()=>{this.showResendNotification=!0},1e3*this.showResendNotificationTimeoutSeconds)})}buildAuthRequest(e,t){return bt(this,void 0,void 0,function*(){const i=yield this.cryptoFunctionService.rsaGenerateKeyPair(2048);this.authRequestKeyPair={publicKey:i[0],privateKey:i[1]};const n=yield this.appIdService.getAppId();if(!this.authRequestKeyPair.publicKey){const e="No public key when building an auth request.";throw this.logService.error(e),new Error(e)}this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(e,this.authRequestKeyPair.publicKey),this.accessCode=yield this.passwordGenerationService.generatePassword({type:"password",length:25});const r=O.A.fromBufferToB64(this.authRequestKeyPair.publicKey);return new ct(e,n,r,t,this.accessCode)})}handleExistingAdminAuthRequestLogin(e,t){return bt(this,void 0,void 0,function*(){let i;try{i=yield this.authRequestApiService.getAuthRequest(e.id)}catch(r){return r instanceof $._&&r.statusCode===P.kG.NotFound?yield this.clearExistingAdminAuthRequestAndStartNewRequest(t):void this.logService.error(r)}if(!i)return yield this.clearExistingAdminAuthRequestAndStartNewRequest(t);if(i.isAnswered&&!i.requestApproved)return yield this.clearExistingAdminAuthRequestAndStartNewRequest(t);if(i.requestApproved)return yield this.decryptViaApprovedAuthRequest(i,e.privateKey,t);if(!this.email)return void this.logService.error("Email not defined when handling an existing an admin auth request.");const n=yield this.cryptoFunctionService.rsaExtractPublicKey(e.privateKey);this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(this.email,n),this.authRequestKeyPair={privateKey:e.privateKey,publicKey:void 0},yield this.anonymousHubService.createHubConnection(e.id)})}retrieveAuthRequest(e){return bt(this,void 0,void 0,function*(){let t;try{if(this.authStatus===at.J.Locked)t=yield this.authRequestApiService.getAuthRequest(e);else{if(!this.accessCode){const e="No access code available when handling approved auth request.";throw this.logService.error(e),new Error(e)}t=yield this.authRequestApiService.getAuthResponse(e,this.accessCode)}}catch(i){i instanceof $._&&i.statusCode===P.kG.NotFound?t=void 0:this.logService.error(i)}if(void 0===t)throw new Error("Auth request response not generated");return t})}handleExistingAuthRequestLogin(e){return bt(this,void 0,void 0,function*(){this.showResendNotification=!1;try{const t=yield this.retrieveAuthRequest(e);if(!t)return yield this.clearExistingStandardAuthRequestAndStartNewRequest();if(t.isAnswered&&!t.requestApproved)return yield this.clearExistingStandardAuthRequestAndStartNewRequest();if(t.requestApproved){return this.authStatus===at.J.Locked?yield this.handleAuthenticatedFlows(t):yield this.handleUnauthenticatedFlows(t,e)}yield this.anonymousHubService.createHubConnection(e)}catch(t){t instanceof $._&&(yield this.router.navigate([this.backToRoute]),this.validationService.showError(t)),this.logService.error(t)}setTimeout(()=>{this.showResendNotification=!0},1e3*this.showResendNotificationTimeoutSeconds)})}handleAuthenticatedFlows(e){return bt(this,void 0,void 0,function*(){var t;const i=null===(t=yield(0,w._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;i?this.authRequestKeyPair&&this.authRequestKeyPair.privateKey?yield this.decryptViaApprovedAuthRequest(e,this.authRequestKeyPair.privateKey,i):this.logService.error("No private key set when handling the authenticated flows."):this.logService.error("Not able to get a user id from the account service active account observable.")})}handleUnauthenticatedFlows(e,t){return bt(this,void 0,void 0,function*(){const i=yield this.buildAuthRequestLoginCredentials(t,e);if(!i)return void this.logService.error("Didn't set up auth request login credentials properly.");this.loginViaAuthRequestCacheService.clearCacheLoginView();const n=yield this.loginStrategyService.logIn(i);yield this.handlePostLoginNavigation(n)})}decryptViaApprovedAuthRequest(e,t,i){return bt(this,void 0,void 0,function*(){e.masterPasswordHash?yield this.authRequestService.setKeysAfterDecryptingSharedMasterKeyAndHash(e,t,i):yield this.authRequestService.setUserKeyAfterDecryptingSharedUserKey(e,t,i),yield this.authRequestService.clearAdminAuthRequest(i),this.loginViaAuthRequestCacheService.clearCacheLoginView(),this.toastService.showToast({variant:"success",message:this.i18nService.t("loginApproved")});const n=yield(0,w._)(this.accountService.activeAccount$);n?(yield this.deviceTrustService.trustDeviceIfRequired(n.id),yield this.handleSuccessfulLoginNavigation(i)):this.logService.error("No active account defined from the account service.")})}buildAuthRequestLoginCredentials(e,t){return bt(this,void 0,void 0,function*(){if(this.authRequestKeyPair&&this.authRequestKeyPair.privateKey)if(this.email){if(this.accessCode){if(t.masterPasswordHash){const{masterKey:i,masterKeyHash:n}=yield this.authRequestService.decryptPubKeyEncryptedMasterKeyAndHash(t.key,t.masterPasswordHash,this.authRequestKeyPair.privateKey);return new F.xM(this.email,this.accessCode,e,null,i,n)}{const i=yield this.authRequestService.decryptPubKeyEncryptedUserKey(t.key,this.authRequestKeyPair.privateKey);return new F.xM(this.email,this.accessCode,e,i,null,null)}}this.logService.error("Access code not defined when building auth request login credentials.")}else this.logService.error("Email not defined.");else this.logService.error("No private key set when building auth request login credentials.")})}clearExistingAdminAuthRequestAndStartNewRequest(e){return bt(this,void 0,void 0,function*(){yield this.authRequestService.clearAdminAuthRequest(e),yield this.handleNewAdminAuthRequestLogin()})}clearExistingStandardAuthRequestAndStartNewRequest(){return bt(this,void 0,void 0,function*(){this.loginViaAuthRequestCacheService.clearCacheLoginView(),yield this.handleNewStandardAuthRequestLogin()})}handlePostLoginNavigation(e){return bt(this,void 0,void 0,function*(){e.requiresTwoFactor?yield this.router.navigate(["2fa"]):yield this.handleSuccessfulLoginNavigation(e.userId)})}handleSuccessfulLoginNavigation(e){return bt(this,void 0,void 0,function*(){yield this.loginSuccessHandlerService.run(e,null),yield this.router.navigate(["vault"])})}}xt.ɵfac=function(e){return new(e||xt)(l.rXU(je.Di),l.rXU(vt.k),l.rXU(_.Y),l.rXU(ft.d),l.rXU(F.XF),l.rXU(gt.u),l.rXU(yt.R),l.rXU(Ve.M),l.rXU(E.v),l.rXU(H.W),l.rXU(A.K),l.rXU(F.DS),l.rXU(F.sg),l.rXU(dt.JJ),l.rXU(J.y),l.rXU(L.Ix),l.rXU(q.f),l.rXU(Q.B),l.rXU(F.aJ),l.rXU(pt))},xt.ɵcmp=l.VBU({type:xt,selectors:[["ng-component"]],features:[l.Jv_([{provide:pt}])],decls:2,vars:2,consts:[[4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[1,"tw-text-center"],[1,"tw-font-medium"],[1,"tw-text-code"],["type","button","bitButton","","block","","buttonType","secondary","class","tw-mt-4",3,"click",4,"ngIf"],["class","tw-mt-4",4,"ngIf"],["bitLink","","linkType","primary","target","_blank","rel","noreferrer",1,"tw-cursor-pointer",3,"href"],["type","button","bitButton","","block","","buttonType","secondary",1,"tw-mt-4",3,"click"],[1,"tw-mt-4"],["bitLink","","linkType","primary",3,"routerLink"]],template:function(e,t){1&e&&l.DNE(0,wt,3,0,"ng-container",0)(1,Rt,4,2,"ng-container",0),2&e&&(l.Y8G("ngIf",t.loading),l.R7$(),l.Y8G("ngIf",!t.loading))},dependencies:[o.t,c.Q,v.MD,v.bT,n.p,V.V,he.L,y.iI,y.Wk,h.$],encapsulation:2});var $t=i(65113);class Et{constructor(e){this.email=e}}var At=i(57083),Dt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ot(e,t){if(1&e){const e=l.RV6();l.j41(0,"bit-form-field")(1,"bit-label"),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.nrm(4,"input",4),l.k0s(),l.j41(5,"button",5),l.EFF(6),l.nI1(7,"i18n"),l.k0s(),l.j41(8,"button",6),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.cancel())}),l.EFF(9),l.nI1(10,"i18n"),l.k0s()}2&e&&(l.R7$(2),l.JRh(l.bMT(3,5,"accountEmail")),l.R7$(3),l.Y8G("block",!0),l.R7$(),l.SpI(" ",l.bMT(7,7,"requestHint")," "),l.R7$(2),l.Y8G("block",!0),l.R7$(),l.SpI(" ",l.bMT(10,9,"cancel")," "))}function Mt(e,t){1&e&&l.eu8(0)}function Ut(e,t){if(1&e&&(l.j41(0,"main",7),l.DNE(1,Mt,1,0,"ng-container",8),l.k0s()),2&e){l.XpG();const e=l.sdS(2);l.R7$(),l.Y8G("ngTemplateOutlet",e)}}function Gt(e,t){1&e&&l.eu8(0)}function jt(e,t){if(1&e&&(l.qex(0),l.DNE(1,Gt,1,0,"ng-container",8),l.bVm()),2&e){l.XpG();const e=l.sdS(2);l.R7$(),l.Y8G("ngTemplateOutlet",e)}}class Nt{get email(){return this.formGroup.controls.email.value}constructor(e,t,i,n,r,s,o){this.apiService=e,this.formBuilder=t,this.i18nService=i,this.loginEmailService=n,this.platformUtilsService=r,this.toastService=s,this.router=o,this.formGroup=this.formBuilder.group({email:["",[g.k0.required,g.k0.email]]}),this.submit=()=>Dt(this,void 0,void 0,function*(){this.validateEmailOrShowToast(this.email)&&(yield this.apiService.postPasswordHint(new Et(this.email)),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("masterPassSent")}),yield this.router.navigate(["login"]))}),this.clientType=this.platformUtilsService.getClientType()}ngOnInit(){return Dt(this,void 0,void 0,function*(){var e;const t=null!==(e=yield(0,w._)(this.loginEmailService.loginEmail$))&&void 0!==e?e:"";this.formGroup.controls.email.setValue(t)})}cancel(){return Dt(this,void 0,void 0,function*(){yield this.loginEmailService.setLoginEmail(this.email),yield this.router.navigate(["login"])})}validateEmailOrShowToast(e){return null==e||""===e?(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("emailRequired")}),!1):-1!==e.indexOf("@")||(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidEmail")}),!1)}}Nt.ɵfac=function(e){return new(e||Nt)(l.rXU(Ne.G),l.rXU(g.ok),l.rXU(H.W),l.rXU(F.DS),l.rXU(J.y),l.rXU(q.f),l.rXU(L.Ix))},Nt.ɵcmp=l.VBU({type:Nt,selectors:[["ng-component"]],decls:5,vars:4,consts:[["formContentTemplate",""],[3,"bitSubmit","formGroup"],["tabindex","-1",4,"ngIf"],[4,"ngIf"],["bitInput","","appAutofocus","","inputmode","email","appInputVerbatim","false","type","email","formControlName","email"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",1,"tw-mb-2",3,"block"],["type","button","bitButton","","buttonType","secondary",3,"click","block"],["tabindex","-1"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(l.j41(0,"form",1),l.DNE(1,Ot,11,11,"ng-template",null,0,l.C5r)(3,Ut,2,1,"main",2)(4,jt,2,1,"ng-container",3),l.k0s()),2&e&&(l.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),l.R7$(3),l.Y8G("ngIf","browser"===t.clientType),l.R7$(),l.Y8G("ngIf","browser"!==t.clientType))},dependencies:[U.C,ie.$,ne.L,o.t,c.Q,v.MD,v.bT,v.T3,j.L,oe.j,ae.J,le.h,n.p,pe.B,At.q,g.X1,g.qT,g.me,g.BC,g.cb,g.j4,g.JD,y.iI,h.$],encapsulation:2});const Vt=k.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 0.87 76.36 76.8">
    <path class="tw-fill-illustration-bg-primary" d="M3.333 33.298a5 5 0 0 1 1.745-3.794L37.287 1.87a4.167 4.167 0 0 1 5.426 0l32.21 27.634a5 5 0 0 1 1.744 3.794v41.035a3.333 3.333 0 0 1-3.334 3.334H6.667a3.333 3.333 0 0 1-3.334-3.334V33.299Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 74.334V33.297c0-.972-.425-1.896-1.163-2.53L41.627 3.136a2.5 2.5 0 0 0-3.255 0L6.162 30.769A3.333 3.333 0 0 0 5 33.299v41.035C5 75.254 5.746 76 6.667 76h66.666c.92 0 1.667-.746 1.667-1.666ZM5.078 29.504a5 5 0 0 0-1.745 3.794v41.035a3.333 3.333 0 0 0 3.334 3.334h66.666a3.333 3.333 0 0 0 3.334-3.334V33.299a5 5 0 0 0-1.745-3.794L42.713 1.87a4.167 4.167 0 0 0-5.426 0L5.077 29.504Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41.98 55.17a3.333 3.333 0 0 1-3.96 0L5.496 31.161a.833.833 0 1 0-.99 1.341L37.031 56.51a5 5 0 0 0 5.938 0l32.526-24.007a.833.833 0 0 0-.99-1.34L41.98 55.168Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M12.5 10.166h55v28.333L40.999 58.175a1.667 1.667 0 0 1-1.994-.005L12.5 38.29V10.166Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65.833 11.833H14.167v25.625l25.838 19.379L65.833 37.66V11.833ZM67.5 38.499 40.999 58.175a1.667 1.667 0 0 1-1.994-.005L12.5 38.29V10.166h55v28.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="m40 50.166 18.333 10.417L40 70.999 21.667 60.583 40 50.166Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.02 51.92a3.333 3.333 0 0 0-4.04 0L5.505 76.663a.833.833 0 0 1-1.01-1.326L36.97 50.594a5 5 0 0 1 6.06 0l-.494.648.494-.648 32.475 24.743a.833.833 0 0 1-1.01 1.326L42.02 51.92Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M70 41c0 9.204-7.462 16.666-16.667 16.666-9.204 0-16.666-7.462-16.666-16.666 0-9.205 7.462-16.667 16.666-16.667C62.538 24.333 70 31.795 70 41Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M53.333 56c8.285 0 15-6.716 15-15 0-8.285-6.715-15-15-15-8.284 0-15 6.715-15 15 0 8.284 6.716 15 15 15Zm0 1.666C62.538 57.666 70 50.204 70 41c0-9.205-7.462-16.667-16.667-16.667-9.204 0-16.666 7.462-16.666 16.667 0 9.204 7.462 16.666 16.666 16.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M65.833 41c0 6.904-5.596 12.5-12.5 12.5-6.903 0-12.5-5.596-12.5-12.5s5.597-12.5 12.5-12.5c6.904 0 12.5 5.596 12.5 12.5Z"/>
    <path class="tw-fill-illustration-outline" d="M79.17 65.24 65.417 52.25l-1.667 1.667L76.74 67.67a1.667 1.667 0 0 0 2.39.034l.074-.075a1.667 1.667 0 0 0-.034-2.39Z"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M18.333 17.666a.833.833 0 0 0 0 1.667h8.334a.833.833 0 0 0 0-1.667h-8.334ZM55 20.999a.833.833 0 0 1 0 1.667h-8.333a.833.833 0 1 1 0-1.667H55Zm.453 3.467a.83.83 0 0 0-.453-.133h-8.333a.833.833 0 0 0-.397 1.566 16.603 16.603 0 0 1 7.063-1.566c.718 0 1.425.045 2.12.133Zm-17.737 10.7a16.551 16.551 0 0 0-.524 1.667H35a.833.833 0 0 1 0-1.667h2.716Zm1.696-3.333a16.643 16.643 0 0 0-.966 1.666H32.5a.833.833 0 1 1 0-1.666h6.912ZM30 17.666a.833.833 0 0 0 0 1.667h8.333a.833.833 0 1 0 0-1.667H30Zm14.167 4.167a.833.833 0 0 0-.834-.834H35a.833.833 0 0 0 0 1.667h8.333c.46 0 .834-.373.834-.833Zm-.834 4.166a.833.833 0 1 0 0-1.666h-10a.833.833 0 0 0 0 1.666h10Zm-1.666-8.333a.833.833 0 1 0 0 1.667h1.666a.833.833 0 1 0 0-1.667h-1.666ZM32.5 21.833a.833.833 0 0 0-.833-.834H30a.833.833 0 0 0 0 1.667h1.667c.46 0 .833-.373.833-.833ZM30 25.999a.833.833 0 1 0 0-1.666h-3.333a.833.833 0 1 0 0 1.666H30Zm0 6.667c0 .46-.373.833-.833.833h-5a.833.833 0 1 1 0-1.666h5c.46 0 .833.373.833.833Zm1.667 4.167a.833.833 0 0 0 0-1.667H18.333a.833.833 0 0 0 0 1.667h13.334Zm15-19.167a.833.833 0 1 0 0 1.667H55a.833.833 0 0 0 0-1.667h-8.333ZM27.5 21.833a.833.833 0 0 0-.833-.834h-8.334a.833.833 0 0 0 0 1.667h8.334c.46 0 .833-.373.833-.833Zm-4.167 4.166a.833.833 0 1 0 0-1.666h-5a.833.833 0 0 0 0 1.666h5Zm-1.666 6.667c0 .46-.373.833-.834.833h-2.5a.833.833 0 1 1 0-1.666h2.5c.46 0 .834.373.834.833Z" clip-rule="evenodd"/>
  </svg>
`;var Bt=i(24558);class zt{constructor(e,t,i){this.email=e,this.name=t,this.receiveMarketingEmails=i}}var Lt=i(55807),Kt=i(36359),qt=i(12610),_t=i(39444),Xt=i(8433),Yt=i(69194),Ht=i(68016),Wt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Jt=(e,t)=>({"bwi-angle-right":e,"bwi-angle-down":t});function Zt(e,t){1&e&&(l.qex(0),l.j41(1,"p",11),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"bit-form-field")(5,"bit-label"),l.EFF(6),l.nI1(7,"i18n"),l.k0s(),l.nrm(8,"input",12),l.k0s(),l.j41(9,"bit-form-field")(10,"bit-label"),l.EFF(11),l.nI1(12,"i18n"),l.k0s(),l.nrm(13,"input",13),l.k0s(),l.j41(14,"bit-form-field")(15,"bit-label"),l.EFF(16),l.nI1(17,"i18n"),l.k0s(),l.nrm(18,"input",14),l.k0s(),l.j41(19,"bit-form-field")(20,"bit-label"),l.EFF(21),l.nI1(22,"i18n"),l.k0s(),l.nrm(23,"input",15),l.k0s(),l.j41(24,"bit-form-field")(25,"bit-label"),l.EFF(26),l.nI1(27,"i18n"),l.k0s(),l.nrm(28,"input",16),l.k0s(),l.bVm()),2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,6,"selfHostedCustomEnvHeader")," "),l.R7$(4),l.JRh(l.bMT(7,8,"webVaultUrl")),l.R7$(5),l.JRh(l.bMT(12,10,"apiUrl")),l.R7$(5),l.JRh(l.bMT(17,12,"identityUrl")),l.R7$(5),l.JRh(l.bMT(22,14,"notificationsUrl")),l.R7$(5),l.JRh(l.bMT(27,16,"iconsUrl")))}function Qt(e,t){1&e&&(l.j41(0,"span",17),l.nrm(1,"i",18),l.EFF(2),l.nI1(3,"i18n"),l.k0s()),2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,1,"selfHostedEnvFormInvalid")," "))}function ei(){const e=(0,z.WQX)(H.W),t=(0,z.WQX)(J.y);return i=>{const n=i.value;return!n||n.startsWith("https://")||t.isDev()?null:{onlyHttpsAllowed:{message:e.t("selfHostedEnvMustUseHttps")}}}}class ti{static open(e){return Wt(this,void 0,void 0,function*(){const t=e.open(ti,{disableClose:!1}),i=yield(0,w._)(t.closed);return null!=i&&i})}get baseUrl(){return this.formGroup.get("baseUrl")}get webVaultUrl(){return this.formGroup.get("webVaultUrl")}get apiUrl(){return this.formGroup.get("apiUrl")}get identityUrl(){return this.formGroup.get("identityUrl")}get iconsUrl(){return this.formGroup.get("iconsUrl")}get notificationsUrl(){return this.formGroup.get("notificationsUrl")}constructor(e,t,i){this.dialogRef=e,this.formBuilder=t,this.environmentService=i,this.formGroup=this.formBuilder.group({baseUrl:["",[ei()]],webVaultUrl:["",[ei()]],apiUrl:["",[ei()]],identityUrl:["",[ei()]],iconsUrl:["",[ei()]],notificationsUrl:["",[ei()]]},{validators:e=>{var t,i,n,r,s,o;const a=e,l=null===(t=a.get("baseUrl"))||void 0===t?void 0:t.value,c=null===(i=a.get("webVaultUrl"))||void 0===i?void 0:i.value,d=null===(n=a.get("apiUrl"))||void 0===n?void 0:n.value,u=null===(r=a.get("identityUrl"))||void 0===r?void 0:r.value,h=null===(s=a.get("iconsUrl"))||void 0===s?void 0:s.value,p=null===(o=a.get("notificationsUrl"))||void 0===o?void 0:o.value;return l||c||d||u||h||p?null:{atLeastOneUrlIsRequired:!0}}}),this.showCustomEnv=!1,this.showErrorSummary=!1,this.destroy$=new b.B,this.submit=()=>Wt(this,void 0,void 0,function*(){var e;this.formGroup.markAllAsTouched(),this.showErrorSummary=!1,this.formGroup.invalid?this.showErrorSummary=Boolean(null===(e=this.formGroup.errors)||void 0===e?void 0:e.atLeastOneUrlIsRequired):(yield this.environmentService.setEnvironment(E.T.SelfHosted,{base:this.baseUrl.value,api:this.apiUrl.value,identity:this.identityUrl.value,webVault:this.webVaultUrl.value,icons:this.iconsUrl.value,notifications:this.notificationsUrl.value}),this.dialogRef.close(!0))})}ngOnInit(){this.environmentService.environment$.pipe((0,S.s)(1),(0,Yt.p)(e=>e.getRegion()===E.T.SelfHosted),(0,I.Q)(this.destroy$)).subscribe({next:e=>{const t=e.getUrls();this.formGroup.patchValue({baseUrl:t.base||"",webVaultUrl:t.webVault||"",apiUrl:t.api||"",identityUrl:t.identity||"",iconsUrl:t.icons||"",notificationsUrl:t.notifications||""})}})}cancel(){return Wt(this,void 0,void 0,function*(){this.dialogRef.close(!1)})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}ti.ɵfac=function(e){return new(e||ti)(l.rXU(r.ce),l.rXU(g.ok),l.rXU(E.v))},ti.ɵcmp=l.VBU({type:ti,selectors:[["self-hosted-env-config-dialog"]],decls:26,vars:23,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["id","self_hosted_env_settings_form_input_base_url","bitInput","","type","text","formControlName","baseUrl","appAutofocus","","appInputVerbatim",""],["bitLink","","linkType","primary","type","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sm",3,"ngClass"],[4,"ngIf"],["class","tw-block tw-text-danger tw-mt-2","aria-live","assertive","role","alert",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click"],["bitTypography","body1",1,"tw-text-muted","tw-mt-3"],["id","self_hosted_env_settings_form_input_web_vault_url","bitInput","","type","text","formControlName","webVaultUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_api_url","bitInput","","type","text","formControlName","apiUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_identity_url","bitInput","","type","text","formControlName","identityUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_notifications_url","bitInput","","type","text","formControlName","notificationsUrl","appInputVerbatim",""],["id","self_hosted_env_settings_form_input_icons_url","bitInput","","type","text","formControlName","iconsUrl","appInputVerbatim",""],["aria-live","assertive","role","alert",1,"tw-block","tw-text-danger","tw-mt-2"],[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(l.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),l.EFF(3," Self-hosted environment"),l.k0s(),l.qex(4,2),l.j41(5,"bit-form-field")(6,"bit-label"),l.EFF(7),l.nI1(8,"i18n"),l.k0s(),l.nrm(9,"input",3),l.j41(10,"bit-hint"),l.EFF(11),l.nI1(12,"i18n"),l.k0s()(),l.j41(13,"button",4),l.bIt("click",function(){return t.showCustomEnv=!t.showCustomEnv}),l.nrm(14,"i",5),l.EFF(15),l.nI1(16,"i18n"),l.k0s(),l.DNE(17,Zt,29,18,"ng-container",6)(18,Qt,4,3,"span",7),l.bVm(),l.qex(19,8),l.j41(20,"button",9),l.EFF(21),l.nI1(22,"i18n"),l.k0s(),l.j41(23,"button",10),l.bIt("click",function(){return t.cancel()}),l.EFF(24),l.nI1(25,"i18n"),l.k0s(),l.bVm(),l.k0s()()),2&e&&(l.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),l.R7$(7),l.JRh(l.bMT(8,10,"baseUrl")),l.R7$(4),l.JRh(l.bMT(12,12,"selfHostedBaseUrlHint")),l.R7$(3),l.Y8G("ngClass",l.l_i(20,Jt,!t.showCustomEnv,t.showCustomEnv)),l.R7$(),l.SpI(" ",l.bMT(16,14,"customEnvironment")," "),l.R7$(2),l.Y8G("ngIf",t.showCustomEnv),l.R7$(),l.Y8G("ngIf",t.showErrorSummary),l.R7$(3),l.SpI(" ",l.bMT(22,16,"save")," "),l.R7$(3),l.SpI(" ",l.bMT(25,18,"cancel")," "))},dependencies:[v.MD,v.YU,v.bT,n.p,pe.B,At.q,a.P,Ht.m,o.t,c.Q,V.V,he.o,Ue.E,Xe.r,g.X1,g.qT,g.me,g.BC,g.cb,g.j4,g.JD,j.L,oe.j,_e.I,ae.J,le.h,U.C,ie.$,ne.L,h.$],encapsulation:2});var ii=i(33886),ni=i(68923),ri=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function si(e,t){if(1&e&&l.nrm(0,"bit-option",5),2&e){const e=t.$implicit;l.Y8G("value",e)("label",e.domain)}}function oi(e,t){if(1&e&&(l.nrm(0,"bit-option",5),l.nI1(1,"i18n")),2&e){const e=l.XpG(2);l.Y8G("value",e.ServerEnvironmentType.SelfHosted)("label",l.bMT(1,2,"selfHostedServer"))}}function ai(e,t){if(1&e){const e=l.RV6();l.j41(0,"form",1)(1,"bit-form-field")(2,"bit-label"),l.EFF(3),l.nI1(4,"i18n"),l.k0s(),l.j41(5,"bit-select",2),l.bIt("closed",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.onSelectClosed())}),l.DNE(6,si,1,2,"bit-option",3)(7,oi,2,4,"bit-option",4),l.k0s()()()}if(2&e){const e=l.XpG();l.Y8G("formGroup",e.formGroup),l.R7$(3),l.JRh(l.bMT(4,4,"creatingAccountOn")),l.R7$(3),l.Y8G("ngForOf",e.availableRegionConfigs),l.R7$(),l.Y8G("ngIf",e.isDesktopOrBrowserExtension)}}class li{get selectedRegion(){return this.formGroup.get("selectedRegion")}constructor(e,t,i,n,r,s){this.formBuilder=e,this.environmentService=t,this.dialogService=i,this.i18nService=n,this.toastService=r,this.platformUtilsService=s,this.selectedRegionChange=new l.bkB,this.ServerEnvironmentType=E.T,this.formGroup=this.formBuilder.group({selectedRegion:[null,g.k0.required]}),this.availableRegionConfigs=this.environmentService.availableRegions(),this.hideEnvSelector=!1,this.isDesktopOrBrowserExtension=!1,this.destroy$=new b.B;const o=s.getClientType();this.isDesktopOrBrowserExtension=o===P.sK.Desktop||o===P.sK.Browser,this.hideEnvSelector=o===P.sK.Web&&this.platformUtilsService.isSelfHost()}ngOnInit(){return ri(this,void 0,void 0,function*(){this.hideEnvSelector||(yield this.initSelectedRegionAndListenForEnvChanges(),this.listenForSelectedRegionChanges())})}initSelectedRegionAndListenForEnvChanges(){return ri(this,void 0,void 0,function*(){this.environmentService.environment$.pipe((0,Pe.T)(e=>{const t=e.getRegion(),i=this.availableRegionConfigs.find(e=>e.key===t);return void 0===i?E.T.SelfHosted:i}),(0,Kt.M)(e=>{e!==this.selectedRegion.value&&this.selectedRegion.setValue(e,{emitEvent:!1}),this.selectedRegionFromEnv=e,this.selectedRegionChange.emit(e)}),(0,I.Q)(this.destroy$)).subscribe()})}listenForSelectedRegionChanges(){this.selectedRegion.valueChanges.pipe((0,qt.Z)(null),(0,_t.J)(),(0,xe.n)(([e,t])=>null===t?(this.selectedRegionChange.emit(t),(0,Oe.of)(null)):t!==E.T.SelfHosted?(this.selectedRegionChange.emit(t),(0,Ae.H)(this.environmentService.setEnvironment(t.key))):(0,Oe.of)(null)),(0,I.Q)(this.destroy$)).subscribe()}handleSelfHostedEnvConfigDialogResult(e,t){if(!0===e)return this.selectedRegionChange.emit(E.T.SelfHosted),void this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("environmentSaved")});!1!==e&&void 0!==e||null===t||t===E.T.SelfHosted?(this.selectedRegionChange.emit(this.selectedRegionFromEnv),this.selectedRegion.setValue(this.selectedRegionFromEnv,{emitEvent:!1})):(this.selectedRegionChange.emit(t),this.selectedRegion.setValue(t,{emitEvent:!1}))}onSelectClosed(){return ri(this,void 0,void 0,function*(){if(this.selectedRegion.value===E.T.SelfHosted){const e=yield ti.open(this.dialogService);return this.handleSelfHostedEnvConfigDialogResult(e,this.selectedRegion.value)}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}li.ɵfac=function(e){return new(e||li)(l.rXU(g.ok),l.rXU(E.v),l.rXU(r.o3),l.rXU(H.W),l.rXU(q.f),l.rXU(J.y))},li.ɵcmp=l.VBU({type:li,selectors:[["auth-registration-env-selector"]],outputs:{selectedRegionChange:"selectedRegionChange"},decls:1,vars:1,consts:[[3,"formGroup",4,"ngIf"],[3,"formGroup"],["formControlName","selectedRegion",3,"closed"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label",4,"ngIf"],[3,"value","label"]],template:function(e,t){1&e&&l.DNE(0,ai,8,6,"form",0),2&e&&l.Y8G("ngIf",!t.hideEnvSelector)},dependencies:[v.MD,v.Sq,v.bT,n.p,g.X1,g.qT,g.BC,g.cb,g.j4,g.JD,j.L,oe.j,le.h,Xt.p,ii.w,ni.P,h.$],encapsulation:2});var ci,di=i(46357),ui=i(68466),hi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function pi(e,t){1&e&&(l.j41(0,"bit-form-control"),l.nrm(1,"input",8),l.j41(2,"bit-label",9),l.EFF(3),l.nI1(4,"i18n"),l.j41(5,"a",10),l.EFF(6),l.nI1(7,"i18n"),l.k0s(),l.EFF(8),l.nI1(9,"i18n"),l.k0s()()),2&e&&(l.R7$(3),l.SpI(" ",l.bMT(4,3,"receiveMarketingEmailsV2")," "),l.R7$(3),l.SpI(" ",l.bMT(7,5,"unsubscribe")," "),l.R7$(2),l.SpI(" ",l.bMT(9,7,"atAnyTime")," "))}function mi(e,t){1&e&&(l.j41(0,"p",11),l.EFF(1),l.nI1(2,"i18n"),l.j41(3,"a",12),l.EFF(4),l.nI1(5,"i18n"),l.k0s(),l.EFF(6),l.nI1(7,"i18n"),l.j41(8,"a",13),l.EFF(9),l.nI1(10,"i18n"),l.k0s()()),2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,4,"byContinuingYouAgreeToThe")," "),l.R7$(3),l.JRh(l.bMT(5,6,"termsOfService")),l.R7$(2),l.SpI(" ",l.bMT(7,8,"and")," "),l.R7$(3),l.JRh(l.bMT(10,10,"privacyPolicy")))}function vi(e,t){if(1&e&&l.nrm(0,"bit-error-summary",14),2&e){const e=l.XpG(2);l.Y8G("formGroup",e.formGroup)}}function fi(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"form",1)(2,"auth-registration-env-selector",2),l.bIt("selectedRegionChange",function(t){z.eBV(e);const i=l.XpG();return z.Njj(i.handleSelectedRegionChange(t))}),l.k0s(),l.j41(3,"bit-form-field")(4,"bit-label"),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.nrm(7,"input",3),l.k0s(),l.j41(8,"bit-form-field")(9,"bit-label"),l.EFF(10),l.nI1(11,"i18n"),l.k0s(),l.nrm(12,"input",4),l.k0s(),l.DNE(13,pi,10,9,"bit-form-control",0),l.j41(14,"button",5),l.EFF(15),l.nI1(16,"i18n"),l.k0s(),l.DNE(17,mi,11,12,"p",6)(18,vi,1,1,"bit-error-summary",7),l.k0s(),l.bVm()}if(2&e){const e=l.XpG();l.R7$(),l.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),l.R7$(4),l.JRh(l.bMT(6,10,"emailAddress")),l.R7$(2),l.BMQ("readonly",!!e.emailReadonly||null),l.R7$(3),l.JRh(l.bMT(11,12,"name")),l.R7$(3),l.Y8G("ngIf",!e.isSelfHost),l.R7$(),l.Y8G("block",!0),l.R7$(),l.SpI(" ",l.bMT(16,14,"continue")," "),l.R7$(2),l.Y8G("ngIf",!e.isSelfHost),l.R7$(),l.Y8G("ngIf",e.showErrorSummary)}}function gi(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"div",15)(2,"p",16),l.EFF(3),l.nI1(4,"i18n"),l.j41(5,"span",17),l.EFF(6),l.k0s(),l.EFF(7),l.nI1(8,"i18n"),l.k0s(),l.j41(9,"p",18),l.EFF(10),l.nI1(11,"i18n"),l.j41(12,"a",19),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.goBack())}),l.EFF(13),l.nI1(14,"i18n"),l.k0s(),l.EFF(15),l.nI1(16,"i18n"),l.k0s()(),l.bVm()}if(2&e){const e=l.XpG();l.R7$(3),l.SpI(" ",l.bMT(4,6,"followTheLinkInTheEmailSentTo")," "),l.R7$(3),l.JRh(e.email.value),l.R7$(),l.SpI(" ",l.bMT(8,8,"andContinueCreatingYourAccount")," "),l.R7$(3),l.SpI(" ",l.bMT(11,10,"noEmail")," "),l.R7$(3),l.SpI(" ",l.bMT(14,12,"goBack")," "),l.R7$(2),l.SpI(" ",l.bMT(16,14,"toEditYourEmailAddress")," ")}}!function(e){e.USER_DATA_ENTRY="UserDataEntry",e.CHECK_EMAIL="CheckEmail"}(ci||(ci={}));const yi={[E.T.US]:!0,[E.T.EU]:!1,[E.T.SelfHosted]:!1};class bi{get email(){return this.formGroup.controls.email}get name(){return this.formGroup.controls.name}get receiveMarketingEmails(){return this.formGroup.controls.receiveMarketingEmails}constructor(e,t,i,n,r,s,o){this.formBuilder=e,this.route=t,this.platformUtilsService=i,this.accountApiService=n,this.router=r,this.loginEmailService=s,this.anonLayoutWrapperDataService=o,this.registrationStartStateChange=new l.bkB,this.state=ci.USER_DATA_ENTRY,this.RegistrationStartState=ci,this.isSelfHost=!1,this.formGroup=this.formBuilder.group({email:["",[g.k0.required,g.k0.email]],name:[""],receiveMarketingEmails:[!1]}),this.emailReadonly=!1,this.showErrorSummary=!1,this.destroy$=new b.B,this.submit=()=>hi(this,void 0,void 0,function*(){if(!this.validateForm())return;const e=""===this.name.value?null:this.name.value,t=new zt(this.email.value,e,this.receiveMarketingEmails.value),i=yield this.accountApiService.registerSendVerificationEmail(t);"string"!=typeof i?(this.state=ci.CHECK_EMAIL,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"checkYourEmail"},pageIcon:Vt}),this.registrationStartStateChange.emit(this.state)):yield this.router.navigate(["/finish-signup"],{queryParams:{token:i,email:this.email.value}})}),this.isSelfHost=i.isSelfHost()}ngOnInit(){return hi(this,void 0,void 0,function*(){this.registrationStartStateChange.emit(this.state),this.listenForQueryParamChanges(),this.loginEmailService.loginEmail$.pipe((0,I.Q)(this.destroy$)).subscribe(e=>{e&&this.formGroup.patchValue({email:e})})})}listenForQueryParamChanges(){this.route.queryParams.pipe((0,I.Q)(this.destroy$)).subscribe(e=>{var t;null!=e.email&&e.email.indexOf("@")>-1&&(null===(t=this.email)||void 0===t||t.setValue(e.email),this.emailReadonly="true"===e.emailReadonly)})}setReceiveMarketingEmailsByRegion(e){let t;if(e===E.T.SelfHosted)t=yi[e];else{const i=e.key;t=yi[i]}this.receiveMarketingEmails.setValue(t)}handleSelectedRegionChange(e){this.isSelfHost=e===E.T.SelfHosted,null!==e&&this.setReceiveMarketingEmailsByRegion(e)}validateForm(){return this.formGroup.markAllAsTouched(),this.formGroup.invalid&&(this.showErrorSummary=!0),this.formGroup.valid}goBack(){this.state=ci.USER_DATA_ENTRY,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:Bt.R,pageTitle:{key:"createAccount"}}),this.registrationStartStateChange.emit(this.state)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}bi.ɵfac=function(e){return new(e||bi)(l.rXU(g.ok),l.rXU(L.nX),l.rXU(J.y),l.rXU(di.T),l.rXU(L.Ix),l.rXU(F.pi),l.rXU(K.f))},bi.ɵcmp=l.VBU({type:bi,selectors:[["auth-registration-start"]],outputs:{registrationStartStateChange:"registrationStartStateChange"},decls:2,vars:2,consts:[[4,"ngIf"],[3,"formGroup","bitSubmit"],[3,"selectedRegionChange"],["id","register-start_form_input_email","bitInput","","type","email","formControlName","email"],["id","register-start_form_input_name","bitInput","","type","text","formControlName","name"],["type","submit","buttonType","primary","bitButton","","bitFormButton","",1,"tw-mb-3",3,"block"],["bitTypography","helper","class","tw-text-main tw-text-xs tw-mb-0",4,"ngIf"],[3,"formGroup",4,"ngIf"],["id","register-start-form-input-receive-marketing-emails","type","checkbox","bitCheckbox","","formControlName","receiveMarketingEmails"],["for","register-start-form-input-receive-marketing-emails"],["bitLink","","linkType","primary","href","https://bitwarden.com/email-preferences","target","_blank","rel","noreferrer"],["bitTypography","helper",1,"tw-text-main","tw-text-xs","tw-mb-0"],["bitLink","","linkType","primary","href","https://bitwarden.com/terms/","target","_blank","rel","noreferrer"],["bitLink","","linkType","primary","href","https://bitwarden.com/privacy/","target","_blank","rel","noreferrer"],[3,"formGroup"],[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center"],["bitTypography","body1","id","follow_the_link_body",1,"tw-text-center","tw-mb-3","tw-text-main"],[1,"tw-font-medium"],["bitTypography","helper",1,"tw-text-center","tw-text-main"],["bitLink","","linkType","primary","tabindex","0",1,"tw-cursor-pointer",3,"click"]],template:function(e,t){1&e&&l.DNE(0,fi,19,16,"ng-container",0)(1,gi,17,16,"ng-container",0),2&e&&(l.Y8G("ngIf",t.state===t.RegistrationStartState.USER_DATA_ENTRY),l.R7$(),l.Y8G("ngIf",t.state===t.RegistrationStartState.CHECK_EMAIL))},dependencies:[v.MD,v.bT,g.X1,g.qT,g.me,g.Zm,g.BC,g.cb,g.j4,g.JD,n.p,j.L,se.f,oe.j,ae.J,ui.L,le.h,U.C,ie.$,ne.L,G.q,re.P,o.t,c.Q,V.V,he.L,Lt.o,li,h.$],encapsulation:2});class wi{constructor(e,t){this.email=e,this.emailVerificationToken=t}}class Si{}var Ii=i(71613),ki=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ci=()=>({key:"createAccount"});function Ti(e,t){1&e&&(l.j41(0,"div",2),l.nrm(1,"i",3),l.k0s())}function Fi(e,t){if(1&e){const e=l.RV6();l.j41(0,"auth-input-password",4),l.bIt("onPasswordFormSubmit",function(t){z.eBV(e);const i=l.XpG();return z.Njj(i.handlePasswordFormSubmit(t))}),l.k0s()}if(2&e){const e=l.XpG();l.Y8G("email",e.email)("flow",e.inputPasswordFlow)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)("loading",e.submitting)("primaryButtonText",l.lJ4(5,Ci))}}const Ri=Object.freeze({Premium:"premium"});class Pi{constructor(e,t,i,n,r,s,o,a,l,c,d,u){this.activatedRoute=e,this.router=t,this.toastService=i,this.i18nService=n,this.registrationFinishService=r,this.validationService=s,this.accountApiService=o,this.loginStrategyService=a,this.logService=l,this.anonLayoutWrapperDataService=c,this.loginSuccessHandlerService=d,this.premiumInterestStateService=u,this.destroy$=new b.B,this.inputPasswordFlow=m.m.SetInitialPasswordAccountRegistration,this.loading=!0,this.submitting=!1,this.premiumInterest=!1,this.masterPasswordPolicyOptions=null}ngOnInit(){return ki(this,void 0,void 0,function*(){const e=yield(0,w._)(this.activatedRoute.queryParams);if(this.handleQueryParams(e),e.fromEmail&&"true"===e.fromEmail&&this.email&&this.emailVerificationToken)yield this.initEmailVerificationFlow();else{(yield this.initOrgInviteFlowIfPresent())||this.initRegistrationWithEmailVerificationDisabledFlow()}this.loading=!1})}handleQueryParams(e){null!=e.email&&e.email.indexOf("@")>-1&&(this.email=e.email),null!=e.token&&(this.emailVerificationToken=e.token),null!=e.orgSponsoredFreeFamilyPlanToken&&(this.orgSponsoredFreeFamilyPlanToken=e.orgSponsoredFreeFamilyPlanToken),null!=e.acceptEmergencyAccessInviteToken&&e.emergencyAccessId&&(this.acceptEmergencyAccessInviteToken=e.acceptEmergencyAccessInviteToken,this.emergencyAccessId=e.emergencyAccessId),null!=e.providerInviteToken&&null!=e.providerUserId&&(this.providerInviteToken=e.providerInviteToken,this.providerUserId=e.providerUserId),null!=e.fromMarketing&&e.fromMarketing===Ri.Premium&&(this.premiumInterest=!0)}initOrgInviteFlowIfPresent(){return ki(this,void 0,void 0,function*(){this.masterPasswordPolicyOptions=yield this.registrationFinishService.getMasterPasswordPolicyOptsFromOrgInvite();const e=yield this.registrationFinishService.getOrgNameFromOrgInvite();return!!e&&(this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"joinOrganizationName",placeholders:[e]},pageSubtitle:{key:"finishJoiningThisOrganizationBySettingAMasterPassword"}}),!0)})}handlePasswordFormSubmit(e){return ki(this,void 0,void 0,function*(){var t;this.submitting=!0;try{yield this.registrationFinishService.finishRegistration(this.email,e,this.emailVerificationToken,this.orgSponsoredFreeFamilyPlanToken,this.acceptEmergencyAccessInviteToken,this.emergencyAccessId,this.providerInviteToken,this.providerUserId)}catch(i){return this.validationService.showError(i),void(this.submitting=!1)}this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("newAccountCreated2")});try{const i=new F.F2(this.email,e.newPassword),n=yield this.loginStrategyService.logIn(i);if(null==n?void 0:n.requiresTwoFactor)return void(yield this.router.navigate(["/2fa"]));yield this.loginSuccessHandlerService.run(n.userId,null!==(t=n.masterPassword)&&void 0!==t?t:null),this.premiumInterest&&(yield this.premiumInterestStateService.setPremiumInterest(n.userId,!0)),yield this.router.navigate(["/vault"])}catch(i){this.logService.error("Error logging in after registration: ",i.message),yield this.router.navigate(["/login"],{queryParams:{email:this.email}})}this.submitting=!1})}setDefaultPageTitleAndSubtitle(){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"setAStrongPassword"},pageSubtitle:{key:"finishCreatingYourAccountBySettingAPassword"}})}initEmailVerificationFlow(){return ki(this,void 0,void 0,function*(){this.setDefaultPageTitleAndSubtitle(),yield this.registerVerificationEmailClicked(this.email,this.emailVerificationToken)})}registerVerificationEmailClicked(e,t){return ki(this,void 0,void 0,function*(){const i=new wi(e,t);try{null==(yield this.accountApiService.registerVerificationEmailClicked(i))&&this.toastService.showToast({title:null,message:this.i18nService.t("emailVerifiedV2"),variant:"success"})}catch(n){yield this.handleRegisterVerificationEmailClickedError(n)}})}handleRegisterVerificationEmailClickedError(e){return ki(this,void 0,void 0,function*(){if(e instanceof $._){const t=e;if(t.statusCode===P.kG.BadRequest)t.message.includes("Expired link")?yield this.router.navigate(["/signup-link-expired"]):this.validationService.showError(t);else this.validationService.showError(t)}else this.validationService.showError(e)})}initRegistrationWithEmailVerificationDisabledFlow(){this.setDefaultPageTitleAndSubtitle()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Pi.ɵfac=function(e){return new(e||Pi)(l.rXU(L.nX),l.rXU(L.Ix),l.rXU(q.f),l.rXU(H.W),l.rXU(Si),l.rXU(Q.B),l.rXU(di.T),l.rXU(F.sg),l.rXU(A.K),l.rXU(K.f),l.rXU(F.aJ),l.rXU(Ii.a))},Pi.ɵcmp=l.VBU({type:Pi,selectors:[["auth-registration-finish"]],decls:2,vars:2,consts:[["class","tw-flex tw-items-center tw-justify-center",4,"ngIf"],[3,"email","flow","masterPasswordPolicyOptions","loading","primaryButtonText","onPasswordFormSubmit",4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[3,"onPasswordFormSubmit","email","flow","masterPasswordPolicyOptions","loading","primaryButtonText"]],template:function(e,t){1&e&&l.DNE(0,Ti,2,0,"div",0)(1,Fi,1,6,"auth-input-password",1),2&e&&(l.Y8G("ngIf",t.loading),l.R7$(),l.Y8G("ngIf",!t.loading))},dependencies:[v.MD,v.bT,n.p,y.iI,m.t],encapsulation:2});var xi=i(32415),$i=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ei{constructor(e){this.activatedRoute=e,this.destroy$=new b.B,this.Icons={TwoFactorTimeoutIcon:xi.c}}ngOnInit(){return $i(this,void 0,void 0,function*(){const e=yield(0,w._)(this.activatedRoute.data);this.loginRoute=e.loginRoute})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Ei.ɵfac=function(e){return new(e||Ei)(l.rXU(L.nX))},Ei.ɵcmp=l.VBU({type:Ei,selectors:[["auth-registration-link-expired"]],decls:13,vars:15,consts:[[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center"],["bitTypography","body1","id","restart_registration_body",1,"tw-text-center","tw-mb-3","tw-text-main"],["type","button","buttonType","primary","bitButton","","routerLink","/signup",1,"tw-mb-3",3,"block"],["type","button","buttonType","secondary","bitButton","",3,"block","routerLink"]],template:function(e,t){1&e&&(l.j41(0,"div",0)(1,"p",1),l.EFF(2),l.nI1(3,"i18n"),l.nrm(4,"br"),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.j41(7,"a",2),l.EFF(8),l.nI1(9,"i18n"),l.k0s(),l.j41(10,"a",3),l.EFF(11),l.nI1(12,"i18n"),l.k0s()()),2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,7,"pleaseRestartRegistrationOrTryLoggingIn")),l.R7$(3),l.SpI(" ",l.bMT(6,9,"youMayAlreadyHaveAnAccount")," "),l.R7$(2),l.Y8G("block",!0),l.R7$(),l.SpI(" ",l.bMT(9,11,"restartRegistration")," "),l.R7$(2),l.Y8G("block",!0)("routerLink",t.loginRoute),l.R7$(),l.SpI(" ",l.bMT(12,13,"logIn")," "))},dependencies:[v.MD,n.p,y.iI,y.Wk,Lt.o,o.t,c.Q,h.$],encapsulation:2});var Ai=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Di{constructor(e){this.activatedRoute=e}ngOnInit(){return Ai(this,void 0,void 0,function*(){const e=yield(0,w._)(this.activatedRoute.data);this.loginRoute=e.loginRoute})}}Di.ɵfac=function(e){return new(e||Di)(l.rXU(L.nX))},Di.ɵcmp=l.VBU({type:Di,selectors:[["auth-registration-start-secondary"]],decls:6,vars:7,consts:[["bitLink","",3,"routerLink"]],template:function(e,t){1&e&&(l.j41(0,"span"),l.EFF(1),l.nI1(2,"i18n"),l.j41(3,"a",0),l.EFF(4),l.nI1(5,"i18n"),l.k0s()()),2&e&&(l.R7$(),l.SpI("",l.bMT(2,3,"alreadyHaveAccount")," "),l.R7$(2),l.Y8G("routerLink",t.loginRoute),l.R7$(),l.JRh(l.bMT(5,5,"logIn")))},dependencies:[v.MD,n.p,y.iI,y.Wk,V.V,he.L,h.$],encapsulation:2});class Oi{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f){this.email=e,this.masterPasswordHash=t,this.masterPasswordHint=i,this.userSymmetricKey=n,this.userAsymmetricKeys=r,this.kdf=s,this.kdfIterations=o,this.kdfMemory=a,this.kdfParallelism=l,this.emailVerificationToken=c,this.orgSponsoredFreeFamilyPlanToken=d,this.acceptEmergencyAccessInviteToken=u,this.acceptEmergencyAccessId=h,this.providerInviteToken=p,this.providerUserId=m,this.organizationUserId=v,this.orgInviteToken=f}}var Mi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ui{constructor(e,t){this.keyService=e,this.accountApiService=t}getOrgNameFromOrgInvite(){return null}getMasterPasswordPolicyOptsFromOrgInvite(){return null}finishRegistration(e,t,i,n,r,s,o,a){return Mi(this,void 0,void 0,function*(){const[l,c]=yield this.keyService.makeUserKey(t.newMasterKey);if(!l||!c)throw new Error("User key could not be created");const d=yield this.keyService.makeKeyPair(l),u=yield this.buildRegisterRequest(e,t,c.encryptedString,d,i,n,r,s,o,a);return yield this.accountApiService.registerFinish(u)})}buildRegisterRequest(e,t,i,n,r,s,o,a,l,c){return Mi(this,void 0,void 0,function*(){const s=new Me.G(n[0],n[1].encryptedString),o=new Oi(e,t.newServerMasterKeyHash,t.newPasswordHint,i,s,t.kdfConfig.kdfType,t.kdfConfig.iterations);return r&&(o.emailVerificationToken=r),o})}}var Gi,ji=i(80351);!function(e){e.MasterPassword="masterPassword",e.Pin="pin",e.Biometrics="biometrics",e.None="none"}(Gi||(Gi={}));var Ni=i(28846),Vi=i(16878);const Bi=k.Sm`
    <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 4 88 88">
    <path class="tw-fill-illustration-bg-primary" d="M4 10a6 6 0 0 1 6-6h50a6 6 0 0 1 6 6v50a6 6 0 0 1-6 6H10a6 6 0 0 1-6-6V10Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60 6H10a4 4 0 0 0-4 4v50a4 4 0 0 0 4 4h50a4 4 0 0 0 4-4V10a4 4 0 0 0-4-4ZM10 4a6 6 0 0 0-6 6v50a6 6 0 0 0 6 6h50a6 6 0 0 0 6-6V10a6 6 0 0 0-6-6H10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M14 19a5 5 0 0 1 5-5h7a1 1 0 1 1 0 2h-7a3 3 0 0 0-3 3v7a1 1 0 1 1-2 0v-7Zm29-4a1 1 0 0 1 1-1h7a5 5 0 0 1 5 5v7a1 1 0 1 1-2 0v-7a3 3 0 0 0-3-3h-7a1 1 0 0 1-1-1ZM15 43a1 1 0 0 1 1 1v7a3 3 0 0 0 3 3h7a1 1 0 1 1 0 2h-7a5 5 0 0 1-5-5v-7a1 1 0 0 1 1-1Zm40 0a1 1 0 0 1 1 1v7a5 5 0 0 1-5 5h-7a1 1 0 1 1 0-2h7a3 3 0 0 0 3-3v-7a1 1 0 0 1 1-1ZM26 27a1 1 0 0 1 1 1v5a1 1 0 1 1-2 0v-5a1 1 0 0 1 1-1Zm11 0a1 1 0 1 0-2 0v10a1 1 0 0 1-1 1h-2a1 1 0 1 0 0 2h2a3 3 0 0 0 3-3V27Zm-2 19c-2.234 0-4.411-.64-6.494-1.862a1 1 0 1 0-1.012 1.724C29.845 47.242 32.368 48 35 48c2.632 0 5.155-.758 7.506-2.138a1 1 0 1 0-1.012-1.724C39.41 45.36 37.234 46 35 46ZM23.565 24.825C24.378 24.268 25.192 24 26 24s1.622.268 2.435.825a1 1 0 1 0 1.13-1.65C28.478 22.43 27.277 22 26 22c-1.277 0-2.478.43-3.565 1.175a1 1 0 1 0 1.13 1.65ZM44 24c-.808 0-1.622.268-2.435.825a1 1 0 1 1-1.13-1.65C41.522 22.43 42.722 22 44 22s2.478.43 3.565 1.175a1 1 0 1 1-1.13 1.65C45.622 24.268 44.808 24 44 24Zm1 4a1 1 0 1 0-2 0v5a1 1 0 1 0 2 0v-5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M92 61.5C92 78.345 80.807 92 67 92S42 78.345 42 61.5 53.193 31 67 31s25 13.655 25 30.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M67 90c12.349 0 23-12.37 23-28.5C90 45.37 79.349 33 67 33S44 45.37 44 61.5C44 77.63 54.651 90 67 90Zm0 2c13.807 0 25-13.655 25-30.5S80.807 31 67 31 42 44.655 42 61.5 53.193 92 67 92Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60.351 49.196A18.953 18.953 0 0 1 67.001 48c2.342 0 4.582.423 6.65 1.196a1 1 0 0 0 .7-1.873A20.954 20.954 0 0 0 67.001 46c-2.584 0-5.06.467-7.35 1.323a1 1 0 1 0 .7 1.873ZM67.001 52c-4.58 0-8.646 2.198-11.201 5.6a1 1 0 1 1-1.6-1.2A15.977 15.977 0 0 1 67.001 50c5.198 0 9.537 2.124 12.708 5.293a1 1 0 1 1-1.414 1.414C75.462 53.877 71.618 52 67.001 52Zm-.14 2c-6.453 0-11.555 5.467-11.111 11.905l.09 1.297a15.002 15.002 0 0 0 1.175 4.873l.565 1.319a1 1 0 1 0 1.838-.788l-.565-1.319a13 13 0 0 1-1.019-4.223l-.09-1.297C57.382 60.485 61.568 56 66.863 56A9.138 9.138 0 0 1 76 65.138V66a1 1 0 1 1-2 0v-1c0-1.61-.58-3.358-1.827-4.713C70.908 58.912 69.01 58 66.5 58c-2.607 0-4.29 1.188-5.276 2.705C60.276 62.164 60 63.871 60 65c0 2.792.25 4.826.952 6.51.712 1.71 1.848 2.958 3.408 4.258a1 1 0 1 0 1.28-1.536c-1.44-1.2-2.304-2.202-2.842-3.492C62.25 69.424 62 67.708 62 65c0-.871.224-2.164.9-3.205.64-.983 1.707-1.795 3.6-1.795 1.99 0 3.342.707 4.202 1.642A5.018 5.018 0 0 1 72 65v1a3 3 0 1 0 6 0v-.862C78 58.987 73.013 54 66.862 54Zm-.905 10.94c0-.505.417-.94.988-.94.583 0 1.056.473 1.056 1.056v1.636c0 1.768.832 3.432 2.246 4.493l.82.615a6 6 0 0 0 3.6 1.2H75a1 1 0 1 0 0-2h-.333a4 4 0 0 1-2.4-.8l-.82-.615A3.615 3.615 0 0 1 70 66.692v-1.636A3.056 3.056 0 0 0 66.944 62c-1.61 0-2.99 1.267-2.988 2.943.002.984.039 2.22.177 3.365.15 1.243.753 2.218 1.396 3.031.293.372.611.73.909 1.065l.079.09c.328.369.631.715.903 1.072.663.875.84 1.591.651 2.063a1 1 0 0 0 1.858.742c.604-1.51-.165-3.023-.916-4.013a20.143 20.143 0 0 0-1-1.193l-.073-.082c-.306-.344-.587-.66-.842-.983-.546-.692-.893-1.32-.98-2.031-.124-1.034-.16-2.181-.162-3.129Z" clip-rule="evenodd"/>
    </svg>
`;var zi=i(68333),Li=i(62166),Ki=i(58384),qi=i(44432),_i=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Xi(e,t){1&e&&l.eu8(0)}function Yi(e,t){if(1&e&&(l.qex(0),l.DNE(1,Xi,1,0,"ng-container",4),l.bVm()),2&e){l.XpG(2);const e=l.sdS(3);l.R7$(),l.Y8G("ngTemplateOutlet",e)}}function Hi(e,t){if(1&e&&(l.qex(0),l.j41(1,"bit-form-field",5)(2,"bit-label"),l.EFF(3),l.nI1(4,"i18n"),l.k0s(),l.nrm(5,"input",6)(6,"button",7),l.j41(7,"bit-hint"),l.EFF(8),l.nI1(9,"i18n"),l.k0s()(),l.bVm()),2&e){const e=l.XpG(2);l.R7$(3),l.JRh(l.bMT(4,3,"pin")),l.R7$(2),l.Y8G("formControl",e.secret),l.R7$(3),l.JRh(l.bMT(9,5,"confirmIdentity"))}}function Wi(e,t){1&e&&(l.j41(0,"div"),l.nrm(1,"i",13),l.nI1(2,"i18n"),l.EFF(3),l.nI1(4,"i18n"),l.k0s()),2&e&&(l.R7$(),l.Y8G("title",l.mNQ(l.bMT(2,3,"loading"))),l.R7$(2),l.SpI(" ",l.bMT(4,5,"awaitingConfirmation")," "))}function Ji(e,t){if(1&e){const e=l.RV6();l.j41(0,"bit-callout",14),l.EFF(1),l.nI1(2,"i18n"),l.j41(3,"button",15),l.bIt("click",function(){z.eBV(e);const t=l.XpG(3);return z.Njj(t.verifyUserViaBiometrics())}),l.EFF(4),l.nI1(5,"i18n"),l.k0s()()}2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,2,"couldNotCompleteBiometrics")," "),l.R7$(3),l.SpI(" ",l.bMT(5,4,"tryAgain")," "))}function Zi(e,t){if(1&e&&(l.qex(0),l.j41(1,"div",8)(2,"div",9),l.nrm(3,"bit-icon",10),l.k0s(),l.j41(4,"p",11),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.DNE(7,Wi,5,7,"div",1),l.k0s(),l.DNE(8,Ji,6,6,"bit-callout",12),l.bVm()),2&e){const e=l.XpG(2);l.R7$(3),l.Y8G("icon",e.Icons.UserVerificationBiometricsIcon),l.R7$(2),l.JRh(l.bMT(6,4,"verifyWithBiometrics")),l.R7$(2),l.Y8G("ngIf",!e.biometricsVerificationFailed),l.R7$(),l.Y8G("ngIf",e.biometricsVerificationFailed)}}function Qi(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",20),l.bIt("click",function(){z.eBV(e);const t=l.XpG(3);return z.Njj(t.activeClientVerificationOption=t.ActiveClientVerificationOption.Biometrics)}),l.EFF(1),l.nI1(2,"i18n"),l.k0s()}2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"useBiometrics")," "))}function en(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",20),l.bIt("click",function(){z.eBV(e);const t=l.XpG(3);return z.Njj(t.activeClientVerificationOption=t.ActiveClientVerificationOption.Pin)}),l.EFF(1),l.nI1(2,"i18n"),l.k0s()}2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"usePin")," "))}function tn(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",21),l.bIt("click",function(){z.eBV(e);const t=l.XpG(3);return z.Njj(t.activeClientVerificationOption=t.ActiveClientVerificationOption.MasterPassword)}),l.EFF(1),l.nI1(2,"i18n"),l.k0s()}2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"useMasterPassword")," "))}function nn(e,t){if(1&e&&(l.j41(0,"div",16)(1,"p",17),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.DNE(4,Qi,3,3,"button",18)(5,en,3,3,"button",18)(6,tn,3,3,"button",19),l.k0s()),2&e){const e=l.XpG(2);l.R7$(2),l.JRh(l.bMT(3,4,"needADifferentMethod")),l.R7$(2),l.Y8G("ngIf",e.userVerificationOptions.client.biometrics&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.Biometrics),l.R7$(),l.Y8G("ngIf",e.userVerificationOptions.client.pin&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.Pin),l.R7$(),l.Y8G("ngIf",e.userVerificationOptions.client.masterPassword&&e.activeClientVerificationOption!==e.ActiveClientVerificationOption.MasterPassword)}}function rn(e,t){if(1&e&&(l.qex(0),l.j41(1,"div",2),l.DNE(2,Yi,2,1,"ng-container",1)(3,Hi,10,7,"ng-container",1)(4,Zi,9,6,"ng-container",1)(5,nn,7,6,"div",3),l.k0s(),l.bVm()),2&e){const e=l.XpG();l.R7$(2),l.Y8G("ngIf",e.userVerificationOptions.client.masterPassword&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.MasterPassword),l.R7$(),l.Y8G("ngIf",e.userVerificationOptions.client.pin&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.Pin),l.R7$(),l.Y8G("ngIf",e.userVerificationOptions.client.biometrics&&e.activeClientVerificationOption==e.ActiveClientVerificationOption.Biometrics),l.R7$(),l.Y8G("ngIf",e.hasMultipleClientVerificationOptions)}}function sn(e,t){1&e&&l.eu8(0)}function on(e,t){if(1&e&&(l.qex(0),l.DNE(1,sn,1,0,"ng-container",4),l.bVm()),2&e){l.XpG(2);const e=l.sdS(3);l.R7$(),l.Y8G("ngTemplateOutlet",e)}}function an(e,t){1&e&&(l.j41(0,"div",24),l.nrm(1,"i",13),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.Y8G("title",l.mNQ(l.bMT(2,2,"loading"))))}function ln(e,t){1&e&&(l.j41(0,"span",27),l.nrm(1,"i",28),l.EFF(2),l.nI1(3,"i18n"),l.k0s()),2&e&&(l.Y8G("@sent",void 0),l.R7$(2),l.SpI(" ",l.bMT(3,2,"codeSent")," "))}function cn(e,t){if(1&e){const e=l.RV6();l.j41(0,"div",24),l.EFF(1),l.nI1(2,"i18n"),l.j41(3,"p",25)(4,"button",15),l.bIt("click",function(){z.eBV(e);const t=l.XpG(3);return z.Njj(t.requestOTP())}),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.DNE(7,ln,4,4,"span",26),l.k0s()()}if(2&e){const e=l.XpG(3);l.R7$(),l.SpI(" ",l.bMT(2,3,"enterVerificationCodeSentToEmail")," "),l.R7$(4),l.SpI(" ",l.bMT(6,5,"resendCode")," "),l.R7$(2),l.Y8G("ngIf",e.sentCode)}}function dn(e,t){if(1&e&&(l.qex(0),l.DNE(1,an,3,4,"div",22)(2,cn,8,7,"div",22),l.j41(3,"bit-form-field",5)(4,"bit-label"),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.nrm(7,"input",23),l.j41(8,"bit-hint"),l.EFF(9),l.nI1(10,"i18n"),l.k0s()(),l.bVm()),2&e){const e=l.XpG(2);l.R7$(),l.Y8G("ngIf",!e.sentInitialCode),l.R7$(),l.Y8G("ngIf",e.sentInitialCode),l.R7$(3),l.JRh(l.bMT(6,5,"verificationCode")),l.R7$(2),l.Y8G("formControl",e.secret),l.R7$(2),l.JRh(l.bMT(10,7,"confirmIdentity"))}}function un(e,t){if(1&e&&(l.qex(0),l.DNE(1,on,2,1,"ng-container",1)(2,dn,11,9,"ng-container",1),l.bVm()),2&e){const e=l.XpG();l.R7$(),l.Y8G("ngIf",e.userVerificationOptions.server.masterPassword),l.R7$(),l.Y8G("ngIf",e.userVerificationOptions.server.otp)}}function hn(e,t){if(1&e&&(l.j41(0,"bit-form-field",5)(1,"bit-label"),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.nrm(4,"input",29)(5,"button",7),l.j41(6,"bit-hint"),l.EFF(7),l.nI1(8,"i18n"),l.k0s()()),2&e){const e=l.XpG();l.R7$(2),l.JRh(l.bMT(3,3,"masterPass")),l.R7$(2),l.Y8G("formControl",e.secret),l.R7$(3),l.JRh(l.bMT(8,5,"confirmIdentity"))}}class pn{get invalidSecret(){return this._invalidSecret}set invalidSecret(e){this._invalidSecret=e,this.invalidSecretChange.emit(e),e&&this.secret.markAsTouched(),this.secret.updateValueAndValidity({emitEvent:!1})}set activeClientVerificationOption(e){this._activeClientVerificationOptionSubject.next(e)}get activeClientVerificationOption(){return this._activeClientVerificationOptionSubject.getValue()}get hasMultipleClientVerificationOptions(){let e=0;return this.userVerificationOptions.client.masterPassword&&e++,this.userVerificationOptions.client.pin&&e++,this.userVerificationOptions.client.biometrics&&e++,e>=2}getInvalidSecretErrorMessage(){return"server"===this.verificationType?this.userVerificationOptions.server.masterPassword?this.i18nService.t("incorrectPassword"):this.i18nService.t("incorrectCode"):this.activeClientVerificationOption===Gi.MasterPassword?this.i18nService.t("incorrectPassword"):this.activeClientVerificationOption===Gi.Pin?this.i18nService.t("incorrectPin"):void 0}constructor(e,t){this.userVerificationService=e,this.i18nService=t,this.verificationType="server",this._invalidSecret=!1,this.invalidSecretChange=new l.bkB,this.activeClientVerificationOptionChange=new l.bkB,this.biometricsVerificationResultChange=new l.bkB,this.Icons={UserVerificationBiometricsIcon:Bi},this.userVerificationOptions={client:{masterPassword:!1,pin:!1,biometrics:!1},server:{masterPassword:!1,otp:!1}},this.ActiveClientVerificationOption=Gi,this._activeClientVerificationOptionSubject=new Vi.t(null),this.activeClientVerificationOption$=this._activeClientVerificationOptionSubject.asObservable(),this.biometricsVerificationFailed=!1,this.disableRequestOTP=!1,this.sentInitialCode=!1,this.sentCode=!1,this.secret=new g.MJ("",[g.k0.required,()=>{if(this.invalidSecret)return{invalidSecret:{message:this.getInvalidSecretErrorMessage()}}}]),this.destroy$=new b.B,this.requestOTP=()=>_i(this,void 0,void 0,function*(){if(!this.userVerificationOptions.server.masterPassword){this.disableRequestOTP=!0;try{yield this.userVerificationService.requestOTP(),this.sentCode=!0,this.sentInitialCode=!0,setTimeout(()=>{this.sentCode=!1},3e3)}finally{this.disableRequestOTP=!1}}})}ngOnInit(){return _i(this,void 0,void 0,function*(){this.userVerificationOptions=yield this.userVerificationService.getAvailableVerificationOptions(this.verificationType),"client"===this.verificationType?(this.setDefaultActiveClientVerificationOption(),this.setupClientVerificationOptionChangeHandler()):this.userVerificationOptions.server.otp&&this.requestOTP(),this.activeClientVerificationOption!==Gi.Biometrics&&this.processSecretChanges(this.secret.value),this.secret.valueChanges.pipe((0,I.Q)(this.destroy$)).subscribe(e=>this.processSecretChanges(e))})}setDefaultActiveClientVerificationOption(){this.userVerificationOptions.client.biometrics?this.activeClientVerificationOption=Gi.Biometrics:this.userVerificationOptions.client.pin?this.activeClientVerificationOption=Gi.Pin:this.userVerificationOptions.client.masterPassword?this.activeClientVerificationOption=Gi.MasterPassword:this.activeClientVerificationOption=Gi.None}setupClientVerificationOptionChangeHandler(){this.activeClientVerificationOption$.pipe((0,I.Q)(this.destroy$)).subscribe(e=>{this.handleActiveClientVerificationOptionChange(e)})}handleActiveClientVerificationOptionChange(e){return _i(this,void 0,void 0,function*(){this.activeClientVerificationOptionChange.emit(e),this.secret.setValue(null),this.secret.markAsUntouched(),this.secret.updateValueAndValidity({emitEvent:!1}),"biometrics"===e&&(this.biometricsVerificationFailed=!1,yield this.verifyUserViaBiometrics())})}verifyUserViaBiometrics(){return _i(this,void 0,void 0,function*(){this.biometricsVerificationFailed=!1;const e=yield this.userVerificationService.verifyUser({type:zi.k.Biometrics});this.biometricsVerificationResultChange.emit(e),this.biometricsVerificationFailed=!e})}writeValue(e){this.secret.setValue(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){}setDisabledState(e){this.disableRequestOTP=e,e?this.secret.disable():this.secret.enable()}processSecretChanges(e){this.invalidSecret=!1,this.activeClientVerificationOption!==Gi.Biometrics&&null!=this.onChange&&this.onChange({type:this.determineVerificationWithSecretType(),secret:O.A.isNullOrWhitespace(e)?null:e})}determineVerificationWithSecretType(){return"server"===this.verificationType?this.userVerificationOptions.server.masterPassword?zi.k.MasterPassword:zi.k.OTP:this.userVerificationOptions.client.masterPassword&&this.activeClientVerificationOption===Gi.MasterPassword?zi.k.MasterPassword:zi.k.PIN}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}pn.ɵfac=function(e){return new(e||pn)(l.rXU(Li.i),l.rXU(H.W))},pn.ɵcmp=l.VBU({type:pn,selectors:[["app-user-verification-form-input"]],inputs:{verificationType:"verificationType",invalidSecret:"invalidSecret"},outputs:{invalidSecretChange:"invalidSecretChange",activeClientVerificationOptionChange:"activeClientVerificationOptionChange",biometricsVerificationResultChange:"biometricsVerificationResultChange"},features:[l.Jv_([{provide:g.kq,multi:!0,useExisting:pn}])],decls:4,vars:2,consts:[["masterPasswordFormField",""],[4,"ngIf"],[1,"tw-flex","tw-flex-col"],["class","tw-flex tw-flex-col tw-items-center tw-justify-center tw-mt-2",4,"ngIf"],[4,"ngTemplateOutlet"],["disableMargin",""],["bitInput","","id","pin","type","password","name","pin","appAutofocus","","appInputVerbatim","",3,"formControl"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],[1,"tw-flex","tw-flex-col","tw-items-center"],[1,"tw-size-16","tw-content-center","tw-mb-4"],[3,"icon"],[1,"tw-font-medium","tw-mb-1"],["type","danger",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["type","danger"],["bitLink","","type","button","linkType","primary",3,"click"],[1,"tw-flex","tw-flex-col","tw-items-center","tw-justify-center","tw-mt-2"],[1,"tw-mb-1"],["type","button","class","tw-mb-1","bitLink","","linkType","primary",3,"click",4,"ngIf"],["type","button","bitLink","","linkType","primary",3,"click",4,"ngIf"],["type","button","bitLink","","linkType","primary",1,"tw-mb-1",3,"click"],["type","button","bitLink","","linkType","primary",3,"click"],["class","tw-mb-6",4,"ngIf"],["bitInput","","type","text","id","verificationCode","name","verificationCode","appInputVerbatim","",3,"formControl"],[1,"tw-mb-6"],[1,"tw-mb-0"],["class","tw-ml-2 tw-text-success","role","alert",4,"ngIf"],["role","alert",1,"tw-ml-2","tw-text-success"],["aria-hidden","true",1,"bwi","bwi-check-circle"],["bitInput","","id","masterPassword","type","password","name","MasterPasswordHash","appAutofocus","","appInputVerbatim","",3,"formControl"]],template:function(e,t){1&e&&l.DNE(0,rn,6,4,"ng-container",1)(1,un,3,2,"ng-container",1)(2,hn,9,7,"ng-template",null,0,l.C5r),2&e&&(l.Y8G("ngIf","client"===t.verificationType),l.R7$(),l.Y8G("ngIf","server"===t.verificationType))},dependencies:[v.MD,v.bT,v.T3,g.X1,g.me,g.BC,g.l_,n.p,pe.B,At.q,j.L,oe.j,_e.I,ae.J,le.h,ce.e,de.a,U.C,N.Q,ue.s,Lt.o,Ki.i,V.V,he.o,o.t,ji.j,qi.G,h.$],encapsulation:2,data:{animation:[(0,Ni.hZ)("sent",[(0,Ni.kY)(":enter",[(0,Ni.iF)({opacity:0}),(0,Ni.i0)("100ms",(0,Ni.iF)({opacity:1}))])])]}});var mn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function vn(e,t){if(1&e&&(l.j41(0,"p",9),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e){const e=l.XpG(2);l.R7$(),l.SpI(" ",l.bMT(2,1,e.dialogOptions.bodyText)," ")}}function fn(e,t){if(1&e&&(l.j41(0,"bit-callout",10),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e){const e=l.XpG(2);l.Y8G("type",e.dialogOptions.calloutOptions.type),l.R7$(),l.SpI(" ",l.bMT(2,2,e.dialogOptions.calloutOptions.text)," ")}}function gn(e,t){if(1&e&&(l.qex(0),l.DNE(1,vn,3,3,"p",7)(2,fn,3,4,"bit-callout",8),l.bVm()),2&e){const e=l.XpG();l.R7$(),l.Y8G("ngIf",e.dialogOptions.bodyText),l.R7$(),l.Y8G("ngIf",e.dialogOptions.calloutOptions)}}function yn(e,t){1&e&&(l.qex(0),l.j41(1,"p",9),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.bVm()),2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,1,"verificationRequiredForActionSetPinToContinue")," "))}function bn(e,t){1&e&&(l.j41(0,"button",13),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"submit")," "))}function wn(e,t){if(1&e&&(l.j41(0,"button",14),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e){const e=l.XpG(3);l.Y8G("buttonType",e.dialogOptions.confirmButtonOptions.type),l.R7$(),l.SpI(" ",l.bMT(2,2,e.dialogOptions.confirmButtonOptions.text)," ")}}function Sn(e,t){if(1&e&&(l.qex(0),l.DNE(1,bn,3,3,"button",11)(2,wn,3,4,"button",12),l.bVm()),2&e){const e=l.XpG(2);l.R7$(),l.Y8G("ngIf",!e.dialogOptions.confirmButtonOptions),l.R7$(),l.Y8G("ngIf",e.dialogOptions.confirmButtonOptions)}}function In(e,t){1&e&&(l.qex(0),l.j41(1,"button",13),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.bVm()),2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,1,"setPin")," "))}function kn(e,t){if(1&e&&(l.qex(0),l.DNE(1,Sn,3,2,"ng-container",3)(2,In,4,3,"ng-container",3),l.bVm()),2&e){const e=l.XpG();l.R7$(),l.Y8G("ngIf",e.activeClientVerificationOption!==e.ActiveClientVerificationOption.None),l.R7$(),l.Y8G("ngIf",e.activeClientVerificationOption===e.ActiveClientVerificationOption.None)}}class Cn{get secret(){return this.verificationForm.controls.secret}constructor(e,t,i,n,r,s,o){this.dialogOptions=e,this.dialogRef=t,this.formBuilder=i,this.userVerificationService=n,this.platformUtilsService=r,this.i18nService=s,this.toastService=o,this.verificationForm=this.formBuilder.group({secret:this.formBuilder.control(null)}),this.invalidSecret=!1,this.ActiveClientVerificationOption=Gi,this.submit=()=>mn(this,void 0,void 0,function*(){if(this.activeClientVerificationOption!==Gi.None){if(this.verificationForm.markAllAsTouched(),!this.verificationForm.invalid)try{if("object"==typeof this.dialogOptions.verificationType&&"custom"===this.dialogOptions.verificationType.type){const e=yield this.dialogOptions.verificationType.verificationFn(this.secret.value);return void this.close({userAction:"confirm",verificationSuccess:e})}(yield this.userVerificationService.verifyUser(this.secret.value))?(this.invalidSecret=!1,this.close({userAction:"confirm",verificationSuccess:!0,noAvailableClientVerificationMethods:!1})):(this.invalidSecret=!0,this.activeClientVerificationOption===Gi.Pin?this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:this.i18nService.t("invalidPin")}):this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("unexpectedError")}))}catch(e){return this.invalidSecret=!0,void this.toastService.showToast({variant:"error",title:this.i18nService.t("error"),message:this.i18nService.t("userVerificationFailed")})}}else this.close({userAction:"confirm",verificationSuccess:!1,noAvailableClientVerificationMethods:!0})})}static open(e,t){return mn(this,void 0,void 0,function*(){const i=e.open(Cn,{data:t}),n=yield(0,w._)(i.closed);return"string"==typeof n||void 0===n?{userAction:"cancel",verificationSuccess:!1}:n})}handleActiveClientVerificationOptionChange(e){this.activeClientVerificationOption=e}handleBiometricsVerificationResultChange(e){e&&this.close({userAction:"confirm",verificationSuccess:!0,noAvailableClientVerificationMethods:!1})}cancel(){this.close({userAction:"cancel",verificationSuccess:!1})}close(e){this.dialogRef.close(e)}}Cn.ɵfac=function(e){return new(e||Cn)(l.rXU(s.Qs),l.rXU(r.ce),l.rXU(g.ok),l.rXU(Li.i),l.rXU(J.y),l.rXU(H.W),l.rXU(q.f))},Cn.ɵcmp=l.VBU({type:Cn,selectors:[["ng-component"]],decls:15,vars:15,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["formControlName","secret",3,"invalidSecretChange","activeClientVerificationOptionChange","biometricsVerificationResultChange","invalidSecret","verificationType"],["bitDialogFooter",""],["type","button","bitButton","","bitFormButton","","buttonType","secondary",3,"click"],["bitTypography","body1",4,"ngIf"],[3,"type",4,"ngIf"],["bitTypography","body1"],[3,"type"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",4,"ngIf"],["type","submit","bitButton","","bitFormButton","",3,"buttonType",4,"ngIf"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","submit","bitButton","","bitFormButton","",3,"buttonType"]],template:function(e,t){1&e&&(l.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),l.EFF(3),l.nI1(4,"i18n"),l.nI1(5,"i18n"),l.k0s(),l.qex(6,2),l.DNE(7,gn,3,2,"ng-container",3)(8,yn,4,3,"ng-container",3),l.j41(9,"app-user-verification-form-input",4),l.mxI("invalidSecretChange",function(e){return l.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),l.bIt("activeClientVerificationOptionChange",function(e){return t.handleActiveClientVerificationOptionChange(e)})("biometricsVerificationResultChange",function(e){return t.handleBiometricsVerificationResultChange(e)}),l.k0s(),l.bVm(),l.qex(10,5),l.DNE(11,kn,3,2,"ng-container",3),l.j41(12,"button",6),l.bIt("click",function(){return t.cancel()}),l.EFF(13),l.nI1(14,"i18n"),l.k0s(),l.bVm(),l.k0s()()),2&e&&(l.Y8G("formGroup",t.verificationForm)("bitSubmit",t.submit),l.R7$(3),l.SpI(" ",t.dialogOptions.title?l.bMT(4,9,t.dialogOptions.title):l.bMT(5,11,"verificationRequired")),l.R7$(4),l.Y8G("ngIf","client"!==t.dialogOptions.verificationType||"client"===t.dialogOptions.verificationType&&t.activeClientVerificationOption!==t.ActiveClientVerificationOption.None),l.R7$(),l.Y8G("ngIf","client"===t.dialogOptions.verificationType&&t.activeClientVerificationOption===t.ActiveClientVerificationOption.None),l.R7$(),l.R50("invalidSecret",t.invalidSecret),l.Y8G("verificationType","client"===t.dialogOptions.verificationType?"client":"server"),l.R7$(2),l.Y8G("ngIf","client"!==t.dialogOptions.verificationType||"client"===t.dialogOptions.verificationType&&t.activeClientVerificationOption!==t.ActiveClientVerificationOption.Biometrics),l.R7$(2),l.SpI(" ",l.bMT(14,13,"cancel")," "))},dependencies:[v.MD,v.bT,g.X1,g.qT,g.BC,g.cb,g.j4,g.JD,n.p,o.t,c.Q,a.P,Ht.m,U.C,ie.$,ne.L,pn,ji.j,qi.G,h.$],encapsulation:2});var Tn=i(81441),Fn=i(4717),Rn=i(83541);class Pn{}var xn,$n=i(52057),En=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function An(e,t){1&e&&(l.j41(0,"div"),l.nrm(1,"i",2),l.nI1(2,"i18n"),l.EFF(3),l.nI1(4,"i18n"),l.k0s()),2&e&&(l.R7$(),l.Y8G("title",l.mNQ(l.bMT(2,3,"loading"))),l.R7$(2),l.SpI(" ",l.bMT(4,5,"loading")," "))}function Dn(e,t){1&e&&(l.j41(0,"div")(1,"bit-form-field")(2,"bit-label"),l.EFF(3),l.nI1(4,"i18n"),l.k0s(),l.nrm(5,"input",3),l.k0s(),l.j41(6,"div",4)(7,"button",5),l.EFF(8),l.nI1(9,"i18n"),l.k0s()()()),2&e&&(l.R7$(3),l.JRh(l.bMT(4,3,"ssoIdentifier")),l.R7$(4),l.Y8G("block",!0),l.R7$(),l.SpI(" ",l.bMT(9,5,"continue")," "))}class On{get identifierFormControl(){return this.formGroup.controls.identifier}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,y,b,S,I){this.ssoLoginService=e,this.loginStrategyService=t,this.router=i,this.i18nService=n,this.route=r,this.orgDomainApiService=s,this.validationService=o,this.platformUtilsService=a,this.apiService=l,this.cryptoFunctionService=c,this.environmentService=d,this.passwordGenerationService=u,this.logService=h,this.userDecryptionOptionsService=p,this.masterPasswordService=m,this.accountService=v,this.toastService=y,this.ssoComponentService=b,this.loginSuccessHandlerService=S,this.keyConnectorService=I,this.formGroup=new g.gE({identifier:new g.MJ(null,[g.k0.required])}),this.loggingIn=!1,this.submit=()=>En(this,void 0,void 0,function*(){var e,t,i;if(this.formGroup.invalid)return;const n=null!=(yield(0,w._)(this.route.queryParams)).identifier;this.identifier=null!==(e=this.identifierFormControl.value)&&void 0!==e?e:"",yield this.ssoLoginService.setOrganizationSsoIdentifier(this.identifier),null===(i=(t=this.ssoComponentService).setDocumentCookies)||void 0===i||i.call(t);try{yield this.submitSso()}catch(r){n?yield this.router.navigate(["/login"]):this.validationService.showError(r)}}),d.environment$.pipe((0,f.pQ)()).subscribe(e=>{this.redirectUri=e.getWebVaultUrl()+"/sso-connector.html"});const k=this.platformUtilsService.getClientType();this.isValidSsoClientType(k)&&(this.clientId=k)}ngOnInit(){return En(this,void 0,void 0,function*(){var e;const t=yield(0,w._)(this.route.queryParams);if(this.email=null!==(e=t.email)&&void 0!==e?e:yield this.ssoLoginService.getSsoEmail(),this.userCompletedSsoAuthentication(t))yield this.handleTokenRequestForAuthenticatedUser(t);else{if(this.hasParametersFromOtherClientRedirect(t)&&this.initializeFromRedirectFromOtherClient(t),null!=t.identifier)return this.identifierFormControl.setValue(t.identifier),this.loggingIn=!0,void(yield this.submit());yield this.initializeIdentifierFromEmailOrStorage()}})}initializeFromRedirectFromOtherClient(e){var t,i,n,r;this.redirectUri=null!==(t=e.redirectUri)&&void 0!==t?t:"",this.state=null!==(i=e.state)&&void 0!==i?i:"",this.codeChallenge=null!==(n=e.codeChallenge)&&void 0!==n?n:"";const s=null!==(r=e.clientId)&&void 0!==r?r:"";if(!this.isValidSsoClientType(s))throw new Error(`Invalid SSO client type: ${e.clientId}`);this.clientId=s}isValidSsoClientType(e){return[P.sK.Web,P.sK.Browser,P.sK.Desktop,P.sK.Cli].includes(e)}hasParametersFromOtherClientRedirect(e){return null!=e.clientId&&null!=e.redirectUri&&null!=e.state&&null!=e.codeChallenge}handleTokenRequestForAuthenticatedUser(e){return En(this,void 0,void 0,function*(){var t,i;const n=yield this.ssoLoginService.getCodeVerifier(),r=yield this.ssoLoginService.getSsoState();if(yield this.ssoLoginService.setCodeVerifier(""),yield this.ssoLoginService.setSsoState(""),null!=e.redirectUri&&(this.redirectUri=e.redirectUri),null!=e.code&&null!=n&&null!=r&&this.verifyStateMatches(r,null!==(t=e.state)&&void 0!==t?t:"")){const t=this.getOrgIdentifierFromState(null!==(i=e.state)&&void 0!==i?i:"");yield this.logIn(e.code,n,t)}})}userCompletedSsoAuthentication(e){return null!=e.code&&null!=e.state}handleGetClaimedDomainByEmailError(e){if(e instanceof $._){const t=e;if(t.statusCode===P.kG.NotFound)return;this.validationService.showError(t)}}submitSso(e,t){return En(this,void 0,void 0,function*(){if(null==this.identifier||""===this.identifier)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("ssoValidationFailed"),message:this.i18nService.t("ssoIdentifierRequired")});if(null==this.clientId)throw new Error("Client ID is required");this.initiateSsoFormPromise=this.apiService.preValidateSso(this.identifier);const i=yield this.initiateSsoFormPromise,n=yield this.buildAuthorizeUrl(e,t,i.token);this.platformUtilsService.launchUri(n,{sameWindow:!0})})}buildAuthorizeUrl(e,t,i){return En(this,void 0,void 0,function*(){var n,r;let s=this.codeChallenge,o=this.state;const a={type:"password",length:64,uppercase:!0,lowercase:!0,numbers:!0,special:!1};if(null==s){const e=yield this.passwordGenerationService.generatePassword(a),t=yield this.cryptoFunctionService.hash(e,"sha256");s=O.A.fromBufferToUrlB64(t),yield this.ssoLoginService.setCodeVerifier(e)}null==o&&(o=yield this.passwordGenerationService.generatePassword(a)),e&&(o+=`_returnUri='${e}'`),o+=`_identifier=${this.identifier}`,yield this.ssoLoginService.setSsoState(o);let l=(yield(0,w._)(this.environmentService.environment$)).getIdentityUrl()+"/connect/authorize?client_id="+this.clientId+"&redirect_uri="+encodeURIComponent(null!==(n=this.redirectUri)&&void 0!==n?n:"")+"&response_type=code&scope=api offline_access&state="+o+"&code_challenge="+s+"&code_challenge_method=S256&response_mode=query&domain_hint="+encodeURIComponent(null!==(r=this.identifier)&&void 0!==r?r:"")+"&ssoToken="+encodeURIComponent(null!=i?i:"");if(t){const e=yield this.apiService.getSsoUserIdentifier();l+=`&user_identifier=${encodeURIComponent(e)}`}return l})}logIn(e,t,i){return En(this,void 0,void 0,function*(){var n,r;this.loggingIn=!0;try{const s=null!==(n=this.redirectUri)&&void 0!==n?n:"",o=new F.pS(e,t,s,i,null!==(r=this.email)&&void 0!==r?r:void 0);this.formPromise=this.loginStrategyService.logIn(o);const a=yield this.formPromise;if(a.requiresTwoFactor)return yield this.handleTwoFactorRequired(i);if(yield this.loginSuccessHandlerService.run(a.userId,null),yield this.ssoLoginService.setActiveUserOrganizationSsoIdentifier(i,a.userId),null!=(yield(0,w._)(this.keyConnectorService.requiresDomainConfirmation$(a.userId))))return void(yield this.router.navigate(["confirm-key-connector-domain"]));const l=yield(0,w._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(a.userId));if(!!l.trustedDeviceOption&&(yield this.isTrustedDeviceEncEnabled(l.trustedDeviceOption)))return yield this.handleTrustedDeviceEncryptionEnabled(l);return!l.hasMasterPassword&&void 0===l.keyConnectorOption||a.resetMasterPassword?yield this.handleChangePasswordRequired(i):yield this.handleSuccessfulLogin()}catch(s){yield this.handleLoginError(s)}})}isTrustedDeviceEncEnabled(e){return En(this,void 0,void 0,function*(){return void 0!==e})}handleTwoFactorRequired(e){return En(this,void 0,void 0,function*(){yield this.router.navigate(["2fa"],{queryParams:{identifier:e,sso:"true"}})})}handleTrustedDeviceEncryptionEnabled(e){return En(this,void 0,void 0,function*(){var t,i,n,r;const s=null===(t=yield(0,w._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;s&&(!e.hasMasterPassword&&(null===(i=e.trustedDeviceOption)||void 0===i?void 0:i.isTdeOffboarding)?yield this.masterPasswordService.setForceSetPasswordReason(Tn.n.TdeOffboarding,s):!e.hasMasterPassword&&(null===(n=e.trustedDeviceOption)||void 0===n?void 0:n.hasManageResetPasswordPermission)&&(yield this.masterPasswordService.setForceSetPasswordReason(Tn.n.TdeUserWithoutPasswordHasPasswordResetPermission,s)),(null===(r=this.ssoComponentService)||void 0===r?void 0:r.closeWindow)?yield this.ssoComponentService.closeWindow():yield this.router.navigate(["login-initiated"]))})}handleChangePasswordRequired(e){return En(this,void 0,void 0,function*(){yield this.router.navigate(["set-initial-password"],{queryParams:{identifier:e}})})}handleSuccessfulLogin(){return En(this,void 0,void 0,function*(){yield this.router.navigate(["lock"])})}handleLoginError(e){return En(this,void 0,void 0,function*(){this.logService.error(e),e instanceof Error&&"Key Connector error"===e.message?this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("ssoKeyConnectorError")}):this.toastService.showToast({variant:"error",title:null,message:e.message}),this.router.routeReuseStrategy.shouldReuseRoute=()=>!1,yield this.router.navigate(["/login"])})}getOrgIdentifierFromState(e){if(null==e)return"";const t=e.split("_identifier=");return t.length>1?t[1]:""}verifyStateMatches(e,t){if(null==e)return!1;if(null==t)return!1;const i=e.split("_identifier="),n=t.split("_identifier=");return i[0]===n[0]}initializeIdentifierFromEmailOrStorage(){return En(this,void 0,void 0,function*(){if(this.email){this.loggingIn=!0;try{const e=yield this.orgDomainApiService.getVerifiedOrgDomainsByEmail(this.email);if(e.data.length>0)return this.identifierFormControl.setValue(e.data[0].organizationIdentifier),void(yield this.submit())}catch(t){this.handleGetClaimedDomainByEmailError(t)}this.loggingIn=!1}const e=yield this.ssoLoginService.getOrganizationSsoIdentifier();null!=e&&this.identifierFormControl.setValue(e)})}}On.ɵfac=function(e){return new(e||On)(l.rXU(te._),l.rXU(F.sg),l.rXU(L.Ix),l.rXU(H.W),l.rXU(L.nX),l.rXU(Fn.o),l.rXU(Q.B),l.rXU(J.y),l.rXU(Ne.G),l.rXU(yt.R),l.rXU(E.v),l.rXU(dt.JJ),l.rXU(A.K),l.rXU(F.Ym),l.rXU(Rn.O),l.rXU(je.Di),l.rXU(q.f),l.rXU(Pn),l.rXU(F.aJ),l.rXU($n.K))},On.ɵcmp=l.VBU({type:On,selectors:[["ng-component"]],decls:3,vars:4,consts:[[1,"tw-container",3,"formGroup","bitSubmit"],[4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["bitInput","","type","text","formControlName","identifier","appAutofocus",""],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"block"]],template:function(e,t){1&e&&(l.j41(0,"form",0),l.DNE(1,An,5,7,"div",1)(2,Dn,10,7,"div",1),l.k0s()),2&e&&(l.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),l.R7$(),l.Y8G("ngIf",t.loggingIn),l.R7$(),l.Y8G("ngIf",!t.loggingIn))},dependencies:[U.C,ie.$,ne.L,o.t,c.Q,G.q,v.MD,v.bT,j.L,oe.j,ae.J,le.h,N.Q,V.V,n.p,pe.B,g.X1,g.qT,g.me,g.BC,g.cb,g.j4,g.JD,y.iI,h.$],encapsulation:2});class Mn{}!function(e){e[e.DIRECT_LAUNCH=0]="DIRECT_LAUNCH",e[e.SINGLE_ACTION_POPOUT=1]="SINGLE_ACTION_POPOUT"}(xn||(xn={}));class Un{}class Gn{shouldCheckForWebAuthnQueryParamResponse(){return!1}determineDuoLaunchAction(){return xn.DIRECT_LAUNCH}}var jn=i(88565),Nn=i(2073),Vn=i(20266),Bn=i(36951);const zn=k.Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 120 40">
    <g clip-path="url(#two-factor-auth-duo-clip)">
        <path fill="#7BCD54" d="M19.359 39.412H0V20.97h38.694c-.505 10.27-8.968 18.44-19.335 18.44Z" />
        <path fill="#63C43F"
            d="M19.359.588H0V19.03h38.694C38.188 8.76 29.726.59 19.358.59ZM100.666.588c-10.367 0-18.83 8.172-19.335 18.441H120C119.496 8.76 111.033.59 100.666.59Z" />
        <path fill="#7BCD54"
            d="M100.666 39.412c-10.367 0-18.83-8.171-19.335-18.441H120c-.504 10.27-8.967 18.44-19.334 18.44Z" />
        <path fill="#63C43F" d="M40.653.588V20c0 10.395 8.15 18.882 18.391 19.388V.588h-18.39Z" />
        <path fill="#7BCD54" d="M79.37 39.412H60.98V.588h18.39v38.824Z" />
    </g>
    <defs>
        <clipPath id="two-factor-auth-duo-clip">
            <path class="tw-fill-text-alt2" d="M0 .588h120v38.824H0z" />
        </clipPath>
    </defs>
</svg>
`;var Ln=i(26061),Kn=i(87895),qn=i(71804),_n=i(68881),Xn=i(37380);class Yn{constructor(){this.tokenFormControl=void 0,this.tokenChange=new l.bkB}onTokenChange(e){const t=e.target.value||"";this.tokenChange.emit({token:t})}}Yn.ɵfac=function(e){return new(e||Yn)},Yn.ɵcmp=l.VBU({type:Yn,selectors:[["app-two-factor-auth-authenticator"]],inputs:{tokenFormControl:"tokenFormControl"},outputs:{tokenChange:"tokenChange"},features:[l.Jv_([])],decls:6,vars:4,consts:[["bitInput","","type","text","appAutofocus","","appInputVerbatim","",3,"keyup","formControl"]],template:function(e,t){1&e&&(l.qex(0),l.j41(1,"bit-form-field")(2,"bit-label"),l.EFF(3),l.nI1(4,"i18n"),l.k0s(),l.j41(5,"input",0),l.bIt("keyup",function(e){return t.onTokenChange(e)}),l.k0s()(),l.bVm()),2&e&&(l.R7$(3),l.JRh(l.bMT(4,2,"verificationCode")),l.R7$(2),l.Y8G("formControl",t.tokenFormControl))},dependencies:[v.MD,n.p,pe.B,At.q,a.P,o.t,V.V,Ue.E,g.X1,g.me,g.BC,g.l_,j.L,oe.j,ae.J,le.h,U.C,g.YN,h.$],encapsulation:2});class Hn{}var Wn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Jn{constructor(e,t,i,n,r){this.i18nService=e,this.platformUtilsService=t,this.toastService=i,this.twoFactorAuthDuoComponentService=n,this.destroyRef=r,this.tokenEmitter=new l.bkB,this.duoFramelessUrl=void 0}ngOnInit(){return Wn(this,void 0,void 0,function*(){this.twoFactorAuthDuoComponentService.listenForDuo2faResult$().pipe((0,f.pQ)(this.destroyRef)).subscribe(e=>{this.tokenEmitter.emit(e.token)}),this.duoFramelessUrl=this.providerData.AuthUrl})}launchDuoFrameless(e){return Wn(this,void 0,void 0,function*(){var t,i;switch(e){case xn.DIRECT_LAUNCH:yield this.launchDuoFramelessDirectly();break;case xn.SINGLE_ACTION_POPOUT:yield null===(i=(t=this.twoFactorAuthDuoComponentService).openTwoFactorAuthDuoPopout)||void 0===i?void 0:i.call(t)}})}launchDuoFramelessDirectly(){return Wn(this,void 0,void 0,function*(){null!==this.duoFramelessUrl&&void 0!==this.duoFramelessUrl?yield this.twoFactorAuthDuoComponentService.launchDuoFrameless(this.duoFramelessUrl):this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("duoHealthCheckResultsInNullAuthUrlError")})})}}Jn.ɵfac=function(e){return new(e||Jn)(l.rXU(H.W),l.rXU(J.y),l.rXU(q.f),l.rXU(Hn),l.rXU(z.abz))},Jn.ɵcmp=l.VBU({type:Jn,selectors:[["app-two-factor-auth-duo"]],inputs:{providerData:"providerData"},outputs:{tokenEmitter:"tokenEmitter"},features:[l.Jv_([])],decls:0,vars:0,template:function(e,t){},dependencies:[v.MD,n.p,a.P,o.t,V.V,Ue.E,g.X1,j.L,U.C,g.YN],encapsulation:2});var Zn=i(74199);class Qn{constructor(){this.emailSent=!1}static fromJSON(e){return null==e?null:Object.assign(new Qn,e)}}class er{constructor(){this.viewCacheService=(0,z.WQX)(ut.Z),this.emailCache=this.viewCacheService.signal({key:"two-factor-auth-email-component-cache",initialValue:null,deserializer:Qn.fromJSON})}cacheData(e){this.emailCache.set({emailSent:e.emailSent})}clearCachedData(){this.emailCache.set(null)}getCachedData(){return this.emailCache()}}er.ɵfac=function(e){return new(e||er)},er.ɵprov=z.jDH({token:er,factory:er.ɵfac});var tr=i(93103),ir=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class nr{constructor(e,t,i,n,r,s,o,a){this.i18nService=e,this.twoFactorService=t,this.loginStrategyService=i,this.platformUtilsService=n,this.logService=r,this.appIdService=s,this.toastService=o,this.cacheService=a,this.tokenFormControl=void 0,this.tokenChange=new l.bkB,this.twoFactorEmail=void 0,this.emailSent=!1}ngOnInit(){return ir(this,void 0,void 0,function*(){const e=this.cacheService.getCachedData();(null==e?void 0:e.emailSent)&&(this.emailSent=!0);const t=yield this.twoFactorService.getProviders();if(!t||0===t.size)throw new Error("User has no 2FA Providers");const i=t.get(qn.R.Email);if(!i)throw new Error("Unable to retrieve email 2FA provider data");this.twoFactorEmail=i.Email,this.emailSent||(yield this.sendEmail(!1))})}onTokenChange(e){const t=e.target.value||"";this.tokenChange.emit({token:t})}sendEmail(e){return ir(this,void 0,void 0,function*(){var t,i,n,r;if(void 0!==this.emailPromise)return;const s=yield this.loginStrategyService.getEmail();if(null!=s){try{const o=new Zn.v;o.email=s,o.masterPasswordHash=null!==(t=yield this.loginStrategyService.getMasterPasswordHash())&&void 0!==t?t:"",o.ssoEmail2FaSessionToken=null!==(i=yield this.loginStrategyService.getSsoEmail2FaSessionToken())&&void 0!==i?i:"",o.deviceIdentifier=yield this.appIdService.getAppId(),o.authRequestAccessCode=null!==(n=yield this.loginStrategyService.getAccessCode())&&void 0!==n?n:"",o.authRequestId=null!==(r=yield this.loginStrategyService.getAuthRequestId())&&void 0!==r?r:"",this.emailPromise=this.twoFactorService.postTwoFactorEmail(o),yield this.emailPromise,this.emailSent=!0,this.cacheService.cacheData({emailSent:this.emailSent}),e&&this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("verificationCodeEmailSent",this.twoFactorEmail)})}catch(o){this.logService.error(o)}this.emailPromise=void 0}else this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("sessionTimeout")})})}}nr.ɵfac=function(e){return new(e||nr)(l.rXU(H.W),l.rXU(Xn.fz),l.rXU(F.sg),l.rXU(J.y),l.rXU(A.K),l.rXU(_.Y),l.rXU(q.f),l.rXU(er))},nr.ɵcmp=l.VBU({type:nr,selectors:[["app-two-factor-auth-email"]],inputs:{tokenFormControl:"tokenFormControl"},outputs:{tokenChange:"tokenChange"},features:[l.Jv_([{provide:er,useClass:er}])],decls:9,vars:7,consts:[[1,"!tw-mb-0"],["bitInput","","type","text","appAutofocus","","appInputVerbatim","",3,"keyup","formControl"],[1,"tw-mb-4"],["bitTypography","helper","bitLink","","href","#","appStopClick","",1,"tw-text-main",3,"click"]],template:function(e,t){1&e&&(l.j41(0,"bit-form-field",0)(1,"bit-label"),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"input",1),l.bIt("keyup",function(e){return t.onTokenChange(e)}),l.k0s()(),l.j41(5,"div",2)(6,"a",3),l.bIt("click",function(){return t.sendEmail(!0)}),l.EFF(7),l.nI1(8,"i18n"),l.k0s()()),2&e&&(l.R7$(2),l.JRh(l.bMT(3,3,"verificationCode")),l.R7$(2),l.Y8G("formControl",t.tokenFormControl),l.R7$(3),l.SpI(" ",l.bMT(8,5,"resendCode")," "))},dependencies:[v.MD,n.p,pe.B,At.q,tr.Y,a.P,o.t,V.V,he.L,Ue.E,Xe.r,g.X1,g.me,g.BC,g.l_,j.L,oe.j,ae.J,le.h,U.C,g.YN,h.$],encapsulation:2});class rr{constructor(e,t,i,n,r,s,o,a){this.win=e,this.webVaultUrl=t,this.webAuthnNewTab=i,this.platformUtilsService=n,this.i18nService=r,this.successCallback=s,this.errorCallback=o,this.infoCallback=a,this.iframe=null,this.parseFunction=this.parseMessage.bind(this),this.connectorLink=e.document.createElement("a")}init(e){const t=new URLSearchParams({data:this.base64Encode(JSON.stringify(e)),parent:encodeURIComponent(this.win.document.location.href),btnText:encodeURIComponent(this.i18nService.t("readSecurityKey")),btnAwaitingInteractionText:encodeURIComponent(this.i18nService.t("awaitingSecurityKeyInteraction")),v:"1"});this.webAuthnNewTab?(t.append("locale",this.i18nService.translationLocale),this.platformUtilsService.launchUri(`${this.webVaultUrl}/webauthn-fallback-connector.html?${t}`)):(this.connectorLink.href=`${this.webVaultUrl}/webauthn-connector.html?${t}`,this.iframe=this.win.document.getElementById("webauthn_iframe"),this.iframe.allow="publickey-credentials-get "+new URL(this.webVaultUrl).origin,this.iframe.src=this.connectorLink.href,this.win.addEventListener("message",this.parseFunction,!1))}stop(){this.sendMessage("stop")}start(){this.sendMessage("start")}sendMessage(e){this.iframe&&this.iframe.src&&this.iframe.contentWindow&&this.iframe.contentWindow.postMessage(e,this.iframe.src)}base64Encode(e){return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode("0x"+t)))}cleanup(){this.win.removeEventListener("message",this.parseFunction,!1)}parseMessage(e){if(!this.validMessage(e))return;const t=e.data.split("|");"success"===t[0]&&this.successCallback?this.successCallback(t[1]):"error"===t[0]&&this.errorCallback?this.errorCallback(t[1]):"info"===t[0]&&this.infoCallback&&this.infoCallback(t[1])}validMessage(e){return null!=e.origin&&""!==e.origin&&e.origin===this.connectorLink.origin&&null!=e.data&&"string"==typeof e.data&&(0===e.data.indexOf("success|")||0===e.data.indexOf("error|")||0===e.data.indexOf("info|"))}}class sr{}var or=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ar=e=>({"tw-hidden":e});function lr(e,t){1&e&&(l.j41(0,"div",5),l.nrm(1,"i",6),l.k0s())}function cr(e,t){if(1&e&&(l.j41(0,"div",2),l.DNE(1,lr,2,0,"div",3),l.nrm(2,"iframe",4),l.k0s()),2&e){const e=l.XpG();l.R7$(),l.Y8G("ngIf",!e.webAuthnReady),l.R7$(),l.Y8G("ngClass",l.eq3(2,ar,!e.webAuthnReady))}}function dr(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"button",7),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.authWebAuthn())}),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.bVm()}2&e&&(l.R7$(),l.Y8G("block",!0),l.R7$(),l.SpI(" ",l.bMT(3,2,"openInNewTab")," "))}class ur{constructor(e,t,i,n,r,s,o,a,c){this.i18nService=e,this.platformUtilsService=t,this.win=i,this.environmentService=n,this.twoFactorService=r,this.route=s,this.toastService=o,this.twoFactorAuthWebAuthnComponentService=a,this.logService=c,this.webAuthnResultEmitter=new l.bkB,this.webAuthnInNewTabEmitter=new l.bkB,this.webAuthnReady=!1,this.webAuthnNewTab=!1,this.webAuthnSupported=!1,this.webAuthnIframe=void 0,this.webAuthnSupported=this.platformUtilsService.supportsWebAuthn(i),this.webAuthnNewTab=this.twoFactorAuthWebAuthnComponentService.shouldOpenWebAuthnInNewTab()}ngOnInit(){return or(this,void 0,void 0,function*(){this.webAuthnInNewTabEmitter.emit(this.webAuthnNewTab),this.webAuthnNewTab&&this.route.snapshot.paramMap.has("webAuthnResponse")?this.submitWebAuthnNewTabResponse():yield this.buildWebAuthnIFrame()})}submitWebAuthnNewTabResponse(){const e=this.route.snapshot.paramMap.get("webAuthnResponse"),t="true"===this.route.snapshot.paramMap.get("remember");null!=e&&this.webAuthnResultEmitter.emit({token:e,remember:t})}buildWebAuthnIFrame(){return or(this,void 0,void 0,function*(){if(null!=this.win&&this.webAuthnSupported){const e=(yield(0,w._)(this.environmentService.environment$)).getWebVaultUrl();this.webAuthnIframe=new rr(this.win,e,this.webAuthnNewTab,this.platformUtilsService,this.i18nService,e=>{this.webAuthnResultEmitter.emit({token:e})},e=>{this.logService.error("WebAuthn error: ",e),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("webauthnCancelOrTimeout")})},e=>{"ready"===e&&(this.webAuthnReady=!0)}),this.webAuthnNewTab||setTimeout(()=>or(this,void 0,void 0,function*(){yield this.authWebAuthn()}),500)}})}ngOnDestroy(){this.cleanupWebAuthnIframe()}authWebAuthn(){return or(this,void 0,void 0,function*(){const e=yield this.twoFactorService.getProviders();if(null==e)return void this.logService.error("No 2FA providers found. Unable to authenticate with WebAuthn.");const t=null==e?void 0:e.get(qn.R.WebAuthn);this.webAuthnSupported&&null!=this.webAuthnIframe&&this.webAuthnIframe.init(t)})}cleanupWebAuthnIframe(){null!=this.webAuthnIframe&&(this.webAuthnIframe.stop(),this.webAuthnIframe.cleanup())}}ur.ɵfac=function(e){return new(e||ur)(l.rXU(H.W),l.rXU(J.y),l.rXU(Nn.jf),l.rXU(E.v),l.rXU(Xn.fz),l.rXU(L.nX),l.rXU(q.f),l.rXU(sr),l.rXU(A.K))},ur.ɵcmp=l.VBU({type:ur,selectors:[["app-two-factor-auth-webauthn"]],outputs:{webAuthnResultEmitter:"webAuthnResultEmitter",webAuthnInNewTabEmitter:"webAuthnInNewTabEmitter"},features:[l.Jv_([])],decls:2,vars:2,consts:[["id","web-authn-frame","class","tw-mb-3",4,"ngIf"],[4,"ngIf"],["id","web-authn-frame",1,"tw-mb-3"],["class","tw-flex tw-items-center tw-justify-center",4,"ngIf"],["id","webauthn_iframe","sandbox","allow-scripts allow-same-origin",3,"ngClass"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],["buttonType","primary","bitButton","","type","button","appStopClick","",1,"tw-mb-3",3,"click","block"]],template:function(e,t){1&e&&l.DNE(0,cr,3,4,"div",0)(1,dr,4,4,"ng-container",1),2&e&&(l.Y8G("ngIf",!t.webAuthnNewTab),l.R7$(),l.Y8G("ngIf",t.webAuthnNewTab))},dependencies:[v.MD,v.YU,v.bT,n.p,tr.Y,a.P,o.t,c.Q,V.V,Ue.E,g.X1,j.L,U.C,g.YN,h.$],encapsulation:2});class hr{constructor(){this.tokenFormControl=void 0}}hr.ɵfac=function(e){return new(e||hr)},hr.ɵcmp=l.VBU({type:hr,selectors:[["app-two-factor-auth-yubikey"]],inputs:{tokenFormControl:"tokenFormControl"},features:[l.Jv_([])],decls:5,vars:4,consts:[[1,""],["type","password","bitInput","","appAutofocus","","appInputVerbatim","",3,"formControl"]],template:function(e,t){1&e&&(l.j41(0,"bit-form-field")(1,"bit-label",0),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.nrm(4,"input",1),l.k0s()),2&e&&(l.R7$(2),l.JRh(l.bMT(3,2,"verificationCode")),l.R7$(2),l.Y8G("formControl",t.tokenFormControl))},dependencies:[v.MD,n.p,pe.B,At.q,a.P,o.t,V.V,Ue.E,g.X1,g.me,g.BC,g.l_,j.L,oe.j,ae.J,le.h,U.C,g.YN,h.$],encapsulation:2});class pr{constructor(){this.token=void 0,this.remember=void 0,this.selectedProviderType=void 0}static fromJSON(e){return null==e?null:Object.assign(new pr,e)}}class mr{constructor(){this.viewCacheService=(0,z.WQX)(ut.Z),this.twoFactorAuthComponentCache=this.viewCacheService.signal({key:"two-factor-auth-component-cache",initialValue:null,deserializer:pr.fromJSON})}cacheData(e){this.twoFactorAuthComponentCache.set({token:e.token,remember:e.remember,selectedProviderType:e.selectedProviderType})}clearCachedData(){this.twoFactorAuthComponentCache.set(null)}getCachedData(){return this.twoFactorAuthComponentCache()}}mr.ɵfac=function(e){return new(e||mr)},mr.ɵprov=z.jDH({token:mr,factory:mr.ɵfac});const vr=k.Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 121 33">
    <g fill="#84BD00" clip-path="url(#two-factor-auth-yubico-clip)">
        <path
            d="M11.011 19.366 15.18 7.47h6.02L11.054 32.622H4.698l2.903-6.891L.5 7.47h6.147l4.364 11.895ZM42.446 25.872h-5.87V23.84c-.925.73-1.92 1.364-2.971 1.892-.9.432-1.971.648-3.216.646-2.014 0-3.562-.584-4.645-1.751-1.082-1.168-1.627-2.895-1.633-5.18V7.471h5.865v9.127c0 .929.03 1.702.09 2.319.036.533.177 1.054.414 1.532.199.396.53.71.935.884.418.186 1 .279 1.749.279a5.726 5.726 0 0 0 1.657-.28 7.101 7.101 0 0 0 1.757-.818V7.47h5.868v18.4ZM66.065 16.42c0 2.894-.793 5.254-2.38 7.078-1.586 1.824-3.565 2.736-5.935 2.736a9.864 9.864 0 0 1-2.68-.327 9.183 9.183 0 0 1-2.191-.95l-.245.916H47.01V.377h5.87v9.012a14.137 14.137 0 0 1 2.753-1.754 7.413 7.413 0 0 1 3.24-.671c2.305 0 4.08.84 5.327 2.52 1.245 1.68 1.867 3.992 1.865 6.935Zm-6.032.122c0-1.637-.276-2.897-.828-3.78-.553-.884-1.537-1.326-2.952-1.326-.577.004-1.15.09-1.704.254a6.987 6.987 0 0 0-1.67.72v9.227c.388.144.79.249 1.2.311a9.8 9.8 0 0 0 1.363.083c1.548 0 2.7-.459 3.455-1.375.755-.918 1.135-2.289 1.138-4.114h-.002ZM75.961 4.85h-6.195V.377h6.195V4.85ZM75.8 25.872h-5.87v-18.4h5.87v18.4ZM90.789 26.363a15.651 15.651 0 0 1-4.36-.572 9.575 9.575 0 0 1-3.438-1.77 8.005 8.005 0 0 1-2.244-3.015c-.53-1.211-.796-2.631-.797-4.26 0-1.716.285-3.196.854-4.44a8.377 8.377 0 0 1 2.382-3.097A9.675 9.675 0 0 1 86.6 7.504a14.864 14.864 0 0 1 4.017-.54c1.16-.01 2.319.127 3.446.408 1.013.26 1.999.616 2.944 1.066v5.03h-.83c-.225-.197-.499-.426-.82-.688a7.315 7.315 0 0 0-1.176-.77 7.73 7.73 0 0 0-1.46-.598 6.497 6.497 0 0 0-1.858-.234c-1.56 0-2.76.5-3.598 1.5-.839 1-1.255 2.357-1.25 4.072 0 1.77.43 3.114 1.29 4.03.86.918 2.08 1.376 3.662 1.376a7.202 7.202 0 0 0 1.988-.254 6.426 6.426 0 0 0 1.47-.597c.344-.201.67-.431.974-.688.282-.241.536-.475.779-.706h.829v5.041c-.931.434-1.9.778-2.896 1.028a13.455 13.455 0 0 1-3.323.383ZM120.4 16.68c0 3.027-.875 5.411-2.626 7.153-1.751 1.741-4.209 2.613-7.375 2.614-3.165 0-5.624-.871-7.374-2.614-1.751-1.743-2.627-4.127-2.627-7.153 0-3.048.882-5.44 2.644-7.176 1.763-1.735 4.215-2.603 7.357-2.605 3.187 0 5.651.874 7.391 2.622 1.74 1.747 2.61 4.134 2.61 7.16Zm-7.203 4.474a4.741 4.741 0 0 0 .852-1.696c.192-.661.287-1.576.286-2.745.018-.915-.08-1.829-.293-2.719a4.768 4.768 0 0 0-.818-1.753 2.853 2.853 0 0 0-1.251-.95 4.4 4.4 0 0 0-1.577-.28 4.607 4.607 0 0 0-1.504.229c-.489.192-.92.508-1.251.918a4.687 4.687 0 0 0-.854 1.754 10.45 10.45 0 0 0-.318 2.8c-.014.88.079 1.758.277 2.615.141.645.418 1.251.813 1.778a3.11 3.11 0 0 0 1.25.935 4.6 4.6 0 0 0 3.17.023 2.794 2.794 0 0 0 1.218-.909Z" />
    </g>
    <defs>
        <clipPath id="two-factor-auth-yubico-clip">
            <path class="tw-fill-text-alt2" d="M.5.377h120v32.247H.5z" />
        </clipPath>
    </defs>
</svg>
`;var fr=i(98403),gr=i(75556),yr=i(90300),br=i(91962),wr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Sr(e,t){if(1&e&&l.nrm(0,"bit-icon",11),2&e){const e=l.XpG(2);l.Y8G("icon",e.Icons.TwoFactorAuthAuthenticatorIcon)}}function Ir(e,t){if(1&e&&l.nrm(0,"bit-icon",11),2&e){const e=l.XpG(2);l.Y8G("icon",e.Icons.TwoFactorAuthEmailIcon)}}function kr(e,t){if(1&e&&l.nrm(0,"bit-icon",11),2&e){const e=l.XpG(2);l.Y8G("icon",e.Icons.TwoFactorAuthDuoIcon)}}function Cr(e,t){if(1&e&&l.nrm(0,"bit-icon",11),2&e){const e=l.XpG(2);l.Y8G("icon",e.Icons.TwoFactorAuthYubicoIcon)}}function Tr(e,t){if(1&e&&l.nrm(0,"bit-icon",11),2&e){const e=l.XpG(2);l.Y8G("icon",e.Icons.TwoFactorAuthDuoIcon)}}function Fr(e,t){if(1&e&&l.nrm(0,"bit-icon",11),2&e){const e=l.XpG(2);l.Y8G("icon",e.Icons.TwoFactorAuthWebAuthnIcon)}}function Rr(e,t){if(1&e){const e=l.RV6();l.j41(0,"bit-item",6),l.bIt("click",function(){const t=z.eBV(e).$implicit,i=l.XpG();return z.Njj(i.choose(t))}),l.j41(1,"button",7)(2,"div",8),l.DNE(3,Sr,1,1,"bit-icon",9)(4,Ir,1,1,"bit-icon",9)(5,kr,1,1,"bit-icon",9)(6,Cr,1,1,"bit-icon",9)(7,Tr,1,1,"bit-icon",9)(8,Fr,1,1,"bit-icon",9),l.k0s(),l.EFF(9),l.qex(10,10),l.EFF(11),l.bVm(),l.k0s()()}if(2&e){const e=t.$implicit,i=l.XpG();l.R7$(),l.Y8G("truncate",!1),l.R7$(),l.Y8G("ngSwitch",e.type),l.R7$(),l.Y8G("ngSwitchCase",i.TwoFactorProviderType.Authenticator),l.R7$(),l.Y8G("ngSwitchCase",i.TwoFactorProviderType.Email),l.R7$(),l.Y8G("ngSwitchCase",i.TwoFactorProviderType.Duo),l.R7$(),l.Y8G("ngSwitchCase",i.TwoFactorProviderType.Yubikey),l.R7$(),l.Y8G("ngSwitchCase",i.TwoFactorProviderType.OrganizationDuo),l.R7$(),l.Y8G("ngSwitchCase",i.TwoFactorProviderType.WebAuthn),l.R7$(),l.SpI(" ",e.name," "),l.R7$(2),l.SpI(" ",e.description," ")}}class Pr{constructor(e,t){this.twoFactorService=e,this.dialogRef=t,this.providers=[],this.TwoFactorProviderType=qn.R,this.Icons={TwoFactorAuthAuthenticatorIcon:Vn.m,TwoFactorAuthEmailIcon:Bn.f,TwoFactorAuthDuoIcon:zn,TwoFactorAuthYubicoIcon:vr,TwoFactorAuthWebAuthnIcon:Kn.R}}ngOnInit(){return wr(this,void 0,void 0,function*(){const e=yield this.twoFactorService.getSupportedProviders(window);e.sort((e,t)=>e.sort-t.sort),this.providers=e})}choose(e){return wr(this,void 0,void 0,function*(){this.dialogRef.close({type:e.type})})}static open(e){return e.open(Pr)}cancel(){this.dialogRef.close()}}Pr.ɵfac=function(e){return new(e||Pr)(l.rXU(Xn.fz),l.rXU(r.ce))},Pr.ɵcmp=l.VBU({type:Pr,selectors:[["app-two-factor-options"]],features:[l.Jv_([])],decls:11,vars:8,consts:[["dialogSize","large",3,"background"],["bitDialogTitle",""],["bitDialogContent",""],[3,"click",4,"ngFor","ngForOf"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","secondary",3,"click"],[3,"click"],["bit-item-content","","type","button",1,"tw-h-auto","md:tw-h-20",3,"truncate"],["slot","start",1,"tw-w-16","md:tw-w-20","tw-mr-2","sm:tw-mr-4",3,"ngSwitch"],[3,"icon",4,"ngSwitchCase"],["slot","secondary"],[3,"icon"]],template:function(e,t){1&e&&(l.j41(0,"bit-dialog",0)(1,"span",1),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.qex(4,2),l.j41(5,"bit-item-group"),l.DNE(6,Rr,12,10,"bit-item",3),l.k0s(),l.bVm(),l.qex(7,4),l.j41(8,"button",5),l.bIt("click",function(){return t.cancel()}),l.EFF(9),l.nI1(10,"i18n"),l.k0s(),l.bVm(),l.k0s()),2&e&&(l.Y8G("background","alt"),l.R7$(2),l.SpI(" ",l.bMT(3,4,"selectTwoStepLoginMethod")," "),l.R7$(4),l.Y8G("ngForOf",t.providers),l.R7$(3),l.SpI(" ",l.bMT(10,6,"cancel")," "))},dependencies:[v.MD,v.Sq,v.ux,v.e1,n.p,a.P,Ht.m,o.t,c.Q,Ue.E,fr.k,gr.J,yr.g,br._,Lt.o,Ki.i,h.$],encapsulation:2});var xr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const $r=["continueButton"],Er=["duoComponent"];function Ar(e,t){1&e&&(l.qex(0),l.j41(1,"div",3),l.nrm(2,"i",4),l.k0s(),l.bVm())}function Dr(e,t){if(1&e){const e=l.RV6();l.j41(0,"app-two-factor-auth-email",16),l.bIt("tokenChange",function(t){z.eBV(e);const i=l.XpG(2);return z.Njj(i.saveFormDataWithPartialData(t))}),l.k0s()}if(2&e){const e=l.XpG(2);l.Y8G("tokenFormControl",e.tokenFormControl)}}function Or(e,t){if(1&e){const e=l.RV6();l.j41(0,"app-two-factor-auth-authenticator",16),l.bIt("tokenChange",function(t){z.eBV(e);const i=l.XpG(2);return z.Njj(i.saveFormDataWithPartialData(t))}),l.k0s()}if(2&e){const e=l.XpG(2);l.Y8G("tokenFormControl",e.tokenFormControl)}}function Mr(e,t){if(1&e&&l.nrm(0,"app-two-factor-auth-yubikey",17),2&e){const e=l.XpG(2);l.Y8G("tokenFormControl",e.tokenFormControl)}}function Ur(e,t){if(1&e){const e=l.RV6();l.j41(0,"app-two-factor-auth-duo",18,0),l.bIt("tokenEmitter",function(t){z.eBV(e);const i=l.XpG(2);return z.Njj(i.submit(t))}),l.k0s()}if(2&e){const e=l.XpG(2);l.Y8G("providerData",e.selectedProviderData)}}function Gr(e,t){if(1&e){const e=l.RV6();l.j41(0,"bit-form-control")(1,"bit-label"),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"input",19),l.bIt("change",function(){z.eBV(e);const t=l.XpG(2);return z.Njj(t.onRememberChange())}),l.k0s()()}2&e&&(l.R7$(2),l.JRh(l.bMT(3,1,"dontAskAgainOnThisDeviceFor30Days")))}function jr(e,t){if(1&e){const e=l.RV6();l.j41(0,"app-two-factor-auth-webauthn",20),l.bIt("webAuthnResultEmitter",function(t){z.eBV(e);const i=l.XpG(2);return z.Njj(i.submit(t.token,t.remember))})("webAuthnInNewTabEmitter",function(t){z.eBV(e);const i=l.XpG(2);return z.Njj(i.webAuthInNewTab=t)}),l.k0s()}}function Nr(e,t){1&e&&(l.qex(0),l.j41(1,"p",21),l.EFF(2),l.nI1(3,"i18n"),l.k0s(),l.j41(4,"p",21),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.bVm()),2&e&&(l.R7$(2),l.JRh(l.bMT(3,2,"noTwoStepProviders")),l.R7$(3),l.JRh(l.bMT(6,4,"noTwoStepProviders2")))}function Vr(e,t){1&e&&(l.j41(0,"button",22,1)(2,"span"),l.EFF(3),l.nI1(4,"i18n"),l.k0s()()),2&e&&(l.R7$(3),l.SpI(" ",l.bMT(4,1,"continueLoggingIn")," "))}function Br(e,t){1&e&&(l.j41(0,"span"),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"launchDuo")))}function zr(e,t){1&e&&(l.j41(0,"span"),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" ",l.bMT(2,1,"popoutExtension")))}function Lr(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",23),l.bIt("click",function(){z.eBV(e);const t=l.XpG(2);return z.Njj(t.launchDuo())}),l.DNE(1,Br,3,3,"span",2)(2,zr,3,3,"span",2),l.k0s()}if(2&e){const e=l.XpG(2);l.R7$(),l.Y8G("ngIf",e.duoLaunchAction===e.DuoLaunchAction.DIRECT_LAUNCH),l.R7$(),l.Y8G("ngIf",e.duoLaunchAction===e.DuoLaunchAction.SINGLE_ACTION_POPOUT)}}function Kr(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",15),l.bIt("click",function(){z.eBV(e);const t=l.XpG(2);return z.Njj(t.selectOtherTwoFactorMethod())}),l.j41(1,"span"),l.EFF(2),l.nI1(3,"i18n"),l.k0s()()}2&e&&(l.R7$(2),l.SpI(" ",l.bMT(3,1,"selectAnotherMethod")," "))}function qr(e,t){if(1&e){const e=l.RV6();l.qex(0),l.j41(1,"form",5),l.bIt("keydown.enter",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.handleEnterKeyPress())}),l.DNE(2,Dr,1,1,"app-two-factor-auth-email",6)(3,Or,1,1,"app-two-factor-auth-authenticator",6)(4,Mr,1,1,"app-two-factor-auth-yubikey",7)(5,Ur,2,1,"app-two-factor-auth-duo",8)(6,Gr,5,3,"bit-form-control",2)(7,jr,1,0,"app-two-factor-auth-webauthn",9)(8,Nr,7,6,"ng-container",2),l.j41(9,"div",10),l.DNE(10,Vr,5,3,"button",11)(11,Lr,3,2,"button",12),l.j41(12,"p",13),l.EFF(13),l.nI1(14,"i18n"),l.k0s(),l.DNE(15,Kr,4,3,"button",14),l.j41(16,"button",15),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.use2faRecoveryCode())}),l.j41(17,"span"),l.EFF(18),l.nI1(19,"i18n"),l.k0s()()()(),l.bVm()}if(2&e){const e=l.XpG();l.R7$(),l.Y8G("bitSubmit",e.submit)("formGroup",e.form),l.R7$(),l.Y8G("ngIf",e.selectedProviderType===e.providerType.Email),l.R7$(),l.Y8G("ngIf",e.selectedProviderType===e.providerType.Authenticator),l.R7$(),l.Y8G("ngIf",e.selectedProviderType===e.providerType.Yubikey),l.R7$(),l.Y8G("ngIf",e.selectedProviderType===e.providerType.OrganizationDuo||e.selectedProviderType===e.providerType.Duo),l.R7$(),l.Y8G("ngIf",!e.hideRememberMe()),l.R7$(),l.Y8G("ngIf",e.selectedProviderType===e.providerType.WebAuthn),l.R7$(),l.Y8G("ngIf",null==e.selectedProviderType),l.R7$(2),l.Y8G("ngIf",e.showContinueButton()),l.R7$(),l.Y8G("ngIf",e.selectedProviderType===e.providerType.Duo||e.selectedProviderType===e.providerType.OrganizationDuo),l.R7$(2),l.JRh(l.bMT(14,14,"or")),l.R7$(2),l.Y8G("ngIf",(null==e.twoFactorProviders?null:e.twoFactorProviders.size)>1),l.R7$(3),l.SpI(" ",l.bMT(19,16,"useYourRecoveryCode")," ")}}class _r{get tokenFormControl(){return this.form.controls.token}get rememberFormControl(){return this.form.controls.remember}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,y,b,w,S,I,k){this.loginStrategyService=e,this.router=t,this.i18nService=i,this.platformUtilsService=n,this.dialogService=r,this.activatedRoute=s,this.logService=o,this.twoFactorService=a,this.userDecryptionOptionsService=l,this.ssoLoginService=c,this.masterPasswordService=d,this.accountService=u,this.formBuilder=h,this.win=p,this.toastService=m,this.twoFactorAuthComponentService=v,this.destroyRef=f,this.anonLayoutWrapperDataService=y,this.environmentService=b,this.loginSuccessHandlerService=w,this.twoFactorAuthComponentCacheService=S,this.authService=I,this.keyConnectorService=k,this.continueButton=void 0,this.loading=!0,this.orgSsoIdentifier=void 0,this.providerType=qn.R,this.selectedProviderType=qn.R.Authenticator,this.twoFactorProviders=null,this.form=this.formBuilder.group({token:["",{validators:[g.k0.required],updateOn:"submit"}],remember:[!1]}),this.duoLaunchAction=void 0,this.DuoLaunchAction=xn,this.webAuthInNewTab=!1,this.authenticationSessionTimeoutRoute="authentication-timeout",this.submit=(e,t)=>xr(this,void 0,void 0,function*(){var i;let n;if(void 0!==e){if(""===e||null===e)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("verificationCodeRequired")});n=e}else{if(this.tokenFormControl.markAsTouched(),this.tokenFormControl.markAsDirty(),this.tokenFormControl.updateValueAndValidity(),this.form.invalid)return;const e=this.tokenFormControl.value;if(!e)return;n=e.trim()}const r=null!==(i=null!=t?t:this.rememberFormControl.value)&&void 0!==i&&i;this.twoFactorAuthComponentCacheService.cacheData({token:n,remember:r,selectedProviderType:this.selectedProviderType});try{this.formPromise=this.loginStrategyService.logInTwoFactor(new _n.i(this.selectedProviderType,n,r));const e=yield this.formPromise;this.logService.info("Successfully submitted two factor token"),yield this.handleAuthResult(e)}catch(s){this.logService.error("Error submitting two factor token"),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidVerificationCode")})}})}ngOnInit(){return xr(this,void 0,void 0,function*(){var e,t,i;this.orgSsoIdentifier=null!==(e=this.activatedRoute.snapshot.queryParamMap.get("identifier"))&&void 0!==e?e:void 0,this.listenForAuthnSessionTimeout();let n=!1;const r=this.twoFactorAuthComponentCacheService.getCachedData();r&&(r.token&&this.form.patchValue({token:r.token}),void 0!==r.remember&&this.form.patchValue({remember:r.remember}),void 0!==r.selectedProviderType&&(this.selectedProviderType=r.selectedProviderType,n=!0)),n||(this.selectedProviderType=yield this.initializeSelected2faProviderType(),this.twoFactorAuthComponentCacheService.cacheData({selectedProviderType:this.selectedProviderType})),yield this.set2faProvidersAndData(),yield this.setAnonLayoutDataByTwoFactorProviderType(),yield null===(i=(t=this.twoFactorAuthComponentService).extendPopupWidthIfRequired)||void 0===i?void 0:i.call(t,this.selectedProviderType),this.duoLaunchAction=this.twoFactorAuthComponentService.determineDuoLaunchAction(),this.loading=!1})}saveFormDataWithPartialData(e){return xr(this,void 0,void 0,function*(){var t,i,n,r,s;const o=this.twoFactorAuthComponentCacheService.getCachedData();this.twoFactorAuthComponentCacheService.cacheData({token:null!==(i=null!==(t=null==e?void 0:e.token)&&void 0!==t?t:null==o?void 0:o.token)&&void 0!==i?i:"",remember:null!==(r=null!==(n=null==e?void 0:e.remember)&&void 0!==n?n:null==o?void 0:o.remember)&&void 0!==r&&r,selectedProviderType:null!==(s=null==e?void 0:e.selectedProviderType)&&void 0!==s?s:null==o?void 0:o.selectedProviderType})})}onRememberChange(){return xr(this,void 0,void 0,function*(){const e=!!this.rememberFormControl.value;yield this.saveFormDataWithPartialData({remember:e})})}initializeSelected2faProviderType(){return xr(this,void 0,void 0,function*(){const e=this.platformUtilsService.supportsWebAuthn(this.win);if(this.twoFactorAuthComponentService.shouldCheckForWebAuthnQueryParamResponse()&&e){if(this.activatedRoute.snapshot.paramMap.get("webAuthnResponse"))return qn.R.WebAuthn}return yield this.twoFactorService.getDefaultProvider(e)})}set2faProvidersAndData(){return xr(this,void 0,void 0,function*(){var e;if(this.twoFactorProviders=yield this.twoFactorService.getProviders(),void 0!==this.selectedProviderType){const t=null===(e=this.twoFactorProviders)||void 0===e?void 0:e.get(this.selectedProviderType);this.selectedProviderData=t}})}listenForAuthnSessionTimeout(){this.loginStrategyService.authenticationSessionTimeout$.pipe((0,f.pQ)(this.destroyRef)).subscribe(e=>xr(this,void 0,void 0,function*(){if(e)try{yield this.router.navigate([this.authenticationSessionTimeoutRoute])}catch(t){this.logService.error(`Failed to navigate to ${this.authenticationSessionTimeoutRoute} route`,t)}}))}selectOtherTwoFactorMethod(){return xr(this,void 0,void 0,function*(){const e=Pr.open(this.dialogService),t=yield(0,jn.s)(e.closed);if(null!=t&&"string"!=typeof t){const e=yield this.twoFactorService.getProviders().then(e=>null==e?void 0:e.get(t.type));this.selectedProviderData=e,this.selectedProviderType=t.type,yield this.setAnonLayoutDataByTwoFactorProviderType(),this.twoFactorAuthComponentCacheService.cacheData({token:"",remember:!1,selectedProviderType:t.type}),this.form.reset(),this.form.updateValueAndValidity()}})}launchDuo(){return xr(this,void 0,void 0,function*(){null!=this.duoComponent&&void 0!==this.duoLaunchAction&&(yield this.duoComponent.launchDuoFrameless(this.duoLaunchAction))})}handleMigrateEncryptionKey(e){return xr(this,void 0,void 0,function*(){return!!e.requiresEncryptionKeyMigration&&(this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("legacyEncryptionUnsupported")}),!0)})}setAnonLayoutDataByTwoFactorProviderType(){return xr(this,void 0,void 0,function*(){switch(this.selectedProviderType){case qn.R.Authenticator:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("enterTheCodeFromYourAuthenticatorApp"),pageIcon:Vn.m});break;case qn.R.Email:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("enterTheCodeSentToYourEmail"),pageIcon:Bn.f});break;case qn.R.Duo:case qn.R.OrganizationDuo:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("duoTwoFactorRequiredPageSubtitle"),pageIcon:zn});break;case qn.R.Yubikey:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("pressYourYubiKeyToAuthenticate"),pageIcon:Ln.s});break;case qn.R.WebAuthn:this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:this.i18nService.t("followTheStepsBelowToFinishLoggingInWithSecurityKey"),pageIcon:Kn.R});break;default:this.logService.error("setAnonLayoutDataByTwoFactorProviderType: Unhandled 2FA provider type",this.selectedProviderType)}})}handleAuthResult(e){return xr(this,void 0,void 0,function*(){var t,i,n,r,s;if(this.twoFactorAuthComponentCacheService.clearCachedData(),yield this.handleMigrateEncryptionKey(e))return;if(yield this.loginSuccessHandlerService.run(e.userId,e.masterPassword),void 0!==this.orgSsoIdentifier){const e=null===(t=yield(0,w._)(this.accountService.activeAccount$))||void 0===t?void 0:t.id;yield this.ssoLoginService.setActiveUserOrganizationSsoIdentifier(this.orgSsoIdentifier,e)}if(null!=(yield(0,w._)(this.keyConnectorService.requiresDomainConfirmation$(e.userId))))return void(yield this.router.navigate(["confirm-key-connector-domain"]));const o=yield(0,w._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(e.userId));if(yield this.isTrustedDeviceEncEnabled(o.trustedDeviceOption))return yield this.handleTrustedDeviceEncryptionEnabled(e.userId,o);if(!o.hasMasterPassword&&void 0===o.keyConnectorOption||e.resetMasterPassword)return yield this.handleChangePasswordRequired(this.orgSsoIdentifier);null===(n=(i=this.twoFactorAuthComponentService).reloadOpenWindows)||void 0===n||n.call(i);if(yield null===(s=(r=this.twoFactorAuthComponentService).closeSingleActionPopouts)||void 0===s?void 0:s.call(r))return;const a=yield this.determineDefaultSuccessRoute(e.userId);yield this.router.navigate([a],{queryParams:{identifier:this.orgSsoIdentifier}})})}determineDefaultSuccessRoute(e){return xr(this,void 0,void 0,function*(){if((yield(0,w._)(this.authService.activeAccountStatus$))===at.J.Locked)return"lock";const t=yield(0,w._)(this.masterPasswordService.forceSetPasswordReason$(e));return t===Tn.n.WeakMasterPassword||t===Tn.n.AdminForcePasswordReset?"change-password":"vault"})}isTrustedDeviceEncEnabled(e){return xr(this,void 0,void 0,function*(){return"true"===this.activatedRoute.snapshot.queryParamMap.get("sso")&&void 0!==e})}handleTrustedDeviceEncryptionEnabled(e,t){return xr(this,void 0,void 0,function*(){var i,n,r,s,o,a;!t.hasMasterPassword&&(null===(i=t.trustedDeviceOption)||void 0===i?void 0:i.isTdeOffboarding)?yield this.masterPasswordService.setForceSetPasswordReason(Tn.n.TdeOffboarding,e):!t.hasMasterPassword&&(null===(n=t.trustedDeviceOption)||void 0===n?void 0:n.hasManageResetPasswordPermission)&&(yield this.masterPasswordService.setForceSetPasswordReason(Tn.n.TdeUserWithoutPasswordHasPasswordResetPermission,e)),null===(s=(r=this.twoFactorAuthComponentService).reloadOpenWindows)||void 0===s||s.call(r);(yield null===(a=(o=this.twoFactorAuthComponentService).closeSingleActionPopouts)||void 0===a?void 0:a.call(o))||(yield this.router.navigate(["login-initiated"]))})}handleChangePasswordRequired(e){return xr(this,void 0,void 0,function*(){yield this.router.navigate(["set-initial-password"],{queryParams:{identifier:e}})})}showContinueButton(){return null!=this.selectedProviderType&&this.selectedProviderType!==qn.R.WebAuthn&&this.selectedProviderType!==qn.R.Duo&&this.selectedProviderType!==qn.R.OrganizationDuo}hideRememberMe(){return(this.selectedProviderType===qn.R.Duo||this.selectedProviderType===qn.R.OrganizationDuo)&&this.duoLaunchAction===xn.SINGLE_ACTION_POPOUT||this.selectedProviderType===qn.R.WebAuthn&&this.webAuthInNewTab}use2faRecoveryCode(){return xr(this,void 0,void 0,function*(){const e=(yield(0,w._)(this.environmentService.environment$)).getWebVaultUrl();this.platformUtilsService.launchUri(e+"/#/recover-2fa")})}handleEnterKeyPress(){return xr(this,void 0,void 0,function*(){var e,t;switch(this.selectedProviderType){case qn.R.Authenticator:case qn.R.Email:null===(t=null===(e=this.continueButton)||void 0===e?void 0:e.nativeElement)||void 0===t||t.click();break;case qn.R.Duo:case qn.R.OrganizationDuo:case qn.R.WebAuthn:case qn.R.Yubikey:break;default:this.logService.error("handleEnterKeyPress: Unhandled 2FA provider type",this.selectedProviderType)}})}ngOnDestroy(){return xr(this,void 0,void 0,function*(){var e,t;null===(t=(e=this.twoFactorAuthComponentService).removePopupWidthExtension)||void 0===t||t.call(e)})}}_r.ɵfac=function(e){return new(e||_r)(l.rXU(F.sg),l.rXU(L.Ix),l.rXU(H.W),l.rXU(J.y),l.rXU(r.o3),l.rXU(L.nX),l.rXU(A.K),l.rXU(Xn.fz),l.rXU(F.Ym),l.rXU(te._),l.rXU(Rn.O),l.rXU(je.Di),l.rXU(g.ok),l.rXU(Nn.jf),l.rXU(q.f),l.rXU(Un),l.rXU(z.abz),l.rXU(K.f),l.rXU(E.v),l.rXU(F.aJ),l.rXU(mr),l.rXU(gt.u),l.rXU($n.K))},_r.ɵcmp=l.VBU({type:_r,selectors:[["app-two-factor-auth"]],viewQuery:function(e,t){if(1&e&&(l.GBs($r,5,l.aKT),l.GBs(Er,5)),2&e){let e;l.mGM(e=l.lsd())&&(t.continueButton=e.first),l.mGM(e=l.lsd())&&(t.duoComponent=e.first)}},features:[l.Jv_([{provide:mr}])],decls:2,vars:2,consts:[["duoComponent",""],["continueButton",""],[4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],["autocomplete","off",3,"keydown.enter","bitSubmit","formGroup"],[3,"tokenFormControl","tokenChange",4,"ngIf"],[3,"tokenFormControl",4,"ngIf"],[3,"providerData","tokenEmitter",4,"ngIf"],[3,"webAuthnResultEmitter","webAuthnInNewTabEmitter",4,"ngIf"],[1,"tw-flex","tw-flex-col","tw-space-y-3"],["type","submit","buttonType","primary","bitButton","","bitFormButton","",4,"ngIf"],["type","button","buttonType","primary","bitButton","",3,"click",4,"ngIf"],[1,"tw-text-center","tw-mb-0"],["type","button","buttonType","secondary","bitButton","","bitFormButton","",3,"click",4,"ngIf"],["type","button","buttonType","secondary","bitButton","","bitFormButton","",3,"click"],[3,"tokenChange","tokenFormControl"],[3,"tokenFormControl"],[3,"tokenEmitter","providerData"],["type","checkbox","bitCheckbox","","formControlName","remember",3,"change"],[3,"webAuthnResultEmitter","webAuthnInNewTabEmitter"],["bitTypography","body1"],["type","submit","buttonType","primary","bitButton","","bitFormButton",""],["type","button","buttonType","primary","bitButton","",3,"click"]],template:function(e,t){1&e&&l.DNE(0,Ar,3,0,"ng-container",2)(1,qr,20,18,"ng-container",2),2&e&&(l.Y8G("ngIf",t.loading),l.R7$(),l.Y8G("ngIf",!t.loading))},dependencies:[v.MD,v.bT,n.p,g.X1,g.qT,g.Zm,g.BC,g.cb,g.j4,g.JD,j.L,se.f,oe.j,U.C,ie.$,ne.L,G.q,re.P,o.t,c.Q,Yn,nr,Jn,hr,ur,h.$],encapsulation:2});var Xr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Yr=(e,t)=>Xr(void 0,void 0,void 0,function*(){const e=(0,z.WQX)(F.sg),t=(0,z.WQX)(Xn.fz),i=(0,z.WQX)(L.Ix),n=null!==(yield(0,w._)(e.currentAuthType$)),r=yield t.getProviders();return!(!n||null==r)||i.createUrlTree(["/login"])});class Hr{shouldOpenWebAuthnInNewTab(){return!1}}var Wr=i(3633),Jr=i(65802);class Zr{}var Qr=i(96331),es=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ts(e,t){if(1&e){const e=l.RV6();l.j41(0,"div",6),l.EFF(1),l.nI1(2,"i18n"),l.k0s(),l.j41(3,"button",7),l.bIt("click",function(){z.eBV(e);const t=l.XpG();return z.Njj(t.goBack())}),l.EFF(4),l.nI1(5,"i18n"),l.k0s()}2&e&&(l.R7$(),l.JRh(l.bMT(2,2,"or")),l.R7$(3),l.SpI(" ",l.bMT(5,4,"back")," "))}class is{constructor(e,t,i,n,r,s,o,a,l,c,d){this.router=e,this.formBuilder=t,this.apiService=i,this.loginStrategyService=n,this.logService=r,this.i18nService=s,this.loginSuccessHandlerService=o,this.accountService=a,this.masterPasswordService=l,this.newDeviceVerificationComponentService=c,this.location=d,this.formGroup=this.formBuilder.group({code:["",{validators:[g.k0.required],updateOn:"change"}]}),this.disableRequestOTP=!1,this.destroy$=new b.B,this.authenticationSessionTimeoutRoute="/authentication-timeout",this.showBackButton=!0,this.submit=()=>es(this,void 0,void 0,function*(){var e,t;const i=this.formGroup.get("code");if(i&&i.value)try{const e=yield this.loginStrategyService.logInNewDeviceVerification(i.value);if(e.requiresTwoFactor)return void(yield this.router.navigate(["/2fa"]));yield this.loginSuccessHandlerService.run(e.userId,e.masterPassword);const t=yield(0,w._)(this.accountService.activeAccount$.pipe(Wr.F6)),n=yield(0,w._)(this.masterPasswordService.forceSetPasswordReason$(t));n===Tn.n.WeakMasterPassword||n===Tn.n.AdminForcePasswordReset?yield this.router.navigate(["/change-password"]):yield this.router.navigate(["/vault"])}catch(n){this.logService.error(n);let r=null!==(t=null===(e=null==n?void 0:n.response)||void 0===e?void 0:e.error_description)&&void 0!==t?t:this.i18nService.t("errorOccurred");r.includes("Invalid New Device OTP")&&(r=this.i18nService.t("invalidVerificationCode")),i.setErrors({serverError:{message:r}}),i.markAsTouched()}})}ngOnInit(){return es(this,void 0,void 0,function*(){this.showBackButton=this.newDeviceVerificationComponentService.showBackButton(),this.loginStrategyService.authenticationSessionTimeout$.pipe((0,I.Q)(this.destroy$)).subscribe(e=>{if(e)try{this.router.navigate([this.authenticationSessionTimeoutRoute])}catch(t){this.logService.error(`Failed to navigate to ${this.authenticationSessionTimeoutRoute} route`,t)}})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}resendOTP(){return es(this,void 0,void 0,function*(){this.disableRequestOTP=!0;try{const e=yield this.loginStrategyService.getEmail(),t=yield this.loginStrategyService.getMasterPasswordHash();if(!e||!t)throw new Error("Missing email or master password hash");yield this.apiService.send("POST","/accounts/resend-new-device-otp",{email:e,masterPasswordHash:t},!1,!1)}catch(e){this.logService.error(e)}finally{this.disableRequestOTP=!1}})}goBack(){this.location.back()}}is.ɵfac=function(e){return new(e||is)(l.rXU(L.Ix),l.rXU(g.ok),l.rXU(Ne.G),l.rXU(Jr.s),l.rXU(A.K),l.rXU(H.W),l.rXU(F.aJ),l.rXU(je.Di),l.rXU(Rn.L),l.rXU(Zr),l.rXU(Qr.aZ))},is.ɵcmp=l.VBU({type:is,selectors:[["app-new-device-verification"]],decls:14,vars:15,consts:[[3,"formGroup","bitSubmit"],[1,"!tw-mb-1"],["bitInput","","type","text","id","verificationCode","name","verificationCode","formControlName","code","appInputVerbatim",""],["bitLink","","type","button","linkType","primary",1,"tw-text-sm",3,"click","disabled"],[1,"tw-grid","tw-gap-3","tw-mt-4"],["bitButton","","bitFormButton","","buttonType","primary","type","submit",3,"block","disabled"],[1,"tw-text-center"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(l.j41(0,"form",0)(1,"bit-form-field",1)(2,"bit-label"),l.EFF(3),l.nI1(4,"i18n"),l.k0s(),l.nrm(5,"input",2),l.k0s(),l.j41(6,"button",3),l.bIt("click",function(){return t.resendOTP()}),l.EFF(7),l.nI1(8,"i18n"),l.k0s(),l.j41(9,"div",4)(10,"button",5),l.EFF(11),l.nI1(12,"i18n"),l.k0s(),l.nVh(13,ts,6,6),l.k0s()()),2&e&&(l.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),l.R7$(3),l.JRh(l.bMT(4,9,"verificationCode")),l.R7$(3),l.Y8G("disabled",t.disableRequestOTP),l.R7$(),l.SpI(" ",l.bMT(8,11,"resendCode")," "),l.R7$(3),l.Y8G("block",!0)("disabled",t.formGroup.invalid),l.R7$(),l.SpI(" ",l.bMT(12,13,"continueLoggingIn")," "),l.R7$(2),l.vxM(t.showBackButton?13:-1))},dependencies:[v.MD,g.X1,g.qT,g.me,g.BC,g.cb,g.j4,g.JD,U.C,ie.$,ne.L,n.p,At.q,o.t,c.Q,j.L,oe.j,ae.J,le.h,N.Q,V.V,he.o,h.$],encapsulation:2});class ns{showBackButton(){return!0}}i(91834)},81387:(e,t,i)=>{"use strict";i.d(t,{$:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.minComplexity=this.getResponseProperty("MinComplexity"),this.minLength=this.getResponseProperty("MinLength"),this.requireUpper=this.getResponseProperty("RequireUpper"),this.requireLower=this.getResponseProperty("RequireLower"),this.requireNumbers=this.getResponseProperty("RequireNumbers"),this.requireSpecial=this.getResponseProperty("RequireSpecial"),this.enforceOnLogin=this.getResponseProperty("EnforceOnLogin")}}},81441:(e,t,i)=>{"use strict";var n;i.d(t,{n:()=>n}),function(e){e[e.None=0]="None",e[e.SsoNewJitProvisionedUser=1]="SsoNewJitProvisionedUser",e[e.TdeUserWithoutPasswordHasPasswordResetPermission=2]="TdeUserWithoutPasswordHasPasswordResetPermission",e[e.TdeOffboarding=3]="TdeOffboarding",e[e.TdeOffboardingUntrustedDevice=4]="TdeOffboardingUntrustedDevice",e[e.AdminForcePasswordReset=5]="AdminForcePasswordReset",e[e.WeakMasterPassword=6]="WeakMasterPassword"}(n||(n={}))},81573:(e,t,i)=>{"use strict";i.d(t,{P:()=>l});var n=i(81525),r=i(68016),s=i(21274),o=i(74208),a=i(33812);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.$C({type:l}),l.ɵinj=o.G2t({providers:[s.o3],imports:[n.Ph,r.m,n.Ph]})},81582:(e,t,i)=>{"use strict";i.d(t,{c:()=>n});class n{}},81667:(e,t,i)=>{"use strict";i.d(t,{Je:()=>s,nK:()=>w,EB:()=>S,dc:()=>I,WW:()=>C});var n=i(33812),r=i(74208);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=n.$C({type:s}),s.ɵinj=r.G2t({});var o=i(50545),a=i(12277),l=i(28202);class c{constructor(){this.collections=[]}static fromResponse(e){const t=Object.assign(new c,e);return t.collections=e.collections.map(e=>new l.sK(e)),t}}class d{static fromResponse(e){return Object.assign(new d,e)}}class u{constructor(){this.collections=[],this.users=[]}}class h{constructor(e){this.ids=null==e?[]:e}}var p=i(73409),m=i(20702);class v extends m.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.organizationId=this.getResponseProperty("OrganizationId"),this.name=this.getResponseProperty("Name"),this.externalId=this.getResponseProperty("ExternalId")}}class f extends v{constructor(e){super(e),this.collections=[];const t=this.getResponseProperty("Collections");null!=t&&(this.collections=t.map(e=>new p.U(e)))}}var g=i(12012),y=i(1601),b=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class w{constructor(e,t){this.apiService=e,this.configService=t}get(e,t){return b(this,void 0,void 0,function*(){const i=yield this.apiService.send("GET","/organizations/"+e+"/groups/"+t+"/details",null,!0,!0);return c.fromResponse(new f(i))})}getAll(e){return b(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/groups",null,!0,!0);return new a.s(t,f).data.map(e=>d.fromResponse(e))})}getAllDetails(e){return b(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET","/organizations/"+e+"/groups/details",null,!0,!0);return new a.s(t,f).data.map(e=>c.fromResponse(e))})}}w.ɵfac=function(e){return new(e||w)(r.KVO(g.G),r.KVO(y.w))},w.ɵprov=r.jDH({token:w,factory:w.ɵfac,providedIn:"root"});class S extends w{constructor(e,t){super(e,t),this.apiService=e,this.configService=t}delete(e,t){return b(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/organizations/"+e+"/groups/"+t,null,!0,!1)})}deleteMany(e,t){return b(this,void 0,void 0,function*(){yield this.apiService.send("DELETE","/organizations/"+e+"/groups",new h(t),!0,!0)})}save(e){return b(this,void 0,void 0,function*(){const t=new u;return t.name=e.name,t.users=e.members,t.collections=e.collections.map(e=>new o.I(e.id,e.readOnly,e.hidePasswords,e.manage)),null==e.id?yield this.postGroup(e.organizationId,t):yield this.putGroup(e.organizationId,e.id,t)})}postGroup(e,t){return b(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/organizations/"+e+"/groups",t,!0,!0);return d.fromResponse(new v(i))})}putGroup(e,t,i){return b(this,void 0,void 0,function*(){const n=yield this.apiService.send("PUT","/organizations/"+e+"/groups/"+t,i,!0,!0);return d.fromResponse(new v(n))})}}S.ɵfac=function(e){return new(e||S)(r.KVO(g.G),r.KVO(y.w))},S.ɵprov=r.jDH({token:S,factory:S.ɵfac,providedIn:s});class I{constructor(){this.collections=[],this.groups=[]}static fromResponse(e,t){const i=new I;return i.id=t.id,i.organizationId=e,i.userId=t.userId,i.type=t.type,i.status=t.status,i.externalId=t.externalId,i.ssoExternalId=t.ssoExternalId,i.permissions=t.permissions,i.resetPasswordEnrolled=t.resetPasswordEnrolled,i.collections=t.collections.map(e=>({id:e.id,hidePasswords:e.hidePasswords,readOnly:e.readOnly,manage:e.manage})),i.groups=t.groups,i.accessSecretsManager=t.accessSecretsManager,i.hasMasterPassword=t.hasMasterPassword,i.managedByOrganization=t.managedByOrganization,i}}var k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(e){this.organizationUserApiService=e}get(e,t){return k(this,void 0,void 0,function*(){const i=yield this.organizationUserApiService.getOrganizationUser(e,t,{includeGroups:!0});if(null!=i)return I.fromResponse(e,i)})}save(e){return k(this,void 0,void 0,function*(){const t=new l.$3;t.permissions=e.permissions,t.type=e.type,t.collections=e.collections,t.groups=e.groups,t.accessSecretsManager=e.accessSecretsManager,yield this.organizationUserApiService.putOrganizationUser(e.organizationId,e.id,t)})}invite(e,t){return k(this,void 0,void 0,function*(){const i=new l.JS;i.emails=e,i.permissions=t.permissions,i.type=t.type,i.collections=t.collections,i.groups=t.groups,i.accessSecretsManager=t.accessSecretsManager,yield this.organizationUserApiService.postOrganizationUserInvite(t.organizationId,i)})}}C.ɵfac=function(e){return new(e||C)(r.KVO(l.uB))},C.ɵprov=r.jDH({token:C,factory:C.ɵfac,providedIn:s});i(65551)},81740:(e,t,i)=>{"use strict";i.d(t,{P:()=>l});var n=i(24137),r=i(1463),s=i(41607),o=i(74208),a=i(33812);class l{}l.ɵfac=function(e){return new(e||l)},l.ɵmod=a.$C({type:l}),l.ɵinj=o.G2t({imports:[r.s,s.y,n.f]})},82468:(e,t,i)=>{"use strict";var n;i.d(t,{TO:()=>n,Y6:()=>o}),function(e){e.CreateDefaultLocation="pm-19467-create-default-location",e.AutoConfirm="pm-19934-auto-confirm-organization-users",e.BlockClaimedDomainAccountCreation="pm-28297-block-uninvited-claimed-domain-registration",e.IncreaseBulkReinviteLimitForCloud="pm-28251-increase-bulk-reinvite-limit-for-cloud",e.PM23801_PrefetchPasswordPrelogin="pm-23801-prefetch-password-prelogin",e.MacOsNativeCredentialSync="macos-native-credential-sync",e.WindowsDesktopAutotype="windows-desktop-autotype",e.TrialPaymentOptional="PM-8163-trial-payment",e.PM22415_TaxIDWarnings="pm-22415-tax-id-warnings",e.PM24032_NewNavigationPremiumUpgradeButton="pm-24032-new-navigation-premium-upgrade-button",e.PM25379_UseNewOrganizationMetadataStructure="pm-25379-use-new-organization-metadata-structure",e.PM24996_ImplementUpgradeFromFreeDialog="pm-24996-implement-upgrade-from-free-dialog",e.PM24033PremiumUpgradeNewDesign="pm-24033-updat-premium-subscription-page",e.PM26793_FetchPremiumPriceFromPricingService="pm-26793-fetch-premium-price-from-pricing-service",e.PM23713_PremiumBadgeOpensNewPremiumUpgradeDialog="pm-23713-premium-badge-opens-new-premium-upgrade-dialog",e.PM26462_Milestone_3="pm-26462-milestone-3",e.PM23341_Milestone_2="pm-23341-milestone-2",e.PrivateKeyRegeneration="pm-12241-private-key-regeneration",e.EnrollAeadOnKeyRotation="enroll-aead-on-key-rotation",e.ForceUpdateKDFSettings="pm-18021-force-update-kdf-settings",e.PM25174_DisableType0Decryption="pm-25174-disable-type-0-decryption",e.LinuxBiometricsV2="pm-26340-linux-biometrics-v2",e.UnlockWithMasterPasswordUnlockData="pm-23246-unlock-with-master-password-unlock-data",e.NoLogoutOnKdfChange="pm-23995-no-logout-on-kdf-change",e.DataRecoveryTool="pm-28813-data-recovery-tool",e.ConsolidatedSessionTimeoutComponent="pm-26056-consolidated-session-timeout-component",e.DesktopSendUIRefresh="desktop-send-ui-refresh",e.UseSdkPasswordGenerators="pm-19976-use-sdk-password-generators",e.ChromiumImporterWithABE="pm-25855-chromium-importer-abe",e.EventManagementForDataDogAndCrowdStrike="event-management-for-datadog-and-crowdstrike",e.PhishingDetection="phishing-detection",e.PM22887_RiskInsightsActivityTab="pm-22887-risk-insights-activity-tab",e.PM19941MigrateCipherDomainToSdk="pm-19941-migrate-cipher-domain-to-sdk",e.PM22134SdkCipherListView="pm-22134-sdk-cipher-list-view",e.PM22136_SdkCipherEncryption="pm-22136-sdk-cipher-encryption",e.CipherKeyEncryption="cipher-key-encryption",e.AutofillConfirmation="pm-25083-autofill-confirm-from-search",e.RiskInsightsForPremium="pm-23904-risk-insights-for-premium",e.VaultLoadingSkeletons="pm-25081-vault-skeleton-loaders",e.BrowserPremiumSpotlight="pm-23384-browser-premium-spotlight",e.MigrateMyVaultToMyItems="pm-20558-migrate-myvault-to-myitems",e.IpcChannelFramework="ipc-channel-framework",e.InactiveUserServerNotification="pm-25130-receive-push-notifications-for-inactive-users",e.PushNotificationsWhenLocked="pm-19388-push-notifications-when-locked",e.PM19148_InnovationArchive="pm-19148-innovation-archive",e.DesktopUiMigrationMilestone1="desktop-ui-migration-milestone-1",e.RouterFocusManagement="router-focus-management"}(n||(n={}));const r=!1,s={[n.CreateDefaultLocation]:r,[n.AutoConfirm]:r,[n.BlockClaimedDomainAccountCreation]:r,[n.IncreaseBulkReinviteLimitForCloud]:r,[n.MacOsNativeCredentialSync]:r,[n.WindowsDesktopAutotype]:r,[n.DesktopSendUIRefresh]:r,[n.UseSdkPasswordGenerators]:r,[n.ChromiumImporterWithABE]:r,[n.EventManagementForDataDogAndCrowdStrike]:r,[n.PhishingDetection]:r,[n.PM22887_RiskInsightsActivityTab]:r,[n.CipherKeyEncryption]:r,[n.PM19941MigrateCipherDomainToSdk]:r,[n.PM22134SdkCipherListView]:r,[n.PM22136_SdkCipherEncryption]:r,[n.AutofillConfirmation]:r,[n.RiskInsightsForPremium]:r,[n.VaultLoadingSkeletons]:r,[n.BrowserPremiumSpotlight]:r,[n.MigrateMyVaultToMyItems]:r,[n.PM23801_PrefetchPasswordPrelogin]:r,[n.TrialPaymentOptional]:r,[n.PM22415_TaxIDWarnings]:r,[n.PM24032_NewNavigationPremiumUpgradeButton]:r,[n.PM25379_UseNewOrganizationMetadataStructure]:r,[n.PM24996_ImplementUpgradeFromFreeDialog]:r,[n.PM24033PremiumUpgradeNewDesign]:r,[n.PM26793_FetchPremiumPriceFromPricingService]:r,[n.PM23713_PremiumBadgeOpensNewPremiumUpgradeDialog]:r,[n.PM26462_Milestone_3]:r,[n.PM23341_Milestone_2]:r,[n.PrivateKeyRegeneration]:r,[n.EnrollAeadOnKeyRotation]:r,[n.ForceUpdateKDFSettings]:r,[n.PM25174_DisableType0Decryption]:r,[n.LinuxBiometricsV2]:r,[n.UnlockWithMasterPasswordUnlockData]:r,[n.NoLogoutOnKdfChange]:r,[n.DataRecoveryTool]:r,[n.ConsolidatedSessionTimeoutComponent]:r,[n.IpcChannelFramework]:r,[n.InactiveUserServerNotification]:r,[n.PushNotificationsWhenLocked]:r,[n.PM19148_InnovationArchive]:r,[n.DesktopUiMigrationMilestone1]:r,[n.RouterFocusManagement]:r};function o(e,t){return null==(null==e?void 0:e.featureStates)||null==e.featureStates[t]?s[t]:e.featureStates[t]}},82489:(e,t,i)=>{"use strict";i.d(t,{x:()=>s});var n=i(20702),r=i(81387);class s extends n.r{constructor(e){super(e),this.twoFactorProviders=this.getResponseProperty("TwoFactorProviders"),this.twoFactorProviders2=this.getResponseProperty("TwoFactorProviders2"),this.masterPasswordPolicy=new r.$(this.getResponseProperty("MasterPasswordPolicy")),this.ssoEmail2faSessionToken=this.getResponseProperty("SsoEmail2faSessionToken"),this.email=this.getResponseProperty("Email")}}},82522:(e,t,i)=>{"use strict";i.d(t,{r:()=>v,fA:()=>f.fA,L0:()=>f.L0,aI:()=>f.aI,oE:()=>f.oE,Ew:()=>f.Ew,hV:()=>f.hV,u3:()=>f.u3});var n=i(25065),r=i(20183),s=i(33812),o=i(74208);class a{}a.ɵfac=function(e){return new(e||a)},a.ɵmod=s.$C({type:a}),a.ɵinj=o.G2t({providers:[r.A],imports:[n.G]});var l=i(81285),c=i(5864),d=i(29730);class u{}u.ɵfac=function(e){return new(e||u)},u.ɵmod=s.$C({type:u}),u.ɵinj=o.G2t({providers:[d.y,c.Q]});var h=i(65071),p=i(75441);class m{}m.ɵfac=function(e){return new(e||m)},m.ɵmod=s.$C({type:m}),m.ɵinj=o.G2t({imports:[n.G,p.L,h.S,l.Rz,u]});class v{}v.ɵfac=function(e){return new(e||v)},v.ɵmod=s.$C({type:v}),v.ɵinj=o.G2t({imports:[m,a,m]});var f=i(38420)},82696:(e,t,i)=>{"use strict";i.d(t,{j:()=>n});class n{constructor(e){null!=e&&(this.title=e.title,this.firstName=e.firstName,this.middleName=e.middleName,this.lastName=e.lastName,this.address1=e.address1,this.address2=e.address2,this.address3=e.address3,this.city=e.city,this.state=e.state,this.postalCode=e.postalCode,this.country=e.country,this.company=e.company,this.email=e.email,this.phone=e.phone,this.ssn=e.ssn,this.username=e.username,this.passportNumber=e.passportNumber,this.licenseNumber=e.licenseNumber)}}},83078:(e,t,i)=>{"use strict";i.d(t,{B:()=>n});class n{}},83234:(e,t,i)=>{"use strict";i.d(t,{T2:()=>c,oO:()=>a});var n=i(3204),r=i(68467),s=i(31857),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a{}const l=new s.Zs(s.dD,"selection",{deserializer:e=>e});class c{constructor(e,t=r.NJ.System){this.globalStateProvider=e,this.defaultTheme=t,this.selectedThemeState=this.globalStateProvider.get(l),this.selectedTheme$=this.selectedThemeState.state$.pipe((0,n.T)(e=>null==e||Object.values(r.NJ).includes(e)?e:null),(0,n.T)(e=>null!=e?e:this.defaultTheme))}setSelectedTheme(e){return o(this,void 0,void 0,function*(){yield this.selectedThemeState.update(()=>e,{shouldUpdate:t=>t!==e})})}}},83516:(e,t,i)=>{"use strict";i.d(t,{U:()=>n.D$});var n=i(5819)},83541:(e,t,i)=>{"use strict";i.d(t,{L:()=>n,O:()=>r});class n{}class r extends n{}},83586:(e,t,i)=>{"use strict";i.d(t,{qi:()=>c,wP:()=>o,aH:()=>s,Dt:()=>a});var n=i(2738),r=i(78991);const s=Object.freeze({file:"file",chromium:"chromium",ipc:"ipc",download:"download"}),o=Object.freeze({unique:"unique",chromium:"chromium"}),a=(0,r.ol)({[s.chromium]:[n.s.Desktop],[s.download]:[n.s.Browser],[s.file]:[n.s.Browser,n.s.Desktop,n.s.Web,n.s.Cli],[s.ipc]:[]}),l=[{id:"bitwardenjson",loaders:[s.file],instructions:o.unique},{id:"chromecsv",loaders:[s.file],instructions:o.chromium},{id:"operacsv",loaders:[s.file],instructions:o.chromium},{id:"vivaldicsv",loaders:[s.file],instructions:o.chromium},{id:"bravecsv",loaders:[s.file],instructions:o.chromium},{id:"edgecsv",loaders:[s.file],instructions:o.chromium}],c=(0,r.ol)(Object.fromEntries(l.map(e=>[e.id,e])))},83632:(e,t,i)=>{"use strict";i.d(t,{t:()=>c});var n=i(77468),r=i(94573),s=i(74208),o=i(33812),a=i(50700);function l(e,t){if(1&e&&(o.j41(0,"span",4),o.EFF(1),o.k0s()),2&e){const e=o.XpG();o.R7$(),o.JRh(e.title)}}class c{get classList(){return["tw-inline-block","tw-overflow-hidden","tw-flex","tw-items-center"].concat(this.sizeClass).concat([this.noColor?"":"tw-text-primary-600"])}constructor(e){this.i18nService=e,this.size="large",this.noColor=!1,this.title=this.i18nService.t("loading"),this.sr=!0}get sizeClass(){switch(this.size){case"small":return["tw-h-4"];case"large":return["tw-h-16"];default:return["tw-h-full","tw-w-full"]}}}c.ɵfac=function(e){return new(e||c)(o.rXU(a.W))},c.ɵcmp=o.VBU({type:c,selectors:[["bit-spinner"]],hostVars:2,hostBindings:function(e,t){2&e&&o.HbH(t.classList)},inputs:{size:"size",noColor:[2,"noColor","noColor",r.L39],title:"title",sr:[2,"sr","sr",r.L39]},decls:4,vars:1,consts:[["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 56 56","fill","none","aria-hidden","true",1,"tw-size-full","tw-animate-spin"],["cx","28","cy","28","r","23","pathLength","4","stroke-width","5","stroke-dasharray","1 3","stroke-linecap","round",1,"tw-stroke-primary-600"],["cx","28","cy","28","r","23","stroke-width","5","opacity","0.4",1,"tw-stroke-primary-600"],["class","tw-sr-only",4,"ngIf"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(s.qSk(),o.j41(0,"svg",0),o.nrm(1,"circle",1)(2,"circle",2),o.k0s(),o.DNE(3,l,2,1,"span",3)),2&e&&(o.R7$(3),o.Y8G("ngIf",t.sr))},dependencies:[n.MD,n.bT],encapsulation:2})},83691:(e,t,i)=>{"use strict";i.d(t,{E:()=>o});var n=i(38140),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.X]})},83724:(e,t,i)=>{"use strict";i.d(t,{_:()=>c});var n=i(11573),r=i(56962),s=i(83516),o=i(74208),a=i(50700),l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class c{constructor(e,t,i){this.i18nService=e,this.messagingService=t,this.logService=i,this.browserCache=null}getDevice(){return null!=this.browserCache||(-1!==navigator.userAgent.indexOf(" Firefox/")||-1!==navigator.userAgent.indexOf(" Gecko/")?this.browserCache=n.bq.FirefoxBrowser:navigator.userAgent.indexOf(" OPR/")>=0?this.browserCache=n.bq.OperaBrowser:-1!==navigator.userAgent.indexOf(" Edg/")?this.browserCache=n.bq.EdgeBrowser:-1!==navigator.userAgent.indexOf(" Vivaldi/")?this.browserCache=n.bq.VivaldiBrowser:-1!==navigator.userAgent.indexOf("Ddg")?this.browserCache=n.bq.DuckDuckGoBrowser:-1!==navigator.userAgent.indexOf(" Safari/")&&-1===navigator.userAgent.indexOf("Chrome")?this.browserCache=n.bq.SafariBrowser:window.chrome&&-1!==navigator.userAgent.indexOf(" Chrome/")?this.browserCache=n.bq.ChromeBrowser:-1!==navigator.userAgent.indexOf(" Trident/")?this.browserCache=n.bq.IEBrowser:this.browserCache=n.bq.UnknownBrowser),this.browserCache}getDeviceString(){return n.bq[this.getDevice()].toLowerCase().replace("browser","")}getClientType(){return n.sK.Web}isFirefox(){return this.getDevice()===n.bq.FirefoxBrowser}isChrome(){return this.getDevice()===n.bq.ChromeBrowser}isEdge(){return this.getDevice()===n.bq.EdgeBrowser}isOpera(){return this.getDevice()===n.bq.OperaBrowser}isVivaldi(){return this.getDevice()===n.bq.VivaldiBrowser}isSafari(){return this.getDevice()===n.bq.SafariBrowser}isChromium(){return this.isChrome()||this.isEdge()||this.isOpera()||this.isVivaldi()}isWebKit(){return!0}isMacAppStore(){return!1}isPopupOpen(){return Promise.resolve(!1)}launchUri(e,t){const i=document.createElement("a");i.href=e,null!=t&&t.sameWindow||(i.target="_blank",i.rel="noreferrer noopener"),i.classList.add("d-none"),document.body.appendChild(i),i.click(),document.body.removeChild(i)}getApplicationVersion(){return Promise.resolve("2025.12.1")}getApplicationVersionNumber(){return l(this,void 0,void 0,function*(){return(yield this.getApplicationVersion()).split(RegExp("[+|-]"))[0].trim()})}supportsWebAuthn(e){return"undefined"!=typeof PublicKeyCredential}supportsDuo(){return!0}supportsAutofill(){return!1}supportsFileDownloads(){return!(this.getDevice()===n.bq.SafariBrowser)}showToast(e,t,i,n){this.messagingService.send("showToast",{text:i,title:t,type:e,options:n})}isDev(){return!1}isSelfHost(){return!0}static isSelfHost(){return!0}copyToClipboard(e,t){let i=window,n=window.document;if(t&&(t.window||t.win)?(i=t.window||t.win,n=i.document):t&&t.doc&&(n=t.doc),n.queryCommandSupported&&n.queryCommandSupported("copy")){const t=n.createElement("textarea");t.textContent=e,t.style.position="fixed";let i=n.body;n.body.classList.contains("modal-open")&&(i=n.body.querySelector(".modal")),i.appendChild(t),t.select();let s=!1;try{s=n.execCommand("copy"),s||this.logService.debug("Copy command unsupported or disabled.")}catch(r){console.warn("Copy to clipboard failed.",r)}finally{i.removeChild(t)}return s}}readFromClipboard(e){throw new Error("Cannot read from clipboard on web.")}supportsSecureStorage(){return!1}getAutofillKeyboardShortcut(){return null}packageType(){return null}}c.ɵfac=function(e){return new(e||c)(o.KVO(a.W),o.KVO(s.U),o.KVO(r.K))},c.ɵprov=o.jDH({token:c,factory:c.ɵfac})},84101:(e,t,i)=>{"use strict";i.d(t,{t:()=>n});class n{}},84110:(e,t,i)=>{"use strict";var n;i.d(t,{J:()=>n}),function(e){e[e.LoggedOut=0]="LoggedOut",e[e.Locked=1]="Locked",e[e.Unlocked=2]="Unlocked"}(n||(n={}))},84175:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{constructor(e,t,i,n){this.children=[],this.parent=t,this.node=e,i&&(this.node.name=i),n&&(this.node.id=n)}}},84274:(e,t,i)=>{"use strict";i.d(t,{v:()=>a});var n=i(39306),r=i(17989),s=i(78078),o=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class a extends r.A{constructor(e){super(),null!=e&&(this.buildDomainModel(this,e,{id:null,name:null},["id"]),this.revisionDate=null!=e.revisionDate?new Date(e.revisionDate):null)}decrypt(e){return this.decryptObj(this,new s.u(this),["name"],e)}decryptWithKey(e,t){return o(this,void 0,void 0,function*(){const i=new s.u;i.id=this.id,i.revisionDate=this.revisionDate;try{i.name=yield t.decryptString(this.name,e)}catch(n){throw console.error("[Folder] Error decrypting folder",n),n}return i})}static fromJSON(e){const t=null==e.revisionDate?null:new Date(e.revisionDate);return Object.assign(new a,e,{name:n.k.fromJSON(e.name),revisionDate:t})}}},84431:(e,t,i)=>{"use strict";i.d(t,{d:()=>F});var n=i(51757),r=i(49272),s=i(81525),o=i(50866),a=i(25065),l=i(33812),c=i(69855),d=i(21274),u=i(12012),h=i(50700),p=i(37115),m=i(62166),v=i(23649),f=i(26657),g=i(45154),y=i(56898),b=i(44432),w=i(7730),S=i(68016),I=i(58806),k=i(7855),C=i(88016),T=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class F{constructor(e,t,i,r,s,o,a,l,c){this.data=e,this.dialogRef=t,this.apiService=i,this.i18nService=r,this.platformUtilsService=s,this.userVerificationService=o,this.router=a,this.syncService=l,this.toastService=c,this.organizationId=null,this.formGroup=new n.gE({masterPassword:new n.MJ(null)}),this.submit=()=>T(this,void 0,void 0,function*(){const e=this.userVerificationService.buildRequest(this.formGroup.value.masterPassword).then(e=>this.apiService.postPurgeCiphers(e,this.organizationId));yield e,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("vaultPurged")}),yield this.syncService.fullSync(!0),null!=this.organizationId?yield this.router.navigate(["organizations",this.organizationId,"vault"]):yield this.router.navigate(["vault"]),this.dialogRef.close()}),this.organizationId=e&&e.organizationId?e.organizationId:null}static open(e,t){return e.open(F,t)}}F.ɵfac=function(e){return new(e||F)(l.rXU(s.Qs),l.rXU(d.ce),l.rXU(u.G),l.rXU(h.W),l.rXU(p.y),l.rXU(m.i),l.rXU(v.Ix),l.rXU(r.H),l.rXU(c.f))},F.ɵcmp=l.VBU({type:F,selectors:[["ng-component"]],decls:18,vars:17,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1"],["type","warning"],["formControlName","masterPassword"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(l.j41(0,"form",0)(1,"bit-dialog",1),l.nI1(2,"i18n"),l.qex(3,2),l.j41(4,"p",3),l.EFF(5),l.nI1(6,"i18n"),l.k0s(),l.j41(7,"bit-callout",4),l.EFF(8),l.nI1(9,"i18n"),l.k0s(),l.nrm(10,"app-user-verification",5),l.bVm(),l.qex(11,6),l.j41(12,"button",7),l.EFF(13),l.nI1(14,"i18n"),l.k0s(),l.j41(15,"button",8),l.EFF(16),l.nI1(17,"i18n"),l.k0s(),l.bVm(),l.k0s()()),2&e&&(l.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),l.R7$(),l.Y8G("title",l.bMT(2,7,"purgeVault")),l.R7$(4),l.SpI(" ",l.bMT(6,9,t.organizationId?"purgeOrgVaultDesc":"purgeVaultDesc")," "),l.R7$(3),l.JRh(l.bMT(9,11,"purgeVaultWarning")),l.R7$(5),l.SpI(" ",l.bMT(14,13,"purgeVault")," "),l.R7$(3),l.SpI(" ",l.bMT(17,15,"close")," "))},dependencies:[a.G,n.qT,n.BC,n.cb,n.j4,n.JD,f.$,g.L,y.Q,b.G,w.I,S.m,I.r,o.R6,k.q,C.$],encapsulation:2})},84454:(e,t,i)=>{"use strict";i.d(t,{U:()=>c});var n=i(39306),r=i(17989),s=i(24072),o=i(69886),a=i(65918),l=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class c extends r.A{constructor(e){super(),null!=e?(this.credentialId=new n.k(e.credentialId),this.keyType=new n.k(e.keyType),this.keyAlgorithm=new n.k(e.keyAlgorithm),this.keyCurve=new n.k(e.keyCurve),this.keyValue=new n.k(e.keyValue),this.rpId=new n.k(e.rpId),this.counter=new n.k(e.counter),this.discoverable=new n.k(e.discoverable),this.userHandle=(0,s.e)(e.userHandle),this.userName=(0,s.e)(e.userName),this.rpName=(0,s.e)(e.rpName),this.userDisplayName=(0,s.e)(e.userDisplayName),this.creationDate=new Date(e.creationDate)):this.creationDate=new Date}decrypt(e){return l(this,void 0,void 0,function*(){const t=yield this.decryptObj(this,new a.X,["credentialId","keyType","keyAlgorithm","keyCurve","keyValue","rpId","userHandle","userName","rpName","userDisplayName"],e),{counter:i}=yield this.decryptObj(this,{counter:""},["counter"],e);t.counter=parseInt(i);const{discoverable:n}=yield this.decryptObj(this,{discoverable:""},["discoverable"],e);return t.discoverable="true"===n,t.creationDate=this.creationDate,t})}toFido2CredentialData(){const e=new o.w;return e.creationDate=this.creationDate.toISOString(),this.buildDataModel(this,e,{credentialId:null,keyType:null,keyAlgorithm:null,keyCurve:null,keyValue:null,rpId:null,userHandle:null,userName:null,counter:null,rpName:null,userDisplayName:null,discoverable:null}),e}static fromJSON(e){if(null==e)return;const t=new c;return t.credentialId=n.k.fromJSON(e.credentialId),t.keyType=n.k.fromJSON(e.keyType),t.keyAlgorithm=n.k.fromJSON(e.keyAlgorithm),t.keyCurve=n.k.fromJSON(e.keyCurve),t.keyValue=n.k.fromJSON(e.keyValue),t.rpId=n.k.fromJSON(e.rpId),t.userHandle=(0,s.u)(e.userHandle),t.userName=(0,s.u)(e.userName),t.counter=n.k.fromJSON(e.counter),t.rpName=(0,s.u)(e.rpName),t.userDisplayName=(0,s.u)(e.userDisplayName),t.discoverable=n.k.fromJSON(e.discoverable),t.creationDate=new Date(e.creationDate),t}toSdkFido2Credential(){var e,t,i,n,r,s;return{credentialId:null===(e=this.credentialId)||void 0===e?void 0:e.toSdk(),keyType:this.keyType.toSdk(),keyAlgorithm:this.keyAlgorithm.toSdk(),keyCurve:this.keyCurve.toSdk(),keyValue:this.keyValue.toSdk(),rpId:this.rpId.toSdk(),userHandle:null===(t=this.userHandle)||void 0===t?void 0:t.toSdk(),userName:null===(i=this.userName)||void 0===i?void 0:i.toSdk(),counter:this.counter.toSdk(),rpName:null===(n=this.rpName)||void 0===n?void 0:n.toSdk(),userDisplayName:null===(r=this.userDisplayName)||void 0===r?void 0:r.toSdk(),discoverable:null===(s=this.discoverable)||void 0===s?void 0:s.toSdk(),creationDate:this.creationDate.toISOString()}}static fromSdkFido2Credential(e){if(null==e)return;const t=new c;return t.credentialId=n.k.fromJSON(e.credentialId),t.keyType=n.k.fromJSON(e.keyType),t.keyAlgorithm=n.k.fromJSON(e.keyAlgorithm),t.keyCurve=n.k.fromJSON(e.keyCurve),t.keyValue=n.k.fromJSON(e.keyValue),t.rpId=n.k.fromJSON(e.rpId),t.counter=n.k.fromJSON(e.counter),t.userHandle=(0,s.u)(e.userHandle),t.userName=(0,s.u)(e.userName),t.rpName=(0,s.u)(e.rpName),t.userDisplayName=(0,s.u)(e.userDisplayName),t.discoverable=n.k.fromJSON(e.discoverable),t.creationDate=new Date(e.creationDate),t}}},84488:(e,t,i)=>{"use strict";i.d(t,{y:()=>s});var n=i(85776),r=(i(88083),i(43978));class s{constructor(e){null!=e&&(this.id=e.id,this.name=e.name,this.status=e.status,this.type=e.type,this.enabled=e.enabled,this.usePolicies=e.usePolicies,this.useGroups=e.useGroups,this.useDirectory=e.useDirectory,this.useEvents=e.useEvents,this.useTotp=e.useTotp,this.use2fa=e.use2fa,this.useApi=e.useApi,this.useSso=e.useSso,this.useOrganizationDomains=e.useOrganizationDomains,this.useKeyConnector=e.useKeyConnector,this.useScim=e.useScim,this.useCustomPermissions=e.useCustomPermissions,this.useResetPassword=e.useResetPassword,this.useSecretsManager=e.useSecretsManager,this.usePasswordManager=e.usePasswordManager,this.useActivateAutofillPolicy=e.useActivateAutofillPolicy,this.useAutomaticUserConfirmation=e.useAutomaticUserConfirmation,this.selfHost=e.selfHost,this.usersGetPremium=e.usersGetPremium,this.seats=e.seats,this.maxCollections=e.maxCollections,this.maxStorageGb=e.maxStorageGb,this.ssoBound=e.ssoBound,this.identifier=e.identifier,this.permissions=e.permissions,this.resetPasswordEnrolled=e.resetPasswordEnrolled,this.userId=e.userId,this.organizationUserId=e.organizationUserId,this.hasPublicAndPrivateKeys=e.hasPublicAndPrivateKeys,this.providerId=e.providerId,this.providerName=e.providerName,this.providerType=e.providerType,this.isProviderUser=e.isProviderUser,this.isMember=e.isMember,this.familySponsorshipFriendlyName=e.familySponsorshipFriendlyName,this.familySponsorshipAvailable=e.familySponsorshipAvailable,this.productTierType=e.productTierType,this.keyConnectorEnabled=e.keyConnectorEnabled,this.keyConnectorUrl=e.keyConnectorUrl,this.familySponsorshipLastSyncDate=e.familySponsorshipLastSyncDate,this.familySponsorshipValidUntil=e.familySponsorshipValidUntil,this.familySponsorshipToDelete=e.familySponsorshipToDelete,this.accessSecretsManager=e.accessSecretsManager,this.limitCollectionCreation=e.limitCollectionCreation,this.limitCollectionDeletion=e.limitCollectionDeletion,this.limitItemDeletion=e.limitItemDeletion,this.allowAdminAccessToAllCollectionItems=e.allowAdminAccessToAllCollectionItems,this.userIsManagedByOrganization=e.userIsManagedByOrganization,this.useAccessIntelligence=e.useAccessIntelligence,this.useAdminSponsoredFamilies=e.useAdminSponsoredFamilies,this.isAdminInitiated=e.isAdminInitiated,this.ssoEnabled=e.ssoEnabled,this.ssoMemberDecryptionType=e.ssoMemberDecryptionType,this.usePhishingBlocker=e.usePhishingBlocker)}get canAccess(){return!!this.isOwner||this.enabled&&this.status===r.Zx.Confirmed}get isAdmin(){return this.type===r.D7.Admin||this.isOwner}get isOwner(){return this.type===r.D7.Owner||this.isProviderUser}get canAccessEventLogs(){return(this.isAdmin||this.permissions.accessEventLogs)&&this.useEvents}get canAccessImport(){return this.isProviderUser||this.type===r.D7.Owner||this.type===r.D7.Admin||this.permissions.accessImportExport}get canAccessExport(){return this.isMember&&(this.type===r.D7.Owner||this.type===r.D7.Admin||this.permissions.accessImportExport)}get canAccessReports(){return this.isAdmin||this.permissions.accessReports}get canCreateNewCollections(){return!this.limitCollectionCreation||this.isAdmin||this.permissions.createNewCollections}get canEditAnyCollection(){return this.isProviderUser||this.type===r.D7.Custom&&this.permissions.editAnyCollection||this.allowAdminAccessToAllCollectionItems&&this.isAdmin}get canEditUnmanagedCollections(){return this.isAdmin||this.permissions.editAnyCollection}get canEditUnassignedCiphers(){return this.type===r.D7.Admin||this.type===r.D7.Owner||this.permissions.editAnyCollection}get canEditAllCiphers(){return this.type===r.D7.Custom&&this.permissions.editAnyCollection||this.allowAdminAccessToAllCollectionItems&&(this.type===r.D7.Admin||this.type===r.D7.Owner)}get canDeleteAnyCollection(){return!(!this.isProviderUser&&!this.permissions.deleteAnyCollection)||!!this.allowAdminAccessToAllCollectionItems&&(this.type==r.D7.Owner||this.type==r.D7.Admin)}get canViewAllCollections(){return this.isAdmin||this.permissions.editAnyCollection||this.permissions.deleteAnyCollection}get canManageGroups(){return(this.isAdmin||this.permissions.manageGroups)&&this.useGroups}get canManageSso(){return(this.isAdmin||this.permissions.manageSso)&&this.useSso}get canManageDomainVerification(){return(this.isAdmin||this.permissions.manageSso)&&this.useOrganizationDomains}get canManageScim(){return(this.isAdmin||this.permissions.manageScim)&&this.useScim}get canManagePolicies(){return(this.isAdmin||this.permissions.managePolicies)&&this.usePolicies}get canManageUsers(){return this.isAdmin||this.permissions.manageUsers}get canManageUsersPassword(){return this.isAdmin||this.permissions.manageResetPassword}get canEnableAutoConfirmPolicy(){return(this.canManageUsers||this.canManagePolicies)&&this.useAutomaticUserConfirmation&&!this.isProviderUser}get canManageDeviceApprovals(){return(this.isAdmin||this.permissions.manageResetPassword)&&this.useSso&&this.ssoEnabled&&this.ssoMemberDecryptionType===n.QI.TrustedDeviceEncryption}get isExemptFromPolicies(){return this.canManagePolicies}get canViewSubscription(){return!!this.canEditSubscription||(this.hasBillableProvider?this.isProviderUser:this.isOwner)}get canEditSubscription(){return this.hasProvider?this.isProviderUser:this.isOwner}get canEditPaymentMethods(){return this.canEditSubscription}get canViewBillingHistory(){return this.canEditSubscription}get hasProvider(){return null!=this.providerId||null!=this.providerName}get hasBillableProvider(){return this.hasProvider&&(this.providerType===r.cp.Msp||this.providerType===r.cp.BusinessUnit)}get hasReseller(){return this.hasProvider&&this.providerType===r.cp.Reseller}get canAccessSecretsManager(){return this.useSecretsManager&&this.accessSecretsManager}get isFreeOrg(){return!this.useTotp}get canManageSponsorships(){return this.familySponsorshipAvailable||null!==this.familySponsorshipFriendlyName}static fromJSON(e){return null==e?null:Object.assign(new s,e,{familySponsorshipLastSyncDate:new Date(e.familySponsorshipLastSyncDate),familySponsorshipValidUntil:new Date(e.familySponsorshipValidUntil)})}get canAccessIntegrations(){return!1}get canUseAccessIntelligence(){return!1}}},85037:(e,t,i)=>{"use strict";i.d(t,{y:()=>Y});var n=i(67553),r=i(39488),s=i(31442),o=i(22166),a=i(62819),l=i(77723),c=i(74208),d=i(33812),u=i(5556),h=i(72331),p=i(21274),m=i(35500),v=i(50700),f=i(77468),g=i(26333),y=i(93103),b=i(47428),w=i(47696),S=i(56898),I=i(44432),k=i(10672),C=i(59032),T=i(30930),F=i(38410),R=i(32316),P=i(12694),x=i(16496),$=i(71944),E=i(93748),A=i(88016),D=i(91975),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function M(e,t){1&e&&(d.j41(0,"bit-callout",6),d.nI1(1,"i18n"),d.EFF(2),d.nI1(3,"i18n"),d.k0s()),2&e&&(d.Y8G("title",d.mNQ(d.bMT(1,3,"goodNews"))),d.R7$(2),d.SpI(" ",d.bMT(3,5,"noExposedPasswords")," "))}function U(e,t){if(1&e&&(d.qex(0),d.j41(1,"bit-toggle",18),d.EFF(2),d.j41(3,"span",19),d.EFF(4),d.k0s()(),d.bVm()),2&e){const e=t.$implicit,i=d.XpG(4);d.R7$(),d.Y8G("value",e),d.R7$(),d.SpI(" ",i.getName(e)," "),d.R7$(2),d.SpI(" ",i.getCount(e)," ")}}function G(e,t){if(1&e){const e=d.RV6();d.j41(0,"bit-toggle-group",16),d.nI1(1,"async"),d.nI1(2,"i18n"),d.bIt("selectedChange",function(t){c.eBV(e);const i=d.XpG(3);return c.Njj(i.filterOrgToggle(t))}),d.DNE(3,U,5,3,"ng-container",17),d.k0s()}if(2&e){const e=d.XpG(3);d.Y8G("selected",d.bMT(1,3,e.filterOrgStatus$)),d.BMQ("aria-label",d.bMT(2,5,"addAccessFilter")),d.R7$(3),d.Y8G("ngForOf",e.filterStatus)}}function j(e,t){1&e&&(d.j41(0,"th",20),d.EFF(1),d.nI1(2,"i18n"),d.k0s()),2&e&&(d.R7$(),d.SpI(" ",d.bMT(2,1,"owner")," "))}function N(e,t){if(1&e){const e=d.RV6();d.qex(0),d.j41(1,"a",26),d.nI1(2,"i18n"),d.bIt("click",function(){c.eBV(e);const t=d.XpG().$implicit,i=d.XpG(3);return c.Njj(i.selectCipher(t))}),d.EFF(3),d.k0s(),d.bVm()}if(2&e){const e=d.XpG().$implicit;d.R7$(),d.Y8G("title",d.mNQ(d.i5U(2,3,"editItemWithName",e.name))),d.R7$(2),d.SpI(" ",e.name," ")}}function V(e,t){if(1&e&&(d.j41(0,"span"),d.EFF(1),d.k0s()),2&e){const e=d.XpG().$implicit;d.R7$(),d.JRh(e.name)}}function B(e,t){1&e&&(d.qex(0),d.nrm(1,"i",27),d.nI1(2,"i18n"),d.j41(3,"span",28),d.EFF(4),d.nI1(5,"i18n"),d.k0s(),d.bVm()),2&e&&(d.R7$(),d.Y8G("title",d.mNQ(d.bMT(2,3,"shared"))),d.R7$(3),d.JRh(d.bMT(5,5,"shared")))}function z(e,t){1&e&&(d.qex(0),d.nrm(1,"i",29),d.nI1(2,"i18n"),d.j41(3,"span",28),d.EFF(4),d.nI1(5,"i18n"),d.k0s(),d.bVm()),2&e&&(d.R7$(),d.Y8G("title",d.mNQ(d.bMT(2,3,"attachments"))),d.R7$(3),d.JRh(d.bMT(5,5,"attachments")))}function L(e,t){if(1&e&&(d.nrm(0,"app-org-badge",31),d.nI1(1,"async"),d.nI1(2,"orgNameFromId")),2&e){const e=d.XpG(2).$implicit,t=d.XpG(3);d.Y8G("disabled",t.disabled)("organizationId",e.organizationId)("organizationName",d.i5U(2,5,e.organizationId,d.bMT(1,3,t.organizations$)))}}function K(e,t){if(1&e&&(d.j41(0,"td",11),d.DNE(1,L,3,8,"app-org-badge",30),d.k0s()),2&e){const e=d.XpG(4);d.R7$(),d.Y8G("ngIf",!e.organization)}}function q(e,t){if(1&e&&(d.j41(0,"td",11),d.nrm(1,"app-vault-icon",21),d.k0s(),d.j41(2,"td",11),d.DNE(3,N,4,6,"ng-container",22)(4,V,2,1,"ng-template",null,0,d.C5r)(6,B,6,7,"ng-container",5)(7,z,6,7,"ng-container",5),d.nrm(8,"br"),d.j41(9,"small"),d.EFF(10),d.k0s()(),d.DNE(11,K,2,1,"td",23),d.j41(12,"td",24)(13,"span",25),d.EFF(14),d.nI1(15,"number"),d.nI1(16,"i18n"),d.k0s()()),2&e){const e=t.$implicit,i=d.sdS(5),n=d.XpG(3);d.R7$(),d.Y8G("cipher",e),d.R7$(2),d.Y8G("ngIf",!n.organization||n.canManageCipher(e))("ngIfElse",i),d.R7$(3),d.Y8G("ngIf",!n.organization&&e.organizationId),d.R7$(),d.Y8G("ngIf",e.hasAttachments),d.R7$(3),d.JRh(e.subTitle),d.R7$(),d.Y8G("ngIf",!n.isAdminConsoleActive),d.R7$(3),d.SpI(" ",d.i5U(16,10,"exposedXTimes",d.bMT(15,8,e.exposedXTimes))," ")}}function _(e,t){if(1&e&&(d.qex(0),d.j41(1,"bit-callout",7),d.nI1(2,"i18n"),d.EFF(3),d.nI1(4,"number"),d.nI1(5,"i18n"),d.k0s(),d.DNE(6,G,4,7,"bit-toggle-group",8),d.j41(7,"bit-table-scroll",9),d.qex(8,10),d.nrm(9,"th",11),d.j41(10,"th",12),d.EFF(11),d.nI1(12,"i18n"),d.k0s(),d.DNE(13,j,3,3,"th",13),d.j41(14,"th",14),d.EFF(15),d.nI1(16,"i18n"),d.k0s(),d.bVm(),d.DNE(17,q,17,13,"ng-template",15),d.k0s(),d.bVm()),2&e){const e=d.XpG(2);d.R7$(),d.Y8G("title",d.mNQ(d.bMT(2,10,"exposedPasswordsFound")))("useAlertRole",!0),d.R7$(2),d.SpI(" ",d.brH(5,14,"exposedPasswordsFoundReportDesc",d.bMT(4,12,e.ciphers.length),e.vaultMsg)," "),d.R7$(3),d.Y8G("ngIf",e.showFilterToggle&&!e.isAdminConsoleActive),d.R7$(),d.Y8G("dataSource",e.dataSource)("rowSize",53),d.R7$(4),d.JRh(d.bMT(12,18,"name")),d.R7$(2),d.Y8G("ngIf",!e.isAdminConsoleActive),d.R7$(2),d.SpI(" ",d.bMT(16,20,"timesExposed")," ")}}function X(e,t){if(1&e&&(d.j41(0,"div",3),d.DNE(1,M,4,7,"bit-callout",4)(2,_,18,22,"ng-container",5),d.k0s()),2&e){const e=d.XpG();d.R7$(),d.Y8G("ngIf",!e.ciphers.length),d.R7$(),d.Y8G("ngIf",e.ciphers.length)}}class Y extends l.n{constructor(e,t,i,n,r,s,o,a,l,c){super(e,n,s,i,r,o,a,l,c),this.cipherService=e,this.auditService=t,this.organizationService=i,this.disabled=!0}ngOnInit(){const e=Object.create(null,{load:{get:()=>super.load}});return O(this,void 0,void 0,function*(){yield e.load.call(this)})}setCiphers(){return O(this,void 0,void 0,function*(){const e=yield this.getAllCiphers(),t=[],i=[];this.filterStatus=[0],e.forEach(e=>{const{type:n,login:r,isDeleted:o,edit:a,viewPassword:l}=e;if(n!==s.gC.Login||null==r.password||""===r.password||o||!this.organization&&!a||!l)return;const c=this.isPasswordExposed(e).then(e=>{e&&t.push(e)});i.push(c)}),yield Promise.all(i),this.filterCiphersByOrg(t),this.dataSource.sort={column:"exposedXTimes",direction:"desc"}})}isPasswordExposed(e){return O(this,void 0,void 0,function*(){const{login:t}=e;return null==t.password?null:yield this.auditService.passwordLeaked(t.password).then(t=>t>0?Object.assign(Object.assign({},e),{exposedXTimes:t}):null)})}canManageCipher(e){return!0}determinedUpdatedCipherReportStatus(e,t){return O(this,void 0,void 0,function*(){return yield this.isPasswordExposed(t)})}}Y.ɵfac=function(e){return new(e||Y)(d.rXU(u.p),d.rXU(h.d),d.rXU(n.PV),d.rXU(p.o3),d.rXU(m.Di),d.rXU(o.qX),d.rXU(v.W),d.rXU(r.H),d.rXU(o.hI),d.rXU(a.l))},Y.ɵcmp=d.VBU({type:Y,selectors:[["app-exposed-passwords-report"]],standalone:!1,features:[d.Vt3],decls:9,vars:8,consts:[["cantManage",""],["type","submit","buttonType","primary","bitButton","",3,"click","loading"],["class","tw-mt-4",4,"ngIf"],[1,"tw-mt-4"],["type","success",3,"title",4,"ngIf"],[4,"ngIf"],["type","success",3,"title"],["type","danger",3,"title","useAlertRole"],[3,"selected","selectedChange",4,"ngIf"],[3,"dataSource","rowSize"],["header",""],["bitCell",""],["bitCell","","bitSortable","name"],["bitCell","","bitSortable","organizationId",4,"ngIf"],["bitCell","","bitSortable","exposedXTimes",1,"tw-text-right"],["bitRowDef",""],[3,"selectedChange","selected"],[4,"ngFor","ngForOf"],[3,"value"],["bitBadge","","variant","info"],["bitCell","","bitSortable","organizationId"],[3,"cipher"],[4,"ngIf","ngIfElse"],["bitCell","",4,"ngIf"],["bitCell","",1,"tw-text-right"],["bitBadge","","variant","warning"],["bitLink","","href","#","appStopClick","",3,"click","title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared",3,"title"],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["appStopProp","",3,"disabled","organizationId","organizationName",4,"ngIf"],["appStopProp","",3,"disabled","organizationId","organizationName"]],template:function(e,t){1&e&&(d.nrm(0,"app-header"),d.j41(1,"bit-container")(2,"p"),d.EFF(3),d.nI1(4,"i18n"),d.k0s(),d.j41(5,"button",1),d.bIt("click",function(){return t.load()}),d.EFF(6),d.nI1(7,"i18n"),d.k0s(),d.DNE(8,X,3,2,"div",2),d.k0s()),2&e&&(d.R7$(3),d.JRh(d.bMT(4,4,"exposedPasswordsReportDesc")),d.R7$(2),d.Y8G("loading",t.loading),d.R7$(),d.SpI(" ",d.bMT(7,6,"checkExposedPasswords")," "),d.R7$(2),d.Y8G("ngIf",t.hasLoaded))},dependencies:[f.Sq,f.bT,g.R,y.Y,b.x,w.n,S.Q,I.G,k.H,C.L,T.a,F.Q,R.O,T.N,P.H,x.a,$.P,E.f,f.Jj,f.QX,A.$,D.t],encapsulation:2})},85111:(e,t,i)=>{"use strict";i.d(t,{C:()=>Ce});var n=i(33812),r=i(74208),s=i(66046),o=i(72245),a=i(44500),l=i(83892),c=i(14803),d=i(33338),u=i(3204),h=i(34040),p=i(27442),m=i(43978),v=i(685),f=i(3633),g=i(31442),y=i(66983),b=i(27760),w=i(51122),S=i(28202),I=i(93241),k=i(67553),C=i(56962),T=i(49272),F=i(22848),R=i(45151),P=i(88565),x=i(81285),$=i(78781),E=i(78212),A=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class D{constructor(){}static open(e,t,i,n,r,s,a,l,c,d,u,h){return A(this,void 0,void 0,function*(){const p=yield x.GA.open(e,{title:"enrollAccountRecovery",calloutOptions:{text:"resetPasswordEnrollmentWarning",type:"warning"},verificationType:{type:"custom",verificationFn:r=>A(this,void 0,void 0,function*(){const s=(yield(0,o._)(u.activeAccount$)).id,a=$.A.fromB64ToArray((yield h.getKeys(t.organization.id)).publicKey),c=yield l.buildRequest(r),p=E.QY.open(e,{name:t.organization.name,orgId:t.organization.id,publicKey:a});if(!0!==(yield(0,P.s)(p.closed)))throw new Error("Organization not trusted, aborting user key rotation");const m=[a],v=yield(0,o._)(d.userKey$(s));return c.resetPasswordKey=yield i.buildRecoveryKey(t.organization.id,v,m),yield n.putOrganizationUserResetPasswordEnrollment(t.organization.id,t.organization.userId,c),!0})}});if("cancel"!==p.userAction&&p.verificationSuccess)try{c.showToast({variant:"success",title:null,message:r.t("enrollPasswordResetSuccess")}),yield s.fullSync(!0)}catch(m){a.error(m)}})}}var O=i(27197),M=i(49492),U=i(37115),G=i(50700),j=i(12012),N=i(18499),V=i(11224),B=i(21274),z=i(69855),L=i(62166),K=i(1601),q=i(35500),_=i(86214),X=i(77468),Y=i(5771),H=i(13496),W=i(53997),J=i(78952),Z=i(88016),Q=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ee(e,t){1&e&&(n.qex(0),n.nrm(1,"i",7),n.nI1(2,"i18n"),n.j41(3,"span",8),n.EFF(4),n.nI1(5,"i18n"),n.k0s(),n.bVm()),2&e&&(n.R7$(),n.Y8G("title",n.mNQ(n.bMT(2,3,"loading"))),n.R7$(3),n.JRh(n.bMT(5,5,"loading")))}function te(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(3);return r.Njj(t.toggleResetPasswordEnrollment(t.organization))}),n.nrm(1,"i",12),n.EFF(2),n.nI1(3,"i18n"),n.k0s()}2&e&&(n.R7$(2),n.SpI(" ",n.bMT(3,1,"enrollAccountRecovery")," "))}function ie(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(3);return r.Njj(t.toggleResetPasswordEnrollment(t.organization))}),n.nrm(1,"i",13),n.EFF(2),n.nI1(3,"i18n"),n.k0s()}2&e&&(n.R7$(2),n.SpI(" ",n.bMT(3,1,"withdrawAccountRecovery")," "))}function ne(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(4);return r.Njj(t.unlinkSso(t.organization))}),n.EFF(1),n.nI1(2,"i18n"),n.k0s()}2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"unlinkSso")," "))}function re(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(4);return r.Njj(t.handleLinkSso(t.organization))}),n.EFF(1),n.nI1(2,"i18n"),n.k0s()}2&e&&(n.R7$(),n.SpI(" ",n.bMT(2,1,"linkSso")," "))}function se(e,t){if(1&e&&(n.qex(0),n.DNE(1,ne,3,3,"button",14)(2,re,3,3,"ng-template",null,1,n.C5r),n.bVm()),2&e){const e=n.sdS(3),t=n.XpG(3);n.R7$(),n.Y8G("ngIf",t.organization.ssoBound)("ngIfElse",e)}}function oe(e,t){if(1&e){const e=n.RV6();n.j41(0,"button",11),n.bIt("click",function(){r.eBV(e);const t=n.XpG(3);return r.Njj(t.leave(t.organization))}),n.nrm(1,"i",15),n.j41(2,"span",16),n.EFF(3),n.nI1(4,"i18n"),n.k0s()()}2&e&&(n.R7$(3),n.JRh(n.bMT(4,1,"leave")))}function ae(e,t){if(1&e&&(n.j41(0,"div",9),n.DNE(1,te,4,3,"button",10)(2,ie,4,3,"button",10)(3,se,4,2,"ng-container",2)(4,oe,5,3,"button",10),n.k0s()),2&e){const e=n.XpG(2);n.Y8G("appApiAction",e.actionPromise),n.R7$(),n.Y8G("ngIf",e.allowEnrollmentChanges(e.organization)&&!e.organization.resetPasswordEnrolled),n.R7$(),n.Y8G("ngIf",e.allowEnrollmentChanges(e.organization)&&e.organization.resetPasswordEnrolled),n.R7$(),n.Y8G("ngIf",e.showSsoOptions(e.organization)),n.R7$(),n.Y8G("ngIf",e.showLeaveOrgOption)}}function le(e,t){if(1&e&&(n.qex(0),n.j41(1,"button",3),n.nI1(2,"i18n"),n.nrm(3,"i",4),n.k0s(),n.j41(4,"bit-menu",5,0),n.DNE(6,ee,6,7,"ng-container",2)(7,ae,5,5,"div",6),n.k0s(),n.bVm()),2&e){const e=n.sdS(5),t=n.XpG();n.R7$(),n.Y8G("bitMenuTriggerFor",e),n.BMQ("aria-label",n.bMT(2,4,"organizationOptionsMenu")),n.R7$(5),n.Y8G("ngIf",!t.loaded),n.R7$(),n.Y8G("ngIf",t.loaded)}}class ce{constructor(e,t,i,n,r,o,a,l,c,d,u,h,p,m,v,f,g,y,b,w){this.organization$=e,this.platformUtilsService=t,this.i18nService=i,this.apiService=n,this.syncService=r,this.policyService=o,this.logService=a,this.organizationApiService=l,this.organizationUserApiService=c,this.userDecryptionOptionsService=d,this.dialogService=u,this.resetPasswordService=h,this.userVerificationService=p,this.toastService=m,this.configService=v,this.organizationService=f,this.keyService=g,this.accountService=y,this.linkSsoService=b,this.ssoLoginService=w,this.loaded=!1,this.hideMenu=!1,this.showLeaveOrgOption=!1,this.destroy$=new s.B}ngOnInit(){return Q(this,void 0,void 0,function*(){const e=this.accountService.activeAccount$.pipe(f.F6,(0,a.n)(e=>this.policyService.policies$(e)),(0,u.T)(e=>e.filter(e=>e.type==m.tt.ResetPassword))),t=this.accountService.activeAccount$.pipe(f.F6,(0,a.n)(e=>this.organizationService.organizations$(e)),(0,u.T)(e=>e.find(e=>!0===e.userIsManagedByOrganization)));(0,d.z)([this.organization$,e,this.accountService.activeAccount$.pipe(f.F6,(0,a.n)(e=>this.userDecryptionOptionsService.userDecryptionOptionsById$(e))),t]).pipe((0,c.Q)(this.destroy$)).subscribe(([e,t,i,n])=>{this.organization=e,this.resetPasswordPolicy=t.find(t=>t.organizationId===e.id),this.showLeaveOrgOption=(null==n?void 0:n.id)!==e.id&&(null==i.trustedDeviceOption&&null==i.keyConnectorOption||i.hasMasterPassword),this.hideMenu=!this.showLeaveOrgOption&&!this.showSsoOptions(this.organization)&&!this.allowEnrollmentChanges(this.organization),this.loaded=!0})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}allowEnrollmentChanges(e){return!!((null==e?void 0:e.usePolicies)&&(null==e?void 0:e.useResetPassword)&&(null==e?void 0:e.hasPublicAndPrivateKeys)&&null!=this.resetPasswordPolicy&&this.resetPasswordPolicy.enabled)&&!((null==e?void 0:e.resetPasswordEnrolled)&&this.resetPasswordPolicy.data.autoEnrollEnabled)}showSsoOptions(e){return(null==e?void 0:e.useSso)&&(null==e?void 0:e.identifier)}handleLinkSso(e){return Q(this,void 0,void 0,function*(){try{yield this.linkSsoService.linkSso(e.identifier)}catch(t){this.logService.error(t),this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("errorOccurred")})}})}unlinkSso(e){return Q(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"unlinkSsoConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.apiService.deleteSsoUser(e.id).then(()=>this.syncService.fullSync(!0)),yield this.actionPromise,this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("unlinkedSso")}),yield this.removeEmailFromSsoRequiredCacheIfPresent()}catch(t){this.logService.error(t)}})}leave(e){return Q(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"leaveOrganizationConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.organizationApiService.leave(e.id),yield this.actionPromise,this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("leftOrganization")}),yield this.removeEmailFromSsoRequiredCacheIfPresent()}catch(t){this.logService.error(t)}})}removeEmailFromSsoRequiredCacheIfPresent(){return Q(this,void 0,void 0,function*(){const e=yield(0,o._)(this.accountService.activeAccount$);e?yield this.ssoLoginService.removeFromSsoRequiredCacheIfPresent(e.email):this.logService.error("Active account not found.")})}toggleResetPasswordEnrollment(e){return Q(this,void 0,void 0,function*(){if(this.organization.resetPasswordEnrolled){const e=new S.Wt;e.masterPasswordHash="ignored",e.resetPasswordKey="",this.actionPromise=this.organizationUserApiService.putOrganizationUserResetPasswordEnrollment(this.organization.id,this.organization.userId,e);try{yield this.actionPromise,this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("withdrawPasswordResetSuccess")}),yield this.syncService.fullSync(!0)}catch(t){this.logService.error(t)}}else yield D.open(this.dialogService,{organization:e},this.resetPasswordService,this.organizationUserApiService,this.i18nService,this.syncService,this.logService,this.userVerificationService,this.toastService,this.keyService,this.accountService,this.organizationApiService)})}}ce.ɵfac=function(e){return new(e||ce)(n.rXU(M.n),n.rXU(U.y),n.rXU(G.W),n.rXU(j.G),n.rXU(T.H),n.rXU(N.m),n.rXU(C.K),n.rXU(V.X),n.rXU(S.uB),n.rXU(I.Ym),n.rXU(B.o3),n.rXU(R.w),n.rXU(L.i),n.rXU(z.f),n.rXU(K.w),n.rXU(k.PV),n.rXU(F.Lu),n.rXU(q.Di),n.rXU(O.fA),n.rXU(_._))},ce.ɵcmp=n.VBU({type:ce,selectors:[["app-organization-options"]],standalone:!1,decls:1,vars:1,consts:[["optionsMenu",""],["linkSso",""],[4,"ngIf"],["type","button",1,"filter-options-icon",3,"bitMenuTriggerFor"],["aria-hidden","true",1,"bwi","bwi-ellipsis-v"],[1,"filter-organization-options"],["class","tw-flex tw-min-w-[200px] tw-max-w-[300px] tw-flex-col",3,"appApiAction",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-m-2","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-flex","tw-min-w-[200px]","tw-max-w-[300px]","tw-flex-col",3,"appApiAction"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-key"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"],["type","button","bitMenuItem","",3,"click",4,"ngIf","ngIfElse"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sign-out","tw-text-danger"],[1,"tw-text-danger"]],template:function(e,t){1&e&&n.DNE(0,le,8,6,"ng-container",2),2&e&&n.Y8G("ngIf",!t.hideMenu)},dependencies:[X.bT,Y.k,H.Z,W.O,J.S,Z.$],encapsulation:2});var de=i(91240),ue=i(48180),he=i(5556),pe=i(92411),me=i(43090),ve=i(51757),fe=i(54471),ge=i(49519),ye=i(59032),be=i(5520),we=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Se(e,t){1&e&&(n.j41(0,"div",3),n.nrm(1,"i",4),n.k0s())}function Ie(e,t){if(1&e&&(n.qex(0),n.j41(1,"div",12),n.nrm(2,"app-filter-section",13),n.k0s(),n.bVm()),2&e){const e=t.$implicit,i=n.XpG(2);n.R7$(2),n.Y8G("activeFilter",i.activeFilter)("section",e)}}function ke(e,t){if(1&e){const e=n.RV6();n.j41(0,"div")(1,"div",5),n.EFF(2),n.nI1(3,"i18n"),n.j41(4,"a",6),n.nI1(5,"i18n"),n.nrm(6,"i",7),n.k0s()(),n.j41(7,"div",8)(8,"div",9)(9,"bit-search",10),n.nI1(10,"i18n"),n.mxI("ngModelChange",function(t){r.eBV(e);const i=n.XpG();return n.DH7(i.searchText,t)||(i.searchText=t),r.Njj(t)}),n.bIt("ngModelChange",function(t){r.eBV(e);const i=n.XpG();return r.Njj(i.onSearchTextChanged(t))}),n.k0s()(),n.DNE(11,Ie,3,2,"ng-container",11),n.k0s()()}if(2&e){const e=n.XpG();n.R7$(2),n.SpI(" ",n.bMT(3,7,"filters")," "),n.R7$(2),n.Y8G("appA11yTitle",n.mNQ(n.bMT(5,9,"learnMoreAboutSearchingYourVault"))),n.R7$(5),n.Y8G("placeholder",n.mNQ(n.bMT(10,11,e.searchPlaceholder))),n.R50("ngModel",e.searchText),n.R7$(2),n.Y8G("ngForOf",e.filtersList)}}class Ce{get filtersList(){return this.filters?Object.values(this.filters):[]}get searchPlaceholder(){var e,t;return this.activeFilter.isFavorites?"searchFavorites":this.activeFilter.isDeleted?"searchTrash":this.activeFilter.isArchived?"searchArchive":this.activeFilter.cipherType===g.gC.Login?"searchLogin":this.activeFilter.cipherType===g.gC.Card?"searchCard":this.activeFilter.cipherType===g.gC.Identity?"searchIdentity":this.activeFilter.cipherType===g.gC.SecureNote?"searchSecureNote":this.activeFilter.cipherType===g.gC.SshKey?"searchSshKey":(null===(e=this.activeFilter.selectedFolderNode)||void 0===e?void 0:e.node)?"searchFolder":(null===(t=this.activeFilter.selectedCollectionNode)||void 0===t?void 0:t.node)?"searchCollection":"MyVault"===this.activeFilter.organizationId?"searchMyVault":this.activeFilter.organizationId?"searchOrganization":"searchVault"}constructor(e,t,i,a,l,c,d,u,h,p,m,v){this.vaultFilterService=e,this.policyService=t,this.i18nService=i,this.platformUtilsService=a,this.toastService=l,this.billingApiService=c,this.dialogService=d,this.accountService=u,this.restrictedItemTypesService=h,this.cipherService=p,this.cipherArchiveService=m,this.premiumUpgradePromptService=v,this.activeFilter=new w.$,this.onEditFolder=new n.bkB,this.searchText="",this.searchTextChanged=new n.bkB,this.isLoaded=!1,this.destroy$=new s.B,this.organizationWarningsService=(0,r.WQX)(b.S),this.allTypeFilters=[{id:"favorites",name:this.i18nService.t("favorites"),type:"favorites",icon:"bwi-star"},{id:"login",name:this.i18nService.t("typeLogin"),type:g.gC.Login,icon:"bwi-globe"},{id:"card",name:this.i18nService.t("typeCard"),type:g.gC.Card,icon:"bwi-credit-card"},{id:"identity",name:this.i18nService.t("typeIdentity"),type:g.gC.Identity,icon:"bwi-id-card"},{id:"note",name:this.i18nService.t("note"),type:g.gC.SecureNote,icon:"bwi-sticky-note"},{id:"sshKey",name:this.i18nService.t("typeSshKey"),type:g.gC.SshKey,icon:"bwi-key"}],this.activeUserId$=this.accountService.activeAccount$.pipe(f.F6),this.applyOrganizationFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;"AllVaults"===(null==e?void 0:e.node.id)?t.resetOrganization():t.selectedOrganizationNode=e,this.vaultFilterService.setOrganizationFilter(e.node);const i=yield(0,o._)(this.activeUserId$);yield this.vaultFilterService.expandOrgFilter(i)}),this.applyTypeFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;t.resetFilter(),t.selectedCipherTypeNode=e}),this.applyFolderFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;t.resetFilter(),t.selectedFolderNode=e}),this.applyCollectionFilter=e=>we(this,void 0,void 0,function*(){const t=this.activeFilter;t.resetFilter(),t.selectedCollectionNode=e}),this.editFolder=e=>we(this,void 0,void 0,function*(){this.onEditFolder.emit(e)})}ngOnInit(){return we(this,void 0,void 0,function*(){var e,t,i;this.filters=yield this.buildAllFilters(),(null===(t=null===(e=this.filters)||void 0===e?void 0:e.typeFilter)||void 0===t?void 0:t.data$)&&(this.activeFilter.selectedCipherTypeNode=yield(0,o._)(null===(i=this.filters)||void 0===i?void 0:i.typeFilter.data$)),this.isLoaded=!0,this.accountService.activeAccount$.pipe(f.F6,(0,a.n)(e=>(0,l.h)(this.policyService.policiesByType$(m.tt.SingleOrg,e).pipe(v.Zc),this.policyService.policiesByType$(m.tt.OrganizationDataOwnership,e).pipe(v.Zc)))).pipe((0,a.n)(()=>this.addOrganizationFilter()),(0,c.Q)(this.destroy$)).subscribe(e=>{this.filters&&(this.filters.organizationFilter=e)})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}onSearchTextChanged(e){this.searchText=e,this.searchTextChanged.emit(e)}buildAllFilters(){return we(this,void 0,void 0,function*(){const[e,t]=yield(0,o._)((0,d.z)([this.accountService.activeAccount$.pipe(f.F6),this.cipherArchiveService.hasArchiveFlagEnabled$])),i={};return i.organizationFilter=yield this.addOrganizationFilter(),i.typeFilter=yield this.addTypeFilter(),i.folderFilter=yield this.addFolderFilter(),i.collectionFilter=yield this.addCollectionFilter(),t&&(i.archiveFilter=yield this.addArchiveFilter(e)),i.trashFilter=yield this.addTrashFilter(),i})}addOrganizationFilter(){return we(this,void 0,void 0,function*(){const e=yield(0,o._)(this.accountService.activeAccount$.pipe(f.F6,(0,a.n)(e=>this.policyService.policyAppliesToUser$(m.tt.SingleOrg,e)))),t=yield(0,o._)(this.accountService.activeAccount$.pipe(f.F6,(0,a.n)(e=>this.policyService.policyAppliesToUser$(m.tt.OrganizationDataOwnership,e)))),i=e?void 0:{text:"newOrganization",route:"/create-organization"};return{data$:this.vaultFilterService.organizationTree$,header:{showHeader:!(e&&t),isSelectable:!0},action:this.applyOrganizationFilter,options:{component:ce},add:i,divider:!0}})}addTypeFilter(){return we(this,arguments,void 0,function*(e=[],t){const i={id:"AllItems",name:"allItems",type:"all",icon:""},n=yield(0,o._)(this.activeUserId$);return{data$:(0,d.z)([this.restrictedItemTypesService.restricted$,this.cipherService.cipherListViews$(n)]).pipe((0,u.T)(([i,n])=>{const r=i.filter(e=>0===e.allowViewOrgIds.length||!(null==n?void 0:n.some(i=>!i.deletedDate&&i.type===e.cipherType&&(!!i.organizationId&&(t?i.organizationId===t&&e.allowViewOrgIds.includes(i.organizationId):e.allowViewOrgIds.includes(i.organizationId)))))).map(e=>e.cipherType),s=[...e,...r];return this.allTypeFilters.filter(e=>!s.includes(e.type))}),(0,a.n)(e=>this.vaultFilterService.buildTypeTree(i,e)),(0,h.F)(),(0,p.t)({bufferSize:1,refCount:!0})),header:{showHeader:!0,isSelectable:!0},action:this.applyTypeFilter}})}addFolderFilter(){return we(this,void 0,void 0,function*(){return{data$:this.vaultFilterService.folderTree$,header:{showHeader:!0,isSelectable:!1},action:this.applyFolderFilter,edit:{filterName:this.i18nService.t("folder"),action:this.editFolder}}})}addCollectionFilter(){return we(this,void 0,void 0,function*(){return{data$:this.vaultFilterService.collectionTree$,header:{showHeader:!0,isSelectable:!0},action:this.applyCollectionFilter}})}addTrashFilter(){return we(this,void 0,void 0,function*(){return{data$:this.vaultFilterService.buildTypeTree({id:"headTrash",name:"HeadTrash",type:"trash",icon:"bwi-trash"},[{id:"trash",name:this.i18nService.t("trash"),type:"trash",icon:"bwi-trash"}]),header:{showHeader:!1,isSelectable:!0},action:this.applyTypeFilter}})}addArchiveFilter(e){return we(this,void 0,void 0,function*(){const[t,i]=yield(0,o._)((0,d.z)([this.cipherArchiveService.archivedCiphers$(e).pipe((0,u.T)(e=>e.length>0)),this.cipherArchiveService.userHasPremium$(e)])),n=!i&&!t;return{data$:this.vaultFilterService.buildTypeTree({id:"headArchive",name:"HeadArchive",type:"archive",icon:"bwi-archive"},[{id:"archive",name:this.i18nService.t("archiveNoun"),type:"archive",icon:"bwi-archive"}]),header:{showHeader:!1,isSelectable:!0},action:this.applyTypeFilter,premiumOptions:{showBadgeForNonPremium:!0,blockFilterAction:n?()=>we(this,void 0,void 0,function*(){return yield this.premiumUpgradePromptService.promptForPremium()}):void 0}}})}}Ce.ɵfac=function(e){return new(e||Ce)(n.rXU(de.u),n.rXU(N.m),n.rXU(G.W),n.rXU(U.y),n.rXU(z.f),n.rXU(ue.P),n.rXU(B.o3),n.rXU(q.Di),n.rXU(y.b),n.rXU(he.p),n.rXU(pe.J),n.rXU(me.l))},Ce.ɵcmp=n.VBU({type:Ce,selectors:[["app-vault-filter"]],inputs:{activeFilter:"activeFilter",searchText:"searchText"},outputs:{onEditFolder:"onEditFolder",searchTextChanged:"searchTextChanged"},standalone:!1,decls:3,vars:2,consts:[["data-testid","filters",1,"tw-border","tw-border-solid","tw-border-secondary-300","tw-rounded"],["class","tw-text-center tw-p-5",4,"ngIf"],[4,"ngIf"],[1,"tw-text-center","tw-p-5"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin"],["data-testid","filters-header",1,"tw-bg-background-alt","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-100","tw-rounded-t","tw-px-5","tw-py-2.5","tw-font-medium","tw-uppercase"],["bitLink","","href","https://bitwarden.com/help/searching-vault/","target","_blank","rel","noreferrer",1,"tw-float-right",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["data-testid","filters-body",1,"tw-p-5"],[1,"tw-mb-4"],["id","search","autocomplete","off","appAutofocus","",3,"ngModelChange","placeholder","ngModel"],[4,"ngFor","ngForOf"],[1,"filter"],[3,"activeFilter","section"]],template:function(e,t){1&e&&(n.j41(0,"div",0),n.DNE(1,Se,2,0,"div",1)(2,ke,12,13,"div",2),n.k0s()),2&e&&(n.R7$(),n.Y8G("ngIf",!t.isLoaded),n.R7$(),n.Y8G("ngIf",t.isLoaded))},dependencies:[X.Sq,X.bT,ve.BC,ve.vS,fe.C,ge.B,ye.L,M.H,be.S,Z.$],encapsulation:2})},85494:(e,t,i)=>{"use strict";i.d(t,{G:()=>f});var n=i(2096),r=i(81525),s=i(22166),o=i(25065),a=i(33812),l=i(74208),c=i(21274),d=i(26657),u=i(56898),h=i(7730),p=i(68016),m=i(88016),v=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class f{constructor(e,t){this.params=e,this.dialogRef=t}onCollectionAssign(e){return v(this,void 0,void 0,function*(){this.dialogRef.close(e)})}static open(e,t){return e.open(f,t)}}f.ɵfac=function(e){return new(e||f)(a.rXU(r.Qs),a.rXU(c.ce))},f.ɵcmp=a.VBU({type:f,selectors:[["ng-component"]],decls:19,vars:20,consts:[["assignSubmitButton",""],["dialogSize","large"],["bitDialogTitle",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["bitDialogContent",""],[3,"onCollectionAssign","editableItemCountChange","params","submitBtn"],["bitDialogFooter",""],["form","assign_collections_form","type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","buttonType","secondary","bitDialogClose",""]],template:function(e,t){if(1&e){const e=a.RV6();a.j41(0,"bit-dialog",1)(1,"span",2),a.EFF(2),a.nI1(3,"i18n"),a.j41(4,"span",3),a.EFF(5),a.nI1(6,"i18n"),a.nI1(7,"i18n"),a.nI1(8,"pluralize"),a.k0s()(),a.j41(9,"div",4)(10,"assign-collections",5),a.bIt("onCollectionAssign",function(i){return l.eBV(e),l.Njj(t.onCollectionAssign(i))})("editableItemCountChange",function(i){return l.eBV(e),l.Njj(t.editableItemCount=i)}),a.k0s()(),a.qex(11,6),a.j41(12,"button",7,0),a.EFF(14),a.nI1(15,"i18n"),a.k0s(),a.j41(16,"button",8),a.EFF(17),a.nI1(18,"i18n"),a.k0s(),a.bVm(),a.k0s()}if(2&e){const e=a.sdS(13);a.R7$(2),a.SpI(" ",a.bMT(3,6,"assignToCollections")," "),a.R7$(3),a.SpI(" ",a.brH(8,12,t.editableItemCount,a.bMT(6,8,"item"),a.bMT(7,10,"items"))," "),a.R7$(5),a.Y8G("params",t.params)("submitBtn",e),a.R7$(4),a.SpI(" ",a.bMT(15,16,"assign")," "),a.R7$(3),a.SpI(" ",a.bMT(18,18,"cancel")," ")}},dependencies:[o.G,d.$,u.Q,h.I,p.m,s.Gc,m.$,n.n],encapsulation:2})},85523:(e,t,i)=>{"use strict";i.d(t,{O6:()=>U,W_:()=>G});var n=i(60409),r=i(33812),s=i(83731),o=i(33338),a=i(93695),l=i(3204),c=i(12610),d=i(44500),u=i(28202),h=i(11979),p=i(66983),m=i(61325),v=i(55542),f=i(45980),g=i(74208),y=i(92411);function b(e,t){if(1&e&&(r.j41(0,"th",17),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.HbH(e.showExtraColumn?"tw-w-3/5":"tw-w-full"),r.Y8G("fn",e.sortByName),r.R7$(),r.SpI(" ",r.bMT(2,4,"name")," ")}}function w(e,t){if(1&e&&(r.j41(0,"th",18),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.HbH(e.showExtraColumn?"tw-w-3/5":"tw-w-full"),r.R7$(),r.SpI(" ",r.bMT(2,3,"name")," ")}}function S(e,t){1&e&&(r.j41(0,"th",19),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.SpI(" ",r.bMT(2,1,"owner")," "))}function I(e,t){1&e&&(r.j41(0,"th",20),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e&&(r.R7$(),r.JRh(r.bMT(2,1,"collections")))}function k(e,t){if(1&e&&(r.j41(0,"th",21),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.Y8G("fn",e.sortByGroups),r.R7$(),r.SpI(" ",r.bMT(2,2,"groups")," ")}}function C(e,t){if(1&e&&(r.j41(0,"th",22),r.EFF(1),r.nI1(2,"i18n"),r.k0s()),2&e){const e=r.XpG();r.Y8G("fn",e.sortByPermissions),r.R7$(),r.SpI(" ",r.bMT(2,2,"permission")," ")}}function T(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",23),r.bIt("click",function(){g.eBV(e);const t=r.XpG();return g.Njj(t.bulkMoveToFolder())}),r.nrm(1,"i",24),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"addToFolder")," "))}function F(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",23),r.bIt("click",function(){g.eBV(e);const t=r.XpG();return g.Njj(t.bulkEditCollectionAccess())}),r.nrm(1,"i",25),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"editAccess")," "))}function R(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",23),r.bIt("click",function(){g.eBV(e);const t=r.XpG();return g.Njj(t.assignToCollections())}),r.nrm(1,"i",26),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"assignToCollections")," "))}function P(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",23),r.bIt("click",function(){g.eBV(e);const t=r.XpG();return g.Njj(t.bulkArchive())}),r.nrm(1,"i",27),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"archiveVerb")," "))}function x(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",23),r.bIt("click",function(){g.eBV(e);const t=r.XpG();return g.Njj(t.bulkUnarchive())}),r.nrm(1,"i",28),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"unArchive")," "))}function $(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",23),r.bIt("click",function(){g.eBV(e);const t=r.XpG();return g.Njj(t.bulkRestore())}),r.nrm(1,"i",29),r.EFF(2),r.nI1(3,"i18n"),r.k0s()}2&e&&(r.R7$(2),r.SpI(" ",r.bMT(3,1,"restoreSelected")," "))}function E(e,t){if(1&e){const e=r.RV6();r.j41(0,"button",23),r.bIt("click",function(){g.eBV(e);const t=r.XpG();return g.Njj(t.bulkDelete())}),r.j41(1,"span",30),r.nrm(2,"i",31),r.EFF(3),r.nI1(4,"i18n"),r.k0s()()}if(2&e){const e=r.XpG();r.R7$(3),r.SpI(" ",r.bMT(4,1,e.showBulkTrashOptions?"permanentlyDeleteSelected":"delete")," ")}}function A(e,t){if(1&e){const e=r.RV6();r.j41(0,"tr",35),r.bIt("checkedToggled",function(){g.eBV(e);const t=r.XpG().$implicit,i=r.XpG(2);return g.Njj(i.selection.toggle(t))})("onEvent",function(t){g.eBV(e);const i=r.XpG(3);return g.Njj(i.event(t))}),r.k0s()}if(2&e){const e=r.XpG().$implicit,t=r.XpG(2);r.Y8G("disabled",t.disabled)("collection",e.collection)("showOwner",t.showOwner)("showCollections",t.showCollections)("showGroups",t.showGroups)("organizations",t.allOrganizations)("showPermissionsColumn",t.showPermissionsColumn)("groups",t.allGroups)("canDeleteCollection",t.canDeleteCollection(e.collection))("canEditCollection",t.canEditCollection(e.collection))("canViewCollectionInfo",t.canViewCollectionInfo(e.collection))("checked",t.selection.isSelected(e))}}function D(e,t){if(1&e){const e=r.RV6();r.j41(0,"tr",36),r.nI1(1,"async"),r.nI1(2,"async"),r.nI1(3,"async"),r.nI1(4,"async"),r.bIt("checkedToggled",function(){g.eBV(e);const t=r.XpG().$implicit,i=r.XpG(2);return g.Njj(i.selection.toggle(t))})("onEvent",function(t){g.eBV(e);const i=r.XpG(3);return g.Njj(i.event(t))}),r.k0s()}if(2&e){const e=r.XpG().$implicit,t=r.XpG(2);r.Y8G("disabled",t.disabled)("cipher",e.cipher)("showOwner",t.showOwner)("showCollections",t.showCollections)("showGroups",t.showGroups)("showPremiumFeatures",t.showPremiumFeatures)("useEvents",t.useEvents)("viewingOrgVault",t.viewingOrgVault)("cloneable",r.bMT(1,20,t.canClone$(e)))("organizations",t.allOrganizations)("collections",t.allCollections)("checked",t.selection.isSelected(e))("canEditCipher",t.canEditCipher(e.cipher))("canAssignCollections",t.canAssignCollections(e.cipher))("canManageCollection",t.canManageCollection(e.cipher))("canDeleteCipher",r.bMT(2,22,t.cipherAuthorizationService.canDeleteCipher$(e.cipher,t.showAdminActions)))("canRestoreCipher",r.bMT(3,24,t.cipherAuthorizationService.canRestoreCipher$(e.cipher,t.showAdminActions)))("userCanArchive",t.userCanArchive)("enforceOrgDataOwnershipPolicy",t.enforceOrgDataOwnershipPolicy)("archiveEnabled",r.bMT(4,26,t.archiveFeatureEnabled$))}}function O(e,t){if(1&e&&(r.qex(0),r.DNE(1,A,1,12,"tr",33)(2,D,5,28,"tr",34),r.bVm()),2&e){const e=t.$implicit,i=r.XpG(2);r.R7$(),r.Y8G("ngIf",e.collection),r.R7$(),r.Y8G("ngIf",e.cipher&&(!i.addAccessToggle||i.addAccessToggle&&1!==i.addAccessStatus))}}function M(e,t){if(1&e&&r.DNE(0,O,3,2,"ng-container",32),2&e){const e=t.$implicit;r.Y8G("cdkVirtualForOf",e)("cdkVirtualForTemplateCacheSize",0)}}const U="tw-h-[75px]";class G{get ciphers(){return this._ciphers}set ciphers(e){this._ciphers=null!=e?e:[],this.refreshItems()}get collections(){return this._collections}set collections(e){this._collections=null!=e?e:[],this.refreshItems()}constructor(e,t,i){this.cipherAuthorizationService=e,this.restrictedItemTypesService=t,this.cipherArchiveService=i,this.RowHeight=75,this.showAdminActions=!1,this.allOrganizations=[],this.allCollections=[],this.allGroups=[],this.showBulkEditCollectionAccess=!1,this.showBulkAddToCollections=!1,this.showPermissionsColumn=!1,this._ciphers=[],this._collections=[],this.onEvent=new r.bkB,this.editableItems=[],this.dataSource=new v.s,this.selection=new n.C(!0,[],!0),this.restrictedTypes=[],this.archiveFeatureEnabled$=this.cipherArchiveService.hasArchiveFlagEnabled$,this.sortByName=(e,t,i)=>{const n=this.prioritizeCollections(e,t,i);return 0!==n?n:this.compareNames(e,t)},this.sortByGroups=(e,t,i)=>{if(!(e.collection instanceof u.nb||t.collection instanceof u.nb))return 0;const n=e=>e.groups.length>0?e.groups.map(e=>this.getGroupName(e.id)||"").sort()[0]:null,r=this.prioritizeCollections(e,t,i);if(0!==r)return r;const s=n(e.collection),o=n(t.collection);return null===s?1:null===o?-1:s.localeCompare(o)},this.sortByPermissions=(e,t,i)=>{const n=e=>{var t;const i=e.collection?this.getCollectionPermission(e.collection):this.getCipherPermission(e.cipher);return null!==(t={[f.aF.Manage]:5,[f.aF.Edit]:4,[f.aF.EditExceptPass]:3,[f.aF.View]:2,[f.aF.ViewExceptPass]:1,NoAccess:0}[i])&&void 0!==t?t:-1},r=this.prioritizeCollections(e,t,i);if(0!==r)return r;const s=n(e),o=n(t);return s!==o?s-o:this.compareNames(e,t)},this.canDeleteSelected$=this.selection.changed.pipe((0,c.Z)(null),(0,d.n)(()=>{const t=this.selection.selected.filter(e=>e.cipher).map(e=>e.cipher);if(0===this.selection.selected.length)return(0,a.of)(!0);const i=t.map(t=>e.canDeleteCipher$(t,this.showAdminActions)),n=this.selection.selected.filter(e=>e.collection).every(e=>e.collection&&this.canDeleteCollection(e.collection));return(0,o.z)(i).pipe((0,l.T)(e=>e.every(e=>e)&&n))})),this.restrictedItemTypesService.restricted$.pipe((0,s.pQ)()).subscribe(e=>{this.restrictedTypes=e,this.refreshItems()}),this.canRestoreSelected$=this.selection.changed.pipe((0,c.Z)(null),(0,d.n)(()=>{const t=this.selection.selected.filter(e=>e.cipher).map(e=>e.cipher);if(0===this.selection.selected.length)return(0,a.of)(!0);const i=t.map(t=>e.canRestoreCipher$(t,this.showAdminActions));return(0,o.z)(i).pipe((0,l.T)(e=>e.every(e=>e)))}),(0,l.T)(e=>e&&this.showBulkTrashOptions)),this.disableMenu$=this.canDeleteSelected$.pipe((0,l.T)(e=>!(this.bulkMoveAllowed||this.showAssignToCollections()||e||this.showBulkEditCollectionAccess)))}clearSelection(){this.selection.clear()}get showExtraColumn(){return this.showCollections||this.showGroups||this.showOwner}get isAllSelected(){return this.editableItems.slice(0,500).every(e=>this.selection.isSelected(e))}get isEmpty(){return 0===this.dataSource.data.length}get bulkMoveAllowed(){return this.showBulkMove&&0===this.selection.selected.filter(e=>e.collection).length}get bulkArchiveAllowed(){return!(0===this.selection.selected.length||!this.userCanArchive)&&(this.userCanArchive&&!this.selection.selected.find(e=>e.cipher&&(e.cipher.organizationId||e.cipher.archivedDate)))}get bulkUnarchiveAllowed(){return 0!==this.selection.selected.length&&!this.selection.selected.find(e=>{var t,i;return!(null===(t=e.cipher)||void 0===t?void 0:t.archivedDate)||(null===(i=e.cipher)||void 0===i?void 0:i.organizationId)})}get showDelete(){if(0===this.selection.selected.length)return!0;const e=this.hasPersonalItems(),t=this.getUniqueOrganizationIds(),i=this.selection.selected.filter(e=>e.cipher).every(({cipher:e})=>this.canManageCollection(e)),n=this.selection.selected.filter(e=>e.collection).every(e=>e.collection&&this.canDeleteCollection(e.collection)),r=i&&n;return!(!r&&(!e||t.size&&!r))}get bulkAssignToCollectionsAllowed(){return this.showBulkAddToCollections&&this.ciphers.length>0&&!this.anySelectedCiphersAreArchived}get anySelectedCiphersAreArchived(){return this.selection.selected.some(e=>e.cipher&&m.n.isArchived(e.cipher))}canEditCollection(e){if(e.id===u.I_)return!1;const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.canEdit(t)}canDeleteCollection(e){if(e.id===u.I_)return!1;const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.canDelete(t)}canViewCollectionInfo(e){const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.canViewCollectionInfo(t)}toggleAll(){this.isAllSelected?this.selection.clear():this.selection.select(...this.editableItems.slice(0,500))}event(e){this.onEvent.emit(e)}bulkMoveToFolder(){this.event({type:"moveToFolder",items:this.selection.selected.filter(e=>void 0!==e.cipher).map(e=>e.cipher)})}bulkArchive(){this.event({type:"archive",items:this.selection.selected.filter(e=>void 0!==e.cipher).map(e=>e.cipher)})}bulkUnarchive(){this.event({type:"unarchive",items:this.selection.selected.filter(e=>void 0!==e.cipher).map(e=>e.cipher)})}bulkRestore(){this.event({type:"restore",items:this.selection.selected.filter(e=>void 0!==e.cipher).map(e=>e.cipher)})}bulkDelete(){this.event({type:"delete",items:this.selection.selected})}canClone$(e){return this.restrictedItemTypesService.restricted$.pipe((0,d.n)(t=>t.some(t=>t.cipherType===m.n.getType(e.cipher))?(0,a.of)(!1):this.cipherAuthorizationService.canCloneCipher$(e.cipher,this.showAdminActions)))}canEditCipher(e){if(null==e.organizationId)return!0;return this.allOrganizations.find(t=>t.id===e.organizationId).canEditAllCiphers&&this.viewingOrgVault||e.edit}canAssignCollections(e){const t=this.allOrganizations.find(t=>t.id===e.organizationId),i=this.allCollections.filter(e=>!e.readOnly);return(null==t?void 0:t.canEditAllCiphers)&&this.viewingOrgVault||m.n.canAssignToCollections(e)&&i.length>0}canManageCollection(e){if(null==e.organizationId)return!0;if(this.showAdminActions){const t=this.allOrganizations.find(t=>t.id===e.organizationId);if(0===e.collectionIds.length)return!0===(null==t?void 0:t.canEditUnmanagedCollections);if((null==t?void 0:t.permissions.editAnyCollection)||(null==t?void 0:t.allowAdminAccessToAllCollectionItems)&&t.isAdmin)return!0}return this.activeCollection?!0===this.activeCollection.manage:this.allCollections.filter(t=>e.collectionIds.includes(t.id)).some(e=>e.manage)}refreshItems(){const e=this.collections.map(e=>({collection:e})),t=this.ciphers.filter(e=>!this.restrictedItemTypesService.isCipherRestricted(e,this.restrictedTypes)).map(e=>({cipher:e})),i=[].concat(e).concat(t);this.editableItems=i.filter(e=>void 0!==e.cipher||void 0!==e.collection&&(this.canEditCollection(e.collection)||this.canDeleteCollection(e.collection))),this.dataSource.data=i}bulkEditCollectionAccess(){this.event({type:"bulkEditCollectionAccess",items:this.selection.selected.filter(e=>void 0!==e.collection).map(e=>e.collection)})}assignToCollections(){this.event({type:"assignToCollections",items:this.selection.selected.filter(e=>void 0!==e.cipher).map(e=>e.cipher)})}showAssignToCollections(){if(!this.showBulkMove)return!1;if(0===this.allOrganizations.length)return!1;if(0===this.selection.selected.length)return!1;const e=this.hasPersonalItems(),t=this.getUniqueOrganizationIds(),i=this.allCollections.some(e=>!e.readOnly);if(t.size>1)return!1;if(0===t.size&&i)return e;const[n]=t,r=this.allOrganizations.find(e=>e.id===n),s=(null==r?void 0:r.canEditAllCiphers)&&this.viewingOrgVault,o=0===this.selection.selected.filter(e=>e.collection).length;return(s||this.allCiphersHaveEditAccess())&&o&&i}compareNames(e,t){var i,n;const r=e=>{var t,i;return(null===(t=e.collection)||void 0===t?void 0:t.name)||(null===(i=e.cipher)||void 0===i?void 0:i.name)};return null!==(n=null===(i=r(e))||void 0===i?void 0:i.localeCompare(r(t)))&&void 0!==n?n:-1}prioritizeCollections(e,t,i){return e.collection&&!t.collection?"asc"===i?-1:1:!e.collection&&t.collection?"asc"===i?1:-1:0}hasPersonalItems(){return this.selection.selected.some(({cipher:e})=>!(null==e?void 0:e.organizationId))}allCiphersHaveEditAccess(){return this.selection.selected.filter(({cipher:e})=>e).every(({cipher:e})=>(null==e?void 0:e.edit)&&(null==e?void 0:e.viewPassword))}getUniqueOrganizationIds(){return new Set(this.selection.selected.flatMap(e=>{var t,i;return null!==(i=null===(t=e.cipher)||void 0===t?void 0:t.organizationId)&&void 0!==i?i:[]}))}getGroupName(e){var t;return null===(t=this.allGroups.find(t=>t.id===e))||void 0===t?void 0:t.name}getCollectionPermission(e){const t=this.allOrganizations.find(t=>t.id===e.organizationId);return e.id==u.I_&&(null==t?void 0:t.canEditUnassignedCiphers)?f.aF.Edit:e.assigned?(0,f.Jh)(e):"NoAccess"}getCipherPermission(e){var t;if(!e.organizationId||0===e.collectionIds.length)return f.aF.Manage;const i=null===(t=this.allCollections)||void 0===t?void 0:t.filter(t=>{if(t.assigned)return e.collectionIds.find(e=>{if(t.id===e)return t})});if(1===(null==i?void 0:i.length))return(0,f.Jh)(i[0]);if((null==i?void 0:i.length)>0){const e=i.map(e=>(0,f.Jh)(e));return[f.aF.Manage,f.aF.Edit,f.aF.EditExceptPass,f.aF.View,f.aF.ViewExceptPass].find(t=>e.includes(t))}return"NoAccess"}}G.ɵfac=function(e){return new(e||G)(r.rXU(h.y),r.rXU(p.b),r.rXU(y.J))},G.ɵcmp=r.VBU({type:G,selectors:[["app-vault-items"]],inputs:{disabled:"disabled",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",useEvents:"useEvents",showPremiumFeatures:"showPremiumFeatures",showBulkMove:"showBulkMove",showBulkTrashOptions:"showBulkTrashOptions",showAdminActions:"showAdminActions",allOrganizations:"allOrganizations",allCollections:"allCollections",allGroups:"allGroups",showBulkEditCollectionAccess:"showBulkEditCollectionAccess",showBulkAddToCollections:"showBulkAddToCollections",showPermissionsColumn:"showPermissionsColumn",viewingOrgVault:"viewingOrgVault",addAccessStatus:"addAccessStatus",addAccessToggle:"addAccessToggle",activeCollection:"activeCollection",userCanArchive:"userCanArchive",enforceOrgDataOwnershipPolicy:"enforceOrgDataOwnershipPolicy",ciphers:"ciphers",collections:"collections"},outputs:{onEvent:"onEvent"},standalone:!1,decls:33,vars:35,consts:[["headerMenu",""],["bitScrollLayout","",1,"tw-pb-8",3,"itemSize"],["layout","fixed",3,"dataSource"],["header",""],["bitCell","","colspan","2",1,"tw-w-24","tw-whitespace-nowrap"],["type","checkbox","bitCheckbox","","id","checkAll",1,"tw-mr-2",3,"change","disabled","checked"],["for","checkAll",1,"tw-mb-0","!tw-font-medium","!tw-text-muted"],["bitCell","","bitSortable","name",3,"fn","class",4,"ngIf"],["bitCell","",3,"class",4,"ngIf"],["bitCell","","class","tw-hidden tw-w-2/5 lg:tw-table-cell",4,"ngIf"],["bitCell","","class","tw-w-2/5",4,"ngIf"],["bitCell","","bitSortable","groups","class","tw-w-2/5",3,"fn",4,"ngIf"],["bitCell","","bitSortable","permissions","default","desc","class","tw-w-2/5",3,"fn",4,"ngIf"],["bitCell","",1,"tw-w-12","tw-text-right"],["bitIconButton","bwi-ellipsis-v","size","small","type","button",3,"disabled","bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["body",""],["bitCell","","bitSortable","name",3,"fn"],["bitCell",""],["bitCell","",1,"tw-hidden","tw-w-2/5","lg:tw-table-cell"],["bitCell","",1,"tw-w-2/5"],["bitCell","","bitSortable","groups",1,"tw-w-2/5",3,"fn"],["bitCell","","bitSortable","permissions","default","desc",1,"tw-w-2/5",3,"fn"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-folder"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-users"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection-shared"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-archive"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-unarchive"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],[4,"cdkVirtualFor","cdkVirtualForOf","cdkVirtualForTemplateCacheSize"],["bitRow","","appVaultCollectionRow","","alignContent","middle",3,"disabled","collection","showOwner","showCollections","showGroups","organizations","showPermissionsColumn","groups","canDeleteCollection","canEditCollection","canViewCollectionInfo","checked","checkedToggled","onEvent",4,"ngIf"],["bitRow","","appVaultCipherRow","","alignContent","middle",3,"disabled","cipher","showOwner","showCollections","showGroups","showPremiumFeatures","useEvents","viewingOrgVault","cloneable","organizations","collections","checked","canEditCipher","canAssignCollections","canManageCollection","canDeleteCipher","canRestoreCipher","userCanArchive","enforceOrgDataOwnershipPolicy","archiveEnabled","checkedToggled","onEvent",4,"ngIf"],["bitRow","","appVaultCollectionRow","","alignContent","middle",3,"checkedToggled","onEvent","disabled","collection","showOwner","showCollections","showGroups","organizations","showPermissionsColumn","groups","canDeleteCollection","canEditCollection","canViewCollectionInfo","checked"],["bitRow","","appVaultCipherRow","","alignContent","middle",3,"checkedToggled","onEvent","disabled","cipher","showOwner","showCollections","showGroups","showPremiumFeatures","useEvents","viewingOrgVault","cloneable","organizations","collections","checked","canEditCipher","canAssignCollections","canManageCollection","canDeleteCipher","canRestoreCipher","userCanArchive","enforceOrgDataOwnershipPolicy","archiveEnabled"]],template:function(e,t){if(1&e){const e=r.RV6();r.j41(0,"cdk-virtual-scroll-viewport",1)(1,"bit-table",2),r.qex(2,3),r.j41(3,"tr")(4,"th",4)(5,"input",5),r.bIt("change",function(i){return g.eBV(e),g.Njj(i?t.toggleAll():null)}),r.k0s(),r.j41(6,"label",6),r.EFF(7),r.nI1(8,"i18n"),r.k0s()(),r.DNE(9,b,3,6,"th",7)(10,w,3,5,"th",8)(11,S,3,3,"th",9)(12,I,3,3,"th",10)(13,k,3,4,"th",11)(14,C,3,4,"th",12),r.j41(15,"th",13),r.SS7(16),r.nI1(17,"async"),r.nrm(18,"button",14),r.nI1(19,"i18n"),r.nI1(20,"i18n"),r.j41(21,"bit-menu",null,0),r.DNE(23,T,4,3,"button",15)(24,F,4,3,"button",15)(25,R,4,3,"button",15)(26,P,4,3,"button",15)(27,x,4,3,"button",15)(28,$,4,3,"button",15),r.nI1(29,"async"),r.DNE(30,E,5,3,"button",15),r.nI1(31,"async"),r.k0s()()(),r.bVm(),r.DNE(32,M,1,2,"ng-template",16),r.k0s()()}if(2&e){const e=r.sdS(22);r.Y8G("itemSize",t.RowHeight),r.R7$(),r.Y8G("dataSource",t.dataSource),r.R7$(4),r.Y8G("disabled",t.disabled||t.isEmpty)("checked",t.selection.hasValue()&&t.isAllSelected),r.R7$(2),r.JRh(r.bMT(8,23,"all")),r.R7$(2),r.Y8G("ngIf",t.showAdminActions),r.R7$(),r.Y8G("ngIf",!t.showAdminActions),r.R7$(),r.Y8G("ngIf",t.showOwner),r.R7$(),r.Y8G("ngIf",t.showCollections),r.R7$(),r.Y8G("ngIf",t.showGroups),r.R7$(),r.Y8G("ngIf",t.showPermissionsColumn);const i=r.bMT(17,25,t.disableMenu$);r.R7$(4),r.Y8G("label",r.mNQ(r.bMT(19,27,"options")))("disabled",t.disabled||t.isEmpty||i)("bitMenuTriggerFor",e),r.BMQ("title",i?r.bMT(20,29,"missingPermissions"):""),r.R7$(5),r.Y8G("ngIf",t.bulkMoveAllowed),r.R7$(),r.Y8G("ngIf",t.showAdminActions&&t.showBulkEditCollectionAccess),r.R7$(),r.Y8G("ngIf",(t.showAdminActions||t.showAssignToCollections())&&t.bulkAssignToCollectionsAllowed),r.R7$(),r.Y8G("ngIf",t.bulkArchiveAllowed),r.R7$(),r.Y8G("ngIf",t.bulkUnarchiveAllowed),r.R7$(),r.Y8G("ngIf",r.bMT(29,31,t.canRestoreSelected$)),r.R7$(2),r.Y8G("ngIf",r.bMT(31,33,t.canDeleteSelected$))}},encapsulation:2})},85776:(e,t,i)=>{"use strict";var n,r,s,o,a,l;i.d(t,{Ah:()=>n,QI:()=>r}),function(e){e[e.None=0]="None",e[e.OpenIdConnect=1]="OpenIdConnect",e[e.Saml2=2]="Saml2"}(n||(n={})),function(e){e[e.MasterPassword=0]="MasterPassword",e[e.KeyConnector=1]="KeyConnector",e[e.TrustedDeviceEncryption=2]="TrustedDeviceEncryption"}(r||(r={})),function(e){e[e.RedirectGet=0]="RedirectGet",e[e.FormPost=1]="FormPost"}(s||(s={})),function(e){e[e.HttpRedirect=1]="HttpRedirect",e[e.HttpPost=2]="HttpPost"}(o||(o={})),function(e){e[e.NotConfigured=0]="NotConfigured",e[e.Unspecified=1]="Unspecified",e[e.EmailAddress=2]="EmailAddress",e[e.X509SubjectName=3]="X509SubjectName",e[e.WindowsDomainQualifiedName=4]="WindowsDomainQualifiedName",e[e.KerberosPrincipalName=5]="KerberosPrincipalName",e[e.EntityIdentifier=6]="EntityIdentifier",e[e.Persistent=7]="Persistent",e[e.Transient=8]="Transient"}(a||(a={})),function(e){e[e.IfIdpWantAuthnRequestsSigned=0]="IfIdpWantAuthnRequestsSigned",e[e.Always=1]="Always",e[e.Never=3]="Never"}(l||(l={}))},85800:(e,t,i)=>{"use strict";i.d(t,{r:()=>m});var n=i(60989),r=i(94573),s=i(33812),o=i(22191),a=i(89207),l=i(75583),c=i(74208),d=i(36288),u=i(58806),h=i(25740);function p(e,t){if(1&e){const e=s.RV6();s.j41(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h2",4),s.EFF(5),s.k0s(),s.j41(6,"button",5),s.nI1(7,"i18n"),s.bIt("click",function(){c.eBV(e);const t=s.XpG();return c.Njj(t.closed.emit())}),s.k0s()(),s.j41(8,"div",6),s.SdG(9),s.k0s()()(),s.nrm(10,"div",7),s.k0s()}if(2&e){const e=s.XpG();s.BMQ("aria-label",e.title()),s.R7$(5),s.SpI(" ",e.title()," "),s.R7$(),s.Y8G("label",s.bMT(7,3,"close"))}}class m{constructor(){this.templateRef=r.ebz.required(s.C4Q),this.title=(0,r.hFB)(""),this.closed=new s.bkB}}m.ɵfac=function(e){return new(e||m)},m.ɵcmp=s.VBU({type:m,selectors:[["bit-popover"]],viewQuery:function(e,t){1&e&&s.wEZ(t.templateRef,s.C4Q,5),2&e&&s.NyB()},inputs:{title:[1,"title"]},outputs:{closed:"closed"},exportAs:["popoverComponent"],ngContentSelectors:["*"],decls:1,vars:0,consts:[["cdkTrapFocus","","cdkTrapFocusAutoCapture","","role","dialog","aria-modal","true",1,"tw-relative"],[1,"tw-overflow-hidden","tw-rounded-xl","tw-shadow-lg"],[1,"tw-relative","tw-z-20","tw-w-72","tw-break-words","tw-bg-primary-100","tw-pb-4","tw-pt-2","tw-text-main"],[1,"tw-me-2","tw-flex","tw-items-start","tw-justify-between","tw-gap-4","tw-ps-4"],["bitTypography","h5",1,"tw-font-medium","tw-mt-1"],["type","button","bitIconButton","bwi-close","size","small",3,"click","label"],["bitTypography","body2",1,"tw-px-4"],[1,"bit-popover-arrow"]],template:function(e,t){1&e&&(s.NAR(),s.DNE(0,p,11,5,"ng-template"))},dependencies:[n.Pd,n.kB,o.Q,d.s,a.G,l.E,u.r,h.$],encapsulation:2})},86157:(e,t,i)=>{"use strict";i.d(t,{v:()=>n});class n{}},86214:(e,t,i)=>{"use strict";i.d(t,{_:()=>n});class n{}},86226:(e,t,i)=>{"use strict";i.d(t,{j:()=>v});var n=i(77468),r=i(94573),s=i(33812),o=i(90246);const a=["*",[["","slot","end"]]],l=e=>({"tw-truncate":e});function c(e,t){1&e&&s.SdG(0,1)}function d(e,t){1&e&&s.eu8(0)}function u(e,t){if(1&e&&s.DNE(0,d,1,0,"ng-container",2),2&e){s.XpG();const e=s.sdS(1);s.Y8G("ngTemplateOutlet",e)}}function h(e,t){1&e&&s.eu8(0)}function p(e,t){if(1&e&&s.DNE(0,h,1,0,"ng-container",2),2&e){s.XpG();const e=s.sdS(1);s.Y8G("ngTemplateOutlet",e)}}let m=0;class v{constructor(e,t){this.elementRef=e,this.parentFormControl=t,this.classList=["tw-inline-flex","tw-gap-1","tw-items-baseline","tw-flex-row","tw-min-w-0"],this.id=(0,r.hFB)("bit-label-"+m++)}get title(){var e,t;return null!==(t=null===(e=this.elementRef.nativeElement.textContent)||void 0===e?void 0:e.trim())&&void 0!==t?t:""}get isInsideFormControl(){return!!this.parentFormControl}}v.ɵfac=function(e){return new(e||v)(s.rXU(s.aKT),s.rXU(o.f,8))},v.ɵcmp=s.VBU({type:v,selectors:[["bit-label"]],hostVars:4,hostBindings:function(e,t){2&e&&(s.Avn("id",t.id())("title",t.title),s.HbH(t.classList))},inputs:{id:[1,"id"]},ngContentSelectors:["*","[slot=end]"],decls:6,vars:5,consts:[["endSlotContent",""],[3,"ngClass"],[4,"ngTemplateOutlet"]],template:function(e,t){1&e&&(s.NAR(a),s.DNE(0,c,1,0,"ng-template",null,0,s.C5r),s.j41(2,"span",1),s.SdG(3),s.nVh(4,u,1,1,"ng-container"),s.k0s(),s.nVh(5,p,1,1,"ng-container")),2&e&&(s.R7$(2),s.Y8G("ngClass",s.eq3(3,l,!t.isInsideFormControl)),s.R7$(2),s.vxM(t.isInsideFormControl?4:-1),s.R7$(),s.vxM(t.isInsideFormControl?-1:5))},dependencies:[n.MD,n.YU,n.T3],encapsulation:2})},86346:(e,t,i)=>{"use strict";i.d(t,{Z:()=>s});var n=i(31442),r=i(8583);class s extends r.n{constructor(e){super(),this.type=n.ak.Generic,e&&(this.type=e.type)}get subTitle(){}static fromJSON(e){return Object.assign(new s,e)}static fromSdkSecureNoteView(e){const t=new s;return t.type=e.type,t}toSdkSecureNoteView(){return this}}},86388:(e,t,i)=>{"use strict";i.d(t,{v:()=>n});class n{}},86561:(e,t,i)=>{"use strict";i.d(t,{K:()=>n.K});var n=i(55393)},86639:(e,t,i)=>{"use strict";i.d(t,{z:()=>Fi});var n=i(77468),r=i(74208),s=i(33812),o=i(83731),a=i(51757),l=i(66046),c=i(16878),d=i(72245),u=i(44500),h=i(3633),p=i(31442),m=i(75751),v=i(45154),f=i(37579),g=i(75583),y=i(98403),b=i(26411),w=i(8433);class S{}var I=i(47836);class k{constructor(){this.viewCacheService=(0,r.WQX)(I.Z),this.cipherCache=this.viewCacheService.signal({key:"cipher-form-cache",initialValue:null,deserializer:m.f.fromJSON}),this.initializedWithValue=!!this.cipherCache()}cacheCipherView(e){this.cipherCache.set(m.f.fromJSON(e))}getCachedCipherView(){return this.cipherCache()}clearCache(){this.cipherCache.set(null)}}k.ɵfac=function(e){return new(e||k)},k.ɵprov=r.jDH({token:k,factory:k.ɵfac});var C=i(27442),T=i(58625),F=i(58950),R=i(14318),P=i(47135),x=i(26477),$=i(89591),E=i(34003),A=i(88507),D=i(11573),O=i(6528),M=i(11766),U=i(67036),G=i(14093),j=i(22191),N=i(81525),V=i(81573),B=i(29029),z=i(50700),L=i(7730),K=i(68016),q=i(56898),_=i(86226),X=i(93199),Y=i(97553),H=i(43759),W=i(33886),J=i(68923),Z=i(36288),Q=i(88016);function ee(e,t){if(1&e&&s.nrm(0,"bit-option",12),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}function te(e,t){if(1&e&&(s.j41(0,"bit-form-field")(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",10),s.DNE(5,ee,1,2,"bit-option",11),s.k0s(),s.j41(6,"bit-hint"),s.EFF(7),s.k0s()()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"fieldType")),s.R7$(3),s.Y8G("ngForOf",e.fieldTypeOptions),s.R7$(2),s.SpI(" ",e.getTypeHint()," ")}}function ie(e,t){1&e&&(s.j41(0,"bit-hint"),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e&&(s.R7$(),s.SpI(" ",s.bMT(2,1,"linkedLabelHelpText")," "))}function ne(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",13),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.removeField())}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("label",s.i5U(1,1,"deleteCustomField",e.customFieldForm.value.label))}}class re{constructor(e,t,i){this.data=e,this.formBuilder=t,this.i18nService=i,this.customFieldForm=this.formBuilder.group({type:p.PU.Text,label:["",a.k0.required]}),this.fieldTypeOptions=[{name:this.i18nService.t("cfTypeText"),value:p.PU.Text},{name:this.i18nService.t("cfTypeHidden"),value:p.PU.Hidden},{name:this.i18nService.t("cfTypeCheckbox"),value:p.PU.Boolean},{name:this.i18nService.t("cfTypeLinked"),value:p.PU.Linked}],this.FieldType=p.PU,this.submit=()=>{"add"===this.variant?this.addField():this.updateLabel()},this.variant=e.editLabelConfig?"edit":"add",this.fieldTypeOptions=this.fieldTypeOptions.filter(e=>(!this.data.disallowHiddenField||e.value!==p.PU.Hidden)&&(this.data.cipherType!==p.gC.SecureNote&&this.data.cipherType!==p.gC.SshKey||e.value!==p.PU.Linked)),"edit"===this.variant&&(this.customFieldForm.controls.label.setValue(e.editLabelConfig.label),this.customFieldForm.controls.type.disable())}getTypeHint(){var e;switch(null===(e=this.customFieldForm.get("type"))||void 0===e?void 0:e.value){case p.PU.Text:return this.i18nService.t("textHelpText");case p.PU.Hidden:return this.i18nService.t("hiddenHelpText");case p.PU.Boolean:return this.i18nService.t("checkBoxHelpText");case p.PU.Linked:return this.i18nService.t("linkedHelpText");default:return""}}addField(){if(this.customFieldForm.invalid)return;const{type:e,label:t}=this.customFieldForm.value;this.data.addField(e,t)}updateLabel(){if(this.customFieldForm.invalid)return;const{label:e}=this.customFieldForm.value;this.data.updateLabel(this.data.editLabelConfig.index,e)}removeField(){this.data.removeField(this.data.editLabelConfig.index)}}re.ɵfac=function(e){return new(e||re)(s.rXU(N.Qs),s.rXU(a.ok),s.rXU(z.W))},re.ɵcmp=s.VBU({type:re,selectors:[["vault-add-edit-custom-field-dialog"]],decls:21,vars:18,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["disableMargin",""],["bitInput","","id","fieldLabel","formControlName","label","type","text"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit",3,"disabled"],["bitButton","","bitDialogClose","","buttonType","secondary","type","button"],["type","button","buttonType","danger","class","tw-ml-auto","bitIconButton","bwi-trash",3,"label","click",4,"ngIf"],["id","fieldType","formControlName","type"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],["type","button","buttonType","danger","bitIconButton","bwi-trash",1,"tw-ml-auto",3,"click","label"]],template:function(e,t){1&e&&(s.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.j41(5,"div",2),s.DNE(6,te,8,5,"bit-form-field",3),s.j41(7,"bit-form-field",4)(8,"bit-label"),s.EFF(9),s.nI1(10,"i18n"),s.k0s(),s.nrm(11,"input",5),s.DNE(12,ie,3,3,"bit-hint",3),s.k0s()(),s.qex(13,6),s.j41(14,"button",7),s.EFF(15),s.nI1(16,"i18n"),s.k0s(),s.j41(17,"button",8),s.EFF(18),s.nI1(19,"i18n"),s.k0s(),s.DNE(20,ne,2,4,"button",9),s.bVm(),s.k0s()()),2&e&&(s.Y8G("formGroup",t.customFieldForm)("bitSubmit",t.submit),s.R7$(3),s.SpI(" ",s.bMT(4,10,"add"===t.variant?"addField":"editField")," "),s.R7$(3),s.Y8G("ngIf","add"===t.variant),s.R7$(3),s.JRh(s.bMT(10,12,"fieldLabel")),s.R7$(3),s.Y8G("ngIf",t.customFieldForm.value.type===t.FieldType.Linked),s.R7$(2),s.Y8G("disabled",t.customFieldForm.invalid),s.R7$(),s.SpI(" ",s.bMT(16,14,"add"===t.variant?"add":"save")," "),s.R7$(3),s.SpI(" ",s.bMT(19,16,"cancel")," "),s.R7$(2),s.Y8G("ngIf","edit"===t.variant))},dependencies:[n.MD,n.Sq,n.bT,T.p,V.P,L.I,K.m,B.t,q.Q,b.L,_.j,X.I,Y.J,H.h,w.p,W.w,J.P,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,j.Q,Z.s,f.C,v.L,Q.$],encapsulation:2});var se=i(21274),oe=i(60989),ae=i(81582),le=i(90246),ce=i(76356),de=i(69896),ue=i(58806),he=i(50352),pe=i(59032),me=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ve=["customFieldRow"],fe=e=>({"tw-mb-0":e}),ge=e=>({"tw-items-center":e});function ye(e,t){if(1&e&&(s.j41(0,"bit-form-field",12)(1,"bit-label"),s.EFF(2),s.k0s(),s.nrm(3,"input",13),s.k0s()),2&e){const e=s.XpG().$implicit;s.R7$(2),s.JRh(e.value.name)}}function be(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",16),s.bIt("toggledChange",function(t){r.eBV(e);const i=s.XpG(4);return r.Njj(i.logHiddenEvent(t))}),s.k0s()}}function we(e,t){if(1&e&&(s.j41(0,"bit-form-field",12)(1,"bit-label"),s.EFF(2),s.k0s(),s.nrm(3,"input",14),s.DNE(4,be,1,0,"button",15),s.k0s()),2&e){const e=s.XpG(),t=e.$implicit,i=e.index,n=s.XpG(2);s.R7$(2),s.JRh(t.value.name),s.R7$(2),s.Y8G("ngIf",n.canViewPasswords(i))}}function Se(e,t){if(1&e&&(s.j41(0,"bit-form-control",12),s.nrm(1,"input",17),s.j41(2,"bit-label"),s.EFF(3),s.k0s()()),2&e){const e=s.XpG().$implicit;s.R7$(3),s.JRh(e.value.name)}}function Ie(e,t){if(1&e&&s.nrm(0,"bit-option",20),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}function ke(e,t){if(1&e&&(s.j41(0,"bit-form-field",12)(1,"bit-label"),s.EFF(2),s.k0s(),s.j41(3,"bit-select",18),s.DNE(4,Ie,1,2,"bit-option",19),s.k0s()()),2&e){const e=s.XpG().$implicit,t=s.XpG(2);s.R7$(2),s.JRh(e.value.name),s.R7$(2),s.Y8G("ngForOf",t.linkedFieldOptions)}}function Ce(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",21),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG(),i=t.$implicit,n=t.index,o=s.XpG(2);return r.Njj(o.openAddEditCustomFieldDialog({index:n,label:i.value.name}))}),s.k0s()}if(2&e){const e=s.XpG().$implicit,t=s.XpG(2);s.Y8G("label",s.i5U(1,2,"editFieldLabel",e.value.name))("disabled",t.parentFormDisabled)}}function Te(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",22),s.nI1(1,"i18n"),s.bIt("keydown",function(t){r.eBV(e);const i=s.XpG(),n=i.$implicit,o=i.index,a=s.XpG(2);return r.Njj(a.handleKeyDown(t,n.value.name,o))}),s.k0s()}if(2&e){const e=s.XpG().$implicit,t=s.XpG(2);s.Y8G("label",s.i5U(1,2,"reorderToggleButton",e.value.name))("disabled",t.parentFormDisabled)}}function Fe(e,t){if(1&e&&(s.j41(0,"div",8,0),s.DNE(2,ye,4,1,"bit-form-field",9)(3,we,5,2,"bit-form-field",9)(4,Se,4,1,"bit-form-control",9)(5,ke,5,2,"bit-form-field",9)(6,Ce,2,5,"button",10)(7,Te,2,5,"button",11),s.k0s()),2&e){const e=t.$implicit,i=t.index,n=s.XpG(2);s.Y8G("formGroupName",i)("ngClass",s.eq3(10,ge,e.value.type===n.FieldType.Boolean))("cdkDragDisabled",!n.canEdit(e.value.type)),s.BMQ("data-testid",e.value.name+"-entry"),s.R7$(2),s.Y8G("ngIf",e.value.type===n.FieldType.Text),s.R7$(),s.Y8G("ngIf",e.value.type===n.FieldType.Hidden),s.R7$(),s.Y8G("ngIf",e.value.type===n.FieldType.Boolean),s.R7$(),s.Y8G("ngIf",e.value.type===n.FieldType.Linked),s.R7$(),s.Y8G("ngIf",n.canEdit(e.value.type)),s.R7$(),s.Y8G("ngIf",n.canEdit(e.value.type)&&n.fields.controls.length>1)}}function Re(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",23),s.bIt("click",function(){r.eBV(e);const t=s.XpG(2);return r.Njj(t.openAddEditCustomFieldDialog())}),s.nrm(1,"i",24),s.EFF(2),s.nI1(3,"i18n"),s.k0s()}2&e&&(s.R7$(2),s.SpI(" ",s.bMT(3,1,"addField")," "))}function Pe(e,t){if(1&e){const e=s.RV6();s.j41(0,"section",2)(1,"bit-section-header")(2,"h2",3),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"form",4)(6,"bit-card",5),s.bIt("cdkDropListDropped",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.drop(t))}),s.DNE(7,Fe,8,12,"div",6)(8,Re,4,3,"button",7),s.k0s()()()}if(2&e){const e=s.XpG();s.Y8G("ngClass",s.eq3(7,fe,e.disableSectionMargin)),s.R7$(3),s.JRh(s.bMT(4,5,"customFields")),s.R7$(2),s.Y8G("formGroup",e.customFieldsForm),s.R7$(2),s.Y8G("ngForOf",e.fields.controls),s.R7$(),s.Y8G("ngIf",!e.isPartialEdit&&!e.parentFormDisabled)}}class xe{constructor(e,t,i,n,c,d){this.dialogService=e,this.cipherFormContainer=t,this.formBuilder=i,this.i18nService=n,this.liveAnnouncer=c,this.eventCollectionService=d,this.numberOfFieldsChange=new s.bkB,this.customFieldsForm=this.formBuilder.group({fields:new a.Yp([])}),this.linkedFieldOptions=[],this.hasCustomFields=!1,this.focusOnNewInput$=new l.B,this.parentFormDisabled=!1,this.FieldType=p.PU,this.destroyed$=(0,r.WQX)(r.abz),this.cipherFormContainer.registerChildForm("customFields",this.customFieldsForm),this.customFieldsForm.valueChanges.pipe((0,o.pQ)()).subscribe(()=>{this.updateCipher(this.fields.getRawValue())}),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)()).subscribe(e=>{this.parentFormDisabled="disabled"===e})}get fields(){return this.customFieldsForm.controls.fields}canEdit(e){return!this.isPartialEdit&&(e!==p.PU.Hidden||null===this.cipherFormContainer.originalCipherView||this.cipherFormContainer.originalCipherView.viewPassword)}ngOnInit(){var e,t;const i=this.getLinkedFieldsOptionsForCipher(),n=Array.from(null!==(e=null==i?void 0:i.entries())&&void 0!==e?e:[]);n.sort((e,t)=>e[1].sortPosition-t[1].sortPosition),this.linkedFieldOptions=n.map(([e,t])=>({name:this.i18nService.t(t.i18nKey),value:e}));const r=this.cipherFormContainer.getInitialCipherView();null===(t=null==r?void 0:r.fields)||void 0===t||t.forEach(e=>{var t;let i=e.value;e.type===p.PU.Boolean&&(i="true"===e.value);const n=this.formBuilder.group({type:e.type,name:e.name,value:i,linkedId:e.linkedId,newField:!1});e.type!==p.PU.Hidden||(null===(t=this.cipherFormContainer.originalCipherView)||void 0===t?void 0:t.viewPassword)||n.controls.value.disable(),this.fields.push(n)}),"partial-edit"===this.cipherFormContainer.config.mode&&(this.isPartialEdit=!0,this.customFieldsForm.disable())}ngAfterViewInit(){(0,A.y)(this.focusOnNewInput$,this.customFieldRows.changes).pipe((0,o.pQ)(this.destroyed$)).subscribe(()=>{const e=this.customFieldRows.last.nativeElement,t=e.querySelector("input"),i=e.querySelector("label").textContent.trim();this.liveAnnouncer.announce(this.i18nService.t("fieldAdded",i),"polite").then(()=>{t.focus()})})}openAddEditCustomFieldDialog(e){const{cipherType:t,mode:i,originalCipher:n}=this.cipherFormContainer.config;this.dialogRef=this.dialogService.open(re,{data:{addField:this.addField.bind(this),updateLabel:this.updateLabel.bind(this),removeField:this.removeField.bind(this),cipherType:t,editLabelConfig:e,disallowHiddenField:"edit"===i&&!n.viewPassword}})}canViewPasswords(e){return null===this.cipherFormContainer.originalCipherView||(this.cipherFormContainer.originalCipherView.viewPassword||this.fields.at(e).value.newField)}updateLabel(e,t){var i;this.fields.at(e).patchValue({name:t}),null===(i=this.dialogRef)||void 0===i||i.close()}removeField(e){var t;this.fields.removeAt(e),null===(t=this.dialogRef)||void 0===t||t.close()}addField(e,t){var i;null===(i=this.dialogRef)||void 0===i||i.close();let n=null,r=null;e===p.PU.Boolean&&(n=!1),e===p.PU.Linked&&this.linkedFieldOptions.length>0&&(r=this.linkedFieldOptions[0].value),this.fields.push(this.formBuilder.group({type:e,name:t,value:n,linkedId:r,newField:!0})),this.focusOnNewInput$.next()}drop(e){(0,E.HD)(this.fields.controls,e.previousIndex,e.currentIndex),this.updateCipher(this.fields.controls.map(e=>e.value))}handleKeyDown(e,t,i){return me(this,void 0,void 0,function*(){if("ArrowUp"===e.key&&0!==i){e.preventDefault();const n=i-1;this.drop({previousIndex:i,currentIndex:n}),yield this.liveAnnouncer.announce(this.i18nService.t("reorderFieldUp",t,n+1,this.fields.length),"assertive"),setTimeout(()=>{e.target.focus()})}if("ArrowDown"===e.key&&i!==this.fields.length-1){e.preventDefault();const n=i+1;this.drop({previousIndex:i,currentIndex:n}),yield this.liveAnnouncer.announce(this.i18nService.t("reorderFieldDown",t,n+1,this.fields.length),"assertive")}})}logHiddenEvent(e){return me(this,void 0,void 0,function*(){const{mode:t,originalCipher:i}=this.cipherFormContainer.config,n=["edit","partial-edit"].includes(t);e&&n&&(yield this.eventCollectionService.collect(D.Bx.Cipher_ClientToggledHiddenFieldVisible,i.id,!1,i.organizationId))})}getLinkedFieldsOptionsForCipher(){switch(this.cipherFormContainer.config.cipherType){case p.gC.Login:return G.r.prototype.linkedFieldOptions;case p.gC.Card:return O.G.prototype.linkedFieldOptions;case p.gC.Identity:return U.O.prototype.linkedFieldOptions;default:return null}}updateCipher(e){const t=e.map(e=>{var t;let i;i="number"==typeof e.value?`${e.value}`:"boolean"==typeof e.value?e.value?"true":"false":e.value;const n=new M.g;return n.type=e.type,n.name=e.name,n.value=i,n.linkedId=null!==(t=e.linkedId)&&void 0!==t?t:void 0,n});this.hasCustomFields=t.length>0,this.numberOfFieldsChange.emit(t.length),this.cipherFormContainer.patchCipher(e=>(e.fields=t,e))}}xe.ɵfac=function(e){return new(e||xe)(s.rXU(se.o3),s.rXU(S),s.rXU(a.ok),s.rXU(z.W),s.rXU(oe.Ai),s.rXU(ae.c))},xe.ɵcmp=s.VBU({type:xe,selectors:[["vault-custom-fields"]],viewQuery:function(e,t){if(1&e&&s.GBs(ve,5),2&e){let e;s.mGM(e=s.lsd())&&(t.customFieldRows=e)}},inputs:{disableSectionMargin:"disableSectionMargin"},outputs:{numberOfFieldsChange:"numberOfFieldsChange"},decls:1,vars:1,consts:[["customFieldRow",""],["class","tw-mb-5 bit-compact:tw-mb-4",3,"ngClass",4,"ngIf"],[1,"tw-mb-5","bit-compact:tw-mb-4",3,"ngClass"],["bitTypography","h6"],[3,"formGroup"],["formArrayName","fields","cdkDropList","","data-testid","custom-fields",3,"cdkDropListDropped"],["class","tw-flex tw-p-3 -tw-mx-3 tw-gap-4 tw-bg-background tw-rounded-lg first:-tw-mt-3 last-of-type:tw-mb-0","cdkDrag","",3,"formGroupName","ngClass","cdkDragDisabled",4,"ngFor","ngForOf"],["type","button","bitLink","","linkType","primary","data-testid","add-field-button",3,"click",4,"ngIf"],["cdkDrag","",1,"tw-flex","tw-p-3","-tw-mx-3","tw-gap-4","tw-bg-background","tw-rounded-lg","first:-tw-mt-3","last-of-type:tw-mb-0",3,"formGroupName","ngClass","cdkDragDisabled"],["class","tw-flex-1","disableMargin","",4,"ngIf"],["type","button","bitIconButton","bwi-pencil-square","class","tw-self-center tw-mt-2","data-testid","edit-custom-field-button",3,"label","disabled","click",4,"ngIf"],["type","button","bitIconButton","bwi-drag-and-drop","class","tw-self-center tw-mt-2","cdkDragHandle","","data-testid","reorder-toggle-button",3,"label","disabled","keydown",4,"ngIf"],["disableMargin","",1,"tw-flex-1"],["bitInput","","formControlName","value","data-testid","custom-text-field"],["bitInput","","formControlName","value","type","password","data-testid","custom-hidden-field",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-custom-hidden-field",3,"toggledChange",4,"ngIf"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-custom-hidden-field",3,"toggledChange"],["bitCheckbox","","formControlName","value","type","checkbox","data-testid","custom-boolean-field"],["formControlName","linkedId","data-testid","custom-linked-field"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],["type","button","bitIconButton","bwi-pencil-square","data-testid","edit-custom-field-button",1,"tw-self-center","tw-mt-2",3,"click","label","disabled"],["type","button","bitIconButton","bwi-drag-and-drop","cdkDragHandle","","data-testid","reorder-toggle-button",1,"tw-self-center","tw-mt-2",3,"keydown","label","disabled"],["type","button","bitLink","","linkType","primary","data-testid","add-field-button",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","tw-font-medium"]],template:function(e,t){1&e&&s.DNE(0,Pe,9,9,"section",1),2&e&&s.Y8G("ngIf",t.hasCustomFields)},dependencies:[T.p,n.MD,n.YU,n.Sq,n.bT,a.YN,a.qT,a.me,a.Zm,a.BC,a.cb,b.L,le.f,_.j,Y.J,H.h,ce.e,de.a,a.X1,a.j4,a.JD,a.$R,a.v8,F.U,g.E,ue.r,R.i,j.Q,Z.s,P.q,he.P,w.p,W.w,J.P,E.ad,E.O7,E.T1,E.Fb,x.V,pe.o,Q.$],encapsulation:2});var $e=i(94573);const Ee=e=>({"tw-mb-0":e});function Ae(e,t){if(1&e&&(s.j41(0,"bit-form-control",6),s.nrm(1,"input",7),s.j41(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s()()),2&e){const e=s.XpG();s.Y8G("disableMargin",e.hasCustomFields||e.isPartialEdit),s.R7$(3),s.JRh(s.bMT(4,2,"passwordPrompt"))}}function De(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",8),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.addCustomField())}),s.nrm(1,"i",9),s.EFF(2),s.nI1(3,"i18n"),s.k0s()}2&e&&(s.R7$(2),s.SpI(" ",s.bMT(3,1,"addField")," "))}class Oe{get allowNewField(){return this.additionalOptionsForm.enabled}constructor(e,t,i,n){this.cipherFormContainer=e,this.formBuilder=t,this.passwordRepromptService=i,this.changeDetectorRef=n,this.additionalOptionsForm=this.formBuilder.group({notes:[null],reprompt:[!1]}),this.passwordRepromptEnabled$=this.passwordRepromptService.enabled$.pipe((0,C.t)({refCount:!1,bufferSize:1})),this.hasCustomFields=!1,this.isPartialEdit=!1,this.cipherFormContainer.registerChildForm("additionalOptions",this.additionalOptionsForm),this.additionalOptionsForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>(t.notes=e.notes,t.reprompt=e.reprompt?p.b1.Password:p.b1.None,t))})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e&&this.additionalOptionsForm.patchValue({notes:e.notes,reprompt:e.reprompt===p.b1.Password}),"partial-edit"===this.cipherFormContainer.config.mode&&(this.additionalOptionsForm.disable(),this.isPartialEdit=!0)}addCustomField(){this.customFieldsComponent.openAddEditCustomFieldDialog()}handleCustomFieldChange(e){this.hasCustomFields=e>0,this.changeDetectorRef.detectChanges()}}Oe.ɵfac=function(e){return new(e||Oe)(s.rXU(S),s.rXU(a.ok),s.rXU($.q),s.rXU($e.gRc))},Oe.ɵcmp=s.VBU({type:Oe,selectors:[["vault-additional-options-section"]],viewQuery:function(e,t){if(1&e&&s.GBs(xe,5),2&e){let e;s.mGM(e=s.lsd())&&(t.customFieldsComponent=e.first)}},inputs:{disableSectionMargin:"disableSectionMargin"},decls:15,vars:15,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"ngClass","formGroup"],["bitTypography","h6"],["bitInput","","rows","5","formControlName","notes"],[3,"disableMargin",4,"ngIf"],["bitLink","","type","button","linkType","primary",3,"click",4,"ngIf"],[3,"numberOfFieldsChange","disableSectionMargin"],[3,"disableMargin"],["type","checkbox","bitCheckbox","","formControlName","reprompt"],["bitLink","","type","button","linkType","primary",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","tw-font-medium"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),s.EFF(8),s.nI1(9,"i18n"),s.k0s(),s.nrm(10,"textarea",2),s.k0s(),s.DNE(11,Ae,5,4,"bit-form-control",3),s.nI1(12,"async"),s.DNE(13,De,4,3,"button",4),s.k0s()(),s.j41(14,"vault-custom-fields",5),s.bIt("numberOfFieldsChange",function(e){return t.handleCustomFieldChange(e)}),s.k0s()),2&e&&(s.Y8G("ngClass",s.eq3(13,Ee,t.disableSectionMargin&&!t.hasCustomFields))("formGroup",t.additionalOptionsForm),s.R7$(3),s.JRh(s.bMT(4,7,"additionalOptions")),s.R7$(5),s.JRh(s.bMT(9,9,"notes")),s.R7$(3),s.Y8G("ngIf",s.bMT(12,11,t.passwordRepromptEnabled$)),s.R7$(2),s.Y8G("ngIf",!t.hasCustomFields&&!t.isPartialEdit&&t.allowNewField),s.R7$(),s.Y8G("disableSectionMargin",t.disableSectionMargin))},dependencies:[n.MD,n.YU,n.bT,F.U,g.E,ue.r,T.p,R.i,b.L,le.f,_.j,Y.J,H.h,a.X1,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,P.q,he.P,xe,x.V,pe.o,n.Jj,Q.$],encapsulation:2});var Me=i(39907),Ue=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ge(e,t){if(1&e&&s.nrm(0,"bit-option",14),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}function je(e,t){if(1&e&&s.nrm(0,"bit-option",14),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}class Ne{get initialValues(){return this.cipherFormContainer.config.initialValues}constructor(e,t,i,n){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.eventCollectionService=n,this.cardDetailsForm=this.formBuilder.group({cardholderName:"",number:"",brand:"",expMonth:"",expYear:"",code:""}),this.cardBrands=[{name:"-- "+this.i18nService.t("select")+" --",value:null},{name:"Visa",value:"Visa"},{name:"Mastercard",value:"Mastercard"},{name:"American Express",value:"Amex"},{name:"Discover",value:"Discover"},{name:"Diners Club",value:"Diners Club"},{name:"JCB",value:"JCB"},{name:"Maestro",value:"Maestro"},{name:"UnionPay",value:"UnionPay"},{name:"RuPay",value:"RuPay"},{name:this.i18nService.t("other"),value:"Other"}],this.expirationMonths=[{name:"-- "+this.i18nService.t("select")+" --",value:null},{name:"01 - "+this.i18nService.t("january"),value:"1"},{name:"02 - "+this.i18nService.t("february"),value:"2"},{name:"03 - "+this.i18nService.t("march"),value:"3"},{name:"04 - "+this.i18nService.t("april"),value:"4"},{name:"05 - "+this.i18nService.t("may"),value:"5"},{name:"06 - "+this.i18nService.t("june"),value:"6"},{name:"07 - "+this.i18nService.t("july"),value:"7"},{name:"08 - "+this.i18nService.t("august"),value:"8"},{name:"09 - "+this.i18nService.t("september"),value:"9"},{name:"10 - "+this.i18nService.t("october"),value:"10"},{name:"11 - "+this.i18nService.t("november"),value:"11"},{name:"12 - "+this.i18nService.t("december"),value:"12"}],this.EventType=D.Bx,this.cipherFormContainer.registerChildForm("cardDetails",this.cardDetailsForm),this.cardDetailsForm.valueChanges.pipe((0,o.pQ)()).subscribe(({cardholderName:e,number:t,brand:i,expMonth:n,expYear:r,code:s})=>{this.cipherFormContainer.patchCipher(o=>{var a;const l=null!==(a=(0,Me.jd)(r))&&void 0!==a?a:"";return o.card.cardholderName=e,o.card.number=t,o.card.brand=i,o.card.expMonth=n,o.card.expYear=l,o.card.code=s,o})}),this.cardDetailsForm.controls.number.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{const t=O.G.getCardBrandByPatterns(e);t&&this.cardDetailsForm.controls.brand.setValue(t)})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e?this.initFromExistingCipher(e.card):this.initNewCipher(),this.disabled&&this.cardDetailsForm.disable()}initFromExistingCipher(e){var t,i,n,r,s,o,a,l,c,d;this.cardDetailsForm.patchValue({cardholderName:null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.cardholderName)&&void 0!==i?i:e.cardholderName,number:null!==(r=null===(n=this.initialValues)||void 0===n?void 0:n.number)&&void 0!==r?r:e.number,expMonth:null!==(o=null===(s=this.initialValues)||void 0===s?void 0:s.expMonth)&&void 0!==o?o:e.expMonth,expYear:null!==(l=null===(a=this.initialValues)||void 0===a?void 0:a.expYear)&&void 0!==l?l:e.expYear,code:null!==(d=null===(c=this.initialValues)||void 0===c?void 0:c.code)&&void 0!==d?d:e.code})}initNewCipher(){var e,t,i,n,r,s;this.cardDetailsForm.patchValue({cardholderName:(null===(e=this.initialValues)||void 0===e?void 0:e.cardholderName)||"",number:(null===(t=this.initialValues)||void 0===t?void 0:t.number)||"",expMonth:(null===(i=this.initialValues)||void 0===i?void 0:i.expMonth)||"",expYear:(null===(n=this.initialValues)||void 0===n?void 0:n.expYear)||"",code:(null===(r=this.initialValues)||void 0===r?void 0:r.code)||"",brand:O.G.getCardBrandByPatterns(null===(s=this.initialValues)||void 0===s?void 0:s.number)||""})}getSectionHeading(){const{brand:e}=this.cardDetailsForm.value;return e&&"Other"!==e?this.i18nService.t("cardBrandDetails",e):this.i18nService.t("cardDetails")}logCardEvent(e,t){return Ue(this,void 0,void 0,function*(){const{mode:i,originalCipher:n}=this.cipherFormContainer.config,r=["edit","partial-edit"].includes(i);e&&r&&(yield this.eventCollectionService.collect(t,n.id,!1,n.organizationId))})}}function Ve(e,t){if(1&e&&s.nrm(0,"bit-option",25),2&e){const e=t.$implicit;s.Y8G("value",e.value)("label",e.name)}}Ne.ɵfac=function(e){return new(e||Ne)(s.rXU(S),s.rXU(a.ok),s.rXU(z.W),s.rXU(ae.c))},Ne.ɵcmp=s.VBU({type:Ne,selectors:[["vault-card-details-section"]],inputs:{originalCipherView:"originalCipherView",disabled:"disabled"},decls:40,vars:22,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["id","cardholderName","bitInput","","formControlName","cardholderName"],["id","cardNumber","bitInput","","formControlName","number","type","password",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-card-number",3,"toggledChange"],["id","cardBrand","formControlName","brand"],[3,"value","label",4,"ngFor","ngForOf"],[1,"tw-flex","tw-flex-wrap","tw-gap-1"],[1,"tw-flex-1"],["id","cardExpMonth","formControlName","expMonth"],["id","cardExpYear","bitInput","","formControlName","expYear","type","number"],["disableMargin",""],["id","cardCode","bitInput","","formControlName","code","type","password",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-card-code",3,"toggledChange"],[3,"value","label"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.k0s()(),s.j41(4,"bit-card")(5,"bit-form-field")(6,"bit-label"),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.nrm(9,"input",2),s.k0s(),s.j41(10,"bit-form-field")(11,"bit-label"),s.EFF(12),s.nI1(13,"i18n"),s.k0s(),s.nrm(14,"input",3),s.j41(15,"button",4),s.bIt("toggledChange",function(e){return t.logCardEvent(e,t.EventType.Cipher_ClientToggledCardNumberVisible)}),s.k0s()(),s.j41(16,"bit-form-field")(17,"bit-label"),s.EFF(18),s.nI1(19,"i18n"),s.k0s(),s.j41(20,"bit-select",5),s.DNE(21,Ge,1,2,"bit-option",6),s.k0s()(),s.j41(22,"div",7)(23,"bit-form-field",8)(24,"bit-label"),s.EFF(25),s.nI1(26,"i18n"),s.k0s(),s.j41(27,"bit-select",9),s.DNE(28,je,1,2,"bit-option",6),s.k0s()(),s.j41(29,"bit-form-field",8)(30,"bit-label"),s.EFF(31),s.nI1(32,"i18n"),s.k0s(),s.nrm(33,"input",10),s.k0s()(),s.j41(34,"bit-form-field",11)(35,"bit-label"),s.EFF(36),s.nI1(37,"i18n"),s.k0s(),s.nrm(38,"input",12),s.j41(39,"button",13),s.bIt("toggledChange",function(e){return t.logCardEvent(e,t.EventType.Cipher_ClientToggledCardCodeVisible)}),s.k0s()()()()),2&e&&(s.Y8G("formGroup",t.cardDetailsForm),s.R7$(3),s.SpI(" ",t.getSectionHeading()," "),s.R7$(4),s.JRh(s.bMT(8,10,"cardholderName")),s.R7$(5),s.JRh(s.bMT(13,12,"number")),s.R7$(6),s.JRh(s.bMT(19,14,"brand")),s.R7$(3),s.Y8G("ngForOf",t.cardBrands),s.R7$(4),s.JRh(s.bMT(26,16,"expirationMonth")),s.R7$(3),s.Y8G("ngForOf",t.expirationMonths),s.R7$(3),s.JRh(s.bMT(32,18,"expirationYear")),s.R7$(5),s.JRh(s.bMT(37,20,"securityCode")))},dependencies:[R.i,g.E,ue.r,b.L,_.j,Y.J,H.h,ce.e,de.a,a.X1,a.me,a.Q0,a.BC,a.cb,a.j4,a.JD,w.p,W.w,J.P,F.U,j.Q,Z.s,T.p,n.MD,n.Sq,Q.$],encapsulation:2});class Be{get initialValues(){return this.cipherFormContainer.config.initialValues}constructor(e,t,i){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.identityTitleOptions=[{name:"-- "+this.i18nService.t("select")+" --",value:null},{name:this.i18nService.t("mr"),value:this.i18nService.t("mr")},{name:this.i18nService.t("mrs"),value:this.i18nService.t("mrs")},{name:this.i18nService.t("ms"),value:this.i18nService.t("ms")},{name:this.i18nService.t("mx"),value:this.i18nService.t("mx")},{name:this.i18nService.t("dr"),value:this.i18nService.t("dr")}],this.identityForm=this.formBuilder.group({title:[null],firstName:[""],middleName:[""],lastName:[""],username:[""],company:[""],ssn:[""],passportNumber:[""],licenseNumber:[""],email:[""],phone:[""],address1:[""],address2:[""],address3:[""],city:[""],state:[""],postalCode:[""],country:[""]}),this.cipherFormContainer.registerChildForm("identityDetails",this.identityForm),this.identityForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{const t=new U.O;t.title=e.title,t.firstName=e.firstName,t.middleName=e.middleName,t.lastName=e.lastName,t.username=e.username,t.company=e.company,t.ssn=e.ssn,t.passportNumber=e.passportNumber,t.licenseNumber=e.licenseNumber,t.email=e.email,t.phone=e.phone,t.address1=e.address1,t.address2=e.address2,t.address3=e.address3,t.city=e.city,t.state=e.state,t.postalCode=e.postalCode,t.country=e.country,this.cipherFormContainer.patchCipher(e=>(e.identity=t,e))})}ngOnInit(){var e;this.disabled&&this.identityForm.disable();const t=this.cipherFormContainer.getInitialCipherView();t?(this.initFromExistingCipher(t.identity),this.populateFormData(t)):(this.initNewCipher(),this.identityForm.patchValue({username:(null===(e=this.cipherFormContainer.config.initialValues)||void 0===e?void 0:e.username)||""}))}initFromExistingCipher(e){var t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g,y,b,w,S,I,k,C,T,F,R,P,x,$,E,A;this.identityForm.patchValue({firstName:null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.firstName)&&void 0!==i?i:e.firstName,middleName:null!==(r=null===(n=this.initialValues)||void 0===n?void 0:n.middleName)&&void 0!==r?r:e.middleName,lastName:null!==(o=null===(s=this.initialValues)||void 0===s?void 0:s.lastName)&&void 0!==o?o:e.lastName,company:null!==(l=null===(a=this.initialValues)||void 0===a?void 0:a.company)&&void 0!==l?l:e.company,ssn:null!==(d=null===(c=this.initialValues)||void 0===c?void 0:c.ssn)&&void 0!==d?d:e.ssn,passportNumber:null!==(h=null===(u=this.initialValues)||void 0===u?void 0:u.passportNumber)&&void 0!==h?h:e.passportNumber,licenseNumber:null!==(m=null===(p=this.initialValues)||void 0===p?void 0:p.licenseNumber)&&void 0!==m?m:e.licenseNumber,email:null!==(f=null===(v=this.initialValues)||void 0===v?void 0:v.email)&&void 0!==f?f:e.email,phone:null!==(y=null===(g=this.initialValues)||void 0===g?void 0:g.phone)&&void 0!==y?y:e.phone,address1:null!==(w=null===(b=this.initialValues)||void 0===b?void 0:b.address1)&&void 0!==w?w:e.address1,address2:null!==(I=null===(S=this.initialValues)||void 0===S?void 0:S.address2)&&void 0!==I?I:e.address2,address3:null!==(C=null===(k=this.initialValues)||void 0===k?void 0:k.address3)&&void 0!==C?C:e.address3,city:null!==(F=null===(T=this.initialValues)||void 0===T?void 0:T.city)&&void 0!==F?F:e.city,state:null!==(P=null===(R=this.initialValues)||void 0===R?void 0:R.state)&&void 0!==P?P:e.state,postalCode:null!==($=null===(x=this.initialValues)||void 0===x?void 0:x.postalCode)&&void 0!==$?$:e.postalCode,country:null!==(A=null===(E=this.initialValues)||void 0===E?void 0:E.country)&&void 0!==A?A:e.country})}initNewCipher(){var e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v;this.identityForm.patchValue({firstName:(null===(e=this.initialValues)||void 0===e?void 0:e.firstName)||"",middleName:(null===(t=this.initialValues)||void 0===t?void 0:t.middleName)||"",lastName:(null===(i=this.initialValues)||void 0===i?void 0:i.lastName)||"",company:(null===(n=this.initialValues)||void 0===n?void 0:n.company)||"",ssn:(null===(r=this.initialValues)||void 0===r?void 0:r.ssn)||"",passportNumber:(null===(s=this.initialValues)||void 0===s?void 0:s.passportNumber)||"",licenseNumber:(null===(o=this.initialValues)||void 0===o?void 0:o.licenseNumber)||"",email:(null===(a=this.initialValues)||void 0===a?void 0:a.email)||"",phone:(null===(l=this.initialValues)||void 0===l?void 0:l.phone)||"",address1:(null===(c=this.initialValues)||void 0===c?void 0:c.address1)||"",address2:(null===(d=this.initialValues)||void 0===d?void 0:d.address2)||"",address3:(null===(u=this.initialValues)||void 0===u?void 0:u.address3)||"",city:(null===(h=this.initialValues)||void 0===h?void 0:h.city)||"",state:(null===(p=this.initialValues)||void 0===p?void 0:p.state)||"",postalCode:(null===(m=this.initialValues)||void 0===m?void 0:m.postalCode)||"",country:(null===(v=this.initialValues)||void 0===v?void 0:v.country)||""})}populateFormData(e){var t,i;const{identity:n}=e;this.identityForm.patchValue({title:n.title,firstName:n.firstName,middleName:n.middleName,lastName:n.lastName,username:null!==(i=null===(t=this.cipherFormContainer.config.initialValues)||void 0===t?void 0:t.username)&&void 0!==i?i:n.username,company:n.company,ssn:n.ssn,passportNumber:n.passportNumber,licenseNumber:n.licenseNumber,email:n.email,phone:n.phone,address1:n.address1,address2:n.address2,address3:n.address3,city:n.city,state:n.state,postalCode:n.postalCode,country:n.country})}}Be.ɵfac=function(e){return new(e||Be)(s.rXU(S),s.rXU(a.ok),s.rXU(z.W))},Be.ɵcmp=s.VBU({type:Be,selectors:[["vault-identity-section"]],inputs:{originalCipherView:"originalCipherView",disabled:"disabled"},decls:118,vars:68,consts:[[3,"formGroup"],[1,"tw-mb-5","bit-compact:tw-mb-4"],["bitTypography","h6"],["formControlName","title"],[3,"value","label",4,"ngFor","ngForOf"],["bitInput","","formControlName","firstName"],["bitInput","","formControlName","middleName"],["bitInput","","formControlName","lastName"],["bitInput","","formControlName","username"],["disableMargin",""],["bitInput","","formControlName","company"],["formControlName","ssn","bitInput","","type","password"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-ssn"],["formControlName","passportNumber","bitInput","","type","password"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","","data-testid","visibility-for-passport-number"],["bitInput","","formControlName","licenseNumber"],["bitInput","","formControlName","email"],["bitInput","","formControlName","phone"],["bitInput","","formControlName","address1"],["bitInput","","formControlName","address2"],["bitInput","","formControlName","address3"],["bitInput","","formControlName","city"],["bitInput","","formControlName","state"],["bitInput","","formControlName","postalCode"],["bitInput","","formControlName","country"],[3,"value","label"]],template:function(e,t){1&e&&(s.j41(0,"form",0)(1,"section",1)(2,"bit-section-header")(3,"h2",2),s.EFF(4),s.nI1(5,"i18n"),s.k0s()(),s.j41(6,"bit-card")(7,"bit-form-field")(8,"bit-label"),s.EFF(9),s.nI1(10,"i18n"),s.k0s(),s.j41(11,"bit-select",3),s.DNE(12,Ve,1,2,"bit-option",4),s.k0s()(),s.j41(13,"bit-form-field")(14,"bit-label"),s.EFF(15),s.nI1(16,"i18n"),s.k0s(),s.nrm(17,"input",5),s.k0s(),s.j41(18,"bit-form-field")(19,"bit-label"),s.EFF(20),s.nI1(21,"i18n"),s.k0s(),s.nrm(22,"input",6),s.k0s(),s.j41(23,"bit-form-field")(24,"bit-label"),s.EFF(25),s.nI1(26,"i18n"),s.k0s(),s.nrm(27,"input",7),s.k0s(),s.j41(28,"bit-form-field")(29,"bit-label"),s.EFF(30),s.nI1(31,"i18n"),s.k0s(),s.nrm(32,"input",8),s.k0s(),s.j41(33,"bit-form-field",9)(34,"bit-label"),s.EFF(35),s.nI1(36,"i18n"),s.k0s(),s.nrm(37,"input",10),s.k0s()()(),s.j41(38,"section",1)(39,"bit-section-header")(40,"h2",2),s.EFF(41),s.nI1(42,"i18n"),s.k0s()(),s.j41(43,"bit-card")(44,"bit-form-field")(45,"bit-label"),s.EFF(46),s.nI1(47,"i18n"),s.k0s(),s.nrm(48,"input",11)(49,"button",12),s.k0s(),s.j41(50,"bit-form-field")(51,"bit-label"),s.EFF(52),s.nI1(53,"i18n"),s.k0s(),s.nrm(54,"input",13)(55,"button",14),s.k0s(),s.j41(56,"bit-form-field",9)(57,"bit-label"),s.EFF(58),s.nI1(59,"i18n"),s.k0s(),s.nrm(60,"input",15),s.k0s()()(),s.j41(61,"section",1)(62,"bit-section-header")(63,"h2",2),s.EFF(64),s.nI1(65,"i18n"),s.k0s()(),s.j41(66,"bit-card")(67,"bit-form-field")(68,"bit-label"),s.EFF(69),s.nI1(70,"i18n"),s.k0s(),s.nrm(71,"input",16),s.k0s(),s.j41(72,"bit-form-field",9)(73,"bit-label"),s.EFF(74),s.nI1(75,"i18n"),s.k0s(),s.nrm(76,"input",17),s.k0s()()(),s.j41(77,"section",1)(78,"bit-section-header")(79,"h2",2),s.EFF(80),s.nI1(81,"i18n"),s.k0s()(),s.j41(82,"bit-card")(83,"bit-form-field")(84,"bit-label"),s.EFF(85),s.nI1(86,"i18n"),s.k0s(),s.nrm(87,"input",18),s.k0s(),s.j41(88,"bit-form-field")(89,"bit-label"),s.EFF(90),s.nI1(91,"i18n"),s.k0s(),s.nrm(92,"input",19),s.k0s(),s.j41(93,"bit-form-field")(94,"bit-label"),s.EFF(95),s.nI1(96,"i18n"),s.k0s(),s.nrm(97,"input",20),s.k0s(),s.j41(98,"bit-form-field")(99,"bit-label"),s.EFF(100),s.nI1(101,"i18n"),s.k0s(),s.nrm(102,"input",21),s.k0s(),s.j41(103,"bit-form-field")(104,"bit-label"),s.EFF(105),s.nI1(106,"i18n"),s.k0s(),s.nrm(107,"input",22),s.k0s(),s.j41(108,"bit-form-field")(109,"bit-label"),s.EFF(110),s.nI1(111,"i18n"),s.k0s(),s.nrm(112,"input",23),s.k0s(),s.j41(113,"bit-form-field",9)(114,"bit-label"),s.EFF(115),s.nI1(116,"i18n"),s.k0s(),s.nrm(117,"input",24),s.k0s()()()()),2&e&&(s.Y8G("formGroup",t.identityForm),s.R7$(4),s.JRh(s.bMT(5,24,"personalDetails")),s.R7$(5),s.SpI(" ",s.bMT(10,26,"title")," "),s.R7$(3),s.Y8G("ngForOf",t.identityTitleOptions),s.R7$(3),s.SpI(" ",s.bMT(16,28,"firstName")," "),s.R7$(5),s.SpI(" ",s.bMT(21,30,"middleName")," "),s.R7$(5),s.SpI(" ",s.bMT(26,32,"lastName")," "),s.R7$(5),s.SpI(" ",s.bMT(31,34,"username")," "),s.R7$(5),s.SpI(" ",s.bMT(36,36,"company")," "),s.R7$(6),s.JRh(s.bMT(42,38,"identification")),s.R7$(5),s.SpI(" ",s.bMT(47,40,"ssn")," "),s.R7$(6),s.SpI(" ",s.bMT(53,42,"passportNumber")," "),s.R7$(6),s.SpI(" ",s.bMT(59,44,"licenseNumber")," "),s.R7$(6),s.JRh(s.bMT(65,46,"contactInfo")),s.R7$(5),s.SpI(" ",s.bMT(70,48,"email")," "),s.R7$(5),s.SpI(" ",s.bMT(75,50,"phone")," "),s.R7$(6),s.JRh(s.bMT(81,52,"address")),s.R7$(5),s.SpI(" ",s.bMT(86,54,"address1")," "),s.R7$(5),s.SpI(" ",s.bMT(91,56,"address2")," "),s.R7$(5),s.SpI(" ",s.bMT(96,58,"address3")," "),s.R7$(5),s.SpI(" ",s.bMT(101,60,"cityTown")," "),s.R7$(5),s.SpI(" ",s.bMT(106,62,"stateProvince")," "),s.R7$(5),s.SpI(" ",s.bMT(111,64,"zipPostalCodeLabel")," "),s.R7$(5),s.SpI(" ",s.bMT(116,66,"country")," "))},dependencies:[n.MD,n.Sq,B.t,T.p,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,F.U,R.i,b.L,_.j,Y.J,H.h,ce.e,de.a,j.Q,Z.s,w.p,W.w,J.P,g.E,ue.r,Q.$],encapsulation:2});var ze=i(3204),Le=i(34040),Ke=i(73276),qe=i(28202),_e=i(43978),Xe=i(82468),Ye=i(78781),He=i(35500),We=i(1601),Je=i(18499),Ze=i(406),Qe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function et(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",6),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.toggleFavorite())}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("bitIconButton",e.favoriteIcon)("label",s.bMT(1,4,"favorite"))("disabled",e.favoriteButtonDisabled),s.BMQ("aria-checked",e.itemDetailsForm.value.favorite)}}function tt(e,t){if(1&e&&(s.nrm(0,"bit-option",10),s.nI1(1,"async")),2&e){const e=s.XpG(2);s.Y8G("value",null)("label",s.bMT(1,2,e.userEmail$))}}function it(e,t){if(1&e&&s.nrm(0,"bit-option",10),2&e){const e=t.$implicit;s.Y8G("value",e.id)("label",e.name)}}function nt(e,t){if(1&e&&(s.j41(0,"bit-form-field")(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",7),s.DNE(5,tt,2,4,"bit-option",8)(6,it,1,2,"bit-option",9),s.k0s()()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"owner")),s.R7$(3),s.Y8G("ngIf",e.showPersonalOwnershipOption),s.R7$(),s.Y8G("ngForOf",e.organizations)}}function rt(e,t){if(1&e&&(s.j41(0,"bit-hint",14),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e){const e=s.XpG(2);s.R7$(),s.SpI(" ",s.i5U(2,1,"cannotRemoveViewOnlyCollections",e.readOnlyCollectionsNames.join(", "))," ")}}function st(e,t){if(1&e&&(s.qex(0),s.j41(1,"bit-form-field",11)(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nrm(5,"bit-multi-select",12),s.DNE(6,rt,3,4,"bit-hint",13),s.k0s(),s.bVm()),2&e){const e=s.XpG();s.R7$(),s.Y8G("disableMargin",e.config.hideIndividualVaultFields),s.R7$(2),s.JRh(s.bMT(4,4,"collections")),s.R7$(2),s.Y8G("baseItems",e.collectionOptions),s.R7$(),s.Y8G("ngIf",e.readOnlyCollectionsNames.length>0)}}function ot(e,t){if(1&e&&s.nrm(0,"bit-option",10),2&e){const e=t.$implicit;s.Y8G("value",e.id)("label",e.name)}}function at(e,t){if(1&e&&(s.j41(0,"bit-form-field",15)(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",16),s.DNE(5,ot,1,2,"bit-option",9),s.k0s()()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,2,"folder")),s.R7$(3),s.Y8G("ngForOf",e.config.folders)}}class lt{get readOnlyCollectionsNames(){return this.readOnlyCollections.map(e=>e.name)}get partialEdit(){return"partial-edit"===this.config.mode}get allowPersonalOwnership(){return this.config.organizationDataOwnershipDisabled}get collections(){return this.config.collections}get initialValues(){return this.config.initialValues}get showPersonalOwnershipOption(){return this.allowPersonalOwnership||this.itemDetailsForm.controls.organizationId.disabled||!this.allowPersonalOwnership&&this.config.originalCipher&&null==this.itemDetailsForm.controls.organizationId.value}constructor(e,t,i,n,r,s,l){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.destroyRef=n,this.accountService=r,this.configService=s,this.policyService=l,this.itemDetailsForm=this.formBuilder.group({name:["",[a.k0.required]],organizationId:[null],folderId:[null],collectionIds:new a.MJ([],[a.k0.required]),favorite:[!1]}),this.collectionOptions=[],this.readOnlyCollections=[],this.userEmail$=this.accountService.activeAccount$.pipe((0,ze.T)(e=>e.email)),this.organizations=[],this.favoriteButtonDisabled=!1,this.cipherFormContainer.registerChildForm("itemDetails",this.itemDetailsForm),this.itemDetailsForm.valueChanges.pipe((0,o.pQ)(),(0,ze.T)(()=>this.itemDetailsForm.getRawValue())).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>{var i;return Object.assign(t,{name:e.name,organizationId:e.organizationId,folderId:e.folderId,collectionIds:[...(null===(i=e.collectionIds)||void 0===i?void 0:i.map(e=>e.id))||[],...this.readOnlyCollections.map(e=>e.id)],favorite:e.favorite}),t})})}get favoriteIcon(){return this.itemDetailsForm.controls.favorite.value?"bwi-star-f":"bwi-star"}toggleFavorite(){this.itemDetailsForm.controls.favorite.setValue(!this.itemDetailsForm.controls.favorite.value)}get allowOwnershipChange(){var e;return("edit"!==this.config.mode||null==(null===(e=this.originalCipherView)||void 0===e?void 0:e.organizationId))&&(this.allowPersonalOwnership?this.organizations.length>0:this.organizations.length>1)}get showOwnership(){const e=this.organizations.length>0&&"edit"===this.config.mode,t=this.config.isAdminConsole&&"clone"!==this.config.mode;return this.allowOwnershipChange||e&&!t}get defaultOwner(){return this.allowPersonalOwnership?null:this.organizations[0].id}ngOnInit(){return Qe(this,void 0,void 0,function*(){var e,t,i,n;if(this.organizations=this.config.organizations.sort(Ye.A.getSortFunction(this.i18nService,"name")),this.userId=yield(0,d._)(this.accountService.activeAccount$.pipe(h.F6)),!this.allowPersonalOwnership&&0===this.organizations.length)throw new Error("No organizations available for ownership.");const r=this.cipherFormContainer.getInitialCipherView();if(r)yield this.initFromExistingCipher(r);else{const r=null===(e=this.initialValues)||void 0===e?void 0:e.organizationId;this.itemDetailsForm.setValue({name:(null===(t=this.initialValues)||void 0===t?void 0:t.name)||"",organizationId:r||this.defaultOwner,folderId:(null===(i=this.initialValues)||void 0===i?void 0:i.folderId)||null,collectionIds:[],favorite:!1}),yield this.updateCollectionOptions(null===(n=this.initialValues)||void 0===n?void 0:n.collectionIds)}this.setFormState(),this.itemDetailsForm.controls.organizationId.valueChanges.pipe((0,o.pQ)(this.destroyRef),(0,Le.F)(),(0,Ke.H)(()=>Qe(this,void 0,void 0,function*(){yield this.updateCollectionOptions(),this.setFormState()}))).subscribe()})}setFormState(){this.config.originalCipher&&!this.allowPersonalOwnership?null==this.itemDetailsForm.controls.organizationId.value?(this.cipherFormContainer.disableFormFields(),this.itemDetailsForm.controls.organizationId.enable(),this.favoriteButtonDisabled=!0):(this.cipherFormContainer.enableFormFields(),this.favoriteButtonDisabled=!1,this.setCollectionControlState()):this.allowOwnershipChange||this.itemDetailsForm.controls.organizationId.disable({emitEvent:!1})}getDefaultCollectionId(e){return Qe(this,void 0,void 0,function*(){if(!e||this.allowPersonalOwnership)return;if(!(yield this.configService.getFeatureFlag(Xe.TO.CreateDefaultLocation)))return;if(!(yield(0,d._)(this.policyService.policiesByType$(_e.tt.OrganizationDataOwnership,this.userId))).find(e=>e.organizationId))return;const t=this.collections.find(t=>t.organizationId===e&&t.type===qe.it.DefaultUserCollection);return null==t?void 0:t.id})}initFromExistingCipher(e){return Qe(this,void 0,void 0,function*(){var t,i,n,r,s,o,a;const{name:l,folderId:c,collectionIds:d}=e;this.itemDetailsForm.patchValue({name:l||(null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.name)&&void 0!==i?i:""),organizationId:null!==(n=e.organizationId)&&void 0!==n?n:null,folderId:c||(null!==(s=null===(r=this.initialValues)||void 0===r?void 0:r.folderId)&&void 0!==s?s:null),collectionIds:[],favorite:e.favorite});const u=this.itemDetailsForm.controls.organizationId.value,h=this.cipherFormContainer.initializedWithCachedCipher();"clone"===this.config.mode&&(h||this.itemDetailsForm.controls.name.setValue(e.name+" - "+this.i18nService.t("clone")),this.allowPersonalOwnership||null!=e.organizationId||this.itemDetailsForm.controls.organizationId.setValue(this.defaultOwner));const p=(null==d?void 0:d.length)?d:null!==(a=null===(o=this.initialValues)||void 0===o?void 0:o.collectionIds)&&void 0!==a?a:[];yield this.updateCollectionOptions(p),this.setCollectionControlState(),this.partialEdit?(this.itemDetailsForm.disable(),this.itemDetailsForm.controls.favorite.enable(),this.itemDetailsForm.controls.folderId.enable()):"edit"===this.config.mode&&(this.config.isAdminConsole&&this.config.admin||(this.readOnlyCollections=this.collections.filter(e=>e.organizationId===u&&e.readOnly&&this.originalCipherView.collectionIds.includes(e.id))))})}setCollectionControlState(){const e=this.cipherFormContainer.getInitialCipherView(),t=this.itemDetailsForm.controls.organizationId.value,i=this.organizations.find(e=>e.id===t);i&&e&&((i.canEditAllCiphers||e.canAssignToCollections)&&(!i.allowAdminAccessToAllCollectionItems||e.viewPassword&&e.edit)&&(i.type!==_e.D7.Custom||e.viewPassword)||this.itemDetailsForm.controls.collectionIds.disable())}updateCollectionOptions(){return Qe(this,arguments,void 0,function*(e=[]){var t,i;const n=this.itemDetailsForm.controls.organizationId.value,r=this.itemDetailsForm.controls.collectionIds;if(null==n)return this.collectionOptions=[],r.reset(),r.disable(),void(this.showCollectionsControl=!1);r.enable(),this.showCollectionsControl=!0;const s=(null!==(i=null===(t=this.originalCipherView)||void 0===t?void 0:t.collectionIds)&&void 0!==i?i:[]).length>0&&this.originalCipherView.collectionIds.every(e=>{var t;return(null===(t=this.collections.find(t=>t.id===e))||void 0===t?void 0:t.type)===qe.it.SharedCollection});if(this.collectionOptions=this.collections.filter(e=>e.organizationId===n&&(!!this.partialEdit||(!!this.config.admin||(!s||e.type!==qe.it.DefaultUserCollection)&&(e.assigned&&!e.readOnly)))).sort((e,t)=>(e.type===qe.it.DefaultUserCollection?-1:0)-(t.type===qe.it.DefaultUserCollection?-1:0)).map(e=>({id:e.id,name:e.name,listName:e.name,labelName:e.name})),r.reset(),r.enable(),this.showCollectionsControl=!0,1!==this.collectionOptions.length)if(e.filter(Boolean).length>0)r.setValue(this.collectionOptions.filter(t=>e.includes(t.id)));else{const e=yield this.getDefaultCollectionId(n);e&&r.setValue(this.collectionOptions.filter(t=>t.id===e))}else r.setValue(this.collectionOptions)})}}lt.ɵfac=function(e){return new(e||lt)(s.rXU(S),s.rXU(a.ok),s.rXU(z.W),s.rXU(r.abz),s.rXU(He.Di),s.rXU(We.w),s.rXU(Je.m))},lt.ɵcmp=s.VBU({type:lt,selectors:[["vault-item-details-section"]],inputs:{config:"config",originalCipherView:"originalCipherView"},decls:15,vars:11,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["slot","end","type","button","size","small","role","checkbox",3,"bitIconButton","label","disabled","click",4,"ngIf"],["bitInput","","formControlName","name"],[4,"ngIf"],["disableMargin","",4,"ngIf"],["slot","end","type","button","size","small","role","checkbox",3,"click","bitIconButton","label","disabled"],["formControlName","organizationId"],[3,"value","label",4,"ngIf"],[3,"value","label",4,"ngFor","ngForOf"],[3,"value","label"],[1,"tw-w-full",3,"disableMargin"],["formControlName","collectionIds",1,"tw-w-full",3,"baseItems"],["data-testid","view-only-hint",4,"ngIf"],["data-testid","view-only-hint"],["disableMargin",""],["formControlName","folderId"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.DNE(5,et,2,6,"button",2),s.k0s(),s.j41(6,"bit-card")(7,"bit-form-field")(8,"bit-label"),s.EFF(9),s.nI1(10,"i18n"),s.k0s(),s.nrm(11,"input",3),s.k0s(),s.DNE(12,nt,7,5,"bit-form-field",4)(13,st,7,6,"ng-container",4)(14,at,6,4,"bit-form-field",5),s.k0s()()),2&e&&(s.Y8G("formGroup",t.itemDetailsForm),s.R7$(3),s.JRh(s.bMT(4,7,"itemDetails")),s.R7$(2),s.Y8G("ngIf",!t.config.hideIndividualVaultFields),s.R7$(4),s.JRh(s.bMT(10,9,"itemName")),s.R7$(3),s.Y8G("ngIf",t.showOwnership),s.R7$(),s.Y8G("ngIf",t.showCollectionsControl),s.R7$(),s.Y8G("ngIf",!t.config.hideIndividualVaultFields))},dependencies:[R.i,g.E,ue.r,b.L,_.j,X.I,Y.J,Ze.b,H.h,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,w.p,W.w,J.P,F.U,j.Q,Z.s,T.p,n.MD,n.Sq,n.bT,Q.$,n.Jj],encapsulation:2});var ct=i(79783),dt=i(69194),ut=i(58363),ht=i(70342),pt=i(60276),mt=i(16671),vt=i(39444),ft=i(59777),gt=i(30623),yt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const bt=["uriInput"],wt=["matchDetectionSelect"];function St(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",11),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.removeUri())}),s.k0s()}2&e&&s.Y8G("label",s.bMT(1,1,"deleteWebsite"))}function It(e,t){if(1&e){const e=s.RV6();s.j41(0,"div",12)(1,"button",13),s.nI1(2,"i18n"),s.bIt("keydown",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.handleKeydown(t))}),s.k0s()()}if(2&e){const e=s.XpG();s.R7$(),s.Y8G("label",s.i5U(2,1,"reorderToggleButton",e.uriLabel))}}function kt(e,t){if(1&e&&s.nrm(0,"bit-option",18),2&e){const e=t.$implicit;s.Y8G("label",e.label)("value",e.value)("disabled",e.disabled)}}function Ct(e,t){if(1&e&&(s.qex(0),s.j41(1,"b"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.EFF(4),s.nI1(5,"i18n"),s.bVm()),2&e){const e=s.XpG().ngIf;s.R7$(2),s.SpI("",s.bMT(3,2,"warningCapitalized"),":"),s.R7$(2),s.SpI(" ",s.bMT(5,4,e[1])," ")}}function Tt(e,t){if(1&e&&(s.j41(0,"bit-hint"),s.EFF(1),s.nI1(2,"i18n"),s.DNE(3,Ct,6,6,"ng-container",17),s.k0s()),2&e){const e=t.ngIf;s.R7$(),s.SpI(" ",s.bMT(2,2,e[0])," "),s.R7$(2),s.Y8G("ngIf",e.length>1)}}function Ft(e,t){if(1&e&&(s.j41(0,"bit-form-field",14)(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.j41(4,"bit-select",15,1),s.DNE(6,kt,1,3,"bit-option",16),s.k0s(),s.DNE(7,Tt,4,4,"bit-hint",17),s.k0s()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"matchDetection")),s.R7$(4),s.Y8G("ngForOf",e.uriMatchOptions),s.R7$(),s.Y8G("ngIf",e.getMatchHints())}}class Rt{set defaultMatchDetection(e){var t;null!==e&&(this.uriMatchOptions[0].label=this.i18nService.t("defaultLabelWithValue",null===(t=this.uriMatchOptions.find(t=>t.value===e))||void 0===t?void 0:t.label))}toggleMatchDetection(){this.showMatchDetection=!this.showMatchDetection,this.showMatchDetection&&setTimeout(()=>{var e,t;return null===(t=null===(e=this.matchDetectionSelect)||void 0===e?void 0:e.select())||void 0===t?void 0:t.focus()},0)}get uriLabel(){return 0===this.index?this.i18nService.t("websiteUri"):this.i18nService.t("websiteUriCount",this.index+1)}get toggleTitle(){return this.showMatchDetection?this.i18nService.t("hideMatchDetection",this.uriForm.value.uri):this.i18nService.t("showMatchDetection",this.uriForm.value.uri)}handleKeydown(e){this.onKeydown.emit(e)}constructor(e,t,i){this.dialogService=e,this.formBuilder=t,this.i18nService=i,this.uriForm=this.formBuilder.group({uri:[null],matchDetection:[null]}),this.uriMatchOptions=[{label:this.i18nService.t("default"),value:null},{label:this.i18nService.t("baseDomain"),value:ft.L.Domain},{label:this.i18nService.t("host"),value:ft.L.Host},{label:this.i18nService.t("exact"),value:ft.L.Exact},{label:this.i18nService.t("never"),value:ft.L.Never},{label:this.i18nService.t("uriAdvancedOption"),value:null,disabled:!0},{label:this.i18nService.t("startsWith"),value:ft.L.StartsWith},{label:this.i18nService.t("regEx"),value:ft.L.RegularExpression}],this.advancedOptionWarningMap={[ft.L.StartsWith]:"startsWithAdvancedOptionWarning",[ft.L.RegularExpression]:"regExAdvancedOptionWarning"},this.onKeydown=new s.bkB,this.remove=new s.bkB,this.showMatchDetection=!1,this.onChange=()=>{},this.onTouched=()=>{},this.uriForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{this.onChange(e)}),this.uriForm.statusChanges.pipe((0,o.pQ)()).subscribe(()=>{this.onTouched()}),this.uriForm.controls.matchDetection.valueChanges.pipe((0,vt.J)(),(0,Ke.H)(([e,t])=>this.handleAdvancedMatch(e,t)),(0,o.pQ)()).subscribe()}handleAdvancedMatch(e,t){return yt(this,void 0,void 0,function*(){const i=e!==t,n=t===ft.L.StartsWith||t===ft.L.RegularExpression;i&&n&&gt.r.open(this.dialogService,{contentKey:this.advancedOptionWarningMap[t],onContinue:()=>{this.uriForm.controls.matchDetection.setValue(t)},onCancel:()=>{this.uriForm.controls.matchDetection.setValue(e)}})})}focusInput(){var e;(null===(e=this.inputElement)||void 0===e?void 0:e.nativeElement)&&this.inputElement.nativeElement.focus()}removeUri(){this.remove.emit()}writeValue(e){var t,i;e&&this.uriForm.setValue({uri:null!==(t=e.uri)&&void 0!==t?t:"",matchDetection:null!==(i=e.matchDetection)&&void 0!==i?i:null},{emitEvent:!1})}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){e?this.uriForm.disable():this.uriForm.enable()}getMatchHints(){var e;const t=["uriMatchDefaultStrategyHint"],i=null===(e=this.uriForm.get("matchDetection"))||void 0===e?void 0:e.value;return i!==ft.L.StartsWith&&i!==ft.L.RegularExpression||t.push(this.advancedOptionWarningMap[i]),t}}Rt.ɵfac=function(e){return new(e||Rt)(s.rXU(se.o3),s.rXU(a.ok),s.rXU(z.W))},Rt.ɵcmp=s.VBU({type:Rt,selectors:[["vault-autofill-uri-option"]],viewQuery:function(e,t){if(1&e&&(s.GBs(bt,5),s.GBs(wt,5)),2&e){let e;s.mGM(e=s.lsd())&&(t.inputElement=e.first),s.mGM(e=s.lsd())&&(t.matchDetectionSelect=e.first)}},inputs:{canReorder:"canReorder",canRemove:"canRemove",defaultMatchDetection:"defaultMatchDetection",index:"index"},outputs:{onKeydown:"onKeydown",remove:"remove"},features:[s.Jv_([{provide:a.kq,useExisting:(0,r.Rfq)(()=>Rt),multi:!0}])],decls:12,vars:9,consts:[["uriInput",""],["matchDetectionSelect",""],[3,"formGroup"],[1,"tw-mb-4","tw-pt-1"],[1,"tw-flex","tw-pt-2"],["disableMargin","",1,"tw-flex-1","!tw-pt-0"],["bitInput","","formControlName","uri"],["type","button","bitSuffix","","data-testid","toggle-match-detection-button",3,"click","bitIconButton","label"],["type","button","bitIconButton","bwi-minus-circle","buttonType","danger","bitSuffix","","data-testid","remove-uri-button",3,"label","click",4,"ngIf"],["class","tw-flex tw-items-center tw-ml-1.5",4,"ngIf"],["class","!tw-mb-5",4,"ngIf"],["type","button","bitIconButton","bwi-minus-circle","buttonType","danger","bitSuffix","","data-testid","remove-uri-button",3,"click","label"],[1,"tw-flex","tw-items-center","tw-ml-1.5"],["type","button","bitIconButton","bwi-drag-and-drop","cdkDragHandle","","data-testid","reorder-toggle-button",1,"!tw-py-0","!tw-px-1",3,"keydown","label"],[1,"!tw-mb-5"],["formControlName","matchDetection"],[3,"label","value","disabled",4,"ngFor","ngForOf"],[4,"ngIf"],[3,"label","value","disabled"]],template:function(e,t){if(1&e){const e=s.RV6();s.qex(0,2),s.j41(1,"div",3)(2,"div",4)(3,"bit-form-field",5)(4,"bit-label"),s.EFF(5),s.k0s(),s.nrm(6,"input",6,0),s.j41(8,"button",7),s.bIt("click",function(){return r.eBV(e),r.Njj(t.toggleMatchDetection())}),s.k0s(),s.DNE(9,St,2,3,"button",8),s.k0s(),s.DNE(10,It,3,4,"div",9),s.k0s(),s.DNE(11,Ft,8,5,"bit-form-field",10),s.k0s(),s.bVm()}2&e&&(s.Y8G("formGroup",t.uriForm),s.R7$(2),s.AVh("!tw-mb-1",t.showMatchDetection),s.R7$(3),s.JRh(t.uriLabel),s.R7$(3),s.Y8G("bitIconButton",t.showMatchDetection?"bwi-cog-f":"bwi-cog")("label",t.toggleTitle),s.R7$(),s.Y8G("ngIf",t.canRemove),s.R7$(),s.Y8G("ngIf",t.canReorder),s.R7$(),s.Y8G("ngIf",t.showMatchDetection))},dependencies:[E.ad,E.Fb,b.L,_.j,X.I,Y.J,H.h,de.a,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,j.Q,Z.s,T.p,w.p,W.w,J.P,n.Sq,n.bT,Q.$],encapsulation:2});var Pt=i(37115),xt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function $t(e,t){if(1&e){const e=s.RV6();s.j41(0,"vault-autofill-uri-option",7),s.nI1(1,"async"),s.bIt("remove",function(){const t=r.eBV(e).index,i=s.XpG();return r.Njj(i.removeUri(t))})("onKeydown",function(t){const i=r.eBV(e).index,n=s.XpG();return r.Njj(n.onUriItemKeydown(t,i))}),s.k0s()}if(2&e){const e=t.index,i=s.XpG();s.Y8G("cdkDragDisabled",i.uriControls.length<=1||i.autofillOptionsForm.disabled)("formControlName",e)("canReorder",i.uriControls.length>1&&i.autofillOptionsForm.enabled)("canRemove",i.uriControls.length>1&&i.autofillOptionsForm.enabled)("defaultMatchDetection",s.bMT(1,6,i.defaultMatchDetection$))("index",e)}}function Et(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",8),s.nI1(1,"async"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.addUri({uri:null,matchDetection:null},!0))}),s.nrm(2,"i",9),s.EFF(3),s.nI1(4,"i18n"),s.k0s()}if(2&e){const e=s.XpG();s.AVh("tw-mb-6",s.bMT(1,3,e.autofillOnPageLoadEnabled$)),s.R7$(3),s.SpI(" ",s.bMT(4,5,"addWebsite")," ")}}function At(e,t){if(1&e&&(s.j41(0,"bit-form-field",10)(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.nrm(4,"bit-select",11),s.k0s()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,2,"autoFillOnPageLoad")),s.R7$(2),s.Y8G("items",e.autofillOptions)}}class Dt{get uriControls(){return this.autofillOptionsForm.controls.uris.controls}get isPartialEdit(){return"partial-edit"===this.cipherFormContainer.config.mode}constructor(e,t,i,n,r,s,a){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.liveAnnouncer=n,this.domainSettingsService=r,this.autofillSettingsService=s,this.platformUtilsService=a,this.autofillOptionsForm=this.formBuilder.group({uris:this.formBuilder.array([]),autofillOnPageLoad:[null]}),this.defaultMatchDetection$=this.domainSettingsService.resolvedDefaultUriMatchStrategy$.pipe((0,dt.p)(()=>this.platformUtilsService.getClientType()==D.sK.Browser)),this.autofillOnPageLoadEnabled$=this.autofillSettingsService.autofillOnPageLoad$,this.autofillOptions=[{label:this.i18nService.t("default"),value:null},{label:this.i18nService.t("yes"),value:!0},{label:this.i18nService.t("no"),value:!1}],this.focusOnNewInput$=new l.B,this.cipherFormContainer.registerChildForm("autoFillOptions",this.autofillOptionsForm),this.autofillOptionsForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>{var i;return t.login.uris=null===(i=e.uris)||void 0===i?void 0:i.map(e=>Object.assign(new mt.z,{uri:e.uri,match:e.matchDetection})),t.login.autofillOnPageLoad=e.autofillOnPageLoad,t})}),this.updateDefaultAutofillLabel(),this.focusOnNewInput$.pipe((0,o.pQ)(),(0,u.n)(()=>this.uriOptions.changes.pipe((0,ut.s)(1))),(0,u.n)(()=>this.liveAnnouncer.announce(this.i18nService.t("websiteAdded"),"polite"))).subscribe(()=>{var e,t;null===(t=null===(e=this.uriOptions)||void 0===e?void 0:e.last)||void 0===t||t.focusInput()}),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)()).subscribe(e=>{"disabled"===e?this.autofillOptionsForm.disable({emitEvent:!1}):this.isPartialEdit||this.autofillOptionsForm.enable({emitEvent:!1})})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e?this.initFromExistingCipher(e.login):this.initNewCipher(),this.isPartialEdit&&this.autofillOptionsForm.disable()}initFromExistingCipher(e){var t,i,n;null===(t=e.uris)||void 0===t||t.forEach(e=>{this.addUri({uri:e.uri,matchDetection:e.match},!1,!1)}),this.autofillOptionsForm.patchValue({autofillOnPageLoad:e.autofillOnPageLoad}),(null===(i=this.cipherFormContainer.config.initialValues)||void 0===i?void 0:i.loginUri)&&!this.cipherFormContainer.initializedWithCachedCipher()&&-1===(null===(n=e.uris)||void 0===n?void 0:n.findIndex(e=>e.uri===this.cipherFormContainer.config.initialValues.loginUri))&&this.addUri({uri:this.cipherFormContainer.config.initialValues.loginUri,matchDetection:null})}initNewCipher(){var e,t;this.addUri({uri:null!==(t=null===(e=this.cipherFormContainer.config.initialValues)||void 0===e?void 0:e.loginUri)&&void 0!==t?t:null,matchDetection:null}),this.autofillOptionsForm.patchValue({autofillOnPageLoad:null})}updateDefaultAutofillLabel(){this.autofillSettingsService.autofillOnPageLoadDefault$.pipe((0,o.pQ)()).subscribe(e=>{const t=this.autofillOptions.find(t=>t.value===e);t&&(this.autofillOptions[0].label=this.i18nService.t("defaultLabelWithValue",t.label),this.autofillOptions=[...this.autofillOptions])})}addUri(e={uri:null,matchDetection:null},t=!1,i=!0){this.autofillOptionsForm.controls.uris.push(this.formBuilder.control(e),{emitEvent:i}),t&&this.focusOnNewInput$.next()}removeUri(e){this.autofillOptionsForm.controls.uris.removeAt(e)}updateUriFields(){this.cipherFormContainer.patchCipher(e=>(e.login.uris=this.uriControls.map(e=>{var t;return Object.assign(new mt.z,{uri:e.value.uri,match:null!==(t=e.value.matchDetection)&&void 0!==t?t:null})}),e))}onUriItemDrop(e){(0,E.HD)(this.uriControls,e.previousIndex,e.currentIndex),this.updateUriFields()}onUriItemKeydown(e,t){return xt(this,void 0,void 0,function*(){"ArrowUp"===e.key&&0!==t&&(yield this.reorderUriItems(e,t,"Up")),"ArrowDown"===e.key&&t!==this.uriControls.length-1&&(yield this.reorderUriItems(e,t,"Down"))})}reorderUriItems(e,t,i){return xt(this,void 0,void 0,function*(){const n=t+("Up"===i?-1:1);e.preventDefault(),yield this.liveAnnouncer.announce(this.i18nService.t(`reorderField${i}`,this.i18nService.t("websiteUri"),n+1,this.uriControls.length),"assertive"),(0,E.HD)(this.uriControls,t,n),this.updateUriFields(),requestAnimationFrame(()=>{e.target.focus()})})}}Dt.ɵfac=function(e){return new(e||Dt)(s.rXU(S),s.rXU(a.ok),s.rXU(z.W),s.rXU(oe.Ai),s.rXU(pt.V),s.rXU(ht.h),s.rXU(Pt.y))},Dt.ɵcmp=s.VBU({type:Dt,selectors:[["vault-autofill-options"]],viewQuery:function(e,t){if(1&e&&s.GBs(Rt,5),2&e){let e;s.mGM(e=s.lsd())&&(t.uriOptions=e)}},decls:11,vars:9,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["cdkDropList","",3,"cdkDropListDropped"],["formArrayName","uris"],["cdkDrag","",3,"cdkDragDisabled","formControlName","canReorder","canRemove","defaultMatchDetection","index","remove","onKeydown",4,"ngFor","ngForOf"],["type","button","bitLink","","linkType","primary",3,"tw-mb-6","click",4,"ngIf"],["disableMargin","",4,"ngIf"],["cdkDrag","",3,"remove","onKeydown","cdkDragDisabled","formControlName","canReorder","canRemove","defaultMatchDetection","index"],["type","button","bitLink","","linkType","primary",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","tw-font-medium"],["disableMargin",""],["formControlName","autofillOnPageLoad",3,"items"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card",2),s.bIt("cdkDropListDropped",function(e){return t.onUriItemDrop(e)}),s.qex(6,3),s.DNE(7,$t,2,8,"vault-autofill-uri-option",4),s.bVm(),s.DNE(8,Et,5,7,"button",5)(9,At,5,4,"bit-form-field",6),s.nI1(10,"async"),s.k0s()()),2&e&&(s.Y8G("formGroup",t.autofillOptionsForm),s.R7$(3),s.SpI(" ",s.bMT(4,5,"autofillOptions")," "),s.R7$(4),s.Y8G("ngForOf",t.uriControls),s.R7$(),s.Y8G("ngIf",t.autofillOptionsForm.enabled),s.R7$(),s.Y8G("ngIf",s.bMT(10,7,t.autofillOnPageLoadEnabled$)))},dependencies:[E.ad,E.O7,E.T1,F.U,g.E,ue.r,T.p,R.i,a.X1,a.BC,a.cb,a.j4,a.JD,a.v8,n.Sq,b.L,_.j,H.h,w.p,W.w,j.Q,Rt,x.V,pe.o,n.bT,Q.$,n.Jj],encapsulation:2});var Ot=i(86157),Mt=i(72331),Ut=i(69855);class Gt{}var jt=i(54471),Nt=i(3892),Vt=i(85800),Bt=i(71364),zt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Lt(e,t){if(1&e&&(s.nrm(0,"button",18),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("label",s.bMT(1,2,"generateUsername"))("bitAction",e.generateUsername)}}function Kt(e,t){1&e&&(s.qex(0),s.EFF(1),s.nI1(2,"i18n"),s.bVm()),2&e&&(s.R7$(),s.SpI(" ",s.bMT(2,1,"securePasswordGenerated")," "))}function qt(e,t){1&e&&(s.qex(0),s.j41(1,"span",19),s.EFF(2),s.nI1(3,"i18n"),s.nI1(4,"i18n"),s.k0s(),s.j41(5,"span",20),s.EFF(6),s.nI1(7,"i18n"),s.nrm(8,"i",21),s.EFF(9),s.nI1(10,"i18n"),s.k0s(),s.bVm()),2&e&&(s.R7$(2),s.Lme(" ",s.bMT(3,4,"useGeneratorHelpTextPartOne")," ",s.bMT(4,6,"useGeneratorHelpTextPartTwo")," "),s.R7$(4),s.SpI(" ",s.bMT(7,8,"useGeneratorHelpTextPartOne")," "),s.R7$(3),s.SpI(" ",s.bMT(10,10,"useGeneratorHelpTextPartTwo")," "))}function _t(e,t){if(1&e&&(s.j41(0,"bit-hint"),s.DNE(1,Kt,3,3,"ng-container",6)(2,qt,11,12,"ng-container",6),s.k0s()),2&e){const e=s.XpG();s.R7$(),s.Y8G("ngIf",e.newPasswordGenerated),s.R7$(),s.Y8G("ngIf",!e.newPasswordGenerated)}}function Xt(e,t){if(1&e&&(s.nrm(0,"button",22),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("label",s.bMT(1,2,"checkPassword"))("bitAction",e.checkPassword)}}function Yt(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",23),s.bIt("toggledChange",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.logVisibleEvent(t,i.EventType.Cipher_ClientToggledPasswordVisible))}),s.k0s()}}function Ht(e,t){if(1&e&&(s.nrm(0,"button",24),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("label",s.bMT(1,2,"generatePassword"))("bitAction",e.generatePassword)}}function Wt(e,t){if(1&e&&(s.nrm(0,"button",27),s.nI1(1,"i18n")),2&e){const e=s.XpG(2);s.Y8G("bitAction",e.removePasskey)("label",s.bMT(1,2,"removePasskey"))}}function Jt(e,t){if(1&e&&(s.j41(0,"bit-form-field")(1,"bit-label"),s.EFF(2),s.nI1(3,"i18n"),s.k0s(),s.nrm(4,"input",25),s.DNE(5,Wt,2,4,"button",26),s.k0s()),2&e){const e=s.XpG();s.R7$(2),s.JRh(s.bMT(3,3,"typePasskey")),s.R7$(2),s.Y8G("value",e.fido2CredentialCreationDateValue),s.R7$(),s.Y8G("ngIf",e.loginDetailsForm.enabled&&e.viewHiddenFields)}}function Zt(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",28),s.bIt("toggledChange",function(t){r.eBV(e);const i=s.XpG();return r.Njj(i.logVisibleEvent(t,i.EventType.Cipher_ClientToggledTOTPSeedVisible))}),s.k0s()}}function Qt(e,t){if(1&e&&(s.nrm(0,"button",29),s.nI1(1,"i18n")),2&e){const e=s.XpG();s.Y8G("bitAction",e.captureTotp)("label",s.bMT(1,2,"totpCapture"))}}class ei{get canCaptureTotp(){var e;return!!(null===(e=this.totpCaptureService)||void 0===e?void 0:e.canCaptureTotp(window))&&this.loginDetailsForm.controls.totp.enabled}get hasPasskey(){return null!=this.existingFido2Credentials&&this.existingFido2Credentials.length>0}get fido2CredentialCreationDateValue(){var e,t;return`${this.i18nService.t("dateCreated")} ${this.datePipe.transform(null===(t=null===(e=this.existingFido2Credentials)||void 0===e?void 0:e[0])||void 0===t?void 0:t.creationDate,"short")}`}get viewHiddenFields(){return!this.cipherFormContainer.originalCipherView||this.cipherFormContainer.originalCipherView.viewPassword}get initialValues(){return this.cipherFormContainer.config.initialValues}constructor(e,t,i,s,a,l,c,d){this.cipherFormContainer=e,this.formBuilder=t,this.i18nService=i,this.generationService=s,this.auditService=a,this.toastService=l,this.eventCollectionService=c,this.totpCaptureService=d,this.EventType=D.Bx,this.loginDetailsForm=this.formBuilder.group({username:[""],password:[""],totp:[""]}),this.datePipe=(0,r.WQX)(n.vh),this.destroyRef=(0,r.WQX)(r.abz),this.logVisibleEvent=(e,t)=>zt(this,void 0,void 0,function*(){const{mode:i,originalCipher:n}=this.cipherFormContainer.config,r=["edit","partial-edit"].includes(i);e&&r&&n&&(yield this.eventCollectionService.collect(t,n.id,!1,n.organizationId))}),this.captureTotp=()=>zt(this,void 0,void 0,function*(){if(this.canCaptureTotp)try{const e=yield this.totpCaptureService.captureTotpSecret();e&&(this.loginDetailsForm.controls.totp.patchValue(e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("totpCaptureSuccess")}))}catch(e){this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("totpCaptureError")})}}),this.removePasskey=()=>zt(this,void 0,void 0,function*(){this.existingFido2Credentials=null,this.cipherFormContainer.patchCipher(e=>(e.login.fido2Credentials=null,e))}),this.generatePassword=()=>zt(this,void 0,void 0,function*(){const e=yield this.generationService.generatePassword();e&&(this.loginDetailsForm.controls.password.patchValue(e),this.newPasswordGenerated=!0)}),this.generateUsername=()=>zt(this,void 0,void 0,function*(){const e=yield this.generationService.generateUsername(this.cipherFormContainer.website);e&&this.loginDetailsForm.controls.username.patchValue(e)}),this.checkPassword=()=>zt(this,void 0,void 0,function*(){const e=this.loginDetailsForm.controls.password.value;if(null==e||""===e)return;const t=yield this.auditService.passwordLeaked(e);t>0?this.toastService.showToast({variant:"warning",title:null,message:this.i18nService.t("passwordExposed",t.toString())}):this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("passwordSafe")})}),this.cipherFormContainer.registerChildForm("loginDetails",this.loginDetailsForm),this.loginDetailsForm.valueChanges.pipe((0,o.pQ)(),(0,ze.T)(()=>this.loginDetailsForm.getRawValue())).subscribe(e=>{this.cipherFormContainer.patchCipher(t=>{var i;return Object.assign(t.login,{username:e.username,password:e.password,totp:null===(i=e.totp)||void 0===i?void 0:i.trim()}),t})})}ngOnInit(){const e=this.cipherFormContainer.getInitialCipherView();e?this.initFromExistingCipher(e.login):this.initNewCipher(),"partial-edit"===this.cipherFormContainer.config.mode&&this.loginDetailsForm.disable(),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{"enabled"===e&&(this.viewHiddenFields||(this.loginDetailsForm.controls.password.disable(),this.loginDetailsForm.controls.totp.disable()))})}initFromExistingCipher(e){var t,i,n,r;this.loginDetailsForm.patchValue({username:null!==(i=null===(t=this.initialValues)||void 0===t?void 0:t.username)&&void 0!==i?i:e.username,password:null!==(r=null===(n=this.initialValues)||void 0===n?void 0:n.password)&&void 0!==r?r:e.password,totp:e.totp}),"clone"!=this.cipherFormContainer.config.mode&&(this.existingFido2Credentials=e.fido2Credentials),this.viewHiddenFields||(this.loginDetailsForm.controls.password.disable(),this.loginDetailsForm.controls.totp.disable())}initNewCipher(){var e,t;this.loginDetailsForm.patchValue({username:(null===(e=this.initialValues)||void 0===e?void 0:e.username)||"",password:(null===(t=this.initialValues)||void 0===t?void 0:t.password)||""})}}ei.ɵfac=function(e){return new(e||ei)(s.rXU(S),s.rXU(a.ok),s.rXU(z.W),s.rXU(Ot.v),s.rXU(Mt.d),s.rXU(Ut.f),s.rXU(ae.c),s.rXU(Gt,8))},ei.ɵcmp=s.VBU({type:ei,selectors:[["vault-login-details-section"]],decls:39,vars:31,consts:[["totpPopover",""],[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["bitInput","","formControlName","username"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-username-button",3,"label","bitAction",4,"ngIf"],["bitInput","","formControlName","password","type","password",1,"tw-font-mono"],[4,"ngIf"],["type","button","bitIconButton","bwi-check-circle","bitSuffix","","data-testid","check-password-button",3,"label","bitAction",4,"ngIf"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-password-visibility","bitPasswordInputToggle","",3,"toggledChange",4,"ngIf"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-password-button",3,"label","bitAction",4,"ngIf"],["disableMargin",""],["bitLink","","type","button","slot","end",3,"bitPopoverTriggerFor","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-sm","bwi-question-circle"],[3,"title"],[1,"tw-mb-0"],["bitInput","","formControlName","totp","type","password",1,"tw-font-mono"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-totp-visibility","bitPasswordInputToggle","",3,"toggledChange",4,"ngIf"],["type","button","bitIconButton","bwi-camera","bitSuffix","","data-testid","capture-totp-button",3,"bitAction","label",4,"ngIf"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-username-button",3,"label","bitAction"],[1,"tw-sr-only"],["aria-hidden","true"],["aria-hidden","true",1,"bwi","bwi-generate"],["type","button","bitIconButton","bwi-check-circle","bitSuffix","","data-testid","check-password-button",3,"label","bitAction"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-password-visibility","bitPasswordInputToggle","",3,"toggledChange"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-password-button",3,"label","bitAction"],["bitInput","","disabled","","data-testid","passkey-field",3,"value"],["type","button","bitIconButton","bwi-minus-circle","buttonType","danger","bitSuffix","","data-testid","remove-passkey-button",3,"bitAction","label",4,"ngIf"],["type","button","bitIconButton","bwi-minus-circle","buttonType","danger","bitSuffix","","data-testid","remove-passkey-button",3,"bitAction","label"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-totp-visibility","bitPasswordInputToggle","",3,"toggledChange"],["type","button","bitIconButton","bwi-camera","bitSuffix","","data-testid","capture-totp-button",3,"bitAction","label"]],template:function(e,t){if(1&e&&(s.j41(0,"section",1)(1,"bit-section-header")(2,"h2",2),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),s.EFF(8),s.nI1(9,"i18n"),s.k0s(),s.nrm(10,"input",3),s.DNE(11,Lt,2,4,"button",4),s.k0s(),s.j41(12,"bit-form-field")(13,"bit-label"),s.EFF(14),s.nI1(15,"i18n"),s.k0s(),s.nrm(16,"input",5),s.DNE(17,_t,3,2,"bit-hint",6)(18,Xt,2,4,"button",7)(19,Yt,1,0,"button",8)(20,Ht,2,4,"button",9),s.k0s(),s.DNE(21,Jt,6,5,"bit-form-field",6),s.j41(22,"bit-form-field",10)(23,"bit-label"),s.EFF(24),s.nI1(25,"i18n"),s.j41(26,"button",11),s.nI1(27,"i18n"),s.nrm(28,"i",12),s.k0s(),s.j41(29,"bit-popover",13,0),s.nI1(31,"i18n"),s.j41(32,"p",14),s.EFF(33),s.nI1(34,"i18n"),s.k0s()()(),s.nrm(35,"input",15),s.DNE(36,Zt,1,0,"button",16)(37,Qt,2,4,"button",17),s.k0s()()(),s.nrm(38,"vault-autofill-options")),2&e){const e=s.sdS(30);s.Y8G("formGroup",t.loginDetailsForm),s.R7$(3),s.SpI(" ",s.bMT(4,17,"loginCredentials")," "),s.R7$(5),s.JRh(s.bMT(9,19,"username")),s.R7$(3),s.Y8G("ngIf",t.loginDetailsForm.controls.username.enabled),s.R7$(3),s.JRh(s.bMT(15,21,"password")),s.R7$(3),s.Y8G("ngIf",t.loginDetailsForm.controls.password.enabled),s.R7$(),s.Y8G("ngIf",t.loginDetailsForm.controls.password.enabled&&(null==t.loginDetailsForm.controls.password.value?null:t.loginDetailsForm.controls.password.value.length)>0),s.R7$(),s.Y8G("ngIf",t.viewHiddenFields),s.R7$(),s.Y8G("ngIf",t.loginDetailsForm.controls.password.enabled),s.R7$(),s.Y8G("ngIf",t.hasPasskey),s.R7$(3),s.SpI(" ",s.bMT(25,23,"authenticatorKey")," "),s.R7$(2),s.Y8G("bitPopoverTriggerFor",e)("appA11yTitle",s.bMT(27,25,"learnMoreAboutAuthenticators")),s.R7$(3),s.Y8G("title",s.bMT(31,27,"totpHelperTitle")),s.R7$(4),s.SpI(" ",s.bMT(34,29,t.canCaptureTotp?"totpHelperWithCapture":"totpHelper")," "),s.R7$(3),s.Y8G("ngIf",t.viewHiddenFields),s.R7$(),s.Y8G("ngIf",t.canCaptureTotp)}},dependencies:[a.X1,a.me,a.BC,a.cb,a.j4,a.JD,F.U,g.E,ue.r,T.p,jt.C,R.i,b.L,_.j,X.I,Y.J,H.h,ce.e,de.a,j.Q,Z.s,f.C,Nt.p,n.bT,ct.k,Vt.r,Bt.k,Dt,x.V,pe.o,Q.$],encapsulation:2});var ti=i(33338),ii=i(93695),ni=i(59257),ri=i(31176),si=i(82781),oi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ai(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-spotlight",1),s.bIt("onDismiss",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.dismissNewItemSpotlight())}),s.k0s()}if(2&e){const e=s.XpG();s.Y8G("title",e.nudgeTitle)("subtitle",e.nudgeBody)}}class li{constructor(e,t,i){this.i18nService=e,this.accountService=t,this.nudgesService=i,this.configType=$e.hFB.required(),this.activeUserId$=this.accountService.activeAccount$.pipe(h.F6),this.showNewItemSpotlight$=(0,ti.z)([this.activeUserId$,(0,o.br)(this.configType).pipe((0,ze.T)(e=>this.mapToNudgeType(e)))]).pipe((0,u.n)(([e,t])=>this.nudgesService.showNudgeSpotlight$(t,e))),this.nudgeTitle="",this.nudgeBody="",this.dismissalNudgeType=null}mapToNudgeType(e){switch(e){case si.CipherType.Login:{const e=this.i18nService.t("newLoginNudgeBodyOne"),t=this.i18nService.t("newLoginNudgeBodyBold"),i=this.i18nService.t("newLoginNudgeBodyTwo");return this.dismissalNudgeType=ni.m.NewLoginItemStatus,this.nudgeTitle=this.i18nService.t("newLoginNudgeTitle"),this.nudgeBody=`${e} <strong>${t}</strong> ${i}`,ni.m.NewLoginItemStatus}case si.CipherType.Card:return this.dismissalNudgeType=ni.m.NewCardItemStatus,this.nudgeTitle=this.i18nService.t("newCardNudgeTitle"),this.nudgeBody=this.i18nService.t("newCardNudgeBody"),ni.m.NewCardItemStatus;case si.CipherType.Identity:return this.dismissalNudgeType=ni.m.NewIdentityItemStatus,this.nudgeTitle=this.i18nService.t("newIdentityNudgeTitle"),this.nudgeBody=this.i18nService.t("newIdentityNudgeBody"),ni.m.NewIdentityItemStatus;case si.CipherType.SecureNote:return this.dismissalNudgeType=ni.m.NewNoteItemStatus,this.nudgeTitle=this.i18nService.t("newNoteNudgeTitle"),this.nudgeBody=this.i18nService.t("newNoteNudgeBody"),ni.m.NewNoteItemStatus;case si.CipherType.SshKey:{const e=this.i18nService.t("newSshNudgeBodyOne"),t=this.i18nService.t("newSshNudgeBodyTwo");return this.dismissalNudgeType=ni.m.NewSshItemStatus,this.nudgeTitle=this.i18nService.t("newSshNudgeTitle"),this.nudgeBody=`${e} <a href="https://bitwarden.com/help/ssh-agent" class="tw-text-primary-600 tw-font-medium" target="_blank">${t}</a>`,ni.m.NewSshItemStatus}default:throw new Error("Unsupported cipher type")}}dismissNewItemSpotlight(){return oi(this,void 0,void 0,function*(){const e=yield(0,d._)(this.activeUserId$);this.dismissalNudgeType&&e&&(yield this.nudgesService.dismissNudge(this.dismissalNudgeType,e),this.showNewItemSpotlight$=(0,ii.of)(!1))})}}li.ɵfac=function(e){return new(e||li)(s.rXU(z.W),s.rXU(He.Di),s.rXU(ni.u))},li.ɵcmp=s.VBU({type:li,selectors:[["vault-new-item-nudge"]],inputs:{configType:[1,"configType"]},decls:2,vars:3,consts:[[3,"title","subtitle"],[3,"onDismiss","title","subtitle"]],template:function(e,t){1&e&&(s.nVh(0,ai,1,2,"bit-spotlight",0),s.nI1(1,"async")),2&e&&s.vxM(s.bMT(1,1,t.showNewItemSpotlight$)?0:-1)},dependencies:[ri.c,n.Jj],encapsulation:2});var ci=i(66523),di=i(72142),ui=i(22869),hi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function pi(e,t){if(1&e){const e=s.RV6();s.j41(0,"button",7),s.nI1(1,"i18n"),s.bIt("click",function(){r.eBV(e);const t=s.XpG();return r.Njj(t.importSshKeyFromClipboard())}),s.k0s()}2&e&&s.Y8G("label",s.mNQ(s.bMT(1,2,"importSshKeyFromClipboard")))}class mi{constructor(e,t,i,n,s){this.cipherFormContainer=e,this.formBuilder=t,this.sdkService=i,this.sshImportPromptService=n,this.platformUtilsService=s,this.sshKeyForm=this.formBuilder.group({privateKey:[""],publicKey:[""],keyFingerprint:[""]}),this.showImport=!1,this.destroyRef=(0,r.WQX)(r.abz),this.cipherFormContainer.registerChildForm("sshKeyDetails",this.sshKeyForm),this.sshKeyForm.valueChanges.pipe((0,o.pQ)()).subscribe(e=>{const t=new di.H;t.privateKey=e.privateKey,t.publicKey=e.publicKey,t.keyFingerprint=e.keyFingerprint,this.cipherFormContainer.patchCipher(e=>(e.sshKey=t,e))})}ngOnInit(){return hi(this,void 0,void 0,function*(){var e,t;const i=this.cipherFormContainer.getInitialCipherView(),n=null!==(e=null==i?void 0:i.sshKey)&&void 0!==e?e:null===(t=this.originalCipherView)||void 0===t?void 0:t.sshKey;n?this.setInitialValues(n):yield this.generateSshKey(),this.sshKeyForm.disable(),this.platformUtilsService.getClientType()!==D.sK.Web&&(this.showImport=!0),this.cipherFormContainer.formStatusChange$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{"enabled"===e&&this.sshKeyForm.disable()})})}setInitialValues(e){const{privateKey:t,publicKey:i,keyFingerprint:n}=e;this.sshKeyForm.setValue({privateKey:t,publicKey:i,keyFingerprint:n})}importSshKeyFromClipboard(){return hi(this,void 0,void 0,function*(){const e=yield this.sshImportPromptService.importSshKeyFromClipboard();null!=e&&this.sshKeyForm.setValue({privateKey:e.privateKey,publicKey:e.publicKey,keyFingerprint:e.keyFingerprint})})}generateSshKey(){return hi(this,void 0,void 0,function*(){yield(0,d._)(this.sdkService.client$);const e=(0,si.generate_ssh_key)("Ed25519");this.sshKeyForm.setValue({privateKey:e.privateKey,publicKey:e.publicKey,keyFingerprint:e.fingerprint})})}}mi.ɵfac=function(e){return new(e||mi)(s.rXU(S),s.rXU(a.ok),s.rXU(ci.K5),s.rXU(ui.V),s.rXU(Pt.y))},mi.ɵcmp=s.VBU({type:mi,selectors:[["vault-sshkey-section"]],inputs:{originalCipherView:"originalCipherView",disabled:"disabled"},decls:23,vars:14,consts:[[1,"tw-mb-5","bit-compact:tw-mb-4",3,"formGroup"],["bitTypography","h6"],["id","privateKey","bitInput","","formControlName","privateKey","type","password"],["type","button","bitIconButton","","bitSuffix","","data-testid","toggle-privateKey-visibility","bitPasswordInputToggle",""],["type","button","bitIconButton","bwi-import","bitSuffix","","data-testid","import-privateKey",3,"label","click",4,"ngIf"],["id","publicKey","bitInput","","formControlName","publicKey"],["id","keyFingerprint","bitInput","","formControlName","keyFingerprint"],["type","button","bitIconButton","bwi-import","bitSuffix","","data-testid","import-privateKey",3,"click","label"]],template:function(e,t){1&e&&(s.j41(0,"section",0)(1,"bit-section-header")(2,"h2",1),s.EFF(3),s.nI1(4,"i18n"),s.k0s()(),s.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),s.EFF(8),s.nI1(9,"i18n"),s.k0s(),s.nrm(10,"input",2)(11,"button",3),s.DNE(12,pi,2,4,"button",4),s.k0s(),s.j41(13,"bit-form-field")(14,"bit-label"),s.EFF(15),s.nI1(16,"i18n"),s.k0s(),s.nrm(17,"input",5),s.k0s(),s.j41(18,"bit-form-field")(19,"bit-label"),s.EFF(20),s.nI1(21,"i18n"),s.k0s(),s.nrm(22,"input",6),s.k0s()()()),2&e&&(s.Y8G("formGroup",t.sshKeyForm),s.R7$(3),s.SpI(" ",s.bMT(4,6,"typeSshKey")," "),s.R7$(5),s.JRh(s.bMT(9,8,"sshPrivateKey")),s.R7$(4),s.Y8G("ngIf",t.showImport),s.R7$(3),s.JRh(s.bMT(16,10,"sshPublicKey")),s.R7$(5),s.JRh(s.bMT(21,12,"sshFingerprint")))},dependencies:[R.i,g.E,ue.r,b.L,_.j,Y.J,H.h,ce.e,de.a,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,w.p,F.U,j.Q,Z.s,T.p,n.MD,n.bT,Q.$],encapsulation:2});var vi=i(69588),fi=i(92411),gi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const yi=[[["","slot","attachment-button"]]];function bi(e,t){if(1&e&&s.nrm(0,"vault-new-item-nudge",3),2&e){const e=s.XpG();s.Y8G("configType",e.config.cipherType)}}function wi(e,t){1&e&&s.nrm(0,"vault-login-details-section")}function Si(e,t){if(1&e&&s.nrm(0,"vault-identity-section",8),2&e){const e=s.XpG(2);s.Y8G("disabled","partial-edit"===e.config.mode)("originalCipherView",e.originalCipherView)}}function Ii(e,t){if(1&e&&s.nrm(0,"vault-card-details-section",9),2&e){const e=s.XpG(2);s.Y8G("originalCipherView",e.originalCipherView)("disabled","partial-edit"===e.config.mode)}}function ki(e,t){if(1&e&&s.nrm(0,"vault-sshkey-section",8),2&e){const e=s.XpG(2);s.Y8G("disabled","partial-edit"===e.config.mode)("originalCipherView",e.originalCipherView)}}function Ci(e,t){1&e&&(s.qex(0),s.SdG(1),s.bVm())}function Ti(e,t){if(1&e&&(s.qex(0),s.nrm(1,"vault-item-details-section",4),s.DNE(2,wi,1,0,"vault-login-details-section",2)(3,Si,1,2,"vault-identity-section",5)(4,Ii,1,2,"vault-card-details-section",6)(5,ki,1,2,"vault-sshkey-section",5),s.nrm(6,"vault-additional-options-section",7),s.DNE(7,Ci,2,0,"ng-container",2),s.bVm()),2&e){const e=s.XpG();s.R7$(),s.Y8G("config",e.config)("originalCipherView",e.originalCipherView),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.Login),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.Identity),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.Card),s.R7$(),s.Y8G("ngIf",e.config.cipherType===e.CipherType.SshKey),s.R7$(),s.Y8G("disableSectionMargin","edit"!==e.config.mode),s.R7$(),s.Y8G("ngIf","edit"==e.config.mode)}}class Fi{get website(){var e,t,i,n,r;return null!==(r=null===(n=null===(i=null===(t=null===(e=this.updatedCipherView)||void 0===e?void 0:e.login)||void 0===t?void 0:t.uris)||void 0===i?void 0:i[0])||void 0===n?void 0:n.uri)&&void 0!==r?r:null}ngAfterViewInit(){this.submitBtn&&(this.bitSubmit.loading$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.loading.set(e)}),this.bitSubmit.disabled$.pipe((0,o.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.disabled.set(e)}))}disableFormFields(){this.cipherForm.disable({emitEvent:!1}),this.formStatusChangeSubject.next("disabled")}enableFormFields(){"disabled"===this.formStatusChangeSubject.getValue()&&(this.cipherForm.enable({emitEvent:!1}),this.formStatusChangeSubject.next("enabled"))}registerChildForm(e,t){this.cipherForm.setControl(e,t)}patchCipher(e){this.updatedCipherView=e(this.updatedCipherView),this.cipherFormCacheService.cacheCipherView(this.updatedCipherView)}getInitialCipherView(){const e=this.cipherFormCacheService.getCachedCipherView();return e&&this.initializedWithCachedCipher()?e:this.originalCipherView}initializedWithCachedCipher(){return this.cipherFormCacheService.initializedWithValue}ngOnChanges(){return gi(this,void 0,void 0,function*(){this._firstInitialized&&(yield this.init())})}ngOnInit(){return gi(this,void 0,void 0,function*(){yield this.init(),this._firstInitialized=!0})}init(){return gi(this,void 0,void 0,function*(){if(this.loading=!0,this.changeDetectorRef.detectChanges(),this.updatedCipherView=new m.f,this.originalCipherView=null,this.cipherForm=this.formBuilder.group({}),null!=this.config){if("add"!==this.config.mode){if(null==this.config.originalCipher)throw new Error("Original cipher is required for edit or clone mode");this.originalCipherView=yield this.addEditFormService.decryptCipher(this.config.originalCipher),this.updatedCipherView=yield this.addEditFormService.decryptCipher(this.config.originalCipher),"clone"===this.config.mode&&(this.updatedCipherView.id=null,this.updatedCipherView.login&&(this.updatedCipherView.login.fido2Credentials=null))}else this.updatedCipherView.type=this.config.cipherType,this.config.cipherType===p.gC.SecureNote&&(this.updatedCipherView.secureNote.type=p.ak.Generic);this.setInitialCipherFromCache(),this.loading=!1,this.formReadySubject.next()}})}setInitialCipherFromCache(){if(this.config.initialValues&&(void 0!==this.config.initialValues.username||void 0!==this.config.initialValues.password))return void this.cipherFormCacheService.clearCache();const e=this.cipherFormCacheService.getCachedCipherView();if(null===e)return;const t=this.updatedCipherView.id&&this.updatedCipherView.id===e.id,i=!this.updatedCipherView.id&&!e.id&&this.updatedCipherView.type===e.type;(t||i)&&(this.updatedCipherView=e)}constructor(e,t,i,n,o,a,m,v){this.formBuilder=e,this.addEditFormService=t,this.toastService=i,this.i18nService=n,this.changeDetectorRef=o,this.cipherFormCacheService=a,this.cipherArchiveService=m,this.accountService=v,this.destroyRef=(0,r.WQX)(r.abz),this._firstInitialized=!1,this.cipherSaved=new s.bkB,this.formReadySubject=new l.B,this.formReady=this.formReadySubject.asObservable(),this.formStatusChangeSubject=new c.t(null),this.formStatusChange$=this.formStatusChangeSubject.asObservable(),this.cipherForm=this.formBuilder.group({}),this.loading=!0,this.CipherType=p.gC,this.submit=()=>gi(this,void 0,void 0,function*(){if(this.cipherForm.invalid){this.cipherForm.markAllAsTouched();const e=this.countInvalidFields(this.cipherForm);return void(e>0&&this.toastService.showToast({variant:"error",title:null,message:1===e?this.i18nService.t("singleFieldNeedsAttention"):this.i18nService.t("multipleFieldsNeedAttention",e)}))}if(this.beforeSubmit){if(!(yield this.beforeSubmit()))return}!(yield(0,d._)(this.accountService.activeAccount$.pipe(h.F6,(0,u.n)(e=>this.cipherArchiveService.userCanArchive$(e)))))&&this.updatedCipherView.archivedDate&&(this.updatedCipherView.archivedDate=null);const e=yield this.addEditFormService.saveCipher(this.updatedCipherView,this.config);this.cipherFormCacheService.clearCache(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("edit"===this.config.mode||"partial-edit"===this.config.mode?"editedItem":"addedItem")}),this.cipherSaved.emit(e)})}countInvalidFields(e){return Object.values(e.controls).reduce((e,t)=>t instanceof a.gE?e+this.countInvalidFields(t):e+(t.invalid?1:0),0)}}Fi.ɵfac=function(e){return new(e||Fi)(s.rXU(a.ok),s.rXU(vi.L),s.rXU(Ut.f),s.rXU(z.W),s.rXU($e.gRc),s.rXU(k),s.rXU(fi.J),s.rXU(He.Di))},Fi.ɵcmp=s.VBU({type:Fi,selectors:[["vault-cipher-form"]],viewQuery:function(e,t){if(1&e&&s.GBs(v.L,5),2&e){let e;s.mGM(e=s.lsd())&&(t.bitSubmit=e.first)}},inputs:{formId:"formId",config:"config",submitBtn:"submitBtn",beforeSubmit:"beforeSubmit"},outputs:{cipherSaved:"cipherSaved",formReady:"formReady",formStatusChange$:"formStatusChange$"},features:[s.Jv_([{provide:S,useExisting:(0,r.Rfq)(()=>Fi)},{provide:k}]),s.OA$],ngContentSelectors:["[slot=attachment-button]"],decls:3,vars:5,consts:[[3,"configType",4,"ngIf"],[3,"id","formGroup","bitSubmit"],[4,"ngIf"],[3,"configType"],[3,"config","originalCipherView"],[3,"disabled","originalCipherView",4,"ngIf"],[3,"originalCipherView","disabled",4,"ngIf"],[3,"disableSectionMargin"],[3,"disabled","originalCipherView"],[3,"originalCipherView","disabled"]],template:function(e,t){1&e&&(s.NAR(yi),s.DNE(0,bi,1,1,"vault-new-item-nudge",0),s.j41(1,"form",1),s.DNE(2,Ti,8,8,"ng-container",2),s.k0s()),2&e&&(s.Y8G("ngIf",!t.loading),s.R7$(),s.Y8G("id",t.formId)("formGroup",t.cipherForm)("bitSubmit",t.submit),s.R7$(),s.Y8G("ngIf",!t.loading))},dependencies:[f.C,v.L,g.E,y.k,b.L,a.X1,a.qT,a.cb,a.j4,w.p,lt,Ne,Be,mi,n.bT,Oe,ei,li],encapsulation:2})},86973:()=>{},87895:(e,t,i)=>{"use strict";i.d(t,{R:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.33 3.33 76.49 75.83">
    <path class="tw-fill-illustration-bg-primary" d="M3.333 8.334a5 5 0 0 1 5-5H35a5 5 0 0 1 5 5v56.667a5 5 0 0 1-5 5H8.333a5 5 0 0 1-5-5V8.334Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35 5H8.333A3.333 3.333 0 0 0 5 8.335v56.667a3.333 3.333 0 0 0 3.333 3.333H35a3.333 3.333 0 0 0 3.333-3.333V8.334A3.333 3.333 0 0 0 35 5.001ZM8.333 3.335a5 5 0 0 0-5 5v56.667a5 5 0 0 0 5 5H35a5 5 0 0 0 5-5V8.334a5 5 0 0 0-5-5H8.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M18.333 9.167c0-.46.373-.833.834-.833h5a.833.833 0 0 1 0 1.667h-5a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M36.667 38.333c0 10.126-6.716 18.334-15 18.334-8.285 0-15-8.208-15-18.334 0-10.125 6.715-18.333 15-18.333 8.284 0 15 8.208 15 18.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M21.667 55C28.733 55 35 47.866 35 38.333c0-9.533-6.267-16.666-13.333-16.666-7.067 0-13.334 7.133-13.334 16.666C8.333 47.866 14.6 55 21.667 55Zm0 1.667c8.284 0 15-8.208 15-18.334 0-10.125-6.716-18.333-15-18.333-8.285 0-15 8.208-15 18.333 0 10.126 6.715 18.334 15 18.334Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M68.333 35c0 6.444-5.223 11.667-11.666 11.667C50.223 46.667 45 41.444 45 35.001c0-6.444 5.223-11.667 11.667-11.667 6.443 0 11.666 5.223 11.666 11.667Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M56.667 45c5.523 0 10-4.477 10-10 0-5.522-4.477-10-10-10s-10 4.478-10 10c0 5.523 4.477 10 10 10Zm0 1.667c6.443 0 11.666-5.223 11.666-11.666 0-6.444-5.223-11.667-11.666-11.667C50.223 23.334 45 28.557 45 35.001c0 6.443 5.223 11.666 11.667 11.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M78.255 59.98a22.918 22.918 0 0 1 1.559 5.854H41.667v-8.333h-4.549a22.916 22.916 0 0 1 41.137 2.48Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M43.333 55.834v8.333h34.5a21.238 21.238 0 0 0-5.724-10.442 21.25 21.25 0 0 0-31.9 2.109h3.124Zm-5.18 0c-.368.54-.714 1.096-1.035 1.667h4.549v8.333h38.147a22.875 22.875 0 0 0-1.558-5.853 22.915 22.915 0 0 0-40.102-4.147Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M39.167 79.167c5.272 0 9.829-3.06 11.993-7.5h5.65c.442 0 .866-.176 1.178-.489L60 69.168l1.91 1.91a.833.833 0 0 0 1.18 0l.66-.66.66.66a.833.833 0 0 0 1.18 0l1.91-1.91 2.012 2.011c.312.313.736.489 1.178.489h2.786c.442 0 .866-.176 1.179-.489l5.05-5.05a.417.417 0 0 0 0-.59l-5.05-5.05A1.667 1.667 0 0 0 73.476 60H51.16c-2.164-4.44-6.721-7.5-11.993-7.5-7.364 0-13.334 5.97-13.334 13.333 0 7.364 5.97 13.334 13.334 13.334Zm-5-10.834a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50.118 70h6.692L60 66.81l2.5 2.5 1.25-1.25L65 69.31l2.5-2.5L70.69 70h2.786l4.167-4.167-4.167-4.166H50.118l-.457-.937a11.667 11.667 0 0 0-10.494-6.563c-6.444 0-11.667 5.223-11.667 11.666 0 6.444 5.223 11.667 11.667 11.667 4.61 0 8.6-2.674 10.494-6.563l.457-.937Zm29.587-3.872a.417.417 0 0 0 0-.59l-5.05-5.05A1.667 1.667 0 0 0 73.476 60H51.16c-2.164-4.44-6.721-7.5-11.993-7.5-7.364 0-13.334 5.97-13.334 13.333 0 7.364 5.97 13.334 13.334 13.334 5.272 0 9.829-3.06 11.993-7.5h5.65c.442 0 .866-.176 1.178-.489L60 69.168l1.91 1.91a.833.833 0 0 0 1.179.001l.661-.661.66.66.002.001a.833.833 0 0 0 1.177 0l1.911-1.911 2.012 2.011c.312.313.736.489 1.178.489h2.786c.442 0 .866-.176 1.179-.489l5.05-5.05Zm-41.372-.295a4.167 4.167 0 1 1-8.333 0 4.167 4.167 0 0 1 8.333 0Zm-1.666 0a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM16.126 28.497a15.793 15.793 0 0 1 5.542-.996c1.95 0 3.818.352 5.541.996a.833.833 0 0 0 .584-1.56 17.462 17.462 0 0 0-6.125-1.103c-2.154 0-4.218.39-6.125 1.102a.833.833 0 1 0 .583 1.561Zm5.542 2.337a11.648 11.648 0 0 0-9.335 4.667.833.833 0 1 1-1.332-1 13.314 13.314 0 0 1 10.667-5.334c4.331 0 7.947 1.77 10.59 4.41a.833.833 0 1 1-1.179 1.18c-2.36-2.36-5.564-3.923-9.411-3.923Zm-.117 1.667c-5.377 0-9.63 4.555-9.26 9.92l.075 1.081c.097 1.4.428 2.772.98 4.061l.47 1.099a.833.833 0 1 0 1.532-.656l-.47-1.1a10.835 10.835 0 0 1-.85-3.519l-.074-1.08a7.615 7.615 0 1 1 15.212-.524v.718a.833.833 0 0 1-1.666 0v-.834a5.848 5.848 0 0 0-1.522-3.927c-1.054-1.146-2.637-1.906-4.728-1.906-2.173 0-3.575.99-4.397 2.254-.79 1.216-1.02 2.639-1.02 3.58 0 2.326.209 4.02.794 5.424.593 1.425 1.54 2.465 2.84 3.549a.833.833 0 1 0 1.067-1.28c-1.2-1-1.921-1.835-2.369-2.91-.457-1.097-.665-2.527-.665-4.784 0-.726.187-1.803.75-2.67.533-.82 1.423-1.496 3-1.496 1.659 0 2.785.589 3.501 1.368a4.181 4.181 0 0 1 1.082 2.798v.834a2.5 2.5 0 0 0 5 0v-.718a9.282 9.282 0 0 0-9.282-9.282Zm-.754 9.116c0-.42.347-.783.823-.783a.88.88 0 0 1 .88.88v1.364a4.68 4.68 0 0 0 1.872 3.743l.684.513a5 5 0 0 0 3 1h.277a.833.833 0 0 0 0-1.667h-.277a3.334 3.334 0 0 1-2-.666l-.684-.513a3.013 3.013 0 0 1-1.205-2.41v-1.364a2.547 2.547 0 0 0-2.547-2.547c-1.342 0-2.492 1.056-2.49 2.453.001.82.033 1.85.148 2.804.125 1.035.627 1.848 1.163 2.526.244.31.509.608.757.887l.066.074c.274.308.526.597.752.895.553.729.7 1.326.544 1.719a.833.833 0 0 0 1.547.619c.504-1.26-.137-2.52-.763-3.345-.27-.356-.562-.688-.834-.994l-.06-.069a18.78 18.78 0 0 1-.701-.819c-.456-.577-.745-1.1-.817-1.693a23.012 23.012 0 0 1-.135-2.607Z" clip-rule="evenodd"/>
  </svg>
`},87916:(e,t,i)=>{"use strict";i.d(t,{V:()=>c});var n=i(60989),r=i(6056),s=i(24137),o=i(25065),a=i(74208),l=i(33812);class c{}c.ɵfac=function(e){return new(e||c)},c.ɵmod=l.$C({type:c}),c.ɵinj=a.G2t({imports:[o.G,n.Pd,r.iI,s.f]})},88016:(e,t,i)=>{"use strict";i.d(t,{$:()=>s});var n=i(33812),r=i(50700);class s{constructor(e){this.i18nService=e}transform(e,t,i,n){return this.i18nService.t(e,t,i,n)}}s.ɵfac=function(e){return new(e||s)(n.rXU(r.W,16))},s.ɵpipe=n.EJ8({name:"i18n",type:s,pure:!0,standalone:!1})},88083:(e,t,i)=>{"use strict";var n,r,s,o,a,l,c;function d(e){return e!==a.Free&&e!==a.TeamsStarter&&e!==a.Families}i.d(t,{eq:()=>n,$y:()=>c,MM:()=>r,OL:()=>s,K_:()=>a,ch:()=>l,D_:()=>o,LF:()=>d}),function(e){e[e.Card=0]="Card",e[e.BankAccount=1]="BankAccount",e[e.PayPal=2]="PayPal",e[e.BitPay=3]="BitPay",e[e.Credit=4]="Credit",e[e.WireTransfer=5]="WireTransfer",e[e.Check=8]="Check"}(n||(n={})),function(e){e[e.FamiliesForEnterprise=0]="FamiliesForEnterprise"}(r||(r={})),function(e){e[e.Free=0]="Free",e[e.FamiliesAnnually2019=1]="FamiliesAnnually2019",e[e.TeamsMonthly2019=2]="TeamsMonthly2019",e[e.TeamsAnnually2019=3]="TeamsAnnually2019",e[e.EnterpriseMonthly2019=4]="EnterpriseMonthly2019",e[e.EnterpriseAnnually2019=5]="EnterpriseAnnually2019",e[e.Custom=6]="Custom",e[e.FamiliesAnnually2025=7]="FamiliesAnnually2025",e[e.TeamsMonthly2020=8]="TeamsMonthly2020",e[e.TeamsAnnually2020=9]="TeamsAnnually2020",e[e.EnterpriseMonthly2020=10]="EnterpriseMonthly2020",e[e.EnterpriseAnnually2020=11]="EnterpriseAnnually2020",e[e.TeamsMonthly2023=12]="TeamsMonthly2023",e[e.TeamsAnnually2023=13]="TeamsAnnually2023",e[e.EnterpriseMonthly2023=14]="EnterpriseMonthly2023",e[e.EnterpriseAnnually2023=15]="EnterpriseAnnually2023",e[e.TeamsStarter2023=16]="TeamsStarter2023",e[e.TeamsMonthly=17]="TeamsMonthly",e[e.TeamsAnnually=18]="TeamsAnnually",e[e.EnterpriseMonthly=19]="EnterpriseMonthly",e[e.EnterpriseAnnually=20]="EnterpriseAnnually",e[e.TeamsStarter=21]="TeamsStarter",e[e.FamiliesAnnually=22]="FamiliesAnnually"}(s||(s={})),function(e){e[e.Charge=0]="Charge",e[e.Credit=1]="Credit",e[e.PromotionalCredit=2]="PromotionalCredit",e[e.ReferralCredit=3]="ReferralCredit",e[e.Refund=4]="Refund"}(o||(o={})),function(e){e[e.Free=0]="Free",e[e.Families=1]="Families",e[e.Teams=2]="Teams",e[e.Enterprise=3]="Enterprise",e[e.TeamsStarter=4]="TeamsStarter"}(a||(a={})),function(e){e[e.PasswordManager=0]="PasswordManager",e[e.SecretsManager=1]="SecretsManager"}(l||(l={})),function(e){e[e.Monthly=0]="Monthly",e[e.Annually=1]="Annually"}(c||(c={}))},88516:(e,t,i)=>{"use strict";i.d(t,{W:()=>k});var n=i(58716),r=i(54539),s=i(77468),o=i(74208),a=i(94573),l=i(33812),c=i(33277),d=i(40443),u=i(17386),h=i(39200),p=i(37831);function m(e,t){}class v{get hidden(){return!this.active()||null}constructor(){this._firstRender=!1,this.content=(0,a.hFB)(),this.preserveContent=(0,a.hFB)(!1),this.active=(0,a.hFB)(),(0,c.QZ)(()=>{this.active()&&(this._firstRender=!0)})}get tabContent(){return this.active()||this.preserveContent()&&this._firstRender?this.content():null}}v.ɵfac=function(e){return new(e||v)},v.ɵcmp=l.VBU({type:v,selectors:[["bit-tab-body"]],hostVars:1,hostBindings:function(e,t){2&e&&l.BMQ("hidden",t.hidden)},inputs:{content:[1,"content"],preserveContent:[1,"preserveContent"],active:[1,"active"]},decls:1,vars:1,consts:[[3,"cdkPortalOutlet"]],template:function(e,t){1&e&&l.DNE(0,m,0,0,"ng-template",0),2&e&&l.Y8G("cdkPortalOutlet",t.tabContent)},dependencies:[p.I3],encapsulation:2});var f=i(49608);function g(e,t){if(1&e&&l.eu8(0,6),2&e){const e=l.XpG(2).$implicit;l.Y8G("ngTemplateOutlet",e.templateLabel.templateRef)}}function y(e,t){if(1&e&&l.EFF(0),2&e){const e=l.XpG(2).$implicit;l.SpI(" ",e.textLabel()," ")}}function b(e,t){if(1&e&&l.nVh(0,g,1,1,"ng-container",6)(1,y,1,1),2&e){const e=l.XpG().$implicit;l.vxM(e.templateLabel?0:1)}}function w(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",5),l.bIt("click",function(){const t=o.eBV(e).$index,i=l.XpG();return o.Njj(i.selectTab(t))}),l.eu8(1,6),l.DNE(2,b,2,1,"ng-template",null,0,l.C5r),l.k0s()}if(2&e){const e=t.$implicit,i=t.$index,n=l.sdS(3),r=l.XpG();l.Y8G("id",r.getTabLabelId(i))("active",e.isActive)("disabled",e.disabled()),l.BMQ("aria-selected",r.selectedIndex===i)("tabindex",r.selectedIndex===i?0:-1),l.R7$(),l.Y8G("ngTemplateOutlet",n)}}function S(e,t){if(1&e&&l.nrm(0,"bit-tab-body",4),2&e){const e=t.$implicit,i=t.$index,n=l.XpG();l.Y8G("id",n.getTabContentId(i))("active",e.isActive)("content",e.content)("preserveContent",n.preserveContent()),l.BMQ("tabindex",e.contentTabIndex())("labeledby",n.getTabLabelId(i))}}let I=0;class k{get selectedIndex(){return this._selectedIndex}set selectedIndex(e){this._indexToSelect=(0,r.OE)(e,null)}constructor(){this.destroyRef=(0,o.WQX)(o.abz),this._indexToSelect=0,this.label=(0,a.hFB)(""),this.preserveContent=(0,a.hFB)(!1),this._tab=a.sbv.required(f.j),this.tabs=(0,a.tEk)(f.j),this.tabLabels=(0,a.dtW)(h.y),this._selectedIndex=null,this.selectedIndexChange=new l.bkB,this.selectedTabChange=new l.bkB,this._groupId=I++,(0,c.QZ)(()=>{var e;const t=this._clampTabIndex(null!==(e=this._indexToSelect)&&void 0!==e?e:0);if(t===this._selectedIndex){const e=this.tabs();let i;for(let t=0;t<e.length;t++)if(e[t].isActive){this._indexToSelect=this._selectedIndex=t,i=e[t];break}!i&&e[t]&&(e[t].isActive=!0,this.selectedTabChange.emit({index:t,tab:e[t]}))}})}getTabContentId(e){return`bit-tab-content-${this._groupId}-${e}`}getTabLabelId(e){return`bit-tab-label-${this._groupId}-${e}`}selectTab(e){this.selectedIndex=e}ngAfterContentChecked(){var e,t;const i=this._indexToSelect=this._clampTabIndex(null!==(e=this._indexToSelect)&&void 0!==e?e:0);if(this._selectedIndex!=i){const e=null==this._selectedIndex;e||this.selectedTabChange.emit({index:i,tab:this.tabs()[i]}),Promise.resolve().then(()=>{this.tabs().forEach((e,t)=>e.isActive=t===i),e||this.selectedIndexChange.emit(i)}),this._selectedIndex=i,null===(t=this.keyManager)||void 0===t||t.setActiveItem(i)}}ngAfterViewInit(){this.keyManager=new n.B(this.tabLabels()).withHorizontalOrientation("ltr").withWrap().withHomeAndEnd()}_clampTabIndex(e){return Math.min(this.tabs().length-1,Math.max(e||0,0))}}k.ɵfac=function(e){return new(e||k)},k.ɵcmp=l.VBU({type:k,selectors:[["bit-tab-group"]],contentQueries:function(e,t,i){1&e&&(l.C6U(i,t._tab,f.j,5),l.C6U(i,t.tabs,f.j,4)),2&e&&l.NyB(2)},viewQuery:function(e,t){1&e&&l.wEZ(t.tabLabels,h.y,5),2&e&&l.NyB()},inputs:{label:[1,"label"],preserveContent:[1,"preserveContent"],selectedIndex:"selectedIndex"},outputs:{selectedIndexChange:"selectedIndexChange",selectedTabChange:"selectedTabChange"},decls:7,vars:1,consts:[["content",""],["bitTabListContainer","","role","tablist",3,"keydown"],["bitTabListItem","","type","button","role","tab",3,"id","active","disabled"],[1,"tw-px-6","tw-pt-5"],["role","tabpanel",3,"id","active","content","preserveContent"],["bitTabListItem","","type","button","role","tab",3,"click","id","active","disabled"],[3,"ngTemplateOutlet"]],template:function(e,t){1&e&&(l.j41(0,"bit-tab-header")(1,"div",1),l.bIt("keydown",function(e){return t.keyManager.onKeydown(e)}),l.Z7z(2,w,4,6,"button",2,l.fX1),l.k0s()(),l.j41(4,"div",3),l.Z7z(5,S,1,6,"bit-tab-body",4,l.fX1),l.k0s()),2&e&&(l.R7$(),l.BMQ("aria-label",t.label()),l.R7$(),l.Dyx(t.tabs()),l.R7$(3),l.Dyx(t.tabs()))},dependencies:[s.T3,d.g,u.k,h.y,v],encapsulation:2})},88547:(e,t,i)=>{"use strict";i.d(t,{D:()=>a});var n=i(94573),r=i(33812);function s(e,t){1&e&&r.Hgh(0,"i",1),2&e&&r.HbH(r.VkB("bwi ",t," !tw-me-2"))}function o(e,t){if(1&e&&(r.nVh(0,s,1,3,"i",0),r.SdG(1)),2&e){let e;const t=r.XpG();r.vxM((e=t.icon())?0:-1,e)}}class a{constructor(){this.icon=(0,n.hFB)(),this.route=(0,n.hFB)(),this.queryParams=(0,n.hFB)({}),this.queryParamsHandling=(0,n.hFB)(),this.click=new r.bkB,this.content=(0,n.ebz)(r.C4Q)}onClick(e){this.click.next(e)}}a.ɵfac=function(e){return new(e||a)},a.ɵcmp=r.VBU({type:a,selectors:[["bit-breadcrumb"]],viewQuery:function(e,t){1&e&&r.wEZ(t.content,r.C4Q,5),2&e&&r.NyB()},inputs:{icon:[1,"icon"],route:[1,"route"],queryParams:[1,"queryParams"],queryParamsHandling:[1,"queryParamsHandling"]},outputs:{click:"click"},ngContentSelectors:["*"],decls:1,vars:0,consts:[["aria-hidden","true",3,"class"],["aria-hidden","true"]],template:function(e,t){1&e&&(r.NAR(),r.PeT(0,o,2,1,"ng-template"))},encapsulation:2})},88832:(e,t,i)=>{"use strict";i.d(t,{n:()=>l});var n=i(93161),r=i(77468),s=i(94573),o=i(33812);const a=e=>({"tw-mb-5 bit-compact:tw-mb-4 [&:not(bit-dialog_*):not(popup-page_*)]:md:tw-mb-12":e});class l{constructor(){this.disableMargin=(0,s.hFB)(!1,{transform:n.he})}}l.ɵfac=function(e){return new(e||l)},l.ɵcmp=o.VBU({type:l,selectors:[["bit-section"]],inputs:{disableMargin:[1,"disableMargin"]},ngContentSelectors:["*"],decls:2,vars:3,consts:[[3,"ngClass"]],template:function(e,t){1&e&&(o.NAR(),o.j41(0,"section",0),o.SdG(1),o.k0s()),2&e&&o.Y8G("ngClass",o.eq3(1,a,!t.disableMargin()))},dependencies:[r.MD,r.YU],encapsulation:2})},89033:(e,t,i)=>{"use strict";i.d(t,{c:()=>o});var n=i(86226),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.j]})},89097:(e,t,i)=>{"use strict";i.d(t,{l:()=>r});var n=i(31857);class r{constructor(e,t,i,n,r,s){this.stateDefinition=e,this.key=t,this.classifier=i,this.options=n,this.deconstruct=r,this.reconstruct=s}toEncryptedStateKey(){return new n.Ok(this.stateDefinition,this.key,{cleanupDelayMs:this.options.cleanupDelayMs,deserializer:e=>e,clearOn:this.options.clearOn})}static value(e,t,i,n){return new r(e,t,i,n,e=>[[null,e]],([[,e]])=>e)}static array(e,t,i,n){return new r(e,t,i,n,e=>e.map((e,t)=>[t,e]),e=>e.map(([,e])=>e))}static record(e,t,i,n){return new r(e,t,i,n,e=>Object.entries(e),e=>Object.fromEntries(e))}}},89105:(e,t,i)=>{"use strict";i.d(t,{N:()=>n});class n{}},89177:(e,t,i)=>{"use strict";i.d(t,{T:()=>r});var n=i(75174);class r extends n.O{constructor(e){super(e),this.id=e.id}}},89207:(e,t,i)=>{"use strict";i.d(t,{G:()=>o});var n=i(77468),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.MD,n.MD]})},89222:(e,t,i)=>{"use strict";i.d(t,{p:()=>A});var n=i(48479),r=i(72737),s=i(16878),o=i(34040),a=i(27442),l=i(75811),c=i(99969),d=i(36359),u=i(3204),h=i(44500),p=i(80909),m=i(14803),v=i(12916),f=i(56986),g=i(8131),y=i(45505),b=i(69194),w=i(14928),S=i(21588),I=i(62179),k=i(73276),C=i(39306),T=i(20377);function F(e){return!!e&&"id"in e&&"secret"in e&&"disclosed"in e&&"string"==typeof e.secret&&"object"==typeof e.disclosed}var R=i(59303),P=i(31857);function x(e){return e&&"calibrate"in e}var $=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const E="$^$ALWAYS_UPDATE_KLUDGE_PROPERTY$^$";class A extends n.c{constructor(e,t,i){var n,y,b;super(),this.key=e,this.providers=t,this.context=i,this.input=new r.m(1),this.output=new r.m(1),this.counter=0,!function(e){return"object"===e.target&&"format"in e&&"classifier"in e}(this.key)?(this.objectKey=null,this.stateKey=this.key):(this.objectKey=this.key,this.stateKey=function(e){if("plain"===e.format)return new P.Ok(e.state,e.key,e.options);if("classified"===e.format)return new P.Ok(e.state,e.key,{cleanupDelayMs:e.options.cleanupDelayMs,deserializer:e=>e,clearOn:e.options.clearOn});if("secret-state"===e.format)return new P.Ok(e.state,e.key,{cleanupDelayMs:e.options.cleanupDelayMs,deserializer:e=>e,clearOn:e.options.clearOn});throw new Error(`unknown format: ${e.format}`)}(this.key)),this.log=this.providers.log({contextId:this.contextId,type:"UserStateSubject",storage:{state:this.stateKey.stateDefinition.name,key:this.stateKey.key}});const w=(null!==(n=this.context.when$)&&void 0!==n?n:new s.t(!0)).pipe((0,o.F)()),S=i.account$.pipe((0,T.y_)({name:()=>`${this.contextId} { account$ }`,distinct:(e,t)=>e.id===t.id}),(0,a.t)({refCount:!0,bufferSize:1})),I=this.encryptor(S),k=(null!==(y=this.context.constraints$)&&void 0!==y?y:(0,R.k)()).pipe((0,l.W)(e=>(this.log.error(e,"constraints$ dependency failed; using last-known constraints"),c.w)),(0,a.t)({refCount:!0,bufferSize:1})),C=(null!==(b=this.context.dependencies$)&&void 0!==b?b:new s.t(null)).pipe((0,a.t)({refCount:!0,bufferSize:1})),F=S.pipe((0,d.M)(e=>this.log.debug({accountId:e.id},"loading user state")),(0,u.T)(e=>this.providers.state.getUser(e.id,this.stateKey)),(0,a.t)({refCount:!0,bufferSize:1}));this.outputSubscription=F.pipe((0,h.n)(e=>e.state$),(0,u.T)(e=>(e&&"object"==typeof e&&E in e&&delete e[E],e)),this.declassify(I),this.adjust((0,p.v)(k)),(0,m.Q)((0,T.E)(S))).subscribe(this.output);const x=new r.m(1);this.output.pipe((0,v.H)(),(0,u.T)(e=>e.state)).subscribe(x);const $=(0,f.x)(this.input.pipe(this.when(w),this.adjust((0,T.bt)(k)),this.prepareUpdate(this,C)),x.pipe(this.fix(k),this.prepareUpdate(x,C)));this.inputSubscription=$.pipe(this.classify(I),(0,g.E)(F),(0,m.Q)((0,T.E)([w,this.input,I]))).subscribe({next:([e,t])=>this.onNext(e,t),error:e=>this.onError(e),complete:()=>this.onComplete()})}get contextId(){return`UserStateSubject(${this.stateKey.stateDefinition.name}, ${this.stateKey.key})`}encryptor(e){var t,i;const n=e.pipe((0,u.T)(e=>e.id)),r=null!==(i=null===(t=this.objectKey)||void 0===t?void 0:t.frame)&&void 0!==i?i:32;return this.providers.encryptor.userEncryptor$(r,{singleUserId$:n}).pipe((0,d.M)(()=>this.log.debug("encryptor constructed")),(0,u.T)(({encryptor:e})=>e),(0,a.t)({refCount:!0,bufferSize:1}))}when(e){return(0,y.F)((0,p.v)(e.pipe((0,o.F)())),(0,d.M)(([e,t])=>this.log.debug({when:t},"when status")),(0,b.p)(([e,t])=>!!t),(0,u.T)(([e])=>e))}prepareUpdate(e,t){return i=>(0,f.x)(e.pipe((0,w.$)(),(0,u.T)(e=>[e,null])),i.pipe((0,u.T)(e=>e.state),(0,g.E)(t))).pipe((0,S.S)(([e],[t,i])=>{var n,r,s,o,a,l;if(null===(s=null===(r=(n=this.context).shouldUpdate)||void 0===r?void 0:r.call(n,e,t,i))||void 0===s||s){return[null!==(l=null===(a=(o=this.context).nextValue)||void 0===a?void 0:a.call(o,e,t,i))&&void 0!==l?l:t,i]}return this.log.debug("shouldUpdate prevented write"),[e,null]}),(0,I.i)(1),(0,u.T)(([e])=>e),(0,o.F)())}adjust(e){return(0,y.F)(e,(0,u.T)(([e,t])=>{var i;if(!e&&!(null===(i=this.objectKey)||void 0===i?void 0:i.initial))return this.log.debug("no value; bypassing adjustment"),{constraints:{},state:null};this.log.debug("adjusting");const n=null!=e?e:structuredClone(this.objectKey.initial),r=x(t)?t.calibrate(n):t,s=r.adjust(n);return this.log.debug("adjusted"),{constraints:r.constraints,state:s}}))}fix(e){return(0,y.F)((0,p.v)(e),(0,u.T)(([e,t])=>{this.log.debug("fixing");const i=x(t)?t.calibrate(e):t,n=i.fix(e);return this.log.debug("fixed"),{constraints:i.constraints,state:n}}))}declassify(e){return this.objectKey&&"plain"!==this.objectKey.format?(0,y.F)(this.mapToClassifiedFormat(),(0,p.v)(e),(0,k.H)(e=>$(this,[e],void 0,function*([e,t]){if(null==e)return this.log.debug("no value; bypassing declassification"),null;this.log.debug("declassifying");const{secret:i,disclosed:n}=e,r=C.k.fromJSON(i),s=yield t.decrypt(r),o=this.objectKey.classifier.declassify(n,s),a=this.objectKey.options.deserializer(o);return this.log.debug("declassified"),a}))):(this.log.debug("key uses plain format; bypassing declassification"),e=>e)}mapToClassifiedFormat(){return this.objectKey&&"classified"===this.objectKey.format?(0,u.T)(e=>F(e)?e:(this.log.warn("classified data must be in classified format; dropping"),null)):this.objectKey&&"secret-state"===this.objectKey.format?(0,u.T)(e=>{if(!Array.isArray(e))return this.log.warn("secret-state requires array formatting; dropping"),null;const[t]=e;return F(t)?t:(this.log.warn("unwrapped secret-state must be in classified format; dropping"),null)}):void this.log.panic({format:this.objectKey.format},"unsupported serialization format")}classify(e){return this.objectKey&&"plain"!==this.objectKey.format?(0,y.F)((0,T.bt)(e),(0,k.H)(e=>$(this,[e],void 0,function*([e,t]){if(null==e)return this.log.debug("no value; bypassing classification"),null;this.log.debug("classifying");const i=JSON.parse(JSON.stringify(e)),n=this.objectKey.classifier.classify(i),r=yield t.encrypt(n.secret),s={id:null,secret:JSON.parse(JSON.stringify(r)),disclosed:n.disclosed};return this.log.debug("classified"),s})),this.mapToStorageFormat()):(this.log.debug("key uses plain format; bypassing classification"),(0,y.F)((0,T.Gc)(e),(0,u.T)(e=>e)))}mapToStorageFormat(){return this.objectKey&&"classified"===this.objectKey.format?(0,u.T)(e=>e):this.objectKey&&"secret-state"===this.objectKey.format?(0,u.T)(e=>[e]):void this.log.panic({format:this.objectKey.format},"unsupported serialization format")}next(e){var t;null===(t=this.input)||void 0===t||t.next(e)}error(e){var t;null===(t=this.input)||void 0===t||t.error(e)}complete(){var e;null===(e=this.input)||void 0===e||e.complete()}subscribe(e){return this.output.pipe((0,u.T)(e=>e.state),(0,o.F)()).subscribe(e)}get withConstraints$(){return this.output.asObservable()}onNext(e,t){t.update(()=>{if(this.log.debug("updating"),"object"==typeof e){const t=this.counter++;t>Number.MAX_SAFE_INTEGER&&(this.counter=0);Object.assign({},e)[E]=t}return this.log.debug("updated"),e}).catch(e=>{this.log.error(e,"updating failed"),this.onError(e)})}onError(e){this.isDisposed||(this.log.debug(e,"forwarding error to subscribers"),this.output.error(e)),this.dispose()}onComplete(){this.isDisposed||this.output.complete(),this.dispose()}get isDisposed(){return null===this.input}dispose(){var e,t;this.isDisposed||(this.log.debug("disposing"),null===(e=this.inputSubscription)||void 0===e||e.unsubscribe(),null===(t=this.outputSubscription)||void 0===t||t.unsubscribe(),this.inputSubscription=null,this.outputSubscription=null,this.input=null,this.log.debug("disposed"))}}},89294:(e,t,i)=>{"use strict";i.d(t,{g:()=>m});var n=i(33812),r=i(71804),s=i(16888),o=i(37380),a=i(56962),l=i(50700),c=i(37115),d=i(62166),u=i(69855),h=i(21274),p=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class m{constructor(e,t,i,s,o,a,l){this.twoFactorService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=s,this.userVerificationService=o,this.dialogService=a,this.toastService=l,this.onUpdated=new n.bkB,this.organizationId=null,this.twoFactorProviderType=r.R,this.enabled=!1,this.authed=!1,this.componentName=""}auth(e){this.secret=e.secret,this.verificationType=e.verificationType,this.authed=!0}disableMethod(){return p(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"disable"},content:{key:"twoStepDisableDesc"},type:"warning"})))return;const e=yield this.buildRequestModel(s.G);if(void 0===this.type)throw new Error("Two-factor provider type is required");e.type=this.type,null!=this.organizationId?yield this.twoFactorService.putTwoFactorOrganizationDisable(this.organizationId,e):yield this.twoFactorService.putTwoFactorDisable(e),this.enabled=!1,this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepDisabled")}),this.onUpdated.emit(!1)})}buildRequestModel(e){return p(this,void 0,void 0,function*(){if(void 0===this.secret||void 0===this.verificationType)throw new Error("User verification data is missing");return this.userVerificationService.buildRequest({secret:this.secret,type:this.verificationType},e,!0)})}}m.ɵfac=function(e){return new(e||m)(n.rXU(o.fz),n.rXU(l.W),n.rXU(c.y),n.rXU(a.K),n.rXU(d.i),n.rXU(h.o3),n.rXU(u.f))},m.ɵdir=n.FsC({type:m,outputs:{onUpdated:"onUpdated"}})},89479:(e,t,i)=>{"use strict";i.d(t,{x:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},89591:(e,t,i)=>{"use strict";i.d(t,{q:()=>V});var n=i(88565),r=i(72245),s=i(78781),o=i(31442),a=i(51757),l=i(58625),c=i(3633),d=i(37579),u=i(29029),h=i(81573),p=i(26411),m=i(22191),v=i(22848),f=i(33812),g=i(37115),y=i(50700),b=i(21274),w=i(69855),S=i(35500),I=i(49519),k=i(26657),C=i(45154),T=i(56898),F=i(7730),R=i(68016),P=i(86226),x=i(97553),$=i(43759),E=i(76356),A=i(69896),D=i(36288),O=i(88016),M=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class U{constructor(e,t,i,n,s,o,l){this.keyService=e,this.platformUtilsService=t,this.i18nService=i,this.formBuilder=n,this.dialogRef=s,this.toastService=o,this.accountService=l,this.formGroup=this.formBuilder.group({masterPassword:["",{validators:[a.k0.required],updateOn:"submit"}]}),this.submit=()=>M(this,void 0,void 0,function*(){if(!this.formGroup.value.masterPassword)return;const e=yield(0,r._)((0,c.F6)(this.accountService.activeAccount$));if(null==e)throw new Error("An active user is expected while doing password reprompt.");const t=yield this.keyService.getOrDeriveMasterKey(this.formGroup.value.masterPassword,e);(yield this.keyService.compareKeyHash(this.formGroup.value.masterPassword,t,e))?this.dialogRef.close(!0):this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("invalidMasterPassword")})})}}U.ɵfac=function(e){return new(e||U)(f.rXU(v.Lu),f.rXU(g.y),f.rXU(y.W),f.rXU(a.ok),f.rXU(b.ce),f.rXU(w.f),f.rXU(S.Di))},U.ɵcmp=f.VBU({type:U,selectors:[["vault-password-reprompt"]],decls:22,vars:17,consts:[[3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["disableMargin","",1,"tw-mt-6"],["bitInput","","appAutofocus","","id","masterPassword","type","password","formControlName","masterPassword"],["type","button","bitSuffix","","bitIconButton","","bitPasswordInputToggle",""],["bitDialogFooter",""],["bitButton","","buttonType","primary","bitFormButton","","type","submit"],["bitButton","","buttonType","secondary","bitDialogClose","","type","button"]],template:function(e,t){1&e&&(f.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),f.EFF(3),f.nI1(4,"i18n"),f.k0s(),f.qex(5,2),f.EFF(6),f.nI1(7,"i18n"),f.j41(8,"bit-form-field",3)(9,"bit-label"),f.EFF(10),f.nI1(11,"i18n"),f.k0s(),f.nrm(12,"input",4)(13,"button",5),f.k0s(),f.bVm(),f.qex(14,6),f.j41(15,"button",7)(16,"span"),f.EFF(17),f.nI1(18,"i18n"),f.k0s()(),f.j41(19,"button",8),f.EFF(20),f.nI1(21,"i18n"),f.k0s(),f.bVm(),f.k0s()()),2&e&&(f.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),f.R7$(3),f.SpI(" ",f.bMT(4,7,"passwordConfirmation")," "),f.R7$(3),f.SpI(" ",f.bMT(7,9,"passwordConfirmationDesc")," "),f.R7$(4),f.JRh(f.bMT(11,11,"masterPass")),f.R7$(7),f.JRh(f.bMT(18,13,"ok")),f.R7$(3),f.SpI(" ",f.bMT(21,15,"cancel")," "))},dependencies:[l.p,I.B,d.C,k.$,C.L,u.t,T.Q,h.P,F.I,R.m,p.L,P.j,x.J,$.h,E.e,A.a,m.Q,D.s,a.X1,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,O.$],encapsulation:2});var G=i(74208),j=i(62166),N=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class V{constructor(e,t){this.dialogService=e,this.userVerificationService=t,this.enabled$=s.A.asyncToObservable(()=>this.userVerificationService.hasMasterPasswordAndMasterKeyHash())}protectedFields(){return["TOTP","Password","H_Field","Card Number","Security Code"]}passwordRepromptCheck(e){return N(this,void 0,void 0,function*(){return e.reprompt===o.b1.None||(yield this.showPasswordPrompt())})}showPasswordPrompt(){return N(this,void 0,void 0,function*(){if(!(yield this.enabled()))return!0;const e=this.dialogService.open(U,{ariaModal:!0});return!0===(yield(0,n.s)(e.closed))})}enabled(){return(0,r._)(this.enabled$)}}V.ɵfac=function(e){return new(e||V)(G.KVO(b.o3),G.KVO(j.i))},V.ɵprov=G.jDH({token:V,factory:V.ɵfac})},90005:(e,t,i)=>{"use strict";i.d(t,{f:()=>n});const n=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4.72 12.85 92 80">
    <path class="tw-fill-illustration-bg-primary" d="M16.722 18.846a6 6 0 0 1 6-6h68a6 6 0 0 1 6 6v48a6 6 0 0 1-6 6h-68a6 6 0 0 1-6-6v-48Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M90.722 14.846h-68a4 4 0 0 0-4 4v48a4 4 0 0 0 4 4h68a4 4 0 0 0 4-4v-48a4 4 0 0 0-4-4Zm-68-2a6 6 0 0 0-6 6v48a6 6 0 0 0 6 6h68a6 6 0 0 0 6-6v-48a6 6 0 0 0-6-6h-68Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M54.732 34.216c1.353-2.327 4.713-2.327 6.066 0L72.24 53.898c1.36 2.34-.327 5.272-3.033 5.272H46.321c-2.705 0-4.392-2.933-3.032-5.272l11.443-19.682Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70.512 54.904 59.07 35.22c-.582-1-2.026-1-2.608 0L45.018 54.904a1.508 1.508 0 0 0 1.303 2.266h22.887a1.508 1.508 0 0 0 1.304-2.266Zm-9.714-20.688c-1.353-2.327-4.713-2.327-6.066 0L43.288 53.898c-1.36 2.34.328 5.272 3.033 5.272h22.887c2.706 0 4.393-2.933 3.033-5.272L60.798 34.216Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M59.168 53.557a1.403 1.403 0 1 1-2.806 0 1.403 1.403 0 0 1 2.806 0ZM55.702 41.315a.35.35 0 0 1 .348-.388h3.43a.35.35 0 0 1 .348.388l-.977 9.121a.35.35 0 0 1-.349.314h-1.474a.35.35 0 0 1-.35-.314l-.976-9.121Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M95.722 24.846h-78v-2h78v2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M92.722 18.846a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM86.722 18.846a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM80.722 18.846a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM9.722 31.846a2 2 0 0 1 2-2h15a2 2 0 0 1 2 2v15h-19v-15Z"/>
    <path class="tw-fill-illustration-tertiary" d="M12.722 32.846h3v11h-3v-11ZM17.722 34.846h3v9h-3v-9ZM22.722 32.846h3v11h-3v-11Z"/>
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M8.722 44.846a4 4 0 0 0-4 4v40a4 4 0 0 0 4 4h21a4 4 0 0 0 4-4v-40a4 4 0 0 0-4-4h-21Zm10.5 36a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M8.722 46.846a2 2 0 0 0-2 2v40a2 2 0 0 0 2 2h21a2 2 0 0 0 2-2v-40a2 2 0 0 0-2-2h-21Zm10.5 32a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm-14.5-30a4 4 0 0 1 4-4h21a4 4 0 0 1 4 4v40a4 4 0 0 1-4 4h-21a4 4 0 0 1-4-4v-40Zm17 34.5a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M19.222 72.846a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Zm0 2a9.5 9.5 0 1 0 0-19 9.5 9.5 0 0 0 0 19Z" clip-rule="evenodd"/>
  </svg>
`},90097:(e,t,i)=>{"use strict";i.d(t,{H:()=>o});var n=i(91326),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.K]})},90107:(e,t,i)=>{"use strict";i.d(t,{V$:()=>s,$b:()=>r,Kc:()=>n});class n{}var r;!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(r||(r={}));class s{constructor(e,t=null){this.isDev=e,this.filter=t,this.timersMap=new Map}debug(e,...t){this.isDev&&this.write(r.Debug,e,...t)}info(e,...t){this.write(r.Info,e,...t)}warning(e,...t){this.write(r.Warning,e,...t)}error(e,...t){this.write(r.Error,e,...t)}write(e,t,...i){if(null==this.filter||!this.filter(e))switch(e){case r.Debug:case r.Info:console.log(t,...i);break;case r.Warning:console.warn(t,...i);break;case r.Error:console.error(t,...i)}}measure(e,t,i,n,r){const s=`[${i}]: ${n}`,o=performance.measure(s,{start:e,detail:{devtools:{dataType:"track-entry",track:i,trackGroup:t,properties:r}}});return this.info(`${s} took ${o.duration}`,r),o}mark(e){const t=performance.mark(e,{detail:{devtools:{dataType:"marker"}}});return this.info(t.name,(new Date).toISOString()),t}}},90171:(e,t,i)=>{"use strict";i.d(t,{b:()=>r});var n=i(33812);class r{transform(e){return null==e||null==e.name&&null==e.email?null:null==e.name||""===e.name.trim()?e.email:e.name}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"userName",type:r,pure:!0,standalone:!1})},90246:(e,t,i)=>{"use strict";i.d(t,{f:()=>v});var n=i(77468),r=i(94573),s=i(36801),o=i(58806),a=i(15033),l=i(33812),c=i(50700);const d=["*",[["bit-label"]],[["bit-hint"]]],u=e=>[e];function h(e,t){1&e&&(l.j41(0,"span",3),l.EFF(1),l.nI1(2,"i18n"),l.k0s()),2&e&&(l.R7$(),l.SpI(" (",l.bMT(2,1,"required"),")"))}function p(e,t){1&e&&(l.j41(0,"span",4),l.SdG(1,2),l.k0s())}function m(e,t){if(1&e&&(l.j41(0,"div",5),l.nrm(1,"i",6),l.EFF(2),l.k0s()),2&e){const e=l.XpG();l.R7$(2),l.SpI(" ",e.displayError," ")}}class v{get classes(){return[].concat(this.inline()?["tw-inline-block","tw-me-4"]:["tw-block"]).concat(this.disableMargin()?[]:["tw-mb-4"])}constructor(e){this.i18nService=e,this.label=(0,r.hFB)(),this.inline=(0,r.hFB)(!1,{transform:r.L39}),this.disableMargin=(0,r.hFB)(!1,{transform:r.L39}),this.formControl=r.sbv.required(a.J)}get required(){return this.formControl().required}get hasError(){return this.formControl().hasError}get error(){return this.formControl().error}get displayError(){var e,t;return"required"===this.error[0]?this.i18nService.t("inputRequired"):(null===(e=this.error[1])||void 0===e?void 0:e.message)?null===(t=this.error[1])||void 0===t?void 0:t.message:this.error}}v.ɵfac=function(e){return new(e||v)(l.rXU(c.W))},v.ɵcmp=l.VBU({type:v,selectors:[["bit-form-control"]],contentQueries:function(e,t,i){1&e&&l.C6U(i,t.formControl,a.J,5),2&e&&l.NyB()},hostVars:2,hostBindings:function(e,t){2&e&&l.HbH(t.classes)},inputs:{label:[1,"label"],inline:[1,"inline"],disableMargin:[1,"disableMargin"]},ngContentSelectors:["*","bit-label","bit-hint"],decls:8,vars:7,consts:[[1,"tw-transition","tw-items-start","[&:has(input[type='checkbox'])]:tw-gap-1","[&:has(input[type='radio'])]:tw-gap-1.5","tw-select-none","tw-mb-0","tw-inline-flex","tw-rounded","has-[:focus-visible]:tw-ring","has-[:focus-visible]:tw-ring-primary-600",3,"ngClass"],[1,"tw-inline-flex","tw-flex-col",3,"ngClass"],["bitTypography","body2"],[1,"tw-text-xs","tw-font-normal"],[1,"[&_bit-hint]:tw-mt-0","tw-leading-none"],[1,"tw-mt-1","tw-text-danger","tw-text-xs","tw-ms-0.5"],[1,"bwi","bwi-error"]],template:function(e,t){1&e&&(l.NAR(d),l.j41(0,"label",0),l.SdG(1),l.j41(2,"span",1)(3,"span",2),l.SdG(4,1),l.nVh(5,h,3,3,"span",3),l.k0s(),l.nVh(6,p,2,0,"span",4),l.k0s()(),l.nVh(7,m,3,1,"div",5)),2&e&&(l.Y8G("ngClass",l.eq3(5,u,t.formControl().disabled?"tw-cursor-auto":"tw-cursor-pointer")),l.R7$(2),l.Y8G("ngClass",t.formControl().disabled?"tw-text-muted":"tw-text-main"),l.R7$(3),l.vxM(t.required?5:-1),l.R7$(),l.vxM(t.hasError?-1:6),l.R7$(),l.vxM(t.hasError?7:-1))},dependencies:[n.YU,o.r,s.$Z],encapsulation:2})},90250:(e,t,i)=>{"use strict";i.d(t,{q:()=>a});var n=i(78781),r=i(68467),s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const o=16;class a{constructor(e){this.buffer=e,this.encryptionType=null,this.dataBytes=null,this.ivBytes=null,this.macBytes=null;const t=e,i=t[0];switch(i){case r.Qd.AesCbc256_HmacSha256_B64:{const e=50;t.length<e&&this.throwDecryptionError(),this.ivBytes=t.slice(1,17),this.macBytes=t.slice(17,49),this.dataBytes=t.slice(49);break}case r.Qd.AesCbc256_B64:{const e=18;t.length<e&&this.throwDecryptionError(),this.ivBytes=t.slice(1,17),this.dataBytes=t.slice(17);break}default:this.throwDecryptionError()}this.encryptionType=i}throwDecryptionError(){throw new Error("Error parsing encrypted ArrayBuffer: data is corrupted or has an invalid format.")}static fromParts(e,t,i,n){if(null==e||null==t||null==i)throw new Error("encryptionType, iv, and data must be provided");switch(e){case r.Qd.AesCbc256_B64:case r.Qd.AesCbc256_HmacSha256_B64:a.validateIvLength(t),a.validateMacLength(e,n);break;default:throw new Error(`Unknown EncryptionType ${e} for EncArrayBuffer.fromParts`)}let s=0;null!=n&&(s=n.length);const o=new Uint8Array(1+t.byteLength+s+i.byteLength);return o.set([e],0),o.set(t,1),null!=n&&o.set(n,1+t.byteLength),o.set(i,1+t.byteLength+s),new a(o)}static fromResponse(e){return s(this,void 0,void 0,function*(){const t=yield e.arrayBuffer();if(null==t)throw new Error("Cannot create EncArrayBuffer from Response - Response is empty");return new a(new Uint8Array(t))})}static fromB64(e){const t=n.A.fromB64ToArray(e);return new a(t)}static validateIvLength(e){if(null==e||e.length!==o)throw new Error("Invalid IV length")}static validateMacLength(e,t){switch(e){case r.Qd.AesCbc256_B64:if(null!=t)throw new Error("mac must not be provided for AesCbc256_B64");break;case r.Qd.AesCbc256_HmacSha256_B64:if(null==t||32!==t.length)throw new Error("Invalid MAC length");break;default:throw new Error("Invalid encryption type and mac combination")}}}},90268:(e,t,i)=>{"use strict";i.d(t,{n:()=>n});class n{constructor(e,t){this.document=e,this.i18nService=t}start(){return this.i18nService.locale$.subscribe(e=>{this.document.documentElement.lang=e})}}},90300:(e,t,i)=>{"use strict";i.d(t,{g:()=>h});var n=i(77468),r=i(94573),s=i(74208),o=i(75583),a=i(33812),l=i(58806);const c=["endSlot"],d=[[["","slot","start"]],"*",[["","slot","default-trailing"]],[["","slot","secondary"]],[["","slot","end"]]],u=(e,t)=>({"tw-truncate":e,"tw-text-wrap tw-overflow-auto tw-break-words":t});class h{constructor(){this.endSlot=(0,r.ebz)("endSlot"),this.endSlotHasChildren=(0,s.vPA)(!1),this.truncate=(0,r.hFB)(!0)}ngAfterContentChecked(){var e,t;this.endSlotHasChildren.set((null!==(t=null===(e=this.endSlot())||void 0===e?void 0:e.nativeElement.childElementCount)&&void 0!==t?t:0)>0)}}h.ɵfac=function(e){return new(e||h)},h.ɵcmp=a.VBU({type:h,selectors:[["bit-item-content"],["","bit-item-content",""]],viewQuery:function(e,t){1&e&&a.wEZ(t.endSlot,c,5),2&e&&a.NyB()},hostAttrs:["data-fvw-target","",1,"tw-outline-none","tw-text-main","hover:tw-text-main","tw-no-underline","hover:tw-no-underline","tw-text-base","tw-py-2","tw-px-4","bit-compact:tw-py-1.5","bit-compact:tw-px-2","tw-bg-transparent","tw-w-full","tw-border-none","tw-flex","tw-gap-4","tw-items-center","tw-justify-between","disabled:tw-cursor-not-allowed","[&[disabled]_[bittypography]]:!tw-text-secondary-300","[&[disabled]_i]:!tw-text-secondary-300"],inputs:{truncate:[1,"truncate"]},ngContentSelectors:["[slot=start]","*","[slot=default-trailing]","[slot=secondary]","[slot=end]"],decls:13,vars:9,consts:[["endSlot",""],[1,"tw-flex","tw-gap-2","tw-items-center","tw-w-full","tw-min-w-0"],[1,"tw-flex","tw-flex-col","tw-items-start","tw-text-start","tw-w-full","tw-truncate","[&_p]:tw-mb-0"],["bitTypography","body2",1,"tw-text-main","tw-truncate","tw-inline-flex","tw-items-center","tw-gap-1.5","tw-w-full"],[3,"ngClass"],[1,"tw-flex-grow"],["bitTypography","helper",1,"tw-text-muted","tw-w-full",3,"ngClass"],[1,"tw-flex","tw-gap-2","tw-items-center",3,"hidden"]],template:function(e,t){1&e&&(a.NAR(d),a.j41(0,"div",1),a.SdG(1),a.j41(2,"div",2)(3,"div",3)(4,"div",4),a.SdG(5,1),a.k0s(),a.j41(6,"div",5),a.SdG(7,2),a.k0s()(),a.j41(8,"div",6),a.SdG(9,3),a.k0s()()(),a.j41(10,"div",7,0),a.SdG(12,4),a.k0s()),2&e&&(a.R7$(4),a.Y8G("ngClass",a.l_i(3,u,t.truncate(),!t.truncate())),a.R7$(4),a.Y8G("ngClass",a.l_i(6,u,t.truncate(),!t.truncate())),a.R7$(2),a.Y8G("hidden",!t.endSlotHasChildren()))},dependencies:[o.E,l.r,n.YU],encapsulation:2,changeDetection:0})},90586:(e,t,i)=>{"use strict";function n(e,t){return null==e&&null==t||(!e||null!=t)&&((null!=e||!t)&&("object"!=typeof e||"object"!=typeof t?e===t:JSON.stringify(e)===JSON.stringify(t)))}i.d(t,{c:()=>n})},90647:(e,t,i)=>{"use strict";i.d(t,{M:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},91059:(e,t,i)=>{"use strict";i.d(t,{Y:()=>n});class n{}},91240:(e,t,i)=>{"use strict";i.d(t,{u:()=>n});class n{}},91261:(e,t,i)=>{"use strict";i.d(t,{z:()=>b});var n=i(33812),r=i(51757),s=i(66046),o=i(72737),a=i(3204),l=i(62179),c=i(14803),d=i(8131),u=i(58625),h=i(26411),p=i(29776),m=i(36801),v=i(86226),f=i(97553),g=i(43759),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class b{constructor(e,t){this.formBuilder=e,this.generatorService=t,this.account=null,this.account$=new o.m(1),this.onUpdated=new n.bkB,this.settings=this.formBuilder.group({subaddressEmail:[""]}),this.saveSettings=new s.B,this.destroyed$=new s.B}ngOnChanges(e){return y(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}ngOnInit(){return y(this,void 0,void 0,function*(){const e=yield this.generatorService.settings(p.qG.plusAddress,{account$:this.account$});e.pipe((0,c.Q)(this.destroyed$)).subscribe(e=>{this.settings.patchValue(e,{emitEvent:!1})}),e.pipe((0,l.i)(1),(0,c.Q)(this.destroyed$)).subscribe(this.onUpdated),this.saveSettings.pipe((0,d.E)(this.settings.valueChanges),(0,a.T)(([,e])=>e),(0,c.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}b.ɵfac=function(e){return new(e||b)(n.rXU(r.ok),n.rXU(p.iE))},b.ɵcmp=n.VBU({type:b,selectors:[["tools-subaddress-settings"]],inputs:{account:"account"},outputs:{onUpdated:"onUpdated"},features:[n.OA$],decls:6,vars:4,consts:[[1,"tw-container",3,"formGroup"],["bitInput","","formControlName","subaddressEmail","type","text",3,"change"]],template:function(e,t){1&e&&(n.j41(0,"form",0)(1,"bit-form-field")(2,"bit-label"),n.EFF(3),n.nI1(4,"i18n"),n.k0s(),n.j41(5,"input",1),n.bIt("change",function(){return t.save("subaddressEmail")}),n.k0s()()()),2&e&&(n.Y8G("formGroup",t.settings),n.R7$(3),n.JRh(n.bMT(4,2,"email")))},dependencies:[r.X1,r.qT,r.me,r.BC,r.cb,r.j4,r.JD,h.L,v.j,f.J,g.h,u.p,m.$Z],encapsulation:2})},91304:(e,t,i)=>{"use strict";i.d(t,{N:()=>r});var n=i(31442);class r{constructor(e){this.type=n.PU.Text,null!=e&&(this.type=e.type,this.name=e.name,this.value=e.value,this.linkedId=e.linkedId)}}},91326:(e,t,i)=>{"use strict";i.d(t,{K:()=>p});var n=i(94573),r=i(33277),s=i(36801),o=i(22191),a=i(74208),l=i(33812),c=i(36288);function d(e,t){1&e&&l.nrm(0,"i",4),2&e&&l.HbH(t)}function u(e,t){if(1&e){const e=l.RV6();l.j41(0,"button",5),l.nI1(1,"i18n"),l.bIt("click",function(){a.eBV(e);const t=l.XpG();return a.Njj(t.onClose.emit())}),l.k0s()}2&e&&l.Y8G("label",l.bMT(1,1,"close"))}const h={premium:"bwi-star",info:"bwi-info-circle",warning:"bwi-exclamation-triangle",danger:"bwi-error"};class p{constructor(){this.bannerType=(0,n.hFB)("info"),this.icon=(0,n.hFB)(),this.useAlertRole=(0,n.hFB)(!0),this.showClose=(0,n.hFB)(!0),this.onClose=(0,n.CGW)(),this.displayIcon=(0,r.EW)(()=>{var e;return null===this.icon()?null:null!==(e=this.icon())&&void 0!==e?e:h[this.bannerType()]}),this.bannerClass=(0,r.EW)(()=>{switch(this.bannerType()){case"danger":return"tw-bg-danger-100 tw-border-b-danger-700";case"info":return"tw-bg-info-100 tw-border-b-info-700";case"premium":return"tw-bg-success-100 tw-border-b-success-700";case"warning":return"tw-bg-warning-100 tw-border-b-warning-700"}})}}p.ɵfac=function(e){return new(e||p)},p.ɵcmp=l.VBU({type:p,selectors:[["bit-banner"]],hostAttrs:[1,"tw-flex","tw-flex-col","[bit-layout_&]:-tw-mx-8","[bit-layout_&]:-tw-my-6","[bit-layout_&]:tw-pb-6"],inputs:{bannerType:[1,"bannerType"],icon:[1,"icon"],useAlertRole:[1,"useAlertRole"],showClose:[1,"showClose"]},outputs:{onClose:"onClose"},ngContentSelectors:["*"],decls:5,vars:6,consts:[[1,"tw-flex","tw-items-center","tw-gap-4","tw-p-2","tw-ps-4","tw-text-main","tw-border-transparent","tw-bg-clip-padding","tw-border-solid","tw-border-b","tw-border-0"],["aria-hidden","true",1,"bwi","tw-align-middle","tw-text-base",3,"class"],[1,"tw-grow","tw-text-base","[&>button[bitlink]:focus-visible:before]:!tw-ring-text-main"],["type","button","bitIconButton","bwi-close","buttonType","main","size","small",3,"label"],["aria-hidden","true",1,"bwi","tw-align-middle","tw-text-base"],["type","button","bitIconButton","bwi-close","buttonType","main","size","small",3,"click","label"]],template:function(e,t){if(1&e&&(l.NAR(),l.j41(0,"div",0),l.nVh(1,d,1,2,"i",1),l.j41(2,"span",2),l.SdG(3),l.k0s(),l.nVh(4,u,2,3,"button",3),l.k0s()),2&e){let e;l.HbH(t.bannerClass()),l.BMQ("role",t.useAlertRole()?"status":null)("aria-live",t.useAlertRole()?"polite":null),l.R7$(),l.vxM((e=t.displayIcon())?1:-1,e),l.R7$(3),l.vxM(t.showClose()?4:-1)}},dependencies:[o.Q,c.s,s.$Z],encapsulation:2,changeDetection:0})},91517:(e,t,i)=>{"use strict";i.d(t,{m:()=>U,F:()=>M});var n=i(51757),r=i(66046),s=i(12610),o=i(14803);const a=i(13299).Sm`
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 580 104" fill="none">
    <path class="tw-fill-text-alt2" d="M102.539 52.27c0 28.315-22.954 51.269-51.27 51.269C22.955 103.539 0 80.585 0 52.269 0 23.955 22.954 1 51.27 1c28.315 0 51.269 22.954 51.269 51.27Z"/>
    <path class="tw-fill-bw-blue" fill-rule="evenodd" d="M75.971 26.765c-.516-.49-1.111-.777-1.786-.777H28.39c-.675 0-1.31.287-1.786.777-.516.49-.754 1.145-.754 1.84v31.47c0 2.371.437 4.66 1.31 6.95.873 2.288 1.984 4.332 3.294 6.13s2.897 3.515 4.682 5.232a62.036 62.036 0 0 0 5 4.25 82.731 82.731 0 0 0 4.802 3.188c1.667.981 2.857 1.676 3.572 2.003.714.368 1.27.613 1.706.817a2.26 2.26 0 0 0 1.032.246 2.26 2.26 0 0 0 1.032-.246c.436-.204.992-.45 1.706-.817.715-.368 1.905-1.022 3.572-2.003a54.848 54.848 0 0 0 4.801-3.188c1.548-1.103 3.215-2.534 5.04-4.25 1.826-1.717 3.373-3.434 4.683-5.232 1.31-1.798 2.42-3.842 3.294-6.13.912-2.29 1.31-4.62 1.31-6.95v-31.47c.04-.695-.239-1.309-.715-1.84Zm-5.913 33.597c0 11.403-18.77 21.172-18.77 21.172V32.732h18.77v27.63Z" clip-rule="evenodd"/>
    <path class="tw-fill-text-alt2" d="M142.208 70.81c-2.804 0-5.243-.511-7.319-1.533-2.075-1.023-3.678-2.447-4.806-4.272-1.129-1.826-1.694-3.943-1.694-6.353h4.807c0 1.497.346 2.884 1.038 4.162.692 1.241 1.693 2.246 3.004 3.012 1.347.73 3.004 1.096 4.97 1.096 2.585 0 4.588-.621 6.008-1.862 1.42-1.242 2.13-2.794 2.13-4.656 0-1.533-.327-2.756-.983-3.669-.655-.95-1.547-1.716-2.676-2.3-1.092-.585-2.367-1.096-3.823-1.534a126.43 126.43 0 0 1-4.479-1.479c-2.95-1.022-5.134-2.281-6.555-3.778-1.42-1.534-2.13-3.524-2.13-5.97-.036-2.045.437-3.852 1.42-5.422.984-1.607 2.367-2.848 4.151-3.724 1.821-.913 3.969-1.37 6.446-1.37 2.439 0 4.551.457 6.335 1.37 1.821.913 3.223 2.172 4.206 3.779 1.02 1.606 1.548 3.432 1.584 5.476h-4.806c0-1.058-.274-2.099-.82-3.121-.546-1.06-1.383-1.917-2.512-2.574-1.093-.658-2.476-.986-4.151-.986-2.076-.037-3.787.493-5.135 1.588-1.31 1.095-1.966 2.61-1.966 4.546 0 1.643.455 2.903 1.366 3.779.946.876 2.257 1.606 3.932 2.19 1.675.548 3.605 1.187 5.79 1.917 1.821.657 3.459 1.424 4.916 2.3 1.456.877 2.585 2.009 3.386 3.396.838 1.388 1.256 3.158 1.256 5.313 0 1.825-.473 3.56-1.42 5.203-.946 1.606-2.385 2.92-4.315 3.943-1.893 1.022-4.278 1.533-7.155 1.533ZM172.42 70.81c-2.586 0-4.88-.584-6.882-1.752-2.003-1.205-3.587-2.867-4.752-4.984-1.129-2.118-1.694-4.619-1.694-7.503 0-2.848.565-5.331 1.694-7.449 1.128-2.154 2.694-3.815 4.697-4.983 2.039-1.205 4.388-1.808 7.046-1.808 2.622 0 4.879.603 6.773 1.807 1.93 1.169 3.404 2.72 4.424 4.656a13.201 13.201 0 0 1 1.529 6.243c0 .402-.018.803-.054 1.205v1.37h-21.575c.109 2.08.582 3.815 1.42 5.202.874 1.351 1.948 2.373 3.222 3.067a8.754 8.754 0 0 0 4.152 1.04c1.893 0 3.477-.437 4.751-1.314 1.275-.876 2.203-2.063 2.786-3.56h4.533c-.728 2.52-2.13 4.62-4.205 6.299-2.039 1.643-4.661 2.464-7.865 2.464Zm0-24.59c-2.185 0-4.133.675-5.845 2.026-1.675 1.314-2.64 3.25-2.895 5.805h17.042c-.11-2.446-.947-4.363-2.513-5.75-1.566-1.388-3.495-2.081-5.789-2.081ZM202.697 70.81c-2.585 0-4.916-.584-6.991-1.752-2.039-1.205-3.66-2.867-4.861-4.984-1.166-2.154-1.748-4.655-1.748-7.503s.582-5.331 1.748-7.449c1.201-2.154 2.822-3.815 4.861-4.983 2.075-1.205 4.406-1.808 6.991-1.808 3.204 0 5.899.84 8.084 2.52 2.221 1.679 3.623 3.924 4.206 6.736h-4.698c-.364-1.68-1.256-2.976-2.676-3.889-1.42-.949-3.077-1.424-4.97-1.424-1.53 0-2.968.384-4.315 1.15-1.348.767-2.44 1.917-3.278 3.45-.837 1.534-1.256 3.433-1.256 5.697 0 2.263.419 4.162 1.256 5.696.838 1.533 1.93 2.701 3.278 3.505a8.584 8.584 0 0 0 4.315 1.15c1.893 0 3.55-.457 4.97-1.37 1.42-.949 2.312-2.282 2.676-3.998h4.698c-.547 2.739-1.93 4.966-4.152 6.682-2.221 1.716-4.934 2.574-8.138 2.574ZM220.302 70.153V42.988h4.151l.382 5.203c.838-1.789 2.112-3.213 3.823-4.272 1.712-1.058 3.824-1.588 6.336-1.588v4.82h-1.256c-1.602 0-3.077.292-4.424.876-1.347.548-2.422 1.497-3.223 2.848-.801 1.35-1.201 3.213-1.201 5.586v13.692h-4.588ZM250.218 70.81c-2.585 0-4.879-.584-6.882-1.752-2.003-1.205-3.587-2.867-4.752-4.984-1.129-2.118-1.693-4.619-1.693-7.503 0-2.848.564-5.331 1.693-7.449 1.129-2.154 2.695-3.815 4.698-4.983 2.039-1.205 4.387-1.808 7.045-1.808 2.622 0 4.88.603 6.773 1.807 1.93 1.169 3.405 2.72 4.424 4.656 1.02 1.935 1.53 4.016 1.53 6.243 0 .402-.018.803-.055 1.205v1.37h-21.575c.11 2.08.583 3.815 1.421 5.202.874 1.351 1.948 2.373 3.222 3.067a8.753 8.753 0 0 0 4.151 1.04c1.894 0 3.478-.437 4.752-1.314 1.275-.876 2.203-2.063 2.786-3.56h4.533c-.728 2.52-2.13 4.62-4.206 6.299-2.039 1.643-4.66 2.464-7.865 2.464Zm0-24.59c-2.185 0-4.133.675-5.844 2.026-1.675 1.314-2.64 3.25-2.895 5.805h17.041c-.109-2.446-.946-4.363-2.512-5.75-1.566-1.388-3.496-2.081-5.79-2.081ZM277.841 70.153c-2.476 0-4.424-.603-5.844-1.807-1.42-1.205-2.13-3.378-2.13-6.518V46.877h-4.698v-3.889h4.698l.601-6.517h3.987v6.517h7.974v3.889h-7.974v14.951c0 1.716.346 2.885 1.038 3.505.691.585 1.911.877 3.659.877h2.84v3.943h-4.151ZM297.544 70.81c-3.241 0-5.936-.821-8.084-2.464-2.149-1.643-3.405-3.87-3.769-6.682h4.697c.292 1.424 1.038 2.665 2.24 3.724 1.238 1.022 2.895 1.534 4.97 1.534 1.93 0 3.35-.402 4.26-1.205.911-.84 1.366-1.826 1.366-2.958 0-1.643-.601-2.738-1.803-3.286-1.165-.547-2.822-1.04-4.97-1.478a28.114 28.114 0 0 1-4.369-1.26c-1.457-.548-2.677-1.315-3.66-2.3-.983-1.023-1.475-2.355-1.475-3.998 0-2.373.874-4.309 2.622-5.806 1.784-1.533 4.188-2.3 7.21-2.3 2.876 0 5.225.73 7.046 2.19 1.857 1.425 2.931 3.47 3.222 6.135h-4.533c-.182-1.388-.783-2.465-1.803-3.231-.983-.804-2.312-1.205-3.987-1.205-1.638 0-2.913.346-3.823 1.04-.874.694-1.311 1.607-1.311 2.739 0 1.095.564 1.953 1.693 2.574 1.165.62 2.731 1.15 4.697 1.588 1.675.365 3.259.821 4.752 1.37 1.53.51 2.768 1.295 3.714 2.354.984 1.022 1.475 2.52 1.475 4.491.037 2.446-.892 4.473-2.785 6.08-1.857 1.57-4.388 2.354-7.592 2.354ZM327.019 70.153V31.816h5.353l13.764 26.726 13.655-26.726h5.407v38.337h-4.588V40.031l-12.781 24.645h-3.441l-12.781-24.59v30.067h-4.588ZM380.911 70.81c-2.258 0-4.133-.383-5.626-1.15-1.493-.767-2.604-1.789-3.332-3.067a8.266 8.266 0 0 1-1.092-4.162c0-2.775 1.056-4.911 3.168-6.408 2.112-1.497 4.988-2.245 8.63-2.245h7.319v-.33c0-2.372-.619-4.161-1.857-5.366-1.238-1.242-2.895-1.862-4.971-1.862-1.784 0-3.332.456-4.642 1.369-1.275.876-2.076 2.172-2.404 3.888h-4.697c.182-1.971.838-3.633 1.966-4.983 1.166-1.352 2.604-2.374 4.315-3.068 1.712-.73 3.532-1.095 5.462-1.095 3.787 0 6.627 1.022 8.521 3.067 1.93 2.008 2.895 4.692 2.895 8.05v16.705h-4.097l-.273-4.874c-.765 1.533-1.893 2.848-3.386 3.943-1.457 1.059-3.423 1.588-5.899 1.588Zm.71-3.888c1.748 0 3.241-.457 4.479-1.37a8.66 8.66 0 0 0 2.895-3.56c.655-1.46.983-2.993.983-4.6v-.055h-6.937c-2.695 0-4.606.475-5.735 1.424-1.092.913-1.639 2.063-1.639 3.45 0 1.425.51 2.575 1.53 3.451 1.056.84 2.53 1.26 4.424 1.26ZM400.356 70.153V42.988h4.151l.273 4.875a9.86 9.86 0 0 1 3.769-4.053c1.639-.986 3.496-1.479 5.571-1.479 3.205 0 5.754.986 7.647 2.958 1.93 1.935 2.895 4.929 2.895 8.981v15.883h-4.588v-15.39c0-5.659-2.331-8.489-6.991-8.489-2.331 0-4.279.858-5.845 2.575-1.529 1.679-2.294 4.089-2.294 7.229v14.075h-4.588ZM439.533 70.81c-2.258 0-4.133-.383-5.626-1.15-1.493-.767-2.603-1.789-3.332-3.067a8.266 8.266 0 0 1-1.092-4.162c0-2.775 1.056-4.911 3.168-6.408 2.112-1.497 4.988-2.245 8.63-2.245h7.319v-.33c0-2.372-.619-4.161-1.857-5.366-1.238-1.242-2.895-1.862-4.971-1.862-1.784 0-3.331.456-4.642 1.369-1.275.876-2.076 2.172-2.404 3.888h-4.697c.182-1.971.838-3.633 1.966-4.983 1.166-1.352 2.604-2.374 4.315-3.068 1.712-.73 3.532-1.095 5.462-1.095 3.787 0 6.627 1.022 8.521 3.067 1.93 2.008 2.895 4.692 2.895 8.05v16.705h-4.097l-.273-4.874c-.764 1.533-1.893 2.848-3.386 3.943-1.457 1.059-3.423 1.588-5.899 1.588Zm.71-3.888c1.748 0 3.241-.457 4.479-1.37a8.66 8.66 0 0 0 2.895-3.56c.655-1.46.983-2.993.983-4.6v-.055h-6.937c-2.694 0-4.606.475-5.735 1.424-1.092.913-1.639 2.063-1.639 3.45 0 1.425.51 2.575 1.53 3.451 1.056.84 2.531 1.26 4.424 1.26ZM469.684 61.61c-1.53 0-2.931-.202-4.206-.603l-2.731 2.574c.401.292.892.548 1.475.767.619.182 1.493.365 2.622.547 1.128.146 2.712.31 4.751.493 3.642.256 6.245 1.096 7.811 2.52 1.566 1.424 2.349 3.286 2.349 5.586 0 1.57-.437 3.067-1.311 4.49-.838 1.425-2.149 2.593-3.933 3.506-1.748.913-4.005 1.369-6.773 1.369-2.439 0-4.606-.329-6.499-.986-1.894-.62-3.369-1.588-4.425-2.903-1.055-1.277-1.583-2.902-1.583-4.874 0-1.022.273-2.136.819-3.34.546-1.169 1.566-2.282 3.059-3.341a13.725 13.725 0 0 1-2.076-1.041 13.173 13.173 0 0 1-1.529-1.314V63.8l4.642-4.6c-2.148-1.826-3.222-4.236-3.222-7.23 0-1.789.418-3.414 1.256-4.874.837-1.46 2.057-2.61 3.66-3.45 1.602-.877 3.55-1.315 5.844-1.315 1.566 0 2.986.22 4.26.657h9.995v3.45l-5.079.22c1.056 1.533 1.584 3.304 1.584 5.312 0 1.79-.437 3.414-1.311 4.874-.838 1.461-2.057 2.63-3.66 3.506-1.565.84-3.495 1.26-5.789 1.26Zm0-3.78c1.93 0 3.459-.493 4.588-1.478 1.165-1.023 1.748-2.483 1.748-4.382 0-1.862-.583-3.286-1.748-4.272-1.129-1.022-2.658-1.533-4.588-1.533-1.967 0-3.532.511-4.698 1.533-1.128.986-1.693 2.41-1.693 4.272 0 1.899.565 3.36 1.693 4.382 1.166.985 2.731 1.478 4.698 1.478Zm-7.975 15.828c0 1.826.765 3.177 2.294 4.053 1.53.913 3.441 1.37 5.735 1.37 2.258 0 4.06-.494 5.408-1.48 1.383-.986 2.075-2.3 2.075-3.943 0-1.168-.473-2.19-1.42-3.067-.947-.84-2.694-1.332-5.243-1.479-2.003-.146-3.733-.328-5.189-.547-1.493.803-2.476 1.661-2.95 2.574-.473.95-.71 1.789-.71 2.52ZM499.136 70.81c-2.585 0-4.879-.584-6.882-1.752-2.003-1.205-3.587-2.867-4.752-4.984-1.129-2.118-1.693-4.619-1.693-7.503 0-2.848.564-5.331 1.693-7.449 1.129-2.154 2.695-3.815 4.697-4.983 2.04-1.205 4.388-1.808 7.046-1.808 2.622 0 4.88.603 6.773 1.807 1.93 1.169 3.405 2.72 4.424 4.656 1.02 1.935 1.53 4.016 1.53 6.243 0 .402-.019.803-.055 1.205v1.37h-21.575c.11 2.08.583 3.815 1.42 5.202.874 1.351 1.949 2.373 3.223 3.067a8.753 8.753 0 0 0 4.151 1.04c1.894 0 3.478-.437 4.752-1.314 1.274-.876 2.203-2.063 2.786-3.56h4.533c-.728 2.52-2.13 4.62-4.206 6.299-2.039 1.643-4.661 2.464-7.865 2.464Zm0-24.59c-2.185 0-4.133.675-5.844 2.026-1.675 1.314-2.64 3.25-2.895 5.805h17.041c-.109-2.446-.947-4.363-2.512-5.75-1.566-1.388-3.496-2.081-5.79-2.081ZM516.96 70.153V42.988h4.151l.383 5.203c.837-1.789 2.112-3.213 3.823-4.272 1.712-1.058 3.824-1.588 6.336-1.588v4.82h-1.256c-1.602 0-3.077.292-4.424.876-1.348.548-2.422 1.497-3.223 2.848-.801 1.35-1.202 3.213-1.202 5.586v13.692h-4.588Z"/>
  </svg>
`;var l=i(88083),c=(i(69138),i(69580),i(33812)),d=i(50700),u=i(77468),h=i(26657),p=i(56898),m=i(50352),v=i(90246),f=i(86226),g=i(93199),y=i(97553),b=i(43759),w=i(58384),S=i(58806),I=i(88016);function k(e,t){if(1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.JRh(c.i5U(2,1,"limitedUsers",e.maxUsers))}}function C(e,t){if(1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.SpI(" ",c.i5U(2,1,"projectsIncluded",e.maxProjects)," ")}}function T(e,t){1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.JRh(c.bMT(2,1,"unlimitedProjects")))}function F(e,t){if(1&e&&(c.j41(0,"li"),c.EFF(1),c.nI1(2,"currency"),c.nI1(3,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.SpI(" ",c.i5U(3,4,"additionalMachineAccountCost",c.i5U(2,1,e.monthlyCostPerServiceAccount,"$"))," ")}}function R(e,t){if(1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"currency"),c.nI1(3,"i18n"),c.nI1(4,"i18n"),c.k0s()),2&e){const e=c.XpG(2);c.R7$(),c.Lme(" ",c.i5U(3,5,"costPerUser",c.i5U(2,2,e.monthlyCostPerUser,"$"))," /",c.bMT(4,8,"month")," ")}}function P(e,t){1&e&&(c.j41(0,"span"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.JRh(c.bMT(2,1,"freeForever")))}function x(e,t){1&e&&(c.j41(0,"bit-hint"),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.JRh(c.bMT(2,1,"addSecretsManagerUpgradeDesc")))}function $(e,t){1&e&&(c.j41(0,"div",17)(1,"bit-form-field")(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.nrm(5,"input",18),c.j41(6,"bit-hint"),c.EFF(7),c.nI1(8,"i18n"),c.k0s()()()),2&e&&(c.R7$(3),c.JRh(c.bMT(4,2,"userSeats")),c.R7$(4),c.JRh(c.bMT(8,4,"userSeatsHowManyDesc")))}function E(e,t){if(1&e&&(c.j41(0,"div",17)(1,"bit-form-field")(2,"bit-label"),c.EFF(3),c.nI1(4,"i18n"),c.k0s(),c.nrm(5,"input",19),c.j41(6,"bit-hint"),c.EFF(7),c.nI1(8,"i18n"),c.nI1(9,"currency"),c.nI1(10,"i18n"),c.k0s()()()),2&e){const e=c.XpG(3);c.R7$(3),c.JRh(c.bMT(4,3,"additionalMachineAccounts")),c.R7$(4),c.Lme(" ",c.i5U(8,5,"includedMachineAccounts",e.serviceAccountsIncluded)," ",c.i5U(10,11,"addAdditionalMachineAccounts",c.i5U(9,8,e.monthlyCostPerServiceAccount,"$"))," ")}}function A(e,t){1&e&&(c.j41(0,"button",20),c.EFF(1),c.nI1(2,"i18n"),c.k0s()),2&e&&(c.R7$(),c.SpI(" ",c.bMT(2,1,"save")," "))}function D(e,t){if(1&e&&(c.qex(0),c.DNE(1,$,9,6,"div",15)(2,E,11,14,"div",15)(3,A,3,3,"button",16),c.bVm()),2&e){const e=c.XpG(2);c.R7$(),c.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalSeatsOption),c.R7$(),c.Y8G("ngIf",e.selectedPlan.SecretsManager.hasAdditionalServiceAccountOption),c.R7$(),c.Y8G("ngIf",e.showSubmitButton)}}function O(e,t){if(1&e&&(c.j41(0,"div",3)(1,"h3",4),c.EFF(2),c.nI1(3,"i18n"),c.k0s(),c.j41(4,"div",5)(5,"div",6),c.nrm(6,"bit-icon",7),c.k0s()(),c.j41(7,"div",8)(8,"h4",9),c.EFF(9),c.nI1(10,"i18n"),c.k0s(),c.j41(11,"div",10),c.EFF(12),c.nI1(13,"i18n"),c.j41(14,"ul"),c.DNE(15,k,3,4,"li",11),c.j41(16,"li"),c.EFF(17),c.nI1(18,"i18n"),c.k0s(),c.DNE(19,C,3,4,"li",12)(20,T,3,3,"ng-template",null,0,c.C5r),c.j41(22,"li"),c.EFF(23),c.nI1(24,"i18n"),c.k0s(),c.DNE(25,F,4,7,"li",11),c.k0s()(),c.j41(26,"div",13),c.DNE(27,R,5,10,"span",12)(28,P,3,3,"ng-template",null,1,c.C5r),c.k0s(),c.j41(30,"bit-form-control"),c.nrm(31,"input",14),c.j41(32,"bit-label"),c.EFF(33),c.nI1(34,"i18n"),c.k0s(),c.DNE(35,x,3,3,"bit-hint",11),c.k0s(),c.DNE(36,D,4,3,"ng-container",11),c.k0s()()),2&e){const e=c.sdS(21),t=c.sdS(29),i=c.XpG();c.Y8G("formGroup",i.formGroup),c.R7$(2),c.JRh(c.bMT(3,16,"moreFromBitwarden")),c.R7$(4),c.Y8G("icon",i.logo),c.R7$(3),c.JRh(c.i5U(10,18,"secretsManagerForPlan",i.planName)),c.R7$(3),c.SpI(" ",c.bMT(13,21,"secretsManagerForPlanDesc")," "),c.R7$(3),c.Y8G("ngIf",i.product==i.productTypes.Free),c.R7$(2),c.JRh(c.bMT(18,23,"unlimitedSecrets")),c.R7$(2),c.Y8G("ngIf",i.product==i.productTypes.Free)("ngIfElse",e),c.R7$(4),c.JRh(c.i5U(24,25,"machineAccountsIncluded",i.serviceAccountsIncluded)),c.R7$(2),c.Y8G("ngIf",i.product!=i.productTypes.Free),c.R7$(2),c.Y8G("ngIf",i.product!=i.productTypes.Free)("ngIfElse",t),c.R7$(6),c.JRh(c.bMT(34,28,"subscribeToSecretsManager")),c.R7$(2),c.Y8G("ngIf",i.upgradeOrganization),c.R7$(),c.Y8G("ngIf",i.formGroup.value.enabled)}}const M=e=>e.group({enabled:[!1],userSeats:[1,[n.k0.required,n.k0.min(1),n.k0.max(1e5)]],additionalServiceAccounts:[0,[n.k0.required,n.k0.min(0),n.k0.max(1e5)]]});class U{constructor(e){this.i18nService=e,this.showSubmitButton=!1,this.logo=a,this.productTypes=l.K_,this.destroy$=new r.B,this.discountPrice=e=>e-(this.customerDiscount&&this.customerDiscount.active?e*(this.customerDiscount.percentOff/100):0)}ngOnInit(){this.formGroup.controls.enabled.valueChanges.pipe((0,s.Z)(this.formGroup.value.enabled),(0,o.Q)(this.destroy$)).subscribe(e=>{e?(this.formGroup.controls.userSeats.enable(),this.formGroup.controls.additionalServiceAccounts.enable()):(this.formGroup.controls.userSeats.disable(),this.formGroup.controls.additionalServiceAccounts.disable())})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get product(){return this.selectedPlan.productTier}get planName(){switch(this.product){case l.K_.Free:return this.i18nService.t("free2PersonOrganization");case l.K_.Teams:case l.K_.TeamsStarter:return this.i18nService.t("planNameTeams");case l.K_.Enterprise:return this.i18nService.t("planNameEnterprise")}}get serviceAccountsIncluded(){return this.selectedPlan.SecretsManager.baseServiceAccount}get monthlyCostPerServiceAccount(){return this.selectedPlan.isAnnual?this.discountPrice(this.selectedPlan.SecretsManager.additionalPricePerServiceAccount)/12:this.discountPrice(this.selectedPlan.SecretsManager.additionalPricePerServiceAccount)}get maxUsers(){return this.selectedPlan.SecretsManager.maxSeats}get maxProjects(){return this.selectedPlan.SecretsManager.maxProjects}get monthlyCostPerUser(){return this.selectedPlan.isAnnual?this.discountPrice(this.selectedPlan.SecretsManager.seatPrice)/12:this.discountPrice(this.selectedPlan.SecretsManager.seatPrice)}}U.ɵfac=function(e){return new(e||U)(c.rXU(d.W))},U.ɵcmp=c.VBU({type:U,selectors:[["sm-subscribe"]],inputs:{formGroup:"formGroup",upgradeOrganization:"upgradeOrganization",showSubmitButton:"showSubmitButton",selectedPlan:"selectedPlan",customerDiscount:"customerDiscount"},standalone:!1,decls:1,vars:1,consts:[["unlimitedProjects",""],["freeForever",""],[3,"formGroup",4,"ngIf"],[3,"formGroup"],["bitTypography","h3"],[1,"tw-rounded-t","tw-bg-background-alt3","tw-p-5"],[1,"tw-w-72"],[3,"icon"],[1,"tw-rounded-b","tw-border-x","tw-border-b","tw-border-t-0","tw-border-solid","tw-border-secondary-300","tw-p-5"],["bitTypography","h4"],[1,"tw-text-muted"],[4,"ngIf"],[4,"ngIf","ngIfElse"],[1,"tw-mb-5"],["type","checkbox","bitCheckbox","","formControlName","enabled"],["class","tw-w-1/2",4,"ngIf"],["type","submit","bitButton","","buttonType","primary","bitFormButton","",4,"ngIf"],[1,"tw-w-1/2"],["bitInput","","formControlName","userSeats","type","number"],["bitInput","","formControlName","additionalServiceAccounts","type","number"],["type","submit","bitButton","","buttonType","primary","bitFormButton",""]],template:function(e,t){1&e&&c.DNE(0,O,37,30,"div",2),2&e&&c.Y8G("ngIf",t.formGroup&&null!=t.selectedPlan)},dependencies:[u.bT,n.me,n.Q0,n.Zm,n.BC,n.cb,n.j4,n.JD,h.$,p.Q,m.P,v.f,f.j,g.I,y.J,b.h,w.i,S.r,u.oe,I.$],encapsulation:2})},91834:(e,t,i)=>{"use strict";i.d(t,{R:()=>s,l:()=>n});var n,r=i(51757);function s(e,t,i,s,o="controlB"){return a=>{if(!(a instanceof r.gE))throw new Error("compareInputs only supports validation at the FormGroup level");const l=a.get(t),c=a.get(i);if(!l||!c)throw new Error("[compareInputs validator] one or both of the specified controls could not be found in the form group");const d="controlA"===o?l:c;if(""===l.value&&""===c.value)return p();const u=l.value===c.value;return e===n.InputsShouldMatch?u?p():h():e===n.InputsShouldNotMatch?u?h():p():null;function h(){return d.setErrors(Object.assign(Object.assign({},d.errors||{}),{compareInputsError:{message:s}})),{compareInputsError:{message:s}}}function p(){const e=null==d?void 0:d.errors;if(null!=e){(null==e?void 0:e.compareInputsError)&&delete e.compareInputsError;const t=0===Object.keys(e).length;d.setErrors(t?null:e)}return null}}}!function(e){e[e.InputsShouldMatch=0]="InputsShouldMatch",e[e.InputsShouldNotMatch=1]="InputsShouldNotMatch"}(n||(n={}))},91962:(e,t,i)=>{"use strict";i.d(t,{_:()=>r});var n=i(33812);class r{}r.ɵfac=function(e){return new(e||r)},r.ɵcmp=n.VBU({type:r,selectors:[["bit-item-group"]],hostAttrs:[1,"tw-block"],ngContentSelectors:["*"],decls:1,vars:0,template:function(e,t){1&e&&(n.NAR(),n.SdG(0))},encapsulation:2,changeDetection:0})},91968:(e,t,i)=>{"use strict";i.d(t,{ie:()=>T,dn:()=>F,dp:()=>Y,Vl:()=>H,vZ:()=>I,wt:()=>R,Md:()=>a,O2:()=>_,Iw:()=>ke,Cg:()=>k,g:()=>C,rB:()=>xe,fn:()=>be,HR:()=>we,Xk:()=>Se,Z9:()=>W,PM:()=>ue,xS:()=>he,Z6:()=>J,Gg:()=>De,Gd:()=>Oe,V_:()=>Ys,BA:()=>S,eP:()=>P,XH:()=>X,w8:()=>n,K8:()=>$e,ww:()=>Z,Wm:()=>Q,Qb:()=>le,OB:()=>se,Rv:()=>pe,jx:()=>me,qd:()=>oe,kj:()=>ae,Y2:()=>s,hs:()=>ee,P7:()=>Me,_Q:()=>Ue,Zs:()=>d,d1:()=>x,jB:()=>$,Gm:()=>E,Br:()=>A,Tf:()=>D,y7:()=>O,Nb:()=>Qs,i9:()=>Te,bI:()=>Fe,nr:()=>g,fK:()=>K,ll:()=>w,EF:()=>Ee,aL:()=>Ae,jb:()=>y,Bh:()=>Ie,L_:()=>b,Sc:()=>M,k2:()=>Ce,Mc:()=>B,bj:()=>ce,$g:()=>de,q9:()=>Re,iy:()=>U,aC:()=>G,W$:()=>te,Ys:()=>o,zU:()=>f,iO:()=>Ge,lR:()=>v,v2:()=>r,dw:()=>to,dD:()=>ie,uv:()=>j,MC:()=>N,oR:()=>V,Ud:()=>ne,bh:()=>z,xu:()=>L,Ok:()=>m,gc:()=>Pe,km:()=>ve,iK:()=>fe,s2:()=>ye,Jb:()=>ge,dr:()=>q,g4:()=>re,yT:()=>Hs,YO:()=>Ws,GR:()=>Js});class n{}class r{}class s{}class o{}class a{}function l(e){return t=>null==t?null:t.map(t=>e(t))}function c(e){return t=>{if(null==t)return null;const i={};return Object.entries(t).forEach(([t,n])=>{i[t]=e(n)}),i}}class d{constructor(e,t,i){var n;if(this.stateDefinition=e,this.key=t,this.options=i,null==i.deserializer)throw new Error(`'deserializer' is a required property on key ${this.errorKeyName}`);if(i.cleanupDelayMs<0)throw new Error(`'cleanupDelayMs' must be greater than or equal to 0. Value of ${i.cleanupDelayMs} passed to key ${this.errorKeyName} `);const{enableUpdateLogging:r=!1,enableRetrievalLogging:s=!1}=null!==(n=i.debug)&&void 0!==n?n:{};this.debug={enableUpdateLogging:r,enableRetrievalLogging:s}}get deserializer(){return this.options.deserializer}get cleanupDelayMs(){var e;return this.options.cleanupDelayMs<0?0:null!==(e=this.options.cleanupDelayMs)&&void 0!==e?e:1e3}static array(e,t,i){return new d(e,t,Object.assign(Object.assign({},i),{deserializer:l(e=>i.deserializer(e))}))}static record(e,t,i){return new d(e,t,Object.assign(Object.assign({},i),{deserializer:c(e=>i.deserializer(e))}))}get fullName(){return`${this.stateDefinition.name}_${this.key}`}get errorKeyName(){return`${this.stateDefinition.name} > ${this.key}`}}var u,h=i(53323);const p=Symbol("UserKeyDefinition");class m{constructor(e,t,i){var n;if(this.stateDefinition=e,this.key=t,this.options=i,this[u]=!0,null==i.deserializer)throw new Error(`'deserializer' is a required property on key ${this.errorKeyName}`);if(i.cleanupDelayMs<0)throw new Error(`'cleanupDelayMs' must be greater than or equal to 0. Value of ${i.cleanupDelayMs} passed to key ${this.errorKeyName} `);this.clearOn=Array.from(new Set(i.clearOn));const{enableUpdateLogging:r=!1,enableRetrievalLogging:s=!1}=null!==(n=i.debug)&&void 0!==n?n:{};this.debug={enableUpdateLogging:r,enableRetrievalLogging:s}}get deserializer(){return this.options.deserializer}get cleanupDelayMs(){var e;return this.options.cleanupDelayMs<0?0:null!==(e=this.options.cleanupDelayMs)&&void 0!==e?e:1e3}static array(e,t,i){return new m(e,t,Object.assign(Object.assign({},i),{deserializer:l(e=>i.deserializer(e))}))}static record(e,t,i){return new m(e,t,Object.assign(Object.assign({},i),{deserializer:c(e=>i.deserializer(e))}))}get fullName(){return`${this.stateDefinition.name}_${this.key}`}buildKey(e){if(!(0,h.W_)(e))throw new Error(`You cannot build a user key without a valid UserId, building for key ${this.fullName}`);return`user_${e}_${this.stateDefinition.name}_${this.key}`}get errorKeyName(){return`${this.stateDefinition.name} > ${this.key}`}}u=p;class v{}Symbol("active");class f{constructor(e,t,i){this.name=e,this.defaultStorageLocation=t,this.storageLocationOverrides=null!=i?i:{}}}const g=new f("organizations","disk"),y=new f("policies","disk"),b=new f("providers","disk"),w=new f("organizationManagementPreferences","disk",{web:"disk-local"}),S=new f("showDeleteManagedUserWarning","disk",{web:"disk-local"}),I=new f("autoConfirm","disk",{web:"disk-local"}),k=new f("billing","disk"),C=new f("billing","memory"),T=new f("account","disk"),F=(new f("account","memory"),new f("authRequestLocal","disk",{web:"disk-local"})),R=new f("avatar","disk",{web:"disk-local"}),P=new f("deviceTrust","disk",{web:"disk-local",browser:"disk-backup-local-storage"}),x=new f("loginEmail","disk",{web:"disk-local"}),$=new f("loginEmail","memory"),E=new f("loginStrategy","memory"),A=new f("masterPassword","disk"),D=new f("masterPassword","memory"),O=new f("masterPasswordUnlock","disk"),M=new f("router","disk"),U=new f("ssoLogin","disk"),G=new f("ssoLoginLocal","disk",{web:"disk-local"}),j=new f("token","disk"),N=new f("tokenDiskLocal","disk",{web:"disk-local"}),V=new f("token","memory"),B=new f("sendAccess","disk"),z=new f("twoFactor","memory"),L=new f("userDecryptionOptions","disk"),K=new f("organizationInvite","disk"),q=new f("vaultTimeoutSettings","disk",{web:"disk-local"}),_=new f("badgeSettings","disk"),X=(new f("userNotificationSettings","disk"),new f("domainSettings","disk")),Y=new f("autofillSettings","disk"),H=new f("autofillSettingsLocal","disk",{web:"disk-local"}),W=(new f("autotypeSettings","disk"),new f("newWebLayoutBanner","disk",{web:"disk-local"}),new f("phishingDetection","disk"),new f("applicationId","disk",{web:"disk-local"}),new f("clearEvent","disk")),J=new f("config","disk",{web:"disk-local"}),Z=(new f("desktopSettings","disk"),new f("environment","disk")),Q=new f("environment","memory"),ee=new f("interProcessCommunication","memory"),te=(new f("popupView","memory",{browser:"memory-large-object"}),new f("sync","disk",{web:"memory"})),ie=new f("theming","disk",{web:"disk-local"}),ne=new f("translation","disk",{web:"disk-local"}),re=(new f("animation","disk"),new f("taskScheduler","disk"),new f("extensionInitialInstall","disk"),new f("webPushSubscription","disk",{web:"disk-local"})),se=(new f("popupStyle","disk"),new f("smOnboarding","disk",{web:"disk-local"}),new f("extension","disk")),oe=new f("generator","disk"),ae=new f("generator","memory"),le=(new f("sendBrowser","memory"),new f("eventCollection","disk")),ce=new f("encryptedSend","disk",{web:"memory"}),de=new f("decryptedSend","memory",{browser:"memory-large-object"}),ue=(new f("sendAccessAuth","memory"),new f("collection","disk",{web:"memory"})),he=new f("decryptedCollections","memory",{browser:"memory-large-object"}),pe=new f("folder","disk",{web:"memory"}),me=new f("decryptedFolders","memory",{browser:"memory-large-object"}),ve=new f("vaultFilter","disk",{web:"disk-local"}),fe=new f("vaultOnboarding","disk",{web:"disk-local"}),ge=new f("vaultSettings","disk",{web:"disk-local"}),ye=(new f("vaultBrowser","memory",{browser:"memory-large-object"}),new f("vaultSearch","memory",{browser:"memory-large-object"})),be=new f("ciphers","disk",{web:"memory"}),we=new f("ciphersLocal","disk",{web:"disk-local"}),Se=new f("ciphersMemory","memory",{browser:"memory-large-object"}),Ie=new f("premiumBannerReprompt","disk",{web:"disk-local"}),ke=new f("bannersDismissed","disk"),Ce=(new f("vaultAppearance","disk"),new f("securityTasks","disk")),Te=(new f("atRiskPasswordsPage","disk"),new f("notifications","disk")),Fe=new f("nudges","disk",{web:"disk-local"}),Re=new f("setupExtensionDismissed","disk",{web:"disk-local"}),Pe=(new f("vaultBrowserIntroCarousel","disk"),new f("vaultAtRiskPasswords","memory")),xe=new f("biometricSettings","disk"),$e=new f("encryptedMigration","disk"),Ee=new f("pinUnlock","disk"),Ae=new f("pinUnlock","memory"),De=new f("crypto","disk"),Oe=new f("crypto","memory"),Me=new f("kdfConfig","disk"),Ue=new f("keyConnector","disk");class Ge{}var je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ne{static create(){return new Ne([])}constructor(e){this.migrations=e}with(...e){return this.addMigrator(e,"up")}rollback(...e){return 3===e.length&&(e=[e[0],e[2],e[1]]),this.addMigrator(e,"down")}migrate(e){return this.migrations.reduce((t,i)=>t.then(()=>je(this,void 0,void 0,function*(){yield this.runMigrator(i.migrator,e,i.direction)})),Promise.resolve())}addMigrator(e,t="up"){const i=1===e.length?{migrator:new e[0],direction:t}:{migrator:new e[0](e[1],e[2]),direction:t};return new Ne([...this.migrations,i])}runMigrator(e,t,i){return je(this,void 0,void 0,function*(){const n=yield e.shouldMigrate(t,i);if(t.info(`Migrator ${e.constructor.name} (to version ${e.toVersion}) should migrate: ${n} - ${i}`),n){const n="up"===i?e.migrate:e.rollback;yield n.bind(e)(t),t.info(`Migrator ${e.constructor.name} (to version ${e.toVersion}) migrated - ${i}`),yield e.updateVersion(t,i),t.info(`Migrator ${e.constructor.name} (to version ${e.toVersion}) updated version - ${i}`)}})}}var Ve=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Be=new Error("Irreversible migration");class ze{constructor(e,t){if(this.fromVersion=e,this.toVersion=t,null==e||null==t)throw new Error("Invalid migration");if(e>t)throw new Error("Invalid migration")}shouldMigrate(e,t){const i="up"===t?this.fromVersion:this.toVersion;return Promise.resolve(e.currentVersion===i)}updateVersion(e,t){return Ve(this,void 0,void 0,function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i,yield e.set("stateVersion",i)})}}var Le=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ke={key:"everHadUserKey",stateDefinition:{name:"crypto"}};class qe extends ze{migrate(e){return Le(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Le(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.everHadUserKey;yield e.setToUser(t,Ke,null!=r&&r),null!=r&&delete i.profile.everHadUserKey,yield e.set(t,i)})}(t,i))])})}rollback(e){return Le(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Le(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Ke);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{everHadUserKey:r}),yield e.set(t,i)),yield e.setToUser(t,Ke,null)})}(t,i))])})}}var _e=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xe={key:"organizationKeys",stateDefinition:{name:"crypto"}};class Ye extends ze{migrate(e){return _e(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return _e(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,Xe,s),delete i.keys.organizationKeys,yield e.set(t,i))})}(t,i))])})}rollback(e){return _e(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return _e(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Xe);i&&r&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{organizationKeys:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,Xe,null)})}(t,i))])})}}var He=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const We={name:"environment"},Je={key:"region",stateDefinition:We},Ze={key:"urls",stateDefinition:We};class Qe extends ze{migrate(e){return He(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.region)&&(yield e.setToGlobal(Je,t.region)),null!=(null==t?void 0:t.environmentUrls)&&(yield e.setToGlobal(Ze,t.environmentUrls));const i=yield e.getAccounts();yield Promise.all(i.map(t=>He(this,[t],void 0,function*({userId:t,account:i}){var n,r,s,o;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.region)&&(yield e.setToUser(t,Je,i.settings.region)),null!=(null===(r=null==i?void 0:i.settings)||void 0===r?void 0:r.environmentUrls)&&(yield e.setToUser(t,Ze,i.settings.environmentUrls)),null===(s=null==i?void 0:i.settings)||void 0===s||delete s.region,null===(o=null==i?void 0:i.settings)||void 0===o||delete o.environmentUrls,yield e.set(t,i)}))),null==t||delete t.region,null==t||delete t.environmentUrls,yield e.set("global",t)})}rollback(e){return He(this,void 0,void 0,function*(){let t=yield e.get("global"),i=!1;const n=yield e.getFromGlobal(Je);n&&(t||(t={}),i=!0,t.region=n,yield e.setToGlobal(Je,null));const r=yield e.getFromGlobal(Ze);r&&(t||(t={}),i=!0,t.environmentUrls=r,yield e.setToGlobal(Ze,null)),i&&(yield e.set("global",t));const s=yield e.getAccounts();yield Promise.all(s.map(({userId:t,account:i})=>function(t,i){return He(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,Je);r&&(i||(i={}),i.settings||(i.settings={}),n=!0,i.settings.region=r,yield e.setToUser(t,Je,null));const s=yield e.getFromUser(t,Ze);s&&(i||(i={}),i.settings||(i.settings={}),n=!0,i.settings.environmentUrls=s,yield e.setToUser(t,Ze,null)),n&&(yield e.set(t,i))})}(t,i)))})}}var et=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const tt={key:"providerKeys",stateDefinition:{name:"crypto"}};class it extends ze{migrate(e){return et(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return et(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.providerKeys)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,tt,s),delete i.keys.providerKeys,yield e.set(t,i))})}(t,i))])})}rollback(e){return et(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return et(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,tt);i&&r&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{providerKeys:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,tt,null)})}(t,i))])})}}var nt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const rt={key:"clientKeyHalf",stateDefinition:{name:"biometricSettings"}};class st extends ze{migrate(e){return nt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>nt(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=(null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.biometricEncryptionClientKeyHalf)&&(yield e.setToUser(t,rt,i.keys.biometricEncryptionClientKeyHalf),null===(r=null==i?void 0:i.keys)||void 0===r||delete r.biometricEncryptionClientKeyHalf,yield e.set(t,i))})))})}rollback(e){return nt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return nt(this,void 0,void 0,function*(){var n;let r=!1;const s=yield e.getFromUser(t,rt);s&&(null!=i||(i={}),null!==(n=i.keys)&&void 0!==n||(i.keys={}),r=!0,i.keys.biometricEncryptionClientKeyHalf=s,yield e.setToUser(t,rt,null)),r&&(yield e.set(t,i))})}(t,i)))})}}var ot=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const at={key:"folders",stateDefinition:{name:"folder"}};class lt extends ze{migrate(e){return ot(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ot(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.folders)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,at,s),delete i.data.folders,yield e.set(t,i))})}(t,i))])})}rollback(e){return ot(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ot(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,at);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{folders:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,at,null)})}(t,i))])})}}var ct=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const dt={key:"lastSync",stateDefinition:{name:"sync"}};class ut extends ze{migrate(e){return ct(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ct(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;yield e.setToUser(t,dt,null!=r?r:null),null!=r&&(delete i.profile.lastSync,yield e.set(t,i))})}(t,i))])})}rollback(e){return ct(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ct(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,dt);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{lastSync:r}),yield e.set(t,i)),yield e.setToUser(t,dt,null)})}(t,i))])})}}var ht=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const pt={key:"enablePasskeys",stateDefinition:{name:"vaultSettings"}};class mt extends ze{migrate(e){return ht(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.enablePasskeys)&&(yield e.setToGlobal(pt,t.enablePasskeys),null==t||delete t.enablePasskeys,yield e.set("global",t))})}rollback(e){return ht(this,void 0,void 0,function*(){let t=yield e.get("global");const i=yield e.getFromGlobal(pt);null!=i&&(t=Object.assign(null!=t?t:{},{enablePasskeys:i}),yield e.set("global",t),yield e.setToGlobal(pt,void 0))})}}var vt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ft={stateDefinition:{name:"autofillSettings"}};class gt extends ze{migrate(e){return vt(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.autoFillOverlayVisibility)&&(yield e.setToGlobal({stateDefinition:{name:"autofillSettingsLocal"},key:"inlineMenuVisibility"},t.autoFillOverlayVisibility),delete t.autoFillOverlayVisibility,yield e.set("global",t));const i=yield e.getAccounts();yield Promise.all([...i.map(({userId:t,account:i})=>function(t,i){return vt(this,void 0,void 0,function*(){let n=!1;const r=null==i?void 0:i.settings;null!=(null==r?void 0:r.autoFillOnPageLoadDefault)&&(yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoadDefault"}),r.autoFillOnPageLoadDefault),delete i.settings.autoFillOnPageLoadDefault,n=!0),null!=(null==r?void 0:r.enableAutoFillOnPageLoad)&&(yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoad"}),null==r?void 0:r.enableAutoFillOnPageLoad),delete i.settings.enableAutoFillOnPageLoad,n=!0),null!=(null==r?void 0:r.dismissedAutoFillOnPageLoadCallout)&&(yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoadCalloutIsDismissed"}),null==r?void 0:r.dismissedAutoFillOnPageLoadCallout),delete i.settings.dismissedAutoFillOnPageLoadCallout,n=!0),null!=(null==r?void 0:r.disableAutoTotpCopy)&&(yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autoCopyTotp"}),!(null==r?void 0:r.disableAutoTotpCopy)),delete i.settings.disableAutoTotpCopy,n=!0),null!=(null==r?void 0:r.activateAutoFillOnPageLoadFromPolicy)&&(yield e.setToUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"},null==r?void 0:r.activateAutoFillOnPageLoadFromPolicy),delete i.settings.activateAutoFillOnPageLoadFromPolicy,n=!0),n&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return vt(this,void 0,void 0,function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal({stateDefinition:{name:"autofillSettingsLocal"},key:"inlineMenuVisibility"});i&&(yield e.set("global",Object.assign(Object.assign({},t),{autoFillOverlayVisibility:i})),yield e.setToGlobal({stateDefinition:{name:"autofillSettingsLocal"},key:"inlineMenuVisibility"},null));const n=yield e.getAccounts();yield Promise.all([...n.map(({userId:t,account:i})=>function(t,i){return vt(this,void 0,void 0,function*(){let n=!1,r=(null==i?void 0:i.settings)||{};const s=yield e.getFromUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoadDefault"})),o=yield e.getFromUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoad"})),a=yield e.getFromUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoadCalloutIsDismissed"})),l=yield e.getFromUser(t,Object.assign(Object.assign({},ft),{key:"autoCopyTotp"})),c=yield e.getFromUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"});null!=s&&(r=Object.assign(Object.assign({},r),{autoFillOnPageLoadDefault:s}),yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoadDefault"}),null),n=!0),null!=o&&(r=Object.assign(Object.assign({},r),{enableAutoFillOnPageLoad:o}),yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoad"}),null),n=!0),null!=a&&(r=Object.assign(Object.assign({},r),{dismissedAutoFillOnPageLoadCallout:a}),yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autofillOnPageLoadCalloutIsDismissed"}),null),n=!0),null!=l&&(r=Object.assign(Object.assign({},r),{disableAutoTotpCopy:!l}),yield e.setToUser(t,Object.assign(Object.assign({},ft),{key:"autoCopyTotp"}),null),n=!0),null!=c&&(r=Object.assign(Object.assign({},r),{activateAutoFillOnPageLoadFromPolicy:c}),yield e.setToUser(t,{stateDefinition:{name:"autofillSettingsLocal"},key:"activateAutofillOnPageLoadFromPolicy"},null),n=!0),n&&(yield e.set(t,Object.assign(Object.assign({},i),{settings:r})))})}(t,i))])})}}var yt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const bt={key:"requirePasswordOnStart",stateDefinition:{name:"biometricSettings"}};class wt extends ze{migrate(e){return yt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>yt(this,[t],void 0,function*({userId:t,account:i}){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.requirePasswordOnStart)&&(yield e.setToUser(t,bt,i.settings.requirePasswordOnStart),delete i.settings.requirePasswordOnStart,yield e.set(t,i))})))})}rollback(e){return yt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return yt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,bt);r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.requirePasswordOnStart=r,yield e.setToUser(t,bt,null),yield e.set(t,i))})}(t,i)))})}}var St=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const It={key:"privateKey",stateDefinition:{name:"crypto"}};class kt extends ze{migrate(e){return St(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return St(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.privateKey)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,It,s),delete i.keys.privateKey,yield e.set(t,i))})}(t,i))])})}rollback(e){return St(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return St(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,It);i&&r&&(i.keys=Object.assign(null!==(n=i.keys)&&void 0!==n?n:{},{privateKey:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,It,null)})}(t,i))])})}}var Ct=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Tt={key:"collections",stateDefinition:{name:"collection"}};class Ft extends ze{migrate(e){return Ct(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Ct(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.collections)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,Tt,s),delete i.data.collections,yield e.set(t,i))})}(t,i))])})}rollback(e){return Ct(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Ct(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Tt);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{collections:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,Tt,null)})}(t,i))])})}}var Rt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Pt={key:"collapsedGroupings",stateDefinition:{name:"vaultFilter"}};class xt extends ze{migrate(e){return Rt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Rt(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.collapsedGroupings;null!=r&&(yield e.setToUser(t,Pt,r),delete i.settings.collapsedGroupings,yield e.set(t,i))})}(t,i))])})}rollback(e){return Rt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Rt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Pt);i&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{collapsedGroupings:r}),yield e.set(t,i)),yield e.setToUser(t,Pt,null)})}(t,i))])})}}var $t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Et={key:"dismissedBiometricRequirePasswordOnStartCallout",stateDefinition:{name:"biometricSettings"}},At={key:"promptAutomatically",stateDefinition:{name:"biometricSettings"}};class Dt extends ze{migrate(e){return $t(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>$t(this,[t],void 0,function*({userId:t,account:i}){var n,r,s,o;null!=i&&(null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.dismissedBiometricRequirePasswordOnStartCallout)&&(yield e.setToUser(t,Et,i.settings.dismissedBiometricRequirePasswordOnStartCallout)),null!=(null===(r=null==i?void 0:i.settings)||void 0===r?void 0:r.disableAutoBiometricsPrompt)&&(yield e.setToUser(t,At,!i.settings.disableAutoBiometricsPrompt)),null===(s=null==i?void 0:i.settings)||void 0===s||delete s.dismissedBiometricRequirePasswordOnStartCallout,null===(o=null==i?void 0:i.settings)||void 0===o||delete o.disableAutoBiometricsPrompt,yield e.set(t,i))})))})}rollback(e){return $t(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return $t(this,void 0,void 0,function*(){var n,r;let s=!1;const o=yield e.getFromUser(t,Et);o&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),s=!0,i.settings.dismissedBiometricRequirePasswordOnStartCallout=o,yield e.setToUser(t,Et,null));const a=yield e.getFromUser(t,At);null!=a&&(null!=i||(i={}),null!==(r=i.settings)&&void 0!==r||(i.settings={}),s=!0,i.settings.disableAutoBiometricsPrompt=!a,yield e.setToUser(t,At,null)),s&&(yield e.set(t,i))})}(t,i)))})}}var Ot=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Mt={key:"tasks",stateDefinition:{name:"smOnboarding"}};class Ut extends ze{migrate(e){return Ot(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Ot(this,[t],void 0,function*({userId:t,account:i}){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.smOnboardingTasks)&&(yield e.setToUser(t,Mt,i.settings.smOnboardingTasks),delete i.settings.smOnboardingTasks,yield e.set(t,i))})))})}rollback(e){return Ot(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Ot(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Mt);r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.smOnboardingTasks=r,yield e.setToUser(t,Mt,null),yield e.set(t,i))})}(t,i)))})}}var Gt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const jt={stateDefinition:{name:"autofillSettingsLocal"}};class Nt extends ze{migrate(e){return Gt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Gt(this,void 0,void 0,function*(){const n=null==i?void 0:i.settings;void 0!==(null==n?void 0:n.clearClipboard)&&(yield e.setToUser(t,Object.assign(Object.assign({},jt),{key:"clearClipboardDelay"}),n.clearClipboard),delete i.settings.clearClipboard,yield e.set(t,i))})}(t,i))])})}rollback(e){return Gt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Gt(this,void 0,void 0,function*(){let n=(null==i?void 0:i.settings)||{};const r=yield e.getFromUser(t,Object.assign(Object.assign({},jt),{key:"clearClipboardDelay"}));void 0!==r&&(n=Object.assign(Object.assign({},n),{clearClipboard:r}),yield e.setToUser(t,Object.assign(Object.assign({},jt),{key:"clearClipboardDelay"}),null),yield e.set(t,Object.assign(Object.assign({},i),{settings:n})))})}(t,i))])})}}var Vt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Bt={key:"lastSync",stateDefinition:{name:"sync"}};class zt extends ze{rollback(e){return Vt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Vt(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;yield e.setToUser(t,Bt,null!=r?r:null),null!=r&&(delete i.profile.lastSync,yield e.set(t,i))})}(t,i))])})}migrate(e){return Vt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Vt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Bt);i&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{lastSync:r}),yield e.set(t,i)),yield e.setToUser(t,Bt,null)})}(t,i))])})}}var Lt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Kt={stateDefinition:{name:"badgeSettings"},key:"enableBadgeCounter"};class qt extends ze{migrate(e){return Lt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Lt(this,void 0,void 0,function*(){const n=null==i?void 0:i.settings;null!=(null==n?void 0:n.disableBadgeCounter)&&(yield e.setToUser(t,Kt,!n.disableBadgeCounter),delete i.settings.disableBadgeCounter,yield e.set(t,i))})}(t,i))])})}rollback(e){return Lt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Lt(this,void 0,void 0,function*(){let n=(null==i?void 0:i.settings)||{};const r=yield e.getFromUser(t,Kt);null!=r&&(n=Object.assign(Object.assign({},n),{disableBadgeCounter:!r}),yield e.setToUser(t,Kt,null),yield e.set(t,Object.assign(Object.assign({},i),{settings:n})))})}(t,i))])})}}var _t=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xt={key:"biometricUnlockEnabled",stateDefinition:{name:"biometricSettings"}};class Yt extends ze{migrate(e){return _t(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>_t(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=i&&(null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.biometricUnlock)&&(yield e.setToUser(t,Xt,i.settings.biometricUnlock)),null===(r=null==i?void 0:i.settings)||void 0===r||delete r.biometricUnlock,yield e.set(t,i))})))})}rollback(e){return _t(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return _t(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Xt);null!=r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.biometricUnlock=r,yield e.setToUser(t,Xt,null),yield e.set(t,i))})}(t,i)))})}}var Ht=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Wt extends ze{migrate(e){return Ht(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableAddLoginNotification)&&(yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableAddedLoginPrompt"},!t.disableAddLoginNotification),delete t.disableAddLoginNotification,yield e.set("global",t)),null!=(null==t?void 0:t.disableChangedPasswordNotification)&&(yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableChangedPasswordPrompt"},!t.disableChangedPasswordNotification),delete t.disableChangedPasswordNotification,yield e.set("global",t))})}rollback(e){return Ht(this,void 0,void 0,function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableAddedLoginPrompt"}),n=yield e.getFromGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableChangedPasswordPrompt"});i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableAddLoginNotification:!i})),yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableAddedLoginPrompt"},null)),n&&(yield e.set("global",Object.assign(Object.assign({},t),{disableChangedPasswordNotification:!n})),yield e.setToGlobal({stateDefinition:{name:"userNotificationSettings"},key:"enableChangedPasswordPrompt"},null))})}}var Jt,Zt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e[e.TwoFactorAuthentication=0]="TwoFactorAuthentication",e[e.MasterPassword=1]="MasterPassword",e[e.PasswordGenerator=2]="PasswordGenerator",e[e.SingleOrg=3]="SingleOrg",e[e.RequireSso=4]="RequireSso",e[e.PersonalOwnership=5]="PersonalOwnership",e[e.DisableSend=6]="DisableSend",e[e.SendOptions=7]="SendOptions",e[e.ResetPassword=8]="ResetPassword",e[e.MaximumVaultTimeout=9]="MaximumVaultTimeout",e[e.DisablePersonalVaultExport=10]="DisablePersonalVaultExport",e[e.ActivateAutofill=11]="ActivateAutofill"}(Jt||(Jt={}));const Qt={key:"policies",stateDefinition:{name:"policies"}};class ei extends ze{migrate(e){return Zt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Zt(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.policies)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,Qt,s),delete i.data.policies,yield e.set(t,i))})}(t,i)))})}rollback(e){return Zt(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Zt(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Qt);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{policies:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,Qt,null)})}(t,i)))})}}var ti=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ii={stateDefinition:{name:"autofillSettings"},key:"enableContextMenu"};class ni extends ze{migrate(e){return ti(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableContextMenuItem)&&(yield e.setToGlobal(ii,!t.disableContextMenuItem),delete t.disableContextMenuItem,yield e.set("global",t))})}rollback(e){return ti(this,void 0,void 0,function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal(ii);null!=i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableContextMenuItem:!i})),yield e.setToGlobal(ii,null))})}}var ri=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const si={key:"locale",stateDefinition:{name:"translation"}};class oi extends ze{migrate(e){return ri(this,void 0,void 0,function*(){const t=yield e.get("global");(null==t?void 0:t.locale)&&(yield e.setToGlobal(si,t.locale),delete t.locale,yield e.set("global",t))})}rollback(e){return ri(this,void 0,void 0,function*(){var t;const i=yield e.getFromGlobal(si);if(!i)return;const n=null!==(t=yield e.get("global"))&&void 0!==t?t:{};n.locale=i,yield e.set("global",n),yield e.setToGlobal(si,null)})}}var ai=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const li="appId",ci="anonymousAppId",di={key:li,stateDefinition:{name:"applicationId"}},ui={key:ci,stateDefinition:{name:"applicationId"}};class hi extends ze{migrate(e){return ai(this,void 0,void 0,function*(){const t=yield e.get(li),i=yield e.get(ci);null!=t&&(yield e.setToGlobal(di,t),yield e.set(li,null)),null!=i&&(yield e.setToGlobal(ui,i),yield e.set(ci,null))})}rollback(e){return ai(this,void 0,void 0,function*(){const t=yield e.getFromGlobal(di),i=yield e.getFromGlobal(ui);null!=t&&(yield e.set(li,t),yield e.setToGlobal(di,null)),null!=i&&(yield e.set(ci,i),yield e.setToGlobal(ui,null))})}}var pi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const mi={stateDefinition:{name:"domainSettings"},key:"defaultUriMatchStrategy"},vi={stateDefinition:{name:"domainSettings"},key:"equivalentDomains"},fi={stateDefinition:{name:"domainSettings"},key:"neverDomains"};class gi extends ze{migrate(e){return pi(this,void 0,void 0,function*(){let t=!1;const i=yield e.get("global");null!=(null==i?void 0:i.neverDomains)&&(yield e.setToGlobal(fi,i.neverDomains),delete i.neverDomains,yield e.set("global",i));const n=yield e.getAccounts();yield Promise.all([...n.map(({userId:i,account:n})=>function(i,n){return pi(this,void 0,void 0,function*(){var r;const s=null==n?void 0:n.settings;null!=(null==s?void 0:s.defaultUriMatch)&&(yield e.setToUser(i,mi,s.defaultUriMatch),delete n.settings.defaultUriMatch,t=!0),null!=(null===(r=null==s?void 0:s.settings)||void 0===r?void 0:r.equivalentDomains)&&(yield e.setToUser(i,vi,s.settings.equivalentDomains),delete n.settings.settings.equivalentDomains,delete n.settings.settings,t=!0),t&&(yield e.set(i,n))})}(i,n))])})}rollback(e){return pi(this,void 0,void 0,function*(){let t=!1;const i=(yield e.get("global"))||{},n=yield e.getFromGlobal(fi);null!=n&&(yield e.set("global",Object.assign(Object.assign({},i),{neverDomains:n})),yield e.setToGlobal(fi,null));const r=yield e.getAccounts();yield Promise.all([...r.map(({userId:i,account:n})=>function(i,n){return pi(this,void 0,void 0,function*(){let r=(null==n?void 0:n.settings)||{};const s=yield e.getFromUser(i,mi),o=yield e.getFromUser(i,vi);null!=s&&(r=Object.assign(Object.assign({},r),{defaultUriMatch:s}),yield e.setToUser(i,mi,null),t=!0),null!=o&&(r=Object.assign(Object.assign({},r),{settings:{equivalentDomains:o}}),yield e.setToUser(i,vi,null),t=!0),t&&(yield e.set(i,Object.assign(Object.assign({},n),{settings:r})))})}(i,n))])})}}var yi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const bi={key:"selection",stateDefinition:{name:"theming"}};class wi extends ze{migrate(e){return yi(this,void 0,void 0,function*(){const t=yield e.get("global"),i=null==t?void 0:t.theme;null!=i&&(yield e.setToGlobal(bi,i),delete t.theme,yield e.set("global",t))})}rollback(e){return yi(this,void 0,void 0,function*(){var t;const i=yield e.getFromGlobal(bi);if(null!=i){const n=null!==(t=yield e.get("global"))&&void 0!==t?t:{};n.theme=i,yield e.set("global",n),yield e.removeFromGlobal(bi)}})}}var Si=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ii={stateDefinition:{name:"vaultSettings"}};class ki extends ze{migrate(e){return Si(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Si(this,void 0,void 0,function*(){let n=!1;const r=null==i?void 0:i.settings;null!=(null==r?void 0:r.dontShowCardsCurrentTab)&&(yield e.setToUser(t,Object.assign(Object.assign({},Ii),{key:"showCardsCurrentTab"}),!r.dontShowCardsCurrentTab),delete i.settings.dontShowCardsCurrentTab,n=!0),null!=(null==r?void 0:r.dontShowIdentitiesCurrentTab)&&(yield e.setToUser(t,Object.assign(Object.assign({},Ii),{key:"showIdentitiesCurrentTab"}),!r.dontShowIdentitiesCurrentTab),delete i.settings.dontShowIdentitiesCurrentTab,n=!0),n&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return Si(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Si(this,void 0,void 0,function*(){var n;let r=!1,s=null!==(n=null==i?void 0:i.settings)&&void 0!==n?n:{};const o=yield e.getFromUser(t,Object.assign(Object.assign({},Ii),{key:"showCardsCurrentTab"})),a=yield e.getFromUser(t,Object.assign(Object.assign({},Ii),{key:"showIdentitiesCurrentTab"}));null!=o&&(s=Object.assign(Object.assign({},s),{dontShowCardsCurrentTab:!o}),yield e.setToUser(t,Object.assign(Object.assign({},Ii),{key:"showCardsCurrentTab"}),null),r=!0),null!=a&&(s=Object.assign(Object.assign({},s),{dontShowIdentitiesCurrentTab:!a}),yield e.setToUser(t,Object.assign(Object.assign({},Ii),{key:"showIdentitiesCurrentTab"}),null),r=!0),r&&(yield e.set(t,Object.assign(Object.assign({},i),{settings:s})))})}(t,i))])})}}var Ci=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ti={key:"avatarColor",stateDefinition:{name:"avatar"}};class Fi extends ze{migrate(e){return Ci(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Ci(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.avatarColor)&&(yield e.setToUser(t,Ti,i.settings.avatarColor),null===(r=null==i?void 0:i.settings)||void 0===r||delete r.avatarColor,yield e.set(t,i))})))})}rollback(e){return Ci(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Ci(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,Ti);r&&(i||(i={}),n=!0,i.settings.avatarColor=r,yield e.setToUser(t,Ti,null)),n&&(yield e.set(t,i))})}(t,i)))})}}var Ri=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Pi={key:"emailTwoFactorTokenRecord",stateDefinition:{name:"tokenDiskLocal"}},xi={name:"token"},$i={key:"accessToken",stateDefinition:xi},Ei={key:"refreshToken",stateDefinition:xi},Ai={key:"apiKeyClientId",stateDefinition:xi},Di={key:"apiKeyClientSecret",stateDefinition:xi};class Oi extends ze{migrate(e){return Ri(this,void 0,void 0,function*(){const t=yield e.get("global"),i={},n=yield e.getAccounts();yield Promise.all([...n.map(({userId:n,account:r})=>function(t,i,n,r){return Ri(this,void 0,void 0,function*(){var s,o,a,l,c;let d=!1;const u=null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.email;null!=n&&null!=i&&null!=u&&(r[u]=n);const h=null===(o=null==i?void 0:i.tokens)||void 0===o?void 0:o.accessToken;null!=h&&("web-disk-local"!==e.type&&(yield e.setToUser(t,$i,h)),delete i.tokens.accessToken,d=!0);const p=null===(a=null==i?void 0:i.tokens)||void 0===a?void 0:a.refreshToken;null!=p&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Ei,p)),delete i.tokens.refreshToken,d=!0);const m=null===(l=null==i?void 0:i.profile)||void 0===l?void 0:l.apiKeyClientId;null!=m&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Ai,m)),delete i.profile.apiKeyClientId,d=!0);const v=null===(c=null==i?void 0:i.keys)||void 0===c?void 0:c.apiKeyClientSecret;null!=v&&("web-disk-local"!==e.type&&(yield e.setToUser(t,Di,v)),delete i.keys.apiKeyClientSecret,d=!0),d&&(yield e.set(t,i))})}(n,r,null==t?void 0:t.twoFactorToken,i))]),yield e.setToGlobal(Pi,i),null==t||delete t.twoFactorToken,yield e.set("global",t)})}rollback(e){return Ri(this,void 0,void 0,function*(){var t;const i=yield e.getAccounts();let n=null;for(const{account:r}of i){const i=null===(t=null==r?void 0:r.profile)||void 0===t?void 0:t.email;if(null==i)continue;if(n=(yield e.getFromGlobal(Pi))[i],null!=n)break}if(null!=n){let t=yield e.get("global");t||(t={}),t.twoFactorToken=n,yield e.set("global",t)}yield e.setToGlobal(Pi,null),yield Promise.all([...i.map(({userId:t,account:i})=>function(t,i){return Ri(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,$i);(null==i?void 0:i.tokens)&&null!=r&&(i.tokens.accessToken=r,n=!0),yield e.setToUser(t,$i,null);const s=yield e.getFromUser(t,Ei);(null==i?void 0:i.tokens)&&null!=s&&(i.tokens.refreshToken=s,n=!0),yield e.setToUser(t,Ei,null);const o=yield e.getFromUser(t,Ai);(null==i?void 0:i.profile)&&null!=o&&(i.profile.apiKeyClientId=o,n=!0),yield e.setToUser(t,Ai,null);const a=yield e.getFromUser(t,Di);(null==i?void 0:i.keys)&&null!=a&&(i.keys.apiKeyClientSecret=a,n=!0),yield e.setToUser(t,Di,null),n&&(yield e.set(t,i))})}(t,i))])})}}var Mi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ui={key:"accountProfile",stateDefinition:{name:"billing"}};class Gi extends ze{migrate(e){return Mi(this,void 0,void 0,function*(){const t=yield e.getAccounts(),i=(t,i)=>Mi(this,void 0,void 0,function*(){var n,r,s,o;const a=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.hasPremiumPersonally,l=null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.hasPremiumFromOrganization;null==a&&null==l||(yield e.setToUser(t,Ui,{hasPremiumPersonally:a,hasPremiumFromOrganization:l}),null===(s=null==i?void 0:i.profile)||void 0===s||delete s.hasPremiumPersonally,null===(o=null==i?void 0:i.profile)||void 0===o||delete o.hasPremiumFromOrganization,yield e.set(t,i))});yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}rollback(e){return Mi(this,void 0,void 0,function*(){const t=yield e.getAccounts(),i=(t,i)=>Mi(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Ui);i&&r&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{hasPremiumPersonally:null==r?void 0:r.hasPremiumPersonally,hasPremiumFromOrganization:null==r?void 0:r.hasPremiumFromOrganization}),yield e.set(t,i)),yield e.setToUser(t,Ui,null)});yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}}var ji=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ni extends ze{migrate(e){return ji(this,void 0,void 0,function*(){const t=yield e.getAccounts();Promise.all(t.map(({userId:t,account:i})=>function(t,i){return ji(this,void 0,void 0,function*(){var n;if(null!=(null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.everBeenUnlocked))return delete i.profile.everBeenUnlocked,e.set(t,i)})}(t,i)))})}rollback(e){throw Be}updateVersion(e,t){return ji(this,void 0,void 0,function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))})}}var Vi,Bi,zi,Li,Ki=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e[e.Invited=0]="Invited",e[e.Accepted=1]="Accepted",e[e.Confirmed=2]="Confirmed",e[e.Revoked=-1]="Revoked"}(Vi||(Vi={})),function(e){e[e.Owner=0]="Owner",e[e.Admin=1]="Admin",e[e.User=2]="User",e[e.Manager=3]="Manager",e[e.Custom=4]="Custom"}(Bi||(Bi={})),function(e){e[e.Msp=0]="Msp",e[e.Reseller=1]="Reseller"}(zi||(zi={})),function(e){e[e.Free=0]="Free",e[e.Families=1]="Families",e[e.Teams=2]="Teams",e[e.Enterprise=3]="Enterprise",e[e.TeamsStarter=4]="TeamsStarter"}(Li||(Li={}));const qi={key:"organizations",stateDefinition:{name:"organizations"}};class _i extends ze{migrate(e){return Ki(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Ki(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.organizations;null!=r&&(yield e.setToUser(t,qi,r),delete i.data.organizations,yield e.set(t,i))})}(t,i)))})}rollback(e){return Ki(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Ki(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,qi);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{organizations:r}),yield e.set(t,i)),yield e.setToUser(t,qi,null)})}(t,i)))})}}var Xi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Yi={stateDefinition:{name:"eventCollection"},key:"eventCollection"};class Hi extends ze{migrate(e){return Xi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Xi(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.eventCollection;null!=r&&(yield e.setToUser(t,Yi,r),delete i.data.eventCollection,yield e.set(t,i))})}(t,i))])})}rollback(e){return Xi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Xi(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Yi);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{eventCollection:r}),yield e.set(t,i)),yield e.setToUser(t,Yi,null)})}(t,i))])})}}var Wi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ji={stateDefinition:{name:"domainSettings"},key:"showFavicons"};class Zi extends ze{migrate(e){return Wi(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.disableFavicon)&&(yield e.setToGlobal(Ji,!t.disableFavicon),delete t.disableFavicon,yield e.set("global",t))})}rollback(e){return Wi(this,void 0,void 0,function*(){const t=(yield e.get("global"))||{},i=yield e.getFromGlobal(Ji);null!=i&&(yield e.set("global",Object.assign(Object.assign({},t),{disableFavicon:!i})),yield e.setToGlobal(Ji,null))})}}var Qi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const en={key:"autoConfirmFingerPrints",stateDefinition:{name:"organizationManagementPreferences"}};class tn extends ze{migrate(e){return Qi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(t=>Qi(this,[t],void 0,function*({userId:t,account:i}){var n,r;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.autoConfirmFingerPrints)&&(yield e.setToUser(t,en,i.settings.autoConfirmFingerPrints),null===(r=null==i?void 0:i.settings)||void 0===r||delete r.autoConfirmFingerPrints,yield e.set(t,i))})))})}rollback(e){return Qi(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Qi(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,en);r&&(i||(i={}),n=!0,i.settings.autoConfirmFingerPrints=r,yield e.setToUser(t,en,null)),n&&(yield e.set(t,i))})}(t,i)))})}}var nn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const rn={key:"decryptionOptions",stateDefinition:{name:"userDecryptionOptions"}};class sn extends ze{migrate(e){return nn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return nn(this,void 0,void 0,function*(){const n=null==i?void 0:i.decryptionOptions;null!=n&&(yield e.setToUser(t,rn,n),delete i.decryptionOptions,yield e.set(t,i))})}(t,i))])})}rollback(e){return nn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return nn(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,rn);i&&(i.decryptionOptions=Object.assign(i.decryptionOptions,n),yield e.set(t,i)),yield e.setToUser(t,rn,null)})}(t,i))])})}}var on=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const an={name:"environment"},ln={key:"region",stateDefinition:an},cn={key:"urls",stateDefinition:an},dn={key:"environment",stateDefinition:an};class un extends ze{migrate(e){return on(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return on(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,ln),n=yield e.getFromUser(t,cn);null==i&&null==n||(yield e.setToUser(t,dn,{region:i,urls:n}),yield e.removeFromUser(t,ln),yield e.removeFromUser(t,cn))})}(t))]);const i=yield e.getFromGlobal(ln),n=yield e.getFromGlobal(cn);null==i&&null==n||(yield e.setToGlobal(dn,{region:i,urls:n}),yield e.removeFromGlobal(ln),yield e.removeFromGlobal(cn))})}rollback(e){return on(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return on(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,dn);yield e.setToUser(t,ln,null==i?void 0:i.region),yield e.setToUser(t,cn,null==i?void 0:i.urls),yield e.removeFromUser(t,dn)})}(t))]);const i=yield e.getFromGlobal(dn);yield e.setToGlobal(ln,null==i?void 0:i.region),yield e.setToGlobal(cn,null==i?void 0:i.urls),yield e.removeFromGlobal(dn)})}}var hn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const pn={key:"promptCancelled",stateDefinition:{name:"biometricSettings"}};class mn extends ze{migrate(e){return hn(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>hn(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,pn)&&(yield e.removeFromUser(t,pn))})))})}rollback(e){return hn(this,void 0,void 0,function*(){throw Be})}}var vn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const fn={name:"desktopSettings"},gn={key:"window",stateDefinition:fn},yn={key:"closeToTray",stateDefinition:fn},bn={key:"minimizeToTray",stateDefinition:fn},wn={key:"startToTray",stateDefinition:fn},Sn={key:"trayEnabled",stateDefinition:fn},In={key:"openAtLogin",stateDefinition:fn},kn={key:"alwaysShowDock",stateDefinition:fn},Cn={key:"alwaysOnTop",stateDefinition:fn};class Tn extends ze{migrate(e){return vn(this,void 0,void 0,function*(){const t=yield e.get("global");let i=!1;void 0!==(null==t?void 0:t.window)&&(yield e.setToGlobal(gn,t.window),i=!0,delete t.window),null!=(null==t?void 0:t.enableCloseToTray)&&(yield e.setToGlobal(yn,t.enableCloseToTray),i=!0,delete t.enableCloseToTray),null!=(null==t?void 0:t.enableMinimizeToTray)&&(yield e.setToGlobal(bn,t.enableMinimizeToTray),i=!0,delete t.enableMinimizeToTray),null!=(null==t?void 0:t.enableStartToTray)&&(yield e.setToGlobal(wn,t.enableStartToTray),i=!0,delete t.enableStartToTray),null!=(null==t?void 0:t.enableTray)&&(yield e.setToGlobal(Sn,t.enableTray),i=!0,delete t.enableTray),null!=(null==t?void 0:t.openAtLogin)&&(yield e.setToGlobal(In,t.openAtLogin),i=!0,delete t.openAtLogin),null!=(null==t?void 0:t.alwaysShowDock)&&(yield e.setToGlobal(kn,t.alwaysShowDock),i=!0,delete t.alwaysShowDock),null!=(null==t?void 0:t.enableAlwaysOnTop)&&(yield e.setToGlobal(Cn,t.enableAlwaysOnTop),i=!0,delete t.enableAlwaysOnTop),i&&(yield e.set("global",t));const n=yield e.getAccounts();yield Promise.all(n.map(({userId:t,account:i})=>function(t,i){return vn(this,void 0,void 0,function*(){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.enableAlwaysOnTop)&&(delete i.settings.enableAlwaysOnTop,yield e.set(t,i))})}(t,i)))})}rollback(e){throw Be}}var Fn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Rn={key:"enableDuckDuckGoBrowserIntegration",stateDefinition:{name:"autofillSettings"}};class Pn extends ze{migrate(e){return Fn(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.enableDuckDuckGoBrowserIntegration)&&(yield e.setToGlobal(Rn,t.enableDuckDuckGoBrowserIntegration),delete t.enableDuckDuckGoBrowserIntegration,yield e.set("global",t))})}rollback(e){return Fn(this,void 0,void 0,function*(){var t;const i=yield e.getFromGlobal(Rn);if(!i)return;const n=null!==(t=yield e.get("global"))&&void 0!==t?t:{};n.enableDuckDuckGoBrowserIntegration=i,yield e.set("global",n),yield e.removeFromGlobal(Rn)})}}var xn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const $n={stateDefinition:{name:"config"},key:"serverConfig"};class En extends ze{migrate(e){return xn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return xn(this,void 0,void 0,function*(){var n;null!=(null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.serverConfig)&&(yield e.setToUser(t,$n,i.settings.serverConfig),delete i.settings.serverConfig,yield e.set(t,i))})}(t,i))])})}rollback(e){return xn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return xn(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,$n);r&&(null!=i||(i={}),null!==(n=i.settings)&&void 0!==n||(i.settings={}),i.settings.serverConfig=r,yield e.setToUser(t,$n,null),yield e.set(t,i))})}(t,i))])})}}var An=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Dn extends ze{migrate(e){return An(this,void 0,void 0,function*(){const t=yield e.getAccounts();Promise.all(t.map(({userId:t,account:i})=>function(t,i){return An(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===r?void 0:r.encrypted;if(null==s)return;const o={};Object.entries(s).forEach(([e,t])=>{o[e]={type:"organization",key:t}}),i.keys.organizationKeys.encrypted=o,yield e.set(t,i)})}(t,i)))})}rollback(e){return An(this,void 0,void 0,function*(){const t=yield e.getAccounts();Promise.all(t.map(t=>An(this,[t],void 0,function*({userId:t,account:i}){return function(t,i){return An(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.organizationKeys)||void 0===r?void 0:r.encrypted;if(null==s)return;const o={};Object.entries(s).forEach(([e,t])=>{o[e]=t.key}),i.keys.organizationKeys.encrypted=o,yield e.set(t,i)})}(t,i)})))})}updateVersion(e,t){return An(this,void 0,void 0,function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))})}}var On=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Mn={key:"usesKeyConnector",stateDefinition:{name:"keyConnector"}},Un={key:"convertAccountToKeyConnector",stateDefinition:{name:"keyConnector"}};class Gn extends ze{migrate(e){return On(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return On(this,void 0,void 0,function*(){var n,r;const s=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.usesKeyConnector,o=null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.convertAccountToKeyConnector;null==s&&null==o||(null!=s&&(yield e.setToUser(t,Mn,s),delete i.profile.usesKeyConnector),null!=o&&(yield e.setToUser(t,Un,o),delete i.profile.convertAccountToKeyConnector),yield e.set(t,i))})}(t,i))])})}rollback(e){return On(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return On(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,Mn),r=yield e.getFromUser(t,Un);null==n&&null==r||(null!=n&&(i.profile.usesKeyConnector=n,yield e.setToUser(t,Mn,null)),null!=r&&(i.profile.convertAccountToKeyConnector=r,yield e.setToUser(t,Un,null)),yield e.set(t,i))})}(t,i))])})}}var jn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Nn={key:"storedEmail",stateDefinition:{name:"loginEmail"}};class Vn extends ze{migrate(e){return jn(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.rememberedEmail)&&(yield e.setToGlobal(Nn,t.rememberedEmail)),null==t||delete t.rememberedEmail,yield e.set("global",t)})}rollback(e){return jn(this,void 0,void 0,function*(){let t=yield e.get("global"),i=!1;const n=yield e.getFromGlobal(Nn);n&&(t||(t={}),i=!0,t.rememberedEmail=n,yield e.setToGlobal(Nn,null)),i&&(yield e.set("global",t))})}}var Bn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class zn extends ze{migrate(e){return Bn(this,void 0,void 0,function*(){const t=yield e.get("global");null!=(null==t?void 0:t.installedVersion)&&(delete t.installedVersion,yield e.set("global",t))})}rollback(e){throw Be}}var Ln=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Kn={key:"deviceKey",stateDefinition:{name:"deviceTrust"}},qn={key:"shouldTrustDevice",stateDefinition:{name:"deviceTrust"}};class _n extends ze{migrate(e){return Ln(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Ln(this,void 0,void 0,function*(){var n,r;let s=!1;const o=null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.deviceKey;null!=o&&(yield e.setToUser(t,Kn,o),delete i.keys.deviceKey,s=!0);const a=null===(r=null==i?void 0:i.settings)||void 0===r?void 0:r.trustDeviceChoiceForDecryption;null!=a&&(yield e.setToUser(t,qn,a),delete i.settings.trustDeviceChoiceForDecryption,s=!0),s&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return Ln(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Ln(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,Kn);(null==i?void 0:i.keys)&&null!=n&&(i.keys.deviceKey=n,yield e.set(t,i)),yield e.setToUser(t,Kn,null);const r=yield e.getFromUser(t,qn);(null==i?void 0:i.settings)&&null!=r&&(i.settings.trustDeviceChoiceForDecryption=r,yield e.set(t,i)),yield e.setToUser(t,qn,null)})}(t,i))])})}}var Xn,Yn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e[e.Text=0]="Text",e[e.File=1]="File"}(Xn||(Xn={}));const Hn={stateDefinition:{name:"send"},key:"sends"};class Wn extends ze{migrate(e){return Yn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Yn(this,void 0,void 0,function*(){var n,r;const s=null===(r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.sends)||void 0===r?void 0:r.encrypted;null!=s&&(yield e.setToUser(t,Hn,s),delete i.data.sends,yield e.set(t,i))})}(t,i))])})}rollback(e){return Yn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Yn(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,Hn);i&&(i.data=Object.assign(null!==(n=i.data)&&void 0!==n?n:{},{sends:{encrypted:r}}),yield e.set(t,i)),yield e.setToUser(t,Hn,null)})}(t,i))])})}}var Jn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Zn={key:"forceSetPasswordReason",stateDefinition:{name:"masterPassword"}},Qn={key:"masterKeyHash",stateDefinition:{name:"masterPassword"}},er={key:"masterKeyEncryptedUserKey",stateDefinition:{name:"masterPassword"}};class tr extends ze{migrate(e){return Jn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Jn(this,void 0,void 0,function*(){var n,r,s;const o=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.forceSetPasswordReason;null!=o&&(yield e.setToUser(t,Zn,o),delete i.profile.forceSetPasswordReason,yield e.set(t,i));const a=null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.keyHash;null!=a&&(yield e.setToUser(t,Qn,a),delete i.profile.keyHash,yield e.set(t,i));const l=null===(s=null==i?void 0:i.keys)||void 0===s?void 0:s.masterKeyEncryptedUserKey;null!=l&&(yield e.setToUser(t,er,l),delete i.keys.masterKeyEncryptedUserKey,yield e.set(t,i))})}(t,i))])})}rollback(e){return Jn(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Jn(this,void 0,void 0,function*(){var n,r,s;const o=yield e.getFromUser(t,Zn),a=yield e.getFromUser(t,Qn),l=yield e.getFromUser(t,er);null!=i&&(null!=o&&(i.profile=Object.assign(null!==(n=i.profile)&&void 0!==n?n:{},{forceSetPasswordReason:o})),null!=a&&(i.profile=Object.assign(null!==(r=i.profile)&&void 0!==r?r:{},{keyHash:a})),null!=l&&(i.keys=Object.assign(null!==(s=i.keys)&&void 0!==s?s:{},{masterKeyEncryptedUserKey:l})),yield e.set(t,i)),yield e.setToUser(t,Zn,null),yield e.setToUser(t,Qn,null)})}(t,i))])})}}var ir=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const nr={stateDefinition:{name:"authRequestLocal"},key:"adminAuthRequest"},rr={stateDefinition:{name:"authRequestLocal"},key:"acceptAuthRequests"};class sr extends ze{migrate(e){return ir(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ir(this,void 0,void 0,function*(){var n;let r=!1;const s=null==i?void 0:i.adminAuthRequest;null!=s&&(yield e.setToUser(t,nr,s),delete i.adminAuthRequest,r=!0);const o=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.approveLoginRequests;null!=o&&(yield e.setToUser(t,rr,o),delete i.settings.approveLoginRequests,r=!0),r&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return ir(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return ir(this,void 0,void 0,function*(){var n;let r=!1;const s=yield e.getFromUser(t,nr);null!=s&&(i.adminAuthRequest=s,r=!0),yield e.setToUser(t,nr,null);const o=yield e.getFromUser(t,rr);null!=o&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{approveLoginRequests:o}),r=!0),yield e.setToUser(t,rr,null),r&&(yield e.set(t,i))})}(t,i))])})}}var or=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ar={key:"localData",stateDefinition:{name:"ciphersLocal"}},lr={key:"ciphers",stateDefinition:{name:"ciphers"}};class cr extends ze{migrate(e){return or(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return or(this,void 0,void 0,function*(){var n,r,s;let o=!1;const a=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.localData;null!=a&&(yield e.setToUser(t,ar,a),delete i.data.localData,o=!0);const l=null===(s=null===(r=null==i?void 0:i.data)||void 0===r?void 0:r.ciphers)||void 0===s?void 0:s.encrypted;null!=l&&(yield e.setToUser(t,lr,l),delete i.data.ciphers,o=!0),o&&(yield e.set(t,i))})}(t,i))])})}rollback(e){return or(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return or(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,ar);i.data&&null!=r&&(i.data.localData=r,yield e.set(t,i)),yield e.setToUser(t,ar,null);const s=yield e.getFromUser(t,lr);i.data&&null!=s&&((n=i.data).ciphers||(n.ciphers={encrypted:null}),i.data.ciphers.encrypted=s,yield e.set(t,i)),yield e.setToUser(t,lr,null)})}(t,i))])})}}var dr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ur={key:"refreshTokenMigratedToSecureStorage",stateDefinition:{name:"token"}};class hr extends ze{migrate(e){return dr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return dr(this,void 0,void 0,function*(){null!=(yield e.getFromUser(t,ur))&&(yield e.removeFromUser(t,ur))})}(t))])})}rollback(e){return dr(this,void 0,void 0,function*(){throw Be})}}var pr,mr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e[e.PBKDF2_SHA256=0]="PBKDF2_SHA256",e[e.Argon2id=1]="Argon2id"}(pr||(pr={}));const vr={key:"kdfConfig",stateDefinition:{name:"kdfConfig"}};class fr extends ze{migrate(e){return mr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return mr(this,void 0,void 0,function*(){var n,r,s,o,a,l,c,d;const u={iterations:null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.kdfIterations,kdfType:null===(r=null==i?void 0:i.profile)||void 0===r?void 0:r.kdfType,memory:null===(s=null==i?void 0:i.profile)||void 0===s?void 0:s.kdfMemory,parallelism:null===(o=null==i?void 0:i.profile)||void 0===o?void 0:o.kdfParallelism};null!=u&&(yield e.setToUser(t,vr,u),null===(a=null==i?void 0:i.profile)||void 0===a||delete a.kdfIterations,null===(l=null==i?void 0:i.profile)||void 0===l||delete l.kdfType,null===(c=null==i?void 0:i.profile)||void 0===c||delete c.kdfMemory,null===(d=null==i?void 0:i.profile)||void 0===d||delete d.kdfParallelism),yield e.set(t,i)})}(t,i))])})}rollback(e){return mr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return mr(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,vr);null!=n&&(i.profile.kdfIterations=n.iterations,i.profile.kdfType=n.kdfType,i.profile.kdfMemory=n.memory,i.profile.kdfParallelism=n.parallelism,yield e.setToUser(t,vr,null)),yield e.set(t,i)})}(t,i))])})}}var gr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class yr extends ze{migrate(e){return gr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return gr(this,void 0,void 0,function*(){var n;(null===(n=null==i?void 0:i.keys)||void 0===n?void 0:n.legacyEtmKey)&&(delete i.keys.legacyEtmKey,yield e.set(t,i))})}(t,i)))})}rollback(e){return gr(this,void 0,void 0,function*(){throw Be})}updateVersion(e,t){return gr(this,void 0,void 0,function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))})}}var br=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const wr={stateDefinition:{name:"account"},key:"accounts"},Sr={stateDefinition:{name:"account"},key:"activeAccountId"},Ir={stateDefinition:{name:"account"},key:"activity"};class kr extends ze{migrate(e){return br(this,void 0,void 0,function*(){yield this.migrateAuthenticatedAccounts(e),yield this.migrateActiveAccountId(e),yield this.migrateAccountActivity(e)})}rollback(e){return br(this,void 0,void 0,function*(){var t;const i=null!==(t=yield e.getKnownUserIds())&&void 0!==t?t:[];yield e.set("authenticatedAccounts",i),yield e.removeFromGlobal(wr);const n=yield e.getFromGlobal(Sr);n&&(yield e.set("activeUserId",n)),yield e.removeFromGlobal(Sr);const r=yield e.getFromGlobal(Ir);if(r){const t=Object.entries(r).reduce((e,[t,i])=>(e[t]=new Date(i).getTime(),e),{});yield e.set("accountActivity",t)}yield e.removeFromGlobal(Ir)})}migrateAuthenticatedAccounts(e){return br(this,void 0,void 0,function*(){var t;const i=null!==(t=yield e.get("authenticatedAccounts"))&&void 0!==t?t:[],n=(yield Promise.all(i.map(t=>br(this,void 0,void 0,function*(){const i=yield e.get(t);return{userId:t,account:i}})))).reduce((e,{userId:t,account:i})=>{var n,r;return(null==i?void 0:i.profile)&&(e[t]={email:null!==(n=i.profile.email)&&void 0!==n?n:"",emailVerified:null!==(r=i.profile.emailVerified)&&void 0!==r&&r,name:i.profile.name}),e},{});yield e.setToGlobal(wr,n),yield e.remove("authenticatedAccounts")})}migrateAccountActivity(e){return br(this,void 0,void 0,function*(){const t=yield e.get("accountActivity"),i=Object.entries(null!=t?t:{}).reduce((e,[t,i])=>(e[t]=JSON.stringify(new Date(i)),e),{});yield e.setToGlobal(Ir,i),yield e.remove("accountActivity")})}migrateActiveAccountId(e){return br(this,void 0,void 0,function*(){const t=yield e.get("activeUserId");yield e.setToGlobal(Sr,t),yield e.remove("activeUserId")})}}var Cr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Tr={name:"pinUnlock"},Fr={stateDefinition:Tr,key:"pinKeyEncryptedUserKeyPersistent"},Rr={stateDefinition:Tr,key:"userKeyEncryptedPin"},Pr={stateDefinition:Tr,key:"oldPinKeyEncryptedMasterKey"};class xr extends ze{migrate(e){return Cr(this,void 0,void 0,function*(){const t=yield e.getAccounts();let i=!1;yield Promise.all([...t.map(({userId:t,account:n})=>function(t,n){return Cr(this,void 0,void 0,function*(){var r,s,o,a;null!=(null===(r=null==n?void 0:n.settings)||void 0===r?void 0:r.pinKeyEncryptedUserKey)&&(yield e.setToUser(t,Fr,n.settings.pinKeyEncryptedUserKey),delete n.settings.pinKeyEncryptedUserKey,i=!0),null!=(null===(s=null==n?void 0:n.settings)||void 0===s?void 0:s.protectedPin)&&(yield e.setToUser(t,Rr,n.settings.protectedPin),delete n.settings.protectedPin,i=!0),null!=(null===(a=null===(o=null==n?void 0:n.settings)||void 0===o?void 0:o.pinProtected)||void 0===a?void 0:a.encrypted)&&(yield e.setToUser(t,Pr,n.settings.pinProtected.encrypted),delete n.settings.pinProtected,i=!0),i&&(yield e.set(t,n))})}(t,n))])})}rollback(e){return Cr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return Cr(this,void 0,void 0,function*(){var n;let r=!1;const s=yield e.getFromUser(t,Fr),o=yield e.getFromUser(t,Rr),a=yield e.getFromUser(t,Pr);i||(i={}),null!=s&&(i.settings.pinKeyEncryptedUserKey=s,yield e.setToUser(t,Fr,null),r=!0),null!=o&&(i.settings.protectedPin=o,yield e.setToUser(t,Rr,null),r=!0),null!=a&&(i.settings=Object.assign(null!==(n=i.settings)&&void 0!==n?n:{},{pinProtected:{encrypted:a}}),yield e.setToUser(t,Pr,null),r=!0),r&&(yield e.set(t,i))})}(t,i)))})}}var $r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Er={name:"vaultTimeoutSettings"},Ar={key:"vaultTimeout",stateDefinition:Er},Dr={key:"vaultTimeoutAction",stateDefinition:Er},Or={null:"never","-1":"onRestart","-2":"onLocked","-3":"onSleep","-4":"onIdle"},Mr={never:null,onRestart:-1,onLocked:-2,onSleep:-3,onIdle:-4};var Ur;!function(e){e.Web="web",e.Browser="browser",e.Desktop="desktop",e.Cli="cli"}(Ur||(Ur={}));class Gr extends ze{migrate(e){return $r(this,void 0,void 0,function*(){const t=yield e.get("global"),i=yield e.getAccounts();yield Promise.all([...i.map(({userId:t,account:i})=>function(t,i){return $r(this,void 0,void 0,function*(){var n,r,s,o;let a=!1,l=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.vaultTimeout;if(e.clientType===Ur.Cli&&void 0===l&&(l=null),void 0!==l){if(null===l||l<0){const i=Or[l];yield e.setToUser(t,Ar,i)}else yield e.setToUser(t,Ar,l);null===(r=null==i?void 0:i.settings)||void 0===r||delete r.vaultTimeout,a=!0}const c=null===(s=null==i?void 0:i.settings)||void 0===s?void 0:s.vaultTimeoutAction;null!=c&&(yield e.setToUser(t,Dr,c),null===(o=null==i?void 0:i.settings)||void 0===o||delete o.vaultTimeoutAction,a=!0),a&&(yield e.set(t,i))})}(t,i))]),null==t||delete t.vaultTimeout,null==t||delete t.vaultTimeoutAction,yield e.set("global",t),yield e.remove("global\\.vaultTimeout"),yield e.remove("global\\.vaultTimeoutAction")})}rollback(e){return $r(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return $r(this,void 0,void 0,function*(){let n=!1;const r=yield e.getFromUser(t,Ar);(null==i?void 0:i.settings)&&null!=r&&(i.settings.vaultTimeout="string"==typeof r?Mr[r]:r,n=!0),yield e.setToUser(t,Ar,null);const s=yield e.getFromUser(t,Dr);(null==i?void 0:i.settings)&&null!=s&&(i.settings.vaultTimeoutAction=s,n=!0),yield e.setToUser(t,Dr,null),n&&(yield e.set(t,i))})}(t,i))])})}}var jr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Nr={stateDefinition:{name:"generator"},key:"generatorSettings"},Vr={stateDefinition:{name:"generator"},key:"passwordGeneratorSettings"},Br={stateDefinition:{name:"generator"},key:"passphraseGeneratorSettings"};class zr extends ze{migrate(e){return jr(this,void 0,void 0,function*(){const t=yield e.getAccounts();function i(t,i){return jr(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.passwordGenerationOptions;if(r){const n=function(e){const t={length:e.length,ambiguous:e.ambiguous,uppercase:e.uppercase,minUppercase:e.minUppercase,lowercase:e.lowercase,minLowercase:e.minLowercase,number:e.number,minNumber:e.minNumber,special:e.special,minSpecial:e.minSpecial},i={type:e.type},n={numWords:e.numWords,wordSeparator:e.wordSeparator,capitalize:e.capitalize,includeNumber:e.includeNumber};return{generator:i,password:t,passphrase:n}}(r);yield function(e,t,i){return jr(this,void 0,void 0,function*(){var n;const r=null!==(n=yield e.getFromUser(t,Nr))&&void 0!==n?n:{},s=Object.assign(r,i.generator);yield Promise.all([e.setToUser(t,Nr,s),e.setToUser(t,Br,i.passphrase),e.setToUser(t,Vr,i.password)])})}(e,t,n),yield function(e,t,i){return jr(this,void 0,void 0,function*(){var n;null===(n=null==i?void 0:i.settings)||void 0===n||delete n.passwordGenerationOptions,yield e.set(t,i)})}(e,t,i)}})}yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}rollback(e){return jr(this,void 0,void 0,function*(){})}}var Lr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Kr={stateDefinition:{name:"generator"},key:"localGeneratorHistoryBuffer"};class qr extends ze{migrate(e){return Lr(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t,i){return Lr(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.data)||void 0===n?void 0:n.passwordGenerationHistory;r&&r.encrypted&&(yield e.setToUser(t,Kr,r.encrypted),delete i.data.passwordGenerationHistory,yield e.set(t,i))})}(t,i))])})}rollback(e){return Lr(this,void 0,void 0,function*(){})}}var _r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xr={stateDefinition:{name:"generator"},key:"generatorSettings"},Yr={stateDefinition:{name:"generator"},key:"catchallGeneratorSettings"},Hr={stateDefinition:{name:"generator"},key:"effUsernameGeneratorSettings"},Wr={stateDefinition:{name:"generator"},key:"subaddressGeneratorSettings"},Jr={stateDefinition:{name:"generator"},key:"addyIoBuffer"},Zr={stateDefinition:{name:"generator"},key:"duckDuckGoBuffer"},Qr={stateDefinition:{name:"generator"},key:"fastmailBuffer"},es={stateDefinition:{name:"generator"},key:"firefoxRelayBuffer"},ts={stateDefinition:{name:"generator"},key:"forwardEmailBuffer"},is={stateDefinition:{name:"generator"},key:"simpleLoginBuffer"};class ns extends ze{migrate(e){return _r(this,void 0,void 0,function*(){const t=yield e.getAccounts();function i(t,i){return _r(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.usernameGenerationOptions;if(r){const n=function(e){const t={addyIo:{baseUrl:e.forwardedAnonAddyBaseUrl,token:e.forwardedAnonAddyApiToken,domain:e.forwardedAnonAddyDomain},duckDuckGo:{token:e.forwardedDuckDuckGoToken},fastmail:{token:e.forwardedFastmailApiToken},firefoxRelay:{token:e.forwardedFirefoxApiToken},forwardEmail:{token:e.forwardedForwardEmailApiToken,domain:e.forwardedForwardEmailDomain},simpleLogin:{token:e.forwardedSimpleLoginApiKey,baseUrl:e.forwardedSimpleLoginBaseUrl}},i={username:e.type,forwarder:e.forwardedService},n={effUsername:{wordCapitalize:e.wordCapitalize,wordIncludeNumber:e.wordIncludeNumber},subaddress:{subaddressType:e.subaddressType,subaddressEmail:e.subaddressEmail},catchall:{catchallType:e.catchallType,catchallDomain:e.catchallDomain}};return{generator:i,algorithms:n,forwarders:t}}(r);yield function(e,t,i){return _r(this,void 0,void 0,function*(){yield Promise.all([e.setToUser(t,Xr,i.generator),e.setToUser(t,Yr,i.algorithms.catchall),e.setToUser(t,Hr,i.algorithms.effUsername),e.setToUser(t,Wr,i.algorithms.subaddress),e.setToUser(t,Jr,i.forwarders.addyIo),e.setToUser(t,Zr,i.forwarders.duckDuckGo),e.setToUser(t,Qr,i.forwarders.fastmail),e.setToUser(t,es,i.forwarders.firefoxRelay),e.setToUser(t,ts,i.forwarders.forwardEmail),e.setToUser(t,is,i.forwarders.simpleLogin)])})}(e,t,n),yield function(e,t,i){return _r(this,void 0,void 0,function*(){var n;null===(n=null==i?void 0:i.settings)||void 0===n||delete n.usernameGenerationOptions,yield e.set(t,i)})}(e,t,i)}})}yield Promise.all([...t.map(({userId:e,account:t})=>i(e,t))])})}rollback(e){return _r(this,void 0,void 0,function*(){})}}var rs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ss={name:"desktopSettings"},os={key:"browserIntegrationEnabled",stateDefinition:ss},as={key:"browserIntegrationFingerprintEnabled",stateDefinition:ss},ls={key:"minimizeOnCopy",stateDefinition:ss};class cs extends ze{migrate(e){return rs(this,void 0,void 0,function*(){const t=yield e.get("global"),i=null==t?void 0:t.enableBrowserIntegration,n=null==t?void 0:t.enableBrowserIntegrationFingerprint;let r=!1;null!=i&&(yield e.setToGlobal(os,i),delete t.enableBrowserIntegration,r=!0),null!=n&&(yield e.setToGlobal(as,n),delete t.enableBrowserIntegrationFingerprint,r=!0),r&&(yield e.set("global",t));const s=yield e.getAccounts();yield Promise.all(s.map(({userId:t,account:i})=>function(t,i){return rs(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.settings)||void 0===n?void 0:n.minimizeOnCopyToClipboard;null!=r&&(yield e.setToUser(t,ls,r),delete i.settings.minimizeOnCopyToClipboard,yield e.set(t,i))})}(t,i)))})}rollback(e){return rs(this,void 0,void 0,function*(){const t=yield e.getFromGlobal(os),i=yield e.getFromGlobal(as);if(null!=t){let i=yield e.get("global");null!=i||(i={}),i.enableBrowserIntegration=t,yield e.set("global",i),yield e.removeFromGlobal(os)}if(null!=i){let t=yield e.get("global");null!=t||(t={}),t.enableBrowserIntegrationFingerprint=i,yield e.set("global",t),yield e.removeFromGlobal(as)}const n=yield e.getAccounts();yield Promise.all(n.map(({userId:t,account:i})=>function(t,i){return rs(this,void 0,void 0,function*(){const n=yield e.getFromUser(t,ls);null!=n&&(null!=i||(i={settings:{}}),i.settings.minimizeOnCopyToClipboard=n,yield e.set(t,i),yield e.removeFromUser(t,ls))})}(t,i)))})}}var ds=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const us={key:"showBanner",stateDefinition:{name:"unassignedItemsBanner"}};class hs extends ze{migrate(e){return ds(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>ds(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,us)&&(yield e.removeFromUser(t,us))})))})}rollback(e){return ds(this,void 0,void 0,function*(){throw Be})}}var ps=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ms={key:"lastSync",stateDefinition:{name:"sync"}};class vs extends ze{migrate(e){return ps(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return ps(this,void 0,void 0,function*(){var n;const r=null===(n=null==i?void 0:i.profile)||void 0===n?void 0:n.lastSync;null!=r&&(yield e.setToUser(t,ms,r),delete i.profile.lastSync,yield e.set(t,i))})}(t,i)))})}rollback(e){return ps(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t,account:i})=>function(t,i){return ps(this,void 0,void 0,function*(){var n;const r=yield e.getFromUser(t,ms);null!=r&&(null!=i||(i={}),null!==(n=i.profile)&&void 0!==n||(i.profile={}),i.profile.lastSync=r,yield e.set(t,i),yield e.removeFromUser(t,ms))})}(t,i)))})}}var fs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const gs={key:"folder",stateDefinition:{name:"folder"}},ys={key:"folders",stateDefinition:{name:"folder"}};class bs extends ze{migrate(e){return fs(this,void 0,void 0,function*(){const t=yield e.getKnownUserIds();yield Promise.all(t.map(t=>function(t){return fs(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,gs);null!=i&&(yield e.setToUser(t,ys,i)),yield e.removeFromUser(t,gs)})}(t)))})}rollback(e){return fs(this,void 0,void 0,function*(){const t=yield e.getKnownUserIds();yield Promise.all(t.map(t=>function(t){return fs(this,void 0,void 0,function*(){const i=yield e.getFromUser(t,ys);null!=i&&(yield e.setToUser(t,gs,i)),yield e.removeFromUser(t,ys)})}(t)))})}}var ws=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ss extends ze{migrate(e){return ws(this,void 0,void 0,function*(){var t;const i=yield e.get("global"),n=null!==(t=null==i?void 0:i.noAutoPromptBiometrics)&&void 0!==t&&t,r=yield e.getAccounts();delete i.noAutoPromptBiometrics,yield Promise.all([...r.map(({userId:t,account:i})=>function(t,i){return ws(this,void 0,void 0,function*(){var r;null!=i&&n&&(i.settings=Object.assign(null!==(r=null==i?void 0:i.settings)&&void 0!==r?r:{},{disableAutoBiometricsPrompt:!0}),yield e.set(t,i))})}(t,i)),e.set("global",i)])})}rollback(e){return ws(this,void 0,void 0,function*(){throw Be})}updateVersion(e,t){return ws(this,void 0,void 0,function*(){const i="up"===t?this.toVersion:this.fromVersion;e.currentVersion=i;const n=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},n),{stateVersion:i}))})}}var Is=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ks={key:"acBannersDismissed",stateDefinition:{name:"showProviderClientVaultPrivacyBanner"}};class Cs extends ze{migrate(e){return Is(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>Is(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,ks)&&(yield e.removeFromUser(t,ks))})))})}rollback(e){return Is(this,void 0,void 0,function*(){throw Be})}}var Ts=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Fs={key:"newCustomizationOptionsCalloutDismissed",stateDefinition:{name:"bannersDismissed"}};class Rs extends ze{migrate(e){return Ts(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>Ts(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,Fs)&&(yield e.removeFromUser(t,Fs))})))})}rollback(e){return Ts(this,void 0,void 0,function*(){throw Be})}}var Ps=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const xs={key:"showAccountDeprovisioningBanner",stateDefinition:{name:"accountDeprovisioningBanner"}};class $s extends ze{migrate(e){return Ps(this,void 0,void 0,function*(){yield Promise.all((yield e.getAccounts()).map(t=>Ps(this,[t],void 0,function*({userId:t}){null!=e.getFromUser(t,xs)&&(yield e.removeFromUser(t,xs))})))})}rollback(e){return Ps(this,void 0,void 0,function*(){throw Be})}}var Es=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const As={stateDefinition:{name:"account"},key:"accounts"},Ds={key:"masterPasswordUnlockKey",stateDefinition:{name:"masterPasswordUnlock"}},Os={key:"masterKeyEncryptedUserKey",stateDefinition:{name:"masterPassword"}},Ms={key:"kdfConfig",stateDefinition:{name:"kdfConfig"}};class Us extends ze{migrate(e){return Es(this,void 0,void 0,function*(){const t=yield e.getFromGlobal(As),i=yield e.getAccounts();yield Promise.all(i.map(({userId:i})=>function(t,i){return Es(this,void 0,void 0,function*(){const n=null==i?void 0:i.email,r=yield e.getFromUser(t,Ms),s=yield e.getFromUser(t,Os);null==(yield e.getFromUser(t,Ds))&&null!=n&&null!=r&&null!=s&&(yield e.setToUser(t,Ds,{salt:n.trim().toLowerCase(),kdf:r,masterKeyWrappedUserKey:s}))})}(i,t[i])))})}rollback(e){return Es(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all(t.map(({userId:t})=>function(t){return Es(this,void 0,void 0,function*(){null!=(yield e.getFromUser(t,Ds))&&(yield e.removeFromUser(t,Ds))})}(t)))})}}var Gs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const js={key:"pinKeyEncryptedUserKeyPersistent",stateDefinition:{name:"pinUnlock"}};class Ns extends ze{migrate(e){return Gs(this,void 0,void 0,function*(){const t=yield e.getAccounts();yield Promise.all([...t.map(({userId:t,account:i})=>function(t){return Gs(this,void 0,void 0,function*(){null!=(yield e.getFromUser(t,js))&&(yield e.removeFromUser(t,js))})}(t))])})}rollback(e){return Gs(this,void 0,void 0,function*(){throw Be})}}var Vs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Bs extends ze{migrate(e){return Vs(this,void 0,void 0,function*(){const t=yield e.get("global");if(!t.stateVersion)throw new Error("Migration failed, state version not found");yield e.set("stateVersion",t.stateVersion),delete t.stateVersion,yield e.set("global",t)})}rollback(e){return Vs(this,void 0,void 0,function*(){const t=yield e.get("stateVersion"),i=yield e.get("global");yield e.set("global",Object.assign(Object.assign({},i),{stateVersion:t})),yield e.set("stateVersion",void 0)})}updateVersion(e,t){return Vs(this,void 0,void 0,function*(){const i="up"===t?this.toVersion:this.fromVersion;if(e.currentVersion=i,"up"===t)yield e.set("stateVersion",i);else{const t=(yield e.get("global"))||{};yield e.set("global",Object.assign(Object.assign({},t),{stateVersion:i}))}})}}var zs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ls extends ze{tryAddSetting(e,t,i){if(e.some(({account:e})=>void 0!==t(e))){const n=!e.some(({account:e})=>{var i;return!1===(null!==(i=t(e))&&void 0!==i&&i)});i(n)}}migrate(e){return zs(this,void 0,void 0,function*(){const t=yield e.get("global"),i=yield e.getAccounts(),n=i.reduce((e,{account:t})=>{var i,n;const r=null!==(n=null===(i=t.settings)||void 0===i?void 0:i.neverDomains)&&void 0!==n?n:{};for(const[s,o]of Object.entries(r))null!=e||(e={}),e[s]=o;return e},void 0),r={};null!=n&&(r.neverDomains=n),this.tryAddSetting(i,e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableAddLoginNotification},e=>r.disableAddLoginNotification=e),this.tryAddSetting(i,e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableChangedPasswordNotification},e=>r.disableChangedPasswordNotification=e),this.tryAddSetting(i,e=>{var t;return null===(t=e.settings)||void 0===t?void 0:t.disableContextMenuItem},e=>r.disableContextMenuItem=e),yield e.set("global",Object.assign(Object.assign({},t),r)),yield Promise.all(i.map(t=>zs(this,[t],void 0,function*({userId:t,account:i}){var n,r,s,o;null===(n=i.settings)||void 0===n||delete n.disableAddLoginNotification,null===(r=i.settings)||void 0===r||delete r.disableChangedPasswordNotification,null===(s=i.settings)||void 0===s||delete s.disableContextMenuItem,null===(o=i.settings)||void 0===o||delete o.neverDomains,yield e.set(t,i)})))})}rollback(e){throw new Error("Method not implemented.")}}var Ks=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qs extends ze{constructor(){super(0,Xs)}shouldMigrate(e){return Promise.resolve(e.currentVersion<Xs)}migrate(e){return Ks(this,void 0,void 0,function*(){if(e.currentVersion<Xs)throw new Error(`Your local data is too old to be migrated. Your current state version is ${e.currentVersion}, but minimum version is ${Xs}.`)})}rollback(e){return Ks(this,void 0,void 0,function*(){throw Be})}}var _s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xs=3,Ys=74;function Hs(){return Ne.create().with(qs).with(Ni,3,4).with(Dn,4,5).with(yr,5,6).with(Ss,6,7).with(Bs,7,8).with(Ls,8,9).with(qe,9,10).with(Ye,10,11).with(Qe,11,12).with(it,12,13).with(st,13,14).with(lt,14,15).with(ut,15,16).with(mt,16,17).with(gt,17,18).with(wt,18,19).with(kt,19,20).with(Ft,20,21).with(xt,21,22).with(Dt,22,23).with(Ut,23,24).with(Nt,24,25).with(zt,25,26).with(qt,26,27).with(Yt,27,28).with(Wt,28,29).with(ei,29,30).with(ni,30,31).with(oi,31,32).with(hi,32,33).with(gi,33,34).with(wi,34,35).with(ki,35,36).with(Fi,36,37).with(Oi,37,38).with(Gi,38,39).with(_i,39,40).with(Hi,40,41).with(Zi,41,42).with(tn,42,43).with(sn,43,44).with(un,44,45).with(mn,45,46).with(Tn,46,47).with(Pn,47,48).with(En,48,49).with(Gn,49,50).with(Vn,50,51).with(zn,51,52).with(_n,52,53).with(Wn,53,54).with(tr,54,55).with(sr,55,56).with(cr,56,57).with(hr,57,58).with(fr,58,59).with(kr,59,60).with(xr,60,61).with(Gr,61,62).with(zr,62,63).with(qr,63,64).with(ns,64,65).with(cs,65,66).with(hs,66,67).with(vs,67,68).with(bs,68,69).with(Cs,69,70).with(Rs,70,71).with($s,71,72).with(Us,72,73).with(Ns,73,Ys)}function Ws(e,t){return _s(this,void 0,void 0,function*(){var i;let n=yield e.get("stateVersion");return null==n&&(n=null===(i=yield e.get("global"))||void 0===i?void 0:i.stateVersion),null==n?(t.info("No state version found, assuming empty state."),-1):(t.info(`State version: ${n}`),n)})}function Js(e,t){return _s(this,void 0,void 0,function*(){const i=()=>_s(this,void 0,void 0,function*(){return(yield Ws(e,t))>=Ys}),n=e=>_s(this,void 0,void 0,function*(){const r=2*e;if(!(r>8192))return new Promise(s=>{setTimeout(()=>_s(this,void 0,void 0,function*(){(yield i())||(t.info(`Waiting for migrations to finish, waiting for ${r}ms`),yield n(r)),s()}),e)})});(yield i())||(yield n(2))})}var Zs=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Qs{constructor(e,t,i,n,r){this.currentVersion=e,this.storageService=t,this.logService=i,this.clientType=r,this.type=n}get(e){return this.storageService.get(e)}set(e,t){return this.logService.info(`Setting ${e}`),this.storageService.save(e,t)}remove(e){return this.logService.info(`Removing ${e}`),this.storageService.remove(e)}getFromGlobal(e){return this.get(this.getGlobalKey(e))}setToGlobal(e,t){return this.set(this.getGlobalKey(e),t)}removeFromGlobal(e){return this.remove(this.getGlobalKey(e))}getFromUser(e,t){return this.get(this.getUserKey(e,t))}setToUser(e,t,i){return this.set(this.getUserKey(e,t),i)}removeFromUser(e,t){return this.remove(this.getUserKey(e,t))}info(e){this.logService.info(e)}getAccounts(){return Zs(this,void 0,void 0,function*(){const e=yield this.getKnownUserIds();return Promise.all(e.map(e=>Zs(this,void 0,void 0,function*(){return{userId:e,account:yield this.get(e)}})))})}getKnownUserIds(){return Zs(this,void 0,void 0,function*(){return this.currentVersion<60?function(e){return Zs(this,void 0,void 0,function*(){var t;return null!==(t=yield e.get("authenticatedAccounts"))&&void 0!==t?t:[]})}(this.storageService):function(e){return Zs(this,void 0,void 0,function*(){const t=yield e.get(eo({stateDefinition:{name:"account"},key:"accounts"}));return Object.keys(null!=t?t:{})})}(this.storageService)})}getUserKey(e,t){return this.currentVersion<9?function(){throw Error("No key builder should be used for versions prior to 9.")}():function(e,t){return`user_${e}_${t.stateDefinition.name}_${t.key}`}(e,t)}getGlobalKey(e){return this.currentVersion<9?function(){throw Error("No key builder should be used for versions prior to 9.")}():eo(e)}}function eo(e){return`global_${e.stateDefinition.name}_${e.key}`}class to{}},91975:(e,t,i)=>{"use strict";i.d(t,{t:()=>r});var n=i(33812);class r{transform(e,t){var i;return null===(i=null==t?void 0:t.find(t=>t.id===e))||void 0===i?void 0:i.name}}r.ɵfac=function(e){return new(e||r)},r.ɵpipe=n.EJ8({name:"orgNameFromId",type:r,pure:!0,standalone:!1})},92411:(e,t,i)=>{"use strict";i.d(t,{J:()=>n});class n{}},92697:(e,t,i)=>{"use strict";i.d(t,{E:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},93103:(e,t,i)=>{"use strict";i.d(t,{Y:()=>r});var n=i(33812);class r{onClick(e){e.preventDefault()}}r.ɵfac=function(e){return new(e||r)},r.ɵdir=n.FsC({type:r,selectors:[["","appStopClick",""]],hostBindings:function(e,t){1&e&&n.bIt("click",function(e){return t.onClick(e)})},standalone:!1})},93173:(e,t,i)=>{"use strict";i.d(t,{Bz:()=>V,$5:()=>p,jx:()=>I,dR:()=>E,Bh:()=>U,df:()=>J,ep:()=>Q,Cp:()=>N,mH:()=>X});var n=i(34040),r=i(44500),s=i(81714),o=i(3204),a=i(72245),l=i(22485),c=i(37567),d=i(91968),u=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class h{constructor(e,t,i){this.keyDefinition=e,this.activeUserId$=t,this.singleUserStateProvider=i,this.combinedState$=this.activeUserId$.pipe((0,r.n)(e=>null!=e?this.singleUserStateProvider.get(e,this.keyDefinition).combinedState$:s.t)),this.state$=this.combinedState$.pipe((0,o.T)(([e,t])=>t))}update(e){return u(this,arguments,void 0,function*(e,t={}){const i=yield(0,a._)(this.activeUserId$.pipe((0,l.w)({first:1e3,with:()=>(0,c.$)(()=>new Error(`Timeout while retrieving active user for key ${this.keyDefinition.fullName}.`))})));if(null==i)throw new Error(`Error storing ${this.keyDefinition.fullName} for the active user: No active user at this time.`);return[i,yield this.singleUserStateProvider.get(i,this.keyDefinition).update(e,t)]})}}class p{constructor(e,t){this.activeAccountAccessor=e,this.singleUserStateProvider=t,this.activeUserId$=this.activeAccountAccessor.activeUserId$.pipe((0,n.F)((e,t)=>null==e||null==t?e==t:e===t))}get(e){return new h(e,this.activeUserId$,this.singleUserStateProvider)}}var m=i(66046),v=i(73276),f=i(83892),g=i(3097),y=i(72737),b=i(8029),w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class S{constructor(e,t,i){this.parentState$=e,this.deriveDefinition=t,this.dependencies=i,this.forcedValueSubject=new m.B,this.storageKey=t.storageKey;const n=this.parentState$.pipe((0,v.H)(e=>w(this,void 0,void 0,function*(){let t=this.deriveDefinition.derive(e,this.dependencies);t instanceof Promise&&(t=yield t);return t})));this.state$=(0,f.h)(this.forcedValueSubject,n).pipe((0,g.u)({connector:()=>new y.m(1),resetOnRefCountZero:()=>(0,b.O)(this.deriveDefinition.cleanupDelayMs)}))}forceValue(e){return w(this,void 0,void 0,function*(){return this.forcedValueSubject.next(e),e})}}class I{constructor(){this.cache=new WeakMap}get(e,t,i){let n=this.cache.get(e);n||(n={},this.cache.set(e,n));const r=t.buildCacheKey(),s=n[r];if(null!=s)return s;const o=this.buildDerivedState(e,t,i);return n[r]=o,o}buildDerivedState(e,t,i){return new S(e,t,i)}}var k=i(69194),C=i(43008),T=i(36359),F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function R(e,t,i){return F(this,void 0,void 0,function*(){if(t.valuesRequireDeserialization){const n=yield t.get(e);return i(n)}{const i=yield t.get(e);return null!=i?i:null}})}var P=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class x{constructor(e,t,i,n){this.key=e,this.storageService=t,this.keyDefinition=i,this.logService=n;const s=t.updates$.pipe((0,k.p)(t=>t.key===e),(0,r.n)(n=>P(this,void 0,void 0,function*(){return"remove"===n.updateType?null:yield R(e,t,i.deserializer)})));let o=(0,f.h)((0,C.v)(()=>R(e,t,i.deserializer)),s);i.debug.enableRetrievalLogging&&(o=o.pipe((0,T.M)({next:t=>{this.logService.info(`Retrieving '${e}' from storage, value is ${null==t?"null":"non-null"}`)}}))),0!==i.cleanupDelayMs&&(o=o.pipe((0,g.u)({connector:()=>new y.m(1),resetOnRefCountZero:()=>(0,b.O)(i.cleanupDelayMs)}))),this.state$=o}update(e){return P(this,arguments,void 0,function*(e,t={}){const i=function(e){const{combineLatestWith:t=null,shouldUpdate:i=()=>!0,msTimeout:n=1e3}=e;return{combineLatestWith:t,shouldUpdate:i,msTimeout:n}}(t);null!=this.updatePromise&&(yield this.updatePromise);try{return this.updatePromise=this.internalUpdate(e,i),yield this.updatePromise}finally{this.updatePromise=null}})}internalUpdate(e,t){return P(this,void 0,void 0,function*(){const i=yield this.getStateForUpdate(),n=null!=t.combineLatestWith?yield(0,a._)(t.combineLatestWith.pipe((0,l.w)(t.msTimeout))):null;if(!t.shouldUpdate(i,n))return i;const r=e(i,n);return yield this.doStorageSave(r,i),r})}doStorageSave(e,t){return P(this,void 0,void 0,function*(){this.keyDefinition.debug.enableUpdateLogging&&this.logService.info(`Updating '${this.key}' from ${null==t?"null":"non-null"} to ${null==e?"null":"non-null"}`),yield this.storageService.save(this.key,e)})}getStateForUpdate(){return P(this,void 0,void 0,function*(){return yield R(this.key,this.storageService,this.keyDefinition.deserializer)})}}class $ extends x{constructor(e,t,i){super(function(e){return`global_${e.stateDefinition.name}_${e.key}`}(e),t,e,i)}}class E{constructor(e,t){this.storageServiceProvider=e,this.logService=t,this.globalStateCache={}}get(e){const[t,i]=this.storageServiceProvider.get(e.stateDefinition.defaultStorageLocation,e.stateDefinition.storageLocationOverrides),n=this.buildCacheKey(t,e),r=this.globalStateCache[n];if(null!=r)return r;const s=new $(e,i,this.logService);return this.globalStateCache[n]=s,s}buildCacheKey(e,t){return`${e}_${t.fullName}`}}var A=i(33338),D=i(93695),O=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class M extends x{constructor(e,t,i,n,r){super(t.buildKey(e),i,t,r),this.userId=e,this.stateEventRegistrarService=n,this.combinedState$=(0,A.z)([(0,D.of)(e),this.state$])}doStorageSave(e,t){const i=Object.create(null,{doStorageSave:{get:()=>super.doStorageSave}});return O(this,void 0,void 0,function*(){yield i.doStorageSave.call(this,e,t),yield this.stateEventRegistrarService.registerEvents(this.keyDefinition)})}}class U{constructor(e,t,i){this.storageServiceProvider=e,this.stateEventRegistrarService=t,this.logService=i,this.cache={}}get(e,t){const[i,n]=this.storageServiceProvider.get(t.stateDefinition.defaultStorageLocation,t.stateDefinition.storageLocationOverrides),r=this.buildCacheKey(i,e,t),s=this.cache[r];if(null!=s)return s;const o=new M(e,t,n,this.stateEventRegistrarService,this.logService);return this.cache[r]=o,o}buildCacheKey(e,t,i){return`${e}_${i.fullName}_${t}`}}var G=i(58363),j=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class N{constructor(e,t,i,n){this.activeUserStateProvider=e,this.singleUserStateProvider=t,this.globalStateProvider=i,this.derivedStateProvider=n,this.getActive=this.activeUserStateProvider.get.bind(this.activeUserStateProvider),this.getUser=this.singleUserStateProvider.get.bind(this.singleUserStateProvider),this.getGlobal=this.globalStateProvider.get.bind(this.globalStateProvider),this.getDerived=this.derivedStateProvider.get.bind(this.derivedStateProvider),this.activeUserId$=this.activeUserStateProvider.activeUserId$}getUserState$(e,t){return t?this.getUser(t,e).state$:this.activeUserId$.pipe((0,k.p)(e=>null!=e),(0,G.s)(1),(0,r.n)(t=>this.getUser(t,e).state$))}getUserStateOrDefault$(e,t){const{userId:i,defaultValue:n=null}=t;return i?this.getUser(i,e).state$:this.activeUserId$.pipe((0,G.s)(1),(0,r.n)(t=>null!=t?this.getUser(t,e).state$:(0,D.of)(n)))}setUserState(e,t,i){return j(this,void 0,void 0,function*(){return i?[i,yield this.getUser(i,e).update(()=>t)]:yield this.getActive(e).update(()=>t)})}}class V{}class B{}var z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const L="global",K="_user_auto",q="_user_biometric",_="DuckDuckGoSharedKey";class X{constructor(e,t,i){this.storageService=e,this.secureStorageService=t,this.activeUserAccessor=i}clean(e){return z(this,void 0,void 0,function*(){yield this.setUserKeyAutoUnlock(null,e),yield this.clearUserKeyBiometric(e.userId)})}getUserKeyAutoUnlock(e){return z(this,void 0,void 0,function*(){return null==e.userId?null:yield this.secureStorageService.get(`${e.userId}${K}`,{userId:e.userId,keySuffix:"auto"})})}setUserKeyAutoUnlock(e,t){return z(this,void 0,void 0,function*(){null!=t.userId&&(yield this.saveSecureStorageKey(K,e,t.userId,"auto"))})}clearUserKeyBiometric(e){return z(this,void 0,void 0,function*(){null!=e&&(yield this.saveSecureStorageKey(q,null,e,"biometric"))})}getDuckDuckGoSharedKey(){return z(this,void 0,void 0,function*(){return null==(yield this.getActiveUserIdFromStorage())?null:yield this.secureStorageService.get(_)})}setDuckDuckGoSharedKey(e){return z(this,void 0,void 0,function*(){null!=(yield this.getActiveUserIdFromStorage())&&(null==e?yield this.secureStorageService.remove(_):yield this.secureStorageService.save(_,e))})}setEnableDuckDuckGoBrowserIntegration(e){return z(this,void 0,void 0,function*(){var t;const i=null!==(t=yield this.storageService.get(L))&&void 0!==t?t:new B;i.enableDuckDuckGoBrowserIntegration=e,yield this.storageService.save(L,i)})}getActiveUserIdFromStorage(){return z(this,void 0,void 0,function*(){return yield(0,a._)(this.activeUserAccessor.activeUserId$)})}saveSecureStorageKey(e,t,i,n){return z(this,void 0,void 0,function*(){return null==t?yield this.secureStorageService.remove(`${i}${e}`,{keySuffix:n}):yield this.secureStorageService.save(`${i}${e}`,t,{keySuffix:n})})}}var Y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const H=d.Zs.array(d.Z9,"lock",{deserializer:e=>e}),W=d.Zs.array(d.Z9,"logout",{deserializer:e=>e});class J{constructor(e,t){this.storageServiceProvider=t,this.stateEventStateMap={lock:e.get(H),logout:e.get(W)}}registerEvents(e){return Y(this,void 0,void 0,function*(){for(const t of e.clearOn){const i=this.stateEventStateMap[t],[n]=this.storageServiceProvider.get(e.stateDefinition.defaultStorageLocation,e.stateDefinition.storageLocationOverrides),r={state:e.stateDefinition.name,key:e.key,location:n};yield i.update(e=>(null!=e||(e=[]),e.push(r),e),{shouldUpdate:e=>null==e||-1===e.findIndex(e=>e.state===r.state&&e.key===r.key&&e.location===r.location)})}})}}var Z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Q{constructor(e,t){this.storageServiceProvider=t,this.stateEventMap={lock:e.get(H),logout:e.get(W)}}handleEvent(e,t){return Z(this,void 0,void 0,function*(){let i=yield(0,a._)(this.stateEventMap[e].state$);null!=i||(i=[]);const n=[];for(const e of i)try{const[,i]=this.storageServiceProvider.get(e.location,{}),n=this.storageKeyFor(t,e);null!=(yield i.get(n))&&(yield i.remove(n))}catch(r){let t="Unknown Error";null!=r&&"object"==typeof r&&"message"in r&&"string"==typeof r.message&&(t=r.message),n.push(`${t} in ${e.state} > ${e.key} located ${e.location}`)}if(n.length>0)throw new Error(`One or more errors occurred while handling event '${e}' for user ${t}.\n${n.join("\n")}`)})}storageKeyFor(e,t){return new d.Ok(new d.zU(t.state,t.location),t.key,{deserializer:e=>e,clearOn:[]}).buildKey(e)}}},93175:(e,t,i)=>{"use strict";i.d(t,{W:()=>n});class n{}},93199:(e,t,i)=>{"use strict";i.d(t,{I:()=>s});var n=i(33812);let r=0;class s{constructor(){this.id="bit-hint-"+r++}}s.ɵfac=function(e){return new(e||s)},s.ɵdir=n.FsC({type:s,selectors:[["bit-hint"]],hostAttrs:[1,"tw-text-muted","tw-font-normal","tw-inline-block","tw-mt-1","tw-text-xs"],hostVars:1,hostBindings:function(e,t){2&e&&n.Avn("id",t.id)}})},93241:(e,t,i)=>{"use strict";i.d(t,{d8:()=>n.d,xM:()=>g,H8:()=>ze,XF:()=>c,_l:()=>qe,uU:()=>We,L7:()=>Ze,$c:()=>et,bj:()=>l,FQ:()=>He,pi:()=>x,DS:()=>r,CL:()=>$e,sg:()=>o.s,aJ:()=>d,k4:()=>u,F2:()=>v,pS:()=>f,GX:()=>De,Ym:()=>a,Gz:()=>y,iD:()=>tt});var n=i(77312);class r{}var s,o=i(65802);class a{}class l extends a{}class c{}class d{}class u{}!function(e){e[e.Password=0]="Password",e[e.Sso=1]="Sso",e[e.UserApiKey=2]="UserApiKey",e[e.AuthRequest=3]="AuthRequest",e[e.WebAuthn=4]="WebAuthn"}(s||(s={}));var h=i(68881),p=i(97883),m=i(43890);class v{constructor(e,t,i,n){this.email=e,this.masterPassword=t,this.twoFactor=i,this.masterPasswordPoliciesFromOrgInvite=n,this.type=s.Password}}class f{constructor(e,t,i,n,r,o){this.code=e,this.codeVerifier=t,this.redirectUrl=i,this.orgId=n,this.email=r,this.twoFactor=o,this.type=s.Sso}}class g{constructor(e,t,i,n,r,o,a){this.email=e,this.accessCode=t,this.authRequestId=i,this.decryptedUserKey=n,this.decryptedMasterKey=r,this.decryptedMasterKeyHash=o,this.twoFactor=a,this.type=s.AuthRequest}static fromJSON(e){return Object.assign(new g(e.email,e.accessCode,e.authRequestId,null,null,e.decryptedMasterKeyHash,e.twoFactor?new h.i(e.twoFactor.provider,e.twoFactor.token,e.twoFactor.remember):e.twoFactor),{decryptedUserKey:m.e.fromJSON(e.decryptedUserKey),decryptedMasterKey:m.e.fromJSON(e.decryptedMasterKey)})}}class y{constructor(e,t,i){this.token=e,this.deviceResponse=t,this.prfKey=i,this.type=s.WebAuthn}static fromJSON(e){return new y(e.token,Object.assign(Object.create(p.c.prototype),e.deviceResponse),m.e.fromJSON(e.prfKey))}}class b{static fromResponse(e){var t;if(null==e)return;const i=new b;return i.keyConnectorUrl=null!==(t=null==e?void 0:e.keyConnectorUrl)&&void 0!==t?t:null,i}static fromJSON(e){if(null!=e)return Object.assign(new b,e)}}class w{static fromResponse(e){var t,i,n,r;if(null==e)return;const s=new w;return s.hasAdminApproval=null!==(t=null==e?void 0:e.hasAdminApproval)&&void 0!==t&&t,s.hasLoginApprovingDevice=null!==(i=null==e?void 0:e.hasLoginApprovingDevice)&&void 0!==i&&i,s.hasManageResetPasswordPermission=null!==(n=null==e?void 0:e.hasManageResetPasswordPermission)&&void 0!==n&&n,s.isTdeOffboarding=null!==(r=null==e?void 0:e.isTdeOffboarding)&&void 0!==r&&r,s}static fromJSON(e){if(null!=e)return Object.assign(new w,e)}}class S{static fromIdentityTokenResponse(e){if(null==e)throw new Error("User Decryption Options are required for client initialization. Response is nullish.");const t=new S;if(!e.userDecryptionOptions)throw new Error("User Decryption Options are required for client initialization. userDecryptionOptions is missing in response.");{const i=e.userDecryptionOptions;t.hasMasterPassword=i.hasMasterPassword,t.trustedDeviceOption=w.fromResponse(i.trustedDeviceOption),t.keyConnectorOption=b.fromResponse(i.keyConnectorOption)}return t}static fromJSON(e){const t=Object.assign(new S,e);return t.trustedDeviceOption=w.fromJSON(null==e?void 0:e.trustedDeviceOption),t.keyConnectorOption=b.fromJSON(null==e?void 0:e.keyConnectorOption),t}}var I=i(44500),k=i(72245),C=i(84110),T=i(31857),F=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const R=new T.Zs(T.jB,"loginEmail",{deserializer:e=>e}),P=new T.Zs(T.d1,"storedEmail",{deserializer:e=>e});class x{constructor(e,t,i){this.accountService=e,this.authService=t,this.stateProvider=i,this.loginEmailState=this.stateProvider.getGlobal(R),this.storedEmailState=this.stateProvider.getGlobal(P),this.addingAccount$=this.authService.authStatuses$.pipe((0,I.n)(e=>F(this,void 0,void 0,function*(){const t=yield(0,k._)(this.accountService.activeAccount$);return t&&delete e[t.id],Object.values(e).some(e=>e!==C.J.LoggedOut)}))),this.loginEmail$=this.loginEmailState.state$,this.rememberedEmail$=this.storedEmailState.state$.pipe((0,I.n)(e=>F(this,void 0,void 0,function*(){return(yield(0,k._)(this.addingAccount$))?null:e})))}setLoginEmail(e){return F(this,void 0,void 0,function*(){yield this.loginEmailState.update(t=>e)})}clearLoginEmail(){return F(this,void 0,void 0,function*(){yield this.loginEmailState.update(e=>null)})}setRememberedEmailChoice(e,t){return F(this,void 0,void 0,function*(){t?yield this.storedEmailState.update(t=>e):yield this.storedEmailState.update(e=>null)})}clearRememberedEmail(){return F(this,void 0,void 0,function*(){yield this.storedEmailState.update(e=>null)})}}var $=i(16878),E=i(34040),A=i(80909),D=i(27442),O=i(3204),M=i(82468);class U{constructor(e){this.email=e}}var G=i(7861),j=i(9249),N=i(22848),V=i(9997),B=i(6912);class z extends B.D{constructor(e,t,i,n,r){super(i,n),this.email=e,this.masterPasswordHash=t,this.twoFactor=i,this.newDeviceOtp=r}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="password",t.username=this.email,t.password=this.masterPasswordHash,this.newDeviceOtp&&(t.newDeviceOtp=this.newDeviceOtp),t}static fromJSON(e){return Object.assign(Object.create(z.prototype),e,{device:e.device?V.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new h.i,e.twoFactor):void 0})}}var L=i(69194),K=i(22485),q=i(71804),_=i(78781);class X{constructor(){this.resetMasterPassword=!1,this.twoFactorProviders=null}get requiresTwoFactor(){return null!=this.twoFactorProviders}get requiresSso(){return!_.A.isNullOrWhitespace(this.ssoOrganizationIdentifier)}}var Y=i(81441),H=i(78107),W=i(27790),J=i(65861),Z=i(82489),Q=i(48541),ee=i(68467),te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ie{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g){this.accountService=e,this.masterPasswordService=t,this.keyService=i,this.encryptService=n,this.apiService=r,this.tokenService=s,this.appIdService=o,this.platformUtilsService=a,this.messagingService=l,this.logService=c,this.stateService=d,this.twoFactorService=u,this.userDecryptionOptionsService=h,this.billingAccountProfileStateService=p,this.vaultTimeoutSettingsService=m,this.KdfConfigService=v,this.environmentService=f,this.configService=g,this.sessionTimeoutSubject=new $.t(!1),this.sessionTimeout$=this.sessionTimeoutSubject.asObservable()}logInTwoFactor(e){return te(this,void 0,void 0,function*(){var t;const i=this.cache.value;if(!i.tokenRequest)throw new Error("Token request is undefined");i.tokenRequest.setTwoFactor(e),this.cache.next(i);const[n]=yield this.startLogIn();return n.masterPassword=null!==(t=this.cache.value.masterPassword)&&void 0!==t?t:null,n})}startLogIn(){return te(this,void 0,void 0,function*(){yield this.twoFactorService.clearSelectedProvider();const e=this.cache.value.tokenRequest;if(!e)throw new Error("Token request is undefined");const t=yield this.apiService.postIdentityToken(e);if(t instanceof Z.x)return[yield this.processTwoFactorResponse(t),t];if(t instanceof J.L)return[yield this.processTokenResponse(t),t];if(t instanceof H.H)return[yield this.processDeviceVerificationResponse(t),t];if(t instanceof W.u)return[yield this.processSsoRequiredResponse(t),t];throw new Error("Invalid response object.")})}buildDeviceRequest(){return te(this,void 0,void 0,function*(){const e=yield this.appIdService.getAppId();return new V.C(e,this.platformUtilsService)})}buildTwoFactor(e,t){return te(this,void 0,void 0,function*(){if(null!=e)return e;if(t){const e=yield this.tokenService.getTwoFactorToken(t);if(null!=e)return new h.i(q.R.Remember,e,!1)}return new h.i})}saveAccountInformation(e){return te(this,void 0,void 0,function*(){var t,i,n,r;const s=yield this.tokenService.decodeAccessToken(e.accessToken),o=s.sub;if(yield this.accountService.addAccount(o,{name:s.name,email:null!==(t=s.email)&&void 0!==t?t:"",emailVerified:null!==(i=s.email_verified)&&void 0!==i&&i,creationDate:void 0}),yield this.environmentService.seedUserEnvironment(o),yield this.accountService.switchAccount(o),yield this.verifyAccountAdded(o),yield this.userDecryptionOptionsService.setUserDecryptionOptionsById(o,S.fromIdentityTokenResponse(e)),null!=(null===(n=e.userDecryptionOptions)||void 0===n?void 0:n.masterPasswordUnlock)){const t=e.userDecryptionOptions.masterPasswordUnlock.toMasterPasswordUnlockData();yield this.masterPasswordService.setMasterPasswordUnlockData(t,o)}const a=yield(0,k._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(o)),l=yield(0,k._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(o));return yield this.tokenService.setTokens(e.accessToken,a,l,e.refreshToken),yield this.KdfConfigService.setKdfConfig(o,e.kdfConfig),yield this.billingAccountProfileStateService.setHasPremium(null!==(r=s.premium)&&void 0!==r&&r,!1,o),o})}processTokenResponse(e){return te(this,void 0,void 0,function*(){var t;const i=new X;if(this.encryptionKeyMigrationRequired(e))return i.requiresEncryptionKeyMigration=!0,i;const n=yield this.saveAccountInformation(e);if(i.userId=n,i.resetMasterPassword=e.resetMasterPassword,null!=e.twoFactorToken){const t=yield this.tokenService.getEmail();yield this.tokenService.setTwoFactorToken(t,e.twoFactorToken)}return yield this.setMasterKey(e,n),yield this.setUserKey(e,n),yield this.setPrivateKey(e,n),yield this.processForceSetPasswordReason(e.forcePasswordReset,n),this.messagingService.send("loggedIn"),i.masterPassword=null!==(t=this.cache.value.masterPassword)&&void 0!==t?t:null,i})}encryptionKeyMigrationRequired(e){return!1}processForceSetPasswordReason(e,t){return te(this,void 0,void 0,function*(){return!!e&&(yield this.masterPasswordService.setForceSetPasswordReason(Y.n.AdminForcePasswordReset,t),!0)})}createKeyPairForOldAccount(e){return te(this,void 0,void 0,function*(){try{const t=yield(0,k._)(this.keyService.userKey$(e));if(null===t)throw new Error("User key is null when creating key pair for old account");if(t.inner().type==ee.Qd.CoseEncrypt0)throw new Error("Cannot create key pair for account on V2 encryption");const[i,n]=yield this.keyService.makeKeyPair(t);if(!n.encryptedString)throw new Error("Failed to create encrypted private key");return yield this.apiService.postAccountKeys(new Q.G(i,n.encryptedString)),n.encryptedString}catch(t){this.logService.error(t)}})}processTwoFactorResponse(e){return te(this,void 0,void 0,function*(){var t;yield this.clearTwoFactorToken();const i=new X;return i.twoFactorProviders=e.twoFactorProviders2,yield this.twoFactorService.setProviders(e),i.ssoEmail2FaSessionToken=e.ssoEmail2faSessionToken,i.email=null!==(t=e.email)&&void 0!==t?t:"",i})}clearTwoFactorToken(){return te(this,void 0,void 0,function*(){const e=this.cache.value.userEnteredEmail;e&&(yield this.tokenService.clearTwoFactorToken(e))})}verifyAccountAdded(e){return te(this,void 0,void 0,function*(){yield(0,k._)(this.accountService.activeAccount$.pipe((0,L.p)(t=>(null==t?void 0:t.id)===e),(0,K.w)({first:1e3,with:()=>{throw new Error("Expected user never made active user after initialization.")}})))})}processDeviceVerificationResponse(e){return te(this,void 0,void 0,function*(){const e=new X;return e.requiresDeviceVerification=!0,e})}processSsoRequiredResponse(e){return te(this,void 0,void 0,function*(){const t=new X;return t.ssoOrganizationIdentifier=e.ssoOrganizationIdentifier,t})}}var ne=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class re{static fromJSON(e){return Object.assign(new re,e,{tokenRequest:z.fromJSON(e.tokenRequest),authRequestCredentials:g.fromJSON(e.authRequestCredentials)})}}class se extends ie{constructor(e,t,...i){super(...i),this.deviceTrustService=t,this.cache=new $.t(e),this.email$=this.cache.pipe((0,O.T)(e=>e.tokenRequest.email)),this.accessCode$=this.cache.pipe((0,O.T)(e=>e.authRequestCredentials.accessCode)),this.authRequestId$=this.cache.pipe((0,O.T)(e=>e.authRequestCredentials.authRequestId))}logIn(e){return ne(this,void 0,void 0,function*(){const t=new re;t.tokenRequest=new z(e.email,e.accessCode,yield this.buildTwoFactor(e.twoFactor,e.email),yield this.buildDeviceRequest()),t.tokenRequest.setAuthRequestAccessCode(e.authRequestId),t.authRequestCredentials=e,this.cache.next(t);const[i]=yield this.startLogIn();return i})}logInTwoFactor(e){const t=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return ne(this,void 0,void 0,function*(){const i=this.cache.value;return this.cache.next(i),t.logInTwoFactor.call(this,e)})}setMasterKey(e,t){return ne(this,void 0,void 0,function*(){const e=this.cache.value.authRequestCredentials;e.decryptedMasterKey&&e.decryptedMasterKeyHash&&(yield this.masterPasswordService.setMasterKey(e.decryptedMasterKey,t),yield this.masterPasswordService.setMasterKeyHash(e.decryptedMasterKeyHash,t))})}setUserKey(e,t){return ne(this,void 0,void 0,function*(){const i=this.cache.value.authRequestCredentials;e.key&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,t)),i.decryptedUserKey?yield this.keyService.setUserKey(i.decryptedUserKey,t):(yield this.trySetUserKeyWithMasterKey(t),yield this.deviceTrustService.trustDeviceIfRequired(t))})}trySetUserKeyWithMasterKey(e){return ne(this,void 0,void 0,function*(){const t=yield(0,k._)(this.masterPasswordService.masterKey$(e));if(t){const i=yield this.masterPasswordService.decryptUserKeyWithMasterKey(t,e);yield this.keyService.setUserKey(i,e)}})}setPrivateKey(e,t){return ne(this,void 0,void 0,function*(){var i;yield this.keyService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)})}exportCache(){return{authRequest:this.cache.value}}}var oe=i(46217),ae=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class le{constructor(){this.forcePasswordResetReason=Y.n.None}static fromJSON(e){return Object.assign(new le,e,{tokenRequest:z.fromJSON(e.tokenRequest),masterKey:m.e.fromJSON(e.masterKey)})}}class ce extends ie{constructor(e,t,i,n,...r){super(...r),this.passwordStrengthService=t,this.policyService=i,this.loginStrategyService=n,this.cache=new $.t(e),this.email$=this.cache.pipe((0,O.T)(e=>e.tokenRequest.email)),this.serverMasterKeyHash$=this.cache.pipe((0,O.T)(e=>e.tokenRequest.masterPasswordHash)),this.localMasterKeyHash$=this.cache.pipe((0,O.T)(e=>e.localMasterKeyHash))}logIn(e){return ae(this,void 0,void 0,function*(){const{email:t,masterPassword:i,twoFactor:n}=e,r=new le;r.masterKey=yield this.loginStrategyService.makePasswordPreLoginMasterKey(i,t),r.masterPassword=i,r.userEnteredEmail=t,r.localMasterKeyHash=yield this.keyService.hashMasterKey(i,r.masterKey,ee.VK.LocalAuthorization);const s=yield this.keyService.hashMasterKey(i,r.masterKey);r.tokenRequest=new z(t,s,yield this.buildTwoFactor(n,t),yield this.buildDeviceRequest()),this.cache.next(r);const[o,a]=yield this.startLogIn();return yield this.evaluateMasterPasswordIfRequired(a,e,o),o})}logInTwoFactor(e){const t=Object.create(null,{logInTwoFactor:{get:()=>super.logInTwoFactor}});return ae(this,void 0,void 0,function*(){return yield t.logInTwoFactor.call(this,e)})}setMasterKey(e,t){return ae(this,void 0,void 0,function*(){const{masterKey:e,localMasterKeyHash:i}=this.cache.value;yield this.masterPasswordService.setMasterKey(e,t),yield this.masterPasswordService.setMasterKeyHash(i,t)})}setUserKey(e,t){return ae(this,void 0,void 0,function*(){if(this.encryptionKeyMigrationRequired(e))return;e.key&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,t));const i=yield(0,k._)(this.masterPasswordService.masterKey$(t));if(i){const e=yield this.masterPasswordService.decryptUserKeyWithMasterKey(i,t);yield this.keyService.setUserKey(e,t)}})}setPrivateKey(e,t){return ae(this,void 0,void 0,function*(){var i;yield this.keyService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)})}encryptionKeyMigrationRequired(e){return!e.key}evaluateMasterPasswordIfRequired(e,t,i){return ae(this,void 0,void 0,function*(){if(e instanceof H.H||e instanceof W.u)return;const n=this.policyService.combineMasterPasswordPolicyOptions(t.masterPasswordPoliciesFromOrgInvite,this.getMasterPasswordPolicyOptionsFromResponse(e));if(!t.masterPasswordPoliciesFromOrgInvite&&!(null==n?void 0:n.enforceOnLogin))return;this.evaluateMasterPassword(t,n)||(e instanceof Z.x?this.cache.next(Object.assign(Object.assign({},this.cache.value),{forcePasswordResetReason:Y.n.WeakMasterPassword})):yield this.masterPasswordService.setForceSetPasswordReason(Y.n.WeakMasterPassword,i.userId))})}getMasterPasswordPolicyOptionsFromResponse(e){return null==e?null:oe.U.fromResponse(e.masterPasswordPolicy)}evaluateMasterPassword({masterPassword:e,email:t},i){var n;const r=null===(n=this.passwordStrengthService.getPasswordStrength(e,t))||void 0===n?void 0:n.score;return this.policyService.evaluateMasterPassword(r,e,i)}exportCache(){return{password:this.cache.value}}logInNewDeviceVerification(e){return ae(this,void 0,void 0,function*(){var t;const i=this.cache.value;i.tokenRequest.newDeviceOtp=e,this.cache.next(i);const[n]=yield this.startLogIn();return n.masterPassword=null!==(t=this.cache.value.masterPassword)&&void 0!==t?t:null,n})}processForceSetPasswordReason(e,t){const i=Object.create(null,{processForceSetPasswordReason:{get:()=>super.processForceSetPasswordReason}});return ae(this,void 0,void 0,function*(){if(yield i.processForceSetPasswordReason.call(this,e,t))return!1;const n=this.cache.value.forcePasswordResetReason;return n!==Y.n.None&&(yield this.masterPasswordService.setForceSetPasswordReason(n,t),!0)})}}class de extends B.D{constructor(e,t,i,n,r){super(n,r),this.code=e,this.codeVerifier=t,this.redirectUri=i,this.twoFactor=n}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="authorization_code",t.code=this.code,t.code_verifier=this.codeVerifier,t.redirect_uri=this.redirectUri,t}static fromJSON(e){return Object.assign(Object.create(de.prototype),e,{device:e.device?V.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new h.i,e.twoFactor):void 0})}}var ue=i(11573),he=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class pe{static fromJSON(e){return Object.assign(new pe,e,{tokenRequest:de.fromJSON(e.tokenRequest)})}}class me extends ie{constructor(e,t,i,n,r,...s){super(...s),this.keyConnectorService=t,this.deviceTrustService=i,this.authRequestService=n,this.i18nService=r,this.cache=new $.t(e),this.email$=this.cache.pipe((0,O.T)(e=>e.email)),this.orgId$=this.cache.pipe((0,O.T)(e=>e.orgId)),this.ssoEmail2FaSessionToken$=this.cache.pipe((0,O.T)(e=>e.ssoEmail2FaSessionToken))}logIn(e){return he(this,void 0,void 0,function*(){const t=new pe;t.orgId=e.orgId,t.userEnteredEmail=e.email;const i=yield this.buildDeviceRequest();this.logService.info("Logging in with appId %s.",i.identifier),t.tokenRequest=new de(e.code,e.codeVerifier,e.redirectUrl,yield this.buildTwoFactor(e.twoFactor,e.email),i),this.cache.next(t);const[n]=yield this.startLogIn(),r=n.email,s=n.ssoEmail2FaSessionToken;return this.cache.next(Object.assign(Object.assign({},this.cache.value),{email:r,ssoEmail2FaSessionToken:s})),n})}setMasterKey(e,t){return he(this,void 0,void 0,function*(){if(this.shouldSetMasterKeyFromKeyConnector(e)){if(null==e.key)yield this.keyConnectorService.setNewSsoUserKeyConnectorConversionData({kdfConfig:e.kdfConfig,keyConnectorUrl:this.getKeyConnectorUrl(e),organizationId:this.cache.value.orgId},t);else{const i=this.getKeyConnectorUrl(e);yield this.keyConnectorService.setMasterKeyFromUrl(i,t)}}})}shouldSetMasterKeyFromKeyConnector(e){var t;const i=null==e?void 0:e.userDecryptionOptions;if(null!=i){const e=i.hasMasterPassword;return null!=(null===(t=i.keyConnectorOption)||void 0===t?void 0:t.keyConnectorUrl)&&!e}}getKeyConnectorUrl(e){var t;const i=null==e?void 0:e.userDecryptionOptions;return null===(t=null==i?void 0:i.keyConnectorOption)||void 0===t?void 0:t.keyConnectorUrl}setUserKey(e,t){return he(this,void 0,void 0,function*(){const i=e.key;i&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(i,t));const n=null==e?void 0:e.userDecryptionOptions;if(null==n?void 0:n.trustedDeviceOption){this.logService.info("Attempting to set user key with approved admin auth request."),yield this.trySetUserKeyWithApprovedAdminRequestIfExists(t);(yield this.keyService.hasUserKey(t))||(this.logService.info("Attempting to set user key with device key."),yield this.trySetUserKeyWithDeviceKey(e,t))}else null!=i&&null!=this.getKeyConnectorUrl(e)&&(yield this.trySetUserKeyWithMasterKey(t))})}trySetUserKeyWithApprovedAdminRequestIfExists(e){return he(this,void 0,void 0,function*(){const t=yield this.authRequestService.getAdminAuthRequest(e);if(!t)return;let i;try{i=yield this.apiService.getAuthRequest(t.id)}catch(n){return void(n instanceof G._&&n.statusCode===ue.kG.NotFound&&(yield this.authRequestService.clearAdminAuthRequest(e)))}(null==i?void 0:i.requestApproved)&&(i.masterPasswordHash?yield this.authRequestService.setKeysAfterDecryptingSharedMasterKeyAndHash(i,t.privateKey,e):yield this.authRequestService.setUserKeyAfterDecryptingSharedUserKey(i,t.privateKey,e),(yield this.keyService.hasUserKey(e))&&(yield this.deviceTrustService.trustDeviceIfRequired(e),yield this.authRequestService.clearAdminAuthRequest(e),this.authRequestService.emitAdminLoginApproved()))})}trySetUserKeyWithDeviceKey(e,t){return he(this,void 0,void 0,function*(){var i;const n=null===(i=e.userDecryptionOptions)||void 0===i?void 0:i.trustedDeviceOption;if(!n)return void this.logService.error("Unable to set user key due to missing trustedDeviceOption.");const r=yield this.deviceTrustService.getDeviceKey(t),s=null==n?void 0:n.encryptedPrivateKey,o=null==n?void 0:n.encryptedUserKey;if(!r||!s||!o)return r?s&&o||(yield this.deviceTrustService.recordDeviceTrustLoss()):this.logService.warning("Unable to set user key due to missing device key."),s||this.logService.warning("Unable to set user key due to missing encrypted device private key."),void(o||this.logService.warning("Unable to set user key due to missing encrypted user key."));const a=yield this.deviceTrustService.decryptUserKeyWithDeviceKey(t,s,o,r);a&&(yield this.keyService.setUserKey(a,t))})}trySetUserKeyWithMasterKey(e){return he(this,void 0,void 0,function*(){const t=yield(0,k._)(this.masterPasswordService.masterKey$(e));if(!t)return;const i=yield this.masterPasswordService.decryptUserKeyWithMasterKey(t,e);yield this.keyService.setUserKey(i,e)})}setPrivateKey(e,t){return he(this,void 0,void 0,function*(){var i;e.hasMasterKeyEncryptedUserKey()?yield this.keyService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t):e.privateKey&&(yield this.keyService.setPrivateKey(e.privateKey,t))})}exportCache(){return{sso:this.cache.value}}processForceSetPasswordReason(e,t){const i=Object.create(null,{processForceSetPasswordReason:{get:()=>super.processForceSetPasswordReason}});return he(this,void 0,void 0,function*(){var n,r,s,o;if(yield i.processForceSetPasswordReason.call(this,e,t))return!1;const a=yield(0,k._)(this.userDecryptionOptionsService.userDecryptionOptionsById$(t));if(!a)return!1;if(null===(n=a.trustedDeviceOption)||void 0===n?void 0:n.isTdeOffboarding)return yield this.masterPasswordService.setForceSetPasswordReason(Y.n.TdeOffboarding,t),!0;const l=yield(0,k._)(this.keyService.userEncryptedPrivateKey$(t)),c=yield this.keyService.hasUserKey(t);return a.trustedDeviceOption||a.hasMasterPassword||(null===(r=a.keyConnectorOption)||void 0===r?void 0:r.keyConnectorUrl)||!l||c?!a.hasMasterPassword&&(null===(s=a.trustedDeviceOption)||void 0===s?void 0:s.hasManageResetPasswordPermission)?(yield this.masterPasswordService.setForceSetPasswordReason(Y.n.TdeUserWithoutPasswordHasPasswordResetPermission,t),!0):!(a.hasMasterPassword||(null===(o=a.keyConnectorOption)||void 0===o?void 0:o.keyConnectorUrl)||a.trustedDeviceOption)&&(yield this.masterPasswordService.setForceSetPasswordReason(Y.n.SsoNewJitProvisionedUser,t),!0):(yield this.masterPasswordService.setForceSetPasswordReason(Y.n.TdeOffboardingUntrustedDevice,t),!0)})}}var ve=i(65485),fe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ge{static fromJSON(e){return Object.assign(new ge,e,{tokenRequest:ve.i.fromJSON(e.tokenRequest)})}}class ye extends ie{constructor(e,t,...i){super(...i),this.keyConnectorService=t,this.cache=new $.t(e)}logIn(e){return fe(this,void 0,void 0,function*(){const t=new ge;t.tokenRequest=new ve.i(e.clientId,e.clientSecret,yield this.buildTwoFactor(),yield this.buildDeviceRequest()),this.cache.next(t);const[i]=yield this.startLogIn();return i})}setMasterKey(e,t){return fe(this,void 0,void 0,function*(){if(e.apiUseKeyConnector){const e=(yield(0,k._)(this.environmentService.environment$)).getKeyConnectorUrl();yield this.keyConnectorService.setMasterKeyFromUrl(e,t)}})}setUserKey(e,t){return fe(this,void 0,void 0,function*(){if(e.key&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(e.key,t)),e.apiUseKeyConnector){const e=yield(0,k._)(this.masterPasswordService.masterKey$(t));if(e){const i=yield this.masterPasswordService.decryptUserKeyWithMasterKey(e,t);yield this.keyService.setUserKey(i,t)}}})}setPrivateKey(e,t){return fe(this,void 0,void 0,function*(){var i;yield this.keyService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)})}saveAccountInformation(e){const t=Object.create(null,{saveAccountInformation:{get:()=>super.saveAccountInformation}});return fe(this,void 0,void 0,function*(){const i=yield t.saveAccountInformation.call(this,e),n=yield(0,k._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(i)),r=yield(0,k._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(i)),s=this.cache.value.tokenRequest;return yield this.tokenService.setClientId(s.clientId,n,r),yield this.tokenService.setClientSecret(s.clientSecret,n,r),i})}exportCache(){return{userApiKey:this.cache.value}}}class be extends B.D{constructor(e,t,i){super(void 0,i),this.token=e,this.deviceResponse=t}toIdentityToken(e){const t=super.toIdentityToken(e);return t.grant_type="webauthn",t.token=this.token,t.deviceResponse=JSON.stringify(this.deviceResponse),t}static fromJSON(e){return Object.assign(Object.create(be.prototype),e,{deviceResponse:p.c.fromJSON(e.deviceResponse),device:e.device?V.C.fromJSON(e.device):void 0,twoFactor:e.twoFactor?Object.assign(new h.i,e.twoFactor):void 0})}}var we=i(39306),Se=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ie{static fromJSON(e){return Object.assign(new Ie,e,{tokenRequest:be.fromJSON(e.tokenRequest),credentials:y.fromJSON(e.credentials)})}}class ke extends ie{constructor(e,...t){super(...t),this.cache=new $.t(e)}logIn(e){return Se(this,void 0,void 0,function*(){const t=new Ie;t.credentials=e,t.tokenRequest=new be(e.token,e.deviceResponse,yield this.buildDeviceRequest()),this.cache.next(t);const[i]=yield this.startLogIn();return i})}logInTwoFactor(){return Se(this,void 0,void 0,function*(){throw new Error("2FA not supported yet for WebAuthn Login.")})}setMasterKey(e,t){return Se(this,void 0,void 0,function*(){})}setUserKey(e,t){return Se(this,void 0,void 0,function*(){var i;const n=e.key;n&&(yield this.masterPasswordService.setMasterKeyEncryptedUserKey(n,t));const r=null==e?void 0:e.userDecryptionOptions;if(null==r?void 0:r.webAuthnPrfOption){const n=null===(i=e.userDecryptionOptions)||void 0===i?void 0:i.webAuthnPrfOption,r=this.cache.value.credentials;if(!r.prfKey)return;const s=yield this.encryptService.unwrapDecapsulationKey(n.encryptedPrivateKey,r.prfKey),o=yield this.encryptService.decapsulateKeyUnsigned(new we.k(n.encryptedUserKey.encryptedString),s);o&&(yield this.keyService.setUserKey(o,t))}})}setPrivateKey(e,t){return Se(this,void 0,void 0,function*(){var i;yield this.keyService.setPrivateKey(null!==(i=e.privateKey)&&void 0!==i?i:yield this.createKeyPairForOldAccount(t),t)})}exportCache(){return{webAuthn:this.cache.value}}}const Ce=new T.Zs(T.Gm,"currentLoginStrategy",{deserializer:e=>e}),Te=new T.Zs(T.Gm,"loginStrategyCacheExpiration",{deserializer:e=>e?null:new Date(e)}),Fe=new T.Zs(T.Gm,"authRequestPushNotification",{deserializer:e=>e}),Re=new T.Zs(T.Gm,"loginStrategyCache",{deserializer:e=>null==e?null:{password:e.password?le.fromJSON(e.password):void 0,sso:e.sso?pe.fromJSON(e.sso):void 0,userApiKey:e.userApiKey?ge.fromJSON(e.userApiKey):void 0,authRequest:e.authRequest?re.fromJSON(e.authRequest):void 0,webAuthn:e.webAuthn?Ie.fromJSON(e.webAuthn):void 0}});var Pe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const xe=3e5;class $e{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g,y,b,w,S,I,k,C,T){this.accountService=e,this.masterPasswordService=t,this.keyService=i,this.apiService=n,this.tokenService=r,this.appIdService=s,this.platformUtilsService=o,this.messagingService=a,this.logService=l,this.keyConnectorService=c,this.environmentService=d,this.stateService=u,this.twoFactorService=h,this.i18nService=p,this.encryptService=m,this.passwordStrengthService=v,this.policyService=f,this.deviceTrustService=g,this.authRequestService=y,this.userDecryptionOptionsService=b,this.stateProvider=w,this.billingAccountProfileStateService=S,this.vaultTimeoutSettingsService=I,this.kdfConfigService=k,this.taskSchedulerService=C,this.configService=T,this.authenticationTimeoutSubject=new $.t(!1),this.passwordPrelogin={email:null,kdfConfig:null,promise:null,version:0},this.authenticationSessionTimeout$=this.authenticationTimeoutSubject.asObservable(),this.currentAuthnTypeState=this.stateProvider.get(Ce),this.loginStrategyCacheState=this.stateProvider.get(Re),this.loginStrategyCacheExpirationState=this.stateProvider.get(Te),this.authRequestPushNotificationState=this.stateProvider.get(Fe),this.taskSchedulerService.registerTaskHandler(j.fq.loginStrategySessionTimeout,()=>Pe(this,void 0,void 0,function*(){this.authenticationTimeoutSubject.next(!0);try{yield this.clearCache()}catch(e){this.logService.error("Failed to clear cache during session timeout",e)}})),this.currentAuthType$=this.currentAuthnTypeState.state$,this.loginStrategy$=this.currentAuthnTypeState.state$.pipe((0,E.F)(),(0,A.v)(this.loginStrategyCacheState.state$),this.initializeLoginStrategy.bind(this),(0,D.t)({refCount:!0,bufferSize:1}))}getEmail(){return Pe(this,void 0,void 0,function*(){const e=yield(0,k._)(this.loginStrategy$);return e&&"email$"in e?yield(0,k._)(e.email$):null})}getMasterPasswordHash(){return Pe(this,void 0,void 0,function*(){const e=yield(0,k._)(this.loginStrategy$);return e&&"serverMasterKeyHash$"in e?yield(0,k._)(e.serverMasterKeyHash$):null})}getSsoEmail2FaSessionToken(){return Pe(this,void 0,void 0,function*(){const e=yield(0,k._)(this.loginStrategy$);return e&&"ssoEmail2FaSessionToken$"in e?yield(0,k._)(e.ssoEmail2FaSessionToken$):null})}getAccessCode(){return Pe(this,void 0,void 0,function*(){const e=yield(0,k._)(this.loginStrategy$);return e&&"accessCode$"in e?yield(0,k._)(e.accessCode$):null})}getAuthRequestId(){return Pe(this,void 0,void 0,function*(){const e=yield(0,k._)(this.loginStrategy$);return e&&"authRequestId$"in e?yield(0,k._)(e.authRequestId$):null})}logIn(e){return Pe(this,void 0,void 0,function*(){yield this.clearCache(),this.authenticationTimeoutSubject.next(!1),yield this.currentAuthnTypeState.update(t=>e.type);const t=yield(0,k._)(this.loginStrategy$),i=Object.assign({},e),n=yield null==t?void 0:t.logIn(i);if(null==n||n.requiresTwoFactor||n.requiresDeviceVerification?(yield this.loginStrategyCacheState.update(e=>{var i;return null!==(i=null==t?void 0:t.exportCache())&&void 0!==i?i:null}),yield this.startSessionTimeout()):yield this.clearCache(),!n)throw new Error("No auth result returned");return n})}logInTwoFactor(e){return Pe(this,void 0,void 0,function*(){if(!(yield this.isSessionValid()))throw new Error(this.i18nService.t("sessionTimeout"));const t=yield(0,k._)(this.loginStrategy$);if(null==t)throw new Error("No login strategy found.");try{const i=yield t.logInTwoFactor(e);return null==i||i.requiresTwoFactor||(yield this.clearCache()),i}catch(i){throw i instanceof G._||(yield this.clearCache()),i}})}logInNewDeviceVerification(e){return Pe(this,void 0,void 0,function*(){if(!(yield this.isSessionValid()))throw new Error(this.i18nService.t("sessionTimeout"));const t=yield(0,k._)(this.loginStrategy$);if(null==t)throw new Error("No login strategy found.");if(!("logInNewDeviceVerification"in t))throw new Error("Current login strategy does not support device verification.");try{const i=yield t.logInNewDeviceVerification(e);return null===i||i.requiresDeviceVerification||(yield this.clearCache()),i}catch(i){throw i instanceof G._||(yield this.clearCache()),i}})}makePasswordPreLoginMasterKey(e,t){return Pe(this,void 0,void 0,function*(){var i;if(t=t.trim().toLowerCase(),yield this.configService.getFeatureFlag(M.TO.PM23801_PrefetchPasswordPrelogin)){let i=null;if(this.passwordPrelogin.email===t)if(this.passwordPrelogin.kdfConfig)i=this.passwordPrelogin.kdfConfig;else if(null!=this.passwordPrelogin.promise){try{yield this.passwordPrelogin.promise}catch(r){this.logService.error("Failed to prefetch prelogin data, falling back to fetching now.",r)}i=this.passwordPrelogin.kdfConfig}if(!i)try{const e=yield this.apiService.postPrelogin(new U(t));i=this.buildKdfConfigFromPrelogin(e)}catch(s){if(null==s||404!==s.statusCode)throw s}if(!i)throw new Error("KDF config is required");return i.validateKdfConfigForPrelogin(),yield this.keyService.makeMasterKey(e,t,i)}let n;try{const e=yield this.apiService.postPrelogin(new U(t));n=null!==(i=this.buildKdfConfigFromPrelogin(e))&&void 0!==i?i:void 0}catch(s){if(null==s||404!==s.statusCode)throw s}if(!n)throw new Error("KDF config is required");return n.validateKdfConfigForPrelogin(),yield this.keyService.makeMasterKey(e,t,n)})}getPasswordPrelogin(e){return Pe(this,void 0,void 0,function*(){const t=e.trim().toLowerCase(),i=++this.passwordPrelogin.version;this.passwordPrelogin.email=t,this.passwordPrelogin.kdfConfig=null;const n=(()=>Pe(this,void 0,void 0,function*(){try{const e=yield this.apiService.postPrelogin(new U(t));return this.buildKdfConfigFromPrelogin(e)}catch(e){if(null==e||404!==e.statusCode)throw e;return null}}))();this.passwordPrelogin.promise=n,n.then(e=>{this.passwordPrelogin.email===t&&this.passwordPrelogin.version===i&&e&&(this.passwordPrelogin.kdfConfig=e)}).catch(()=>{}).finally(()=>{this.passwordPrelogin.email===t&&this.passwordPrelogin.version===i&&(this.passwordPrelogin.promise=null)})})}clearCache(){return Pe(this,void 0,void 0,function*(){yield this.currentAuthnTypeState.update(e=>null),yield this.loginStrategyCacheState.update(e=>null),this.authenticationTimeoutSubject.next(!1),yield this.clearSessionTimeout(),this.passwordPrelogin.version++,this.passwordPrelogin.email=null,this.passwordPrelogin.kdfConfig=null,this.passwordPrelogin.promise=null})}startSessionTimeout(){return Pe(this,void 0,void 0,function*(){yield this.clearSessionTimeout(),yield this.loginStrategyCacheExpirationState.update(e=>new Date(Date.now()+xe)),this.sessionTimeoutSubscription=this.taskSchedulerService.setTimeout(j.fq.loginStrategySessionTimeout,xe)})}clearSessionTimeout(){return Pe(this,void 0,void 0,function*(){var e;yield this.loginStrategyCacheExpirationState.update(e=>null),null===(e=this.sessionTimeoutSubscription)||void 0===e||e.unsubscribe()})}isSessionValid(){return Pe(this,void 0,void 0,function*(){if(null==(yield(0,k._)(this.loginStrategyCacheState.state$)))return!1;const e=yield(0,k._)(this.loginStrategyCacheExpirationState.state$);return!(null!=e&&e<new Date)||(yield this.clearCache(),!1)})}initializeLoginStrategy(e){const t=[this.accountService,this.masterPasswordService,this.keyService,this.encryptService,this.apiService,this.tokenService,this.appIdService,this.platformUtilsService,this.messagingService,this.logService,this.stateService,this.twoFactorService,this.userDecryptionOptionsService,this.billingAccountProfileStateService,this.vaultTimeoutSettingsService,this.kdfConfigService,this.environmentService,this.configService];return e.pipe((0,O.T)(([e,i])=>{var n,r,o,a,l;if(null==e)return null;switch(e){case s.Password:return new ce(null!==(n=null==i?void 0:i.password)&&void 0!==n?n:new le,this.passwordStrengthService,this.policyService,this,...t);case s.Sso:return new me(null!==(r=null==i?void 0:i.sso)&&void 0!==r?r:new pe,this.keyConnectorService,this.deviceTrustService,this.authRequestService,this.i18nService,...t);case s.UserApiKey:return new ye(null!==(o=null==i?void 0:i.userApiKey)&&void 0!==o?o:new ge,this.keyConnectorService,...t);case s.AuthRequest:return new se(null!==(a=null==i?void 0:i.authRequest)&&void 0!==a?a:new re,this.deviceTrustService,...t);case s.WebAuthn:return new ke(null!==(l=null==i?void 0:i.webAuthn)&&void 0!==l?l:new Ie,...t)}}))}buildKdfConfigFromPrelogin(e){return null==e?null:e.kdf===N.ao.PBKDF2_SHA256?new N.n1(e.kdfIterations):new N.hU(e.kdfIterations,e.kdfMemory,e.kdfParallelism)}}var Ee=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ae=new T.Ok(T.xu,"decryptionOptions",{deserializer:e=>S.fromJSON(e),clearOn:["logout"]});class De{constructor(e){this.singleUserStateProvider=e}userDecryptionOptionsById$(e){return this.singleUserStateProvider.get(e,Ae).state$.pipe((0,L.p)(e=>null!=e))}hasMasterPasswordById$(e){return this.userDecryptionOptionsById$(e).pipe((0,O.T)(e=>{var t;return null!==(t=e.hasMasterPassword)&&void 0!==t&&t}))}setUserDecryptionOptionsById(e,t){return Ee(this,void 0,void 0,function*(){yield this.singleUserStateProvider.get(e,Ae).update(e=>t)})}}var Oe=i(66046),Me=i(43008),Ue=i(99352);class Ge{constructor(e,t,i,n){this.key=e,this.masterPasswordHash=t,this.deviceIdentifier=i,this.requestApproved=n}}var je=i(1086),Ne=i(3633),Ve=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Be=new T.Ok(T.dn,"adminAuthRequest",{deserializer:e=>e,clearOn:[]});class ze{constructor(e,t,i,n,r,s,o,a){this.appIdService=e,this.masterPasswordService=t,this.keyService=i,this.encryptService=n,this.apiService=r,this.stateProvider=s,this.authRequestApiService=o,this.accountService=a,this.authRequestPushNotificationSubject=new Oe.B,this.adminLoginApprovedSubject=new Oe.B,this.authRequestPushNotification$=this.authRequestPushNotificationSubject.asObservable(),this.adminLoginApproved$=this.adminLoginApprovedSubject.asObservable()}getAdminAuthRequest(e){return Ve(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required");const t=yield(0,k._)(this.stateProvider.getUser(e,Be).state$);return Ue.x.fromJSON(t)})}setAdminAuthRequest(e,t){return Ve(this,void 0,void 0,function*(){if(null==t)throw new Error("User ID is required");if(null==e)throw new Error("Auth request is required");yield this.stateProvider.setUserState(Be,e.toJSON(),t)})}clearAdminAuthRequest(e){return Ve(this,void 0,void 0,function*(){if(null==e)throw new Error("User ID is required");yield this.stateProvider.setUserState(Be,null,e)})}getPendingAuthRequests$(){return(0,Me.v)(()=>this.authRequestApiService.getPendingAuthRequests()).pipe((0,O.T)(e=>e.data.map(e=>new je.B(e))))}getLatestPendingAuthRequest$(){return this.getPendingAuthRequests$().pipe((0,O.T)(e=>0===e.length?null:e.sort((e,t)=>{const i=new Date(e.creationDate).getTime();return new Date(t.creationDate).getTime()-i})[0]))}approveOrDenyAuthRequest(e,t){return Ve(this,void 0,void 0,function*(){const i=yield(0,k._)(this.accountService.activeAccount$.pipe(Ne.F6));if(!t.id)throw new Error("Auth request has no id");if(!t.publicKey)throw new Error("Auth request has no public key");if(null==i)throw new Error("User ID is required");const n=_.A.fromB64ToArray(t.publicKey),r=yield(0,k._)(this.keyService.userKey$(i)),s=yield this.encryptService.encapsulateKeyUnsigned(r,n),o=new Ge(s.encryptedString,void 0,yield this.appIdService.getAppId(),e);return yield this.apiService.putAuthRequest(t.id,o)})}setUserKeyAfterDecryptingSharedUserKey(e,t,i){return Ve(this,void 0,void 0,function*(){const n=yield this.decryptPubKeyEncryptedUserKey(e.key,t);yield this.keyService.setUserKey(n,i)})}setKeysAfterDecryptingSharedMasterKeyAndHash(e,t,i){return Ve(this,void 0,void 0,function*(){const{masterKey:n,masterKeyHash:r}=yield this.decryptPubKeyEncryptedMasterKeyAndHash(e.key,e.masterPasswordHash,t),s=yield this.masterPasswordService.decryptUserKeyWithMasterKey(n,i);yield this.masterPasswordService.setMasterKey(n,i),yield this.masterPasswordService.setMasterKeyHash(r,i),yield this.keyService.setUserKey(s,i)})}decryptPubKeyEncryptedUserKey(e,t){return Ve(this,void 0,void 0,function*(){return yield this.encryptService.decapsulateKeyUnsigned(new we.k(e),t)})}decryptPubKeyEncryptedMasterKeyAndHash(e,t,i){return Ve(this,void 0,void 0,function*(){const n=yield this.encryptService.rsaDecrypt(new we.k(e),i),r=yield this.encryptService.rsaDecrypt(new we.k(t),i);return{masterKey:new m.e(n),masterKeyHash:_.A.fromBufferToUtf8(r)}})}sendAuthRequestPushNotification(e){null!=e.id&&this.authRequestPushNotificationSubject.next(e.id)}getFingerprintPhrase(e,t){return Ve(this,void 0,void 0,function*(){return(yield this.keyService.getFingerprint(e.toLowerCase(),t)).join("-")})}emitAdminLoginApproved(){this.adminLoginApprovedSubject.next()}}var Le=i(12277),Ke=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qe{constructor(e,t){this.apiService=e,this.logService=t}getPendingAuthRequests(){return Ke(this,void 0,void 0,function*(){const e=yield this.apiService.send("GET","/auth-requests/pending",null,!0,!0);return new Le.s(e,je.B)})}getAuthRequest(e){return Ke(this,void 0,void 0,function*(){try{const t=`/auth-requests/${e}`,i=yield this.apiService.send("GET",t,null,!0,!0);return new je.B(i)}catch(t){throw this.logService.error(t),t}})}getAuthResponse(e,t){return Ke(this,void 0,void 0,function*(){try{const i=`/auth-requests/${e}/response?code=${t}`,n=yield this.apiService.send("GET",i,null,!1,!0);return new je.B(n)}catch(i){throw this.logService.error(i),i}})}postAdminAuthRequest(e){return Ke(this,void 0,void 0,function*(){try{const t=yield this.apiService.send("POST","/auth-requests/admin-request",e,!0,!0);return new je.B(t)}catch(t){throw this.logService.error(t),t}})}postAuthRequest(e){return Ke(this,void 0,void 0,function*(){try{const t=yield this.apiService.send("POST","/auth-requests/",e,!1,!0,null,t=>{t.set("Device-Identifier",e.deviceIdentifier)});return new je.B(t)}catch(t){throw this.logService.error(t),t}})}}var _e=i(33338),Xe=i(60512),Ye=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class He{}class We{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m){this.accountService=e,this.biometricService=t,this.vaultTimeoutSettingsService=i,this.logoutService=n,this.messagingService=r,this.searchService=s,this.folderService=o,this.masterPasswordService=a,this.stateEventRunnerService=l,this.cipherService=c,this.authService=d,this.systemService=u,this.processReloadService=h,this.logService=p,this.keyService=m}lockAll(){return Ye(this,void 0,void 0,function*(){const e=yield(0,k._)((0,_e.z)([this.accountService.activeAccount$,this.accountService.accounts$]).pipe((0,O.T)(([e,t])=>{const i=Object.keys(t);return null==e?{activeAccount:null,otherAccounts:i}:{activeAccount:e.id,otherAccounts:i.filter(t=>t!==e.id)}})));for(const t of e.otherAccounts)yield this.lock(t);null!=e.activeAccount&&(yield this.lock(e.activeAccount))})}lock(e){return Ye(this,void 0,void 0,function*(){if((0,Xe.x)(e,"userId","LockService"),this.logService.info(`[LockService] Locking user ${e}`),(yield(0,k._)(this.authService.authStatusFor$(e)))!==C.J.LoggedOut){if(!(yield this.vaultTimeoutSettingsService.canLock(e)))return yield this.logoutService.logout(e,"vaultTimeout"),void this.logService.info(`[LockService] User ${e} cannot lock, logging out instead.`);yield this.wipeDecryptedState(e),yield this.waitForLockedStatus(e),yield this.systemService.clearPendingClipboard(),yield this.runPlatformOnLockActions(),this.logService.info(`[LockService] Locked user ${e}`),yield this.biometricService.setShouldAutopromptNow(!1),this.messagingService.send("locked",{userId:e}),yield this.processReloadService.startProcessReload()}})}wipeDecryptedState(e){return Ye(this,void 0,void 0,function*(){yield this.searchService.clearIndex(e),yield this.folderService.clearDecryptedFolderState(e),yield this.masterPasswordService.clearMasterKey(e),yield this.cipherService.clearCache(e),yield this.keyService.clearStoredUserKey(e),yield this.stateEventRunnerService.handleEvent("lock",e)})}waitForLockedStatus(e){return Ye(this,void 0,void 0,function*(){yield(0,k._)(this.authService.authStatusFor$(e).pipe((0,L.p)(e=>e===C.J.Locked),(0,K.w)({first:5e3,with:()=>{throw new Error("The lock process did not complete in a reasonable amount of time.")}})))})}runPlatformOnLockActions(){return Ye(this,void 0,void 0,function*(){})}}var Je=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ze{constructor(e,t,i,n,r,s,o){this.configService=e,this.loginEmailService=t,this.ssoLoginService=i,this.syncService=n,this.userAsymmetricKeysRegenerationService=r,this.encryptedMigrator=s,this.logService=o}run(e,t){return Je(this,void 0,void 0,function*(){yield this.syncService.fullSync(!0,{skipTokenRefresh:!0}),yield this.userAsymmetricKeysRegenerationService.regenerateIfNeeded(e),yield this.loginEmailService.clearLoginEmail();try{yield this.encryptedMigrator.runMigrations(e,t)}catch(n){}const i=yield this.ssoLoginService.getSsoEmail();i?(yield this.ssoLoginService.updateSsoRequiredCache(i,e),yield this.ssoLoginService.clearSsoEmail()):this.logService.debug("SSO login email not found.")})}}var Qe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class et{constructor(e){this.messagingService=e}logout(e,t){return Qe(this,void 0,void 0,function*(){this.messagingService.send("logout",{userId:e,logoutReason:t})})}}function tt(e){if(null==e)throw new Error("JWT token not found");const t=e.split(".");if(3!==t.length)throw new Error("JWT must have 3 parts");const i=t[1];let n;try{n=_.A.fromUrlB64ToUtf8(i)}catch(r){throw new Error("Cannot decode the token")}try{return JSON.parse(n)}catch(s){throw new Error("Cannot parse the token's payload into JSON")}}},93748:(e,t,i)=>{"use strict";i.d(t,{f:()=>_});var n=i(3204),r=i(16184),s=i(83516),o=i(33812),a=i(74208),l=i(23649),c=i(6056),d=i(37115),u=i(35500),h=i(77468),p=i(47428),m=i(13496),v=i(53997),f=i(78952),g=i(32924),y=i(58806),b=i(23490),w=i(78867),S=i(94573),I=i(36288),k=i(59032),C=i(25740);const T=["menu"],F=e=>({"--num-products":e,"grid-template-columns":"repeat(min(var(--num-products,1),3),auto)"});function R(e,t){if(1&e&&(o.j41(0,"a",7),o.nrm(1,"i"),o.j41(2,"span",8),o.EFF(3),o.k0s()()),2&e){const e=t.$implicit;o.Y8G("routerLink",e.appRoute)("ngClass",e.isActive?"tw-bg-primary-600 tw-font-medium !tw-text-contrast tw-ring-offset-2 hover:tw-bg-primary-600":""),o.R7$(),o.HbH(o.VkB("bwi ",e.icon," tw-text-4xl !tw-m-0 !tw-mb-1")),o.R7$(2),o.JRh(e.name)}}function P(e,t){if(1&e&&(o.j41(0,"a",14)(1,"span",15),o.nrm(2,"i"),o.EFF(3),o.k0s()()),2&e){const e=o.XpG().$implicit;o.Y8G("routerLink",e.marketingRoute.route),o.R7$(2),o.HbH(o.VkB("bwi bwi-fw ",e.icon," tw-m-0 !tw-mr-3")),o.R7$(),o.SpI("",e.name," ")}}function x(e,t){if(1&e&&(o.j41(0,"a",16)(1,"span",15),o.nrm(2,"i"),o.EFF(3),o.k0s()()),2&e){const e=o.XpG().$implicit;o.Y8G("href",e.marketingRoute.route,o.B4B),o.R7$(2),o.HbH(o.VkB("bwi bwi-fw ",e.icon," tw-m-0 !tw-mr-3")),o.R7$(),o.SpI("",e.name," ")}}function $(e,t){if(1&e&&(o.j41(0,"span"),o.DNE(1,P,4,5,"a",12)(2,x,4,5,"a",13),o.k0s()),2&e){const e=t.$implicit;o.R7$(),o.Y8G("ngIf",!e.marketingRoute.external),o.R7$(),o.Y8G("ngIf",e.marketingRoute.external)}}function E(e,t){if(1&e&&(o.j41(0,"section",9)(1,"span",10),o.EFF(2),o.nI1(3,"i18n"),o.k0s(),o.DNE(4,$,3,2,"span",11),o.k0s()),2&e){const e=o.XpG().ngIf;o.R7$(2),o.JRh(o.bMT(3,2,"moreFromBitwarden")),o.R7$(2),o.Y8G("ngForOf",e.other)}}function A(e,t){if(1&e&&(o.j41(0,"div",3)(1,"section",4),o.DNE(2,R,4,6,"a",5),o.k0s(),o.DNE(3,E,5,4,"section",6),o.k0s()),2&e){const e=t.ngIf;o.R7$(),o.Y8G("ngStyle",o.eq3(3,F,e.bento.length)),o.R7$(),o.Y8G("ngForOf",e.bento),o.R7$(),o.Y8G("ngIf",!1)}}class D{constructor(e){this.productSwitcherService=e,this.products$=this.productSwitcherService.products$}}function O(e,t){if(1&e&&(o.nrm(0,"button",2),o.nI1(1,"i18n")),2&e){const e=o.XpG(),t=o.sdS(3);o.Y8G("bitMenuTriggerFor",null==t?null:t.menu)("buttonType",e.buttonType)("label",o.bMT(1,3,"switchProducts"))}}D.ɵfac=function(e){return new(e||D)(o.rXU(w.Y))},D.ɵcmp=o.VBU({type:D,selectors:[["product-switcher-content"]],viewQuery:function(e,t){if(1&e&&o.GBs(T,5),2&e){let e;o.mGM(e=o.lsd())&&(t.menu=e.first)}},standalone:!1,decls:5,vars:6,consts:[["menu",""],["ariaRole","dialog",3,"ariaLabel"],["class","tw-px-4 tw-py-2",4,"ngIf"],[1,"tw-px-4","tw-py-2"],[1,"tw-grid","tw-gap-2",3,"ngStyle"],["class","tw-group/product-link tw-flex tw-h-24 tw-w-28 tw-flex-col tw-items-center tw-justify-center tw-rounded tw-p-1 tw-text-primary-600 tw-outline-none hover:tw-bg-background-alt hover:tw-text-primary-700 hover:tw-no-underline focus-visible:!tw-ring-2 focus-visible:!tw-ring-primary-700","ariaCurrentWhenActive","page",3,"routerLink","ngClass",4,"ngFor","ngForOf"],["class","tw-mt-4 tw-flex tw-w-full tw-flex-col tw-gap-2 tw-border-0 tw-border-t tw-border-solid tw-border-t-secondary-100 tw-p-2 tw-pb-0",4,"ngIf"],["ariaCurrentWhenActive","page",1,"tw-group/product-link","tw-flex","tw-h-24","tw-w-28","tw-flex-col","tw-items-center","tw-justify-center","tw-rounded","tw-p-1","tw-text-primary-600","tw-outline-none","hover:tw-bg-background-alt","hover:tw-text-primary-700","hover:tw-no-underline","focus-visible:!tw-ring-2","focus-visible:!tw-ring-primary-700",3,"routerLink","ngClass"],[1,"tw-max-w-24","tw-text-center","tw-text-sm","tw-leading-snug","group-hover/product-link:tw-underline"],[1,"tw-mt-4","tw-flex","tw-w-full","tw-flex-col","tw-gap-2","tw-border-0","tw-border-t","tw-border-solid","tw-border-t-secondary-100","tw-p-2","tw-pb-0"],[1,"tw-mb-1","tw-text-xs","tw-text-muted"],[4,"ngFor","ngForOf"],["bitLink","",3,"routerLink",4,"ngIf"],["bitLink","","target","_blank","rel","noreferrer",3,"href",4,"ngIf"],["bitLink","",3,"routerLink"],[1,"tw-flex","tw-items-center","tw-font-normal"],["bitLink","","target","_blank","rel","noreferrer",3,"href"]],template:function(e,t){1&e&&(o.j41(0,"bit-menu",1,0),o.nI1(2,"i18n"),o.DNE(3,A,4,5,"div",2),o.nI1(4,"async"),o.k0s()),2&e&&(o.Y8G("ariaLabel",o.bMT(2,2,"switchProducts")),o.R7$(3),o.Y8G("ngIf",o.bMT(4,4,t.products$)))},dependencies:[h.YU,h.Sq,h.bT,h.B3,c.Wk,k.L,m.Z,h.Jj,C.$],encapsulation:2});class M{ngAfterViewInit(){this.changeDetector.detectChanges()}constructor(e,t){this.changeDetector=e,this.productSwitcherService=t,this.buttonType="main",this.products$=this.productSwitcherService.products$}}M.ɵfac=function(e){return new(e||M)(o.rXU(S.gRc),o.rXU(w.Y))},M.ɵcmp=o.VBU({type:M,selectors:[["product-switcher"]],inputs:{buttonType:"buttonType"},standalone:!1,decls:4,vars:3,consts:[["content",""],["type","button","bitIconButton","bwi bwi-fw bwi-filter",3,"bitMenuTriggerFor","buttonType","label",4,"ngIf"],["type","button","bitIconButton","bwi bwi-fw bwi-filter",3,"bitMenuTriggerFor","buttonType","label"]],template:function(e,t){1&e&&(o.DNE(0,O,2,5,"button",1),o.nI1(1,"async"),o.nrm(2,"product-switcher-content",null,0)),2&e&&o.Y8G("ngIf",o.bMT(1,1,t.products$))},dependencies:[h.bT,I.s,v.O,D,h.Jj,C.$],encapsulation:2});var U=i(88016),G=i(90171);const j=[[["","slot","breadcrumbs"]],[["","slot","title-suffix"]],"*",[["","slot","secondary"]],[["","slot","tabs"]]],N=e=>({"tw-border-0 tw-border-b tw-border-solid tw-border-secondary-100 tw-bg-background-alt tw-pb-0":e}),V=e=>({"tw-hidden":e});function B(e,t){if(1&e&&o.nrm(0,"i",15),2&e){const e=o.XpG(2);o.HbH(o.VkB("bwi ",e.icon))}}function z(e,t){if(1&e&&(o.qex(0),o.nrm(1,"bit-menu-divider"),o.j41(2,"span",31),o.EFF(3),o.k0s(),o.bVm()),2&e){const e=o.XpG(3);o.R7$(3),o.SpI(" ",e.hostname," ")}}function L(e,t){if(1&e){const e=o.RV6();o.j41(0,"button",29),o.bIt("click",function(){a.eBV(e);const t=o.XpG(3);return a.Njj(t.lock())}),o.nrm(1,"i",32),o.EFF(2),o.nI1(3,"i18n"),o.k0s()}2&e&&(o.R7$(2),o.SpI(" ",o.bMT(3,1,"lockNow")," "))}function K(e,t){if(1&e){const e=o.RV6();o.qex(0),o.j41(1,"button",16),o.nrm(2,"dynamic-avatar",17),o.nI1(3,"userName"),o.k0s(),o.j41(4,"bit-menu",null,2)(6,"div",18)(7,"div",19),o.nrm(8,"dynamic-avatar",17),o.nI1(9,"userName"),o.j41(10,"div",20)(11,"span"),o.EFF(12),o.nI1(13,"i18n"),o.k0s(),o.j41(14,"small",21),o.EFF(15),o.nI1(16,"userName"),o.k0s()()(),o.DNE(17,z,4,1,"ng-container",12),o.nrm(18,"bit-menu-divider"),o.j41(19,"a",22),o.nrm(20,"i",23),o.EFF(21),o.nI1(22,"i18n"),o.k0s(),o.j41(23,"a",24),o.nrm(24,"i",25),o.EFF(25),o.nI1(26,"i18n"),o.k0s(),o.j41(27,"a",26),o.nrm(28,"i",27),o.EFF(29),o.nI1(30,"i18n"),o.k0s(),o.nrm(31,"bit-menu-divider"),o.DNE(32,L,4,3,"button",28),o.nI1(33,"async"),o.j41(34,"button",29),o.bIt("click",function(){a.eBV(e);const t=o.XpG(2);return a.Njj(t.logout())}),o.nrm(35,"i",30),o.EFF(36),o.nI1(37,"i18n"),o.k0s()()(),o.bVm()}if(2&e){const e=t.ngIf,i=o.sdS(5),n=o.XpG(2);o.R7$(),o.Y8G("bitMenuTriggerFor",i),o.R7$(),o.Y8G("id",e.id)("text",o.bMT(3,13,e)),o.R7$(6),o.Y8G("id",e.id)("text",o.bMT(9,15,e)),o.R7$(4),o.JRh(o.bMT(13,17,"loggedInAs")),o.R7$(3),o.SpI(" ",o.bMT(16,19,e)," "),o.R7$(2),o.Y8G("ngIf",n.selfHosted),o.R7$(4),o.SpI(" ",o.bMT(22,21,"accountSettings")," "),o.R7$(4),o.SpI(" ",o.bMT(26,23,"getHelp")," "),o.R7$(4),o.SpI(" ",o.bMT(30,25,"getApps")," "),o.R7$(3),o.Y8G("ngIf",o.bMT(33,27,n.canLock$)),o.R7$(4),o.SpI(" ",o.bMT(37,29,"logOut")," ")}}function q(e,t){if(1&e&&(o.j41(0,"header",4)(1,"div",5)(2,"div",6),o.SdG(3),o.j41(4,"h1",7),o.nI1(5,"i18n"),o.j41(6,"div",8),o.DNE(7,B,1,3,"i",9),o.EFF(8),o.nI1(9,"i18n"),o.k0s(),o.j41(10,"div"),o.SdG(11,1),o.k0s()()(),o.j41(12,"div",10)(13,"div",11),o.SdG(14,2),o.nrm(15,"product-switcher"),o.DNE(16,K,38,31,"ng-container",12),o.nI1(17,"async"),o.k0s(),o.j41(18,"div",13,0),o.SdG(20,3),o.k0s()()(),o.j41(21,"div",14,1),o.SdG(23,4),o.k0s()()),2&e){const e=t.ngIf,i=o.sdS(19),n=o.sdS(22),r=o.XpG();o.Y8G("ngClass",o.eq3(13,N,0!==n.childElementCount)),o.R7$(4),o.Y8G("title",r.title||o.bMT(5,7,e.titleId)),o.R7$(3),o.Y8G("ngIf",r.icon),o.R7$(),o.SpI(" ",r.title||o.bMT(9,9,e.titleId)," "),o.R7$(8),o.Y8G("ngIf",o.bMT(17,11,r.account$)),o.R7$(2),o.Y8G("ngClass",o.eq3(15,V,0===i.childElementCount)),o.R7$(3),o.Y8G("ngClass",o.eq3(17,V,0===n.childElementCount))}}class _{constructor(e,t,i,s,o){this.route=e,this.platformUtilsService=t,this.vaultTimeoutSettingsService=i,this.messagingService=s,this.accountService=o,this.hostname=location.hostname,this.routeData$=this.route.data.pipe((0,n.T)(e=>({titleId:e.titleId}))),this.selfHosted=this.platformUtilsService.isSelfHost(),this.account$=this.accountService.activeAccount$,this.canLock$=this.vaultTimeoutSettingsService.availableVaultTimeoutActions$().pipe((0,n.T)(e=>e.includes(r.W4.Lock)))}lock(){this.messagingService.send("lockVault")}logout(){this.messagingService.send("logout")}}_.ɵfac=function(e){return new(e||_)(o.rXU(l.nX),o.rXU(d.y),o.rXU(r.ep),o.rXU(s.U),o.rXU(u.Di))},_.ɵcmp=o.VBU({type:_,selectors:[["app-header"]],inputs:{title:"title",icon:"icon"},standalone:!1,ngContentSelectors:["[slot=breadcrumbs]","[slot=title-suffix]","*","[slot=secondary]","[slot=tabs]"],decls:2,vars:3,consts:[["contentContainer",""],["tabsContainer",""],["accountMenu",""],["class","-tw-mt-6 -tw-mx-8 tw-mb-3 tw-flex tw-flex-col tw-py-6 tw-px-8",3,"ngClass",4,"ngIf"],[1,"-tw-mt-6","-tw-mx-8","tw-mb-3","tw-flex","tw-flex-col","tw-py-6","tw-px-8",3,"ngClass"],[1,"tw-flex"],[1,"tw-flex","tw-min-w-0","tw-flex-1","tw-flex-col","tw-gap-2"],["bitTypography","h1","noMargin","",1,"tw-m-0","tw-mr-2","tw-leading-10","tw-flex","tw-gap-1",3,"title"],[1,"tw-truncate"],["aria-hidden","true",3,"class",4,"ngIf"],[1,"tw-ml-auto","tw-flex","tw-flex-col","tw-gap-4"],[1,"tw-flex","tw-min-w-max","tw-items-center","tw-justify-end","tw-gap-2"],[4,"ngIf"],[1,"tw-ml-auto",3,"ngClass"],[1,"-tw-mx-4","-tw-mb-px",3,"ngClass"],["aria-hidden","true"],["type","button",1,"tw-border-0","tw-bg-transparent","tw-p-0","tw-shrink-0",3,"bitMenuTriggerFor"],[3,"id","text"],[1,"tw-flex","tw-min-w-52","tw-max-w-72","tw-flex-col"],["appStopProp","",1,"tw-flex","tw-items-center","tw-px-4","tw-py-1","tw-leading-tight","tw-text-muted"],[1,"tw-ml-2","tw-block","tw-overflow-hidden","tw-whitespace-nowrap"],[1,"tw-block","tw-overflow-hidden","tw-whitespace-nowrap"],["bitMenuItem","","routerLink","/settings/account"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-user"],["bitMenuItem","","href","https://github.com/dani-garcia/vaultwarden","target","_blank","rel","noreferrer"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-question-circle"],["bitMenuItem","","href","https://bitwarden.com/download/","target","_blank","rel","noreferrer"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-download"],["bitMenuItem","","type","button",3,"click",4,"ngIf"],["bitMenuItem","","type","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sign-out"],[1,"tw-break-all","tw-px-4","tw-py-1","tw-text-left","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-lock"]],template:function(e,t){1&e&&(o.NAR(j),o.DNE(0,q,24,19,"header",3),o.nI1(1,"async")),2&e&&o.Y8G("ngIf",o.bMT(1,1,t.routeData$))},dependencies:[h.YU,h.bT,c.Wk,p.x,m.Z,v.O,f.S,g.M,y.r,b.O,M,h.Jj,U.$,G.b],encapsulation:2})},93817:(e,t,i)=>{"use strict";i.d(t,{l:()=>Ve});var n=i(94251),r=i(77468),s=i(6056),o=i(30675),a=i(47659),l=i(20798),c=i(79303),d=i(62963),u=i(14092),h=i(10840),p=i(94573),m=i(33812),v=i(31442),f=i(61325),g=i(53997),y=i(45980),b=i(85523),w=i(74208),S=i(50700),I=i(26333),k=i(47428),C=i(50352),T=i(36288),F=i(59032),R=i(13496),P=i(78952),x=i(32924),$=i(38410),E=i(71944),A=i(55393),D=i(69592),O=i(37856),M=i(88016),U=i(91975),G=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const j=()=>[],N=(e,t)=>({itemId:e,action:t});function V(e,t){if(1&e){const e=m.RV6();m.j41(0,"input",16),m.nI1(1,"i18n"),m.bIt("change",function(t){w.eBV(e);const i=m.XpG();return w.Njj(t?i.checkedToggled.next():null)}),m.k0s()}if(2&e){const e=m.XpG();m.Y8G("disabled",e.disabled||e.decryptionFailure)("checked",e.checked),m.BMQ("aria-label",m.bMT(1,3,"vaultItemSelect"))}}function B(e,t){1&e&&(m.qex(0),m.nrm(1,"i",19),m.nI1(2,"i18n"),m.j41(3,"span",18),m.EFF(4),m.nI1(5,"i18n"),m.k0s(),m.bVm()),2&e&&(m.R7$(),m.Y8G("title",m.mNQ(m.bMT(2,3,"attachmentsNeedFix"))),m.R7$(3),m.JRh(m.bMT(5,5,"attachmentsNeedFix")))}function z(e,t){if(1&e&&(m.qex(0),m.nrm(1,"i",17),m.nI1(2,"i18n"),m.j41(3,"span",18),m.EFF(4),m.nI1(5,"i18n"),m.k0s(),m.DNE(6,B,6,7,"ng-container",9),m.bVm()),2&e){const e=m.XpG();m.R7$(),m.Y8G("title",m.mNQ(m.bMT(2,4,"attachments"))),m.R7$(3),m.JRh(m.bMT(5,6,"attachments")),m.R7$(2),m.Y8G("ngIf",e.showFixOldAttachments)}}function L(e,t){if(1&e&&(m.j41(0,"td",20),m.nrm(1,"app-org-badge",21),m.nI1(2,"orgNameFromId"),m.k0s()),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass),m.R7$(),m.Y8G("disabled",e.disabled)("organizationId",e.cipher.organizationId)("organizationName",m.i5U(2,4,e.cipher.organizationId,e.organizations))}}function K(e,t){if(1&e&&m.nrm(0,"app-collection-badge",24),2&e){const e=m.XpG(2);m.Y8G("collectionIds",e.cipher.collectionIds)("collections",e.collections)}}function q(e,t){if(1&e&&(m.j41(0,"td",22),m.DNE(1,K,1,2,"app-collection-badge",23),m.k0s()),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass),m.R7$(),m.Y8G("ngIf",e.cipher.collectionIds)}}function _(e,t){if(1&e&&m.nrm(0,"td",22),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass)}}function X(e,t){if(1&e&&(m.j41(0,"td",22)(1,"p",25),m.EFF(2),m.k0s()()),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass),m.R7$(2),m.SpI(" ",e.permissionText," ")}}function Y(e,t){if(1&e&&(m.nrm(0,"button",26),m.nI1(1,"i18n")),2&e){const e=m.XpG(),t=m.sdS(20);m.Y8G("label",m.mNQ(m.bMT(1,4,"options")))("disabled",e.disabled||!e.canManageCollection)("bitMenuTriggerFor",t)}}function H(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG();return w.Njj(t.deleteCipher())}),m.j41(1,"span",28),m.nrm(2,"i",29),m.EFF(3),m.nI1(4,"i18n"),m.k0s()()}if(2&e){const e=m.XpG();m.R7$(3),m.SpI(" ",m.bMT(4,1,e.isDeleted?"permanentlyDelete":"delete")," ")}}function W(e,t){if(1&e&&(m.j41(0,"button",34),m.nrm(1,"i",33),m.EFF(2),m.nI1(3,"i18n"),m.k0s()),2&e){const e=m.XpG(3);m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(3,2,"copyPassword")," ")}}function J(e,t){if(1&e&&(m.j41(0,"a",37),m.nrm(1,"i",38),m.EFF(2),m.nI1(3,"i18n"),m.k0s()),2&e){const e=m.XpG(3);m.Y8G("href",e.launchUri,m.B4B),m.R7$(2),m.SpI(" ",m.bMT(3,2,"launch")," ")}}function Z(e,t){if(1&e&&(m.qex(0),m.j41(1,"button",32),m.nrm(2,"i",33),m.EFF(3),m.nI1(4,"i18n"),m.k0s(),m.nVh(5,W,4,4,"button",34),m.j41(6,"button",35),m.nrm(7,"i",33),m.EFF(8),m.nI1(9,"i18n"),m.k0s(),m.DNE(10,J,4,4,"a",36),m.bVm()),2&e){const e=m.XpG(2);m.R7$(),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(4,6,"copyUsername")," "),m.R7$(2),m.vxM(e.cipher.viewPassword?5:-1),m.R7$(),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(9,8,"copyVerificationCode")," "),m.R7$(2),m.Y8G("ngIf",e.canLaunch)}}function Q(e,t){if(1&e&&(m.qex(0),m.j41(1,"button",39),m.nrm(2,"i",33),m.EFF(3),m.nI1(4,"i18n"),m.k0s(),m.j41(5,"button",40),m.nrm(6,"i",33),m.EFF(7),m.nI1(8,"i18n"),m.k0s(),m.bVm()),2&e){const e=m.XpG(2);m.R7$(),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(4,4,"copyNumber")," "),m.R7$(2),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(8,6,"copySecurityCode")," ")}}function ee(e,t){if(1&e&&(m.qex(0),m.j41(1,"button",32),m.nrm(2,"i",33),m.EFF(3),m.nI1(4,"i18n"),m.k0s(),m.j41(5,"button",41),m.nrm(6,"i",33),m.EFF(7),m.nI1(8,"i18n"),m.k0s(),m.j41(9,"button",42),m.nrm(10,"i",33),m.EFF(11),m.nI1(12,"i18n"),m.k0s(),m.j41(13,"button",43),m.nrm(14,"i",33),m.EFF(15),m.nI1(16,"i18n"),m.k0s(),m.bVm()),2&e){const e=m.XpG(2);m.R7$(),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(4,8,"copyUsername")," "),m.R7$(2),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(8,10,"copyEmail")," "),m.R7$(2),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(12,12,"copyPhone")," "),m.R7$(2),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(16,14,"copyAddress")," ")}}function te(e,t){if(1&e&&(m.qex(0),m.j41(1,"button",44),m.nrm(2,"i",33),m.EFF(3),m.nI1(4,"i18n"),m.k0s(),m.bVm()),2&e){const e=m.XpG(2);m.R7$(),m.Y8G("cipher",e.cipher),m.R7$(2),m.SpI(" ",m.bMT(4,2,"copyNote")," ")}}function ie(e,t){1&e&&m.nrm(0,"bit-menu-divider")}function ne(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.toggleFavorite())}),m.nrm(1,"i",45),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}if(2&e){const e=m.XpG(2);m.R7$(2),m.SpI(" ",m.bMT(3,1,e.cipher.favorite?"unfavorite":"favorite")," ")}}function re(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.editCipher())}),m.nrm(1,"i",46),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"edit")," "))}function se(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.attachments())}),m.nrm(1,"i",47),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"attachments")," "))}function oe(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.clone())}),m.nrm(1,"i",48),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"clone")," "))}function ae(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.assignToCollections())}),m.nrm(1,"i",49),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"assignToCollections")," "))}function le(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.events())}),m.nrm(1,"i",50),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"eventLogs")," "))}function ce(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(3);return w.Njj(t.archive())}),m.nrm(1,"i",51),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"archiveVerb")," "))}function de(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(t){w.eBV(e);const i=m.sdS(6);return w.Njj(i.promptForPremium(t))}),m.nrm(1,"i",51),m.EFF(2),m.nI1(3,"i18n"),m.j41(4,"div",52),m.nrm(5,"app-premium-badge",null,2),m.k0s()()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"archiveVerb")," "))}function ue(e,t){if(1&e&&(m.nVh(0,ce,4,3,"button",31),m.nVh(1,de,7,3,"button",31)),2&e){const e=m.XpG(2);m.vxM(e.userCanArchive?0:-1),m.R7$(),m.vxM(e.userCanArchive?-1:1)}}function he(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.unarchive())}),m.nrm(1,"i",53),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"unArchive")," "))}function pe(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.restore())}),m.nrm(1,"i",54),m.EFF(2),m.nI1(3,"i18n"),m.k0s()}2&e&&(m.R7$(2),m.SpI(" ",m.bMT(3,1,"restore")," "))}function me(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",27),m.bIt("click",function(){w.eBV(e);const t=m.XpG(2);return w.Njj(t.deleteCipher())}),m.j41(1,"span",28),m.nrm(2,"i",29),m.EFF(3),m.nI1(4,"i18n"),m.k0s()()}if(2&e){const e=m.XpG(2);m.R7$(3),m.SpI(" ",m.bMT(4,1,e.isDeleted?"permanentlyDelete":"delete")," ")}}function ve(e,t){if(1&e&&(m.nrm(0,"button",30),m.nI1(1,"i18n"),m.j41(2,"bit-menu",null,1),m.DNE(4,Z,11,10,"ng-container",9)(5,Q,9,8,"ng-container",9)(6,ee,17,16,"ng-container",9)(7,te,5,4,"ng-container",9)(8,ie,1,0,"bit-menu-divider",9),m.nVh(9,ne,4,3,"button",31),m.DNE(10,re,4,3,"button",15)(11,se,4,3,"button",15)(12,oe,4,3,"button",15)(13,ae,4,3,"button",15)(14,le,4,3,"button",15),m.nVh(15,ue,2,2),m.nVh(16,he,4,3,"button",31),m.DNE(17,pe,4,3,"button",15)(18,me,5,3,"button",15),m.k0s()),2&e){const e=m.sdS(3),t=m.XpG();m.Y8G("label",m.mNQ(m.bMT(1,19,"options")))("bitMenuTriggerFor",e)("disabled",t.disabled),m.R7$(4),m.Y8G("ngIf",t.isLoginCipher),m.R7$(),m.Y8G("ngIf",t.isCardCipher),m.R7$(),m.Y8G("ngIf",t.isIdentityCipher),m.R7$(),m.Y8G("ngIf",t.isSecureNoteCipher),m.R7$(),m.Y8G("ngIf",t.showMenuDivider),m.R7$(),m.vxM(t.viewingOrgVault?-1:9),m.R7$(),m.Y8G("ngIf",t.canEditCipher),m.R7$(),m.Y8G("ngIf",t.showAttachments),m.R7$(),m.Y8G("ngIf",t.showClone),m.R7$(),m.Y8G("ngIf",t.showAssignToCollections),m.R7$(),m.Y8G("ngIf",t.showEventLogs),m.R7$(),m.vxM(t.showArchiveButton?15:-1),m.R7$(),m.vxM(t.showUnArchiveButton?16:-1),m.R7$(),m.Y8G("ngIf",t.isDeleted&&t.canRestoreCipher),m.R7$(),m.Y8G("ngIf",t.canDeleteCipher)}}class fe{constructor(e){this.i18nService=e,this.RowHeightClass=b.O6,this.archiveEnabled=p.hFB.required(),this.onEvent=new m.bkB,this.checkedToggled=new m.bkB,this.CipherType=v.gC,this.permissionList=(0,y.M3)(),this.permissionPriority=["manageCollection","editItems","editItemsHidePass","viewItems","viewItemsHidePass"]}ngOnInit(){return G(this,void 0,void 0,function*(){null!=this.cipher.organizationId&&(this.organization=this.organizations.find(e=>e.id===this.cipher.organizationId))})}get showArchiveButton(){return!!this.archiveEnabled()&&(!f.n.isArchived(this.cipher)&&!f.n.isDeleted(this.cipher))}get showUnArchiveButton(){return!!this.archiveEnabled()&&f.n.isArchived(this.cipher)}get clickAction(){return this.decryptionFailure?"showFailedToDecrypt":"view"}get showTotpCopyButton(){var e;const t=f.n.getLogin(this.cipher);return null!==(e=null==t?void 0:t.totp)&&void 0!==e&&e&&(this.cipher.organizationUseTotp||this.showPremiumFeatures)}get showFixOldAttachments(){return this.cipher.hasOldAttachments&&null==this.cipher.organizationId}get hasAttachments(){return f.n.hasAttachments(this.cipher)}get showAttachments(){return!(f.n.isArchived(this.cipher)&&!this.userCanArchive)&&(this.canEditCipher||this.hasAttachments)}get canLaunch(){return f.n.canLaunch(this.cipher)}get launchUri(){return f.n.getLaunchUri(this.cipher)}get subtitle(){return f.n.subtitle(this.cipher)}get isDeleted(){return f.n.isDeleted(this.cipher)}get decryptionFailure(){return f.n.decryptionFailure(this.cipher)}get showAssignToCollections(){var e;return!f.n.isArchived(this.cipher)&&((null===(e=this.organizations)||void 0===e?void 0:e.length)&&this.canAssignCollections&&!f.n.isDeleted(this.cipher))}get showClone(){return!(f.n.isArchived(this.cipher)&&(!this.userCanArchive||this.enforceOrgDataOwnershipPolicy))&&(this.cloneable&&!f.n.isDeleted(this.cipher))}get showEventLogs(){return this.useEvents&&this.cipher.organizationId}get isLoginCipher(){return f.n.getType(this.cipher)===this.CipherType.Login&&!f.n.isDeleted(this.cipher)&&!f.n.isArchived(this.cipher)}get hasPasswordToCopy(){return f.n.hasCopyableValue(this.cipher,"password")}get hasUsernameToCopy(){return f.n.hasCopyableValue(this.cipher,"username")}get permissionText(){var e;if(!this.cipher.organizationId||0===this.cipher.collectionIds.length)return this.i18nService.t("manageCollection");const t=this.collections.filter(e=>{if(e.assigned)return this.cipher.collectionIds.find(t=>{if(e.id===t)return e})});if(1===(null==t?void 0:t.length))return this.i18nService.t(null===(e=this.permissionList.find(e=>e.perm===(0,y.Jh)(t[0])))||void 0===e?void 0:e.labelId);if((null==t?void 0:t.length)>1){const e=t.map(e=>{var t;return null===(t=this.permissionList.find(t=>t.perm===(0,y.Jh)(e)))||void 0===t?void 0:t.labelId}),i=this.permissionPriority.find(t=>e.includes(t));return this.i18nService.t(i)}return this.i18nService.t("noAccess")}get hasVisibleLoginOptions(){return this.isLoginCipher&&(f.n.hasCopyableValue(this.cipher,"username")||this.cipher.viewPassword&&f.n.hasCopyableValue(this.cipher,"password")||this.showTotpCopyButton||this.canLaunch)}get isCardCipher(){return f.n.getType(this.cipher)===this.CipherType.Card&&!this.isDeleted}get hasVisibleCardOptions(){return this.isCardCipher&&(f.n.hasCopyableValue(this.cipher,"cardNumber")||f.n.hasCopyableValue(this.cipher,"securityCode"))}get isIdentityCipher(){return f.n.getType(this.cipher)===this.CipherType.Identity&&!this.isDeleted}get hasVisibleIdentityOptions(){return this.isIdentityCipher&&(f.n.hasCopyableValue(this.cipher,"address")||f.n.hasCopyableValue(this.cipher,"email")||f.n.hasCopyableValue(this.cipher,"username")||f.n.hasCopyableValue(this.cipher,"phone"))}get isSecureNoteCipher(){return f.n.getType(this.cipher)===this.CipherType.SecureNote&&!(this.isDeleted&&this.canRestoreCipher)}get hasVisibleSecureNoteOptions(){return this.isSecureNoteCipher&&f.n.hasCopyableValue(this.cipher,"secureNote")}get showMenuDivider(){return this.hasVisibleLoginOptions||this.hasVisibleCardOptions||this.hasVisibleIdentityOptions||this.hasVisibleSecureNoteOptions}clone(){this.onEvent.emit({type:"clone",item:this.cipher})}events(){this.onEvent.emit({type:"viewEvents",item:this.cipher})}archive(){this.onEvent.emit({type:"archive",items:[this.cipher]})}unarchive(){this.onEvent.emit({type:"unarchive",items:[this.cipher]})}restore(){this.onEvent.emit({type:"restore",items:[this.cipher]})}deleteCipher(){this.onEvent.emit({type:"delete",items:[{cipher:this.cipher}]})}attachments(){this.onEvent.emit({type:"viewAttachments",item:this.cipher})}assignToCollections(){this.onEvent.emit({type:"assignToCollections",items:[this.cipher]})}get showCheckbox(){return!this.viewingOrgVault||!this.organization||(this.organization.canEditAllCiphers||this.cipher.edit&&this.cipher.viewPassword)}toggleFavorite(){this.onEvent.emit({type:"toggleFavorite",item:this.cipher})}editCipher(){this.onEvent.emit({type:"editCipher",item:this.cipher})}onRightClick(e){e.shiftKey&&e.ctrlKey||!this.disabled&&this.menuTrigger&&this.menuTrigger.toggleMenuOnRightClick(e)}}fe.ɵfac=function(e){return new(e||fe)(m.rXU(S.W))},fe.ɵcmp=m.VBU({type:fe,selectors:[["tr","appVaultCipherRow",""]],viewQuery:function(e,t){if(1&e&&m.GBs(g.O,5),2&e){let e;m.mGM(e=m.lsd())&&(t.menuTrigger=e.first)}},hostBindings:function(e,t){1&e&&m.bIt("contextmenu",function(e){return t.onRightClick(e)})},inputs:{disabled:"disabled",cipher:"cipher",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",showPremiumFeatures:"showPremiumFeatures",useEvents:"useEvents",cloneable:"cloneable",organizations:"organizations",collections:"collections",viewingOrgVault:"viewingOrgVault",canEditCipher:"canEditCipher",canAssignCollections:"canAssignCollections",canManageCollection:"canManageCollection",canDeleteCipher:"canDeleteCipher",canRestoreCipher:"canRestoreCipher",userCanArchive:"userCanArchive",archiveEnabled:[1,"archiveEnabled"],enforceOrgDataOwnershipPolicy:"enforceOrgDataOwnershipPolicy",checked:"checked"},outputs:{onEvent:"onEvent",checkedToggled:"checkedToggled"},standalone:!1,attrs:["appVaultCipherRow",""],decls:23,vars:29,consts:[["corruptedCipherOptions",""],["cipherOptions",""],["badge",""],["bitCell","",1,"tw-min-w-fit",3,"ngClass"],["type","checkbox","bitCheckbox","","appStopProp","",3,"disabled","checked","change",4,"ngIf"],[3,"cipher"],["bitCell","",1,"tw-truncate",3,"ngClass"],[1,"tw-inline-flex","tw-w-full"],["bitLink","","queryParamsHandling","merge","type","button","appStopProp","","aria-haspopup","true",1,"tw-overflow-hidden","tw-text-ellipsis","tw-text-start","tw-leading-snug",3,"disabled","routerLink","queryParams","replaceUrl","title"],[4,"ngIf"],["appStopProp","",1,"tw-text-sm","tw-text-muted"],["bitCell","","class","tw-hidden lg:tw-table-cell",3,"ngClass",4,"ngIf"],["bitCell","",3,"ngClass",4,"ngIf"],["bitCell","",1,"tw-text-right",3,"ngClass"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","label",4,"ngIf"],["bitMenuItem","","type","button",3,"click",4,"ngIf"],["type","checkbox","bitCheckbox","","appStopProp","",3,"change","disabled","checked"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip","tw-ml-2","tw-leading-normal",3,"title"],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle","tw-ml-2","tw-leading-normal","tw-text-warning",3,"title"],["bitCell","",1,"tw-hidden","lg:tw-table-cell",3,"ngClass"],["appStopProp","",3,"disabled","organizationId","organizationName"],["bitCell","",3,"ngClass"],[3,"collectionIds","collections",4,"ngIf"],[3,"collectionIds","collections"],[1,"tw-mb-0","tw-text-muted"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","label"],["bitMenuItem","","type","button",3,"click"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"bitMenuTriggerFor","disabled","label"],["bitMenuItem","","type","button"],["type","button","bitMenuItem","","appCopyField","username",3,"cipher"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-clone"],["bitMenuItem","","type","button","appCopyField","password",3,"cipher"],["bitMenuItem","","type","button","appCopyField","totp",3,"cipher"],["bitMenuItem","","type","button","target","_blank","rel","noreferrer",3,"href",4,"ngIf"],["bitMenuItem","","type","button","target","_blank","rel","noreferrer",3,"href"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-external-link"],["type","button","bitMenuItem","","appCopyField","cardNumber",3,"cipher"],["type","button","bitMenuItem","","appCopyField","securityCode",3,"cipher"],["type","button","bitMenuItem","","appCopyField","email",3,"cipher"],["type","button","bitMenuItem","","appCopyField","phone",3,"cipher"],["type","button","bitMenuItem","","appCopyField","address",3,"cipher"],["type","button","bitMenuItem","","appCopyField","secureNote",3,"cipher"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-star"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-paperclip"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-files"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-collection-shared"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-file-text"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-archive"],["slot","end","aria-hidden","",1,"-tw-mt-0.5"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-unarchive"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-undo"]],template:function(e,t){1&e&&(m.j41(0,"td",3),m.DNE(1,V,2,5,"input",4),m.k0s(),m.j41(2,"td",3),m.nrm(3,"app-vault-icon",5),m.k0s(),m.j41(4,"td",6)(5,"div",7)(6,"button",8),m.nI1(7,"i18n"),m.EFF(8),m.k0s(),m.DNE(9,z,7,8,"ng-container",9),m.k0s(),m.nrm(10,"br"),m.j41(11,"span",10),m.EFF(12),m.k0s()(),m.DNE(13,L,3,7,"td",11)(14,q,2,2,"td",12)(15,_,1,1,"td",12)(16,X,3,2,"td",12),m.j41(17,"td",13),m.DNE(18,Y,2,6,"button",14),m.j41(19,"bit-menu",null,0),m.DNE(21,H,5,3,"button",15),m.k0s(),m.nVh(22,ve,19,21),m.k0s()),2&e&&(m.Y8G("ngClass",t.RowHeightClass),m.R7$(),m.Y8G("ngIf",t.showCheckbox),m.R7$(),m.Y8G("ngClass",t.RowHeightClass),m.R7$(),m.Y8G("cipher",t.cipher),m.R7$(),m.Y8G("ngClass",t.RowHeightClass),m.R7$(2),m.Y8G("title",m.mNQ(m.i5U(7,22,"editItemWithName",t.cipher.name)))("disabled",t.disabled)("routerLink",m.lJ4(25,j))("queryParams",m.l_i(26,N,t.cipher.id,t.clickAction))("replaceUrl",!0),m.R7$(2),m.SpI(" ",t.cipher.name," "),m.R7$(),m.Y8G("ngIf",t.hasAttachments),m.R7$(3),m.JRh(t.subtitle),m.R7$(),m.Y8G("ngIf",t.showOwner),m.R7$(),m.Y8G("ngIf",t.showCollections),m.R7$(),m.Y8G("ngIf",t.showGroups),m.R7$(),m.Y8G("ngIf",t.viewingOrgVault),m.R7$(),m.Y8G("ngClass",t.RowHeightClass),m.R7$(),m.Y8G("ngIf",t.decryptionFailure),m.R7$(3),m.Y8G("ngIf",t.canDeleteCipher),m.R7$(),m.vxM(t.decryptionFailure?-1:22))},dependencies:[r.YU,r.bT,s.Wk,I.R,k.x,C.P,T.s,F.o,R.Z,g.O,P.S,x.M,$.Q,E.P,A.K,D.w,O.a,M.$,U.t],encapsulation:2});var ge=i(28202),ye=i(47696),be=i(33277),we=i(94438);class Se{constructor(e){this.i18nService=e,this.selectedGroups=(0,p.hFB)([]),this.allGroups=(0,p.hFB)([]),this.groupNames=(0,be.EW)(()=>{const e=this.allGroups();return e?this.selectedGroups().map(t=>{var i;return null===(i=e.find(e=>e.id===t.id))||void 0===i?void 0:i.name}).filter(e=>void 0!==e).sort(this.i18nService.collator.compare):[]})}}Se.ɵfac=function(e){return new(e||Se)(m.rXU(S.W))},Se.ɵcmp=m.VBU({type:Se,selectors:[["app-group-badge"]],inputs:{selectedGroups:[1,"selectedGroups"],allGroups:[1,"allGroups"]},standalone:!1,decls:1,vars:2,consts:[["variant","secondary",3,"items","maxItems"]],template:function(e,t){1&e&&m.nrm(0,"bit-badge-list",0),2&e&&m.Y8G("items",t.groupNames())("maxItems",3)},dependencies:[we.p],encapsulation:2,changeDetection:0});const Ie=()=>[],ke=e=>({collectionId:e});function Ce(e,t){if(1&e){const e=m.RV6();m.j41(0,"input",15),m.nI1(1,"i18n"),m.bIt("change",function(t){w.eBV(e);const i=m.XpG();return w.Njj(t?i.checkedToggled.next():null)}),m.k0s()}if(2&e){const e=m.XpG();m.Y8G("disabled",e.disabled)("checked",e.checked),m.BMQ("aria-label",m.bMT(1,3,"collectionItemSelect"))}}function Te(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",16),m.bIt("click",function(){w.eBV(e);const t=m.XpG();return w.Njj(t.addAccess(t.CollectionPermission.Manage))}),m.EFF(1),m.nI1(2,"i18n"),m.k0s()}2&e&&(m.R7$(),m.SpI(" ",m.bMT(2,1,"addAccess")," "))}function Fe(e,t){if(1&e&&(m.j41(0,"td",17),m.nrm(1,"app-org-badge",18),m.nI1(2,"orgNameFromId"),m.k0s()),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass),m.R7$(),m.Y8G("disabled",e.disabled)("organizationId",e.collection.organizationId)("organizationName",m.i5U(2,4,e.collection.organizationId,e.organizations))}}function Re(e,t){if(1&e&&m.nrm(0,"td",4),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass)}}function Pe(e,t){if(1&e&&m.nrm(0,"app-group-badge",20),2&e){const e=m.XpG(2);m.Y8G("selectedGroups",e.collectionGroups)("allGroups",e.groups)}}function xe(e,t){if(1&e&&(m.j41(0,"td",4),m.DNE(1,Pe,1,2,"app-group-badge",19),m.k0s()),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass),m.R7$(),m.Y8G("ngIf",e.collectionGroups)}}function $e(e,t){if(1&e&&(m.j41(0,"td",4)(1,"p",21),m.EFF(2),m.k0s()()),2&e){const e=m.XpG();m.Y8G("ngClass",e.RowHeightClass),m.R7$(),m.Y8G("title",e.permissionTooltip),m.R7$(),m.SpI(" ",e.permissionText," ")}}function Ee(e,t){if(1&e&&(m.nrm(0,"button",12),m.nI1(1,"i18n")),2&e){const e=m.XpG(),t=m.sdS(19);m.Y8G("label",m.mNQ(m.bMT(1,4,"options")))("disabled",e.disabled)("bitMenuTriggerFor",t)}}function Ae(e,t){if(1&e){const e=m.RV6();m.qex(0),m.j41(1,"button",22),m.bIt("click",function(){w.eBV(e);const t=m.XpG();return w.Njj(t.edit(!1))}),m.nrm(2,"i",23),m.EFF(3),m.nI1(4,"i18n"),m.k0s(),m.j41(5,"button",22),m.bIt("click",function(){w.eBV(e);const t=m.XpG();return w.Njj(t.access(!1))}),m.nrm(6,"i",24),m.EFF(7),m.nI1(8,"i18n"),m.k0s(),m.bVm()}2&e&&(m.R7$(3),m.SpI(" ",m.bMT(4,2,"editInfo")," "),m.R7$(4),m.SpI(" ",m.bMT(8,4,"editAccess")," "))}function De(e,t){if(1&e){const e=m.RV6();m.qex(0),m.j41(1,"button",22),m.bIt("click",function(){w.eBV(e);const t=m.XpG();return w.Njj(t.edit(!0))}),m.nrm(2,"i",23),m.EFF(3),m.nI1(4,"i18n"),m.k0s(),m.j41(5,"button",22),m.bIt("click",function(){w.eBV(e);const t=m.XpG();return w.Njj(t.access(!0))}),m.nrm(6,"i",24),m.EFF(7),m.nI1(8,"i18n"),m.k0s(),m.bVm()}2&e&&(m.R7$(3),m.SpI(" ",m.bMT(4,2,"viewInfo")," "),m.R7$(4),m.SpI(" ",m.bMT(8,4,"viewAccess")," "))}function Oe(e,t){if(1&e){const e=m.RV6();m.j41(0,"button",22),m.bIt("click",function(){w.eBV(e);const t=m.XpG();return w.Njj(t.deleteCollection())}),m.j41(1,"span",25),m.nrm(2,"i",26),m.EFF(3),m.nI1(4,"i18n"),m.k0s()()}2&e&&(m.R7$(3),m.SpI(" ",m.bMT(4,1,"delete")," "))}class Me{constructor(e){this.i18nService=e,this.RowHeightClass=b.O6,this.Unassigned="unassigned",this.CollectionPermission=y.aF,this.DefaultCollectionType=ge.it.DefaultUserCollection,this.onEvent=new m.bkB,this.checkedToggled=new m.bkB}get collectionGroups(){return this.collection instanceof ge.nb?this.collection.groups:[]}get organization(){return this.organizations.find(e=>e.id===this.collection.organizationId)}get showAddAccess(){var e,t;return this.collection.id!=ge.I_&&(this.collection instanceof ge.nb&&(!(null===(e=this.organization)||void 0===e?void 0:e.allowAdminAccessToAllCollectionItems)&&this.collection.unmanaged&&(null===(t=this.organization)||void 0===t?void 0:t.canEditUnmanagedCollections)))}get permissionText(){var e,t;if(this.collection.id==ge.I_&&(null===(e=this.organization)||void 0===e?void 0:e.canEditUnassignedCiphers))return this.i18nService.t("editItems");if(this.collection.assigned){const e=(0,y.M3)();return this.i18nService.t(null===(t=e.find(e=>e.perm===(0,y.Jh)(this.collection)))||void 0===t?void 0:t.labelId)}return this.i18nService.t("noAccess")}get permissionTooltip(){return this.collection.id==ge.I_?this.i18nService.t("collectionAdminConsoleManaged"):""}edit(e){this.onEvent.next({type:"editCollection",item:this.collection,readonly:e})}access(e){this.onEvent.next({type:"viewCollectionAccess",item:this.collection,readonly:e})}addAccess(e){this.onEvent.next({type:"viewCollectionAccess",item:this.collection,readonly:!1,initialPermission:e})}deleteCollection(){this.onEvent.next({type:"delete",items:[{collection:this.collection}]})}onRightClick(e){e.shiftKey&&e.ctrlKey||!this.disabled&&this.menuTrigger&&this.menuTrigger.toggleMenuOnRightClick(e)}}Me.ɵfac=function(e){return new(e||Me)(m.rXU(S.W))},Me.ɵcmp=m.VBU({type:Me,selectors:[["tr","appVaultCollectionRow",""]],viewQuery:function(e,t){if(1&e&&m.GBs(g.O,5),2&e){let e;m.mGM(e=m.lsd())&&(t.menuTrigger=e.first)}},hostBindings:function(e,t){1&e&&m.bIt("contextmenu",function(e){return t.onRightClick(e)})},inputs:{disabled:"disabled",collection:"collection",showOwner:"showOwner",showCollections:"showCollections",showGroups:"showGroups",canEditCollection:"canEditCollection",canDeleteCollection:"canDeleteCollection",canViewCollectionInfo:"canViewCollectionInfo",organizations:"organizations",groups:"groups",showPermissionsColumn:"showPermissionsColumn",checked:"checked"},outputs:{onEvent:"onEvent",checkedToggled:"checkedToggled"},standalone:!1,attrs:["appVaultCollectionRow",""],decls:23,vars:28,consts:[["collectionOptions",""],["bitCell","",1,"tw-min-w-fit",3,"ngClass"],["type","checkbox","bitCheckbox","","appStopProp","",3,"disabled","checked"],["aria-hidden","true"],["bitCell","",3,"ngClass"],[1,"tw-flex"],["bitLink","","type","button","linkType","secondary","queryParamsHandling","merge","appStopProp","",1,"tw-flex","tw-text-start","tw-leading-snug","tw-truncate",3,"disabled","title","routerLink","queryParams"],[1,"tw-truncate","tw-mr-1"],["bitBadge","","type","button","variant","warning"],["bitCell","","class","tw-hidden lg:tw-table-cell",3,"ngClass",4,"ngIf"],["bitCell","",3,"ngClass",4,"ngIf"],["bitCell","",1,"tw-text-right",3,"ngClass"],["size","small","bitIconButton","bwi-ellipsis-v","type","button","appStopProp","",3,"disabled","bitMenuTriggerFor","label"],[4,"ngIf"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","checkbox","bitCheckbox","","appStopProp","",3,"change","disabled","checked"],["bitBadge","","type","button","variant","warning",3,"click"],["bitCell","",1,"tw-hidden","lg:tw-table-cell",3,"ngClass"],["appStopProp","",3,"disabled","organizationId","organizationName"],[3,"selectedGroups","allGroups",4,"ngIf"],[3,"selectedGroups","allGroups"],[1,"tw-mb-0","tw-text-muted",3,"title"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-users"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"]],template:function(e,t){1&e&&(m.j41(0,"td",1),m.nVh(1,Ce,2,5,"input",2),m.k0s(),m.j41(2,"td",1)(3,"div",3),m.nrm(4,"i"),m.k0s()(),m.j41(5,"td",4)(6,"div",5)(7,"button",6),m.nI1(8,"i18n"),m.j41(9,"span",7),m.EFF(10),m.k0s()(),m.nVh(11,Te,3,3,"button",8),m.k0s()(),m.DNE(12,Fe,3,7,"td",9)(13,Re,1,1,"td",10)(14,xe,2,2,"td",10)(15,$e,3,3,"td",10),m.j41(16,"td",11),m.nVh(17,Ee,2,6,"button",12),m.j41(18,"bit-menu",null,0),m.DNE(20,Ae,9,6,"ng-container",13)(21,De,9,6,"ng-container",13)(22,Oe,5,3,"button",14),m.k0s()()),2&e&&(m.Y8G("ngClass",t.RowHeightClass),m.R7$(),m.vxM(t.canEditCollection||t.canDeleteCollection?1:-1),m.R7$(),m.Y8G("ngClass",t.RowHeightClass),m.R7$(2),m.HbH("bwi bwi-fw bwi-lg "+(t.collection.type===t.DefaultCollectionType?"bwi-user":"bwi-collection-shared")),m.R7$(),m.Y8G("ngClass",t.RowHeightClass),m.R7$(2),m.Y8G("title",m.mNQ(m.i5U(8,22,"viewCollectionWithName",t.collection.name)))("disabled",t.disabled)("routerLink",m.lJ4(25,Ie))("queryParams",m.eq3(26,ke,t.collection.id)),m.R7$(3),m.JRh(t.collection.name),m.R7$(),m.vxM(t.showAddAccess?11:-1),m.R7$(),m.Y8G("ngIf",t.showOwner),m.R7$(),m.Y8G("ngIf",t.showCollections),m.R7$(),m.Y8G("ngIf",t.showGroups),m.R7$(),m.Y8G("ngIf",t.showPermissionsColumn),m.R7$(),m.Y8G("ngClass",t.RowHeightClass),m.R7$(),m.vxM(t.canEditCollection||t.canDeleteCollection||t.canViewCollectionInfo?17:-1),m.R7$(3),m.Y8G("ngIf",t.canEditCollection),m.R7$(),m.Y8G("ngIf",!t.canEditCollection&&t.canViewCollectionInfo),m.R7$(),m.Y8G("ngIf",t.canDeleteCollection))},dependencies:[r.YU,r.bT,s.Wk,k.x,ye.n,C.P,T.s,F.o,R.Z,g.O,P.S,$.Q,E.P,Se,M.$,U.t],encapsulation:2});var Ue=i(22466),Ge=i(32316),je=i(36572),Ne=i(69672);class Ve{}Ve.ɵfac=function(e){return new(e||Ve)},Ve.ɵmod=m.$C({type:Ve}),Ve.ɵinj=w.G2t({imports:[r.MD,s.iI,n.E9,d.G,a.b,u.t,l.KW,c.B,h.Y,o.a]}),m.wjB(b.W_,[r.bT,n.yg,n.E$,n.d6,C.P,T.s,R.Z,g.O,P.S,$.Q,Ue.Y,Ge.O,je._,je.O,Ne.lp,fe,Me],[r.Jj,M.$])},93824:(e,t,i)=>{"use strict";i.d(t,{x:()=>o});var n=i(20702),r=i(78781);class s extends n.r{constructor(e){var t;super(e),this.allowCredentials=null===(t=this.getResponseProperty("allowCredentials"))||void 0===t?void 0:t.map(e=>Object.assign(Object.assign({},e),{id:r.A.fromUrlB64ToArray(e.id).buffer})),this.challenge=r.A.fromUrlB64ToArray(this.getResponseProperty("challenge")),this.extensions=this.getResponseProperty("extensions"),this.rpId=this.getResponseProperty("rpId"),this.timeout=this.getResponseProperty("timeout"),this.userVerification=this.getResponseProperty("userVerification")}}class o extends n.r{constructor(e){super(e),this.options=new s(this.getResponseProperty("options")),this.token=this.getResponseProperty("token")}}},94438:(e,t,i)=>{"use strict";i.d(t,{p:()=>p});var n=i(94573),r=i(33277),s=i(36801),o=i(639),a=i(33812),l=i(47696);function c(e,t){1&e&&(a.j41(0,"span",3),a.EFF(1,", "),a.k0s())}function d(e,t){if(1&e&&(a.j41(0,"span",2),a.EFF(1),a.k0s(),a.nVh(2,c,2,0,"span",3)),2&e){const e=t.$implicit,i=t.$index,n=t.$count,r=a.XpG();a.Y8G("variant",r.variant())("truncate",r.truncate()),a.R7$(),a.SpI(" ",e," "),a.R7$(),a.vxM(i!==n-1||r.isFiltered()?2:-1)}}function u(e,t){if(1&e&&(a.j41(0,"span",1),a.EFF(1),a.nI1(2,"i18n"),a.k0s()),2&e){const e=a.XpG();a.Y8G("variant",e.variant()),a.R7$(),a.SpI(" ",a.i5U(2,2,"plusNMore",(e.items().length-e.filteredItems().length).toString())," ")}}function h(e){return null==e?void 0:Math.max(1,e)}class p{constructor(){this.variant=(0,n.hFB)("primary"),this.items=(0,n.hFB)([]),this.truncate=(0,n.hFB)(!0),this.maxItems=(0,n.hFB)(void 0,{transform:h}),this.filteredItems=(0,r.EW)(()=>{const e=this.maxItems(),t=this.items();return null==e||t.length<=e?t:t.slice(0,e-1)}),this.isFiltered=(0,r.EW)(()=>this.items().length>this.filteredItems().length)}}p.ɵfac=function(e){return new(e||p)},p.ɵcmp=a.VBU({type:p,selectors:[["bit-badge-list"]],inputs:{variant:[1,"variant"],items:[1,"items"],truncate:[1,"truncate"],maxItems:[1,"maxItems"]},decls:4,vars:1,consts:[[1,"tw-inline-flex","tw-flex-wrap","tw-gap-2"],["bitBadge","",3,"variant"],["bitBadge","",3,"variant","truncate"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(a.j41(0,"div",0),a.Z7z(1,d,3,4,null,null,a.fX1),a.nVh(3,u,3,5,"span",1),a.k0s()),2&e&&(a.R7$(),a.Dyx(t.filteredItems()),a.R7$(2),a.vxM(t.isFiltered()?3:-1))},dependencies:[o.E,l.n,s.$Z],encapsulation:2,changeDetection:0})},94615:(e,t,i)=>{"use strict";i.d(t,{H:()=>G});var n=i(93161),r=i(77468),s=i(33812),o=i(51757),a=i(66046),l=i(72737),c=i(3204),d=i(62179),u=i(14803),h=i(36359),p=i(8131),m=i(58625),v=i(56962),f=i(20136),g=i(88832),y=i(75583),b=i(26411),w=i(47135),S=i(58950),I=i(14318),k=i(29776),C=i(36801),T=i(50700),F=i(58806),R=i(90246),P=i(86226),x=i(93199),$=i(97553),E=i(43759),A=i(50352),D=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function O(e,t){1&e&&(s.j41(0,"bit-section-header")(1,"h6",9),s.EFF(2),s.nI1(3,"i18n"),s.k0s()()),2&e&&(s.R7$(2),s.JRh(s.bMT(3,1,"options")))}function M(e,t){1&e&&(s.j41(0,"p",8),s.EFF(1),s.nI1(2,"i18n"),s.k0s()),2&e&&(s.R7$(),s.JRh(s.bMT(2,1,"generatorPolicyInEffect")))}const U=Object.freeze({numWords:"numWords",includeNumber:"includeNumber",capitalize:"capitalize",wordSeparator:"wordSeparator"});class G{constructor(e,t,i,n){this.formBuilder=e,this.generatorService=t,this.i18nService=i,this.logService=n,this.debug=!1,this.log=(0,f.S2)({}),this.account=null,this.account$=new l.m(1),this.showHeader=!0,this.disableMargin=!1,this.onUpdated=new s.bkB,this.settings=this.formBuilder.group({[U.numWords]:[0],[U.wordSeparator]:[""],[U.capitalize]:[!1],[U.includeNumber]:[!1]}),this.wordSeparatorMaxLength=0,this.saveSettings=new a.B,this.policyInEffect=!1,this.numWordsBoundariesHint=new l.m(1),this.numWordsBoundariesHint$=this.numWordsBoundariesHint.asObservable(),this.destroyed$=new a.B}ngOnChanges(e){return D(this,void 0,void 0,function*(){"account"in e&&e.account&&this.account$.next(this.account)})}ngOnInit(){return D(this,void 0,void 0,function*(){this.log=(0,f.mJ)(this.debug,this.logService,{type:"PassphraseSettingsComponent"});const e=yield this.generatorService.settings(k.qG.passphrase,{account$:this.account$});e.withConstraints$.pipe((0,h.M)(e=>this.log.debug(e,"passphrase settings loaded with constraints")),(0,u.Q)(this.destroyed$)).subscribe(({state:e,constraints:t})=>{var i,n,r,s,o,a,l,c,d;this.settings.patchValue(e,{emitEvent:!1});let u=this.i18nService.t("spinboxBoundariesHint",null===(n=null===(i=t.numWords)||void 0===i?void 0:i.min)||void 0===n?void 0:n.toString(),null===(s=null===(r=t.numWords)||void 0===r?void 0:r.max)||void 0===s?void 0:s.toString());(null!==(o=e.numWords)&&void 0!==o?o:0)<=(null!==(l=null===(a=t.numWords)||void 0===a?void 0:a.recommendation)&&void 0!==l?l:0)&&(u+=this.i18nService.t("passphraseNumWordsRecommendationHint",null===(d=null===(c=t.numWords)||void 0===c?void 0:c.recommendation)||void 0===d?void 0:d.toString())),this.numWordsBoundariesHint.next(u)}),e.pipe((0,d.i)(1),(0,h.M)(e=>this.log.debug(e,"passphrase settings onUpdate event")),(0,u.Q)(this.destroyed$)).subscribe(this.onUpdated),this.generatorService.policy$(k.qG.passphrase,{account$:this.account$}).pipe((0,u.Q)(this.destroyed$)).subscribe(({constraints:e})=>{var t,i,n,r,s;this.wordSeparatorMaxLength=null!==(i=null===(t=e.wordSeparator)||void 0===t?void 0:t.maxLength)&&void 0!==i?i:0,this.policyInEffect=null!==(n=e.policyInEffect)&&void 0!==n&&n,this.toggleEnabled(U.capitalize,!(null===(r=e.capitalize)||void 0===r?void 0:r.readonly)),this.toggleEnabled(U.includeNumber,!(null===(s=e.includeNumber)||void 0===s?void 0:s.readonly))}),this.saveSettings.pipe((0,p.E)(this.settings.valueChanges),(0,h.M)(([e,t])=>this.log.debug({source:e,form:t},"save passphrase settings request")),(0,c.T)(([,e])=>e),(0,u.Q)(this.destroyed$)).subscribe(e)})}save(e="component api call"){this.saveSettings.next(e)}toggleEnabled(e,t){var i,n;t?null===(i=this.settings.get(e))||void 0===i||i.enable({emitEvent:!1}):null===(n=this.settings.get(e))||void 0===n||n.disable({emitEvent:!1})}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}}G.ɵfac=function(e){return new(e||G)(s.rXU(o.ok),s.rXU(k.iE),s.rXU(T.W),s.rXU(v.K))},G.ɵcmp=s.VBU({type:G,selectors:[["tools-passphrase-settings"]],inputs:{debug:"debug",account:"account",showHeader:"showHeader",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onUpdated:"onUpdated"},features:[s.OA$],decls:31,vars:21,consts:[[3,"disableMargin"],[1,"tw-container",3,"formGroup"],[1,"tw-mb-4"],["disableMargin",""],["bitInput","","formControlName","numWords","id","num-words","type","number",3,"change"],["bitInput","","formControlName","wordSeparator","id","word-separator","type","text",3,"change","maxlength"],["bitCheckbox","","formControlName","capitalize","id","capitalize","type","checkbox",3,"change"],["bitCheckbox","","formControlName","includeNumber","id","include-number","type","checkbox",3,"change"],["bitTypography","helper"],["bitTypography","h6"]],template:function(e,t){1&e&&(s.j41(0,"bit-section",0),s.nVh(1,O,4,3,"bit-section-header"),s.j41(2,"form",1)(3,"div",2)(4,"bit-card")(5,"bit-form-field",3)(6,"bit-label"),s.EFF(7),s.nI1(8,"i18n"),s.k0s(),s.j41(9,"input",4),s.bIt("change",function(){return t.save("numWords")}),s.k0s(),s.j41(10,"bit-hint"),s.EFF(11),s.nI1(12,"async"),s.k0s()()()(),s.j41(13,"div")(14,"bit-card")(15,"bit-form-field")(16,"bit-label"),s.EFF(17),s.nI1(18,"i18n"),s.k0s(),s.j41(19,"input",5),s.bIt("change",function(){return t.save("wordSeparator")}),s.k0s()(),s.j41(20,"bit-form-control")(21,"input",6),s.bIt("change",function(){return t.save("capitalize")}),s.k0s(),s.j41(22,"bit-label"),s.EFF(23),s.nI1(24,"i18n"),s.k0s()(),s.j41(25,"bit-form-control",0)(26,"input",7),s.bIt("change",function(){return t.save("includeNumber")}),s.k0s(),s.j41(27,"bit-label"),s.EFF(28),s.nI1(29,"i18n"),s.k0s()(),s.nVh(30,M,3,3,"p",8),s.k0s()()()()),2&e&&(s.Y8G("disableMargin",t.disableMargin),s.R7$(),s.vxM(t.showHeader?1:-1),s.R7$(),s.Y8G("formGroup",t.settings),s.R7$(5),s.JRh(s.bMT(8,11,"numWords")),s.R7$(4),s.JRh(s.bMT(12,13,t.numWordsBoundariesHint$)),s.R7$(6),s.JRh(s.bMT(18,15,"wordSeparator")),s.R7$(2),s.Y8G("maxlength",t.wordSeparatorMaxLength),s.R7$(4),s.JRh(s.bMT(24,17,"capitalize")),s.R7$(2),s.Y8G("disableMargin",!t.policyInEffect),s.R7$(3),s.JRh(s.bMT(29,19,"includeNumber")),s.R7$(2),s.vxM(t.policyInEffect?30:-1))},dependencies:[g.n,S.U,y.E,F.r,o.X1,o.qT,o.me,o.Q0,o.Zm,o.BC,o.cb,o.tU,o.j4,o.JD,I.i,b.L,R.f,P.j,x.I,$.J,E.h,w.q,A.P,m.p,r.Jj,C.$Z],encapsulation:2})},95668:(e,t,i)=>{"use strict";i.d(t,{u:()=>o});var n=i(39306),r=i(17989),s=i(48550);class o extends r.A{constructor(e){super(),null!=e&&(this.hidden=e.hidden,this.buildDomainModel(this,e,{text:null},[]))}decrypt(e){return this.decryptObj(this,new s.t(this),["text"],e)}static fromJSON(e){return null==e?null:Object.assign(new o,e,{text:n.k.fromJSON(e.text)})}}},95919:(e,t,i)=>{"use strict";i.d(t,{n:()=>r});var n=i(20702);class r extends n.r{constructor(e=null){if(super(e),null==e)return this;this.accessEventLogs=this.getResponseProperty("AccessEventLogs"),this.accessImportExport=this.getResponseProperty("AccessImportExport"),this.accessReports=this.getResponseProperty("AccessReports"),this.createNewCollections=this.getResponseProperty("CreateNewCollections"),this.editAnyCollection=this.getResponseProperty("EditAnyCollection"),this.deleteAnyCollection=this.getResponseProperty("DeleteAnyCollection"),this.manageCiphers=this.getResponseProperty("ManageCiphers"),this.manageGroups=this.getResponseProperty("ManageGroups"),this.manageSso=this.getResponseProperty("ManageSso"),this.managePolicies=this.getResponseProperty("ManagePolicies"),this.manageUsers=this.getResponseProperty("ManageUsers"),this.manageResetPassword=this.getResponseProperty("ManageResetPassword"),this.manageScim=this.getResponseProperty("ManageScim")}}},95982:(e,t,i)=>{"use strict";var n=i(38450),r=i(94573),s=i(34003),o=i(45795),a=i(51757),l=i(71458),c=i(83731),d=i(66046),u=i(72245),h=i(69194),p=i(22485),m=i(3204),v=i(28202),f=i(93241),g=i(67553),y=i(84110),b=i(3633),w=i(44997),S=i(31857),I=i(22848),k=i(33812),C=i(74208),T=i(52396),F=i(74526),R=i(5556),P=i(68455),x=i(23649),$=i(69855),E=i(21274),A=i(62179),D=i(80909),O=i(36359),M=i(82468),U=i(1601);class G{constructor(){this.router=(0,C.WQX)(x.Ix),this.configService=(0,C.WQX)(U.w),this.start$=this.router.events.pipe((0,c.pQ)(),(0,h.p)(e=>e instanceof x.wF),(0,A.i)(1),(0,D.v)(this.configService.getFeatureFlag$(M.TO.RouterFocusManagement)),(0,h.p)(([e,t])=>t),(0,m.T)(()=>{var e;const t=null===(e=this.router.getCurrentNavigation())||void 0===e?void 0:e.extras;return null==t?void 0:t.info}),(0,h.p)(e=>void 0===e||!1!==(null==e?void 0:e.focusMainAfterNav)),(0,O.M)(()=>{const e=document.querySelector("main");e&&e.focus()}))}}G.ɵfac=function(e){return new(e||G)},G.ɵprov=C.jDH({token:G,factory:G.ɵfac,providedIn:"root"});var j=i(50700),N=i(37115),V=i(54351),B=i(15055),z=i(19543),L=i(35500),K=i(76599),q=i(16436),_=i(90268),X=i(83078),Y=i(77468),H=i(82630);class W{constructor(e){this.toastrService=e,this.toastContainer=(0,r.ebz)(H.kZ)}ngOnInit(){this.toastrService.overlayContainer=this.toastContainer()}}W.ɵfac=function(e){return new(e||W)(k.rXU(H.tw))},W.ɵcmp=k.VBU({type:W,selectors:[["bit-toast-container"]],viewQuery:function(e,t){1&e&&k.wEZ(t.toastContainer,H.kZ,5),2&e&&k.NyB()},decls:1,vars:0,consts:[["role","status","aria-live","polite","aria-atomic","true","toastContainer",""]],template:function(e,t){1&e&&k.nrm(0,"div",0)},dependencies:[H.kZ],encapsulation:2});var J=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Z(e,t){1&e&&(k.j41(0,"div",2)(1,"div",3),k.nrm(2,"img",4),k.k0s(),k.j41(3,"div",5),k.nrm(4,"i",6),k.k0s(),k.j41(5,"div",7)(6,"div",8),C.qSk(),k.j41(7,"svg",9)(8,"g",10),k.nrm(9,"path",11)(10,"path",12)(11,"path",13)(12,"path",14)(13,"path",15)(14,"path",16)(15,"path",17)(16,"path",18)(17,"path",19)(18,"path",20)(19,"path",21)(20,"path",22)(21,"path",23)(22,"path",24)(23,"path",25)(24,"path",26)(25,"path",27)(26,"path",28),k.k0s(),k.j41(27,"defs")(28,"clipPath",29),k.nrm(29,"path",30),k.k0s()()(),k.EFF(30," `; "),k.k0s(),C.joV(),k.j41(31,"div",31),C.qSk(),k.j41(32,"svg",32)(33,"g",33),k.nrm(34,"path",34)(35,"path",35)(36,"path",36)(37,"circle",37)(38,"circle",38)(39,"path",39)(40,"path",40)(41,"path",41)(42,"path",42)(43,"path",43)(44,"path",44)(45,"path",45)(46,"path",46)(47,"path",47)(48,"path",48),k.k0s(),k.j41(49,"defs")(50,"clipPath",49),k.nrm(51,"path",50),k.k0s()()()()()())}function Q(e,t){1&e&&(k.qex(0),k.nrm(1,"router-outlet"),k.bVm())}const ee="AppComponent";class te{constructor(e,t,i,n,r,s,o,a,l,u,h,p,m,v,f,g,y,b,w,S,I,k,C,T,F,R,P,x){this.broadcasterService=e,this.folderService=t,this.cipherService=i,this.authService=n,this.router=r,this.toastService=s,this.i18nService=o,this.platformUtilsService=a,this.ngZone=l,this.keyService=u,this.lockService=h,this.collectionService=p,this.searchService=m,this.serverNotificationsService=v,this.stateService=f,this.eventUploadService=g,this.configService=y,this.dialogService=b,this.biometricStateService=w,this.stateEventRunnerService=S,this.organizationService=I,this.accountService=k,this.processReloadService=C,this.deviceTrustToastService=T,this.destroy=F,this.documentLangSetter=R,this.tokenService=P,this.routerFocusManager=x,this.lastActivity=null,this.idleTimer=null,this.isIdle=!1,this.destroy$=new d.B,this.loading=!1,this.deviceTrustToastService.setupListeners$.pipe((0,c.pQ)()).subscribe();const $=this.documentLangSetter.start();this.routerFocusManager.start$.pipe((0,c.pQ)()).subscribe(),this.destroy.onDestroy(()=>{$.unsubscribe()})}ngOnInit(){this.ngZone.runOutsideAngular(()=>{window.onmousemove=()=>this.recordActivity(),window.onmousedown=()=>this.recordActivity(),window.ontouchstart=()=>this.recordActivity(),window.onclick=()=>this.recordActivity(),window.onscroll=()=>this.recordActivity(),window.onkeypress=()=>this.recordActivity()}),this.broadcasterService.subscribe(ee,e=>J(this,void 0,void 0,function*(){this.ngZone.run(()=>J(this,void 0,void 0,function*(){switch(e.command){case"authBlocked":this.router.navigate(["/"]);break;case"logout":yield this.logOut(e.redirect);break;case"lockVault":{const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.lockService.lock(e);break}case"locked":yield this.processReloadService.startProcessReload();break;case"lockedUrl":case"syncStarted":default:break;case"syncCompleted":e.successfully&&(yield this.configService.ensureConfigFetched());break;case"upgradeOrganization":(yield this.dialogService.openSimpleDialog({title:{key:"upgradeOrganization"},content:{key:"upgradeOrganizationDesc"},acceptButtonText:{key:"upgradeOrganization"},type:"info"}))&&this.router.navigate(["organizations",e.organizationId,"billing","subscription"]);break;case"emailVerificationRequired":(yield this.dialogService.openSimpleDialog({title:{key:"emailVerificationRequired"},content:{key:"emailVerificationRequiredDesc"},acceptButtonText:{key:"learnMore"},type:"info"}))&&this.platformUtilsService.launchUri("https://bitwarden.com/help/create-bitwarden-account/");break;case"showToast":this.toastService._showToast(e);break;case"convertAccountToKeyConnector":this.router.navigate(["/remove-password"]);break;case"syncOrganizationStatusChanged":{const{organizationId:t,enabled:i}=e,n=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),r=(yield(0,u._)(this.organizationService.organizations$(n))).find(e=>e.id===t);if(r){const e=Object.assign(Object.assign({},r),{enabled:i});yield this.organizationService.upsert(e,n)}break}case"syncOrganizationCollectionSettingChanged":{const{organizationId:t,limitCollectionCreation:i,limitCollectionDeletion:n}=e,r=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),s=(yield(0,u._)(this.organizationService.organizations$(r))).find(e=>e.id===t);s&&(yield this.organizationService.upsert(Object.assign(Object.assign({},s),{limitCollectionCreation:i,limitCollectionDeletion:n}),r));break}}}))}))}ngOnDestroy(){this.broadcasterService.unsubscribe(ee),this.destroy$.next(),this.destroy$.complete()}logOut(){return J(this,arguments,void 0,function*(e=!0){this.ngZone.run(()=>{this.loading=!0,document.body.classList.add("layout_frontend")}),yield this.eventUploadService.uploadEvents();const t=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),i=(0,u._)(this.authService.authStatusFor$(t).pipe((0,h.p)(e=>e===y.J.LoggedOut),(0,p.w)({first:5e3,with:()=>{throw new Error("The logout process did not complete in a reasonable amount of time.")}})));yield Promise.all([this.keyService.clearKeys(t),this.cipherService.clear(t),this.folderService.clear(t),this.biometricStateService.logout(t)]),yield this.stateEventRunnerService.handleEvent("logout",t),yield this.searchService.clearIndex(t),this.authService.logOut(()=>J(this,void 0,void 0,function*(){yield this.stateService.clean({userId:t}),yield this.tokenService.clearAccessToken(t),yield this.accountService.clean(t),yield this.accountService.switchAccount(null),yield i,e&&(yield this.router.navigate(["/"])),yield this.processReloadService.startProcessReload()}),t)})}recordActivity(){return J(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.id))),t=new Date;null!=this.lastActivity&&t.getTime()-this.lastActivity.getTime()<250||(this.lastActivity=t,yield this.accountService.setAccountActivity(e,t),this.isIdle&&(this.isIdle=!1,this.idleStateChanged()),null!=this.idleTimer&&(window.clearTimeout(this.idleTimer),this.idleTimer=null),this.idleTimer=window.setTimeout(()=>{this.isIdle||(this.isIdle=!0,this.idleStateChanged())},6e5))})}idleStateChanged(){this.isIdle?this.serverNotificationsService.disconnectFromInactivity():this.serverNotificationsService.reconnectFromActivity()}}te.ɵfac=function(e){return new(e||te)(k.rXU(T.y),k.rXU(F.Z),k.rXU(R.p),k.rXU(P.u),k.rXU(x.Ix),k.rXU($.f),k.rXU(j.W),k.rXU(N.y),k.rXU(k.SKi),k.rXU(I.Lu),k.rXU(f.FQ),k.rXU(v.YD),k.rXU(V.S),k.rXU(B.J),k.rXU(w.d),k.rXU(z.f),k.rXU(U.w),k.rXU(E.o3),k.rXU(I.vB),k.rXU(S.lR),k.rXU(g.k4),k.rXU(L.Di),k.rXU(K.Y),k.rXU(q.T),k.rXU(C.abz),k.rXU(_.n),k.rXU(X.B),k.rXU(G))},te.ɵcmp=k.VBU({type:te,selectors:[["app-root"]],standalone:!1,decls:4,vars:2,consts:[["loadingState",""],[4,"ngIf","ngIfElse"],[1,"tw-flex","tw-flex-col","tw-min-h-[100vh]"],[1,"tw-pt-5","tw-px-5","tw-fixed"],["alt","Vaultwarden",1,"new-logo-themed","!tw-w-[200px]"],[1,"spinner-container","tw-justify-center"],["title","Loading","aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-muted"],[1,"tw-relative","tw-grow"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","[&_svg]:tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-start-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 501 226"],["clip-path","url(#left-a)"],["d","M-71.691 6.821a4 4 0 0 1 4-4h296.5a4 4 0 0 1 4 4v188a4 4 0 0 1-4 4h-296.5a4 4 0 0 1-4-4v-188Z",1,"tw-fill-illustration-bg-primary"],["d","M-48.941 25.821a2 2 0 0 1 2-2h127.5v154h-127.5a2 2 0 0 1-2-2v-150Z",1,"tw-fill-illustration-bg-primary"],["d","M80.559 25.82a2 2 0 0 1 2-2h125.5a2 2 0 0 1 2 2v150.001a2 2 0 0 1-2 2h-125.5a2 2 0 0 1-2-2v-150ZM45.871 89.854c0 17.155-13.96 31.062-31.182 31.062-17.221 0-31.182-13.907-31.182-31.062s13.96-31.062 31.182-31.062c17.221 0 31.182 13.907 31.182 31.062Z",1,"tw-fill-illustration-bg-tertiary"],["d","M72.396 153.443a57.243 57.243 0 0 1 4.663 22.604v1.222a2 2 0 0 1-2 2h-118.5a2 2 0 0 1-2-2v-1.222a57.243 57.243 0 0 1 4.662-22.604c3.078-7.167 7.59-13.678 13.277-19.163 5.688-5.485 12.44-9.836 19.871-12.805a63.228 63.228 0 0 1 23.44-4.496 63.227 63.227 0 0 1 23.439 4.496c7.431 2.969 14.183 7.32 19.87 12.805 5.688 5.485 10.2 11.996 13.278 19.163Z",1,"tw-fill-illustration-bg-tertiary"],["d","M161.629 57.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625 0-9.181 7.579-16.625 16.928-16.625 9.348 0 16.927 7.444 16.927 16.625Z",1,"tw-fill-illustration-bg-secondary"],["d","M176.028 89.071a29.33 29.33 0 0 1 2.531 11.894c0 .937-.759 1.696-1.696 1.696h-63.109a1.695 1.695 0 0 1-1.695-1.696c0-4.081.86-8.123 2.531-11.894 1.671-3.77 4.12-7.197 7.207-10.083 3.088-2.886 6.753-5.176 10.787-6.738a35.275 35.275 0 0 1 12.725-2.366c4.366 0 8.69.804 12.724 2.366 4.034 1.562 7.699 3.852 10.787 6.738 3.087 2.886 5.537 6.312 7.208 10.083ZM161.629 134.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625s7.579-16.625 16.928-16.625c9.348 0 16.927 7.443 16.927 16.625Z",1,"tw-fill-illustration-bg-secondary"],["d","M176.028 165.953a28.993 28.993 0 0 1 2.531 11.821c0 .93-.755 1.684-1.685 1.684h-63.131c-.93 0-1.684-.754-1.684-1.684 0-4.057.86-8.074 2.531-11.821 1.671-3.748 4.12-7.153 7.207-10.021 3.088-2.869 6.753-5.144 10.787-6.696a35.456 35.456 0 0 1 12.725-2.352c4.366 0 8.69.799 12.724 2.352 4.034 1.552 7.699 3.827 10.787 6.696 3.087 2.868 5.537 6.273 7.208 10.021ZM-87.441 199.521h332.5v14.5c0 5.523-4.478 10-10 10h-312.5c-5.523 0-10-4.477-10-10v-14.5Z",1,"tw-fill-illustration-bg-secondary"],["fill-rule","evenodd","d","M208.059 21.82a4 4 0 0 1 4 4v150.001a4 4 0 0 1-4 4l-255 .001a4 4 0 0 1-4-4v-150a4 4 0 0 1 4-4l255-.001Zm-255 154.002h1.5a57.23 57.23 0 0 1 4.378-21.706l.284-.673c2.982-6.943 7.31-13.27 12.748-18.646l.529-.517c5.688-5.485 12.44-9.836 19.871-12.805a62.937 62.937 0 0 1 10.036-3.065c-11.113-4.751-18.897-15.747-18.897-28.556 0-17.155 13.96-31.061 31.182-31.062 17.22 0 31.18 13.907 31.181 31.062 0 12.537-7.457 23.338-18.192 28.245a62.952 62.952 0 0 1 11.569 3.376c7.431 2.969 14.184 7.32 19.871 12.805 5.688 5.485 10.2 11.996 13.278 19.163a57.251 57.251 0 0 1 4.66 22.379h1.502v-150h-125.5v150Zm129.5-.001h29.568a29.02 29.02 0 0 1 2.159-9.161l.304-.706c1.671-3.748 4.12-7.154 7.207-10.022 2.894-2.689 6.297-4.857 10.035-6.396l.752-.299c.996-.383 2.01-.721 3.037-1.012-4.602-2.879-7.693-7.881-7.841-13.602l-.006-.429c0-9.182 7.579-16.625 16.928-16.625l.437.006c9.146.227 16.49 7.581 16.49 16.619l-.006.429c-.144 5.571-3.08 10.461-7.484 13.372 1.321.338 2.622.752 3.894 1.242 4.034 1.552 7.7 3.827 10.787 6.695 3.088 2.868 5.536 6.274 7.207 10.022a29.066 29.066 0 0 1 2.462 9.867h29.57v-73h-125.5v73Zm62.75-24.936c-3.881 0-7.718.71-11.288 2.084-3.571 1.374-6.797 3.382-9.501 5.894-2.704 2.511-4.831 5.478-6.277 8.72a25.125 25.125 0 0 0-2.074 7.876h58.279a25.125 25.125 0 0 0-2.074-7.876c-1.445-3.242-3.573-6.209-6.276-8.72-2.705-2.512-5.931-4.52-9.501-5.894a31.473 31.473 0 0 0-11.288-2.084Zm-129.5-29.906a59.215 59.215 0 0 0-21.955 4.211c-6.957 2.779-13.269 6.848-18.579 11.969-5.31 5.12-9.513 11.191-12.378 17.862a53.266 53.266 0 0 0-4.332 20.248H73.053a53.266 53.266 0 0 0-4.332-20.248c-2.866-6.671-7.07-12.742-12.38-17.862-5.31-5.121-11.621-9.19-18.577-11.969a59.215 59.215 0 0 0-21.955-4.211Zm128.893.59c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625ZM14.69 62.792c-15.027 0-27.182 12.13-27.182 27.062 0 14.931 12.155 27.062 27.181 27.063 15.027-.001 27.182-12.132 27.182-27.063S29.716 62.793 14.69 62.792Zm67.869 36.029h29.579c.229-3.094.952-6.141 2.148-9.04l.304-.71a30.936 30.936 0 0 1 6.636-9.536l.571-.547a33.416 33.416 0 0 1 10.035-6.437l.752-.3a34.78 34.78 0 0 1 3.047-1.021c-4.607-2.878-7.703-7.883-7.851-13.607l-.006-.43c0-9.18 7.579-16.624 16.928-16.624l.437.006c9.146.227 16.49 7.58 16.49 16.619l-.006.429c-.144 5.574-3.082 10.465-7.49 13.376 1.324.34 2.626.758 3.9 1.252 4.034 1.561 7.7 3.85 10.787 6.737 3.088 2.886 5.536 6.312 7.207 10.083a29.407 29.407 0 0 1 2.451 9.75h29.581v-73h-125.5v73Zm62.75-24.937c-3.878 0-7.712.714-11.281 2.096-3.568 1.382-6.795 3.401-9.5 5.93-2.704 2.528-4.833 5.515-6.281 8.782a25.432 25.432 0 0 0-2.08 7.969h58.283a25.432 25.432 0 0 0-2.08-7.97c-1.447-3.266-3.577-6.253-6.281-8.781-2.705-2.529-5.931-4.548-9.5-5.93a31.275 31.275 0 0 0-11.28-2.096Zm-.607-29.315c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["fill-rule","evenodd","d","M228.809.822a6 6 0 0 1 6 6v188a5.97 5.97 0 0 1-.643 2.699h12.893v16.5c0 6.627-5.373 12-12 12h-312.5c-6.628 0-12-5.373-12-12v-16.5h16.391a5.966 5.966 0 0 1-.634-2.391l-.007-.308v-188a6 6 0 0 1 6-6h296.5ZM-85.441 214.02a8 8 0 0 0 8 8h312.5a8 8 0 0 0 8-8v-12.5h-328.5v12.5Zm17.75-209.2a2 2 0 0 0-2 2v188.001l.01.204a2 2 0 0 0 1.99 1.796h296.5a2.001 2.001 0 0 0 2-2v-188a2 2 0 0 0-2-2h-296.5Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","M378.821 114.003a1.997 1.997 0 0 0-.675 1.497v8.396c0 .583.254 1.136.697 1.515l11.455 9.825a2 2 0 0 1 .543 2.286l-4.203 10.056a1.998 1.998 0 0 1-1.936 1.224l-15.288-.717a1.997 1.997 0 0 0-1.501.579l-6.014 5.979a1.995 1.995 0 0 0-.583 1.569l1.145 14.942a1.997 1.997 0 0 1-1.22 1.995l-9.958 4.169a1.997 1.997 0 0 1-2.252-.503l-10.221-11.309a1.998 1.998 0 0 0-1.482-.658h-8.474c-.579 0-1.129.252-1.508.689l-9.889 11.4a1.998 1.998 0 0 1-2.28.534l-9.969-4.174a1.998 1.998 0 0 1-1.224-1.937l.721-15.182a2 2 0 0 0-.587-1.51l-6.014-5.98a1.996 1.996 0 0 0-1.559-.575l-15.049 1.14a1.997 1.997 0 0 1-1.993-1.221l-4.198-10.045a1.997 1.997 0 0 1 .512-2.258l11.363-10.155c.424-.379.666-.92.666-1.489v-8.403c0-.583-.254-1.136-.696-1.516l-11.456-9.824a1.997 1.997 0 0 1-.542-2.286L279.354 92a1.998 1.998 0 0 1 1.936-1.224l15.288.717a1.998 1.998 0 0 0 1.502-.579l6.007-5.974c.418-.415.631-.995.582-1.582l-1.292-15.419a1.995 1.995 0 0 1 1.218-2.008l9.942-4.163a1.996 1.996 0 0 1 2.258.51l10.552 11.786c.379.423.92.665 1.488.665h8.469c.579 0 1.129-.25 1.508-.688l9.889-11.4a1.996 1.996 0 0 1 2.279-.534l9.97 4.174a1.999 1.999 0 0 1 1.224 1.937l-.721 15.181a2 2 0 0 0 .587 1.51l6.014 5.98c.411.41.98.62 1.558.576l15.049-1.14a1.996 1.996 0 0 1 1.993 1.22l4.195 10.036c.33.79.12 1.702-.521 2.268l-11.507 10.154Z",1,"tw-fill-illustration-bg-primary"],["fill-rule","evenodd","d","M313.765 59.926a3.994 3.994 0 0 1 4.518 1.02l10.552 11.786h8.469l9.888-11.4a3.994 3.994 0 0 1 4.559-1.067l9.97 4.174a3.994 3.994 0 0 1 2.447 3.873l-.72 15.182 6.013 5.98 15.049-1.14a3.995 3.995 0 0 1 3.987 2.442l4.194 10.035a3.992 3.992 0 0 1-1.042 4.534L380.142 115.5v8.396l11.456 9.824a3.995 3.995 0 0 1 1.085 4.571l-4.203 10.056a3.993 3.993 0 0 1-3.872 2.449l-15.288-.717-6.013 5.98 1.145 14.943a3.994 3.994 0 0 1-2.44 3.988l-9.958 4.169a3.992 3.992 0 0 1-4.505-1.005l-10.221-11.309h-8.474l-9.889 11.4a3.993 3.993 0 0 1-4.559 1.067l-9.97-4.174a3.993 3.993 0 0 1-2.446-3.873l.72-15.181-6.014-5.98-15.049 1.14a3.993 3.993 0 0 1-3.986-2.442l-4.198-10.045a3.993 3.993 0 0 1 1.023-4.517l11.363-10.155v-8.403l-11.455-9.825a3.992 3.992 0 0 1-1.085-4.571l4.203-10.056a3.993 3.993 0 0 1 3.872-2.45l15.287.718 6.008-5.974-1.292-15.418a3.992 3.992 0 0 1 2.437-4.017l9.941-4.163Zm1.543 3.684-9.942 4.162 1.292 15.419a3.992 3.992 0 0 1-1.163 3.165l-6.008 5.974a3.994 3.994 0 0 1-3.003 1.157l-15.288-.717-4.202 10.056 11.455 9.824a3.993 3.993 0 0 1 1.394 3.032v8.403c0 1.137-.485 2.22-1.332 2.978l-11.364 10.154 4.198 10.045 15.049-1.14a3.994 3.994 0 0 1 3.118 1.15l6.014 5.98a3.996 3.996 0 0 1 1.173 3.021l-.72 15.181 9.969 4.175 9.889-11.401a3.994 3.994 0 0 1 3.017-1.377h8.474c1.129 0 2.206.478 2.963 1.316l10.221 11.309 9.958-4.169-1.145-14.943a3.996 3.996 0 0 1 1.166-3.137l6.013-5.979a3.997 3.997 0 0 1 3.003-1.158l15.288.717 4.203-10.056-11.456-9.824a3.995 3.995 0 0 1-1.393-3.031V115.5c0-1.146.492-2.236 1.351-2.994l11.506-10.155-4.194-10.035-15.049 1.14a3.991 3.991 0 0 1-3.117-1.15l-6.014-5.98a3.99 3.99 0 0 1-1.173-3.022l.72-15.181-9.97-4.174-9.889 11.4a3.992 3.992 0 0 1-3.016 1.377h-8.469a3.992 3.992 0 0 1-2.975-1.33L315.308 63.61Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","M353.438 119.624c0 11.289-9.152 20.441-20.442 20.441-11.289 0-20.441-9.152-20.441-20.441 0-11.29 9.152-20.442 20.441-20.442 11.29 0 20.442 9.152 20.442 20.442Z",1,"tw-fill-illustration-logo"],["fill-rule","evenodd","d","M332.996 101.179c-10.186 0-18.444 8.258-18.444 18.444 0 10.187 8.258 18.445 18.444 18.445 10.187 0 18.445-8.258 18.445-18.445 0-10.186-8.258-18.444-18.445-18.444Zm-22.438 18.444c0-12.392 10.046-22.438 22.438-22.438 12.393 0 22.439 10.046 22.439 22.438 0 12.393-10.046 22.439-22.439 22.439-12.392 0-22.438-10.046-22.438-22.439Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","m497.152 164.106-7.588-7.587a3.004 3.004 0 0 0-4.245-.003l-4.055 4.047 11.83 11.83 4.055-4.047a2.996 2.996 0 0 0 .003-4.24Z",1,"tw-fill-illustration-bg-tertiary"],["d","M500.922 194.274c0 22.644-18.356 41-41 41s-41-18.356-41-41 18.356-41 41-41 41 18.356 41 41Z",1,"tw-fill-illustration-bg-secondary"],["d","M459.03 177.416a2 2 0 1 1 4 0v18.469c0 .613-.282 1.192-.763 1.571l-12.032 9.48a2.001 2.001 0 0 1-2.809-.333 2.002 2.002 0 0 1 .334-2.809l11.27-8.881v-17.497Z",1,"tw-fill-illustration-outline"],["d","M450.936 144.041a2 2 0 0 1 2-2h13.972a2 2 0 0 1 2 2v3.863a2 2 0 0 1-2 2h-13.972a2 2 0 0 1-2-2v-3.863Z",1,"tw-fill-illustration-bg-tertiary"],["fill-rule","evenodd","d","M467.114 140.046a4 4 0 0 1 3.794 3.995v3.863a3.999 3.999 0 0 1-3.931 3.998v1.978a40.72 40.72 0 0 1 13.484 4.903l3.69-3.68a5.008 5.008 0 0 1 7.076.003l7.587 7.588.177.186a4.994 4.994 0 0 1-.181 6.881l-3.615 3.606a40.801 40.801 0 0 1 5.727 20.907c0 22.644-18.357 41-41 41-22.644 0-41-18.356-41-41 0-20.434 14.949-37.375 34.507-40.487v-1.883h-.493a4 4 0 0 1-4-4v-3.863a4 4 0 0 1 4-4h13.972l.206.005Zm-7.192 17.228c-20.435 0-37 16.566-37 37 0 20.435 16.565 37 37 37 20.434 0 37-16.565 37-37 0-20.434-16.566-37-37-37Zm28.473.658a1.002 1.002 0 0 0-1.416-.001l-2.638 2.633 9.001 9.002 2.639-2.633a1 1 0 0 0 .07-1.338l-.069-.075-7.587-7.588Zm-30.966-6.028v1.447a41.171 41.171 0 0 1 5.548.036v-1.483h-5.548Zm-4.493-4h13.972v-3.863h-13.972v3.863Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["id","left-a"],["d","M0 0h501v226H0z",1,"tw-fill-illustration-bg-tertiary"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-end-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 506 297"],["clip-path","url(#right-a)"],["d","M45.673 294.742v-29.124l22.323 16.198-15.395 15.75a4.04 4.04 0 0 1-6.928-2.824Z",1,"tw-fill-illustration-bg-primary"],["d","m4.978 240.865 95.568-44.738c3.52-1.648 7.492 1.175 7.093 5.041l-9.608 93.173c-.395 3.823-4.774 5.79-7.893 3.547l-43.43-31.233-41.47-16.621c-4.06-1.627-4.221-7.315-.26-9.169Z",1,"tw-fill-illustration-bg-tertiary"],["d","M99.698 194.315c4.929-2.306 10.489 1.645 9.931 7.058l-9.608 93.174c-.552 5.351-6.683 8.105-11.05 4.965l-20.832-14.983-14.107 14.435a6.04 6.04 0 0 1-10.359-4.222v-27.151l-39.178-15.7c-5.684-2.278-5.91-10.242-.364-12.838l95.567-44.738Zm5.953 6.648c.239-2.32-2.144-4.013-4.256-3.025L5.827 242.676c-2.376 1.112-2.28 4.525.156 5.502l40.159 16.093 26.703-30.327a2.001 2.001 0 0 1 3.002 2.644l-26.178 29.731 41.637 29.945c1.872 1.346 4.5.165 4.736-2.128l9.609-93.173Zm-57.978 93.779a2.04 2.04 0 0 0 3.498 1.426l13.684-14.001-17.182-12.357v24.932Z",1,"tw-fill-illustration-outline"],["cx","86.719","cy","86.719","r","84.719","stroke","#020F66","stroke-linecap","round","stroke-linejoin","round","stroke-width","4","transform","scale(-1 1) rotate(45.035 -184.565 -565.488)",1,"tw-fill-illustration-bg-tertiary"],["cx","69.752","cy","69.752","r","69.752","transform","scale(-1 1) rotate(45.035 -213.255 -553.709)",1,"tw-fill-illustration-bg-secondary"],["d","m445.838 353.214 2.95-180.467 12.372-.007 3.078 180.465a4.64 4.64 0 0 1-4.637 4.72l-9.12.005a4.64 4.64 0 0 1-4.643-4.716ZM453.82 52.947a2 2 0 0 1 1.998-2.001l35.638-.023a2 2 0 0 1 2.001 2.015l-.268 35.637a2 2 0 1 1-4-.03l.252-33.62-33.62.02a1.999 1.999 0 0 1-2.001-1.998ZM415.689 86.49a2 2 0 0 1 4.001.03l-.254 33.62 33.622-.021a2 2 0 0 1 .003 4l-35.637.022a2 2 0 0 1-2.001-2.015l.266-35.636Zm25.457-19.997a2 2 0 0 1 3.461-2.006l23.124 39.885a2 2 0 0 1-3.461 2.006l-23.124-39.885Z",1,"tw-fill-illustration-outline"],["d","M259.264 277.271c21.107-4.293 34.791-24.62 30.565-45.402-4.227-20.782-24.764-34.15-45.871-29.857-21.107 4.293-34.791 24.62-30.565 45.402 4.227 20.783 24.764 34.15 45.871 29.857ZM299.993 173.472c7.793-1.585 12.826-9.188 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.187-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-primary"],["d","M329.869 242.094c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.188-12.826-16.981-11.241-7.794 1.585-12.827 9.188-11.241 16.981 1.585 7.794 9.187 12.827 16.981 11.241Z",1,"tw-fill-illustration-bg-secondary"],["d","M330.088 309.401c7.794-1.585 12.826-9.188 11.241-16.981-1.585-7.794-9.187-12.827-16.981-11.242-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.827 16.981 11.242Z",1,"tw-fill-illustration-bg-tertiary"],["d","M234.598 327.597c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-primary"],["d","M176.919 248.71c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.794-9.188-12.827-16.982-11.242-7.793 1.586-12.826 9.188-11.241 16.982 1.585 7.793 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-secondary"],["d","M206.836 185.071c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.793-9.188-12.826-16.982-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z",1,"tw-fill-illustration-bg-tertiary"],["fill-rule","evenodd","d","M200.699 154.89c8.875-1.805 17.533 3.927 19.339 12.803 1.165 5.732-.814 11.372-4.752 15.135.131.223.29.502.489.845l14.805 21.386a41.483 41.483 0 0 1 12.979-5.007c9.276-1.886 18.455-.523 26.321 3.303.038-.221.111-.441.227-.648l17.035-30.333a16.337 16.337 0 0 1-6.09-9.744c-1.805-8.876 3.928-17.535 12.803-19.34 8.876-1.805 17.534 3.928 19.339 12.803 1.805 8.876-3.926 17.534-12.802 19.339-3.427.697-6.822.27-9.803-1.028l-16.994 30.262a1.98 1.98 0 0 1-.397.497c8.774 5.316 15.487 13.883 18.16 24.43l19.238-1.61c-.007-7.642 5.356-14.488 13.135-16.07 8.875-1.805 17.534 3.927 19.339 12.803 1.805 8.875-3.927 17.533-12.802 19.339-8.639 1.757-17.072-3.627-19.18-12.099l-18.935 1.585c1.474 9.839-.81 19.465-5.834 27.387l29.108 22.962a16.324 16.324 0 0 1 8.523-4.671c8.876-1.804 17.534 3.928 19.339 12.803 1.805 8.876-3.927 17.534-12.802 19.339-8.875 1.805-17.534-3.926-19.34-12.802a16.338 16.338 0 0 1 1.872-11.474l-29.007-22.882c-5.828 7.464-14.29 12.983-24.349 15.028a41.442 41.442 0 0 1-14.045.441l-6.224 19.317a16.365 16.365 0 0 1 8.405 11.229c1.805 8.876-3.927 17.534-12.802 19.339-8.876 1.805-17.535-3.926-19.34-12.802-1.805-8.875 3.927-17.534 12.803-19.34 2.461-.5 4.906-.42 7.192.145l6.007-18.641c-14.851-3.594-27.011-15.301-30.225-31.105a40.043 40.043 0 0 1-.808-8.184l-20.473-1.442c-.032-.002-.064-.008-.096-.011-1.37 6.114-6.201 11.162-12.739 12.492-8.875 1.805-17.534-3.926-19.339-12.802-1.805-8.875 3.927-17.534 12.802-19.34 8.876-1.804 17.534 3.928 19.339 12.803.196.962.302 1.921.327 2.869l20.401 1.436c1.206-11.333 7.247-21.627 16.399-28.363l-14.76-21.321a20.41 20.41 0 0 0-.435-.719 16.428 16.428 0 0 1-4.816 1.8c-8.876 1.805-17.535-3.927-19.34-12.802-1.805-8.876 3.927-17.535 12.803-19.34Zm124.048 128.249c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.364-6.71-7.911-11.044-14.622-9.68Zm-95.49 18.196c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.621-1.365-6.711-7.911-11.045-14.622-9.681Zm15.1-97.363c-20.054 4.079-33.004 23.373-29.004 43.044 4.001 19.672 23.459 32.374 43.513 28.296 9.593-1.951 17.558-7.386 22.822-14.676a1.986 1.986 0 0 1 .612-.873c5.306-7.813 7.58-17.606 5.569-27.495-4.001-19.671-23.459-32.374-43.512-28.296Zm80.171 11.861c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.365-6.711-7.911-11.045-14.622-9.68Zm-152.949 6.614c-6.711 1.365-11.045 7.912-9.681 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.621-1.365-6.711-7.912-11.045-14.622-9.681Zm123.073-75.237c-6.71 1.365-11.044 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.622-1.365-6.71-7.912-11.045-14.623-9.68Zm-93.156 11.6c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.622 9.679 6.711-1.365 11.044-7.912 9.68-14.622-1.365-6.711-7.911-11.045-14.622-9.68Z","clip-rule","evenodd",1,"tw-fill-illustration-outline"],["d","M272.266 232.544a1.998 1.998 0 0 0-.353 1.589l.554 2.725a2.002 2.002 0 0 0 1.002 1.357l4.786 2.611a2 2 0 0 1 1.003 2.15l-.667 3.313a1.998 1.998 0 0 1-1.647 1.58l-5.641.896a1.998 1.998 0 0 0-1.352.867l-1.524 2.291a2 2 0 0 0-.252 1.678l1.555 5.227a2 2 0 0 1-.794 2.224l-2.799 1.902a2 2 0 0 1-2.309-.043l-4.524-3.327a2 2 0 0 0-1.583-.348l-2.754.56a1.997 1.997 0 0 0-1.352.994l-2.638 4.785a2 2 0 0 1-2.14.996l-3.339-.661a2 2 0 0 1-1.587-1.649l-.886-5.597a2.003 2.003 0 0 0-.875-1.358l-2.298-1.514a2 2 0 0 0-1.669-.247l-5.272 1.563a2 2 0 0 1-2.22-.788l-1.897-2.774a2.001 2.001 0 0 1 .045-2.321l3.339-4.498a2.004 2.004 0 0 0 .354-1.591l-.557-2.736a2.001 2.001 0 0 0-.983-1.347l-4.848-2.715a2 2 0 0 1-.983-2.14l.669-3.329a2.001 2.001 0 0 1 1.648-1.581l5.641-.895a1.999 1.999 0 0 0 1.352-.868l1.526-2.293c.327-.493.42-1.105.253-1.673l-1.608-5.457a2 2 0 0 1 .794-2.22l2.793-1.897a2 2 0 0 1 2.322.053l4.676 3.5a1.999 1.999 0 0 0 1.597.359l2.744-.558a2.002 2.002 0 0 0 1.353-.995l2.637-4.784a1.997 1.997 0 0 1 2.14-.996l3.339.661a2 2 0 0 1 1.587 1.649l.886 5.597c.088.555.406 1.048.875 1.357l2.298 1.514a2.002 2.002 0 0 0 1.669.248l5.272-1.564a2 2 0 0 1 2.22.789l1.898 2.775a2 2 0 0 1-.044 2.319l-3.432 4.635Zm-24.977-.064c-4.049 2.702-5.078 8.076-2.395 11.991 2.705 4.028 8.1 5.044 12.035 2.365 3.936-2.678 5.078-8.076 2.395-11.991-2.592-4.051-7.986-5.067-12.035-2.365Z",1,"tw-fill-illustration-logo"],["d","m270.507 237.256-.554-2.724a4.004 4.004 0 0 1 .705-3.178l3.433-4.636-1.897-2.775-5.273 1.564a4 4 0 0 1-3.337-.494l-2.298-1.515a4 4 0 0 1-1.751-2.714l-.886-5.597-3.339-.661-2.637 4.784a4.001 4.001 0 0 1-2.706 1.989l-2.744.558a4 4 0 0 1-3.194-.718l-4.676-3.5-2.792 1.898 1.608 5.457a3.998 3.998 0 0 1-.507 3.345l-1.525 2.294c-.62.931-1.6 1.56-2.704 1.736l-5.642.895-.669 3.329 4.848 2.715a4 4 0 0 1 1.965 2.693l.557 2.737a3.999 3.999 0 0 1-.708 3.18l-3.338 4.499 1.897 2.774 5.272-1.563a3.998 3.998 0 0 1 3.338.494l2.298 1.514a4.001 4.001 0 0 1 1.75 2.715l.886 5.597 3.339.661 2.638-4.785a4 4 0 0 1 2.706-1.988l2.753-.56a4 4 0 0 1 3.166.697l4.524 3.327 2.8-1.902-1.555-5.227a4.002 4.002 0 0 1 .504-3.355l1.524-2.291a3.998 3.998 0 0 1 2.703-1.736l5.642-.895.667-3.313-4.787-2.611a4.004 4.004 0 0 1-2.004-2.714Zm-24.328-6.439c4.915-3.28 11.556-2.099 14.795 2.898h.001v.001l.034.051h-.001c3.294 4.868 1.835 11.464-2.953 14.723-4.855 3.304-11.499 2.043-14.821-2.903l.001-.001c-3.308-4.845-2.013-11.461 2.944-14.769Zm11.461 5.106c-1.959-3.06-6.075-3.891-9.24-1.779-3.036 2.026-3.85 5.957-2.039 8.913l.183.284.01.015c2.089 3.109 6.234 3.879 9.25 1.827 3.066-2.087 3.897-6.25 1.871-9.207a.97.97 0 0 1-.035-.053Zm16.787.536 4.787 2.611a4 4 0 0 1 2.005 4.3l-.666 3.313a4.001 4.001 0 0 1-3.295 3.161l-5.641.896-1.525 2.291 1.555 5.227a4.002 4.002 0 0 1-1.586 4.449l-2.8 1.901a4 4 0 0 1-4.618-.086l-4.523-3.326-2.753.56-2.638 4.784a4 4 0 0 1-4.279 1.993l-3.34-.661a4.002 4.002 0 0 1-3.174-3.298l-.886-5.598-2.298-1.514-5.273 1.564a3.999 3.999 0 0 1-4.438-1.577l-1.897-2.774a3.998 3.998 0 0 1 .09-4.641l3.338-4.499-.557-2.737-4.848-2.715a3.998 3.998 0 0 1-1.966-4.279l.669-3.329a4.002 4.002 0 0 1 3.294-3.162l5.642-.895 1.526-2.294-1.609-5.457a4.001 4.001 0 0 1 1.59-4.439l2.792-1.897a4 4 0 0 1 4.645.106l4.676 3.5 2.744-.558 2.636-4.785a4 4 0 0 1 4.281-1.992l3.339.661a4 4 0 0 1 3.174 3.298l.886 5.597 2.298 1.514 5.272-1.563a4 4 0 0 1 4.439 1.576l1.898 2.775a4.001 4.001 0 0 1-.087 4.639l-3.433 4.636.554 2.724Z",1,"tw-fill-illustration-outline"],["id","right-a"],["d","M0 0h506v297H0z",1,"tw-fill-illustration-bg-tertiary"]],template:function(e,t){if(1&e&&(k.DNE(0,Z,52,0,"ng-template",null,0,k.C5r)(2,Q,2,0,"ng-container",1),k.nrm(3,"bit-toast-container")),2&e){const e=k.sdS(1);k.R7$(2),k.Y8G("ngIf",!t.loading)("ngIfElse",e)}},dependencies:[Y.bT,x.n3,W],encapsulation:2});var ie=i(37967),ne=i(6056),re=i(58625),se=i(29029),oe=i(56898),ae=i(88016);class le{}le.ɵfac=function(e){return new(e||le)},le.ɵcmp=k.VBU({type:le,selectors:[["app-authentication-timeout"]],decls:6,vars:6,consts:[[1,"tw-text-center"],["routerLink","/login","bitButton","","block","","buttonType","primary"]],template:function(e,t){1&e&&(k.j41(0,"p",0),k.EFF(1),k.nI1(2,"i18n"),k.k0s(),k.j41(3,"a",1),k.EFF(4),k.nI1(5,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,2,"authenticationSessionTimedOut")," "),k.R7$(3),k.SpI(" ",k.bMT(5,4,"logIn")," "))},dependencies:[Y.MD,re.p,se.t,oe.Q,ne.iI,ne.Wk,ae.$],encapsulation:2});const ce=Object.freeze({SignUp:"signup",FinishSignUp:"finish-signup",Login:"login",LoginWithDevice:"login-with-device",AdminApprovalRequested:"admin-approval-requested",PasswordHint:"hint",LoginInitiated:"login-initiated",SetInitialPassword:"set-initial-password",ChangePassword:"change-password",Sso:"sso",TwoFactor:"2fa",AuthenticationTimeout:"authentication-timeout",NewDeviceVerification:"device-verification",LoginWithPasskey:"login-with-passkey"});var de=i(2780),ue=i(26061),he=i(90005),pe=i(11573),me=i(7861),ve=i(56962),fe=i(83516),ge=i(55807),ye=i(26477),be=i(75583),we=i(45804),Se=i(2471),Ie=i(1221),ke=i(59032),Ce=i(58806),Te=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Fe(e,t){1&e&&(k.qex(0),k.j41(1,"p",4),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"button",5),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,3,"readingPasskeyLoading")),k.R7$(2),k.Y8G("loading",!0),k.R7$(),k.SpI(" ",k.bMT(6,5,"loading")," "))}function Re(e,t){if(1&e){const e=k.RV6();k.qex(0),k.j41(1,"p",4),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"button",6),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.retry())}),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.bVm()}2&e&&(k.R7$(2),k.JRh(k.bMT(3,2,"passkeyAuthenticationFailed")),k.R7$(3),k.SpI(" ",k.bMT(6,4,"tryAgain")," "))}class Pe{get successRoute(){const e=this.platformUtilsService.getClientType();return this.successRoutes[e]||"/vault"}constructor(e,t,i,n,r,s,o,a,l,c,d){this.webAuthnLoginService=e,this.router=t,this.route=i,this.logService=n,this.validationService=r,this.i18nService=s,this.loginSuccessHandlerService=o,this.keyService=a,this.platformUtilsService=l,this.anonLayoutWrapperDataService=c,this.messagingService=d,this.currentState="assert",this.shouldAutoClosePopout=!1,this.Icons={TwoFactorAuthSecurityKeyIcon:ue.s,TwoFactorAuthSecurityKeyFailedIcon:he.f},this.successRoutes={[pe.sK.Web]:"/vault",[pe.sK.Browser]:"/tabs/vault",[pe.sK.Desktop]:"/vault",[pe.sK.Cli]:"/vault"}}ngOnInit(){this.shouldAutoClosePopout="true"===this.route.snapshot.queryParamMap.get("autoClosePopout"),this.authenticate()}retry(){this.currentState="assert",this.setDefaultIcon(),this.authenticate()}authenticate(){return Te(this,void 0,void 0,function*(){let e;try{const t=yield this.webAuthnLoginService.getCredentialAssertionOptions();e=yield this.webAuthnLoginService.assertCredential(t)}catch(t){return this.validationService.showError(t),this.currentState="assertFailed",void this.setFailureIcon()}try{const t=yield this.webAuthnLoginService.logIn(e);if(t.requiresTwoFactor)return this.validationService.showError(this.i18nService.t("twoFactorForPasskeysNotSupportedOnClientUpdateToLogIn")),this.currentState="assertFailed",void this.setFailureIcon();if((yield(0,u._)(this.keyService.userKey$(t.userId)))&&(yield this.loginSuccessHandlerService.run(t.userId,null)),this.shouldAutoClosePopout&&this.platformUtilsService.getClientType()===pe.sK.Browser)return this.messagingService.send("openPopup"),void window.close();yield this.router.navigate([this.successRoute])}catch(t){t instanceof me._&&this.validationService.showError(this.i18nService.t("invalidPasskeyPleaseTryAgain")),this.logService.error(t),this.currentState="assertFailed",this.setFailureIcon()}})}setDefaultIcon(){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:this.Icons.TwoFactorAuthSecurityKeyIcon})}setFailureIcon(){this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageIcon:this.Icons.TwoFactorAuthSecurityKeyFailedIcon})}}Pe.ɵfac=function(e){return new(e||Pe)(k.rXU(we.t),k.rXU(x.Ix),k.rXU(x.nX),k.rXU(ve.K),k.rXU(Se.B),k.rXU(j.W),k.rXU(f.aJ),k.rXU(I.Lu),k.rXU(N.y),k.rXU(Ie.f),k.rXU(fe.U))},Pe.ɵcmp=k.VBU({type:Pe,selectors:[["app-login-via-webauthn"]],decls:10,vars:8,consts:[[1,"tw-flex","tw-flex-col","tw-items-center"],[4,"ngIf"],["bitTypography","body1",1,"tw-mb-0","tw-text-center"],["bitLink","","routerLink","/login"],["bitTypography","body1",1,"tw-text-center"],["type","button","bitButton","","block","","buttonType","primary",1,"tw-mb-4",3,"loading"],["type","button","bitButton","","block","","buttonType","primary",1,"tw-mb-4",3,"click"]],template:function(e,t){1&e&&(k.j41(0,"div",0),k.DNE(1,Fe,7,7,"ng-container",1)(2,Re,7,6,"ng-container",1),k.j41(3,"p",2),k.EFF(4),k.nI1(5,"i18n"),k.nrm(6,"br"),k.j41(7,"a",3),k.EFF(8),k.nI1(9,"i18n"),k.k0s()()()),2&e&&(k.R7$(),k.Y8G("ngIf","assert"===t.currentState),k.R7$(),k.Y8G("ngIf","assertFailed"===t.currentState),k.R7$(2),k.SpI(" ",k.bMT(5,4,"troubleLoggingIn")),k.R7$(4),k.JRh(k.bMT(9,6,"useADifferentLogInMethod")))},dependencies:[Y.MD,Y.bT,ne.iI,ne.Wk,re.p,se.t,oe.Q,ge.o,ye.V,ke.L,be.E,Ce.r,ae.$],encapsulation:2});var xe=i(347),$e=i(13299);const Ee=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 0.5 90.32 96">
    <path class="tw-fill-illustration-bg-secondary" d="M54 8.5a8 8 0 0 1 8-8h8a8 8 0 0 1 8 8v4H54v-4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70 2.5h-8a6 6 0 0 0-6 6v2h20v-2a6 6 0 0 0-6-6Zm-8-2a8 8 0 0 0-8 8v4h24v-4a8 8 0 0 0-8-8h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M47 16.5a8 8 0 0 1 8-8h22a8 8 0 0 1 8 8v6H47v-6Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M77 10.5H55a6 6 0 0 0-6 6v4h34v-4a6 6 0 0 0-6-6Zm-22-2a8 8 0 0 0-8 8v6h38v-6a8 8 0 0 0-8-8H55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M40 26.5a8 8 0 0 1 8-8h36a8 8 0 0 1 8 8v66H40v-66Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M84 20.5H48a6 6 0 0 0-6 6v64h48v-64a6 6 0 0 0-6-6Zm-36-2a8 8 0 0 0-8 8v66h52v-66a8 8 0 0 0-8-8H48Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M4 44.5a8 8 0 0 1 8-8h38a8 8 0 0 1 8 8v48H4v-48Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M50 38.5H12a6 6 0 0 0-6 6v46h50v-46a6 6 0 0 0-6-6Zm-38-2a8 8 0 0 0-8 8v48h54v-48a8 8 0 0 0-8-8H12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M68.677 60.935c1.928-3.316 6.718-3.316 8.645 0l16.31 28.052c1.938 3.334-.467 7.513-4.323 7.513H56.691c-3.856 0-6.26-4.18-4.323-7.513l16.31-28.052Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M91.903 89.993 75.593 61.94c-1.156-1.99-4.03-1.99-5.187 0L54.097 89.993c-1.163 2 .28 4.507 2.594 4.507h32.618c2.314 0 3.757-2.507 2.594-4.507Zm-14.58-29.058c-1.928-3.316-6.718-3.316-8.645 0l-16.31 28.052c-1.938 3.334.467 7.513 4.323 7.513h32.618c3.856 0 6.26-4.18 4.323-7.513l-16.31-28.052Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M75 88.5a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM70.06 71.053a.5.5 0 0 1 .496-.553h4.887a.5.5 0 0 1 .498.553l-1.393 13a.5.5 0 0 1-.498.447h-2.1a.5.5 0 0 1-.498-.447l-1.393-13Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M21 80.5a8 8 0 0 1 8-8h4a8 8 0 0 1 8 8v12H21v-12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33 74.5h-4a6 6 0 0 0-6 6v10h16v-10a6 6 0 0 0-6-6Zm-4-2a8 8 0 0 0-8 8v12h20v-12a8 8 0 0 0-8-8h-4Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M13 46.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15 47.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M13 59.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15 60.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M26 46.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 47.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M26 59.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 60.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M39 59.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41 60.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M39 46.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1v-8Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41 47.5v6h6v-6h-6Zm-1-2a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-8ZM47 27.5a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm11-1a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm9 1a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm10 0a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm0 6a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-10-18a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm-9-19a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-11 1a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm11 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Zm-1 7a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2h-6a1 1 0 0 1-1-1Zm1 5a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2h-6Z" clip-rule="evenodd"/>
  </svg>
`;var Ae=i(81285),De=i(81441);function Oe(e,t,i){if(!e||"number"==typeof e&&Number.isNaN(e))throw new Error(`${t} is falsy.${i?` ${i}`:""}`)}var Me=i(60512),Ue=i(49272),Ge=i(44432),je=i(36801),Ne=i(21001),Ve=i(83541),Be=i(11224),ze=i(27866),Le=i(18499),Ke=i(86214),qe=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const _e=e=>({key:e}),Xe=()=>({key:"logOut"});function Ye(e,t){1&e&&(k.j41(0,"div",0),k.nrm(1,"i",1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,2,"loading"))))}function He(e,t){if(1&e){const e=k.RV6();k.nrm(0,"div",2),k.j41(1,"bit-callout",3),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"button",4),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.logout())}),k.EFF(5),k.nI1(6,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,2,"loginOnTrustedDeviceOrAskAdminToAssignPassword")," "),k.R7$(3),k.SpI(" ",k.bMT(6,4,"logOut")," "))}function We(e,t){1&e&&(k.j41(0,"bit-callout",7),k.nI1(1,"i18n"),k.EFF(2),k.nI1(3,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"resetPasswordPolicyAutoEnroll"))),k.R7$(2),k.SpI(" ",k.bMT(3,5,"resetPasswordAutoEnrollInviteWarning")," "))}function Je(e,t){if(1&e){const e=k.RV6();k.DNE(0,We,4,7,"bit-callout",5),k.j41(1,"auth-input-password",6),k.bIt("onPasswordFormSubmit",function(t){C.eBV(e);const i=k.XpG(2);return C.Njj(i.handlePasswordFormSubmit(t))})("onSecondaryButtonClick",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.logout())}),k.k0s()}if(2&e){const e=k.XpG(2);k.Y8G("ngIf",e.resetPasswordAutoEnroll),k.R7$(),k.Y8G("flow",e.inputPasswordFlow)("email",e.email)("userId",e.userId)("loading",e.submitting)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)("primaryButtonText",k.eq3(8,_e,e.userType===e.SetInitialPasswordUserType.OFFBOARDED_TDE_ORG_USER?"setPassword":"createAccount"))("secondaryButtonText",k.lJ4(10,Xe))}}function Ze(e,t){if(1&e&&k.nVh(0,He,7,6)(1,Je,2,11),2&e){const e=k.XpG();k.vxM(e.userType===e.SetInitialPasswordUserType.OFFBOARDED_TDE_ORG_USER_UNTRUSTED_DEVICE?0:1)}}class Qe{constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p,m,v,f,g){this.accountService=e,this.activatedRoute=t,this.anonLayoutWrapperDataService=i,this.dialogService=n,this.i18nService=r,this.logoutService=s,this.logService=o,this.masterPasswordService=a,this.messagingService=l,this.organizationApiService=c,this.policyApiService=d,this.policyService=u,this.router=h,this.setInitialPasswordService=p,this.ssoLoginService=m,this.syncService=v,this.toastService=f,this.validationService=g,this.inputPasswordFlow=Ae.m5.SetInitialPasswordAuthedUser,this.initializing=!0,this.masterPasswordPolicyOptions=null,this.submitting=!1,this.SetInitialPasswordUserType=Ne.bg}ngOnInit(){return qe(this,void 0,void 0,function*(){yield this.syncService.fullSync(!0);const e=yield(0,u._)(this.accountService.activeAccount$);this.userId=null==e?void 0:e.id,this.email=null==e?void 0:e.email,yield this.establishUserType(),yield this.getOrgInfo(),this.initializing=!1})}establishUserType(){return qe(this,void 0,void 0,function*(){if(!this.userId)throw new Error("userId not found. Could not determine user type.");this.forceSetPasswordReason=yield(0,u._)(this.masterPasswordService.forceSetPasswordReason$(this.userId)),this.forceSetPasswordReason===De.n.TdeOffboardingUntrustedDevice&&(this.userType=Ne.bg.OFFBOARDED_TDE_ORG_USER_UNTRUSTED_DEVICE,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"unableToCompleteLogin"},pageIcon:Ee})),this.forceSetPasswordReason===De.n.SsoNewJitProvisionedUser&&(this.userType=Ne.bg.JIT_PROVISIONED_MP_ORG_USER,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"joinOrganization"},pageSubtitle:{key:"finishJoiningThisOrganizationBySettingAMasterPassword"}})),this.forceSetPasswordReason===De.n.TdeUserWithoutPasswordHasPasswordResetPermission&&(this.userType=Ne.bg.TDE_ORG_USER_RESET_PASSWORD_PERMISSION_REQUIRES_MP,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"setMasterPassword"},pageSubtitle:{key:"orgPermissionsUpdatedMustSetPassword"}})),this.forceSetPasswordReason===De.n.TdeOffboarding&&(this.userType=Ne.bg.OFFBOARDED_TDE_ORG_USER,this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"setMasterPassword"},pageSubtitle:{key:"tdeDisabledMasterPasswordRequired"}})),this.forceSetPasswordReason===De.n.None&&(yield this.router.navigate(["/"]))})}getOrgInfo(){return qe(this,void 0,void 0,function*(){var e,t;if(!this.userId)throw new Error("userId not found. Could not handle query params.");if(this.userType===Ne.bg.OFFBOARDED_TDE_ORG_USER)return void(this.masterPasswordPolicyOptions=null!==(e=yield(0,u._)(this.policyService.masterPasswordPolicyOptions$(this.userId)))&&void 0!==e?e:null);const i=yield(0,u._)(this.activatedRoute.queryParams);if(this.orgSsoIdentifier=null!==(t=i.identifier)&&void 0!==t?t:yield this.ssoLoginService.getActiveUserOrganizationSsoIdentifier(this.userId),null!=this.orgSsoIdentifier)try{const e=yield this.organizationApiService.getAutoEnrollStatus(this.orgSsoIdentifier);this.orgId=e.id,this.resetPasswordAutoEnroll=e.resetPasswordEnabled,this.masterPasswordPolicyOptions=yield this.policyApiService.getMasterPasswordPolicyOptsForOrgUser(this.orgId)}catch(n){this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("errorOccurred")})}})}handlePasswordFormSubmit(e){return qe(this,void 0,void 0,function*(){switch(this.submitting=!0,this.userType){case Ne.bg.JIT_PROVISIONED_MP_ORG_USER:case Ne.bg.TDE_ORG_USER_RESET_PASSWORD_PERMISSION_REQUIRES_MP:yield this.setInitialPassword(e);break;case Ne.bg.OFFBOARDED_TDE_ORG_USER:yield this.setInitialPasswordTdeOffboarding(e);break;default:this.logService.error(`Unexpected user type: ${this.userType}. Could not set initial password.`),this.validationService.showError("Unexpected user type. Could not set initial password.")}})}setInitialPassword(e){return qe(this,void 0,void 0,function*(){const t="Could not set initial password.";Oe(e.newMasterKey,"newMasterKey",t),Oe(e.newServerMasterKeyHash,"newServerMasterKeyHash",t),Oe(e.newLocalMasterKeyHash,"newLocalMasterKeyHash",t),Oe(e.kdfConfig,"kdfConfig",t),Oe(this.orgSsoIdentifier,"orgSsoIdentifier",t),Oe(this.orgId,"orgId",t),Oe(this.userType,"userType",t),Oe(this.userId,"userId",t),(0,Me.x)(e.newPasswordHint,"newPasswordHint",t),(0,Me.x)(this.resetPasswordAutoEnroll,"resetPasswordAutoEnroll",t);try{const t={newMasterKey:e.newMasterKey,newServerMasterKeyHash:e.newServerMasterKeyHash,newLocalMasterKeyHash:e.newLocalMasterKeyHash,newPasswordHint:e.newPasswordHint,kdfConfig:e.kdfConfig,orgSsoIdentifier:this.orgSsoIdentifier,orgId:this.orgId,resetPasswordAutoEnroll:this.resetPasswordAutoEnroll};yield this.setInitialPasswordService.setInitialPassword(t,this.userType,this.userId),this.showSuccessToastByUserType(),this.submitting=!1,yield this.router.navigate(["vault"])}catch(i){this.logService.error("Error setting initial password",i),this.validationService.showError(i),this.submitting=!1}})}setInitialPasswordTdeOffboarding(e){return qe(this,void 0,void 0,function*(){const t="Could not set initial password.";Oe(e.newMasterKey,"newMasterKey",t),Oe(e.newServerMasterKeyHash,"newServerMasterKeyHash",t),Oe(this.userId,"userId",t),(0,Me.x)(e.newPasswordHint,"newPasswordHint",t);try{const t={newMasterKey:e.newMasterKey,newServerMasterKeyHash:e.newServerMasterKeyHash,newPasswordHint:e.newPasswordHint};yield this.setInitialPasswordService.setInitialPasswordTdeOffboarding(t,this.userId),this.showSuccessToastByUserType(),yield this.logoutService.logout(this.userId),yield this.router.navigate(["/"])}catch(i){this.logService.error("Error setting initial password during TDE offboarding",i),this.validationService.showError(i)}finally{this.submitting=!1}})}showSuccessToastByUserType(){this.userType===Ne.bg.JIT_PROVISIONED_MP_ORG_USER?(this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("accountSuccessfullyCreated")}),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("inviteAccepted")})):this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("masterPasswordSuccessfullySet")})}logout(){return qe(this,void 0,void 0,function*(){(yield this.dialogService.openSimpleDialog({title:{key:"logOut"},content:{key:"logOutConfirmation"},acceptButtonText:{key:"logOut"},type:"warning"}))&&this.messagingService.send("logout")})}}Qe.ɵfac=function(e){return new(e||Qe)(k.rXU(L.Di),k.rXU(x.nX),k.rXU(Ie.f),k.rXU(E.o3),k.rXU(j.W),k.rXU(f.k4),k.rXU(ve.K),k.rXU(Ve.O),k.rXU(fe.U),k.rXU(Be.X),k.rXU(ze.m),k.rXU(Le.m),k.rXU(x.Ix),k.rXU(Ne.HQ),k.rXU(Ke._),k.rXU(Ue.H),k.rXU($.f),k.rXU(Se.B))},Qe.ɵcmp=k.VBU({type:Qe,selectors:[["ng-component"]],decls:2,vars:1,consts:[[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x",3,"title"],[1,"tw-mt-4"],["type","warning"],["type","button","bitButton","","block","","buttonType","secondary",3,"click"],["type","warning",3,"title",4,"ngIf"],[3,"onPasswordFormSubmit","onSecondaryButtonClick","flow","email","userId","loading","masterPasswordPolicyOptions","primaryButtonText","secondaryButtonText"],["type","warning",3,"title"]],template:function(e,t){1&e&&k.nVh(0,Ye,3,4,"div",0)(1,Ze,2,1),2&e&&k.vxM(t.initializing?0:1)},dependencies:[se.t,oe.Q,Ge.G,Y.MD,Y.bT,Ae.tu,je.$Z],encapsulation:2});var et=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const tt=(e,t=!0,i,n=!0)=>()=>et(void 0,void 0,void 0,function*(){const r=(0,C.WQX)(U.w),s=(0,C.WQX)($.f),o=(0,C.WQX)(x.Ix),a=(0,C.WQX)(j.W),l=(0,C.WQX)(ve.K);try{return(yield r.getFeatureFlag(e))===t||(n&&s.showToast({variant:"error",title:null,message:a.t("accessDenied")}),null!=i&&o.createUrlTree([i]))}catch(c){return l.error(c),!1}});var it=i(24558),nt=i(274),rt=i(9045);const st=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 10 80 60">
    <path class="tw-fill-illustration-bg-primary" d="M7.5 15a5 5 0 0 1 5-5h55a5 5 0 0 1 5 5v35a5 5 0 0 1-5 5h-55a5 5 0 0 1-5-5V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M67.5 11.667h-55A3.333 3.333 0 0 0 9.167 15v35a3.333 3.333 0 0 0 3.333 3.333h55A3.333 3.333 0 0 0 70.833 50V15a3.333 3.333 0 0 0-3.333-3.333ZM12.5 10a5 5 0 0 0-5 5v35a5 5 0 0 0 5 5h55a5 5 0 0 0 5-5V15a5 5 0 0 0-5-5h-55Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M7.5 15h65v35h-65V15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M70.833 16.667H9.167v31.666h61.666V16.667ZM7.5 15v35h65V15h-65Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M32.5 54.167h15v15h-15v-15Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M31.667 53.334h16.666v15H55a.833.833 0 0 1 0 1.667H25a.833.833 0 0 1 0-1.667h6.667v-15Zm1.666 15h13.334V55.001H33.333v13.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M0 40a3.333 3.333 0 0 1 3.333-3.333h15A3.333 3.333 0 0 1 21.667 40v26.667A3.333 3.333 0 0 1 18.333 70h-15A3.333 3.333 0 0 1 0 66.667V40Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M18.333 38.334h-15c-.92 0-1.666.746-1.666 1.666v26.667c0 .92.746 1.667 1.666 1.667h15c.92 0 1.667-.746 1.667-1.667V40c0-.92-.746-1.666-1.667-1.666Zm-15-1.667A3.333 3.333 0 0 0 0 40v26.667A3.333 3.333 0 0 0 3.333 70h15a3.333 3.333 0 0 0 3.334-3.333V40a3.333 3.333 0 0 0-3.334-3.333h-15Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M8.333 40.833c0-.46.373-.833.834-.833H12.5a.833.833 0 0 1 0 1.667H9.167a.833.833 0 0 1-.834-.834Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" fill-rule="evenodd" d="M40 45.834c7.364 0 13.333-5.97 13.333-13.334 0-7.363-5.97-13.333-13.333-13.333-7.364 0-13.333 5.97-13.333 13.333 0 7.364 5.97 13.334 13.333 13.334ZM34.167 27.5a2.5 2.5 0 0 0-2.5 2.5v8.334a2.5 2.5 0 0 0 2.5 2.5h11.666a2.5 2.5 0 0 0 2.5-2.5V30a2.5 2.5 0 0 0-2.5-2.5H34.167Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M31.667 30a2.5 2.5 0 0 1 2.5-2.5h11.666a2.5 2.5 0 0 1 2.5 2.5v8.333a2.5 2.5 0 0 1-2.5 2.5H34.167a2.5 2.5 0 0 1-2.5-2.5V30Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M45.833 29.167H34.167a.833.833 0 0 0-.834.833v8.333c0 .46.373.834.834.834h11.666c.46 0 .834-.373.834-.834V30a.833.833 0 0 0-.834-.833ZM34.167 27.5a2.5 2.5 0 0 0-2.5 2.5v8.333a2.5 2.5 0 0 0 2.5 2.5h11.666a2.5 2.5 0 0 0 2.5-2.5V30a2.5 2.5 0 0 0-2.5-2.5H34.167Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M39.167 32.5a.833.833 0 0 1 1.666 0v3.334a.833.833 0 0 1-1.666 0V32.5Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35.833 26.667a4.167 4.167 0 0 1 8.334 0v.833H42.5v-.833a2.5 2.5 0 0 0-5 0v.833h-1.667v-.833Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M50 33.333A3.333 3.333 0 0 1 53.333 30h23.334A3.333 3.333 0 0 1 80 33.333v33.334A3.333 3.333 0 0 1 76.667 70H53.333A3.333 3.333 0 0 1 50 66.667V33.333Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M76.667 31.667H53.333c-.92 0-1.666.746-1.666 1.666v33.334c0 .92.746 1.666 1.666 1.666h23.334c.92 0 1.666-.746 1.666-1.666V33.333c0-.92-.746-1.666-1.666-1.666ZM53.333 30A3.333 3.333 0 0 0 50 33.333v33.334A3.333 3.333 0 0 0 53.333 70h23.334A3.333 3.333 0 0 0 80 66.667V33.333A3.333 3.333 0 0 0 76.667 30H53.333Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M67.5 63.334a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65 64.167a.833.833 0 1 0 0-1.666.833.833 0 0 0 0 1.666Zm0 1.667a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M33.333 55h13.334v5H33.333v-5Z"/>
  </svg>
`;var ot=i(54006);const at=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="5 4 87 87">
    <path class="tw-fill-illustration-bg-primary" d="M90 48c0 23.196-18.804 42-42 42S6 71.196 6 48 24.804 6 48 6s42 18.804 42 42Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48 7C25.356 7 7 25.356 7 48s18.356 41 41 41 41-18.356 41-41S70.644 7 48 7ZM5 48C5 24.252 24.252 5 48 5s43 19.252 43 43-19.252 43-43 43S5 71.748 5 48Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M11 72a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H14a3 3 0 0 1-3-3V72Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M28 71H14a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V72a1 1 0 0 0-1-1Zm-14-2a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V72a3 3 0 0 0-3-3H14Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M20 75a1 1 0 1 1 2 0v4a1 1 0 1 1-2 0v-4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M16 68a5 5 0 0 1 10 0v1h-2v-1a3 3 0 1 0-6 0v1h-2v-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M92 16c0 6.627-5.373 12-12 12s-12-5.373-12-12S73.373 4 80 4s12 5.373 12 12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M80 26c5.523 0 10-4.477 10-10S85.523 6 80 6s-10 4.477-10 10 4.477 10 10 10Zm0 2c6.627 0 12-5.373 12-12S86.627 4 80 4 68 9.373 68 16s5.373 12 12 12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M85.707 12.293a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 1.414-1.414L78 18.586l6.293-6.293a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M43 60.883V52l7 4-5.052 5.63A1.117 1.117 0 0 1 43 60.882Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="m42 50.276 9.571 5.47-5.878 6.55A2.117 2.117 0 0 1 42 60.884V50.276Zm2 3.447v7.16a.117.117 0 0 0 .204.078l4.225-4.708L44 53.723Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M31.186 44.957 58.6 32.123a1.5 1.5 0 0 1 2.128 1.513l-2.763 26.793a1.5 1.5 0 0 1-2.366 1.066L42.3 51.965l-11.018-4.25c-1.233-.476-1.293-2.198-.096-2.758Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.733 33.533a.5.5 0 0 0-.709-.504L31.61 45.862a.5.5 0 0 0 .032.92l10.42 4.02 8.341-8.106a1 1 0 1 1 1.394 1.434l-7.942 7.719 12.327 8.833a.5.5 0 0 0 .788-.356l2.764-26.793Zm-17.912 19.32-10.899-4.206c-2.054-.793-2.154-3.663-.16-4.596l27.414-12.834c1.76-.824 3.746.588 3.547 2.521L58.96 60.532c-.197 1.909-2.383 2.893-3.943 1.775l-13.196-9.455Z" clip-rule="evenodd"/>
  </svg>
`;var lt=i(32415);const ct=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 12.12 96 76">
    <path class="tw-fill-illustration-bg-secondary" fill-rule="evenodd" d="M77 43.121h2c9.389 0 17 7.611 17 17s-7.611 17-17 17H21v-.086C9.234 76.022 0 66.15 0 54.121c0-10.663 7.256-19.63 17.099-22.236C21.599 20.32 32.842 12.121 46 12.121c17.12 0 31 13.88 31 31Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" fill-rule="evenodd" d="M56 53.121c2.903 0 5.707-.427 8.352-1.22 3.427 4.966 9.157 8.22 15.648 8.22 5.856 0 11.094-2.65 14.579-6.815C91.952 47.31 85.965 43.121 79 43.121h-2c0-17.12-13.88-31-31-31a30.861 30.861 0 0 0-18.387 6.039A29.12 29.12 0 0 0 27 24.121c0 16.016 12.984 29 29 29Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 45.121v-2c0-16.016-12.984-29-29-29-12.306 0-22.826 7.666-27.037 18.49l-.369.947-.983.26C8.623 36.199 2 44.389 2 54.121c0 10.982 8.43 19.997 19.172 20.922l.91.078H79c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15h-4ZM21 77.035C9.234 76.022 0 66.15 0 54.121c0-10.663 7.256-19.63 17.099-22.236C21.599 20.32 32.842 12.121 46 12.121c17.12 0 31 13.88 31 31h2c9.389 0 17 7.611 17 17s-7.611 17-17 17H21v-.086Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M31 88.121c6.326 0 11.795-3.671 14.392-9h7.002a2 2 0 0 0 1.11-.336L56 77.121l1.895 1.516a1 1 0 0 0 1.225.02l1.38-1.036 1.38 1.035a1 1 0 0 0 1.225-.019L65 77.121l3.578 1.789a2 2 0 0 0 .894.211h3.608a2 2 0 0 0 1.519-.698l4.843-5.651a1 1 0 0 0 0-1.302L74.6 65.82a2 2 0 0 0-1.519-.699H45.392c-2.597-5.328-8.066-9-14.392-9-8.837 0-16 7.163-16 16s7.163 16 16 16Zm-6-13a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M44.141 77.121h8.253l3.713-2.475 2.432 1.945 1.961-1.47 1.96 1.47 2.29-1.831 4.722 2.361h3.608l4.286-5-4.286-5H44.141l-.547-1.124C41.319 61.33 36.532 58.121 31 58.121c-7.732 0-14 6.268-14 14s6.268 14 14 14c5.532 0 10.32-3.209 12.594-7.876l.547-1.124Zm33.783-4.35h-.001Zm-.002-1.3h.002-.002ZM74.6 65.82a2 2 0 0 0-1.519-.699H45.392c-2.597-5.328-8.066-9-14.392-9-8.837 0-16 7.163-16 16s7.163 16 16 16c6.326 0 11.795-3.671 14.392-9h7.002a2 2 0 0 0 1.11-.336L56 77.121l1.895 1.516a1 1 0 0 0 1.225.02l1.38-1.036 1.38 1.035a1 1 0 0 0 1.225-.019L65 77.121l3.578 1.789a2 2 0 0 0 .894.211h3.608a2 2 0 0 0 1.519-.698l4.843-5.651a1 1 0 0 0 0-1.302L74.6 65.82ZM30 72.12a5 5 0 1 1-10 0 5 5 0 0 1 10 0Zm-2 0a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" clip-rule="evenodd"/>
  </svg>
`;var dt=i(20266),ut=i(36951);const ht=$e.Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 12.75 96 72">
  <path class="tw-fill-illustration-bg-primary" d="M0 18.512a5.76 5.76 0 0 1 5.76-5.76h54.48a5.76 5.76 0 0 1 5.76 5.76v38.48a5.76 5.76 0 0 1-5.76 5.76H5.76A5.76 5.76 0 0 1 0 56.992v-38.48Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60.24 14.672H5.76a3.84 3.84 0 0 0-3.84 3.84v38.48a3.84 3.84 0 0 0 3.84 3.84h54.48a3.84 3.84 0 0 0 3.84-3.84v-38.48a3.84 3.84 0 0 0-3.84-3.84Zm-54.48-1.92A5.76 5.76 0 0 0 0 18.512v38.48a5.76 5.76 0 0 0 5.76 5.76h54.48a5.76 5.76 0 0 0 5.76-5.76v-38.48a5.76 5.76 0 0 0-5.76-5.76H5.76Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M65 24.712H1v-1.92h64v1.92Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-outline" d="M62 18.752a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM56 18.752a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM50 18.752a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"/>
  <path class="tw-fill-illustration-tertiary" d="M21.099 48.635c1.515-2.606 5.28-2.606 6.795 0l10.053 17.29c1.523 2.62-.367 5.906-3.398 5.906H14.444c-3.03 0-4.92-3.285-3.398-5.905L21.1 48.636Z"/>
  <path class="tw-fill-illustration-outline" d="M20.373 48.213c1.839-3.163 6.408-3.163 8.247 0l10.053 17.29c1.849 3.18-.446 7.168-4.124 7.168H14.444c-3.678 0-5.973-3.987-4.124-7.167l10.053-17.29Zm6.795.844c-1.192-2.049-4.152-2.049-5.343 0L11.773 66.349c-1.198 2.06.288 4.643 2.671 4.643h20.105c2.383 0 3.869-2.583 2.671-4.643l-10.052-17.29Z"/>
  <circle class="tw-fill-illustration-outline" cx="24.496" cy="66.428" r="1.351" />
  <path class="tw-fill-illustration-outline" d="M22.517 54.707a.393.393 0 0 1 .39-.434h3.178c.234 0 .416.202.391.434l-.929 8.67a.393.393 0 0 1-.39.35h-1.32c-.201 0-.37-.151-.391-.35L22.977 59l-.46-4.293Z"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M82 42.752c0 7.732-6.268 14-14 14s-14-6.268-14-14 6.268-14 14-14 14 6.268 14 14Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M68 54.832c6.671 0 12.08-5.408 12.08-12.08S74.67 30.672 68 30.672c-6.672 0-12.08 5.408-12.08 12.08s5.408 12.08 12.08 12.08Zm0 1.92c7.732 0 14-6.268 14-14s-6.268-14-14-14-14 6.268-14 14 6.268 14 14 14Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M93.907 72.728A27.5 27.5 0 0 1 96 83.252a1.5 1.5 0 0 1-1.5 1.5h-52a1.5 1.5 0 0 1-1.5-1.5 27.5 27.5 0 0 1 52.907-10.524Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M94.076 82.832a25.58 25.58 0 0 0-51.153 0h51.153Zm1.924.42a27.5 27.5 0 1 0-55 0 1.5 1.5 0 0 0 1.5 1.5h52a1.5 1.5 0 0 0 1.5-1.5Z" clip-rule="evenodd"/>
</svg>
`,pt=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.52 0.12 120 120">
    <path class="tw-fill-illustration-bg-primary" d="M120.518 60.121c0 33.137-26.863 60-60 60s-60-26.863-60-60 26.863-60 60-60 60 26.863 60 60Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M60.518 117.621c31.756 0 57.5-25.743 57.5-57.5 0-31.756-25.744-57.5-57.5-57.5s-57.5 25.744-57.5 57.5 25.744 57.5 57.5 57.5Zm0 2.5c33.137 0 60-26.863 60-60s-26.863-60-60-60-60 26.863-60 60 26.863 60 60 60Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M51.088.858c12.675 9.633 22.026 23.414 26.03 39.32 16.502.649 31.563 6.91 43.326 16.93.049.998.074 2.003.074 3.014l-.001.38c-11.422-10.39-26.357-16.986-42.813-17.796a71.535 71.535 0 0 1 1.564 14.916c0 16.114-5.35 30.978-14.37 42.915a68.918 68.918 0 0 0 16.87 2.085 68.566 68.566 0 0 0 25.496-4.883 60.441 60.441 0 0 1-3.429 3.9 71.193 71.193 0 0 1-22.067 3.483 71.36 71.36 0 0 1-18.555-2.44A71.615 71.615 0 0 1 45.5 118.227a59.379 59.379 0 0 1-3.288-.949 69.075 69.075 0 0 0 18.38-15.355C43.27 96.538 28.78 84.721 19.918 69.265A68.568 68.568 0 0 0 8.75 90.475a59.868 59.868 0 0 1-1.636-2.974 71.13 71.13 0 0 1 11.496-20.618c-5.17-9.868-8.093-21.098-8.093-33.011 0-2.536.132-5.041.39-7.509a60.255 60.255 0 0 1 3.093-4.141 69.204 69.204 0 0 0-.983 11.65c0 11.122 2.641 21.627 7.33 30.923 13.065-15.111 32.376-24.673 53.92-24.673h.253C70.367 24.294 60.712 10.694 47.723 1.49a59.73 59.73 0 0 1 3.365-.63Zm25.68 56.764c0-5.15-.566-10.168-1.64-14.995a70.333 70.333 0 0 0-.86-.005c-21.139 0-40.05 9.54-52.661 24.55 8.663 15.617 23.23 27.506 40.687 32.653 9.071-11.65 14.474-26.295 14.474-42.203Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M84.268 40.121a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M76.768 45.121a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M70.518 100.121a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M63.018 105.121a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M28.018 65.121a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M20.518 70.121a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15Z" clip-rule="evenodd"/>
  </svg>
`,mt=$e.Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4.17 0.75 91.67 95.83">
  <path class="tw-fill-illustration-bg-secondary" d="M56.25 9.085A8.333 8.333 0 0 1 64.583.752h8.334a8.333 8.333 0 0 1 8.333 8.333v4.167h-25V9.085Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M72.917 2.835h-8.334a6.25 6.25 0 0 0-6.25 6.25v2.084h20.834V9.085a6.25 6.25 0 0 0-6.25-6.25ZM64.583.752a8.333 8.333 0 0 0-8.333 8.333v4.167h25V9.085A8.333 8.333 0 0 0 72.917.752h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-secondary" d="M48.959 17.418a8.333 8.333 0 0 1 8.333-8.333h22.916a8.333 8.333 0 0 1 8.334 8.333v6.25H48.958v-6.25Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M80.209 11.168H57.291a6.25 6.25 0 0 0-6.25 6.25v4.167h35.416v-4.167a6.25 6.25 0 0 0-6.25-6.25ZM57.291 9.085a8.333 8.333 0 0 0-8.334 8.333v6.25h39.584v-6.25a8.333 8.333 0 0 0-8.334-8.333H57.293Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-secondary" d="M41.666 27.835A8.333 8.333 0 0 1 50 19.502h37.5a8.333 8.333 0 0 1 8.333 8.333v66.667c0 1.15-.933 2.083-2.083 2.083H41.666v-68.75Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M87.5 21.585H50a6.25 6.25 0 0 0-6.25 6.25v66.667h50V27.835a6.25 6.25 0 0 0-6.25-6.25ZM50 19.502a8.333 8.333 0 0 0-8.334 8.333v68.75H93.75c1.15 0 2.083-.932 2.083-2.083V27.835a8.333 8.333 0 0 0-8.333-8.333H50Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-primary"" d="M4.167 46.585a8.333 8.333 0 0 1 8.333-8.333h39.583a8.333 8.333 0 0 1 8.334 8.333v47.917c0 1.15-.933 2.083-2.084 2.083H6.25a2.083 2.083 0 0 1-2.083-2.083V46.585Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M52.083 40.335H12.5a6.25 6.25 0 0 0-6.25 6.25v47.917h52.083V46.585a6.25 6.25 0 0 0-6.25-6.25ZM12.5 38.252a8.333 8.333 0 0 0-8.334 8.333v47.917c0 1.15.933 2.083 2.084 2.083h52.083c1.15 0 2.084-.932 2.084-2.083V46.585a8.333 8.333 0 0 0-8.334-8.333H12.5Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-tertiary" d="M21.875 84.085a8.333 8.333 0 0 1 8.333-8.333h4.167a8.333 8.333 0 0 1 8.333 8.333v12.5H21.875v-12.5Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M34.375 77.835h-4.167a6.25 6.25 0 0 0-6.25 6.25v10.417h16.667V84.085a6.25 6.25 0 0 0-6.25-6.25Zm-4.167-2.083a8.333 8.333 0 0 0-8.333 8.333v12.5h20.833v-12.5a8.333 8.333 0 0 0-8.333-8.333h-4.167Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M23.959 85.127a8.333 8.333 0 0 0-8.334-8.333h-1.041c-.576 0-1.042.466-1.042 1.042v18.75h10.417V85.127Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15.625 94.502V78.877a6.25 6.25 0 0 1 6.25 6.25v9.375h-6.25Zm0-17.708a8.333 8.333 0 0 1 8.334 8.333v11.459H13.542v-18.75c0-.576.466-1.042 1.042-1.042h1.041Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M40.625 85.127a8.333 8.333 0 0 1 8.333-8.333H50c.575 0 1.042.466 1.042 1.042v18.75H40.625V85.127Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M48.958 94.502V78.877a6.25 6.25 0 0 0-6.25 6.25v9.375h6.25Zm0-17.708a8.333 8.333 0 0 0-8.333 8.333v11.459h10.417v-18.75c0-.576-.467-1.042-1.042-1.042h-1.042Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M13.541 48.669c0-.576.467-1.042 1.042-1.042h8.333c.576 0 1.042.466 1.042 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.042-1.042v-8.333Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15.625 49.71v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.042.466-1.042 1.042v8.333c0 .575.467 1.042 1.042 1.042h8.333c.576 0 1.042-.467 1.042-1.042v-8.333c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M13.541 62.21c0-.575.467-1.041 1.042-1.041h8.333c.576 0 1.042.466 1.042 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.042-1.042V62.21Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M15.625 63.252v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.042.466-1.042 1.042v8.333c0 .575.467 1.042 1.042 1.042h8.333c.576 0 1.042-.467 1.042-1.042V62.21c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M27.084 48.669c0-.576.466-1.042 1.041-1.042h8.334c.575 0 1.041.466 1.041 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.041-1.042v-8.333Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.167 49.71v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.041.466-1.041 1.042v8.333c0 .575.466 1.042 1.041 1.042h8.334c.575 0 1.041-.467 1.041-1.042v-8.333c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M27.084 62.21c0-.575.466-1.041 1.041-1.041h8.334c.575 0 1.041.466 1.041 1.042v8.333c0 .575-.466 1.042-1.041 1.042h-8.334a1.042 1.042 0 0 1-1.041-1.042V62.21Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M29.167 63.252v6.25h6.25v-6.25h-6.25Zm-1.042-2.083c-.575 0-1.041.466-1.041 1.042v8.333c0 .575.466 1.042 1.041 1.042h8.334c.575 0 1.041-.467 1.041-1.042V62.21c0-.576-.466-1.042-1.041-1.042h-8.334Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M40.625 48.669c0-.576.466-1.042 1.042-1.042H50c.575 0 1.042.466 1.042 1.042v8.333c0 .575-.467 1.042-1.042 1.042h-8.333a1.042 1.042 0 0 1-1.042-1.042v-8.333Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.708 49.71v6.25h6.25v-6.25h-6.25Zm-1.041-2.083c-.576 0-1.042.466-1.042 1.042v8.333c0 .575.466 1.042 1.042 1.042H50c.575 0 1.042-.467 1.042-1.042v-8.333c0-.576-.467-1.042-1.042-1.042h-8.333ZM48.959 28.877c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083H50a1.042 1.042 0 0 1-1.041-1.041Zm11.458-1.042a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm9.375 1.042c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm10.416 0c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm0 6.25c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm1.042 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.041 7.292c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm1.041 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-10.416-18.75a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.042 7.292c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm1.041 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.041 7.292c0-.576.466-1.042 1.041-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.041-1.041Zm-9.375-19.792a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-11.459 1.042c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083H50a1.042 1.042 0 0 1-1.041-1.041Zm11.459 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Zm-1.042 7.292c0-.576.467-1.042 1.042-1.042h6.25a1.042 1.042 0 1 1 0 2.083h-6.25a1.042 1.042 0 0 1-1.042-1.041Zm1.042 5.208a1.042 1.042 0 1 0 0 2.083h6.25a1.042 1.042 0 0 0 0-2.083h-6.25Z" clip-rule="evenodd"/>
  <path class="tw-fill-illustration-bg-tertiary" d="M40.625 62.21c0-.575.466-1.041 1.042-1.041H50c.575 0 1.042.466 1.042 1.042v8.333c0 .575-.467 1.042-1.042 1.042h-8.333a1.042 1.042 0 0 1-1.042-1.042V62.21Z"/>
  <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42.708 63.252v6.25h6.25v-6.25h-6.25Zm-1.041-2.083c-.576 0-1.042.466-1.042 1.042v8.333c0 .575.466 1.042 1.042 1.042H50c.575 0 1.042-.467 1.042-1.042V62.21c0-.576-.467-1.042-1.042-1.042h-8.333Z" clip-rule="evenodd"/>
</svg>
`,vt=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 14.58 100 75">
    <path class="tw-fill-illustration-bg-secondary" d="M0 20.833a6.25 6.25 0 0 1 6.25-6.25h87.5a6.25 6.25 0 0 1 6.25 6.25v62.5a6.25 6.25 0 0 1-6.25 6.25H6.25A6.25 6.25 0 0 1 0 83.333v-62.5Z"/>
    <path class="tw-fill-illustration-tertiary" d="M14.583 52.084a4.167 4.167 0 0 1 4.167-4.167h65.625a4.167 4.167 0 0 1 4.166 4.167v6.25a4.167 4.167 0 0 1-4.166 4.166H18.75a4.167 4.167 0 0 1-4.167-4.166v-6.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M84.375 50H18.75c-1.15 0-2.084.933-2.084 2.084v6.25c0 1.15.933 2.083 2.084 2.083h65.625c1.15 0 2.083-.933 2.083-2.083v-6.25c0-1.15-.933-2.084-2.083-2.084ZM18.75 47.917a4.167 4.167 0 0 0-4.167 4.167v6.25A4.167 4.167 0 0 0 18.75 62.5h65.625a4.167 4.167 0 0 0 4.166-4.166v-6.25a4.167 4.167 0 0 0-4.166-4.167H18.75Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33.339 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.696 1.211l-.843-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.042-1.041ZM22.922 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.695 1.211l-.844-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.042-1.041ZM54.172 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.695 1.211l-.844-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.041-1.041ZM43.755 51.638c.575 0 1.041.466 1.041 1.041v1.458l1.366-.447a1.042 1.042 0 0 1 .649 1.98l-1.385.453.868 1.215a1.042 1.042 0 0 1-1.695 1.211l-.844-1.182-.844 1.182a1.042 1.042 0 1 1-1.696-1.21l.868-1.216-1.386-.453a1.042 1.042 0 0 1 .649-1.98l1.367.447V52.68c0-.575.466-1.041 1.041-1.041Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M0 20.833a6.25 6.25 0 0 1 6.25-6.25h87.5a6.25 6.25 0 0 1 6.25 6.25v62.5a6.25 6.25 0 0 1-6.25 6.25H6.25A6.25 6.25 0 0 1 0 83.333v-62.5Zm6.25-4.167h87.5a4.167 4.167 0 0 1 4.167 4.167v2.083H2.083v-2.083a4.167 4.167 0 0 1 4.167-4.167ZM2.083 25v58.333A4.167 4.167 0 0 0 6.25 87.5h87.5a4.167 4.167 0 0 0 4.167-4.167V25H2.083Z" clip-rule="evenodd"/>
    <circle class="tw-fill-illustration-outline" cx="6.771" cy="19.885" r="1.563"/>
    <circle class="tw-fill-illustration-outline" cx="11.423" cy="19.885" r="1.563"/>
    <circle class="tw-fill-illustration-outline" cx="16.145" cy="19.885" r="1.563"/>
    <path class="tw-fill-illustration-bg-primary" d="M62.108 33.334a4.167 4.167 0 0 1 4.167-4.167h23.282a4.167 4.167 0 0 1 4.166 4.167v39.583a4.167 4.167 0 0 1-4.166 4.167H66.275a4.167 4.167 0 0 1-4.167-4.167V33.334Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M88.942 44.86c0 .575-.467 1.042-1.042 1.042H67.872a1.042 1.042 0 0 1 0-2.084H87.9c.575 0 1.042.467 1.042 1.042ZM88.942 51.062c0 .576-.467 1.042-1.042 1.042H67.872a1.042 1.042 0 0 1 0-2.083H87.9c.575 0 1.042.466 1.042 1.041ZM87.9 58.306a1.042 1.042 0 0 0 0-2.083H67.872a1.042 1.042 0 0 0 0 2.083H87.9ZM88.942 63.542c0 .576-.467 1.042-1.042 1.042H67.872a1.042 1.042 0 0 1 0-2.083H87.9c.575 0 1.042.466 1.042 1.041ZM87.9 70.975a1.042 1.042 0 1 0 0-2.083H67.872a1.042 1.042 0 0 0 0 2.083H87.9Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M62.135 33.334a4.167 4.167 0 0 1 4.166-4.167h23.282a4.167 4.167 0 0 1 4.167 4.167v2.083H62.135v-2.083Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M66.275 27.084a6.25 6.25 0 0 0-6.25 6.25v39.583a6.25 6.25 0 0 0 6.25 6.25h23.282a6.25 6.25 0 0 0 6.25-6.25V37.501h.026v-4.167a6.25 6.25 0 0 0-6.25-6.25H66.275ZM62.11 37.501v35.416a4.167 4.167 0 0 0 4.166 4.167h23.282a4.167 4.167 0 0 0 4.167-4.167V37.501H62.109Zm27.448-8.334a4.167 4.167 0 0 1 4.167 4.167v2.083h-31.59v-2.083a4.167 4.167 0 0 1 4.167-4.167h23.256Z" clip-rule="evenodd"/>
  </svg>
`;var ft=i(44500),gt=i(93695);const yt=$e.Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 501 226"><g clip-path="url(#left-bg-illustration-clip)"><path class="tw-fill-illustration-bg-primary" d="M-71.691 6.821a4 4 0 0 1 4-4h296.5a4 4 0 0 1 4 4v188a4 4 0 0 1-4 4h-296.5a4 4 0 0 1-4-4v-188Z"/><path class="tw-fill-illustration-bg-primary" d="M-48.941 25.821a2 2 0 0 1 2-2h127.5v154h-127.5a2 2 0 0 1-2-2v-150Z"/><path class="tw-fill-illustration-bg-tertiary" d="M80.559 25.82a2 2 0 0 1 2-2h125.5a2 2 0 0 1 2 2v150.001a2 2 0 0 1-2 2h-125.5a2 2 0 0 1-2-2v-150ZM45.871 89.854c0 17.155-13.96 31.062-31.182 31.062-17.221 0-31.182-13.907-31.182-31.062s13.96-31.062 31.182-31.062c17.221 0 31.182 13.907 31.182 31.062Z"/><path class="tw-fill-illustration-bg-tertiary" d="M72.396 153.443a57.243 57.243 0 0 1 4.663 22.604v1.222a2 2 0 0 1-2 2h-118.5a2 2 0 0 1-2-2v-1.222a57.243 57.243 0 0 1 4.662-22.604c3.078-7.167 7.59-13.678 13.277-19.163 5.688-5.485 12.44-9.836 19.871-12.805a63.228 63.228 0 0 1 23.44-4.496 63.227 63.227 0 0 1 23.439 4.496c7.431 2.969 14.183 7.32 19.87 12.805 5.688 5.485 10.2 11.996 13.278 19.163Z"/><path class="tw-fill-illustration-bg-secondary" d="M161.629 57.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625 0-9.181 7.579-16.625 16.928-16.625 9.348 0 16.927 7.444 16.927 16.625Z"/><path class="tw-fill-illustration-bg-secondary" d="M176.028 89.071a29.33 29.33 0 0 1 2.531 11.894c0 .937-.759 1.696-1.696 1.696h-63.109a1.695 1.695 0 0 1-1.695-1.696c0-4.081.86-8.123 2.531-11.894 1.671-3.77 4.12-7.197 7.207-10.083 3.088-2.886 6.753-5.176 10.787-6.738a35.275 35.275 0 0 1 12.725-2.366c4.366 0 8.69.804 12.724 2.366 4.034 1.562 7.699 3.852 10.787 6.738 3.087 2.886 5.537 6.312 7.208 10.083ZM161.629 134.193c0 9.182-7.579 16.625-16.927 16.625-9.349 0-16.928-7.443-16.928-16.625s7.579-16.625 16.928-16.625c9.348 0 16.927 7.443 16.927 16.625Z"/><path class="tw-fill-illustration-bg-secondary" d="M176.028 165.953a28.993 28.993 0 0 1 2.531 11.821c0 .93-.755 1.684-1.685 1.684h-63.131c-.93 0-1.684-.754-1.684-1.684 0-4.057.86-8.074 2.531-11.821 1.671-3.748 4.12-7.153 7.207-10.021 3.088-2.869 6.753-5.144 10.787-6.696a35.456 35.456 0 0 1 12.725-2.352c4.366 0 8.69.799 12.724 2.352 4.034 1.552 7.699 3.827 10.787 6.696 3.087 2.868 5.537 6.273 7.208 10.021ZM-87.441 199.521h332.5v14.5c0 5.523-4.478 10-10 10h-312.5c-5.523 0-10-4.477-10-10v-14.5Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M208.059 21.82a4 4 0 0 1 4 4v150.001a4 4 0 0 1-4 4l-255 .001a4 4 0 0 1-4-4v-150a4 4 0 0 1 4-4l255-.001Zm-255 154.002h1.5a57.23 57.23 0 0 1 4.378-21.706l.284-.673c2.982-6.943 7.31-13.27 12.748-18.646l.529-.517c5.688-5.485 12.44-9.836 19.871-12.805a62.937 62.937 0 0 1 10.036-3.065c-11.113-4.751-18.897-15.747-18.897-28.556 0-17.155 13.96-31.061 31.182-31.062 17.22 0 31.18 13.907 31.181 31.062 0 12.537-7.457 23.338-18.192 28.245a62.952 62.952 0 0 1 11.569 3.376c7.431 2.969 14.184 7.32 19.871 12.805 5.688 5.485 10.2 11.996 13.278 19.163a57.251 57.251 0 0 1 4.66 22.379h1.502v-150h-125.5v150Zm129.5-.001h29.568a29.02 29.02 0 0 1 2.159-9.161l.304-.706c1.671-3.748 4.12-7.154 7.207-10.022 2.894-2.689 6.297-4.857 10.035-6.396l.752-.299c.996-.383 2.01-.721 3.037-1.012-4.602-2.879-7.693-7.881-7.841-13.602l-.006-.429c0-9.182 7.579-16.625 16.928-16.625l.437.006c9.146.227 16.49 7.581 16.49 16.619l-.006.429c-.144 5.571-3.08 10.461-7.484 13.372 1.321.338 2.622.752 3.894 1.242 4.034 1.552 7.7 3.827 10.787 6.695 3.088 2.868 5.536 6.274 7.207 10.022a29.066 29.066 0 0 1 2.462 9.867h29.57v-73h-125.5v73Zm62.75-24.936c-3.881 0-7.718.71-11.288 2.084-3.571 1.374-6.797 3.382-9.501 5.894-2.704 2.511-4.831 5.478-6.277 8.72a25.125 25.125 0 0 0-2.074 7.876h58.279a25.125 25.125 0 0 0-2.074-7.876c-1.445-3.242-3.573-6.209-6.276-8.72-2.705-2.512-5.931-4.52-9.501-5.894a31.473 31.473 0 0 0-11.288-2.084Zm-129.5-29.906a59.215 59.215 0 0 0-21.955 4.211c-6.957 2.779-13.269 6.848-18.579 11.969-5.31 5.12-9.513 11.191-12.378 17.862a53.266 53.266 0 0 0-4.332 20.248H73.053a53.266 53.266 0 0 0-4.332-20.248c-2.866-6.671-7.07-12.742-12.38-17.862-5.31-5.121-11.621-9.19-18.577-11.969a59.215 59.215 0 0 0-21.955-4.211Zm128.893.59c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625ZM14.69 62.792c-15.027 0-27.182 12.13-27.182 27.062 0 14.931 12.155 27.062 27.181 27.063 15.027-.001 27.182-12.132 27.182-27.063S29.716 62.793 14.69 62.792Zm67.869 36.029h29.579c.229-3.094.952-6.141 2.148-9.04l.304-.71a30.936 30.936 0 0 1 6.636-9.536l.571-.547a33.416 33.416 0 0 1 10.035-6.437l.752-.3a34.78 34.78 0 0 1 3.047-1.021c-4.607-2.878-7.703-7.883-7.851-13.607l-.006-.43c0-9.18 7.579-16.624 16.928-16.624l.437.006c9.146.227 16.49 7.58 16.49 16.619l-.006.429c-.144 5.574-3.082 10.465-7.49 13.376 1.324.34 2.626.758 3.9 1.252 4.034 1.561 7.7 3.85 10.787 6.737 3.088 2.886 5.536 6.312 7.207 10.083a29.407 29.407 0 0 1 2.451 9.75h29.581v-73h-125.5v73Zm62.75-24.937c-3.878 0-7.712.714-11.281 2.096-3.568 1.382-6.795 3.401-9.5 5.93-2.704 2.528-4.833 5.515-6.281 8.782a25.432 25.432 0 0 0-2.08 7.969h58.283a25.432 25.432 0 0 0-2.08-7.97c-1.447-3.266-3.577-6.253-6.281-8.781-2.705-2.529-5.931-4.548-9.5-5.93a31.275 31.275 0 0 0-11.28-2.096Zm-.607-29.315c-7.208 0-12.928 5.72-12.928 12.625.001 6.904 5.721 12.624 12.928 12.624 7.208 0 12.926-5.72 12.927-12.624 0-6.905-5.719-12.625-12.927-12.625Z" clip-rule="evenodd"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M228.809.822a6 6 0 0 1 6 6v188a5.97 5.97 0 0 1-.643 2.699h12.893v16.5c0 6.627-5.373 12-12 12h-312.5c-6.628 0-12-5.373-12-12v-16.5h16.391a5.966 5.966 0 0 1-.634-2.391l-.007-.308v-188a6 6 0 0 1 6-6h296.5ZM-85.441 214.02a8 8 0 0 0 8 8h312.5a8 8 0 0 0 8-8v-12.5h-328.5v12.5Zm17.75-209.2a2 2 0 0 0-2 2v188.001l.01.204a2 2 0 0 0 1.99 1.796h296.5a2.001 2.001 0 0 0 2-2v-188a2 2 0 0 0-2-2h-296.5Z" clip-rule="evenodd"/><path class="tw-fill-illustration-bg-primary" d="M378.821 114.003a1.997 1.997 0 0 0-.675 1.497v8.396c0 .583.254 1.136.697 1.515l11.455 9.825a2 2 0 0 1 .543 2.286l-4.203 10.056a1.998 1.998 0 0 1-1.936 1.224l-15.288-.717a1.997 1.997 0 0 0-1.501.579l-6.014 5.979a1.995 1.995 0 0 0-.583 1.569l1.145 14.942a1.997 1.997 0 0 1-1.22 1.995l-9.958 4.169a1.997 1.997 0 0 1-2.252-.503l-10.221-11.309a1.998 1.998 0 0 0-1.482-.658h-8.474c-.579 0-1.129.252-1.508.689l-9.889 11.4a1.998 1.998 0 0 1-2.28.534l-9.969-4.174a1.998 1.998 0 0 1-1.224-1.937l.721-15.182a2 2 0 0 0-.587-1.51l-6.014-5.98a1.996 1.996 0 0 0-1.559-.575l-15.049 1.14a1.997 1.997 0 0 1-1.993-1.221l-4.198-10.045a1.997 1.997 0 0 1 .512-2.258l11.363-10.155c.424-.379.666-.92.666-1.489v-8.403c0-.583-.254-1.136-.696-1.516l-11.456-9.824a1.997 1.997 0 0 1-.542-2.286L279.354 92a1.998 1.998 0 0 1 1.936-1.224l15.288.717a1.998 1.998 0 0 0 1.502-.579l6.007-5.974c.418-.415.631-.995.582-1.582l-1.292-15.419a1.995 1.995 0 0 1 1.218-2.008l9.942-4.163a1.996 1.996 0 0 1 2.258.51l10.552 11.786c.379.423.92.665 1.488.665h8.469c.579 0 1.129-.25 1.508-.688l9.889-11.4a1.996 1.996 0 0 1 2.279-.534l9.97 4.174a1.999 1.999 0 0 1 1.224 1.937l-.721 15.181a2 2 0 0 0 .587 1.51l6.014 5.98c.411.41.98.62 1.558.576l15.049-1.14a1.996 1.996 0 0 1 1.993 1.22l4.195 10.036c.33.79.12 1.702-.521 2.268l-11.507 10.154Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M313.765 59.926a3.994 3.994 0 0 1 4.518 1.02l10.552 11.786h8.469l9.888-11.4a3.994 3.994 0 0 1 4.559-1.067l9.97 4.174a3.994 3.994 0 0 1 2.447 3.873l-.72 15.182 6.013 5.98 15.049-1.14a3.995 3.995 0 0 1 3.987 2.442l4.194 10.035a3.992 3.992 0 0 1-1.042 4.534L380.142 115.5v8.396l11.456 9.824a3.995 3.995 0 0 1 1.085 4.571l-4.203 10.056a3.993 3.993 0 0 1-3.872 2.449l-15.288-.717-6.013 5.98 1.145 14.943a3.994 3.994 0 0 1-2.44 3.988l-9.958 4.169a3.992 3.992 0 0 1-4.505-1.005l-10.221-11.309h-8.474l-9.889 11.4a3.993 3.993 0 0 1-4.559 1.067l-9.97-4.174a3.993 3.993 0 0 1-2.446-3.873l.72-15.181-6.014-5.98-15.049 1.14a3.993 3.993 0 0 1-3.986-2.442l-4.198-10.045a3.993 3.993 0 0 1 1.023-4.517l11.363-10.155v-8.403l-11.455-9.825a3.992 3.992 0 0 1-1.085-4.571l4.203-10.056a3.993 3.993 0 0 1 3.872-2.45l15.287.718 6.008-5.974-1.292-15.418a3.992 3.992 0 0 1 2.437-4.017l9.941-4.163Zm1.543 3.684-9.942 4.162 1.292 15.419a3.992 3.992 0 0 1-1.163 3.165l-6.008 5.974a3.994 3.994 0 0 1-3.003 1.157l-15.288-.717-4.202 10.056 11.455 9.824a3.993 3.993 0 0 1 1.394 3.032v8.403c0 1.137-.485 2.22-1.332 2.978l-11.364 10.154 4.198 10.045 15.049-1.14a3.994 3.994 0 0 1 3.118 1.15l6.014 5.98a3.996 3.996 0 0 1 1.173 3.021l-.72 15.181 9.969 4.175 9.889-11.401a3.994 3.994 0 0 1 3.017-1.377h8.474c1.129 0 2.206.478 2.963 1.316l10.221 11.309 9.958-4.169-1.145-14.943a3.996 3.996 0 0 1 1.166-3.137l6.013-5.979a3.997 3.997 0 0 1 3.003-1.158l15.288.717 4.203-10.056-11.456-9.824a3.995 3.995 0 0 1-1.393-3.031V115.5c0-1.146.492-2.236 1.351-2.994l11.506-10.155-4.194-10.035-15.049 1.14a3.991 3.991 0 0 1-3.117-1.15l-6.014-5.98a3.99 3.99 0 0 1-1.173-3.022l.72-15.181-9.97-4.174-9.889 11.4a3.992 3.992 0 0 1-3.016 1.377h-8.469a3.992 3.992 0 0 1-2.975-1.33L315.308 63.61Z" clip-rule="evenodd"/><path class="tw-fill-illustration-logo" d="M353.438 119.624c0 11.289-9.152 20.441-20.442 20.441-11.289 0-20.441-9.152-20.441-20.441 0-11.29 9.152-20.442 20.441-20.442 11.29 0 20.442 9.152 20.442 20.442Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M332.996 101.179c-10.186 0-18.444 8.258-18.444 18.444 0 10.187 8.258 18.445 18.444 18.445 10.187 0 18.445-8.258 18.445-18.445 0-10.186-8.258-18.444-18.445-18.444Zm-22.438 18.444c0-12.392 10.046-22.438 22.438-22.438 12.393 0 22.439 10.046 22.439 22.438 0 12.393-10.046 22.439-22.439 22.439-12.392 0-22.438-10.046-22.438-22.439Z" clip-rule="evenodd"/><path class="tw-fill-illustration-bg-tertiary" d="m497.152 164.106-7.588-7.587a3.004 3.004 0 0 0-4.245-.003l-4.055 4.047 11.83 11.83 4.055-4.047a2.996 2.996 0 0 0 .003-4.24Z"/><path class="tw-fill-illustration-bg-secondary" d="M500.922 194.274c0 22.644-18.356 41-41 41s-41-18.356-41-41 18.356-41 41-41 41 18.356 41 41Z"/><path class="tw-fill-illustration-outline" d="M459.03 177.416a2 2 0 1 1 4 0v18.469c0 .613-.282 1.192-.763 1.571l-12.032 9.48a2.001 2.001 0 0 1-2.809-.333 2.002 2.002 0 0 1 .334-2.809l11.27-8.881v-17.497Z"/><path class="tw-fill-illustration-bg-tertiary" d="M450.936 144.041a2 2 0 0 1 2-2h13.972a2 2 0 0 1 2 2v3.863a2 2 0 0 1-2 2h-13.972a2 2 0 0 1-2-2v-3.863Z"/><path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M467.114 140.046a4 4 0 0 1 3.794 3.995v3.863a3.999 3.999 0 0 1-3.931 3.998v1.978a40.72 40.72 0 0 1 13.484 4.903l3.69-3.68a5.008 5.008 0 0 1 7.076.003l7.587 7.588.177.186a4.994 4.994 0 0 1-.181 6.881l-3.615 3.606a40.801 40.801 0 0 1 5.727 20.907c0 22.644-18.357 41-41 41-22.644 0-41-18.356-41-41 0-20.434 14.949-37.375 34.507-40.487v-1.883h-.493a4 4 0 0 1-4-4v-3.863a4 4 0 0 1 4-4h13.972l.206.005Zm-7.192 17.228c-20.435 0-37 16.566-37 37 0 20.435 16.565 37 37 37 20.434 0 37-16.565 37-37 0-20.434-16.566-37-37-37Zm28.473.658a1.002 1.002 0 0 0-1.416-.001l-2.638 2.633 9.001 9.002 2.639-2.633a1 1 0 0 0 .07-1.338l-.069-.075-7.587-7.588Zm-30.966-6.028v1.447a41.171 41.171 0 0 1 5.548.036v-1.483h-5.548Zm-4.493-4h13.972v-3.863h-13.972v3.863Z" clip-rule="evenodd"/></g><defs><clipPath id="left-bg-illustration-clip"><path class="tw-fill-illustration-bg-tertiary" d="M0 0h501v226H0z"/></clipPath></defs></svg>
`,bt=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 506 297">
    <g clip-path="url(#right-bg-illustration-clip)">
      <path class="tw-fill-illustration-bg-primary" d="M45.673 294.742v-29.124l22.323 16.198-15.395 15.75a4.04 4.04 0 0 1-6.928-2.824Z"/>
      <path class="tw-fill-illustration-bg-tertiary" d="m4.978 240.865 95.568-44.738c3.52-1.648 7.492 1.175 7.093 5.041l-9.608 93.173c-.395 3.823-4.774 5.79-7.893 3.547l-43.43-31.233-41.47-16.621c-4.06-1.627-4.221-7.315-.26-9.169Z"/>
      <path class="tw-fill-illustration-outline" d="M99.698 194.315c4.929-2.306 10.489 1.645 9.931 7.058l-9.608 93.174c-.552 5.351-6.683 8.105-11.05 4.965l-20.832-14.983-14.107 14.435a6.04 6.04 0 0 1-10.359-4.222v-27.151l-39.178-15.7c-5.684-2.278-5.91-10.242-.364-12.838l95.567-44.738Zm5.953 6.648c.239-2.32-2.144-4.013-4.256-3.025L5.827 242.676c-2.376 1.112-2.28 4.525.156 5.502l40.159 16.093 26.703-30.327a2.001 2.001 0 0 1 3.002 2.644l-26.178 29.731 41.637 29.945c1.872 1.346 4.5.165 4.736-2.128l9.609-93.173Zm-57.978 93.779a2.04 2.04 0 0 0 3.498 1.426l13.684-14.001-17.182-12.357v24.932Z"/>
      <circle cx="86.719" cy="86.719" r="84.719" class="tw-fill-illustration-bg-tertiary tw-stroke-illustration-outline" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" transform="scale(-1 1) rotate(45.035 -184.565 -565.488)"/>
      <circle cx="69.752" cy="69.752" r="69.752" class="tw-fill-illustration-bg-secondary" transform="scale(-1 1) rotate(45.035 -213.255 -553.709)"/>
      <path class="tw-fill-illustration-outline" d="m445.838 353.214 2.95-180.467 12.372-.007 3.078 180.465a4.64 4.64 0 0 1-4.637 4.72l-9.12.005a4.64 4.64 0 0 1-4.643-4.716ZM453.82 52.947a2 2 0 0 1 1.998-2.001l35.638-.023a2 2 0 0 1 2.001 2.015l-.268 35.637a2 2 0 1 1-4-.03l.252-33.62-33.62.02a1.999 1.999 0 0 1-2.001-1.998ZM415.689 86.49a2 2 0 0 1 4.001.03l-.254 33.62 33.622-.021a2 2 0 0 1 .003 4l-35.637.022a2 2 0 0 1-2.001-2.015l.266-35.636Zm25.457-19.997a2 2 0 0 1 3.461-2.006l23.124 39.885a2 2 0 0 1-3.461 2.006l-23.124-39.885Z"/>
      <path class="tw-fill-illustration-bg-primary" d="M259.264 277.271c21.107-4.293 34.791-24.62 30.565-45.402-4.227-20.782-24.764-34.15-45.871-29.857-21.107 4.293-34.791 24.62-30.565 45.402 4.227 20.783 24.764 34.15 45.871 29.857ZM299.993 173.472c7.793-1.585 12.826-9.188 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.187-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-secondary" d="M329.869 242.094c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.188-12.826-16.981-11.241-7.794 1.585-12.827 9.188-11.241 16.981 1.585 7.794 9.187 12.827 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-tertiary" d="M330.088 309.401c7.794-1.585 12.826-9.188 11.241-16.981-1.585-7.794-9.187-12.827-16.981-11.242-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.827 16.981 11.242Z"/>
      <path class="tw-fill-illustration-bg-primary" d="M234.598 327.597c7.793-1.585 12.826-9.187 11.241-16.981-1.585-7.793-9.187-12.826-16.981-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.794 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-secondary" d="M176.919 248.71c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.794-9.188-12.827-16.982-11.242-7.793 1.586-12.826 9.188-11.241 16.982 1.585 7.793 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-bg-tertiary" d="M206.836 185.071c7.794-1.585 12.827-9.188 11.242-16.981-1.586-7.793-9.188-12.826-16.982-11.241-7.793 1.585-12.826 9.188-11.241 16.981 1.585 7.793 9.188 12.826 16.981 11.241Z"/>
      <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M200.699 154.89c8.875-1.805 17.533 3.927 19.339 12.803 1.165 5.732-.814 11.372-4.752 15.135.131.223.29.502.489.845l14.805 21.386a41.483 41.483 0 0 1 12.979-5.007c9.276-1.886 18.455-.523 26.321 3.303.038-.221.111-.441.227-.648l17.035-30.333a16.337 16.337 0 0 1-6.09-9.744c-1.805-8.876 3.928-17.535 12.803-19.34 8.876-1.805 17.534 3.928 19.339 12.803 1.805 8.876-3.926 17.534-12.802 19.339-3.427.697-6.822.27-9.803-1.028l-16.994 30.262a1.98 1.98 0 0 1-.397.497c8.774 5.316 15.487 13.883 18.16 24.43l19.238-1.61c-.007-7.642 5.356-14.488 13.135-16.07 8.875-1.805 17.534 3.927 19.339 12.803 1.805 8.875-3.927 17.533-12.802 19.339-8.639 1.757-17.072-3.627-19.18-12.099l-18.935 1.585c1.474 9.839-.81 19.465-5.834 27.387l29.108 22.962a16.324 16.324 0 0 1 8.523-4.671c8.876-1.804 17.534 3.928 19.339 12.803 1.805 8.876-3.927 17.534-12.802 19.339-8.875 1.805-17.534-3.926-19.34-12.802a16.338 16.338 0 0 1 1.872-11.474l-29.007-22.882c-5.828 7.464-14.29 12.983-24.349 15.028a41.442 41.442 0 0 1-14.045.441l-6.224 19.317a16.365 16.365 0 0 1 8.405 11.229c1.805 8.876-3.927 17.534-12.802 19.339-8.876 1.805-17.535-3.926-19.34-12.802-1.805-8.875 3.927-17.534 12.803-19.34 2.461-.5 4.906-.42 7.192.145l6.007-18.641c-14.851-3.594-27.011-15.301-30.225-31.105a40.043 40.043 0 0 1-.808-8.184l-20.473-1.442c-.032-.002-.064-.008-.096-.011-1.37 6.114-6.201 11.162-12.739 12.492-8.875 1.805-17.534-3.926-19.339-12.802-1.805-8.875 3.927-17.534 12.802-19.34 8.876-1.804 17.534 3.928 19.339 12.803.196.962.302 1.921.327 2.869l20.401 1.436c1.206-11.333 7.247-21.627 16.399-28.363l-14.76-21.321a20.41 20.41 0 0 0-.435-.719 16.428 16.428 0 0 1-4.816 1.8c-8.876 1.805-17.535-3.927-19.34-12.802-1.805-8.876 3.927-17.535 12.803-19.34Zm124.048 128.249c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.364-6.71-7.911-11.044-14.622-9.68Zm-95.49 18.196c-6.711 1.365-11.045 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.621-1.365-6.711-7.911-11.045-14.622-9.681Zm15.1-97.363c-20.054 4.079-33.004 23.373-29.004 43.044 4.001 19.672 23.459 32.374 43.513 28.296 9.593-1.951 17.558-7.386 22.822-14.676a1.986 1.986 0 0 1 .612-.873c5.306-7.813 7.58-17.606 5.569-27.495-4.001-19.671-23.459-32.374-43.512-28.296Zm80.171 11.861c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.623 9.679 6.71-1.365 11.044-7.911 9.679-14.622-1.365-6.711-7.911-11.045-14.622-9.68Zm-152.949 6.614c-6.711 1.365-11.045 7.912-9.681 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.621-1.365-6.711-7.912-11.045-14.622-9.681Zm123.073-75.237c-6.71 1.365-11.044 7.912-9.68 14.623 1.365 6.711 7.912 11.044 14.623 9.679 6.711-1.365 11.044-7.911 9.68-14.622-1.365-6.71-7.912-11.045-14.623-9.68Zm-93.156 11.6c-6.711 1.364-11.045 7.912-9.68 14.623 1.365 6.71 7.912 11.044 14.622 9.679 6.711-1.365 11.044-7.912 9.68-14.622-1.365-6.711-7.911-11.045-14.622-9.68Z" clip-rule="evenodd"/>
      <path class="tw-fill-illustration-logo" d="M272.266 232.544a1.998 1.998 0 0 0-.353 1.589l.554 2.725a2.002 2.002 0 0 0 1.002 1.357l4.786 2.611a2 2 0 0 1 1.003 2.15l-.667 3.313a1.998 1.998 0 0 1-1.647 1.58l-5.641.896a1.998 1.998 0 0 0-1.352.867l-1.524 2.291a2 2 0 0 0-.252 1.678l1.555 5.227a2 2 0 0 1-.794 2.224l-2.799 1.902a2 2 0 0 1-2.309-.043l-4.524-3.327a2 2 0 0 0-1.583-.348l-2.754.56a1.997 1.997 0 0 0-1.352.994l-2.638 4.785a2 2 0 0 1-2.14.996l-3.339-.661a2 2 0 0 1-1.587-1.649l-.886-5.597a2.003 2.003 0 0 0-.875-1.358l-2.298-1.514a2 2 0 0 0-1.669-.247l-5.272 1.563a2 2 0 0 1-2.22-.788l-1.897-2.774a2.001 2.001 0 0 1 .045-2.321l3.339-4.498a2.004 2.004 0 0 0 .354-1.591l-.557-2.736a2.001 2.001 0 0 0-.983-1.347l-4.848-2.715a2 2 0 0 1-.983-2.14l.669-3.329a2.001 2.001 0 0 1 1.648-1.581l5.641-.895a1.999 1.999 0 0 0 1.352-.868l1.526-2.293c.327-.493.42-1.105.253-1.673l-1.608-5.457a2 2 0 0 1 .794-2.22l2.793-1.897a2 2 0 0 1 2.322.053l4.676 3.5a1.999 1.999 0 0 0 1.597.359l2.744-.558a2.002 2.002 0 0 0 1.353-.995l2.637-4.784a1.997 1.997 0 0 1 2.14-.996l3.339.661a2 2 0 0 1 1.587 1.649l.886 5.597c.088.555.406 1.048.875 1.357l2.298 1.514a2.002 2.002 0 0 0 1.669.248l5.272-1.564a2 2 0 0 1 2.22.789l1.898 2.775a2 2 0 0 1-.044 2.319l-3.432 4.635Zm-24.977-.064c-4.049 2.702-5.078 8.076-2.395 11.991 2.705 4.028 8.1 5.044 12.035 2.365 3.936-2.678 5.078-8.076 2.395-11.991-2.592-4.051-7.986-5.067-12.035-2.365Z"/>
      <path class="tw-fill-illustration-outline" d="m270.507 237.256-.554-2.724a4.004 4.004 0 0 1 .705-3.178l3.433-4.636-1.897-2.775-5.273 1.564a4 4 0 0 1-3.337-.494l-2.298-1.515a4 4 0 0 1-1.751-2.714l-.886-5.597-3.339-.661-2.637 4.784a4.001 4.001 0 0 1-2.706 1.989l-2.744.558a4 4 0 0 1-3.194-.718l-4.676-3.5-2.792 1.898 1.608 5.457a3.998 3.998 0 0 1-.507 3.345l-1.525 2.294c-.62.931-1.6 1.56-2.704 1.736l-5.642.895-.669 3.329 4.848 2.715a4 4 0 0 1 1.965 2.693l.557 2.737a3.999 3.999 0 0 1-.708 3.18l-3.338 4.499 1.897 2.774 5.272-1.563a3.998 3.998 0 0 1 3.338.494l2.298 1.514a4.001 4.001 0 0 1 1.75 2.715l.886 5.597 3.339.661 2.638-4.785a4 4 0 0 1 2.706-1.988l2.753-.56a4 4 0 0 1 3.166.697l4.524 3.327 2.8-1.902-1.555-5.227a4.002 4.002 0 0 1 .504-3.355l1.524-2.291a3.998 3.998 0 0 1 2.703-1.736l5.642-.895.667-3.313-4.787-2.611a4.004 4.004 0 0 1-2.004-2.714Zm-24.328-6.439c4.915-3.28 11.556-2.099 14.795 2.898h.001v.001l.034.051h-.001c3.294 4.868 1.835 11.464-2.953 14.723-4.855 3.304-11.499 2.043-14.821-2.903l.001-.001c-3.308-4.845-2.013-11.461 2.944-14.769Zm11.461 5.106c-1.959-3.06-6.075-3.891-9.24-1.779-3.036 2.026-3.85 5.957-2.039 8.913l.183.284.01.015c2.089 3.109 6.234 3.879 9.25 1.827 3.066-2.087 3.897-6.25 1.871-9.207a.97.97 0 0 1-.035-.053Zm16.787.536 4.787 2.611a4 4 0 0 1 2.005 4.3l-.666 3.313a4.001 4.001 0 0 1-3.295 3.161l-5.641.896-1.525 2.291 1.555 5.227a4.002 4.002 0 0 1-1.586 4.449l-2.8 1.901a4 4 0 0 1-4.618-.086l-4.523-3.326-2.753.56-2.638 4.784a4 4 0 0 1-4.279 1.993l-3.34-.661a4.002 4.002 0 0 1-3.174-3.298l-.886-5.598-2.298-1.514-5.273 1.564a3.999 3.999 0 0 1-4.438-1.577l-1.897-2.774a3.998 3.998 0 0 1 .09-4.641l3.338-4.499-.557-2.737-4.848-2.715a3.998 3.998 0 0 1-1.966-4.279l.669-3.329a4.002 4.002 0 0 1 3.294-3.162l5.642-.895 1.526-2.294-1.609-5.457a4.001 4.001 0 0 1 1.59-4.439l2.792-1.897a4 4 0 0 1 4.645.106l4.676 3.5 2.744-.558 2.636-4.785a4 4 0 0 1 4.281-1.992l3.339.661a4 4 0 0 1 3.174 3.298l.886 5.597 2.298 1.514 5.272-1.563a4 4 0 0 1 4.439 1.576l1.898 2.775a4.001 4.001 0 0 1-.087 4.639l-3.433 4.636.554 2.724Z"/>
    </g>
    <defs>
      <clipPath id="right-bg-illustration-clip">
        <path class="tw-fill-illustration-bg-tertiary" d="M0 0h506v297H0z"/>
      </clipPath>
    </defs>
  </svg>
`,wt=$e.Sm`
<svg version="1.1" viewBox="0 0 290 60" xmlns="http://www.w3.org/2000/svg">
  <title>Vaultwarden</title>
  <path class="tw-fill-marketing-logo" d="m166 46-4.2-13q-.4-1.2-1.5-5.6h-.17q-.83 3.6-1.5 5.6l-4.3 13h-4l-6.2-23h3.6q2.2 8.6 3.3 13 1.2 4.5 1.3 6.1h.17q.23-1.2.73-3.1.52-1.9.89-3l4.2-13h3.7l4.1 13q1.2 3.6 1.6 6h.17q.083-.75.44-2.3.37-1.6 4.3-17h3.6l-6.3 23zm29 0-.69-3.2h-.17q-1.7 2.1-3.4 2.9-1.7.75-4.2.75-3.4 0-5.3-1.7-1.9-1.7-1.9-5 0-6.9 11-7.2l3.9-.12v-1.4q0-2.7-1.2-4-1.1-1.3-3.7-1.3-2.8 0-6.4 1.7l-1.1-2.6q1.7-.92 3.7-1.4 2-.52 4-.52 4.1 0 6 1.8 2 1.8 2 5.8v16zm-7.8-2.4q3.2 0 5.1-1.8 1.9-1.8 1.9-4.9v-2.1l-3.5.15q-4.1.15-5.9 1.3-1.8 1.1-1.8 3.5 0 1.9 1.1 2.8 1.1.98 3.2.98zm28-21q1.5 0 2.7.25l-.48 3.2q-1.4-.31-2.5-.31-2.8 0-4.7 2.2-2 2.2-2 5.6v12h-3.5v-23h2.8l.4 4.2h.17q1.3-2.2 3.1-3.4 1.8-1.2 3.9-1.2zm22 20h-.19q-2.4 3.5-7.2 3.5-4.5 0-7-3.1-2.5-3.1-2.5-8.7 0-5.6 2.5-8.8 2.5-3.1 6.9-3.1 4.6 0 7.1 3.4h.27l-.15-1.6-.083-1.6v-9.3h3.5v32h-2.8zm-6.9.58q3.5 0 5.1-1.9 1.6-1.9 1.6-6.2v-.73q0-4.8-1.6-6.9-1.6-2.1-5.1-2.1-3 0-4.7 2.4-1.6 2.3-1.6 6.7 0 4.4 1.6 6.6 1.6 2.2 4.7 2.2zm27 2.9q-5.1 0-8-3.1-2.9-3.1-2.9-8.5 0-5.5 2.7-8.8 2.7-3.2 7.3-3.2 4.3 0 6.8 2.8 2.5 2.8 2.5 7.4v2.2h-16q.1 4 2 6.1 1.9 2.1 5.4 2.1 3.7 0 7.3-1.5v3.1q-1.8.79-3.5 1.1-1.6.35-3.9.35zm-.94-21q-2.7 0-4.4 1.8-1.6 1.8-1.9 4.9h12q0-3.3-1.5-5-1.5-1.7-4.2-1.7zm31 20v-15q0-2.8-1.3-4.2-1.3-1.4-4-1.4-3.6 0-5.2 1.9-1.7 1.9-1.7 6.4v12h-3.5v-23h2.8l.56 3.1h.17q1.1-1.7 3-2.6 1.9-.94 4.3-.94 4.1 0 6.2 2 2.1 2 2.1 6.3v15z"/>
  <path class="tw-fill-marketing-logo" d="m77 46-1.2-3.2h-.17q-1.6 2-3.3 2.8-1.7.77-4.4.77-3.3 0-5.3-1.9-1.9-1.9-1.9-5.4 0-3.7 2.6-5.4 2.6-1.8 7.8-2l4-.12v-1q0-3.5-3.6-3.5-2.8 0-6.6 1.7l-2.1-4.3q4-2.1 8.9-2.1 4.7 0 7.2 2 2.5 2 2.5 6.2v15zm-1.9-11-2.5.083q-2.8.083-4.1 1-1.4.92-1.4 2.8 0 2.7 3.1 2.7 2.2 0 3.5-1.3 1.3-1.3 1.3-3.4zm29 11-.85-3h-.33q-1 1.6-2.9 2.5-1.9.87-4.3.87-4.1 0-6.2-2.2-2.1-2.2-2.1-6.3v-15h6.3v14q0 2.5.89 3.8.89 1.2 2.8 1.2 2.7 0 3.8-1.8 1.2-1.8 1.2-5.9v-11h6.3v23zm18 0h-6.3v-32h6.3zm16-4.6q1.7 0 4-.73v4.7q-2.4 1.1-5.8 1.1-3.8 0-5.6-1.9-1.7-1.9-1.7-5.8v-11h-3v-2.7l3.5-2.1 1.8-4.9h4.1v4.9h6.5v4.8h-6.5v11q0 1.4.75 2 .77.64 2 .64z"/>
  <path class="tw-fill-marketing-logo" d="m18 11-5.6.00073 15 42h5.3l15-42h-5.6l-9.5 27c-.63 1.7-1.2 3.4-1.6 4.9-.43 1.5-.79 2.9-1.1 4.3-.28-1.4-.63-2.8-1.1-4.4-.43-1.5-.97-3.2-1.6-5l-9.5-27z"/>
  <path class="tw-fill-marketing-logo" d="m30 .05a.85.85 0 00-.44.37l-1.5 2.5c-.27.022-.53.046-.8.076l-2-2.2a.85.85 0 00-1.4.29l-1 2.8c-.26.074-.51.15-.77.23l-2.4-1.8a.85.85 0 00-1.4.56l-.44 2.9c-.23.12-.47.24-.7.37l-2.7-1.3a.85.85 0 00-1.2.81l.14 3c-.2.16-.4.33-.6.49l-2.9-.72a.85.85 0 00-1 1l.72 2.9c-.17.2-.33.4-.49.6l-3-.14a.85.85 0 00-.81 1.2l1.3 2.7c-.13.23-.25.46-.37.7l-2.9.44a.85.85 0 00-.56 1.4l1.8 2.4c-.081.25-.16.51-.23.77l-2.8 1a.85.85 0 00-.29 1.4l2.2 2c-.03.26-.054.53-.076.8l-2.5 1.5a.85.85 0 000 1.5l2.5 1.5c.022.27.046.53.076.8l-2.2 2a.85.85 0 00.29 1.4l2.8 1c.074.26.15.51.23.77l-1.8 2.4a.85.85 0 00.56 1.4l2.9.44c.12.23.24.47.37.7l-1.3 2.7a.85.85 0 00.81 1.2l3-.14c.16.2.33.4.49.6l-.72 2.9a.85.85 0 001 1l2.9-.72c.2.17.4.33.6.49l-.14 3a.85.85 0 001.2.81l2.7-1.3c.23.13.46.25.7.37l.44 2.9a.85.85 0 001.4.56l2.4-1.8c.25.081.51.16.77.23l1 2.8a.85.85 0 001.4.29l2-2.2c.26.03.53.054.8.076l1.5 2.5a.85.85 0 001.5 0l1.5-2.5c.27-.022.53-.046.8-.076l2 2.2a.85.85 0 001.4-.29l1-2.8c.26-.074.51-.15.77-.23l2.4 1.8a.85.85 0 001.4-.56l.44-2.9c.23-.12.47-.24.7-.37l2.7 1.3a.85.85 0 001.2-.81l-.14-3c.2-.16.4-.33.6-.49l2.9.72a.85.85 0 001-1l-.72-2.9c.17-.2.33-.4.49-.6l3 .14a.85.85 0 00.81-1.2l-1.3-2.7c.13-.23.25-.46.37-.7l2.9-.44a.85.85 0 00.56-1.4l-1.8-2.4c.081-.25.16-.51.23-.77l2.8-1a.85.85 0 00.29-1.4l-2.2-2c.03-.26.054-.53.076-.8l2.5-1.5a.85.85 0 000-1.5l-2.5-1.5c-.022-.27-.046-.53-.076-.8l2.2-2a.85.85 0 00-.29-1.4l-2.8-1c-.074-.26-.15-.51-.23-.77l1.8-2.4a.85.85 0 00-.56-1.4l-2.9-.44c-.12-.23-.24-.47-.37-.7l1.3-2.7a.85.85 0 00-.81-1.2l-3 .14c-.16-.2-.33-.4-.49-.6l.72-2.9a.85.85 0 00-1-1l-2.9.72c-.2-.17-.4-.33-.6-.49l.14-3a.85.85 0 00-1.2-.81l-2.7 1.3c-.23-.13-.46-.25-.7-.37l-.44-2.9a.85.85 0 00-1.4-.56l-2.4 1.8c-.25-.081-.51-.16-.77-.23l-1-2.8a.85.85 0 00-1.4-.29l-2 2.2c-.26-.03-.53-.054-.8-.076l-1.5-2.5a.85.85 0 00-1-.37zm.29 5.4a1.7 1.7 0 011.7 1.7 1.7 1.7 0 01-1.7 1.7 1.7 1.7 0 01-1.7-1.7 1.7 1.7 0 011.7-1.7zm-4 2.9 2.8 2.8a1.7 1.7 0 002.4 0l2.8-2.8c6.6 1.2 12 5.4 15 11l-1.8 3.6a1.7 1.7 0 00.75 2.3l3.6 1.8c.12.92.18 1.9.18 2.8 0 5.8-2.3 11-6 15l-4-.63a1.7 1.7 0 00-2 1.4l-.63 4c-2.8 1.3-6 2.1-9.4 2.1-3.4 0-6.5-.76-9.4-2.1l-.63-4a1.7 1.7 0 00-2-1.4l-4 .63c-3.7-3.9-6-9.2-6-15 0-.96.064-1.9.18-2.8l3.6-1.8a1.7 1.7 0 00.75-2.3l-1.8-3.6c3.1-5.7 8.6-9.8 15-11zm-18 13a1.7 1.7 0 01.48.083 1.7 1.7 0 011.1 2.2 1.7 1.7 0 01-2.2 1.1 1.7 1.7 0 01-1.1-2.2 1.7 1.7 0 011.7-1.2zm43 0a1.7 1.7 0 011.7 1.2 1.7 1.7 0 01-1.1 2.2 1.7 1.7 0 01-2.2-1.1 1.7 1.7 0 011.1-2.2 1.7 1.7 0 01.48-.083zm-35 25a1.7 1.7 0 01.91.32 1.7 1.7 0 01.38 2.4 1.7 1.7 0 01-2.4.38 1.7 1.7 0 01-.38-2.4 1.7 1.7 0 011.5-.7zm27 0a1.7 1.7 0 011.5.7 1.7 1.7 0 01-.38 2.4 1.7 1.7 0 01-2.4-.38 1.7 1.7 0 01.38-2.4 1.7 1.7 0 01.91-.32z"/>
</svg>
`;var St=i(29377),It=i(67379),kt=i(89207),Ct=i(58384),Tt=i(25740),Ft=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Rt=[[["","slot","header-actions"]],[["","slot","secondary"]],[["","slot","environment-selector"]],"*"],Pt=(e,t)=>({"tw-min-h-screen":e,"tw-min-h-full":t}),xt=()=>["/"];function $t(e,t){if(1&e&&(k.j41(0,"a",2),k.nrm(1,"bit-icon",11),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.Y8G("routerLink",k.lJ4(5,xt)),k.R7$(),k.Y8G("icon",e.logo)("ariaLabel",k.bMT(2,3,"appLogoLabel"))}}function Et(e,t){if(1&e&&(k.j41(0,"div",12),k.nrm(1,"bit-icon",13),k.k0s()),2&e){k.XpG();const e=k.r8f(6);k.R7$(),k.Y8G("icon",e)}}function At(e,t){if(1&e&&(k.j41(0,"h1",14),k.EFF(1),k.k0s(),k.j41(2,"h1",15),k.EFF(3),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.SpI(" ",e.title()," "),k.R7$(2),k.SpI(" ",e.title()," ")}}function Dt(e,t){if(1&e&&(k.j41(0,"div",6),k.EFF(1),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.JRh(e.subtitle())}}function Ot(e,t){1&e&&k.eu8(0)}function Mt(e,t){if(1&e&&(k.j41(0,"div",8),k.DNE(1,Ot,1,0,"ng-container",16),k.k0s()),2&e){k.XpG();const e=k.sdS(17);k.R7$(),k.Y8G("ngTemplateOutlet",e)}}function Ut(e,t){1&e&&k.eu8(0)}function Gt(e,t){if(1&e&&(k.j41(0,"bit-base-card",9),k.DNE(1,Ut,1,0,"ng-container",16),k.k0s()),2&e){k.XpG();const e=k.sdS(17);k.R7$(),k.Y8G("ngTemplateOutlet",e)}}function jt(e,t){if(1&e&&(k.j41(0,"div",17),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG(2);k.R7$(),k.Lme("",k.bMT(2,2,"accessing")," ",e.hostname)}}function Nt(e,t){1&e&&k.SdG(0,2)}function Vt(e,t){if(1&e&&(k.j41(0,"div",17),k.EFF(1,"Vaultwarden Web"),k.k0s(),k.j41(2,"div",17),k.EFF(3),k.k0s(),k.nrm(4,"br"),k.j41(5,"div",18),k.EFF(6," A modified version of the Bitwarden® Web Vault for Vaultwarden (an unofficial rewrite of the Bitwarden® server)."),k.nrm(7,"br"),k.EFF(8," Vaultwarden is not associated with the Bitwarden® project nor Bitwarden Inc. "),k.k0s()),2&e){const e=k.XpG(2);k.R7$(3),k.JRh(e.version)}}function Bt(e,t){if(1&e&&(k.j41(0,"footer",10),k.nVh(1,jt,3,4,"div",17)(2,Nt,1,0),k.nVh(3,Vt,9,1),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.vxM(e.showReadonlyHostname()?1:2),k.R7$(2),k.vxM(e.hideYearAndVersion?-1:3)}}function zt(e,t){if(1&e&&(k.j41(0,"div",19),k.nrm(1,"bit-icon",13),k.k0s(),k.j41(2,"div",20),k.nrm(3,"bit-icon",13),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.Y8G("icon",e.leftIllustration),k.R7$(2),k.Y8G("icon",e.rightIllustration)}}function Lt(e,t){1&e&&k.SdG(0,3)}class Kt{get classList(){return["tw-h-full"]}get maxWidthClass(){switch(this.maxWidth()){case"md":return"tw-max-w-md";case"lg":return"tw-max-w-lg";case"xl":return"tw-max-w-xl";case"2xl":return"tw-max-w-2xl";case"3xl":return"tw-max-w-3xl";case"4xl":return"tw-max-w-4xl"}}constructor(e,t){this.environmentService=e,this.platformUtilsService=t,this.leftIllustration=yt,this.rightIllustration=bt,this.title=(0,r.hFB)(),this.subtitle=(0,r.hFB)(),this.icon=r.geq.required(),this.showReadonlyHostname=(0,r.hFB)(!1),this.hideLogo=(0,r.hFB)(!1),this.hideFooter=(0,r.hFB)(!1),this.hideCardWrapper=(0,r.hFB)(!1),this.hideBackgroundIllustration=(0,r.hFB)(!1),this.maxWidth=(0,r.geq)("md"),this.logo=wt,this.hideYearAndVersion=!1,this.year=(new Date).getFullYear().toString(),this.clientType=this.platformUtilsService.getClientType(),this.hideYearAndVersion=this.clientType!==pe.sK.Web}ngOnInit(){return Ft(this,void 0,void 0,function*(){var e;this.maxWidth.set(null!==(e=this.maxWidth())&&void 0!==e?e:"md"),this.hostname=(yield(0,u._)(this.environmentService.environment$)).getHostname(),this.version=yield this.platformUtilsService.getApplicationVersion()})}ngOnChanges(e){return Ft(this,void 0,void 0,function*(){var t;e.maxWidth&&this.maxWidth.set(null!==(t=e.maxWidth.currentValue)&&void 0!==t?t:"md")})}}Kt.ɵfac=function(e){return new(e||Kt)(k.rXU(St.v),k.rXU(N.y))},Kt.ɵcmp=k.VBU({type:Kt,selectors:[["auth-anon-layout"]],hostVars:2,hostBindings:function(e,t){2&e&&k.HbH(t.classList)},inputs:{title:[1,"title"],subtitle:[1,"subtitle"],icon:[1,"icon"],showReadonlyHostname:[1,"showReadonlyHostname"],hideLogo:[1,"hideLogo"],hideFooter:[1,"hideFooter"],hideCardWrapper:[1,"hideCardWrapper"],hideBackgroundIllustration:[1,"hideBackgroundIllustration"],maxWidth:[1,"maxWidth"]},outputs:{icon:"iconChange",maxWidth:"maxWidthChange"},features:[k.OA$],ngContentSelectors:["[slot=header-actions]","[slot=secondary]","[slot=environment-selector]","*"],decls:18,vars:16,consts:[["defaultContent",""],[1,"tw-relative","tw-flex","tw-w-full","tw-mx-auto","tw-flex-col","tw-bg-background-alt","tw-p-5","tw-text-main",3,"ngClass"],[1,"tw-w-32","sm:tw-w-[200px]","tw-self-center","sm:tw-self-start","tw-block","[&>*]:tw-align-top",3,"routerLink"],[1,"tw-ms-auto"],[1,"tw-text-center","tw-mb-4","sm:tw-mb-6","tw-mx-auto",3,"ngClass"],["class","tw-size-20 sm:tw-size-24 [&_svg]:tw-w-full [&_svg]:tw-max-w-24 tw-mx-auto tw-content-center",4,"ngIf"],[1,"tw-text-sm","sm:tw-text-base"],[1,"tw-z-10","tw-grow","tw-w-full","tw-mx-auto","tw-flex","tw-flex-col","tw-items-center","sm:tw-min-w-[28rem]",3,"ngClass"],[1,"tw-mb-6","sm:tw-mb-10"],[1,"!tw-rounded-2xl","tw-mb-6","sm:tw-mb-10","tw-mx-auto","tw-w-full","tw-bg-transparent","tw-border-none","tw-shadow-none","sm:tw-bg-background","sm:tw-border","sm:tw-border-solid","sm:tw-border-secondary-100","sm:tw-shadow","sm:tw-p-8"],[1,"tw-text-center","tw-mt-4","sm:tw-mt-6"],[3,"icon","ariaLabel"],[1,"tw-size-20","sm:tw-size-24","[&_svg]:tw-w-full","[&_svg]:tw-max-w-24","tw-mx-auto","tw-content-center"],[3,"icon"],["bitTypography","h2",1,"tw-mt-2","sm:tw-hidden"],["bitTypography","h1",1,"tw-mt-2","tw-hidden","sm:tw-block"],[4,"ngTemplateOutlet"],["bitTypography","body2"],["bitTypography","helper","id","vw-disclaimer"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-start-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"],[1,"tw-hidden","md:tw-block","[&_svg]:tw-absolute","tw-z-[1]","tw-opacity-[.11]","[&_svg]:tw-bottom-0","[&_svg]:tw-end-0","[&_svg]:tw-w-[35%]","[&_svg]:tw-max-w-[450px]"]],template:function(e,t){if(1&e&&(k.NAR(Rt),k.j41(0,"main",1)(1,"div"),k.nVh(2,$t,3,6,"a",2),k.j41(3,"div",3),k.SdG(4),k.k0s()(),k.j41(5,"div",4),k.SS7(6),k.DNE(7,Et,2,1,"div",5),k.nVh(8,At,4,2),k.nVh(9,Dt,2,1,"div",6),k.k0s(),k.j41(10,"div",7),k.nVh(11,Mt,2,1,"div",8)(12,Gt,2,1,"bit-base-card",9),k.SdG(13,1),k.k0s(),k.nVh(14,Bt,4,2,"footer",10),k.nVh(15,zt,4,2),k.k0s(),k.DNE(16,Lt,1,0,"ng-template",null,0,k.C5r)),2&e){k.Y8G("ngClass",k.l_i(13,Pt,"web"===t.clientType,"browser"===t.clientType||"desktop"===t.clientType)),k.R7$(),k.HbH("tw-flex tw-justify-between tw-items-center tw-w-full"+(t.hideLogo()?"":" tw-mb-12")),k.R7$(),k.vxM(t.hideLogo()?-1:2),k.R7$(3),k.Y8G("ngClass",t.maxWidthClass),k.R7$();const e=k.bH3(t.icon());k.R7$(),k.Y8G("ngIf",null!==e),k.R7$(),k.vxM(t.title()?8:-1),k.R7$(),k.vxM(t.subtitle()?9:-1),k.R7$(),k.Y8G("ngClass",t.maxWidthClass),k.R7$(),k.vxM(t.hideCardWrapper()?11:12),k.R7$(3),k.vxM(t.hideFooter()?-1:14),k.R7$(),k.vxM(t.hideBackgroundIllustration()?-1:15)}},dependencies:[ge.o,Ct.i,Y.MD,Y.YU,Y.bT,Y.T3,be.E,Ce.r,kt.G,ne.iI,ne.Wk,It.f,Tt.$],encapsulation:2});class qt{constructor(e,t,i,n,r){this.router=e,this.route=t,this.i18nService=i,this.anonLayoutWrapperDataService=n,this.changeDetectorRef=r,this.destroy$=new d.B,this.pageIcon=null,this.destroyRef=(0,C.WQX)(C.abz)}ngOnInit(){var e;this.setAnonLayoutWrapperDataFromRouteData(null===(e=this.route.snapshot.firstChild)||void 0===e?void 0:e.data),this.listenForPageDataChanges(),this.listenForServiceDataChanges()}listenForPageDataChanges(){this.router.events.pipe((0,h.p)(e=>e instanceof x.wF),(0,O.M)(()=>this.resetPageData()),(0,ft.n)(()=>{var e;return(null===(e=this.route.firstChild)||void 0===e?void 0:e.data)||(0,gt.of)(null)}),(0,c.pQ)(this.destroyRef)).subscribe(e=>{this.setAnonLayoutWrapperDataFromRouteData(e)})}setAnonLayoutWrapperDataFromRouteData(e){e&&(void 0!==e.pageTitle&&(this.pageTitle=this.handleStringOrTranslation(e.pageTitle)),void 0!==e.pageSubtitle&&(this.pageSubtitle=this.handleStringOrTranslation(e.pageSubtitle)),void 0!==e.pageIcon&&(this.pageIcon=e.pageIcon),this.showReadonlyHostname=Boolean(e.showReadonlyHostname),this.maxWidth=e.maxWidth,this.hideCardWrapper=Boolean(e.hideCardWrapper),this.hideBackgroundIllustration=Boolean(e.hideBackgroundIllustration))}listenForServiceDataChanges(){this.anonLayoutWrapperDataService.anonLayoutWrapperData$().pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{this.setAnonLayoutWrapperData(e)})}setAnonLayoutWrapperData(e){e&&(void 0!==e.pageTitle&&(this.pageTitle=null!==e.pageTitle?this.handleStringOrTranslation(e.pageTitle):null),void 0!==e.pageSubtitle&&(this.pageSubtitle=null!==e.pageSubtitle?this.handleStringOrTranslation(e.pageSubtitle):null),void 0!==e.pageIcon&&(this.pageIcon=null!==e.pageIcon?e.pageIcon:null),void 0!==e.showReadonlyHostname&&(this.showReadonlyHostname=e.showReadonlyHostname),void 0!==e.hideCardWrapper&&(this.hideCardWrapper=e.hideCardWrapper),void 0!==e.hideBackgroundIllustration&&(this.hideBackgroundIllustration=e.hideBackgroundIllustration),void 0!==e.maxWidth&&(this.maxWidth=e.maxWidth),this.changeDetectorRef.detectChanges())}handleStringOrTranslation(e){var t;return"string"==typeof e?e:this.i18nService.t(e.key,...null!==(t=e.placeholders)&&void 0!==t?t:[])}resetPageData(){this.pageTitle=null,this.pageSubtitle=null,this.pageIcon=null,this.showReadonlyHostname=null,this.maxWidth=null,this.hideCardWrapper=null,this.hideBackgroundIllustration=null}}qt.ɵfac=function(e){return new(e||qt)(k.rXU(x.Ix),k.rXU(x.nX),k.rXU(j.W),k.rXU(Ie.f),k.rXU(r.gRc))},qt.ɵcmp=k.VBU({type:qt,selectors:[["ng-component"]],decls:5,vars:7,consts:[[3,"title","subtitle","icon","showReadonlyHostname","maxWidth","hideCardWrapper","hideBackgroundIllustration"],["slot","header-actions","name","header-actions"],["slot","secondary","name","secondary"],["slot","environment-selector","name","environment-selector"]],template:function(e,t){1&e&&(k.j41(0,"auth-anon-layout",0),k.nrm(1,"router-outlet",1)(2,"router-outlet")(3,"router-outlet",2)(4,"router-outlet",3),k.k0s()),2&e&&k.Y8G("title",t.pageTitle)("subtitle",t.pageSubtitle)("icon",t.pageIcon)("showReadonlyHostname",t.showReadonlyHostname)("maxWidth",t.maxWidth)("hideCardWrapper",t.hideCardWrapper)("hideBackgroundIllustration",t.hideBackgroundIllustration)},dependencies:[Kt,ne.iI,x.n3],encapsulation:2});var _t=i(78212),Xt=i(71613),Yt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};var Ht=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Wt(e){return()=>Ht(this,void 0,void 0,function*(){const t=(0,C.WQX)(x.Ix),i=(0,C.WQX)($.f),n=(0,C.WQX)(j.W),r=(0,C.WQX)(L.Di),s=(0,C.WQX)(Le.m),o=(0,C.WQX)(U.w),a=(0,C.WQX)(Ue.H);null==(yield(0,u._)(r.activeAccount$.pipe(b.F6,(0,ft.n)(e=>a.lastSync$(e)))))&&(yield a.fullSync(!1));const l=yield(0,u._)(r.activeAccount$.pipe(b.F6,(0,ft.n)(t=>e(t,o,s)),(0,O.M)(e=>{if("boolean"!=typeof e)throw new Error("Feature callback must return a boolean.")})));return l||(i.showToast({variant:"error",message:n.t("noPageAccess")}),t.createUrlTree(["/"]))})}class Jt{constructor(e){this.token=e}}var Zt=i(62963),Qt=i(3892),ei=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ti{constructor(e,t,i,n,r,s){this.router=e,this.apiService=t,this.platformUtilsService=i,this.i18nService=n,this.route=r,this.toastService=s,this.loading=!0,this.submit=()=>ei(this,void 0,void 0,function*(){const e=new Jt(this.token);yield this.apiService.deleteUsingToken(this.orgId,e),this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationDeleted"),message:this.i18nService.t("organizationDeletedDesc")}),yield this.router.navigate(["/"])})}ngOnInit(){return ei(this,void 0,void 0,function*(){const e=yield(0,u._)(this.route.queryParams);null!=e.orgId&&null!=e.token&&null!=e.name?(this.orgId=e.orgId,this.token=e.token,this.name=e.name,this.loading=!1):yield this.router.navigate(["/"])})}}ti.ɵfac=function(e){return new(e||ti)(k.rXU(x.Ix),k.rXU(Be.X),k.rXU(N.y),k.rXU(j.W),k.rXU(x.nX),k.rXU($.f))},ti.ɵcmp=k.VBU({type:ti,selectors:[["ng-component"]],decls:27,vars:24,consts:[[1,"tw-flex","tw-flex-row","tw-justify-center","tw-mt-5"],[1,"tw-w-1/4"],[1,"tw-text-xl","tw-text-center","tw-mb-4"],[1,"tw-rounded-md","tw-border","tw-border-solid","tw-border-secondary-300","tw-bg-background"],[1,"tw-p-5"],["type","warning"],[1,"tw-text-center"],[1,"tw-flex"],["type","button","bitButton","","buttonType","danger",3,"bitAction","disabled","block"],["routerLink","/login","bitButton","","buttonType","secondary",1,"tw-ml-2","tw-mt-0",3,"block"]],template:function(e,t){1&e&&(k.j41(0,"div",0)(1,"div",1)(2,"p",2),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"div",3)(6,"div",4)(7,"bit-callout",5),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.j41(10,"p",6)(11,"strong"),k.EFF(12),k.k0s()(),k.j41(13,"p"),k.EFF(14),k.nI1(15,"i18n"),k.k0s(),k.j41(16,"p"),k.EFF(17),k.nI1(18,"i18n"),k.k0s(),k.nrm(19,"hr"),k.j41(20,"div",7)(21,"button",8),k.EFF(22),k.nI1(23,"i18n"),k.k0s(),k.j41(24,"a",9),k.EFF(25),k.nI1(26,"i18n"),k.k0s()()()()()()),2&e&&(k.R7$(3),k.JRh(k.bMT(4,11,"deleteOrganization")),k.R7$(5),k.SpI(" ",k.i5U(9,13,"deletingOrganizationIsPermanentWarning",t.name)," "),k.R7$(4),k.JRh(t.name),k.R7$(2),k.JRh(k.bMT(15,16,"deleteRecoverOrgConfirmDesc")),k.R7$(3),k.JRh(k.bMT(18,18,"deletingOrganizationActiveUserAccountsWarning")),k.R7$(4),k.Y8G("bitAction",t.submit)("disabled",t.loading)("block",!0),k.R7$(),k.SpI(" ",k.bMT(23,20,"deleteOrganization")," "),k.R7$(2),k.Y8G("block",!0),k.R7$(),k.SpI(" ",k.bMT(26,22,"cancel")," "))},dependencies:[Zt.G,ne.Wk,Qt.p,oe.Q,Ge.G,ae.$],encapsulation:2});var ii=i(80885),ni=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ri(e,t){if(1&e&&(k.j41(0,"div",1)(1,"div"),k.nrm(2,"bit-icon",2),k.nI1(3,"i18n"),k.j41(4,"div",3),k.nrm(5,"i",4),k.nI1(6,"i18n"),k.j41(7,"span",5),k.EFF(8),k.nI1(9,"i18n"),k.k0s()()()()),2&e){const e=k.XpG();k.R7$(2),k.Y8G("icon",e.logo)("ariaLabel",k.bMT(3,5,"appLogoLabel")),k.R7$(3),k.Y8G("title",k.mNQ(k.bMT(6,7,"loading"))),k.R7$(3),k.JRh(k.bMT(9,9,"loading"))}}class si extends ii.X{constructor(){super(...arguments),this.logo=wt,this.failedShortMessage="inviteAcceptFailedShort",this.failedMessage="inviteAcceptFailed",this.requiredParameters=["email","token"],this.policyApiService=(0,C.WQX)(ze.m),this.configService=(0,C.WQX)(U.w),this.toastService=(0,C.WQX)($.f)}authedHandler(e){return ni(this,void 0,void 0,function*(){yield this.router.navigate(["/setup/families-for-enterprise"],{queryParams:e})})}unauthedHandler(e){return ni(this,void 0,void 0,function*(){e.register?yield this.router.navigate(["/finish-signup"],{queryParams:{email:e.email,orgSponsoredFreeFamilyPlanToken:e.token}}):yield this.router.navigate(["/login"],{queryParams:{email:e.email}})})}}si.ɵfac=(()=>{let e;return function(t){return(e||(e=k.xGo(si)))(t||si)}})(),si.ɵcmp=k.VBU({type:si,selectors:[["ng-component"]],features:[k.Vt3],decls:1,vars:1,consts:[["class","tw-mt-10 tw-flex tw-justify-center",4,"ngIf"],[1,"tw-mt-10","tw-flex","tw-justify-center"],[1,"tw-w-72","tw-block","tw-mb-4",3,"icon","ariaLabel"],[1,"tw-flex","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&k.DNE(0,ri,10,11,"div",0),2&e&&k.Y8G("ngIf",t.loading)},dependencies:[Y.MD,Y.bT,ge.o,Ct.i,je.$Z],encapsulation:2});var oi=i(88565),ai=i(14928),li=i(14803),ci=i(43978);class di{}var ui=i(88083),hi=i(39488),pi=i(53072),mi=i(25065),vi=i(71901),fi=i(12012),gi=i(26657),yi=i(45154),bi=i(86226),wi=i(43759),Si=i(33886),Ii=i(68923),ki=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ci(e,t){1&e&&(k.j41(0,"div",4),k.nrm(1,"i",5),k.nI1(2,"i18n"),k.j41(3,"span",6),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function Ti(e,t){1&e&&(k.j41(0,"div",4)(1,"span"),k.EFF(2),k.nI1(3,"i18n"),k.k0s()()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,1,"badToken")))}function Fi(e,t){if(1&e&&k.nrm(0,"bit-option",16),2&e){const e=t.$implicit;k.Y8G("label",e.name)("value",e.id)}}function Ri(e,t){1&e&&(k.j41(0,"div"),k.nrm(1,"app-organization-plans"),k.k0s())}function Pi(e,t){1&e&&(k.j41(0,"div",9)(1,"button",17),k.EFF(2),k.nI1(3,"i18n"),k.k0s()()),2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"acceptOffer")," "))}function xi(e,t){if(1&e&&(k.j41(0,"form",7)(1,"p",8),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"bit-form-field",9)(5,"bit-label"),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"bit-select",10),k.nrm(9,"bit-option",11),k.nI1(10,"i18n"),k.nrm(11,"bit-option",12),k.nI1(12,"i18n"),k.DNE(13,Fi,1,2,"bit-option",13),k.nI1(14,"async"),k.k0s()(),k.DNE(15,Ri,2,0,"div",14)(16,Pi,4,3,"div",15),k.k0s()),2&e){const e=k.XpG();k.Y8G("bitSubmit",e.submit)("formGroup",e.formGroup),k.R7$(2),k.JRh(k.bMT(3,11,"acceptBitwardenFamiliesHelp")),k.R7$(4),k.JRh(k.bMT(7,13,"sponsoredFamiliesSelectOffer")),k.R7$(3),k.Y8G("label",k.VkB("-- ",k.bMT(10,15,"select")," --")),k.R7$(2),k.Y8G("label",k.mNQ(k.bMT(12,17,"newFamiliesOrganization"))),k.R7$(2),k.Y8G("ngForOf",k.bMT(14,19,e.existingFamilyOrganizations$)),k.R7$(2),k.Y8G("ngIf",e.showNewOrganization),k.R7$(),k.Y8G("ngIf",!e.showNewOrganization)}}class $i{set organizationPlansComponent(e){e&&(e.plan=this._familyPlan,e.productTier=ui.K_.Families,e.acceptingSponsorship=!0,e.planSponsorshipType=ui.MM.FamiliesForEnterprise,e.onSuccess.subscribe(this.onOrganizationCreateSuccess.bind(this)))}constructor(e,t,i,n,r,s,o,l,c,u,h,p){this.router=e,this.configService=t,this.i18nService=i,this.route=n,this.apiService=r,this.syncService=s,this.validationService=o,this.organizationService=l,this.accountService=c,this.dialogService=u,this.formBuilder=h,this.toastService=p,this.loading=!0,this.badToken=!1,this.showNewOrganization=!1,this._selectedFamilyOrganizationId="",this._destroy=new d.B,this.formGroup=this.formBuilder.group({selectedFamilyOrganizationId:["",a.k0.required]}),this.submit=()=>ki(this,void 0,void 0,function*(){yield this.doSubmit(this._selectedFamilyOrganizationId)})}ngOnInit(){return ki(this,void 0,void 0,function*(){document.body.classList.remove("layout_frontend"),this.route.queryParams.pipe((0,ai.$)()).subscribe(e=>ki(this,void 0,void 0,function*(){if(null==e.token)return this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("sponsoredFamiliesAcceptFailed"),timeout:1e4}),void this.router.navigate(["/"]);if(this.token=e.token,yield this.syncService.fullSync(!0),this.preValidateSponsorshipResponse=yield this.apiService.postPreValidateSponsorshipToken(this.token),this.preValidateSponsorshipResponse.isFreeFamilyPolicyEnabled)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccured"),message:this.i18nService.t("offerNoLongerValid")}),void(yield this.router.navigate(["/"]));this.badToken=!this.preValidateSponsorshipResponse.isTokenValid;const t=yield this.configService.getFeatureFlag(M.TO.PM26462_Milestone_3);this._familyPlan=t?ui.OL.FamiliesAnnually:ui.OL.FamiliesAnnually2025,this.loading=!1}));const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));this.existingFamilyOrganizations$=this.organizationService.organizations$(e).pipe((0,m.T)(e=>e.filter(e=>e.productTierType===ui.K_.Families&&e.type===ci.D7.Owner))),this.existingFamilyOrganizations$.pipe((0,li.Q)(this._destroy)).subscribe(e=>{0===e.length&&(this.selectedFamilyOrganizationId="createNew")}),this.formGroup.valueChanges.pipe((0,li.Q)(this._destroy)).subscribe(e=>{this.selectedFamilyOrganizationId=e.selectedFamilyOrganizationId})})}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}get selectedFamilyOrganizationId(){return this._selectedFamilyOrganizationId}set selectedFamilyOrganizationId(e){this._selectedFamilyOrganizationId=e,this.showNewOrganization="createNew"===e}doSubmit(e){return ki(this,void 0,void 0,function*(){try{const t=new di;t.planSponsorshipType=ui.MM.FamiliesForEnterprise,t.sponsoredOrganizationId=e,yield this.apiService.postRedeemSponsorship(this.token,t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("sponsoredFamiliesOfferRedeemed")}),yield this.syncService.fullSync(!0),this.router.navigate(["/"])}catch(t){if(this.showNewOrganization){const t=(0,vi.f$)(this.dialogService,{data:{organizationId:e,requestType:"InvalidFamiliesForEnterprise"}});(yield(0,oi.s)(t.closed))===vi.ay.Deleted&&this.router.navigate(["/"])}this.validationService.showError(this.i18nService.t("sponsorshipTokenHasExpired"))}})}onOrganizationCreateSuccess(e){return ki(this,void 0,void 0,function*(){yield this.doSubmit(e.organizationId)})}}$i.ɵfac=function(e){return new(e||$i)(k.rXU(x.Ix),k.rXU(U.w),k.rXU(j.W),k.rXU(x.nX),k.rXU(fi.G),k.rXU(hi.H),k.rXU(Se.B),k.rXU(g.PV),k.rXU(L.Di),k.rXU(E.o3),k.rXU(a.ok),k.rXU($.f))},$i.ɵcmp=k.VBU({type:$i,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&k.GBs(pi.v,5),2&e){let e;k.mGM(e=k.lsd())&&(t.organizationPlansComponent=e.first)}},decls:7,vars:6,consts:[[1,"tw-container"],["bitTypography","h1"],["class","tw-mt-5 tw-flex tw-justify-center",4,"ngIf"],[3,"bitSubmit","formGroup",4,"ngIf"],[1,"tw-mt-5","tw-flex","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"bitSubmit","formGroup"],["bitTypography","body1"],[1,"tw-w-1/2"],["formControlName","selectedFamilyOrganizationId"],["value","","disabled","",3,"label"],["value","createNew",3,"label"],[3,"label","value",4,"ngFor","ngForOf"],[4,"ngIf"],["class","tw-w-1/2",4,"ngIf"],[3,"label","value"],["bitButton","","buttonType","primary","bitFormButton","","type","submit"]],template:function(e,t){1&e&&(k.j41(0,"div",0)(1,"h1",1),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.DNE(4,Ci,6,7,"div",2)(5,Ti,4,3,"div",2)(6,xi,17,21,"form",3),k.k0s()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,4,"sponsoredFamiliesOffer")),k.R7$(2),k.Y8G("ngIf",t.loading),k.R7$(),k.Y8G("ngIf",!t.loading&&t.badToken),k.R7$(),k.Y8G("ngIf",!t.loading&&!t.badToken))},dependencies:[mi.G,Y.Sq,Y.bT,a.qT,a.BC,a.cb,a.j4,a.JD,gi.$,yi.L,oe.Q,bi.j,wi.h,Si.w,Ii.P,Ce.r,pi.v,Y.Jj,ae.$],encapsulation:2});var Ei=i(72932),Ai=i(10672),Di=i(93748),Oi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Mi{constructor(e,t){this.route=e,this.configService=t,this.secretsManager=!1,this.plan=ui.OL.Free,this.productTier=ui.K_.Free,this.destroy$=new d.B}ngOnInit(){return Oi(this,void 0,void 0,function*(){const e=(yield this.configService.getFeatureFlag(M.TO.PM26462_Milestone_3))?ui.OL.FamiliesAnnually:ui.OL.FamiliesAnnually2025;this.route.queryParams.pipe((0,ai.$)(),(0,li.Q)(this.destroy$)).subscribe(t=>{"families"===t.plan||t.productTier==ui.K_.Families?(this.plan=e,this.productTier=ui.K_.Families):"teams"===t.plan||t.productTier==ui.K_.Teams?(this.plan=ui.OL.TeamsAnnually,this.productTier=ui.K_.Teams):"teamsStarter"===t.plan||t.productTier==ui.K_.TeamsStarter?(this.plan=ui.OL.TeamsStarter,this.productTier=ui.K_.TeamsStarter):"enterprise"!==t.plan&&t.productTier!=ui.K_.Enterprise||(this.plan=ui.OL.EnterpriseAnnually,this.productTier=ui.K_.Enterprise),this.secretsManager=t.product==ui.ch.SecretsManager})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Mi.ɵfac=function(e){return new(e||Mi)(k.rXU(x.nX),k.rXU(U.w))},Mi.ɵcmp=k.VBU({type:Mi,selectors:[["ng-component"]],decls:6,vars:6,consts:[[3,"enableSecretsManagerByDefault","plan","productTier"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container")(2,"p"),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.nrm(5,"app-organization-plans",0),k.k0s()),2&e&&(k.R7$(3),k.JRh(k.bMT(4,4,"newOrganizationDesc")),k.R7$(2),k.Y8G("enableSecretsManagerByDefault",t.secretsManager)("plan",t.plan)("productTier",t.productTier))},dependencies:[mi.G,Ai.H,pi.v,Ei.G,Di.f,ae.$],encapsulation:2});const Ui=Object.freeze({Account:"account",EmergencyAccess:"emergency-access",Password:"password",TwoFactor:"two-factor",SecurityKeys:"security-keys",DeviceManagement:"device-management"}),Gi=Object.freeze({SignUpLinkExpired:"signup-link-expired",RecoverTwoFactor:"recover-2fa",AcceptEmergencyAccessInvite:"accept-emergency",RecoverDeleteAccount:"recover-delete",VerifyRecoverDeleteAccount:"verify-recover-delete",AcceptOrganizationInvite:"accept-organization",AccountSettings:`settings/${Ui.Account}`,EmergencyAccessSettings:`settings/${Ui.EmergencyAccess}`,PasswordSettings:`settings/security/${Ui.Password}`,TwoFactorSettings:`settings/security/${Ui.TwoFactor}`,SecurityKeysSettings:`settings/security/${Ui.SecurityKeys}`,DeviceManagement:`settings/security/${Ui.DeviceManagement}`});var ji=i(63629),Ni=i(55784),Vi=i(20183),Bi=i(52717),zi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Li extends ii.X{constructor(e,t,i,n,r,s,o,a,l){super(e,t,i,n,r),this.router=e,this.platformUtilsService=t,this.i18nService=i,this.route=n,this.authService=r,this.acceptOrganizationInviteService=s,this.organizationInviteService=o,this.accountService=a,this.toastService=l,this.orgName$=this.acceptOrganizationInviteService.orgName$,this.requiredParameters=["organizationId","organizationUserId","token"]}authedHandler(e){return zi(this,void 0,void 0,function*(){const t=this.fromParams(e),i=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));(yield this.acceptOrganizationInviteService.validateAndAcceptInvite(t,i))&&(this.toastService.showToast({message:t.initOrganization?this.i18nService.t("inviteInitAcceptedDesc"):this.i18nService.t("invitationAcceptedDesc"),variant:"success",timeout:1e4}),yield this.router.navigate(["/vault"]))})}unauthedHandler(e){return zi(this,void 0,void 0,function*(){const t=this.fromParams(e);yield this.organizationInviteService.setOrganizationInvitation(t),yield this.navigateInviteAcceptance(t)})}navigateInviteAcceptance(e){return zi(this,void 0,void 0,function*(){e.orgUserHasExistingUser?yield this.router.navigate(["/login"],{queryParams:{email:e.email}}):e.orgSsoIdentifier?yield this.router.navigate(["/sso"],{queryParams:{email:e.email,identifier:e.orgSsoIdentifier}}):yield this.router.navigate(["/finish-signup"],{queryParams:{email:e.email}})})}fromParams(e){var t,i;return null==e?null:Object.assign(new Ni.J,{email:e.email,initOrganization:"true"===(null===(t=e.initOrganization)||void 0===t?void 0:t.toLocaleLowerCase()),orgSsoIdentifier:e.orgSsoIdentifier,orgUserHasExistingUser:"true"===(null===(i=e.orgUserHasExistingUser)||void 0===i?void 0:i.toLocaleLowerCase()),organizationId:e.organizationId,organizationName:e.organizationName,organizationUserId:e.organizationUserId,token:e.token})}}Li.ɵfac=function(e){return new(e||Li)(k.rXU(x.Ix),k.rXU(N.y),k.rXU(j.W),k.rXU(x.nX),k.rXU(P.u),k.rXU(Vi.A),k.rXU(Bi.i),k.rXU(L.Di),k.rXU($.f))},Li.ɵcmp=k.VBU({type:Li,selectors:[["ng-component"]],standalone:!1,features:[k.Vt3],decls:9,vars:7,consts:[[1,"tw-mt-5","tw-flex","tw-justify-center"],["src","../../images/logo-dark@2x.png","alt","Bitwarden",1,"logo"],[1,"tw-text-center","tw-my-4"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(k.j41(0,"div",0)(1,"div"),k.nrm(2,"img",1),k.j41(3,"p",2),k.nrm(4,"i",3),k.nI1(5,"i18n"),k.j41(6,"span",4),k.EFF(7),k.nI1(8,"i18n"),k.k0s()()()()),2&e&&(k.R7$(4),k.Y8G("title",k.mNQ(k.bMT(5,3,"loading"))),k.R7$(3),k.JRh(k.bMT(8,5,"loading")))},dependencies:[ae.$],encapsulation:2});class Ki{}var qi=i(49519),_i=i(57083),Xi=i(97553),Yi=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Hi{get email(){return this.recoverDeleteForm.controls.email}constructor(e,t,i,n,r){this.router=e,this.apiService=t,this.platformUtilsService=i,this.i18nService=n,this.toastService=r,this.recoverDeleteForm=new a.gE({email:new a.MJ("",[a.k0.required])}),this.submit=()=>Yi(this,void 0,void 0,function*(){if(this.recoverDeleteForm.invalid)return;const e=new Ki;e.email=this.email.value.trim().toLowerCase(),yield this.apiService.postAccountRecoverDelete(e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deleteRecoverEmailSent")}),yield this.router.navigate(["/"])})}}Hi.ɵfac=function(e){return new(e||Hi)(k.rXU(x.Ix),k.rXU(fi.G),k.rXU(N.y),k.rXU(j.W),k.rXU($.f))},Hi.ɵcmp=k.VBU({type:Hi,selectors:[["app-recover-delete"]],standalone:!1,decls:17,vars:16,consts:[[3,"formGroup","bitSubmit"],["bitTypography","body1"],["bitInput","","appAutofocus","","appInputVerbatim","false","type","email","formControlName","email"],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"block"],["bitButton","","buttonType","secondary","routerLink","/login",3,"block"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"p",1),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"bit-form-field")(5,"bit-label"),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.nrm(8,"input",2),k.k0s(),k.nrm(9,"hr"),k.j41(10,"div",3)(11,"button",4),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.j41(14,"a",5),k.EFF(15),k.nI1(16,"i18n"),k.k0s()()()),2&e&&(k.Y8G("formGroup",t.recoverDeleteForm)("bitSubmit",t.submit),k.R7$(2),k.JRh(k.bMT(3,8,"deleteRecoverDesc")),k.R7$(4),k.JRh(k.bMT(7,10,"emailAddress")),k.R7$(5),k.Y8G("block",!0),k.R7$(),k.SpI(" ",k.bMT(13,12,"submit")," "),k.R7$(2),k.Y8G("block",!0),k.R7$(),k.SpI(" ",k.bMT(16,14,"cancel")," "))},dependencies:[a.qT,a.me,a.BC,a.cb,a.j4,a.JD,ne.Wk,qi.B,_i.q,gi.$,yi.L,oe.Q,bi.j,Xi.J,wi.h,Ce.r,ae.$],encapsulation:2});var Wi=i(71804),Ji=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Zi{constructor(e,t,i,n,r,s,o,l){this.destroyRef=e,this.router=t,this.i18nService=i,this.loginStrategyService=n,this.toastService=r,this.loginSuccessHandlerService=s,this.logService=o,this.validationService=l,this.formGroup=new a.gE({email:new a.MJ("",[a.k0.required]),masterPassword:new a.MJ("",[a.k0.required]),recoveryCode:new a.MJ("",[a.k0.required])}),this.recoveryCodeMessage="",this.submit=()=>Ji(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=this.email.trim().toLowerCase(),t=this.recoveryCode.replace(/\s/g,"").toLowerCase();yield this.loginWithRecoveryCode(e,t)})}ngOnInit(){return Ji(this,void 0,void 0,function*(){this.recoveryCodeMessage=this.i18nService.t("logInBelowUsingYourSingleUseRecoveryCode"),this.formGroup.valueChanges.pipe((0,c.pQ)(this.destroyRef)).subscribe(()=>{var e;null===(e=this.formGroup.get("recoveryCode"))||void 0===e||e.setErrors(null)})})}get email(){var e,t;return null!==(t=null===(e=this.formGroup.get("email"))||void 0===e?void 0:e.value)&&void 0!==t?t:""}get masterPassword(){var e,t;return null!==(t=null===(e=this.formGroup.get("masterPassword"))||void 0===e?void 0:e.value)&&void 0!==t?t:""}get recoveryCode(){var e,t;return null!==(t=null===(e=this.formGroup.get("recoveryCode"))||void 0===e?void 0:e.value)&&void 0!==t?t:""}loginWithRecoveryCode(e,t){return Ji(this,void 0,void 0,function*(){var i;const n={provider:Wi.R.RecoveryCode,token:t,remember:!1},r=new f.F2(e,this.masterPassword,n);try{const e=yield this.loginStrategyService.logIn(r);this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("youHaveBeenLoggedIn")}),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepRecoverDisabled")}),yield this.loginSuccessHandlerService.run(e.userId,this.masterPassword),yield this.router.navigate(["/settings/security/two-factor"])}catch(s){s instanceof me._?s.message.includes("Two-factor recovery has been performed. SSO authentication is required.")?(this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("twoStepRecoverDisabled")}),this.toastService.showToast({variant:"error",title:"",message:this.i18nService.t("ssoLoginIsRequired")}),yield this.router.navigate(["/login"])):(this.logService.error("Error logging in automatically: ",s.message),s.message.includes("Two-step token is invalid")?null===(i=this.formGroup.get("recoveryCode"))||void 0===i||i.setErrors({invalidRecoveryCode:{message:this.i18nService.t("invalidRecoveryCode")}}):this.validationService.showError(s.message)):(this.logService.error("Error logging in automatically: ",s),this.validationService.showError(s))}})}}Zi.ɵfac=function(e){return new(e||Zi)(k.rXU(C.abz),k.rXU(x.Ix),k.rXU(j.W),k.rXU(f.sg),k.rXU($.f),k.rXU(f.aJ),k.rXU(ve.K),k.rXU(Se.B))},Zi.ɵcmp=k.VBU({type:Zi,selectors:[["app-recover-two-factor"]],standalone:!1,decls:28,vars:23,consts:[[3,"formGroup","bitSubmit"],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/lost-two-step-device/","target","_blank","rel","noreferrer"],["bitInput","","type","text","formControlName","email","appAutofocus","","inputmode","email","appInputVerbatim","false"],["bitInput","","type","password","formControlName","masterPassword","appInputVerbatim",""],["bitInput","","type","text","formControlName","recoveryCode","appInputVerbatim",""],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","primary",3,"block"],["bitButton","","buttonType","secondary","routerLink","/login",3,"block"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"p",1),k.EFF(2),k.j41(3,"a",2),k.EFF(4),k.nI1(5,"i18n"),k.k0s()(),k.j41(6,"bit-form-field")(7,"bit-label"),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.nrm(10,"input",3),k.k0s(),k.j41(11,"bit-form-field")(12,"bit-label"),k.EFF(13),k.nI1(14,"i18n"),k.k0s(),k.nrm(15,"input",4),k.k0s(),k.j41(16,"bit-form-field")(17,"bit-label"),k.EFF(18),k.nI1(19,"i18n"),k.k0s(),k.nrm(20,"input",5),k.k0s(),k.j41(21,"div",6)(22,"button",7),k.EFF(23),k.nI1(24,"i18n"),k.k0s(),k.j41(25,"a",8),k.EFF(26),k.nI1(27,"i18n"),k.k0s()()()),2&e&&(k.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),k.R7$(2),k.SpI(" ",t.recoveryCodeMessage," "),k.R7$(2),k.JRh(k.bMT(5,11,"learnMore")),k.R7$(4),k.JRh(k.bMT(9,13,"emailAddress")),k.R7$(5),k.JRh(k.bMT(14,15,"masterPass")),k.R7$(5),k.JRh(k.bMT(19,17,"recoveryCodeTitle")),k.R7$(4),k.Y8G("block",!0),k.R7$(),k.SpI(" ",k.bMT(24,19,"submit")," "),k.R7$(2),k.Y8G("block",!0),k.R7$(),k.SpI(" ",k.bMT(27,21,"cancel")," "))},dependencies:[a.qT,a.me,a.BC,a.cb,a.j4,a.JD,ne.Wk,qi.B,_i.q,gi.$,yi.L,oe.Q,bi.j,Xi.J,wi.h,ke.L,Ce.r,ae.$],encapsulation:2});var Qi=i(48479),en=i(84431),tn=i(7248);class nn extends tn.V{}class rn extends nn{static newConstructor(e,t){const i=new rn;return i.newMasterPasswordHash=e.masterPasswordAuthenticationHash,i.key=t.masterKeyWrappedUserKey,i}}var sn=i(37380),on=i(76356),an=i(69896),ln=i(36288),cn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function dn(e,t){1&e&&(k.j41(0,"bit-callout",10),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"changeEmailTwoFactorWarning")," "))}function un(e,t){if(1&e&&(k.qex(0),k.nrm(1,"hr"),k.j41(2,"p"),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"bit-callout",10),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"div",11)(9,"bit-form-field")(10,"bit-label"),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.nrm(13,"input",12),k.k0s()(),k.bVm()),2&e){const e=k.XpG();k.R7$(3),k.JRh(k.i5U(4,3,"changeEmailDesc",e.formGroup.controls.step1.value.newEmail)),k.R7$(3),k.JRh(k.bMT(7,6,"loggedOutWarning")),k.R7$(5),k.JRh(k.bMT(12,8,"code"))}}function hn(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",13),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.reset())}),k.EFF(1),k.nI1(2,"i18n"),k.k0s()}2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"cancel")," "))}class pn{constructor(e,t,i,n,r,s,o,l,c){this.accountService=e,this.apiService=t,this.twoFactorService=i,this.i18nService=n,this.keyService=r,this.messagingService=s,this.formBuilder=o,this.kdfConfigService=l,this.toastService=c,this.tokenSent=!1,this.showTwoFactorEmailWarning=!1,this.formGroup=this.formBuilder.group({step1:this.formBuilder.group({masterPassword:["",[a.k0.required]],newEmail:["",[a.k0.required,a.k0.email]]}),token:[{value:"",disabled:!0},[a.k0.required]]}),this.submit=()=>cn(this,void 0,void 0,function*(){var e,t;if(null==this.userId)throw new Error("Can't find user");if(this.formGroup.controls.step1.markAllAsTouched(),this.tokenSent&&this.formGroup.controls.token.markAllAsTouched(),this.formGroup.invalid)return;const i=this.formGroup.controls.step1.value,n=null===(e=i.newEmail)||void 0===e?void 0:e.trim().toLowerCase(),r=i.masterPassword;if(null==n||null==r)throw new Error("Missing email or password");const s=yield this.keyService.hashMasterKey(r,yield this.keyService.getOrDeriveMasterKey(r,this.userId));if(this.tokenSent){const e=this.formGroup.value.token;if(null==e)throw new Error("Missing token");const i=new rn;i.token=e,i.newEmail=n,i.masterPasswordHash=s;const o=yield(0,u._)(this.kdfConfigService.getKdfConfig$(this.userId));if(null==o)throw new Error("Missing kdf config");const a=yield this.keyService.makeMasterKey(r,n,o);i.newMasterPasswordHash=yield this.keyService.hashMasterKey(r,a);const l=yield(0,u._)(this.keyService.userKey$(this.userId));if(null==l)throw new Error("Can't find UserKey");const c=null===(t=(yield this.keyService.encryptUserKeyWithMasterKey(a,l))[1])||void 0===t?void 0:t.encryptedString;if(null==c)throw new Error("Missing Encrypted User Key");i.key=c,yield this.apiService.postEmail(i),this.reset(),this.toastService.showToast({variant:"success",title:this.i18nService.t("emailChanged"),message:this.i18nService.t("logBackIn")}),this.messagingService.send("logout")}else{const e=new nn;e.newEmail=n,e.masterPasswordHash=s,yield this.apiService.postEmailToken(e),this.activateStep2()}})}ngOnInit(){return cn(this,void 0,void 0,function*(){this.userId=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));const e=yield this.twoFactorService.getEnabledTwoFactorProviders();this.showTwoFactorEmailWarning=e.data.some(e=>e.type===Wi.R.Email&&e.enabled)})}activateStep2(){this.formGroup.controls.step1.disable(),this.formGroup.controls.token.enable(),this.tokenSent=!0}reset(){this.formGroup.reset(),this.formGroup.controls.step1.enable(),this.formGroup.controls.token.disable(),this.tokenSent=!1}}pn.ɵfac=function(e){return new(e||pn)(k.rXU(L.Di),k.rXU(fi.G),k.rXU(sn.fz),k.rXU(j.W),k.rXU(I.Lu),k.rXU(fe.U),k.rXU(a.ok),k.rXU(I.zZ),k.rXU($.f))},pn.ɵcmp=k.VBU({type:pn,selectors:[["app-change-email"]],decls:20,vars:14,consts:[[3,"formGroup","bitSubmit"],["type","warning",4,"ngIf"],["formGroupName","step1",1,"@3xl:tw-w-1/2","tw-pr-2"],["id","change-email_input_masterPassword","bitInput","","type","password","formControlName","masterPassword"],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["id","change-email_input_newEmail","bitInput","","type","email","formControlName","newEmail","inputmode","email"],[4,"ngIf"],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","buttonType","primary","bitFormButton",""],["type","button","bitButton","",3,"click",4,"ngIf"],["type","warning"],[1,"tw-w-1/2","tw-pr-2"],["id","change-email_input_token","bitInput","","type","text","formControlName","token"],["type","button","bitButton","",3,"click"]],template:function(e,t){1&e&&(k.j41(0,"form",0),k.DNE(1,dn,3,3,"bit-callout",1),k.j41(2,"div",2)(3,"bit-form-field")(4,"bit-label"),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.nrm(7,"input",3)(8,"button",4),k.k0s(),k.j41(9,"bit-form-field")(10,"bit-label"),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.nrm(13,"input",5),k.k0s()(),k.DNE(14,un,14,10,"ng-container",6),k.j41(15,"div",7)(16,"button",8),k.EFF(17),k.nI1(18,"i18n"),k.k0s(),k.DNE(19,hn,3,3,"button",9),k.k0s()()),2&e&&(k.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),k.R7$(),k.Y8G("ngIf",t.showTwoFactorEmailWarning),k.R7$(4),k.JRh(k.bMT(6,8,"masterPass")),k.R7$(6),k.JRh(k.bMT(12,10,"newEmail")),k.R7$(3),k.Y8G("ngIf",t.tokenSent),k.R7$(3),k.SpI(" ",k.bMT(18,12,t.tokenSent?"changeEmail":"continue")," "),k.R7$(2),k.Y8G("ngIf",t.tokenSent))},dependencies:[mi.G,Y.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,a.$R,gi.$,yi.L,oe.Q,Ge.G,bi.j,Xi.J,wi.h,on.e,an.a,ln.s,ae.$],encapsulation:2});var mn=i(46131),vn=i(62166),fn=i(7730),gn=i(68016),yn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class bn{constructor(e,t,i,n,r,s,o){this.apiService=e,this.i18nService=t,this.formBuilder=i,this.userVerificationService=n,this.messagingService=r,this.logService=s,this.toastService=o,this.deauthForm=this.formBuilder.group({verification:void 0}),this.invalidSecret=!1,this.submit=()=>yn(this,void 0,void 0,function*(){try{const e=this.deauthForm.value.verification,t=yield this.userVerificationService.buildRequest(e);yield this.apiService.postSecurityStamp(t),this.toastService.showToast({variant:"success",title:this.i18nService.t("sessionsDeauthorized"),message:this.i18nService.t("logBackIn")}),this.messagingService.send("logout")}catch(e){this.logService.error(e)}})}static open(e){return e.open(bn)}}bn.ɵfac=function(e){return new(e||bn)(k.rXU(fi.G),k.rXU(j.W),k.rXU(a.ok),k.rXU(vn.i),k.rXU(fe.U),k.rXU(ve.K),k.rXU($.f))},bn.ɵcmp=k.VBU({type:bn,selectors:[["ng-component"]],decls:18,vars:18,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1"],["type","warning"],["formControlName","verification","name","verification",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1),k.nI1(2,"i18n"),k.qex(3,2),k.j41(4,"p",3),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"bit-callout",4),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.j41(10,"app-user-verification-form-input",5),k.mxI("invalidSecretChange",function(e){return k.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),k.k0s(),k.bVm(),k.qex(11,6),k.j41(12,"button",7),k.EFF(13),k.nI1(14,"i18n"),k.k0s(),k.j41(15,"button",8),k.EFF(16),k.nI1(17,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.deauthForm)("bitSubmit",t.submit),k.R7$(),k.Y8G("title",k.bMT(2,8,"deauthorizeSessions")),k.R7$(4),k.JRh(k.bMT(6,10,"deauthorizeSessionsDesc")),k.R7$(3),k.JRh(k.bMT(9,12,"deauthorizeSessionsWarning")),k.R7$(2),k.R50("invalidSecret",t.invalidSecret),k.R7$(3),k.SpI(" ",k.bMT(14,14,"deauthorizeSessions")," "),k.R7$(3),k.SpI(" ",k.bMT(17,16,"close")," "))},dependencies:[mi.G,a.qT,a.BC,a.cb,a.j4,a.JD,gi.$,yi.L,oe.Q,Ge.G,fn.I,gn.m,Ce.r,Ae.wV,ae.$],encapsulation:2});var wn=i(46357),Sn=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class In{constructor(e,t,i,n,r){this.i18nService=e,this.formBuilder=t,this.accountApiService=i,this.dialogRef=n,this.toastService=r,this.deleteForm=this.formBuilder.group({verification:void 0}),this.invalidSecret=!1,this.submit=()=>Sn(this,void 0,void 0,function*(){try{const e=this.deleteForm.get("verification").value;yield this.accountApiService.deleteAccount(e),this.dialogRef.close(),this.toastService.showToast({variant:"success",title:this.i18nService.t("accountDeleted"),message:this.i18nService.t("accountDeletedDesc")})}catch(e){throw e instanceof me._&&400===e.statusCode&&(this.invalidSecret=!0),e}})}static open(e){return e.open(In)}}In.ɵfac=function(e){return new(e||In)(k.rXU(j.W),k.rXU(a.ok),k.rXU(wn.T),k.rXU(E.ce),k.rXU($.f))},In.ɵcmp=k.VBU({type:In,selectors:[["ng-component"]],decls:18,vars:18,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1"],["type","warning"],["formControlName","verification","name","verification",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1),k.nI1(2,"i18n"),k.qex(3,2),k.j41(4,"p",3),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"bit-callout",4),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.j41(10,"app-user-verification-form-input",5),k.mxI("invalidSecretChange",function(e){return k.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),k.k0s(),k.bVm(),k.qex(11,6),k.j41(12,"button",7),k.EFF(13),k.nI1(14,"i18n"),k.k0s(),k.j41(15,"button",8),k.EFF(16),k.nI1(17,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.deleteForm)("bitSubmit",t.submit),k.R7$(),k.Y8G("title",k.bMT(2,8,"deleteAccount")),k.R7$(4),k.JRh(k.bMT(6,10,"deleteAccountDesc")),k.R7$(3),k.JRh(k.bMT(9,12,"deleteAccountWarning")),k.R7$(2),k.R50("invalidSecret",t.invalidSecret),k.R7$(3),k.SpI(" ",k.bMT(14,14,"deleteAccount")," "),k.R7$(3),k.SpI(" ",k.bMT(17,16,"close")," "))},dependencies:[mi.G,a.qT,a.BC,a.cb,a.j4,a.JD,gi.$,yi.L,oe.Q,Ge.G,fn.I,gn.m,Ce.r,Ae.wV,ae.$],encapsulation:2});class kn{constructor(e){this.culture="en-US",this.name=e}}var Cn=i(23490),Tn=i(22976),Fn=i(16878),Rn=i(36006),Pn=i(78781),xn=i(81525),$n=i(79703),En=i(57144);class An{constructor(){this.border=!1,this.selected=!1,this.select=new k.bkB}onFire(){this.select.emit(this.color)}get classList(){return["tw-rounded-full tw-inline-block"].concat(["tw-cursor-pointer","tw-outline","tw-outline-solid","tw-outline-offset-1"]).concat(this.selected?["tw-outline-[3px]","tw-outline-primary-600"]:["tw-outline-0","hover:tw-outline-1","hover:tw-outline-primary-300","focus:tw-outline-2","focus:tw-outline-primary-600"])}}An.ɵfac=function(e){return new(e||An)},An.ɵcmp=k.VBU({type:An,selectors:[["selectable-avatar"]],inputs:{id:"id",text:"text",title:"title",color:"color",border:"border",selected:"selected"},outputs:{select:"select"},decls:2,vars:9,consts:[["tabindex","0",3,"click","keyup.enter","title","ngClass"],["appStopClick","","size","xlarge",3,"text","color","border","id","title"]],template:function(e,t){1&e&&(k.j41(0,"span",0),k.bIt("click",function(){return t.onFire()})("keyup.enter",function(){return t.onFire()}),k.nrm(1,"bit-avatar",1),k.k0s()),2&e&&(k.Y8G("title",t.title)("ngClass",t.classList),k.R7$(),k.Y8G("text",t.text)("text",t.text)("color",t.color)("border",!1)("id",t.id)("border",t.border)("title",t.title))},dependencies:[Y.YU,$n.m,En.f],encapsulation:2});var Dn=i(86388),On=i(93103),Mn=i(90171),Un=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Gn=["colorPicker"],jn=e=>({"!tw-outline-[3px] tw-outline-primary-600 hover:tw-outline-[3px] hover:tw-outline-primary-600":e});function Nn(e,t){1&e&&(k.j41(0,"div",13),k.nrm(1,"i",14),k.nI1(2,"i18n"),k.EFF(3),k.nI1(4,"i18n"),k.k0s()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(2),k.SpI(" ",k.bMT(4,5,"loading")," "))}function Vn(e,t){if(1&e){const e=k.RV6();k.qex(0),k.j41(1,"selectable-avatar",15),k.nI1(2,"userName"),k.bIt("select",function(){const t=C.eBV(e).$implicit,i=k.XpG();return C.Njj(i.setSelection(t.color))}),k.k0s(),k.bVm()}if(2&e){const e=t.$implicit,i=k.XpG();k.R7$(),k.Y8G("text",k.mNQ(k.bMT(2,6,i.profile)))("selected",e.selected)("title",e.name)("color",e.color)("border",!0)}}class Bn{constructor(e,t,i,n,r,s){this.data=e,this.i18nService=t,this.platformUtilsService=i,this.avatarService=n,this.dialogRef=r,this.toastService=s,this.loading=!1,this.defaultColorPalette=[{name:"brightBlue",color:"#16cbfc"},{name:"green",color:"#94cc4b"},{name:"orange",color:"#ffb520"},{name:"lavender",color:"#e5beed"},{name:"yellow",color:"#fcff41"},{name:"indigo",color:"#acbdf7"},{name:"teal",color:"#8ecdc5"},{name:"salmon",color:"#ffa3a3"},{name:"pink",color:"#ffa2d4"}],this.customColorSelected=!1,this.customColor$=new Fn.t(null),this.customTextColor$=new Fn.t("#000000"),this.destroy$=new d.B,this.submit=()=>Un(this,void 0,void 0,function*(){Pn.A.validateHexColor(this.currentSelection)||null==this.currentSelection?(yield this.avatarService.setAvatarColor(this.currentSelection),this.dialogRef.close(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("avatarUpdated")})):this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("errorOccurred")})}),this.profile=e.profile}ngOnInit(){return Un(this,void 0,void 0,function*(){this.defaultColorPalette.forEach(e=>e.name=this.i18nService.t(e.name)),this.customColor$.pipe((0,Rn.B)(200),(0,li.Q)(this.destroy$)).subscribe(e=>{null!=e&&(this.customTextColor$.next(Pn.A.pickTextColorBasedOnBgColor(e)),this.customColorSelected=!0,this.currentSelection=e)}),yield this.setSelection(yield(0,u._)(this.avatarService.avatarColor$))})}showCustomPicker(){return Un(this,void 0,void 0,function*(){this.customColorSelected=!0,this.colorPickerElement.nativeElement.click(),this.setSelection(this.customColor$.value)})}generateAvatarColor(){return Un(this,void 0,void 0,function*(){Pn.A.stringToColor(this.profile.name.toString())})}ngOnDestroy(){return Un(this,void 0,void 0,function*(){this.destroy$.next(),this.destroy$.complete()})}setSelection(e){return Un(this,void 0,void 0,function*(){if(this.defaultColorPalette.filter(e=>e.selected).forEach(e=>e.selected=!1),null!=e)if(e=e.toLowerCase(),this.customColorSelected=!1,this.currentSelection===e)this.currentSelection=null;else{const t=this.defaultColorPalette.findIndex(t=>t.color===e);-1!==t?(this.defaultColorPalette[t].selected=!0,this.currentSelection=e):this.customColor$.next(e)}})}static open(e,t){return e.open(Bn,t)}}Bn.ɵfac=function(e){return new(e||Bn)(k.rXU(xn.Qs),k.rXU(j.W),k.rXU(N.y),k.rXU(Dn.v),k.rXU(E.ce),k.rXU($.f))},Bn.ɵcmp=k.VBU({type:Bn,selectors:[["ng-component"]],viewQuery:function(e,t){if(1&e&&k.GBs(Gn,5),2&e){let e;k.mGM(e=k.lsd())&&(t.colorPickerElement=e.first)}},decls:25,vars:35,consts:[["colorPicker",""],["dialogSize","large",3,"title"],["bitDialogContent",""],["class","tw-text-center",4,"ngIf"],[1,"tw-text-lg"],[1,"tw-flex","tw-flex-wrap","tw-justify-center","tw-gap-8"],[4,"ngFor","ngForOf"],[1,"tw-relative","tw-flex","tw-size-24","tw-cursor-pointer","tw-place-content-center","tw-rounded-full","tw-border","tw-border-solid","tw-border-secondary-600","tw-outline","tw-outline-0","tw-outline-offset-1","hover:tw-outline-1","hover:tw-outline-primary-300","focus:tw-outline-2","focus:tw-outline-primary-600",3,"keyup.enter","click","tabIndex","title","ngClass"],[1,"bwi","bwi-pencil","!tw-text-muted","tw-m-auto","tw-text-3xl"],["tabindex","-1","type","color",1,"tw-absolute","tw-bottom-0","tw-right-0","tw-size-px","tw-border-none","tw-bg-transparent","tw-opacity-0",3,"ngModelChange","ngModel"],["bitDialogFooter",""],["bitButton","","type","submit","buttonType","primary",3,"disabled","bitAction"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""],[1,"tw-text-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin",3,"title"],["appStopClick","",3,"select","selected","title","text","color","border"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-dialog",1),k.nI1(1,"i18n"),k.qex(2,2),k.DNE(3,Nn,5,7,"div",3),k.j41(4,"p",4),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"div",5),k.DNE(8,Vn,3,8,"ng-container",6),k.j41(9,"span")(10,"span",7),k.nI1(11,"async"),k.nI1(12,"i18n"),k.bIt("keyup.enter",function(){return C.eBV(e),C.Njj(t.showCustomPicker())})("click",function(){return C.eBV(e),C.Njj(t.showCustomPicker())}),k.nrm(13,"i",8),k.nI1(14,"async"),k.j41(15,"input",9,0),k.nI1(17,"async"),k.bIt("ngModelChange",function(i){return C.eBV(e),C.Njj(t.customColor$.next(i))}),k.k0s()()()(),k.bVm(),k.qex(18,10),k.j41(19,"button",11),k.EFF(20),k.nI1(21,"i18n"),k.k0s(),k.j41(22,"button",12),k.EFF(23),k.nI1(24,"i18n"),k.k0s(),k.bVm(),k.k0s()}2&e&&(k.Y8G("title",k.bMT(1,17,"customizeAvatar")),k.R7$(3),k.Y8G("ngIf",t.loading),k.R7$(2),k.JRh(k.bMT(6,19,"pickAnAvatarColor")),k.R7$(3),k.Y8G("ngForOf",t.defaultColorPalette),k.R7$(2),k.xc7("background-color",k.bMT(11,21,t.customColor$)),k.Y8G("title",k.mNQ(k.bMT(12,23,"customColor")))("tabIndex",0)("ngClass",k.eq3(33,jn,t.customColorSelected)),k.R7$(3),k.xc7("color",k.bMT(14,25,t.customTextColor$)),k.R7$(2),k.Y8G("ngModel",k.bMT(17,27,t.customColor$)),k.R7$(4),k.Y8G("disabled",t.loading)("bitAction",t.submit),k.R7$(),k.SpI(" ",k.bMT(21,29,"save")," "),k.R7$(3),k.SpI(" ",k.bMT(24,31,"close")," "))},dependencies:[mi.G,Y.YU,Y.Sq,Y.bT,a.me,a.BC,a.vS,On.Y,Qt.p,oe.Q,fn.I,gn.m,An,Y.Jj,ae.$,Mn.b],encapsulation:2});var zn=i(47428),Ln=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Kn(e,t){1&e&&(k.j41(0,"div"),k.nrm(1,"i",2),k.nI1(2,"i18n"),k.j41(3,"span",3),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function qn(e,t){if(1&e&&(k.j41(0,"div"),k.EFF(1),k.nI1(2,"i18n"),k.j41(3,"a",16),k.nrm(4,"i",17),k.k0s()()),2&e){const e=t.ngIf;k.R7$(),k.SpI(" ",k.i5U(2,1,"accountIsOwnedMessage",null==e?null:e.name)," ")}}function _n(e,t){if(1&e&&(k.nrm(0,"app-account-fingerprint",14),k.nI1(1,"i18n")),2&e){const e=k.XpG(2);k.Y8G("fingerprintLabel",k.mNQ(k.bMT(1,4,"yourAccountsFingerprint")))("fingerprintMaterial",e.fingerprintMaterial)("publicKeyBuffer",e.userPublicKey)}}function Xn(e,t){if(1&e&&(k.j41(0,"form",4)(1,"div",5)(2,"div",6)(3,"bit-form-field")(4,"bit-label"),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.nrm(7,"input",7),k.k0s(),k.j41(8,"bit-form-field")(9,"bit-label"),k.EFF(10),k.nI1(11,"i18n"),k.k0s(),k.nrm(12,"input",8),k.k0s()(),k.j41(13,"div",9)(14,"div",10),k.nrm(15,"dynamic-avatar",11),k.nI1(16,"userName"),k.j41(17,"button",12),k.nrm(18,"i",13),k.EFF(19," Customize "),k.k0s()(),k.DNE(20,qn,5,4,"div",0),k.nI1(21,"async"),k.nVh(22,_n,2,6,"app-account-fingerprint",14),k.k0s()(),k.j41(23,"button",15),k.EFF(24),k.nI1(25,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),k.R7$(5),k.JRh(k.bMT(6,11,"name")),k.R7$(5),k.JRh(k.bMT(11,13,"email")),k.R7$(5),k.Y8G("text",k.mNQ(k.bMT(16,15,e.profile)))("id",e.profile.id),k.R7$(2),k.Y8G("bitAction",e.openChangeAvatar),k.R7$(3),k.Y8G("ngIf",k.bMT(21,17,e.managingOrganization$)),k.R7$(2),k.vxM(e.fingerprintMaterial&&e.userPublicKey?22:-1),k.R7$(2),k.JRh(k.bMT(25,19,"save"))}}class Yn{constructor(e,t,i,n,r,s,o,l){this.apiService=e,this.i18nService=t,this.accountService=i,this.dialogService=n,this.toastService=r,this.organizationService=s,this.keyService=o,this.logService=l,this.loading=!0,this.destroy$=new d.B,this.formGroup=new a.gE({name:new a.MJ(null),email:new a.MJ(null)}),this.openChangeAvatar=()=>Ln(this,void 0,void 0,function*(){Bn.open(this.dialogService,{data:{profile:this.profile}})}),this.submit=()=>Ln(this,void 0,void 0,function*(){const e=new kn(this.formGroup.get("name").value);yield this.apiService.putProfile(e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("accountUpdated")})})}ngOnInit(){return Ln(this,void 0,void 0,function*(){this.profile=yield this.apiService.getProfile();const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));this.fingerprintMaterial=e;const t=yield(0,u._)(this.keyService.userPublicKey$(e));null==t?this.logService.error("[ProfileComponent] No public key available for the user: "+e+" fingerprint can't be displayed."):this.userPublicKey=t,this.managingOrganization$=this.organizationService.organizations$(e).pipe((0,m.T)(e=>e.find(e=>!0===e.userIsManagedByOrganization))),this.formGroup.get("name").setValue(this.profile.name),this.formGroup.get("email").setValue(this.profile.email),this.formGroup.get("name").valueChanges.pipe((0,li.Q)(this.destroy$)).subscribe(e=>{this.profile.name=e}),this.loading=!1})}ngOnDestroy(){return Ln(this,void 0,void 0,function*(){this.destroy$.next(),this.destroy$.complete()})}}Yn.ɵfac=function(e){return new(e||Yn)(k.rXU(fi.G),k.rXU(j.W),k.rXU(L.Di),k.rXU(E.o3),k.rXU($.f),k.rXU(g.PV),k.rXU(I.Lu),k.rXU(ve.K))},Yn.ɵcmp=k.VBU({type:Yn,selectors:[["app-profile"]],decls:2,vars:2,consts:[[4,"ngIf"],[3,"formGroup","bitSubmit",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"formGroup","bitSubmit"],[1,"tw-grid","tw-grid-cols-12","tw-gap-6"],[1,"tw-col-span-12","@3xl:tw-col-span-6"],["bitInput","","formControlName","name"],["bitInput","","formControlName","email","readonly",""],[1,"tw-col-span-12","@3xl:tw-col-span-6","tw-row-start-1","@3xl:tw-row-start-auto"],[1,"tw-mb-3","tw-flex","tw-align-middle","tw-items-center"],["size","large",3,"text","id"],["type","button","buttonType","secondary","bitButton","","bitFormButton","","appStopClick","","appStopProp","",1,"tw-ml-3",3,"bitAction"],["aria-hidden","true",1,"bwi","bwi-lg","bwi-pencil-square"],[3,"fingerprintMaterial","publicKeyBuffer","fingerprintLabel"],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["target","_blank","rel","noopener noreferrer","href","https://bitwarden.com/help/claimed-accounts"],["aria-hidden","true",1,"bwi","bwi-question-circle"]],template:function(e,t){1&e&&k.DNE(0,Kn,6,7,"div",0)(1,Xn,26,21,"form",1),2&e&&(k.Y8G("ngIf",t.loading),k.R7$(),k.Y8G("ngIf",t.profile&&!t.loading))},dependencies:[mi.G,Y.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,On.Y,zn.x,Qt.p,gi.$,yi.L,oe.Q,bi.j,Xi.J,wi.h,Cn.O,Tn.l,Y.Jj,ae.$,Mn.b],encapsulation:2});class Hn extends tn.V{}var Wn=i(26411),Jn=i(37579),Zn=i(22191),Qn=i(8433),er=i(80351),tr=i(8297),ir=i(81573),nr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function rr(e,t){1&e&&(k.j41(0,"p",10),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"turnOffNewDeviceLoginProtectionModalDesc")," "))}function sr(e,t){1&e&&(k.j41(0,"p",10),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"turnOnNewDeviceLoginProtectionModalDesc")," "))}function or(e,t){1&e&&(k.j41(0,"bit-callout",11),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"turnOffNewDeviceLoginProtectionWarning")))}function ar(e,t){1&e&&(k.j41(0,"button",12),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"disable")," "))}function lr(e,t){1&e&&(k.j41(0,"button",13),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"enable")," "))}class cr{constructor(e,t,i,n,r,s,o,a){this.i18nService=e,this.formBuilder=t,this.accountApiService=i,this.accountService=n,this.userVerificationService=r,this.dialogRef=s,this.toastService=o,this.twoFactorService=a,this.destroy$=new d.B,this.verifyNewDeviceLogin=!0,this.has2faConfigured=!1,this.setVerifyDevicesForm=this.formBuilder.group({verification:void 0}),this.invalidSecret=!1,this.submit=()=>nr(this,void 0,void 0,function*(){try{const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,li.Q)(this.destroy$))),t=this.setVerifyDevicesForm.value.verification,i=yield this.userVerificationService.buildRequest(t,Hn);i.verifyDevices=!this.verifyNewDeviceLogin,yield this.accountApiService.setVerifyDevices(i),yield this.accountService.setAccountVerifyNewDeviceLogin(e.id,i.verifyDevices),this.dialogRef.close(),this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("accountNewDeviceLoginProtectionSaved")})}catch(e){throw e instanceof me._&&400===e.statusCode&&(this.invalidSecret=!0),e}}),this.accountService.accountVerifyNewDeviceLogin$.pipe((0,li.Q)(this.destroy$)).subscribe(e=>{this.verifyNewDeviceLogin=e})}ngOnInit(){return nr(this,void 0,void 0,function*(){const e=yield this.twoFactorService.getEnabledTwoFactorProviders();this.has2faConfigured=e.data.length>0})}static open(e){return e.open(cr)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}cr.ɵfac=function(e){return new(e||cr)(k.rXU(j.W),k.rXU(a.ok),k.rXU(wn.T),k.rXU(L.Di),k.rXU(vn.i),k.rXU(E.ce),k.rXU($.f),k.rXU(sn.fz))},cr.ɵcmp=k.VBU({type:cr,selectors:[["ng-component"]],decls:14,vars:14,consts:[[3,"formGroup","bitSubmit"],["dialogSize","default",3,"title"],["bitDialogContent",""],["bitTypography","body1",4,"ngIf"],["type","warning",4,"ngIf"],["formControlName","verification","name","verification",3,"invalidSecretChange","invalidSecret"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","danger",4,"ngIf"],["bitButton","","bitFormButton","","type","submit","buttonType","primary",4,"ngIf"],["bitButton","","bitFormButton","","type","button","buttonType","secondary","bitDialogClose",""],["bitTypography","body1"],["type","warning"],["bitButton","","bitFormButton","","type","submit","buttonType","danger"],["bitButton","","bitFormButton","","type","submit","buttonType","primary"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1),k.nI1(2,"i18n"),k.qex(3,2),k.DNE(4,rr,3,3,"p",3)(5,sr,3,3,"p",3)(6,or,3,3,"bit-callout",4),k.j41(7,"app-user-verification-form-input",5),k.mxI("invalidSecretChange",function(e){return k.DH7(t.invalidSecret,e)||(t.invalidSecret=e),e}),k.k0s(),k.bVm(),k.qex(8,6),k.DNE(9,ar,3,3,"button",7)(10,lr,3,3,"button",8),k.j41(11,"button",9),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.setVerifyDevicesForm)("bitSubmit",t.submit),k.R7$(),k.Y8G("title",k.bMT(2,10,"newDeviceLoginProtection")),k.R7$(3),k.Y8G("ngIf",t.verifyNewDeviceLogin),k.R7$(),k.Y8G("ngIf",!t.verifyNewDeviceLogin),k.R7$(),k.Y8G("ngIf",t.verifyNewDeviceLogin&&!t.has2faConfigured),k.R7$(),k.R50("invalidSecret",t.invalidSecret),k.R7$(2),k.Y8G("ngIf",t.verifyNewDeviceLogin),k.R7$(),k.Y8G("ngIf",!t.verifyNewDeviceLogin),k.R7$(2),k.SpI(" ",k.bMT(13,12,"close")," "))},dependencies:[Y.MD,Y.bT,a.X1,a.qT,a.BC,a.cb,a.j4,a.JD,re.p,Wn.L,Jn.C,gi.$,yi.L,se.t,oe.Q,Zn.Q,Qn.p,er.j,Ge.G,tr.K,ir.P,fn.I,gn.m,Ae.wV,ae.$],encapsulation:2});var dr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ur(e,t){1&e&&(k.j41(0,"div",4)(1,"h1",5),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.nrm(4,"app-change-email"),k.k0s()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,1,"changeEmail")))}function hr(e,t){if(1&e&&(k.j41(0,"button",6),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.Y8G("bitAction",e.setNewDeviceLoginProtection),k.R7$(),k.SpI(" ",k.bMT(2,2,"turnOffNewDeviceLoginProtection")," ")}}function pr(e,t){if(1&e&&(k.j41(0,"button",7),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.Y8G("bitAction",e.setNewDeviceLoginProtection),k.R7$(),k.SpI(" ",k.bMT(2,2,"turnOnNewDeviceLoginProtection")," ")}}function mr(e,t){if(1&e&&(k.j41(0,"button",6),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.Y8G("bitAction",e.purgeVault),k.R7$(),k.SpI(" ",k.bMT(2,2,"purgeVault")," ")}}function vr(e,t){if(1&e&&(k.j41(0,"button",6),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.Y8G("bitAction",e.deleteAccount),k.R7$(),k.SpI(" ",k.bMT(2,2,"deleteAccount")," ")}}class fr{constructor(e,t,i,n){this.accountService=e,this.dialogService=t,this.userDecryptionOptionsService=i,this.organizationService=n,this.destroy$=new d.B,this.showChangeEmail$=new Qi.c,this.showPurgeVault$=new Qi.c,this.showDeleteAccount$=new Qi.c,this.verifyNewDeviceLogin=!0,this.deauthorizeSessions=()=>dr(this,void 0,void 0,function*(){const e=bn.open(this.dialogService);yield(0,oi.s)(e.closed)}),this.purgeVault=()=>dr(this,void 0,void 0,function*(){const e=en.d.open(this.dialogService);yield(0,oi.s)(e.closed)}),this.deleteAccount=()=>dr(this,void 0,void 0,function*(){const e=In.open(this.dialogService);yield(0,oi.s)(e.closed)}),this.setNewDeviceLoginProtection=()=>dr(this,void 0,void 0,function*(){const e=cr.open(this.dialogService);yield(0,oi.s)(e.closed)})}ngOnInit(){return dr(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),t=this.organizationService.organizations$(e).pipe((0,m.T)(e=>e.some(e=>!0===e.userIsManagedByOrganization))),i=this.userDecryptionOptionsService.hasMasterPasswordById$(e);this.showChangeEmail$=i,this.showPurgeVault$=t.pipe((0,m.T)(e=>!e)),this.showDeleteAccount$=t.pipe((0,m.T)(e=>!e)),this.accountService.accountVerifyNewDeviceLogin$.pipe((0,li.Q)(this.destroy$)).subscribe(e=>{this.verifyNewDeviceLogin=e})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}fr.ɵfac=function(e){return new(e||fr)(k.rXU(L.Di),k.rXU(E.o3),k.rXU(f.Ym),k.rXU(g.PV))},fr.ɵcmp=k.VBU({type:fr,selectors:[["ng-component"]],decls:16,vars:14,consts:[["class","tw-mt-16",4,"ngIf"],["type","button","bitButton","","buttonType","danger",3,"bitAction",4,"ngIf"],["type","button","bitButton","","buttonType","secondary",3,"bitAction",4,"ngIf"],["type","button","bitButton","","buttonType","danger",3,"click"],[1,"tw-mt-16"],["bitTypography","h1"],["type","button","bitButton","","buttonType","danger",3,"bitAction"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container"),k.nrm(2,"app-profile"),k.DNE(3,ur,5,3,"div",0),k.nI1(4,"async"),k.j41(5,"app-danger-zone"),k.qex(6),k.DNE(7,hr,3,4,"button",1)(8,pr,3,4,"button",2),k.bVm(),k.j41(9,"button",3),k.bIt("click",function(){return t.deauthorizeSessions()}),k.EFF(10),k.nI1(11,"i18n"),k.k0s(),k.DNE(12,mr,3,4,"button",1),k.nI1(13,"async"),k.DNE(14,vr,3,4,"button",1),k.nI1(15,"async"),k.k0s()()),2&e&&(k.R7$(3),k.Y8G("ngIf",k.bMT(4,6,t.showChangeEmail$)),k.R7$(4),k.Y8G("ngIf",t.verifyNewDeviceLogin),k.R7$(),k.Y8G("ngIf",!t.verifyNewDeviceLogin),k.R7$(2),k.SpI(" ",k.bMT(11,8,"deauthorizeSessions")," "),k.R7$(2),k.Y8G("ngIf",k.bMT(13,10,t.showPurgeVault$)),k.R7$(2),k.Y8G("ngIf",k.bMT(15,12,t.showDeleteAccount$)))},dependencies:[mi.G,Y.bT,Qt.p,oe.Q,Ai.H,Ce.r,Ei.G,Di.f,Yn,pn,mn.t,Y.Jj,ae.$],encapsulation:2});var gr,yr=i(30675),br=i(65071),wr=i(15740);!function(e){e[e.View=0]="View",e[e.Takeover=1]="Takeover"}(gr||(gr={}));var Sr,Ir=i(57396),kr=i(35631),Cr=i(50352),Tr=i(90246),Fr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};!function(e){e.Confirmed="confirmed"}(Sr||(Sr={}));class Rr{constructor(e,t,i,n,r,s){this.params=e,this.formBuilder=t,this.keyService=i,this.organizationManagementPreferencesService=n,this.logService=r,this.dialogRef=s,this.loading=!0,this.confirmForm=this.formBuilder.group({dontAskAgain:[!1]}),this.submit=()=>Fr(this,void 0,void 0,function*(){if(!this.loading){this.confirmForm.get("dontAskAgain").value&&(yield this.organizationManagementPreferencesService.autoConfirmFingerPrints.set(!0));try{this.dialogRef.close(Sr.Confirmed)}catch(e){this.logService.error(e)}}})}ngOnInit(){return Fr(this,void 0,void 0,function*(){try{const e=yield this.keyService.getFingerprint(this.params.userId,this.params.publicKey);null!=e&&(this.fingerprint=e.join("-"))}catch(e){this.logService.error(e)}this.loading=!1})}static open(e,t){return e.open(Rr,t)}}Rr.ɵfac=function(e){return new(e||Rr)(k.rXU(xn.Qs),k.rXU(a.ok),k.rXU(I.Lu),k.rXU(kr.y),k.rXU(ve.K),k.rXU(E.ce))},Rr.ɵcmp=k.VBU({type:Rr,selectors:[["ng-component"]],decls:30,vars:23,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],[1,"tw-text-muted"],["bitDialogContent",""],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/fingerprint-phrase/","target","_blank","rel","noreferrer"],["type","checkbox","bitCheckbox","","formControlName","dontAskAgain"],["bitDialogFooter",""],["type","submit","buttonType","primary","bitButton","","bitFormButton",""],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1)(2,"span",2),k.EFF(3),k.nI1(4,"i18n"),k.j41(5,"small",3),k.EFF(6),k.k0s()(),k.j41(7,"div",4)(8,"p",5),k.EFF(9),k.nI1(10,"i18n"),k.j41(11,"a",6),k.EFF(12),k.nI1(13,"i18n"),k.k0s()(),k.j41(14,"p",5)(15,"code"),k.EFF(16),k.k0s()(),k.j41(17,"bit-form-control"),k.nrm(18,"input",7),k.j41(19,"bit-label"),k.EFF(20),k.nI1(21,"i18n"),k.k0s()()(),k.qex(22,8),k.j41(23,"button",9)(24,"span"),k.EFF(25),k.nI1(26,"i18n"),k.k0s()(),k.j41(27,"button",10),k.EFF(28),k.nI1(29,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.confirmForm)("bitSubmit",t.submit),k.R7$(),k.Y8G("loading",t.loading),k.R7$(2),k.SpI(" ",k.bMT(4,11,"confirmUser")," "),k.R7$(3),k.JRh(t.params.name),k.R7$(3),k.SpI(" ",k.bMT(10,13,"fingerprintEnsureIntegrityVerify")," "),k.R7$(3),k.SpI(" ",k.bMT(13,15,"learnMore")),k.R7$(4),k.JRh(t.fingerprint),k.R7$(4),k.SpI(" ",k.bMT(21,17,"dontAskFingerprintAgain")),k.R7$(5),k.JRh(k.bMT(26,19,"confirm")),k.R7$(3),k.SpI(" ",k.bMT(29,21,"cancel")," "))},dependencies:[mi.G,a.qT,a.Zm,a.BC,a.cb,a.j4,a.JD,gi.$,yi.L,oe.Q,Cr.P,fn.I,gn.m,Tr.f,bi.j,ke.L,Ce.r,ae.$],encapsulation:2});var Pr,xr=i(54471),$r=i(93199),Er=i(24374),Ar=i(17721),Dr=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Or(e,t){1&e&&k.nrm(0,"app-premium-badge")}function Mr(e,t){if(1&e&&(k.j41(0,"small",19),k.EFF(1),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.JRh(e.params.name)}}function Ur(e,t){1&e&&(k.qex(0),k.j41(1,"p",20),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"bit-form-field")(5,"bit-label"),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.nrm(8,"input",21),k.k0s(),k.bVm()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,2,"inviteEmergencyContactDesc")),k.R7$(4),k.JRh(k.bMT(7,4,"email")))}function Gr(e,t){if(1&e&&k.nrm(0,"bit-option",22),2&e){const e=t.$implicit;k.Y8G("value",e.value)("label",e.name)}}function jr(e,t){if(1&e&&(k.nrm(0,"button",23),k.nI1(1,"i18n")),2&e){const e=k.XpG();k.Y8G("label",k.mNQ(k.bMT(1,3,"delete")))("bitAction",e.delete)}}!function(e){e.Saved="saved",e.Canceled="canceled",e.Deleted="deleted"}(Pr||(Pr={}));class Nr{constructor(e,t,i,n,r,s,o,l){this.params=e,this.formBuilder=t,this.emergencyAccessService=i,this.i18nService=n,this.platformUtilsService=r,this.logService=s,this.dialogRef=o,this.toastService=l,this.loading=!0,this.readOnly=!1,this.editMode=!1,this.type=gr.View,this.emergencyAccessType=gr,this.addEditForm=this.formBuilder.group({email:["",[a.k0.email,a.k0.required]],emergencyAccessType:[this.emergencyAccessType.View],waitTime:[{value:null,disabled:this.readOnly},[a.k0.required]]}),this.submit=()=>Dr(this,void 0,void 0,function*(){if(this.addEditForm.invalid)this.addEditForm.markAllAsTouched();else try{this.editMode?yield this.emergencyAccessService.update(this.params.emergencyAccessId,this.addEditForm.value.emergencyAccessType,this.addEditForm.value.waitTime):yield this.emergencyAccessService.invite(this.addEditForm.value.email,this.addEditForm.value.emergencyAccessType,this.addEditForm.value.waitTime),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(this.editMode?"editedUserId":"invitedUsers",this.params.name)}),this.dialogRef.close(Pr.Saved)}catch(e){this.logService.error(e)}}),this.delete=()=>Dr(this,void 0,void 0,function*(){this.dialogRef.close(Pr.Deleted)})}ngOnInit(){return Dr(this,void 0,void 0,function*(){if(this.editMode=this.loading=null!=this.params.emergencyAccessId,this.waitTimes=[{name:this.i18nService.t("oneDay"),value:1},{name:this.i18nService.t("days","2"),value:2},{name:this.i18nService.t("days","7"),value:7},{name:this.i18nService.t("days","14"),value:14},{name:this.i18nService.t("days","30"),value:30},{name:this.i18nService.t("days","90"),value:90}],this.editMode){this.title=this.i18nService.t("editEmergencyContact");try{const e=yield this.emergencyAccessService.getEmergencyAccess(this.params.emergencyAccessId);this.addEditForm.patchValue({email:e.email,waitTime:e.waitTimeDays,emergencyAccessType:e.type})}catch(e){this.logService.error(e)}}else this.title=this.i18nService.t("inviteEmergencyContact"),this.addEditForm.patchValue({waitTime:this.waitTimes[2].value});this.loading=!1})}}Nr.open=(e,t)=>e.open(Nr,t),Nr.ɵfac=function(e){return new(e||Nr)(k.rXU(xn.Qs),k.rXU(a.ok),k.rXU(br.p),k.rXU(j.W),k.rXU(N.y),k.rXU(ve.K),k.rXU(E.ce),k.rXU($.f))},Nr.ɵcmp=k.VBU({type:Nr,selectors:[["ng-component"]],decls:46,vars:44,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],[4,"ngIf"],["class","tw-text-muted",4,"ngIf"],["bitDialogContent",""],["formControlName","emergencyAccessType",3,"block"],["target","_blank","rel","noreferrer","bitLink","","linkType","primary","href","https://bitwarden.com/help/emergency-access/#user-access","slot","end",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["id","emergencyTypeView",3,"value"],["id","emergencyTypeTakeover",3,"value"],[1,"tw-w-1/2","tw-relative","tw-px-2.5"],["formControlName","waitTime"],[3,"value","label",4,"ngFor","ngForOf"],[1,"tw-text-sm"],["bitDialogFooter",""],["type","submit","buttonType","primary","bitButton","","bitFormButton","",3,"disabled"],["bitButton","","bitFormButton","","buttonType","secondary","type","button","bitDialogClose",""],["type","button","bitFormButton","","class","tw-ml-auto","bitIconButton","bwi-trash","buttonType","danger",3,"bitAction","label",4,"ngIf"],[1,"tw-text-muted"],["bitTypography","body1"],["bitInput","","formControlName","email"],[3,"value","label"],["type","button","bitFormButton","","bitIconButton","bwi-trash","buttonType","danger",1,"tw-ml-auto",3,"bitAction","label"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1)(2,"span",2),k.DNE(3,Or,1,0,"app-premium-badge",3),k.EFF(4),k.DNE(5,Mr,2,1,"small",4),k.k0s(),k.qex(6,5),k.DNE(7,Ur,9,6,"ng-container",3),k.j41(8,"bit-radio-group",6)(9,"bit-label"),k.EFF(10),k.nI1(11,"i18n"),k.j41(12,"a",7),k.nI1(13,"i18n"),k.nrm(14,"i",8),k.k0s()(),k.j41(15,"bit-radio-button",9)(16,"bit-label"),k.EFF(17),k.nI1(18,"i18n"),k.k0s(),k.j41(19,"bit-hint"),k.EFF(20),k.nI1(21,"i18n"),k.k0s()(),k.j41(22,"bit-radio-button",10)(23,"bit-label"),k.EFF(24),k.nI1(25,"i18n"),k.k0s(),k.j41(26,"bit-hint"),k.EFF(27),k.nI1(28,"i18n"),k.k0s()()(),k.j41(29,"bit-form-field",11)(30,"bit-label"),k.EFF(31),k.nI1(32,"i18n"),k.k0s(),k.j41(33,"bit-select",12),k.DNE(34,Gr,1,2,"bit-option",13),k.k0s(),k.j41(35,"bit-hint",14),k.EFF(36),k.nI1(37,"i18n"),k.k0s()(),k.bVm(),k.qex(38,15),k.j41(39,"button",16),k.EFF(40),k.nI1(41,"i18n"),k.k0s(),k.j41(42,"button",17),k.EFF(43),k.nI1(44,"i18n"),k.k0s(),k.DNE(45,jr,2,5,"button",18),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.addEditForm)("bitSubmit",t.submit),k.R7$(),k.Y8G("loading",t.loading),k.R7$(2),k.Y8G("ngIf",t.readOnly),k.R7$(),k.SpI(" ",t.title," "),k.R7$(),k.Y8G("ngIf",t.params.name),k.R7$(2),k.Y8G("ngIf",!t.editMode),k.R7$(),k.Y8G("block",!0),k.R7$(2),k.SpI(" ",k.bMT(11,24,"userAccess")," "),k.R7$(2),k.Y8G("appA11yTitle",k.mNQ(k.bMT(13,26,"learnMoreAboutUserAccess"))),k.R7$(3),k.Y8G("value",t.emergencyAccessType.View),k.R7$(2),k.JRh(k.bMT(18,28,"view")),k.R7$(3),k.JRh(k.bMT(21,30,"viewDesc")),k.R7$(2),k.Y8G("value",t.emergencyAccessType.Takeover),k.R7$(2),k.JRh(k.bMT(25,32,"takeover")),k.R7$(3),k.JRh(k.bMT(28,34,"takeoverDesc")),k.R7$(4),k.JRh(k.bMT(32,36,"waitTime")),k.R7$(3),k.Y8G("ngForOf",t.waitTimes),k.R7$(2),k.JRh(k.bMT(37,38,"waitTimeDesc")),k.R7$(3),k.Y8G("disabled",t.readOnly),k.R7$(),k.SpI(" ",k.bMT(41,40,"save")," "),k.R7$(3),k.SpI(" ",k.bMT(44,42,"cancel")," "),k.R7$(2),k.Y8G("ngIf",t.editMode))},dependencies:[Zt.G,Y.Sq,Y.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,xr.C,Qt.p,gi.$,yi.L,oe.Q,fn.I,gn.m,bi.j,$r.I,Xi.J,wi.h,ln.s,ke.L,Er.d,Ar.Y,Si.w,Ii.P,Ce.r,yr.a,ae.$],encapsulation:2});var Vr=i(33338),Br=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function zr(e,t){if(1&e&&(k.j41(0,"small",8),k.EFF(1),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.JRh(e.dialogData.grantorName)}}function Lr(e,t){1&e&&(k.j41(0,"div",3),k.nrm(1,"i",9),k.nI1(2,"i18n"),k.j41(3,"span",10),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function Kr(e,t){if(1&e){const e=k.RV6();k.j41(0,"auth-input-password",11),k.bIt("onPasswordFormSubmit",function(t){C.eBV(e);const i=k.XpG();return C.Njj(i.handlePasswordFormSubmit(t))})("isSubmitting",function(t){C.eBV(e);const i=k.XpG();return C.Njj(i.handleIsSubmittingChange(t))}),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("flow",e.inputPasswordFlow)("masterPasswordPolicyOptions",e.masterPasswordPolicyOptions)}}const qr="done";class _r{constructor(e,t,i,n,r,s,o,a){this.dialogData=e,this.accountService=t,this.dialogRef=i,this.emergencyAccessService=n,this.i18nService=r,this.logService=s,this.policyService=o,this.toastService=a,this.inputPasswordComponent=void 0,this.parentSubmittingBehaviorSubject=new Fn.t(!1),this.parentSubmitting$=this.parentSubmittingBehaviorSubject.asObservable(),this.childSubmittingBehaviorSubject=new Fn.t(!1),this.childSubmitting$=this.childSubmittingBehaviorSubject.asObservable(),this.submitting$=(0,Vr.z)([this.parentSubmitting$,this.childSubmitting$]).pipe((0,m.T)(([e,t])=>e||t)),this.initializing=!0,this.inputPasswordFlow=Ae.m5.ChangePasswordDelegation,this.handlePrimaryButtonClick=()=>Br(this,void 0,void 0,function*(){if(!this.inputPasswordComponent)throw new Error("InputPasswordComponent is not initialized");yield this.inputPasswordComponent.submit()})}ngOnInit(){return Br(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6)),t=yield this.emergencyAccessService.getGrantorPolicies(this.dialogData.emergencyAccessId);this.masterPasswordPolicyOptions=yield(0,u._)(this.policyService.masterPasswordPolicyOptions$(e,t)),this.initializing=!1})}handlePasswordFormSubmit(e){return Br(this,void 0,void 0,function*(){this.parentSubmittingBehaviorSubject.next(!0);try{const t=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.emergencyAccessService.takeover(this.dialogData.emergencyAccessId,e.newPassword,this.dialogData.grantorEmail,t)}catch(t){this.logService.error(t),this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("unexpectedError")})}finally{this.parentSubmittingBehaviorSubject.next(!1)}this.dialogRef.close(qr)})}handleIsSubmittingChange(e){this.childSubmittingBehaviorSubject.next(e)}}_r.open=(e,t)=>e.open(_r,t),_r.ɵfac=function(e){return new(e||_r)(k.rXU(xn.Qs),k.rXU(L.Di),k.rXU(E.ce),k.rXU(br.p),k.rXU(j.W),k.rXU(ve.K),k.rXU(Le.m),k.rXU($.f))},_r.ɵcmp=k.VBU({type:_r,selectors:[["auth-emergency-access-takeover-dialog"]],viewQuery:function(e,t){if(1&e&&k.GBs(Ae.tu,5),2&e){let e;k.mGM(e=k.lsd())&&(t.inputPasswordComponent=e.first)}},decls:16,vars:14,consts:[["bitDialogTitle",""],["class","tw-text-muted",4,"ngIf"],["bitDialogContent",""],[1,"tw-flex","tw-items-center","tw-justify-center"],[3,"flow","masterPasswordPolicyOptions"],["bitDialogFooter",""],["type","button","bitButton","","buttonType","primary",3,"click","disabled"],["type","button","bitButton","","buttonType","secondary","bitDialogClose",""],[1,"tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"onPasswordFormSubmit","isSubmitting","flow","masterPasswordPolicyOptions"]],template:function(e,t){1&e&&(k.j41(0,"bit-dialog")(1,"span",0),k.EFF(2),k.nI1(3,"i18n"),k.DNE(4,zr,2,1,"small",1),k.k0s(),k.j41(5,"div",2),k.nVh(6,Lr,6,7,"div",3)(7,Kr,1,2,"auth-input-password",4),k.k0s(),k.qex(8,5),k.j41(9,"button",6),k.nI1(10,"async"),k.bIt("click",function(){return t.handlePrimaryButtonClick()}),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.j41(13,"button",7),k.EFF(14),k.nI1(15,"i18n"),k.k0s(),k.bVm(),k.k0s()),2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,6,"takeover")," "),k.R7$(2),k.Y8G("ngIf",t.dialogData.grantorName),k.R7$(2),k.vxM(t.initializing?6:7),k.R7$(3),k.Y8G("disabled",k.bMT(10,8,t.submitting$)),k.R7$(2),k.SpI(" ",k.bMT(12,10,"save")," "),k.R7$(3),k.SpI(" ",k.bMT(15,12,"cancel")," "))},dependencies:[se.t,oe.Q,er.j,Y.MD,Y.bT,ir.P,fn.I,gn.m,Ae.tu,Y.Jj,je.$Z],encapsulation:2});var Xr=i(58329),Yr=i(47696),Hr=i(13496),Wr=i(53997),Jr=i(78952),Zr=i(88832),Qr=i(38410),es=i(22466),ts=i(36572),is=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ns(e,t){1&e&&(k.j41(0,"bit-callout",13),k.nI1(1,"i18n"),k.EFF(2),k.nI1(3,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"warning"))),k.R7$(2),k.JRh(k.bMT(3,5,"emergencyAccessOwnerWarning")))}function rs(e,t){1&e&&(k.j41(0,"span",32),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"invited")))}function ss(e,t){1&e&&(k.j41(0,"span",33),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"needsConfirmation")))}function os(e,t){1&e&&(k.j41(0,"span",33),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"emergencyAccessRecoveryInitiated")))}function as(e,t){1&e&&(k.j41(0,"span",34),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"emergencyAccessRecoveryApproved")))}function ls(e,t){if(1&e&&(k.j41(0,"small",35),k.EFF(1),k.k0s()),2&e){const e=k.XpG().$implicit;k.R7$(),k.JRh(e.name)}}function cs(e,t){1&e&&(k.j41(0,"span",34),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"view")))}function ds(e,t){1&e&&(k.j41(0,"span",34),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"takeover")))}function us(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",30),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.reinvite(t))}),k.nrm(1,"i",36),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"resendInvitation")," "))}function hs(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",30),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.confirm(t))}),k.nrm(1,"i",37),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"confirm")," "))}function ps(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",30),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.approve(t))}),k.nrm(1,"i",37),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"approve")," "))}function ms(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",30),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.reject(t))}),k.nrm(1,"i",31),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"reject")," "))}function vs(e,t){if(1&e){const e=k.RV6();k.j41(0,"tr",19)(1,"td",20),k.nrm(2,"bit-avatar",21),k.nI1(3,"userName"),k.j41(4,"span",22)(5,"a",23),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.edit(t))}),k.EFF(6),k.k0s(),k.DNE(7,rs,3,3,"span",24)(8,ss,3,3,"span",25)(9,os,3,3,"span",25)(10,as,3,3,"span",26)(11,ls,2,1,"small",27),k.k0s()(),k.j41(12,"td",15),k.DNE(13,cs,3,3,"span",26)(14,ds,3,3,"span",26),k.k0s(),k.j41(15,"td",16),k.nrm(16,"button",28),k.nI1(17,"i18n"),k.j41(18,"bit-menu",null,0),k.DNE(20,us,4,3,"button",29)(21,hs,4,3,"button",29)(22,ps,4,3,"button",29)(23,ms,4,3,"button",29),k.j41(24,"button",30),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.remove(t))}),k.nrm(25,"i",31),k.EFF(26),k.nI1(27,"i18n"),k.k0s()()()()}if(2&e){const e=t.$implicit,i=k.sdS(19),n=k.XpG(3);k.R7$(2),k.Y8G("text",k.bMT(3,19,e))("id",e.granteeId)("color",e.avatarColor),k.R7$(4),k.JRh(e.email),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Invited),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Accepted),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved),k.R7$(),k.Y8G("ngIf",e.name),k.R7$(2),k.Y8G("ngIf",e.type===n.emergencyAccessType.View),k.R7$(),k.Y8G("ngIf",e.type===n.emergencyAccessType.Takeover),k.R7$(2),k.Y8G("label",k.mNQ(k.bMT(17,21,"options")))("bitMenuTriggerFor",i),k.R7$(4),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Invited),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Accepted),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated||e.status===n.emergencyAccessStatusType.RecoveryApproved),k.R7$(3),k.SpI(" ",k.bMT(27,23,"remove")," ")}}function fs(e,t){if(1&e&&k.DNE(0,vs,28,25,"tr",18),2&e){const e=k.XpG(2);k.Y8G("ngForOf",e.trustedContacts)}}function gs(e,t){1&e&&(k.j41(0,"bit-table"),k.qex(1,14),k.j41(2,"tr")(3,"th",15),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"th",15),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.j41(9,"th",16),k.EFF(10),k.nI1(11,"i18n"),k.k0s()(),k.bVm(),k.DNE(12,fs,1,1,"ng-template",17),k.k0s()),2&e&&(k.R7$(4),k.JRh(k.bMT(5,3,"name")),k.R7$(3),k.JRh(k.bMT(8,5,"accessLevel")),k.R7$(3),k.JRh(k.bMT(11,7,"options")))}function ys(e,t){1&e&&(k.j41(0,"p",39),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"noTrustedContacts")))}function bs(e,t){1&e&&(k.qex(0),k.nrm(1,"i",40),k.nI1(2,"i18n"),k.j41(3,"span",41),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function ws(e,t){if(1&e&&(k.qex(0),k.DNE(1,ys,3,3,"p",38)(2,bs,6,7,"ng-container",11),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",e.loaded),k.R7$(),k.Y8G("ngIf",!e.loaded)}}function Ss(e,t){1&e&&(k.j41(0,"span",34),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"invited")))}function Is(e,t){1&e&&(k.j41(0,"span",33),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"needsConfirmation")))}function ks(e,t){1&e&&(k.j41(0,"span",33),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"emergencyAccessRecoveryInitiated")))}function Cs(e,t){1&e&&(k.j41(0,"span",44),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"emergencyAccessRecoveryApproved")))}function Ts(e,t){if(1&e&&(k.j41(0,"small",35),k.EFF(1),k.k0s()),2&e){const e=k.XpG().$implicit;k.R7$(),k.JRh(e.name)}}function Fs(e,t){1&e&&(k.j41(0,"span",34),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"view")))}function Rs(e,t){1&e&&(k.j41(0,"span",34),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"takeover")))}function Ps(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",30),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.requestAccess(t))}),k.nrm(1,"i",36),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"requestAccess")," "))}function xs(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",30),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.takeover(t))}),k.nrm(1,"i",45),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"takeover")," "))}function $s(e,t){if(1&e&&(k.j41(0,"button",46),k.nrm(1,"i",47),k.EFF(2),k.nI1(3,"i18n"),k.k0s()),2&e){const e=k.XpG().$implicit;k.Y8G("routerLink",e.id),k.R7$(2),k.SpI(" ",k.bMT(3,2,"view")," ")}}function Es(e,t){if(1&e){const e=k.RV6();k.j41(0,"tr",19)(1,"td",20),k.nrm(2,"bit-avatar",21),k.nI1(3,"userName"),k.j41(4,"span",22)(5,"span"),k.EFF(6),k.k0s(),k.DNE(7,Ss,3,3,"span",26)(8,Is,3,3,"span",25)(9,ks,3,3,"span",25)(10,Cs,3,3,"span",42)(11,Ts,2,1,"small",27),k.k0s()(),k.j41(12,"td",15),k.DNE(13,Fs,3,3,"span",26)(14,Rs,3,3,"span",26),k.k0s(),k.j41(15,"td",16),k.nrm(16,"button",28),k.nI1(17,"i18n"),k.j41(18,"bit-menu",null,1),k.DNE(20,Ps,4,3,"button",29)(21,xs,4,3,"button",29)(22,$s,4,4,"button",43),k.j41(23,"button",30),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.remove(t))}),k.nrm(24,"i",31),k.EFF(25),k.nI1(26,"i18n"),k.k0s()()()()}if(2&e){const e=t.$implicit,i=k.sdS(19),n=k.XpG(3);k.R7$(2),k.Y8G("text",k.bMT(3,18,e))("id",e.grantorId)("color",e.avatarColor),k.R7$(4),k.JRh(e.email),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Invited),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Accepted),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryInitiated),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved),k.R7$(),k.Y8G("ngIf",e.name),k.R7$(2),k.Y8G("ngIf",e.type===n.emergencyAccessType.View),k.R7$(),k.Y8G("ngIf",e.type===n.emergencyAccessType.Takeover),k.R7$(2),k.Y8G("label",k.mNQ(k.bMT(17,20,"options")))("bitMenuTriggerFor",i),k.R7$(4),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.Confirmed),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved&&e.type===n.emergencyAccessType.Takeover),k.R7$(),k.Y8G("ngIf",e.status===n.emergencyAccessStatusType.RecoveryApproved&&e.type===n.emergencyAccessType.View),k.R7$(3),k.SpI(" ",k.bMT(26,22,"remove")," ")}}function As(e,t){if(1&e&&k.DNE(0,Es,27,24,"tr",18),2&e){const e=k.XpG(2);k.Y8G("ngForOf",e.grantedContacts)}}function Ds(e,t){1&e&&(k.j41(0,"bit-table"),k.qex(1,14),k.j41(2,"tr")(3,"th",15),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"th",15),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.j41(9,"th",16),k.EFF(10),k.nI1(11,"i18n"),k.k0s()(),k.bVm(),k.DNE(12,As,1,1,"ng-template",17),k.k0s()),2&e&&(k.R7$(4),k.JRh(k.bMT(5,3,"name")),k.R7$(3),k.JRh(k.bMT(8,5,"accessLevel")),k.R7$(3),k.JRh(k.bMT(11,7,"options")))}function Os(e,t){1&e&&(k.j41(0,"p",2),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"noGrantedAccess")))}function Ms(e,t){1&e&&(k.qex(0),k.nrm(1,"i",40),k.nI1(2,"i18n"),k.j41(3,"span",41),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function Us(e,t){if(1&e&&(k.qex(0),k.DNE(1,Os,3,3,"p",48)(2,Ms,6,7,"ng-container",11),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",e.loaded),k.R7$(),k.Y8G("ngIf",!e.loaded)}}class Gs{constructor(e,t,i,n,r,s,o,a,l,c,d,h,p,m){this.emergencyAccessService=e,this.i18nService=t,this.platformUtilsService=i,this.messagingService=n,this.userNamePipe=r,this.logService=s,this.stateService=o,this.organizationService=a,this.dialogService=l,this.organizationManagementPreferencesService=d,this.toastService=h,this.apiService=p,this.accountService=m,this.loaded=!1,this.emergencyAccessType=gr,this.emergencyAccessStatusType=wr.c,this.edit=e=>is(this,void 0,void 0,function*(){const t=yield(0,u._)(this.canAccessPremium$),i=Nr.open(this.dialogService,{data:{name:this.userNamePipe.transform(e),emergencyAccessId:null==e?void 0:e.id,readOnly:!t}}),n=yield(0,oi.s)(i.closed);n===Pr.Saved?yield this.load():n===Pr.Deleted&&(yield this.remove(e))}),this.invite=()=>is(this,void 0,void 0,function*(){yield this.edit(null)}),this.takeover=e=>is(this,void 0,void 0,function*(){if(!e||!e.email||!e.id)return this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("grantorDetailsNotFound")}),void this.logService.error("Grantor details not found when attempting emergency access takeover");const t=this.userNamePipe.transform(e),i=_r.open(this.dialogService,{data:{grantorName:t,grantorEmail:e.email,emergencyAccessId:e.id}});(yield(0,oi.s)(i.closed))===qr&&this.toastService.showToast({variant:"success",title:"",message:this.i18nService.t("passwordResetFor",t)})}),this.canAccessPremium$=this.accountService.activeAccount$.pipe((0,ft.n)(e=>c.hasPremiumFromAnySource$(e.id)))}ngOnInit(){return is(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),t=yield(0,u._)(this.organizationService.organizations$(e));this.isOrganizationOwner=t.some(e=>e.isOwner),this.load()})}load(){return is(this,void 0,void 0,function*(){this.trustedContacts=yield this.emergencyAccessService.getEmergencyAccessTrusted(),this.grantedContacts=yield this.emergencyAccessService.getEmergencyAccessGranted(),this.loaded=!0})}reinvite(e){return is(this,void 0,void 0,function*(){null==this.actionPromise&&(this.actionPromise=this.emergencyAccessService.reinvite(e.id),yield this.actionPromise,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("hasBeenReinvited",e.email)}),this.actionPromise=null)})}confirm(e){return is(this,void 0,void 0,function*(){function t(){e.status=wr.c.Confirmed}if(null!=this.actionPromise)return;const i=yield this.apiService.getUserPublicKey(e.granteeId),n=Pn.A.fromB64ToArray(i.publicKey),r=yield(0,u._)(this.organizationManagementPreferencesService.autoConfirmFingerPrints.state$);if(null==r||!r){const i=Rr.open(this.dialogService,{data:{name:this.userNamePipe.transform(e),emergencyAccessId:e.id,userId:null==e?void 0:e.granteeId,publicKey:n}});if((yield(0,oi.s)(i.closed))===Sr.Confirmed){const i=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.emergencyAccessService.confirm(e.id,e.granteeId,n,i),t(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("hasBeenConfirmed",this.userNamePipe.transform(e))})}return}const s=yield(0,u._)(this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.id)));this.actionPromise=this.emergencyAccessService.confirm(e.id,e.granteeId,n,s),yield this.actionPromise,t(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("hasBeenConfirmed",this.userNamePipe.transform(e))}),this.actionPromise=null})}remove(e){return is(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:this.userNamePipe.transform(e),content:{key:"removeUserConfirmation"},type:"warning"})))return!1;try{yield this.emergencyAccessService.delete(e.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("removedUserId",this.userNamePipe.transform(e))}),e instanceof Ir.cY?this.removeGrantee(e):this.removeGrantor(e)}catch(t){this.logService.error(t)}})}requestAccess(e){return is(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:this.userNamePipe.transform(e),content:{key:"requestAccessConfirmation",placeholders:[e.waitTimeDays.toString()]},acceptButtonText:{key:"requestAccess"},type:"warning"})))return!1;yield this.emergencyAccessService.requestAccess(e.id),e.status=wr.c.RecoveryInitiated,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("requestSent",this.userNamePipe.transform(e))})})}approve(e){return is(this,void 0,void 0,function*(){const t=this.i18nService.t(e.type===gr.View?"view":"takeover");if(!(yield this.dialogService.openSimpleDialog({title:this.userNamePipe.transform(e),content:{key:"approveAccessConfirmation",placeholders:[this.userNamePipe.transform(e),t]},acceptButtonText:{key:"approve"},type:"warning"})))return!1;yield this.emergencyAccessService.approve(e.id),e.status=wr.c.RecoveryApproved,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emergencyApproved",this.userNamePipe.transform(e))})})}reject(e){return is(this,void 0,void 0,function*(){yield this.emergencyAccessService.reject(e.id),e.status=wr.c.Confirmed,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emergencyRejected",this.userNamePipe.transform(e))})})}removeGrantee(e){const t=this.trustedContacts.indexOf(e);t>-1&&this.trustedContacts.splice(t,1)}removeGrantor(e){const t=this.grantedContacts.indexOf(e);t>-1&&this.grantedContacts.splice(t,1)}}Gs.ɵfac=function(e){return new(e||Gs)(k.rXU(br.p),k.rXU(j.W),k.rXU(N.y),k.rXU(fe.U),k.rXU(Mn.b),k.rXU(ve.K),k.rXU(w.d),k.rXU(g.PV),k.rXU(E.o3),k.rXU(Xr.Q),k.rXU(kr.y),k.rXU($.f),k.rXU(fi.G),k.rXU(L.Di))},Gs.ɵcmp=k.VBU({type:Gs,selectors:[["ng-component"]],decls:31,vars:24,consts:[["trustedContactOptions",""],["grantedContactOptions",""],["bitTypography","body1"],[1,"tw-text-main"],["bitLink","","href","https://bitwarden.com/help/emergency-access/","target","_blank","rel","noreferrer"],["type","warning",3,"title",4,"ngIf"],[1,"tw-flex","tw-items-center","tw-gap-2","tw-mb-2"],["bitTypography","h2","noMargin","",1,"tw-mb-0"],[1,"tw-ml-auto","tw-flex"],["type","button","bitButton","","buttonType","primary",3,"bitAction","disabled"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"],[4,"ngIf"],["bitTypography","h2"],["type","warning",3,"title"],["header",""],["bitCell",""],["bitCell","",1,"tw-text-right"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",1,"tw-flex","tw-items-center","tw-gap-4"],["size","small",3,"text","id","color"],[1,"tw-inline-flex","tw-gap-2"],["bitLink","","href","#","appStopClick","",3,"click"],["bitBadge","","variant","secondary",4,"ngIf"],["bitBadge","","variant","warning",4,"ngIf"],["bitBadge","",4,"ngIf"],["class","tw-text-muted tw-block",4,"ngIf"],["type","button","bitIconButton","bwi-ellipsis-v","buttonType","main",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close"],["bitBadge","","variant","secondary"],["bitBadge","","variant","warning"],["bitBadge",""],[1,"tw-text-muted","tw-block"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-envelope"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check"],["bitTypography","body1","class","tw-mt-2",4,"ngIf"],["bitTypography","body1",1,"tw-mt-2"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitBadge","","variant","success",4,"ngIf"],["type","button","bitMenuItem","",3,"routerLink",4,"ngIf"],["bitBadge","","variant","success"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-key"],["type","button","bitMenuItem","",3,"routerLink"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-eye"],["bitTypography","body1",4,"ngIf"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container")(2,"bit-section")(3,"p",2)(4,"span",3),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"a",4),k.EFF(8),k.nI1(9,"i18n"),k.k0s()(),k.DNE(10,ns,4,7,"bit-callout",5),k.k0s(),k.j41(11,"bit-section")(12,"div",6)(13,"h2",7),k.EFF(14),k.nI1(15,"i18n"),k.k0s(),k.nrm(16,"app-premium-badge"),k.j41(17,"div",8)(18,"button",9),k.nI1(19,"async"),k.nrm(20,"i",10),k.EFF(21),k.nI1(22,"i18n"),k.k0s()()(),k.DNE(23,gs,13,9,"bit-table",11)(24,ws,3,2,"ng-container",11),k.k0s(),k.j41(25,"bit-section")(26,"h2",12),k.EFF(27),k.nI1(28,"i18n"),k.k0s(),k.DNE(29,Ds,13,9,"bit-table",11)(30,Us,3,2,"ng-container",11),k.k0s()()),2&e&&(k.R7$(5),k.JRh(k.bMT(6,12,"emergencyAccessDesc")),k.R7$(3),k.SpI(" ",k.bMT(9,14,"learnMoreAboutEmergencyAccess")," "),k.R7$(2),k.Y8G("ngIf",t.isOrganizationOwner),k.R7$(4),k.SpI(" ",k.bMT(15,16,"trustedEmergencyContacts")," "),k.R7$(4),k.Y8G("bitAction",t.invite)("disabled",!k.bMT(19,18,t.canAccessPremium$)),k.R7$(3),k.SpI(" ",k.bMT(22,20,"addEmergencyContact")," "),k.R7$(2),k.Y8G("ngIf",t.trustedContacts&&t.trustedContacts.length),k.R7$(),k.Y8G("ngIf",!t.trustedContacts||!t.trustedContacts.length),k.R7$(3),k.JRh(k.bMT(28,22,"designatedEmergencyContacts")),k.R7$(2),k.Y8G("ngIf",t.grantedContacts&&t.grantedContacts.length),k.R7$(),k.Y8G("ngIf",!t.grantedContacts||!t.grantedContacts.length))},dependencies:[Zt.G,Y.Sq,Y.bT,ne.Wk,On.Y,Qt.p,En.f,Yr.n,oe.Q,Ge.G,Ai.H,ln.s,ke.L,Hr.Z,Wr.O,Jr.S,Zr.n,Qr.Q,es.Y,ts._,ts.O,Ce.r,Ei.G,Di.f,yr.a,Y.Jj,ae.$,Mn.b],encapsulation:2});var js=i(22166),Ns=i(50790),Vs=i(43090),Bs=i(75421),zs=i(31442),Ls=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Ks{constructor(e,t,i){this.params=e,this.dialogRef=t,this.i18nService=i,this.title="",this.cancel=()=>{this.dialogRef.close()},this.updateTitle()}get cipher(){return this.params.cipher}get emergencyAccessId(){return this.params.emergencyAccessId}updateTitle(){switch(this.cipher.type){case zs.gC.Login:this.title=this.i18nService.t("viewItemHeaderLogin");break;case zs.gC.Card:this.title=this.i18nService.t("viewItemHeaderCard");break;case zs.gC.Identity:this.title=this.i18nService.t("viewItemHeaderIdentity");break;case zs.gC.SecureNote:this.title=this.i18nService.t("viewItemHeaderNote")}}static open(e,t){return e.open(Ks,{data:t})}}Ks.ɵfac=function(e){return new(e||Ks)(k.rXU(xn.Qs),k.rXU(E.ce),k.rXU(j.W))},Ks.ɵcmp=k.VBU({type:Ks,selectors:[["app-emergency-view-dialog"]],features:[k.Jv_([{provide:Bs.Q,useClass:Ns.I},{provide:Vs.l,useClass:class{promptForPremium(){return Ls(this,void 0,void 0,function*(){return Promise.resolve()})}}},{provide:js.e3,useClass:js.bj}])],decls:11,vars:6,consts:[["dialog",""],["dialogContent",""],["dialogSize","large","background","alt"],["bitDialogTitle","","aria-live","polite"],["bitDialogContent",""],[3,"emergencyAccessId","cipher"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","secondary",3,"click"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-dialog",2,0)(2,"span",3),k.EFF(3),k.k0s(),k.j41(4,"div",4,1),k.nrm(6,"app-cipher-view",5),k.k0s(),k.qex(7,6),k.j41(8,"button",7),k.bIt("click",function(){return C.eBV(e),C.Njj(t.cancel())}),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.bVm(),k.k0s()}2&e&&(k.R7$(3),k.SpI(" ",t.title," "),k.R7$(3),k.Y8G("emergencyAccessId",t.emergencyAccessId)("cipher",t.cipher),k.R7$(3),k.SpI(" ",k.bMT(10,4,"cancel")," "))},dependencies:[se.t,oe.Q,js.k,ir.P,gn.m,Y.MD,re.p,ae.$],encapsulation:2});var qs=i(26333),_s=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Xs(e,t){1&e&&(k.qex(0),k.nrm(1,"i",11),k.nI1(2,"i18n"),k.j41(3,"span",12),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"shared"))),k.R7$(3),k.JRh(k.bMT(5,5,"shared")))}function Ys(e,t){1&e&&(k.qex(0),k.nrm(1,"i",13),k.nI1(2,"i18n"),k.j41(3,"span",12),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"attachments"))),k.R7$(3),k.JRh(k.bMT(5,5,"attachments")))}function Hs(e,t){if(1&e){const e=k.RV6();k.j41(0,"tr",5)(1,"td",6),k.nrm(2,"app-vault-icon",7),k.k0s(),k.j41(3,"td",8)(4,"a",9),k.nI1(5,"i18n"),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.selectCipher(t))}),k.EFF(6),k.k0s(),k.DNE(7,Xs,6,7,"ng-container",2)(8,Ys,6,7,"ng-container",2),k.nrm(9,"br"),k.j41(10,"small",10),k.EFF(11),k.k0s()()()}if(2&e){const e=t.$implicit;k.R7$(2),k.Y8G("cipher",e),k.R7$(2),k.Y8G("title",k.mNQ(k.bMT(5,7,"editItem"))),k.R7$(2),k.JRh(e.name),k.R7$(),k.Y8G("ngIf",e.organizationId),k.R7$(),k.Y8G("ngIf",e.hasAttachments),k.R7$(3),k.JRh(e.subTitle)}}function Ws(e,t){if(1&e&&k.DNE(0,Hs,12,9,"tr",4),2&e){const e=k.XpG(2);k.Y8G("ngForOf",e.ciphers)}}function Js(e,t){1&e&&(k.qex(0),k.j41(1,"bit-table"),k.DNE(2,Ws,1,1,"ng-template",3),k.k0s(),k.bVm())}function Zs(e,t){1&e&&(k.qex(0),k.nrm(1,"i",14),k.nI1(2,"i18n"),k.j41(3,"span",12),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}class Qs{constructor(e,t,i,n,r){this.router=e,this.route=t,this.emergencyAccessService=i,this.dialogService=n,this.accountService=r,this.id=null,this.ciphers=[],this.loaded=!1}ngOnInit(){return _s(this,void 0,void 0,function*(){const e=yield(0,u._)(this.route.params);if(null==e.id)return void(yield this.router.navigate(["settings/emergency-access"]));this.id=e.id;const t=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));this.ciphers=yield this.emergencyAccessService.getViewOnlyCiphers(e.id,t),this.loaded=!0})}selectCipher(e){return _s(this,void 0,void 0,function*(){Ks.open(this.dialogService,{cipher:e,emergencyAccessId:this.id})})}}Qs.ɵfac=function(e){return new(e||Qs)(k.rXU(x.Ix),k.rXU(x.nX),k.rXU(br.p),k.rXU(E.o3),k.rXU(L.Di))},Qs.ɵcmp=k.VBU({type:Qs,selectors:[["ng-component"]],features:[k.Jv_([{provide:js.hI,useClass:js.Ws}])],decls:6,vars:5,consts:[["bitTypography","h1"],[1,"tw-mt-6"],[4,"ngIf"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell",""],[3,"cipher"],["bitCell","",1,"tw-w-full"],["bitLink","","href","#","appStopClick","",3,"click","title"],[1,"tw-text-xs"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-collection-shared",3,"title"],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-paperclip",3,"title"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"]],template:function(e,t){1&e&&(k.j41(0,"h1",0),k.EFF(1),k.nI1(2,"i18n"),k.k0s(),k.j41(3,"div",1),k.DNE(4,Js,3,0,"ng-container",2)(5,Zs,6,7,"ng-container",2),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,3,"vault")),k.R7$(3),k.Y8G("ngIf",t.ciphers.length),k.R7$(),k.Y8G("ngIf",!t.loaded))},dependencies:[Zt.G,Y.Sq,Y.bT,qs.R,On.Y,zn.x,ke.L,Qr.Q,es.Y,ts._,ts.O,Ce.r,ae.$],encapsulation:2});var eo=i(40711),to=i(10760),io=i(79783),no=i(90107),ro=i(8806),so=i(28778),oo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ao(e,t){1&e&&(k.j41(0,"div",7),k.nrm(1,"i",8),k.k0s())}function lo(e,t){if(1&e&&(k.qex(0),k.DNE(1,ao,2,0,"div",6),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",e.loading)}}function co(e,t){if(1&e&&(k.qex(0),k.j41(1,"p"),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"div")(5,"span",9),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"p",10),k.EFF(9),k.k0s()(),k.j41(10,"div")(11,"span",9),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.j41(14,"p"),k.EFF(15),k.k0s()(),k.j41(16,"div")(17,"span",9),k.EFF(18),k.nI1(19,"i18n"),k.k0s(),k.j41(20,"p")(21,"span",11),k.EFF(22),k.k0s(),k.EFF(23),k.k0s()(),k.j41(24,"div")(25,"span",9),k.EFF(26),k.nI1(27,"i18n"),k.k0s(),k.j41(28,"p"),k.EFF(29),k.k0s()(),k.bVm()),2&e){const e=k.XpG();k.R7$(2),k.JRh(k.i5U(3,10,"accessAttemptBy",e.email)),k.R7$(4),k.JRh(k.bMT(7,13,"fingerprintPhraseHeader")),k.R7$(3),k.JRh(e.fingerprintPhrase),k.R7$(3),k.JRh(k.bMT(13,15,"deviceType")),k.R7$(3),k.JRh(e.readableDeviceTypeName),k.R7$(3),k.JRh(k.bMT(19,17,"location")),k.R7$(4),k.SpI("",null==e.authRequestResponse?null:e.authRequestResponse.requestCountryName," "),k.R7$(),k.SpI(" (",null==e.authRequestResponse?null:e.authRequestResponse.requestIpAddress,") "),k.R7$(3),k.JRh(k.bMT(27,19,"time")),k.R7$(3),k.JRh(e.requestTimeText)}}const uo=3e5;class ho{constructor(e,t,i,n,r,s,o,a,l,c,d){this.params=e,this.accountService=t,this.apiService=i,this.authRequestService=n,this.devicesService=r,this.dialogRef=s,this.i18nService=o,this.loginApprovalDialogComponentService=a,this.logService=l,this.toastService=c,this.validationService=d,this.loading=!0,this.denyLogin=()=>oo(this,void 0,void 0,function*(){yield this.retrieveAuthRequestAndRespond(!1)}),this.approveLogin=()=>oo(this,void 0,void 0,function*(){yield this.retrieveAuthRequestAndRespond(!0)}),this.authRequestId=e.notificationId}ngOnDestroy(){return oo(this,void 0,void 0,function*(){clearInterval(this.interval)})}ngOnInit(){return oo(this,void 0,void 0,function*(){if(null==this.authRequestId)return void this.logService.error("LoginApprovalDialogComponent: authRequestId is null");try{this.authRequestResponse=yield this.apiService.getAuthRequest(this.authRequestId)}catch(t){this.validationService.showError(t),this.logService.error("LoginApprovalDialogComponent: getAuthRequest error",t)}if(null==this.authRequestResponse)return void this.logService.error("LoginApprovalDialogComponent: authRequestResponse not found");const e=Pn.A.fromB64ToArray(this.authRequestResponse.publicKey);this.email=yield(0,u._)(this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.email))),this.email?(this.fingerprintPhrase=yield this.authRequestService.getFingerprintPhrase(this.email,e),this.readableDeviceTypeName=this.devicesService.getReadableDeviceTypeName(this.authRequestResponse.requestDeviceTypeValue),this.updateTimeText(),this.interval=setInterval(()=>{this.updateTimeText()},uo),yield this.loginApprovalDialogComponentService.showLoginRequestedAlertIfWindowNotVisible(this.email),this.loading=!1):this.logService.error("LoginApprovalDialogComponent: email not found")})}static open(e,t){return e.open(ho,{data:t})}retrieveAuthRequestAndRespond(e){return oo(this,void 0,void 0,function*(){if(this.authRequestResponse=yield this.apiService.getAuthRequest(this.authRequestId),this.authRequestResponse.requestApproved||null!=this.authRequestResponse.responseDate)this.toastService.showToast({variant:"info",message:this.i18nService.t("thisRequestIsNoLongerValid")});else{const t=yield this.authRequestService.approveOrDenyAuthRequest(e,this.authRequestResponse);this.showResultToast(t)}this.dialogRef.close(e)})}showResultToast(e){e.requestApproved?this.toastService.showToast({variant:"success",message:this.i18nService.t("loginRequestApprovedForEmailOnDevice",this.email,this.devicesService.getReadableDeviceTypeName(e.requestDeviceTypeValue))}):this.toastService.showToast({variant:"info",message:this.i18nService.t("youDeniedLoginAttemptFromAnotherDevice")})}updateTimeText(){if(null==this.authRequestResponse)return void this.logService.error("LoginApprovalDialogComponent: authRequestResponse not found");const e=new Date(this.authRequestResponse.creationDate),t=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),i=new Date(Date.now()),n=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds())-t;n<=uo?this.requestTimeText=this.i18nService.t("justNow"):n<9e5?this.requestTimeText=this.i18nService.t("requestedXMinutesAgo",(n/6e4).toFixed()):(clearInterval(this.interval),this.dialogRef.close(),this.toastService.showToast({variant:"info",message:this.i18nService.t("loginRequestHasAlreadyExpired")}))}}ho.ɵfac=function(e){return new(e||ho)(k.rXU(xn.Qs),k.rXU(L.Di),k.rXU(fi.G),k.rXU(f.XF),k.rXU(ro.L),k.rXU(E.ce),k.rXU(j.W),k.rXU(so.x),k.rXU(no.Kc),k.rXU($.f),k.rXU(Se.B))},ho.ɵcmp=k.VBU({type:ho,selectors:[["ng-component"]],decls:14,vars:15,consts:[["bitDialogTitle",""],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["bitButton","","type","button","buttonType","primary",3,"bitAction","disabled"],["bitButton","","type","button","buttonType","secondary",3,"bitAction","disabled"],["class","tw-flex tw-items-center tw-justify-center",4,"ngIf"],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x"],[1,"tw-font-medium"],[1,"tw-text-code"],[1,"tw-capitalize"]],template:function(e,t){1&e&&(k.j41(0,"bit-dialog")(1,"span",0),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.qex(4,1),k.DNE(5,lo,2,1,"ng-container",2)(6,co,30,21,"ng-container",2),k.bVm(),k.qex(7,3),k.j41(8,"button",4),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.j41(11,"button",5),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.bVm(),k.k0s()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,9,"loginRequest")),k.R7$(3),k.Y8G("ngIf",t.loading),k.R7$(),k.Y8G("ngIf",!t.loading),k.R7$(2),k.Y8G("bitAction",t.approveLogin)("disabled",t.loading),k.R7$(),k.SpI(" ",k.bMT(10,11,"confirmAccess")," "),k.R7$(2),k.Y8G("bitAction",t.denyLogin)("disabled",t.loading),k.R7$(),k.SpI(" ",k.bMT(13,13,"denyAccess")," "))},dependencies:[Jn.C,Qt.p,se.t,oe.Q,Y.MD,Y.bT,ir.P,gn.m,re.p,ae.$],encapsulation:2});i(63580);var po=i(639),mo=i(98403),vo=i(75556),fo=i(90300),go=i(91962);function yo(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",3),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG();return C.Njj(i.answerAuthRequest(t.pendingAuthRequest))}),k.j41(1,"span",4),k.EFF(2),k.k0s(),k.j41(3,"span",5)(4,"span",6),k.EFF(5),k.nI1(6,"i18n"),k.k0s()(),k.j41(7,"span",7),k.nrm(8,"br"),k.j41(9,"div")(10,"span",8),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.j41(13,"span"),k.EFF(14),k.nI1(15,"date"),k.k0s()()()()}if(2&e){const e=k.XpG().$implicit;k.BMQ("tabindex",null!=e.pendingAuthRequest?0:null),k.R7$(2),k.JRh(e.displayName),k.R7$(3),k.SpI(" ",k.bMT(6,5,"requestPending")," "),k.R7$(6),k.SpI(" ",k.bMT(12,7,"firstLogin"),": "),k.R7$(3),k.JRh(k.i5U(15,9,e.firstLogin,"medium"))}}function bo(e,t){1&e&&(k.j41(0,"div",5)(1,"span",10),k.EFF(2),k.nI1(3,"i18n"),k.k0s()()),2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"currentSession")," "))}function wo(e,t){1&e&&(k.j41(0,"span"),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"trusted")))}function So(e,t){1&e&&k.nrm(0,"br")}function Io(e,t){if(1&e&&(k.j41(0,"bit-item-content",2)(1,"span",4),k.EFF(2),k.k0s(),k.DNE(3,bo,4,3,"div",9),k.j41(4,"div",7),k.nVh(5,wo,3,3,"span")(6,So,1,0,"br"),k.j41(7,"div")(8,"span",8),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.j41(11,"span"),k.EFF(12),k.nI1(13,"date"),k.k0s()()()()),2&e){const e=k.XpG().$implicit;k.R7$(2),k.JRh(e.displayName),k.R7$(),k.Y8G("ngIf",e.isCurrentDevice),k.R7$(2),k.vxM(e.isTrusted?5:6),k.R7$(4),k.SpI("",k.bMT(10,5,"firstLogin"),": "),k.R7$(3),k.JRh(k.i5U(13,7,e.firstLogin,"medium"))}}function ko(e,t){if(1&e&&(k.j41(0,"bit-item"),k.nVh(1,yo,16,12,"button",1)(2,Io,14,10,"bit-item-content",2),k.k0s()),2&e){const e=t.$implicit;k.R7$(),k.vxM(e.pendingAuthRequest?1:2)}}class Co{constructor(){this.devices=[],this.onAuthRequestAnswered=new k.bkB}answerAuthRequest(e){null!=e&&this.onAuthRequestAnswered.emit(e)}}Co.ɵfac=function(e){return new(e||Co)},Co.ɵcmp=k.VBU({type:Co,selectors:[["auth-device-management-item-group"]],inputs:{devices:"devices"},outputs:{onAuthRequestAnswered:"onAuthRequestAnswered"},decls:2,vars:1,consts:[[4,"ngFor","ngForOf"],["bit-item-content","","type","button",1,"tw-relative"],["ngClass","tw-relative"],["bit-item-content","","type","button",1,"tw-relative",3,"click"],[1,"tw-text-base"],["slot","default-trailing",1,"tw-absolute","tw-top-[6px]","tw-right-3"],["bitBadge","","variant","warning"],["slot","secondary",1,"tw-text-sm"],[1,"tw-font-medium"],["class","tw-absolute tw-top-[6px] tw-right-3","slot","default-trailing",4,"ngIf"],["bitBadge","","variant","primary"]],template:function(e,t){1&e&&(k.j41(0,"bit-item-group"),k.DNE(1,ko,3,1,"bit-item",0),k.k0s()),2&e&&(k.R7$(),k.Y8G("ngForOf",t.devices))},dependencies:[po.E,Yr.n,Y.MD,Y.YU,Y.Sq,Y.bT,mo.k,vo.J,fo.g,go._,Y.vh,je.$Z],encapsulation:2});var To=i(55542),Fo=i(47659),Ro=i(30930),Po=i(32316);function xo(e,t){if(1&e&&(k.j41(0,"th",4),k.EFF(1),k.k0s()),2&e){const e=t.$implicit;k.HbH(e.headerClass),k.Y8G("bitSortable",e.sortable?e.name:""),k.R7$(),k.SpI(" ",e.title," ")}}function $o(e,t){if(1&e){const e=k.RV6();k.j41(0,"a",12),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG();return C.Njj(i.answerAuthRequest(t.pendingAuthRequest))}),k.EFF(1),k.k0s(),k.nrm(2,"br")}if(2&e){const e=k.XpG().$implicit;k.R7$(),k.SpI(" ",e.displayName," ")}}function Eo(e,t){1&e&&(k.j41(0,"div",14),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"trusted")," "))}function Ao(e,t){if(1&e&&(k.j41(0,"span"),k.EFF(1),k.k0s(),k.DNE(2,Eo,3,3,"div",13)),2&e){const e=k.XpG().$implicit;k.R7$(),k.JRh(e.displayName),k.R7$(),k.Y8G("ngIf",e.isTrusted)}}function Do(e,t){1&e&&(k.j41(0,"span",15),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"currentSession")," "))}function Oo(e,t){1&e&&(k.j41(0,"span",16),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"requestPending")," "))}function Mo(e,t){if(1&e&&(k.j41(0,"td",5)(1,"div",6),k.nrm(2,"i",7),k.k0s(),k.j41(3,"div"),k.nVh(4,$o,3,1)(5,Ao,3,2),k.k0s()(),k.j41(6,"td",8)(7,"div",9),k.DNE(8,Do,3,3,"span",10)(9,Oo,3,3,"span",11),k.k0s()(),k.j41(10,"td",8),k.EFF(11),k.nI1(12,"date"),k.k0s()),2&e){const e=t.$implicit;k.R7$(2),k.HbH(e.icon),k.R7$(2),k.vxM(e.pendingAuthRequest?4:5),k.R7$(4),k.Y8G("ngIf",e.isCurrentDevice),k.R7$(),k.Y8G("ngIf",e.pendingAuthRequest),k.R7$(2),k.JRh(k.i5U(12,6,e.firstLogin,"medium"))}}class Uo{constructor(e){this.i18nService=e,this.devices=[],this.onAuthRequestAnswered=new k.bkB,this.tableDataSource=new To.s,this.columnConfig=[{name:"displayName",title:this.i18nService.t("device"),headerClass:"tw-w-1/3",sortable:!0},{name:"loginStatus",title:this.i18nService.t("loginStatus"),headerClass:"tw-w-1/3",sortable:!0},{name:"firstLogin",title:this.i18nService.t("firstLogin"),headerClass:"tw-w-1/3",sortable:!0}]}ngOnChanges(e){e.devices&&(this.tableDataSource.data=this.devices)}answerAuthRequest(e){null!=e&&this.onAuthRequestAnswered.emit(e)}}function Go(e,t){return e.pendingAuthRequest?-1:t.pendingAuthRequest?1:e.isCurrentDevice?-1:t.isCurrentDevice?1:e.creationDate>t.creationDate?-1:e.creationDate<t.creationDate?1:0}Uo.ɵfac=function(e){return new(e||Uo)(k.rXU(j.W))},Uo.ɵcmp=k.VBU({type:Uo,selectors:[["auth-device-management-table"]],inputs:{devices:"devices"},outputs:{onAuthRequestAnswered:"onAuthRequestAnswered"},features:[k.OA$],decls:4,vars:3,consts:[[3,"dataSource","rowSize"],["header",""],["bitCell","","scope","col","role","columnheader",3,"class","bitSortable",4,"ngFor","ngForOf"],["bitRowDef",""],["bitCell","","scope","col","role","columnheader",3,"bitSortable"],["bitCell","",1,"tw-flex","tw-gap-2","tw-items-center","tw-h-16"],[1,"tw-flex","tw-items-center","tw-justify-center","tw-w-10"],["aria-hidden","true",1,"bwi-lg"],["bitCell",""],[1,"tw-flex","tw-gap-1"],["bitBadge","","variant","primary",4,"ngIf"],["bitBadge","","variant","warning",4,"ngIf"],["bitLink","","href","#","appStopClick","",3,"click"],["class","tw-text-sm tw-text-muted",4,"ngIf"],[1,"tw-text-sm","tw-text-muted"],["bitBadge","","variant","primary"],["bitBadge","","variant","warning"]],template:function(e,t){1&e&&(k.j41(0,"bit-table-scroll",0),k.qex(1,1),k.DNE(2,xo,2,4,"th",2),k.bVm(),k.DNE(3,Mo,13,9,"ng-template",3),k.k0s()),2&e&&(k.Y8G("dataSource",t.tableDataSource)("rowSize",64),k.R7$(2),k.Y8G("ngForOf",t.columnConfig))},dependencies:[po.E,Yr.n,se.t,Y.MD,Y.Sq,Y.bT,re.p,On.Y,ye.V,ke.L,Fo.b,Ro.a,Qr.Q,Po.O,Ro.N,Y.vh,ae.$],encapsulation:2});var jo=i(93175),No=i(85800),Vo=i(71364),Bo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function zo(e,t){if(1&e&&(k.j41(0,"div",3)(1,"div",4)(2,"h1",5),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"button",6),k.nrm(6,"i",7),k.k0s(),k.j41(7,"bit-popover",8,0),k.nI1(9,"i18n"),k.j41(10,"p",9),k.EFF(11),k.nI1(12,"i18n"),k.k0s()()(),k.j41(13,"p"),k.EFF(14),k.nI1(15,"i18n"),k.k0s()()),2&e){const e=k.sdS(8);k.R7$(3),k.JRh(k.bMT(4,5,"devices")),k.R7$(2),k.Y8G("bitPopoverTriggerFor",e),k.R7$(2),k.Y8G("title",k.bMT(9,7,"whatIsADevice")),k.R7$(4),k.JRh(k.bMT(12,9,"aDeviceIs")),k.R7$(3),k.SpI(" ",k.bMT(15,11,"deviceListDescriptionTemp")," ")}}function Lo(e,t){1&e&&(k.j41(0,"div",2),k.nrm(1,"i",10),k.k0s())}function Ko(e,t){if(1&e){const e=k.RV6();k.j41(0,"auth-device-management-table",11),k.bIt("onAuthRequestAnswered",function(t){C.eBV(e);const i=k.XpG();return C.Njj(i.handleAuthRequestAnswered(t))}),k.k0s(),k.j41(1,"auth-device-management-item-group",12),k.bIt("onAuthRequestAnswered",function(t){C.eBV(e);const i=k.XpG();return C.Njj(i.handleAuthRequestAnswered(t))}),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("devices",e.devices),k.R7$(),k.Y8G("devices",e.devices)}}class qo{constructor(e,t,i,n,r,s,o,a,l,c){this.accountService=e,this.authRequestApiService=t,this.destroyRef=i,this.deviceManagementComponentService=n,this.devicesService=r,this.dialogService=s,this.i18nService=o,this.messageListener=a,this.pendingAuthRequestStateService=l,this.validationService=c,this.devices=[],this.initializing=!0,this.showHeaderInfo=!1,this.showHeaderInfo=this.deviceManagementComponentService.showHeaderInformation()}ngOnInit(){return Bo(this,void 0,void 0,function*(){yield this.loadDevices(),this.messageListener.allMessages$.pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{"openLoginApproval"===e.command&&e.notificationId&&"string"==typeof e.notificationId&&this.upsertDeviceWithPendingAuthRequest(e.notificationId)})})}loadDevices(){return Bo(this,void 0,void 0,function*(){try{const e=yield(0,u._)(this.devicesService.getDevices$()),t=yield(0,u._)(this.devicesService.getCurrentDevice$());if(!e||!t)return;this.devices=this.mapDevicesToDisplayData(e,t)}catch(e){this.validationService.showError(e)}finally{this.initializing=!1}})}mapDevicesToDisplayData(e,t){return e.map(e=>{var i,n,r,s,o;return e.id?null==e.type?(this.validationService.showError(new Error(this.i18nService.t("deviceTypeMissing"))),null):e.creationDate?{creationDate:e.creationDate,displayName:this.devicesService.getReadableDeviceTypeName(e.type),firstLogin:e.creationDate?new Date(e.creationDate):new Date,icon:this.getDeviceIcon(e.type),id:e.id||"",identifier:null!==(i=e.identifier)&&void 0!==i?i:"",isCurrentDevice:this.isCurrentDevice(e,t),isTrusted:null!==(r=null===(n=e.response)||void 0===n?void 0:n.isTrusted)&&void 0!==r&&r,loginStatus:this.getLoginStatus(e,t),pendingAuthRequest:null!==(o=null===(s=e.response)||void 0===s?void 0:s.devicePendingAuthRequest)&&void 0!==o?o:null}:(this.validationService.showError(new Error(this.i18nService.t("deviceCreationDateMissing"))),null):(this.validationService.showError(new Error(this.i18nService.t("deviceIdMissing"))),null)}).filter(e=>null!==e).sort(Go)}upsertDeviceWithPendingAuthRequest(e){return Bo(this,void 0,void 0,function*(){const t=yield this.authRequestApiService.getAuthRequest(e);if(!t)return;const i={creationDate:"",displayName:this.devicesService.getReadableDeviceTypeName(t.requestDeviceTypeValue),firstLogin:new Date(t.creationDate),icon:this.getDeviceIcon(t.requestDeviceTypeValue),id:"",identifier:t.requestDeviceIdentifier,isCurrentDevice:!1,isTrusted:!1,loginStatus:this.i18nService.t("requestPending"),pendingAuthRequest:{id:t.id,creationDate:t.creationDate}};if(t.requestDeviceIdentifier){const e=yield(0,u._)(this.devicesService.getDeviceByIdentifier$(t.requestDeviceIdentifier));(null==e?void 0:e.id)&&e.creationDate&&(i.creationDate=e.creationDate,i.firstLogin=new Date(e.creationDate),i.id=e.id)}const n=this.devices.findIndex(e=>e.identifier===i.identifier);n>=0?(this.devices[n]=i,this.devices=[...this.devices].sort(Go)):this.devices=[i,...this.devices].sort(Go)})}getLoginStatus(e,t){return this.isCurrentDevice(e,t)?this.i18nService.t("currentSession"):this.hasPendingAuthRequest(e)?this.i18nService.t("requestPending"):""}isCurrentDevice(e,t){return e.id===t.id}hasPendingAuthRequest(e){var t;return null!=(null===(t=e.response)||void 0===t?void 0:t.devicePendingAuthRequest)}getDeviceIcon(e){var t;const i="bwi bwi-desktop",n=pe.mz[e];return n&&null!==(t={webApp:"bwi bwi-browser",desktop:"bwi bwi-desktop",mobile:"bwi bwi-mobile",cli:"bwi bwi-cli",extension:"bwi bwi-puzzle",sdk:"bwi bwi-desktop"}[n.category])&&void 0!==t?t:i}handleAuthRequestAnswered(e){return Bo(this,void 0,void 0,function*(){const t=ho.open(this.dialogService,{notificationId:e.id}),i=yield(0,u._)(t.closed);void 0!==i&&"boolean"==typeof i&&(this.devices=function(e,t){return e.map(e=>{var i;return(null===(i=e.pendingAuthRequest)||void 0===i?void 0:i.id)===t.id&&(e.pendingAuthRequest=null,e.loginStatus=""),e}).sort(Go)}(this.devices,e),yield this.pendingAuthRequestStateService.clear(yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6))))})}}qo.ɵfac=function(e){return new(e||qo)(k.rXU(L.Di),k.rXU(f.d8),k.rXU(C.abz),k.rXU(jo.W),k.rXU(ro.L),k.rXU(E.o3),k.rXU(j.W),k.rXU(to.qk),k.rXU(eo.O),k.rXU(Se.B))},qo.ɵcmp=k.VBU({type:qo,selectors:[["auth-device-management"]],decls:3,vars:2,consts:[["infoPopover",""],["class","tw-mt-6 tw-mb-2 tw-pb-2.5",4,"ngIf"],[1,"tw-flex","tw-justify-center","tw-items-center","tw-p-4"],[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-flex","tw-items-center","tw-gap-2","tw-mb-5"],[1,"tw-m-0"],["type","button","position","right-start",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-flex","tw-items-center","tw-size-4",3,"bitPopoverTriggerFor"],["aria-hidden","true",1,"bwi","bwi-question-circle"],[3,"title"],[1,"tw-mb-0"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-2xl"],["ngClass","tw-hidden md:tw-block",3,"onAuthRequestAnswered","devices"],["ngClass","md:tw-hidden",3,"onAuthRequestAnswered","devices"]],template:function(e,t){1&e&&(k.DNE(0,zo,16,13,"div",1),k.nVh(1,Lo,2,0,"div",2)(2,Ko,2,2)),2&e&&(k.Y8G("ngIf",t.showHeaderInfo),k.R7$(),k.vxM(t.initializing?1:2))},dependencies:[se.t,Y.MD,Y.YU,Y.bT,Co,Uo,io.k,No.r,Vo.k,je.$Z],encapsulation:2});class _o{}_o.ɵfac=function(e){return new(e||_o)},_o.ɵcmp=k.VBU({type:_o,selectors:[["ng-component"]],decls:5,vars:3,consts:[[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-max-w-lg"]],template:function(e,t){1&e&&(k.j41(0,"h2",0),k.EFF(1),k.nI1(2,"i18n"),k.k0s(),k.j41(3,"div",1),k.nrm(4,"bit-session-timeout-settings"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"sessionTimeoutHeader")))},dependencies:[_t.C7,re.p,ae.$],encapsulation:2,changeDetection:0});var Xo,Yo=i(43600),Ho=i(75441),Wo=i(38420),Jo=i(40640),Zo=i(7855),Qo=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ea(e,t){if(1&e){const e=k.RV6();k.qex(0)(1,11),k.j41(2,"app-user-verification",12),k.mxI("invalidSecretChange",function(t){C.eBV(e);const i=k.XpG();return k.DH7(i.invalidSecret,t)||(i.invalidSecret=t),C.Njj(t)}),k.k0s(),k.bVm()()}if(2&e){const e=k.XpG();k.R7$(2),k.R50("invalidSecret",e.invalidSecret)}}function ta(e,t){if(1&e&&(k.j41(0,"div",13)(1,"div",14),k.nrm(2,"bit-icon",15),k.k0s(),k.j41(3,"h3",16),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"p",17),k.EFF(7),k.nI1(8,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.R7$(2),k.Y8G("icon",e.Icons.TwoFactorAuthSecurityKeyIcon),k.R7$(2),k.JRh(k.bMT(5,3,"creatingPasskeyLoading")),k.R7$(3),k.JRh(k.bMT(8,5,"creatingPasskeyLoadingInfo"))}}function ia(e,t){if(1&e&&(k.j41(0,"div",13)(1,"div",14),k.nrm(2,"bit-icon",15),k.k0s(),k.j41(3,"h3",16),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"p",17),k.EFF(7),k.nI1(8,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.R7$(2),k.Y8G("icon",e.Icons.TwoFactorAuthSecurityKeyFailedIcon),k.R7$(2),k.JRh(k.bMT(5,3,"errorCreatingPasskey")),k.R7$(3),k.JRh(k.bMT(8,5,"errorCreatingPasskeyInfo"))}}function na(e,t){1&e&&(k.j41(0,"bit-form-control",22),k.nrm(1,"input",23),k.j41(2,"bit-label"),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"bit-hint"),k.EFF(6),k.nI1(7,"i18n"),k.k0s()()),2&e&&(k.R7$(3),k.JRh(k.bMT(4,2,"useForVaultEncryption")),k.R7$(3),k.JRh(k.bMT(7,4,"useForVaultEncryptionInfo")))}function ra(e,t){if(1&e&&(k.j41(0,"div",18)(1,"h3",16),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"p",17),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"bit-form-field",19)(8,"bit-label"),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.nrm(11,"input",20),k.j41(12,"bit-hint"),k.EFF(13),k.nI1(14,"i18n"),k.k0s()(),k.DNE(15,na,8,6,"bit-form-control",21),k.k0s()),2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,5,"passkeySuccessfullyCreated")),k.R7$(3),k.SpI(" ",k.bMT(6,7,"customPasskeyNameInfo")," "),k.R7$(4),k.JRh(k.bMT(10,9,"name")),k.R7$(4),k.JRh(k.brH(14,11,"charactersCurrentAndMaximum",e.formGroup.value.credentialNaming.name.length,e.NameMaxCharacters)),k.R7$(2),k.Y8G("ngIf",null==e.pendingCredential?null:e.pendingCredential.supportsPrf)}}function sa(e,t){1&e&&(k.qex(0),k.EFF(1),k.nI1(2,"i18n"),k.bVm()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"continue")," "))}function oa(e,t){1&e&&(k.qex(0),k.EFF(1),k.nI1(2,"i18n"),k.bVm()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"continue")," "))}function aa(e,t){1&e&&(k.qex(0),k.EFF(1),k.nI1(2,"i18n"),k.bVm()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"tryAgain")," "))}function la(e,t){if(1&e&&(k.qex(0),k.EFF(1),k.nI1(2,"async"),k.nI1(3,"i18n"),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.SpI(" ",k.bMT(3,3,k.bMT(2,1,e.hasPasskeys$)?"save":"enable")," ")}}!function(e){e[e.Success=0]="Success"}(Xo||(Xo={}));class ca{constructor(e,t,i,n,r,s,o){this.formBuilder=e,this.dialogRef=t,this.webauthnService=i,this.i18nService=n,this.logService=r,this.toastService=s,this.accountService=o,this.NameMaxCharacters=50,this.CreateCredentialDialogResult=Xo,this.Icons={TwoFactorAuthSecurityKeyIcon:ue.s,TwoFactorAuthSecurityKeyFailedIcon:he.f},this.currentStep="userVerification",this.invalidSecret=!1,this.formGroup=this.formBuilder.group({userVerification:this.formBuilder.group({secret:[null,a.k0.required]}),credentialNaming:this.formBuilder.group({name:["",a.k0.maxLength(50)],useForEncryption:[!0]})}),this.loading$=this.webauthnService.loading$,this.submit=()=>Qo(this,void 0,void 0,function*(){this.dialogRef.disableClose=!0;try{switch(this.currentStep){case"userVerification":return yield this.submitUserVerification();case"credentialCreationFailed":return yield this.submitCredentialCreationFailed();case"credentialCreation":return yield this.submitCredentialCreation();case"credentialNaming":return yield this.submitCredentialNaming()}}finally{this.dialogRef.disableClose=!1}})}ngOnInit(){this.hasPasskeys$=this.webauthnService.getCredentials$().pipe((0,m.T)(e=>e.length>0))}submitUserVerification(){return Qo(this,void 0,void 0,function*(){var e;if(this.formGroup.controls.userVerification.markAllAsTouched(),!this.formGroup.controls.userVerification.invalid){try{this.credentialOptions=yield this.webauthnService.getCredentialAttestationOptions(this.formGroup.value.userVerification.secret)}catch(t){return void(t instanceof me._&&400===t.statusCode?this.invalidSecret=!0:(null===(e=this.logService)||void 0===e||e.error(t),this.toastService.showToast({variant:"error",title:this.i18nService.t("unexpectedError"),message:t.message})))}this.currentStep="credentialCreation",yield this.submitCredentialCreation()}})}submitCredentialCreation(){return Qo(this,void 0,void 0,function*(){this.pendingCredential=yield this.webauthnService.createCredential(this.credentialOptions),void 0!==this.pendingCredential?this.currentStep="credentialNaming":this.currentStep="credentialCreationFailed"})}submitCredentialCreationFailed(){return Qo(this,void 0,void 0,function*(){this.currentStep="credentialCreation",yield this.submitCredentialCreation()})}submitCredentialNaming(){return Qo(this,void 0,void 0,function*(){var e;if(this.formGroup.controls.credentialNaming.markAllAsTouched(),this.formGroup.controls.credentialNaming.controls.name.invalid)return;const t=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));let i;if(this.pendingCredential.supportsPrf&&this.formGroup.value.credentialNaming.useForEncryption&&(i=yield this.webauthnService.createKeySet(this.pendingCredential,t),void 0===i))return void(null===(e=this.formGroup.controls.credentialNaming.controls.useForEncryption)||void 0===e||e.setErrors({error:{message:this.i18nService.t("useForVaultEncryptionErrorReadingPasskey")}}));const n=this.formGroup.value.credentialNaming.name;yield this.webauthnService.saveCredential(this.formGroup.value.credentialNaming.name,this.pendingCredential,i),(yield(0,u._)(this.hasPasskeys$))?this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("passkeySaved",n)}):this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("loginWithPasskeyEnabled")}),this.dialogRef.close(Xo.Success)})}}ca.ɵfac=function(e){return new(e||ca)(k.rXU(a.ok),k.rXU(E.ce),k.rXU(Wo.yB),k.rXU(j.W),k.rXU(ve.K),k.rXU($.f),k.rXU(L.Di))},ca.ɵcmp=k.VBU({type:ca,selectors:[["ng-component"]],standalone:!1,decls:23,vars:22,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["bitDialogContent",""],[4,"ngIf"],["class","tw-flex tw-flex-col tw-items-center",4,"ngIf"],["formGroupName","credentialNaming",4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],["formGroupName","userVerification"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"],[1,"tw-flex","tw-flex-col","tw-items-center"],[1,"tw-size-24","tw-content-center","tw-mb-6"],[3,"icon"],["bitTypography","h3"],["bitTypography","body1"],["formGroupName","credentialNaming"],[1,"!tw-mb-0"],["type","text","bitInput","","formControlName","name","appAutofocus",""],["class","!tw-mb-0 tw-mt-6",4,"ngIf"],[1,"!tw-mb-0","tw-mt-6"],["type","checkbox","bitCheckbox","","formControlName","useForEncryption"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1),k.nI1(2,"async"),k.j41(3,"span",2),k.EFF(4),k.nI1(5,"i18n"),k.j41(6,"span",3),k.EFF(7),k.nI1(8,"i18n"),k.k0s()(),k.qex(9,4),k.DNE(10,ea,3,1,"ng-container",5)(11,ta,9,7,"div",6)(12,ia,9,7,"div",6)(13,ra,16,15,"div",7),k.bVm(),k.qex(14,8),k.j41(15,"button",9),k.DNE(16,sa,3,3,"ng-container",5)(17,oa,3,3,"ng-container",5)(18,aa,3,3,"ng-container",5)(19,la,4,5,"ng-container",5),k.k0s(),k.j41(20,"button",10),k.EFF(21),k.nI1(22,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),k.R7$(),k.Y8G("loading",k.bMT(2,14,t.loading$)),k.R7$(3),k.SpI("",k.bMT(5,16,"logInWithPasskey")," "),k.R7$(3),k.JRh(k.bMT(8,18,"newPasskey")),k.R7$(3),k.Y8G("ngIf","userVerification"===t.currentStep),k.R7$(),k.Y8G("ngIf","credentialCreation"===t.currentStep),k.R7$(),k.Y8G("ngIf","credentialCreationFailed"===t.currentStep),k.R7$(),k.Y8G("ngIf","credentialNaming"===t.currentStep),k.R7$(3),k.Y8G("ngIf","userVerification"===t.currentStep),k.R7$(),k.Y8G("ngIf","credentialCreation"===t.currentStep),k.R7$(),k.Y8G("ngIf","credentialCreationFailed"===t.currentStep),k.R7$(),k.Y8G("ngIf","credentialNaming"===t.currentStep),k.R7$(2),k.SpI(" ",k.bMT(22,20,"cancel")," "))},dependencies:[Y.bT,a.qT,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,a.$R,qi.B,gi.$,yi.L,oe.Q,Cr.P,fn.I,gn.m,Tr.f,bi.j,$r.I,Xi.J,wi.h,Ct.i,Ce.r,Zo.q,Y.Jj,ae.$],encapsulation:2});var da=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ua(e,t){if(1&e&&(k.j41(0,"span",9),k.EFF(1),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.JRh(e.credential.name)}}function ha(e,t){1&e&&(k.qex(0),k.nrm(1,"i",10),k.bVm())}function pa(e,t){if(1&e){const e=k.RV6();k.qex(0),k.j41(1,"p",11),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"app-user-verification",12),k.mxI("invalidSecretChange",function(t){C.eBV(e);const i=k.XpG();return k.DH7(i.invalidSecret,t)||(i.invalidSecret=t),C.Njj(t)}),k.k0s(),k.bVm()}if(2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,2,"removePasskeyInfo")),k.R7$(2),k.R50("invalidSecret",e.invalidSecret)}}class ma{constructor(e,t,i,n,r,s,o,a){this.params=e,this.formBuilder=t,this.dialogRef=i,this.webauthnService=n,this.platformUtilsService=r,this.i18nService=s,this.logService=o,this.toastService=a,this.destroy$=new d.B,this.invalidSecret=!1,this.formGroup=this.formBuilder.group({secret:null}),this.loading$=this.webauthnService.loading$,this.submit=()=>da(this,void 0,void 0,function*(){var e;if(void 0!==this.credential){this.dialogRef.disableClose=!0;try{yield this.webauthnService.deleteCredential(this.credential.id,this.formGroup.value.secret),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("passkeyRemoved")})}catch(t){return t instanceof me._&&400===t.statusCode?this.invalidSecret=!0:(null===(e=this.logService)||void 0===e||e.error(t),this.toastService.showToast({variant:"error",title:this.i18nService.t("unexpectedError"),message:t.message})),!1}finally{this.dialogRef.disableClose=!1}this.dialogRef.close()}})}ngOnInit(){this.webauthnService.getCredential$(this.params.credentialId).pipe((0,li.Q)(this.destroy$)).subscribe(e=>this.credential=e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}ma.ɵfac=function(e){return new(e||ma)(k.rXU(xn.Qs),k.rXU(a.ok),k.rXU(E.ce),k.rXU(Wo.yB),k.rXU(N.y),k.rXU(j.W),k.rXU(ve.K),k.rXU($.f))},ma.ɵcmp=k.VBU({type:ma,selectors:[["ng-component"]],standalone:!1,decls:17,vars:17,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],["class","tw-text-sm tw-normal-case tw-text-muted",4,"ngIf"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","danger"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-ml-1"],["bitTypography","body1"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1),k.nI1(2,"async"),k.j41(3,"span",2),k.EFF(4),k.nI1(5,"i18n"),k.DNE(6,ua,2,1,"span",3),k.k0s(),k.qex(7,4),k.DNE(8,ha,2,0,"ng-container",5)(9,pa,5,4,"ng-container",5),k.bVm(),k.qex(10,6),k.j41(11,"button",7),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.j41(14,"button",8),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),k.R7$(),k.Y8G("loading",k.bMT(2,9,t.loading$)),k.R7$(3),k.SpI("",k.bMT(5,11,"removePasskey")," "),k.R7$(2),k.Y8G("ngIf",t.credential),k.R7$(2),k.Y8G("ngIf",!t.credential),k.R7$(),k.Y8G("ngIf",t.credential),k.R7$(3),k.SpI(" ",k.bMT(13,13,"remove")," "),k.R7$(3),k.SpI(" ",k.bMT(16,15,"cancel")," "))},dependencies:[Y.bT,a.qT,a.BC,a.cb,a.j4,a.JD,gi.$,yi.L,oe.Q,fn.I,gn.m,Ce.r,Zo.q,Y.Jj,ae.$],encapsulation:2});var va=i(29096),fa=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function ga(e,t){if(1&e&&(k.j41(0,"span",9),k.EFF(1),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.JRh(e.credential.name)}}function ya(e,t){1&e&&(k.qex(0),k.nrm(1,"i",10),k.bVm())}function ba(e,t){if(1&e){const e=k.RV6();k.qex(0),k.j41(1,"p",11),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.qex(4,12),k.j41(5,"app-user-verification",13),k.mxI("invalidSecretChange",function(t){C.eBV(e);const i=k.XpG();return k.DH7(i.invalidSecret,t)||(i.invalidSecret=t),C.Njj(t)}),k.k0s(),k.bVm()()}if(2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,2,"useForVaultEncryptionInfo")),k.R7$(3),k.R50("invalidSecret",e.invalidSecret)}}class wa{constructor(e,t,i,n,r,s){this.params=e,this.formBuilder=t,this.dialogRef=i,this.webauthnService=n,this.webauthnLoginService=r,this.accountService=s,this.destroy$=new d.B,this.invalidSecret=!1,this.formGroup=this.formBuilder.group({userVerification:this.formBuilder.group({secret:[null,a.k0.required]})}),this.loading$=this.webauthnService.loading$,this.submit=()=>fa(this,void 0,void 0,function*(){if(void 0===this.credential)return;const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));this.dialogRef.disableClose=!0;try{this.credentialOptions=yield this.webauthnService.getCredentialAssertOptions(this.formGroup.value.userVerification.secret),yield this.webauthnService.enableCredentialEncryption(yield this.webauthnLoginService.assertCredential(this.credentialOptions),e)}catch(t){throw t instanceof me._&&400===t.statusCode&&(this.invalidSecret=!0),t}this.dialogRef.close()})}ngOnInit(){this.webauthnService.getCredential$(this.params.credentialId).pipe((0,li.Q)(this.destroy$)).subscribe(e=>this.credential=e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}wa.ɵfac=function(e){return new(e||wa)(k.rXU(xn.Qs),k.rXU(a.ok),k.rXU(E.ce),k.rXU(va.y),k.rXU(we.t),k.rXU(L.Di))},wa.ɵcmp=k.VBU({type:wa,selectors:[["ng-component"]],standalone:!1,decls:17,vars:17,consts:[[3,"formGroup","bitSubmit"],["dialogSize","large",3,"loading"],["bitDialogTitle",""],["class","tw-text-sm tw-normal-case tw-text-muted",4,"ngIf"],["bitDialogContent",""],[4,"ngIf"],["bitDialogFooter",""],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["type","button","bitButton","","bitFormButton","","buttonType","secondary","bitDialogClose",""],[1,"tw-text-sm","tw-normal-case","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-ml-1"],["bitTypography","body1"],["formGroupName","userVerification"],["formControlName","secret",3,"invalidSecretChange","invalidSecret"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1),k.nI1(2,"async"),k.j41(3,"span",2),k.EFF(4),k.nI1(5,"i18n"),k.DNE(6,ga,2,1,"span",3),k.k0s(),k.qex(7,4),k.DNE(8,ya,2,0,"ng-container",5)(9,ba,6,4,"ng-container",5),k.bVm(),k.qex(10,6),k.j41(11,"button",7),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.j41(14,"button",8),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),k.R7$(),k.Y8G("loading",k.bMT(2,9,t.loading$)),k.R7$(3),k.SpI("",k.bMT(5,11,"enablePasskeyEncryption")," "),k.R7$(2),k.Y8G("ngIf",t.credential),k.R7$(2),k.Y8G("ngIf",!t.credential),k.R7$(),k.Y8G("ngIf",t.credential),k.R7$(3),k.SpI(" ",k.bMT(13,13,"submit")," "),k.R7$(3),k.SpI(" ",k.bMT(16,15,"cancel")," "))},dependencies:[Y.bT,a.qT,a.BC,a.cb,a.j4,a.JD,a.$R,gi.$,yi.L,oe.Q,fn.I,gn.m,Ce.r,Zo.q,Y.Jj,ae.$],encapsulation:2});function Sa(e,t){1&e&&(k.j41(0,"span",8),k.EFF(1),k.nI1(2,"i18n"),k.nI1(3,"i18n"),k.k0s()),2&e&&(k.R7$(),k.Lme(" ",k.bMT(2,2,"off")," - ",k.bMT(3,4,"ssoLoginIsRequired")," "))}function Ia(e,t){1&e&&(k.j41(0,"span",11),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"on")," "))}function ka(e,t){1&e&&(k.j41(0,"span",12),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"off")," "))}function Ca(e,t){if(1&e&&(k.qex(0),k.DNE(1,Ia,3,3,"span",9)(2,ka,3,3,"span",10),k.bVm()),2&e){const e=k.XpG(2);k.R7$(),k.Y8G("ngIf",e.hasCredentials),k.R7$(),k.Y8G("ngIf",!e.hasCredentials)}}function Ta(e,t){if(1&e&&(k.qex(0),k.DNE(1,Sa,4,6,"span",7)(2,Ca,3,2,"ng-container",2),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",e.requireSsoPolicyEnabled),k.R7$(),k.Y8G("ngIf",!e.requireSsoPolicyEnabled)}}function Fa(e,t){1&e&&(k.qex(0),k.nrm(1,"i",13),k.bVm())}function Ra(e,t){1&e&&(k.qex(0),k.nrm(1,"i",21),k.j41(2,"span",22),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(3),k.JRh(k.bMT(4,1,"usedForEncryption")))}function Pa(e,t){if(1&e){const e=k.RV6();k.qex(0),k.j41(1,"button",20),k.nI1(2,"i18n"),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(2);return C.Njj(i.enableEncryption(t.id))}),k.nrm(3,"i",21),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()}if(2&e){const e=k.XpG().$implicit,t=k.XpG(2);k.R7$(),k.Y8G("disabled",t.loading),k.BMQ("aria-label",k.bMT(2,3,"enablePasskeyEncryption")+" "+e.name),k.R7$(3),k.SpI(" ",k.bMT(5,5,"enablePasskeyEncryption")," ")}}function xa(e,t){1&e&&(k.j41(0,"span",22),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"encryptionNotSupported")," "))}function $a(e,t){if(1&e){const e=k.RV6();k.j41(0,"tr")(1,"td",16),k.EFF(2),k.k0s(),k.j41(3,"td",17),k.DNE(4,Ra,5,3,"ng-container",2)(5,Pa,6,7,"ng-container",2)(6,xa,3,3,"span",18),k.k0s(),k.j41(7,"td",19)(8,"button",20),k.nI1(9,"i18n"),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(2);return C.Njj(i.deleteCredential(t.id))}),k.EFF(10),k.nI1(11,"i18n"),k.k0s()()()}if(2&e){const e=t.$implicit,i=k.XpG(2);k.R7$(2),k.JRh(e.name),k.R7$(2),k.Y8G("ngIf",e.prfStatus===i.WebauthnLoginCredentialPrfStatus.Enabled),k.R7$(),k.Y8G("ngIf",e.prfStatus===i.WebauthnLoginCredentialPrfStatus.Supported),k.R7$(),k.Y8G("ngIf",e.prfStatus===i.WebauthnLoginCredentialPrfStatus.Unsupported),k.R7$(2),k.Y8G("disabled",i.loading),k.BMQ("aria-label",k.bMT(9,7,"remove")+" "+e.name),k.R7$(2),k.SpI(" ",k.bMT(11,9,"remove")," ")}}function Ea(e,t){if(1&e&&(k.j41(0,"table",14),k.DNE(1,$a,12,11,"tr",15),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngForOf",e.credentials)}}function Aa(e,t){1&e&&(k.j41(0,"p",23),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"passkeyLimitReachedInfo")))}function Da(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",25),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.createCredential())}),k.EFF(1),k.nI1(2,"i18n"),k.k0s()}if(2&e){const e=k.XpG(2);k.Y8G("disabled",e.loading),k.R7$(),k.SpI(" ",k.bMT(2,2,"newPasskey")," ")}}function Oa(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",25),k.nI1(1,"i18n"),k.nI1(2,"i18n"),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.createCredential())}),k.EFF(3),k.nI1(4,"i18n"),k.k0s()}if(2&e){const e=k.XpG(2);k.Y8G("disabled",e.loading),k.BMQ("aria-label",k.bMT(1,3,"enable")+" "+k.bMT(2,5,"logInWithPasskey")),k.R7$(3),k.SpI(" ",k.bMT(4,7,"enable")," ")}}function Ma(e,t){if(1&e&&(k.qex(0),k.DNE(1,Da,3,4,"button",24)(2,Oa,5,9,"button",24),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",e.hasCredentials),k.R7$(),k.Y8G("ngIf",!e.hasCredentials)}}class Ua{constructor(e,t,i,n){this.webauthnService=e,this.dialogService=t,this.policyService=i,this.accountService=n,this.destroy$=new d.B,this.MaxCredentialCount=Wo.yB.MaxCredentialCount,this.WebauthnLoginCredentialPrfStatus=Jo.j,this.loading=!0,this.requireSsoPolicyEnabled=!1}ngOnInit(){this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policyAppliesToUser$(ci.tt.RequireSso,e)),(0,li.Q)(this.destroy$)).subscribe(e=>{this.requireSsoPolicyEnabled=e}),this.webauthnService.getCredentials$().pipe((0,li.Q)(this.destroy$)).subscribe(e=>this.credentials=e),this.webauthnService.loading$.pipe((0,li.Q)(this.destroy$)).subscribe(e=>this.loading=e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}get ariaBusy(){return this.loading?"true":"false"}get hasCredentials(){var e,t;return(null!==(t=null===(e=this.credentials)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>0}get hasData(){return void 0!==this.credentials}get limitReached(){var e,t;return(null!==(t=null===(e=this.credentials)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>=this.MaxCredentialCount}createCredential(){var e,t;e=this.dialogService,t={},e.open(ca,t)}deleteCredential(e){var t,i;t=this.dialogService,i={data:{credentialId:e}},t.open(ma,i)}enableEncryption(e){var t,i;t=this.dialogService,i={data:{credentialId:e}},t.open(wa,i)}}Ua.ɵfac=function(e){return new(e||Ua)(k.rXU(Wo.yB),k.rXU(E.o3),k.rXU(Le.m),k.rXU(L.Di))},Ua.ɵcmp=k.VBU({type:Ua,selectors:[["app-webauthn-login-settings"]],hostAttrs:["aria-live","polite"],hostVars:1,hostBindings:function(e,t){2&e&&k.BMQ("aria-busy",t.ariaBusy)},standalone:!1,decls:15,vars:14,consts:[["bitTypography","h2"],[1,"tw-inline-flex","tw-gap-1","tw-align-middle"],[4,"ngIf"],["bitTypography","body1"],["bitLink","","href","https://bitwarden.com/help/login-with-passkeys"],["class","tw-mb-5",4,"ngIf"],["bitTypography","body2",4,"ngIf"],["bitBadge","","variant","secondary","class","tw-max-w-full !tw-align-middle",4,"ngIf"],["bitBadge","","variant","secondary",1,"tw-max-w-full","!tw-align-middle"],["bitBadge","","variant","success","class","!tw-align-middle",4,"ngIf"],["bitBadge","","variant","secondary","class","!tw-align-middle",4,"ngIf"],["bitBadge","","variant","success",1,"!tw-align-middle"],["bitBadge","","variant","secondary",1,"!tw-align-middle"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-ml-1"],[1,"tw-mb-5"],[4,"ngFor","ngForOf"],[1,"tw-p-2","tw-pl-0","tw-font-medium"],[1,"tw-p-2","tw-pr-10","tw-text-left"],["bitTypography","body1","class","tw-text-muted",4,"ngIf"],[1,"tw-py-2"],["type","button","bitLink","",3,"click","disabled"],[1,"bwi","bwi-lock-encrypted"],["bitTypography","body1",1,"tw-text-muted"],["bitTypography","body2"],["type","button","bitButton","",3,"disabled","click",4,"ngIf"],["type","button","bitButton","",3,"click","disabled"]],template:function(e,t){1&e&&(k.j41(0,"h2",0),k.EFF(1),k.nI1(2,"i18n"),k.j41(3,"span",1),k.DNE(4,Ta,3,2,"ng-container",2),k.k0s(),k.DNE(5,Fa,2,0,"ng-container",2),k.k0s(),k.j41(6,"p",3),k.EFF(7),k.nI1(8,"i18n"),k.j41(9,"a",4),k.EFF(10),k.nI1(11,"i18n"),k.k0s()(),k.DNE(12,Ea,2,1,"table",5)(13,Aa,3,3,"p",6)(14,Ma,3,2,"ng-container",2)),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,8,"logInWithPasskey")," "),k.R7$(3),k.Y8G("ngIf",t.hasData),k.R7$(),k.Y8G("ngIf",t.loading),k.R7$(2),k.SpI(" ",k.bMT(8,10,"loginWithPasskeyInfo")," "),k.R7$(3),k.JRh(k.bMT(11,12,"learnMoreAboutPasswordless")),k.R7$(2),k.Y8G("ngIf",t.hasCredentials),k.R7$(),k.Y8G("ngIf",t.limitReached),k.R7$(),k.Y8G("ngIf",t.hasData&&!t.limitReached&&!t.requireSsoPolicyEnabled))},dependencies:[Y.Sq,Y.bT,Yr.n,oe.Q,ke.L,ke.o,Ce.r,ae.$],encapsulation:2});var Ga=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ja{constructor(e,t,i){this.router=e,this.userDecryptionOptionsService=t,this.accountService=i,this.inputPasswordFlow=Ae.m5.ChangePasswordWithOptionalUserKeyRotation,this.changePasswordFeatureFlag=!1}ngOnInit(){return Ga(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));(yield(0,u._)(this.userDecryptionOptionsService.hasMasterPasswordById$(e)))||(yield this.router.navigate(["/settings/security/two-factor"]))})}}ja.ɵfac=function(e){return new(e||ja)(k.rXU(x.Ix),k.rXU(f.Ym),k.rXU(L.Di))},ja.ɵcmp=k.VBU({type:ja,selectors:[["app-password-settings"]],decls:6,vars:4,consts:[[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-max-w-lg","tw-mb-12"],[3,"inputPasswordFlow"]],template:function(e,t){1&e&&(k.j41(0,"h1",0),k.EFF(1),k.nI1(2,"i18n"),k.k0s(),k.j41(3,"div",1),k.nrm(4,"auth-change-password",2),k.k0s(),k.nrm(5,"app-webauthn-login-settings")),2&e&&(k.R7$(),k.JRh(k.bMT(2,2,"changeMasterPassword")),k.R7$(3),k.Y8G("inputPasswordFlow",t.inputPasswordFlow))},dependencies:[er.j,xe.h5,Ho.L,Ua,je.$Z],encapsulation:2});class Na{}Na.ɵfac=function(e){return new(e||Na)},Na.ɵmod=k.$C({type:Na}),Na.ɵinj=C.G2t({imports:[Y.MD,mi.G,io.k]});var Va=i(50342),Ba=i(16992),za=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function La(e,t){1&e&&(k.j41(0,"bit-callout",3),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"kdfSettingsChangeLogoutWarning")))}class Ka{constructor(e,t,i,n,r,s,o,l){this.i18nService=e,this.messagingService=t,this.accountService=n,this.toastService=r,this.changeKdfService=s,this.dialogRef=o,this.form=new a.gE({masterPassword:new a.MJ(null,a.k0.required)}),this.showPassword=!1,this.loading=!1,this.submit=()=>za(this,void 0,void 0,function*(){this.form.invalid||(this.loading=!0,yield this.makeKeyAndSave(),(yield(0,u._)(this.noLogoutOnKdfChangeFeatureFlag$))?(this.toastService.showToast({variant:"success",message:this.i18nService.t("encKeySettingsChanged")}),this.dialogRef.close()):(this.toastService.showToast({variant:"success",title:this.i18nService.t("encKeySettingsChanged"),message:this.i18nService.t("logBackIn")}),this.messagingService.send("logout")),this.loading=!1)}),this.kdfConfig=i.kdfConfig,this.noLogoutOnKdfChangeFeatureFlag$=l.getFeatureFlag$(M.TO.NoLogoutOnKdfChange)}makeKeyAndSave(){return za(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),t=this.form.value.masterPassword;this.kdfConfig.validateKdfConfigForSetting(),yield this.changeKdfService.updateUserKdfParams(t,this.kdfConfig,e)})}}Ka.ɵfac=function(e){return new(e||Ka)(k.rXU(j.W),k.rXU(fe.U),k.rXU(xn.Qs),k.rXU(L.Di),k.rXU($.f),k.rXU(Ba.J),k.rXU(E.ce),k.rXU(U.w))},Ka.ɵcmp=k.VBU({type:Ka,selectors:[["app-change-kdf-confirmation"]],standalone:!1,decls:25,vars:21,consts:[["autocomplete","off",3,"formGroup","bitSubmit"],["bitDialogTitle",""],["bitDialogContent",""],["type","warning"],["disableMargin",""],["bitInput","","type","password","formControlName","masterPassword","appAutofocus",""],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",3,"toggledChange","toggled"],["bitDialogFooter",""],["bitButton","","buttonType","primary","type","submit","bitFormButton",""],["bitButton","","buttonType","secondary","type","button","bitFormButton","","bitDialogClose",""]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog")(2,"span",1),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"span",2),k.nVh(6,La,3,3,"bit-callout",3),k.nI1(7,"async"),k.j41(8,"bit-form-field",4)(9,"bit-label"),k.EFF(10),k.nI1(11,"i18n"),k.k0s(),k.nrm(12,"input",5),k.j41(13,"button",6),k.mxI("toggledChange",function(e){return k.DH7(t.showPassword,e)||(t.showPassword=e),e}),k.k0s(),k.j41(14,"bit-hint"),k.EFF(15),k.nI1(16,"i18n"),k.k0s()()(),k.qex(17,7),k.j41(18,"button",8)(19,"span"),k.EFF(20),k.nI1(21,"i18n"),k.k0s()(),k.j41(22,"button",9),k.EFF(23),k.nI1(24,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.form)("bitSubmit",t.submit),k.R7$(3),k.SpI(" ",k.bMT(4,9,"updateYourEncryptionSettings")," "),k.R7$(3),k.vxM(k.bMT(7,11,t.noLogoutOnKdfChangeFeatureFlag$)?-1:6),k.R7$(4),k.JRh(k.bMT(11,13,"masterPass")),k.R7$(3),k.R50("toggled",t.showPassword),k.R7$(2),k.SpI(" ",k.bMT(16,15,"confirmIdentity")," "),k.R7$(5),k.JRh(k.bMT(21,17,"updateSettings")),k.R7$(3),k.SpI(" ",k.bMT(24,19,"cancel")," "))},dependencies:[a.qT,a.me,a.BC,a.cb,a.j4,a.JD,qi.B,gi.$,yi.L,oe.Q,Ge.G,fn.I,gn.m,bi.j,$r.I,Xi.J,wi.h,on.e,an.a,ln.s,Y.Jj,ae.$],encapsulation:2});var qa=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function _a(e,t){1&e&&(k.j41(0,"bit-callout",2),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"kdfSettingsChangeLogoutWarning")))}function Xa(e,t){if(1&e&&k.nrm(0,"bit-option",20),2&e){const e=t.$implicit;k.Y8G("value",e.value)("label",e.name)}}function Ya(e,t){if(1&e&&(k.j41(0,"bit-form-field",12)(1,"bit-label"),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.nrm(4,"input",21),k.j41(5,"bit-hint"),k.EFF(6),k.nI1(7,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.R7$(2),k.SpI(" ",k.bMT(3,4,"kdfIterations")," "),k.R7$(2),k.Y8G("min",e.PBKDF2_ITERATIONS.min)("max",e.PBKDF2_ITERATIONS.max),k.R7$(2),k.JRh(k.bMT(7,6,"kdfIterationRecommends"))}}function Ha(e,t){if(1&e&&(k.j41(0,"bit-form-field",12)(1,"bit-label"),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.nrm(4,"input",22),k.k0s()),2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,3,"kdfMemory")),k.R7$(2),k.Y8G("min",e.ARGON2_MEMORY.min)("max",e.ARGON2_MEMORY.max)}}function Wa(e,t){if(1&e&&(k.j41(0,"div",7)(1,"bit-form-field",12)(2,"bit-label"),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.nrm(5,"input",21),k.k0s()(),k.j41(6,"div",7)(7,"bit-form-field",12)(8,"bit-label"),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.nrm(11,"input",23),k.k0s()()),2&e){const e=k.XpG();k.R7$(3),k.SpI(" ",k.bMT(4,6,"kdfIterations")," "),k.R7$(2),k.Y8G("min",e.ARGON2_ITERATIONS.min)("max",e.ARGON2_ITERATIONS.max),k.R7$(4),k.SpI(" ",k.bMT(10,8,"kdfParallelism")," "),k.R7$(2),k.Y8G("min",e.ARGON2_PARALLELISM.min)("max",e.ARGON2_PARALLELISM.max)}}class Ja{constructor(e,t,i,n,r){this.dialogService=e,this.kdfConfigService=t,this.accountService=i,this.formBuilder=n,this.kdfConfig=I.fX,this.kdfOptions=[],this.destroy$=new d.B,this.formGroup=this.formBuilder.group({kdf:new a.MJ(I.ao.PBKDF2_SHA256,[a.k0.required]),kdfConfig:this.formBuilder.group({iterations:new a.MJ(null),memory:new a.MJ(null),parallelism:new a.MJ(null)})}),this.PBKDF2_ITERATIONS=I.n1.ITERATIONS,this.ARGON2_ITERATIONS=I.hU.ITERATIONS,this.ARGON2_MEMORY=I.hU.MEMORY,this.ARGON2_PARALLELISM=I.hU.PARALLELISM,this.kdfOptions=[{name:"PBKDF2 SHA-256",value:I.ao.PBKDF2_SHA256},{name:"Argon2id",value:I.ao.Argon2id}],this.noLogoutOnKdfChangeFeatureFlag$=r.getFeatureFlag$(M.TO.NoLogoutOnKdfChange)}ngOnInit(){return qa(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));this.kdfConfig=yield this.kdfConfigService.getKdfConfig(e),this.formGroup.controls.kdf.setValue(this.kdfConfig.kdfType),this.setFormControlValues(this.kdfConfig),this.setFormValidators(this.kdfConfig.kdfType),this.formGroup.controls.kdf.valueChanges.pipe((0,li.Q)(this.destroy$)).subscribe(e=>{this.updateKdfConfig(e)})})}updateKdfConfig(e){let t;switch(e){case I.ao.PBKDF2_SHA256:t=new I.n1;break;case I.ao.Argon2id:t=new I.hU;break;default:throw new Error("Unknown KDF type.")}this.kdfConfig=t,this.setFormValidators(e),this.setFormControlValues(this.kdfConfig)}setFormValidators(e){const t=this.formGroup.controls.kdfConfig;switch(e){case I.ao.PBKDF2_SHA256:t.controls.iterations.setValidators([a.k0.required,a.k0.min(I.n1.ITERATIONS.min),a.k0.max(I.n1.ITERATIONS.max)]),t.controls.memory.setValidators([]),t.controls.parallelism.setValidators([]);break;case I.ao.Argon2id:t.controls.iterations.setValidators([a.k0.required,a.k0.min(I.hU.ITERATIONS.min),a.k0.max(I.hU.ITERATIONS.max)]),t.controls.memory.setValidators([a.k0.required,a.k0.min(I.hU.MEMORY.min),a.k0.max(I.hU.MEMORY.max)]),t.controls.parallelism.setValidators([a.k0.required,a.k0.min(I.hU.PARALLELISM.min),a.k0.max(I.hU.PARALLELISM.max)]);break;default:throw new Error("Unknown KDF type.")}t.controls.iterations.updateValueAndValidity(),t.controls.memory.updateValueAndValidity(),t.controls.parallelism.updateValueAndValidity()}setFormControlValues(e){const t=this.formGroup.controls.kdfConfig;t.reset(),e.kdfType===I.ao.PBKDF2_SHA256?t.controls.iterations.setValue(e.iterations):e.kdfType===I.ao.Argon2id&&(t.controls.iterations.setValue(e.iterations),t.controls.memory.setValue(e.memory),t.controls.parallelism.setValue(e.parallelism))}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}isPBKDF2(e){return e instanceof I.n1}isArgon2(e){return e instanceof I.hU}openConfirmationModal(){return qa(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=this.formGroup.controls.kdfConfig;this.kdfConfig.kdfType===I.ao.PBKDF2_SHA256?this.kdfConfig.iterations=e.controls.iterations.value:this.kdfConfig.kdfType===I.ao.Argon2id&&(this.kdfConfig.iterations=e.controls.iterations.value,this.kdfConfig.memory=e.controls.memory.value,this.kdfConfig.parallelism=e.controls.parallelism.value),this.dialogService.open(Ka,{data:{kdfConfig:this.kdfConfig}})})}}Ja.ɵfac=function(e){return new(e||Ja)(k.rXU(E.o3),k.rXU(I.zZ),k.rXU(L.Di),k.rXU(a.ok),k.rXU(U.w))},Ja.ɵcmp=k.VBU({type:Ja,selectors:[["app-change-kdf"]],standalone:!1,decls:46,vars:43,consts:[["algorithmPopover",""],["bitTypography","h2",1,"tw-mt-6"],["type","warning"],["bitTypography","body1",1,"tw-mt-4"],["bitTypography","body1"],["autocomplete","off",3,"formGroup"],[1,"tw-grid","tw-grid-cols-12","tw-gap-x-4"],[1,"tw-col-span-6"],["type","button","bitLink","",1,"tw-border-none","tw-bg-transparent","tw-text-primary-600","tw-p-0",3,"bitPopoverTriggerFor","appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["formControlName","kdf"],[3,"value","label",4,"ngFor","ngForOf"],["formGroupName","kdfConfig"],["type","button","buttonType","primary","bitButton","","bitFormButton","",1,"tw-mt-2",3,"click"],[3,"title"],[1,"tw-mt-2","tw-mb-0","tw-ps-4"],[1,"tw-mb-2"],[1,"tw-mt-4","tw-mb-1"],["href","https://bitwarden.com/help/kdf-algorithms/","bitLink","","target","_blank","rel","noreferrer",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-1"],[3,"value","label"],["bitInput","","type","number","formControlName","iterations",3,"min","max"],["bitInput","","formControlName","memory","type","number",3,"min","max"],["bitInput","","type","number","formControlName","parallelism",3,"min","max"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"h2",1),k.EFF(1),k.nI1(2,"i18n"),k.k0s(),k.nVh(3,_a,3,3,"bit-callout",2),k.nI1(4,"async"),k.j41(5,"p",3),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"p",4),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.j41(11,"form",5)(12,"div",6)(13,"div",7)(14,"bit-form-field")(15,"bit-label"),k.EFF(16),k.nI1(17,"i18n"),k.j41(18,"button",8),k.nI1(19,"i18n"),k.nrm(20,"i",9),k.k0s()(),k.j41(21,"bit-select",10),k.DNE(22,Xa,1,2,"bit-option",11),k.k0s()()(),k.j41(23,"div",7),k.nVh(24,Ya,8,8,"bit-form-field",12)(25,Ha,5,5,"bit-form-field",12),k.k0s(),k.nVh(26,Wa,12,10),k.k0s(),k.j41(27,"button",13),k.bIt("click",function(){return C.eBV(e),C.Njj(t.openConfirmationModal())}),k.EFF(28),k.nI1(29,"i18n"),k.k0s()(),k.j41(30,"bit-popover",14,0),k.nI1(32,"i18n"),k.j41(33,"ul",15)(34,"li",16),k.EFF(35),k.nI1(36,"i18n"),k.k0s(),k.j41(37,"li"),k.EFF(38),k.nI1(39,"i18n"),k.k0s()(),k.j41(40,"div",17)(41,"a",18),k.nI1(42,"i18n"),k.EFF(43),k.nI1(44,"i18n"),k.nrm(45,"i",19),k.k0s()()()}if(2&e){const e=k.sdS(31);k.R7$(),k.SpI(" ",k.bMT(2,19,"encKeySettings"),"\n"),k.R7$(2),k.vxM(k.bMT(4,21,t.noLogoutOnKdfChangeFeatureFlag$)?-1:3),k.R7$(3),k.SpI(" ",k.bMT(7,23,"encryptionKeySettingsHowShouldWeEncryptYourData"),"\n"),k.R7$(3),k.SpI(" ",k.bMT(10,25,"encryptionKeySettingsIncreaseImproveSecurity"),"\n"),k.R7$(2),k.Y8G("formGroup",t.formGroup),k.R7$(5),k.SpI(" ",k.bMT(17,27,"algorithm")," "),k.R7$(2),k.Y8G("appA11yTitle",k.mNQ(k.bMT(19,29,"encryptionKeySettingsAlgorithmPopoverTitle")))("bitPopoverTriggerFor",e),k.R7$(4),k.Y8G("ngForOf",t.kdfOptions),k.R7$(2),k.vxM(t.isPBKDF2(t.kdfConfig)?24:t.isArgon2(t.kdfConfig)?25:-1),k.R7$(2),k.vxM(t.isArgon2(t.kdfConfig)?26:-1),k.R7$(2),k.SpI(" ",k.bMT(29,31,"updateEncryptionSettings")," "),k.R7$(2),k.Y8G("title",k.bMT(32,33,"encryptionKeySettingsAlgorithmPopoverTitle")),k.R7$(5),k.JRh(k.bMT(36,35,"encryptionKeySettingsAlgorithmPopoverPBKDF2")),k.R7$(3),k.JRh(k.bMT(39,37,"encryptionKeySettingsAlgorithmPopoverArgon2Id")),k.R7$(3),k.Y8G("appA11yTitle",k.mNQ(k.bMT(42,39,"learnMoreAboutEncryptionAlgorithms"))),k.R7$(2),k.SpI(" ",k.bMT(44,41,"learnMore")," ")}},dependencies:[Y.Sq,a.qT,a.me,a.Q0,a.BC,a.cb,a.VZ,a.zX,a.j4,a.JD,a.$R,xr.C,gi.$,oe.Q,Ge.G,bi.j,$r.I,Xi.J,wi.h,ke.L,ke.o,Si.w,Ii.P,Ce.r,No.r,Vo.k,Y.Jj,ae.$],encapsulation:2});var Za=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Qa=(e,t)=>({"tw-mt-6":e,"tw-mt-16":t});function el(e,t){1&e&&k.nrm(0,"app-change-kdf")}class tl{constructor(e,t,i,n){this.userDecryptionOptionsService=e,this.accountService=t,this.apiService=i,this.dialogService=n,this.showChangeKdf=!0}ngOnInit(){return Za(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));this.showChangeKdf=yield(0,u._)(this.userDecryptionOptionsService.hasMasterPasswordById$(e))})}viewUserApiKey(){return Za(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.id)));if(!e)throw new Error("Active account not found");yield Va.V.open(this.dialogService,{data:{keyType:"user",entityId:e,postKey:this.apiService.postUserApiKey.bind(this.apiService),scope:"api",grantType:"client_credentials",apiKeyTitle:"apiKey",apiKeyWarning:"userApiKeyWarning",apiKeyDescription:"userApiKeyDesc"}})})}rotateUserApiKey(){return Za(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.id)));if(!e)throw new Error("Active account not found");yield Va.V.open(this.dialogService,{data:{keyType:"user",isRotation:!0,entityId:e,postKey:this.apiService.postUserRotateApiKey.bind(this.apiService),scope:"api",grantType:"client_credentials",apiKeyTitle:"apiKey",apiKeyWarning:"userApiKeyWarning",apiKeyDescription:"apiKeyRotateDesc"}})})}}tl.ɵfac=function(e){return new(e||tl)(k.rXU(f.Ym),k.rXU(L.Di),k.rXU(fi.G),k.rXU(E.o3))},tl.ɵcmp=k.VBU({type:tl,selectors:[["ng-component"]],decls:15,vars:17,consts:[[4,"ngIf"],[1,"tw-border-0","tw-mb-0","tw-pb-2.5",3,"ngClass"],["bitTypography","h2"],["bitTypography","body1"],[1,"tw-flex","tw-gap-2"],["type","button","bitButton","","buttonType","secondary",3,"click"]],template:function(e,t){1&e&&(k.DNE(0,el,1,0,"app-change-kdf",0),k.j41(1,"div",1)(2,"h2",2),k.EFF(3),k.nI1(4,"i18n"),k.k0s()(),k.j41(5,"p",3),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"div",4)(9,"button",5),k.bIt("click",function(){return t.viewUserApiKey()}),k.EFF(10),k.nI1(11,"i18n"),k.k0s(),k.j41(12,"button",5),k.bIt("click",function(){return t.rotateUserApiKey()}),k.EFF(13),k.nI1(14,"i18n"),k.k0s()()),2&e&&(k.Y8G("ngIf",t.showChangeKdf),k.R7$(),k.Y8G("ngClass",k.l_i(14,Qa,!t.showChangeKdf,t.showChangeKdf)),k.R7$(2),k.JRh(k.bMT(4,6,"apiKey")),k.R7$(3),k.SpI(" ",k.bMT(7,8,"userApiKeyDesc"),"\n"),k.R7$(4),k.SpI(" ",k.bMT(11,10,"viewApiKey")," "),k.R7$(3),k.SpI(" ",k.bMT(14,12,"rotateApiKey")," "))},dependencies:[mi.G,Y.YU,Y.bT,oe.Q,Ce.r,Na,Ja,ae.$],encapsulation:2});var il=i(39805),nl=i(97560),rl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function sl(e,t){1&e&&(k.j41(0,"bit-tab-link",1),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"sessionTimeoutHeader")))}function ol(e,t){if(1&e&&(k.j41(0,"bit-tab-link",2),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.Y8G("route",e.changePasswordRoute),k.R7$(),k.JRh(k.bMT(2,2,"masterPassword"))}}class al{constructor(e,t,i){this.userDecryptionOptionsService=e,this.accountService=t,this.configService=i,this.showChangePassword=!0,this.changePasswordRoute="password",this.consolidatedSessionTimeoutComponent$=this.configService.getFeatureFlag$(M.TO.ConsolidatedSessionTimeoutComponent)}ngOnInit(){return rl(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));this.showChangePassword=!!e&&(yield(0,u._)(this.userDecryptionOptionsService.hasMasterPasswordById$(e)))})}}al.ɵfac=function(e){return new(e||al)(k.rXU(f.Ym),k.rXU(L.Di),k.rXU(U.w))},al.ɵcmp=k.VBU({type:al,selectors:[["ng-component"]],decls:16,vars:13,consts:[["slot","tabs"],["route","session-timeout"],[3,"route"],["route","two-factor"],["route","device-management"],["route","security-keys"]],template:function(e,t){1&e&&(k.j41(0,"app-header")(1,"bit-tab-nav-bar",0),k.nVh(2,sl,3,3,"bit-tab-link",1),k.nI1(3,"async"),k.nVh(4,ol,3,4,"bit-tab-link",2),k.j41(5,"bit-tab-link",3),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"bit-tab-link",4),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.j41(11,"bit-tab-link",5),k.EFF(12),k.nI1(13,"i18n"),k.k0s()()(),k.j41(14,"bit-container"),k.nrm(15,"router-outlet"),k.k0s()),2&e&&(k.R7$(2),k.vxM(k.bMT(3,5,t.consolidatedSessionTimeoutComponent$)?2:-1),k.R7$(2),k.vxM(t.showChangePassword?4:-1),k.R7$(2),k.JRh(k.bMT(7,7,"twoStepLogin")),k.R7$(3),k.JRh(k.bMT(10,9,"devices")),k.R7$(3),k.JRh(k.bMT(13,11,"keys")))},dependencies:[mi.G,x.n3,Ai.H,il.J,nl.T,Ei.G,Di.f,Y.Jj,ae.$],encapsulation:2});const ll=[{path:"",component:al,data:{titleId:"security"},children:[{path:"",pathMatch:"full",redirectTo:"session-timeout"},{path:"session-timeout",component:_o,canActivate:[tt(M.TO.ConsolidatedSessionTimeoutComponent,!0,"/settings/security/password",!1)],data:{titleId:"sessionTimeoutHeader"}},{path:"password",component:ja,data:{titleId:"masterPassword"}},{path:"two-factor",component:Yo.q,data:{titleId:"twoStepLogin"}},{path:"security-keys",component:tl,data:{titleId:"keys"}},{path:"device-management",component:qo,data:{titleId:"devices"}}]}];class cl{}cl.ɵfac=function(e){return new(e||cl)},cl.ɵmod=k.$C({type:cl}),cl.ɵinj=C.G2t({imports:[ne.iI.forChild(ll),ne.iI]});class dl{constructor(e,t){this.userId=e,this.token=t}}var ul=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class hl{constructor(e,t,i,n,r,s,o,a){this.router=e,this.platformUtilsService=t,this.i18nService=i,this.route=n,this.apiService=r,this.logService=s,this.tokenService=o,this.toastService=a}ngOnInit(){this.route.queryParams.pipe((0,ai.$)()).subscribe(e=>ul(this,void 0,void 0,function*(){if(null!=e.userId&&null!=e.token)try{return yield this.apiService.postAccountVerifyEmailToken(new dl(e.userId,e.token)),(yield(0,u._)(this.tokenService.hasAccessToken$(e.userId)))&&(yield this.apiService.refreshIdentityToken()),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emailVerified")}),void this.router.navigate(["/"])}catch(t){this.logService.error(t)}this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("emailVerifiedFailed")}),this.router.navigate(["/"])}))}}hl.ɵfac=function(e){return new(e||hl)(k.rXU(x.Ix),k.rXU(N.y),k.rXU(j.W),k.rXU(x.nX),k.rXU(fi.G),k.rXU(ve.K),k.rXU(X.B),k.rXU($.f))},hl.ɵcmp=k.VBU({type:hl,selectors:[["app-verify-email-token"]],standalone:!1,decls:4,vars:0,consts:[[1,"tw-p-8","tw-flex"],["alt","Bitwarden",1,"new-logo-themed"],[1,"spinner-container","tw-justify-center"],["title","Loading","aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-muted"]],template:function(e,t){1&e&&(k.j41(0,"div",0),k.nrm(1,"img",1),k.j41(2,"div",2),k.nrm(3,"i",3),k.k0s()())},encapsulation:2});class pl{constructor(e,t){this.userId=e,this.token=t}}var ml=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class vl{constructor(e,t,i,n,r,s){this.router=e,this.apiService=t,this.platformUtilsService=i,this.i18nService=n,this.route=r,this.toastService=s,this.formGroup=new a.gE({}),this.submit=()=>ml(this,void 0,void 0,function*(){const e=new pl(this.userId,this.token);yield this.apiService.postAccountRecoverDeleteToken(e),this.toastService.showToast({variant:"success",title:this.i18nService.t("accountDeleted"),message:this.i18nService.t("accountDeletedDesc")}),yield this.router.navigate(["/"])})}ngOnInit(){this.route.queryParams.pipe((0,ai.$)()).subscribe(e=>ml(this,void 0,void 0,function*(){null!=e.userId&&null!=e.token&&null!=e.email?(this.userId=e.userId,this.token=e.token,this.email=e.email):yield this.router.navigate(["/"])}))}}vl.ɵfac=function(e){return new(e||vl)(k.rXU(x.Ix),k.rXU(fi.G),k.rXU(N.y),k.rXU(j.W),k.rXU(x.nX),k.rXU($.f))},vl.ɵcmp=k.VBU({type:vl,selectors:[["app-verify-recover-delete"]],standalone:!1,decls:18,vars:17,consts:[[3,"bitSubmit","formGroup"],["type","warning"],["bitTypography","body1",1,"tw-text-center"],["bitTypography","body1"],[1,"tw-flex","tw-gap-2"],["type","submit","bitButton","","bitFormButton","","buttonType","danger",3,"block"],["bitButton","","buttonType","secondary","routerLink","/login",3,"block"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-callout",1),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"p",2)(5,"strong"),k.EFF(6),k.k0s()(),k.j41(7,"p",3),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.nrm(10,"hr"),k.j41(11,"div",4)(12,"button",5),k.EFF(13),k.nI1(14,"i18n"),k.k0s(),k.j41(15,"a",6),k.EFF(16),k.nI1(17,"i18n"),k.k0s()()()),2&e&&(k.Y8G("bitSubmit",t.submit)("formGroup",t.formGroup),k.R7$(2),k.JRh(k.bMT(3,9,"deleteAccountWarning")),k.R7$(4),k.JRh(t.email),k.R7$(2),k.JRh(k.bMT(9,11,"deleteRecoverConfirmDesc")),k.R7$(4),k.Y8G("block",!0),k.R7$(),k.SpI(" ",k.bMT(14,13,"deleteAccount")," "),k.R7$(2),k.Y8G("block",!0),k.R7$(),k.SpI(" ",k.bMT(17,15,"cancel")," "))},dependencies:[a.qT,a.cb,a.j4,ne.Wk,gi.$,yi.L,oe.Q,Ge.G,Ce.r,ae.$],encapsulation:2});var fl=i(33189),gl=i(65963),yl=(i(84488),i(304)),bl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function wl(e,t){if(1&e&&(k.nrm(0,"button",7),k.nI1(1,"i18n")),2&e){k.XpG();const e=k.sdS(10);k.Y8G("label",k.mNQ(k.bMT(1,3,"options")))("bitMenuTriggerFor",e)}}function Sl(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",5),k.nI1(1,"i18n"),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.resendEmail())}),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}if(2&e){const e=k.XpG();k.BMQ("aria-label",k.i5U(1,2,"resendEmailLabel",e.sponsoringOrg.familySponsorshipFriendlyName)),k.R7$(2),k.SpI(" ",k.bMT(3,5,"resendEmail")," ")}}class Il{constructor(e,t,i,n,r,s,o,a){this.apiService=e,this.i18nService=t,this.logService=i,this.dialogService=n,this.toastService=r,this.policyService=s,this.accountService=o,this.organizationSponsorshipApiService=a,this.sponsoringOrg=null,this.isSelfHosted=!1,this.sponsorshipRemoved=new k.bkB,this.statusMessage="loading",this.statusClass="tw-text-success",this.locale=""}ngOnInit(){return bl(this,void 0,void 0,function*(){this.locale=yield(0,u._)(this.i18nService.locale$),this.setStatus(this.isSelfHosted,this.sponsoringOrg.familySponsorshipToDelete,this.sponsoringOrg.familySponsorshipValidUntil,this.sponsoringOrg.familySponsorshipLastSyncDate),this.isFreeFamilyPolicyEnabled$=this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policiesByType$(ci.tt.FreeFamiliesSponsorshipPolicy,e)),(0,m.T)(e=>Array.isArray(e)&&e.some(e=>e.organizationId===this.sponsoringOrg.id&&e.enabled)))})}revokeSponsorship(){return bl(this,void 0,void 0,function*(){try{yield this.doRevokeSponsorship()}catch(e){this.logService.error(e)}})}resendEmail(){return bl(this,void 0,void 0,function*(){yield this.organizationSponsorshipApiService.postResendSponsorshipOffer(this.sponsoringOrg.id,this.sponsoringOrg.familySponsorshipFriendlyName),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emailSent")})})}doRevokeSponsorship(){return bl(this,void 0,void 0,function*(){const e=this.sponsoringOrg.familySponsorshipValidUntil?this.i18nService.t("updatedRevokeSponsorshipConfirmationForAcceptedSponsorship",this.sponsoringOrg.familySponsorshipFriendlyName,(0,Y.Yq)(this.sponsoringOrg.familySponsorshipValidUntil,"MM/dd/yyyy",this.locale)):this.i18nService.t("updatedRevokeSponsorshipConfirmationForSentSponsorship",this.sponsoringOrg.familySponsorshipFriendlyName);(yield this.dialogService.openSimpleDialog({title:`${this.i18nService.t("removeSponsorship")}?`,content:e,acceptButtonText:{key:"remove"},type:"warning"}))&&(yield this.organizationSponsorshipApiService.deleteRevokeSponsorship(this.sponsoringOrg.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("reclaimedFreePlan")}),this.sponsorshipRemoved.emit())})}setStatus(e,t,i,n){t&&i?(this.statusMessage=this.i18nService.t("revokeWhenExpired",(0,Y.Yq)(i,"MM/dd/yyyy",this.locale)),this.statusClass="tw-text-danger"):t?(this.statusMessage=this.i18nService.t("requestRemoved"),this.statusClass="tw-text-danger"):i?(this.statusMessage=this.i18nService.t("active"),this.statusClass="tw-text-success"):e&&n?(this.statusMessage=this.i18nService.t("sent"),this.statusClass="tw-text-success"):e?(this.statusMessage=this.i18nService.t("requested"),this.statusClass="tw-text-success"):(this.statusMessage=this.i18nService.t("sent"),this.statusClass="tw-text-success")}}Il.ɵfac=function(e){return new(e||Il)(k.rXU(fi.G),k.rXU(j.W),k.rXU(ve.K),k.rXU(E.o3),k.rXU($.f),k.rXU(Le.m),k.rXU(L.Di),k.rXU(yl.l))},Il.ɵcmp=k.VBU({type:Il,selectors:[["","sponsoring-org-row",""]],inputs:{sponsoringOrg:"sponsoringOrg",isSelfHosted:"isSelfHosted"},outputs:{sponsorshipRemoved:"sponsorshipRemoved"},standalone:!1,attrs:["sponsoring-org-row",""],decls:18,vars:15,consts:[["appListDropdown",""],["bitCell",""],[3,"ngClass"],["type","button","bitIconButton","bwi-ellipsis-v","buttonType","main",3,"bitMenuTriggerFor","label",4,"ngIf"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],[1,"tw-text-danger"],["type","button","bitIconButton","bwi-ellipsis-v","buttonType","main",3,"bitMenuTriggerFor","label"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"td",1),k.EFF(1),k.k0s(),k.j41(2,"td",1),k.EFF(3),k.k0s(),k.j41(4,"td",1)(5,"span",2),k.EFF(6),k.k0s()(),k.j41(7,"td",1),k.DNE(8,wl,2,5,"button",3),k.j41(9,"bit-menu",null,0),k.DNE(11,Sl,4,7,"button",4),k.nI1(12,"async"),k.j41(13,"button",5),k.nI1(14,"i18n"),k.bIt("click",function(){return C.eBV(e),C.Njj(t.revokeSponsorship())}),k.j41(15,"span",6),k.EFF(16),k.nI1(17,"i18n"),k.k0s()()()()}2&e&&(k.R7$(),k.SpI(" ",t.sponsoringOrg.familySponsorshipFriendlyName,"\n"),k.R7$(2),k.JRh(t.sponsoringOrg.name),k.R7$(2),k.Y8G("ngClass",t.statusClass),k.R7$(),k.JRh(t.statusMessage),k.R7$(2),k.Y8G("ngIf",!t.sponsoringOrg.familySponsorshipToDelete),k.R7$(3),k.Y8G("ngIf",!t.isSelfHosted&&!t.sponsoringOrg.familySponsorshipValidUntil&&!k.bMT(12,8,t.isFreeFamilyPolicyEnabled$)),k.R7$(2),k.BMQ("aria-label",k.i5U(14,10,"revokeAccountMessage",t.sponsoringOrg.familySponsorshipFriendlyName)),k.R7$(3),k.JRh(k.bMT(17,13,"remove")))},dependencies:[Y.YU,Y.bT,ln.s,Hr.Z,Wr.O,Jr.S,Qr.Q,Y.Jj,ae.$],encapsulation:2});var kl=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Cl(e,t){1&e&&(k.qex(0),k.nrm(1,"i",1),k.nI1(2,"i18n"),k.j41(3,"span",2),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function Tl(e,t){if(1&e&&k.nrm(0,"bit-option",14),2&e){const e=t.$implicit;k.Y8G("value",e.id)("label",e.name)}}function Fl(e,t){if(1&e&&(k.j41(0,"form",6)(1,"div",7)(2,"div",8)(3,"bit-form-field")(4,"bit-label"),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"bit-select",9),k.nrm(8,"bit-option",10),k.nI1(9,"i18n"),k.DNE(10,Tl,1,2,"bit-option",11),k.nI1(11,"async"),k.k0s()()(),k.j41(12,"div",8)(13,"bit-form-field")(14,"bit-label"),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.nrm(17,"input",12),k.k0s()(),k.j41(18,"div",8)(19,"button",13),k.EFF(20),k.nI1(21,"i18n"),k.k0s()()()()),2&e){const e=k.XpG(2);k.Y8G("formGroup",e.sponsorshipForm)("bitSubmit",e.submit),k.R7$(5),k.JRh(k.bMT(6,10,"familiesSponsoringOrgSelect")),k.R7$(3),k.Y8G("disabled",!0)("value",null)("label","--"+k.bMT(9,12,"select")+"--"),k.R7$(2),k.Y8G("ngForOf",k.bMT(11,14,e.availableSponsorshipOrgs$)),k.R7$(5),k.SpI("",k.bMT(16,16,"sponsoredFamiliesEmail"),":"),k.R7$(2),k.BMQ("aria-invalid",e.sponsorshipEmailControl.invalid),k.R7$(3),k.SpI(" ",k.bMT(21,18,"redeem")," ")}}function Rl(e,t){if(1&e){const e=k.RV6();k.qex(0),k.j41(1,"tr",20),k.bIt("sponsorshipRemoved",function(){C.eBV(e);const t=k.XpG(4);return C.Njj(t.forceReload())}),k.nrm(2,"hr"),k.k0s(),k.bVm()}if(2&e){const e=t.$implicit,i=k.XpG(4);k.R7$(),k.Y8G("sponsoringOrg",e)("isSelfHosted",i.isSelfHosted)}}function Pl(e,t){if(1&e&&(k.DNE(0,Rl,3,2,"ng-container",19),k.nI1(1,"async")),2&e){const e=k.XpG(3);k.Y8G("ngForOf",k.bMT(1,1,e.activeSponsorshipOrgs$))}}function xl(e,t){1&e&&(k.qex(0),k.j41(1,"bit-table"),k.qex(2,15),k.j41(3,"tr")(4,"th",16),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"th",16),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.j41(10,"th",16),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.nrm(13,"th",16),k.k0s(),k.bVm(),k.DNE(14,Pl,2,3,"ng-template",17),k.k0s(),k.nrm(15,"hr"),k.j41(16,"p",18),k.EFF(17),k.nI1(18,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(5),k.JRh(k.bMT(6,4,"recipient")),k.R7$(3),k.JRh(k.bMT(9,6,"sponsoringOrg")),k.R7$(3),k.JRh(k.bMT(12,8,"status")),k.R7$(6),k.JRh(k.bMT(18,10,"sponsoredFamiliesLeaveCopy")))}function $l(e,t){if(1&e&&(k.qex(0),k.j41(1,"p",3),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"div",3),k.EFF(5),k.nI1(6,"i18n"),k.j41(7,"ul",4)(8,"li"),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.j41(11,"li"),k.EFF(12),k.nI1(13,"i18n"),k.k0s()()(),k.DNE(14,Fl,22,20,"form",5),k.nI1(15,"async"),k.DNE(16,xl,19,12,"ng-container",0),k.nI1(17,"async"),k.bVm()),2&e){const e=k.XpG();k.R7$(2),k.SpI(" ",k.bMT(3,6,"sponsoredFamiliesEligible")," "),k.R7$(3),k.SpI(" ",k.bMT(6,8,"sponsoredFamiliesIncludeMessage"),": "),k.R7$(4),k.JRh(k.bMT(10,10,"sponsoredFamiliesPremiumAccess")),k.R7$(3),k.JRh(k.bMT(13,12,"sponsoredFamiliesSharedCollectionsForFamilyMembers")),k.R7$(2),k.Y8G("ngIf",k.bMT(15,14,e.anyOrgsAvailable$)),k.R7$(2),k.Y8G("ngIf",k.bMT(17,16,e.anyActiveSponsorships$))}}class El{constructor(e,t,i,n,r,s,o,l,c,h,p){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.syncService=n,this.organizationService=r,this.formBuilder=s,this.accountService=o,this.toastService=l,this.policyService=c,this.freeFamiliesPolicyService=h,this.router=p,this.loading=!1,this._destroy=new d.B,this.submit=()=>kl(this,void 0,void 0,function*(){this.formPromise=this.apiService.postCreateSponsorship(this.sponsorshipForm.value.selectedSponsorshipOrgId,{sponsoredEmail:this.sponsorshipForm.value.sponsorshipEmail,planSponsorshipType:ui.MM.FamiliesForEnterprise,friendlyName:this.sponsorshipForm.value.sponsorshipEmail}),yield this.formPromise,this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("sponsorshipCreated")}),this.formPromise=null,this.resetForm(),yield this.forceReload()}),this.sponsorshipForm=this.formBuilder.group({selectedSponsorshipOrgId:new a.MJ("",{validators:[a.k0.required]}),sponsorshipEmail:new a.MJ("",{validators:[a.k0.email,a.k0.required],asyncValidators:[this.notAllowedValueAsync(()=>(0,u._)(this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.email))),!0)],updateOn:"change"})})}ngOnInit(){return kl(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));yield this.preventAccessToFreeFamiliesPage(),this.availableSponsorshipOrgs$=(0,Vr.z)([this.organizationService.organizations$(e),this.policyService.policiesByType$(ci.tt.FreeFamiliesSponsorshipPolicy,e)]).pipe((0,m.T)(([e,t])=>e.filter(e=>e.familySponsorshipAvailable).map(e=>({organization:e,isPolicyEnabled:t.some(t=>t.organizationId===e.id&&t.enabled)})).filter(({isPolicyEnabled:e})=>!e).map(({organization:e})=>e))),this.availableSponsorshipOrgs$.pipe((0,li.Q)(this._destroy)).subscribe(e=>{1===e.length&&this.sponsorshipForm.patchValue({selectedSponsorshipOrgId:e[0].id})}),this.anyOrgsAvailable$=this.availableSponsorshipOrgs$.pipe((0,m.T)(e=>e.length>0)),this.activeSponsorshipOrgs$=this.organizationService.organizations$(e).pipe((0,m.T)(e=>e.filter(e=>null!==e.familySponsorshipFriendlyName&&!e.isAdminInitiated))),this.anyActiveSponsorships$=this.activeSponsorshipOrgs$.pipe((0,m.T)(e=>e.length>0)),this.loading=!1,this.sponsorshipForm.get("sponsorshipEmail").valueChanges.pipe((0,li.Q)(this._destroy)).subscribe(e=>{this.sponsorshipEmailControl.hasError("email")&&this.sponsorshipEmailControl.setErrors([{message:this.i18nService.t("invalidEmail")}])})})}ngOnDestroy(){this._destroy.next(),this._destroy.complete()}preventAccessToFreeFamiliesPage(){return kl(this,void 0,void 0,function*(){(yield(0,u._)(this.freeFamiliesPolicyService.showFreeFamilies$))||(yield this.router.navigate(["/"]))})}forceReload(){return kl(this,void 0,void 0,function*(){this.loading=!0,yield this.syncService.fullSync(!0),this.loading=!1})}get sponsorshipEmailControl(){return this.sponsorshipForm.controls.sponsorshipEmail}resetForm(){return kl(this,void 0,void 0,function*(){this.sponsorshipForm.reset()})}get isSelfHosted(){return this.platformUtilsService.isSelfHost()}notAllowedValueAsync(e,t=!1){return i=>kl(this,void 0,void 0,function*(){let n=yield e(),r=i.value;if(t&&(n=n.toLowerCase(),r=r.toLowerCase()),r===n)return{errors:{message:this.i18nService.t("cannotSponsorSelf")}}})}}El.ɵfac=function(e){return new(e||El)(k.rXU(fi.G),k.rXU(j.W),k.rXU(N.y),k.rXU(hi.H),k.rXU(g.PV),k.rXU(a.ok),k.rXU(L.Di),k.rXU($.f),k.rXU(Le.m),k.rXU(fl.A),k.rXU(x.Ix))},El.ɵcmp=k.VBU({type:El,selectors:[["app-sponsored-families"]],standalone:!1,decls:4,vars:2,consts:[[4,"ngIf"],[1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["bitTypography","body1"],[1,"tw-list-outside"],[3,"formGroup","bitSubmit",4,"ngIf"],[3,"formGroup","bitSubmit"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-7"],["id","availableSponsorshipOrg","name","Available Sponsorship Organization","formControlName","selectedSponsorshipOrgId"],[3,"disabled","value","label"],[3,"value","label",4,"ngFor","ngForOf"],["bitInput","","inputmode","email","formControlName","sponsorshipEmail","appInputStripSpaces",""],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],[3,"value","label"],["header",""],["bitCell",""],["body","","alignContent","middle"],["bitTypography","body2"],[4,"ngFor","ngForOf"],["bitRow","","sponsoring-org-row","",3,"sponsorshipRemoved","sponsoringOrg","isSelfHosted"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container"),k.DNE(2,Cl,6,7,"ng-container",0)(3,$l,18,18,"ng-container",0),k.k0s()),2&e&&(k.R7$(2),k.Y8G("ngIf",t.loading),k.R7$(),k.Y8G("ngIf",!t.loading))},dependencies:[Y.Sq,Y.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,gl.J,gi.$,yi.L,oe.Q,Ai.H,bi.j,Xi.J,wi.h,Si.w,Ii.P,Qr.Q,es.Y,ts._,ts.O,Ce.r,Di.f,Il,Y.Jj,ae.$],encapsulation:2});var Al=i(51971),Dl=i(30556);const Ol=(e,t)=>({"tw-border-0 tw-border-l tw-border-solid tw-border-secondary-300":e,"tw-pt-6":t});function Ml(e,t){if(1&e&&(k.j41(0,"div",0),k.SdG(1),k.k0s()),2&e){const e=k.XpG();k.Y8G("ngClass",k.l_i(1,Ol,e.applyBorder,e.addSubLabelSpacing))}}class Ul extends Dl.VI{constructor(){super(...arguments),this.subLabel="",this.applyBorder=!0,this.addSubLabelSpacing=!1}}Ul.ɵfac=(()=>{let e;return function(t){return(e||(e=k.xGo(Ul)))(t||Ul)}})(),Ul.ɵcmp=k.VBU({type:Ul,selectors:[["app-vertical-step"]],inputs:{subLabel:"subLabel",applyBorder:"applyBorder",addSubLabelSpacing:"addSubLabelSpacing"},standalone:!1,features:[k.Jv_([{provide:Dl.VI,useExisting:Ul}]),k.Vt3],ngContentSelectors:["*"],decls:1,vars:0,consts:[[1,"tw-inline-block","tw-w-11/12","tw-pl-7",3,"ngClass"]],template:function(e,t){1&e&&(k.NAR(),k.DNE(0,Ml,2,4,"ng-template"))},dependencies:[Y.YU],encapsulation:2});const Gl=e=>({"hover:tw-bg-secondary-100":e}),jl=e=>({"tw-font-medium":e}),Nl=e=>({"tw-mt-1":e}),Vl=(e,t,i)=>({"tw-bg-primary-600 tw-text-contrast":e,"tw-bg-secondary-300 tw-text-main":t,"tw-bg-transparent tw-text-muted":i});function Bl(e,t){if(1&e&&(k.j41(0,"span",7),k.EFF(1),k.k0s()),2&e){const e=k.XpG();k.Y8G("ngClass",k.sMw(2,Vl,e.selected,!e.selected&&!e.disabled&&e.step.editable,e.disabled)),k.R7$(),k.SpI(" ",e.stepNumber," ")}}function zl(e,t){1&e&&(k.j41(0,"span",8),k.nrm(1,"i",9),k.k0s())}class Ll{constructor(){this.onSelectStep=new k.bkB,this.disabled=!1,this.selected=!1}selectStep(){this.onSelectStep.emit()}}function Kl(e,t){if(1&e&&k.nrm(0,"div",5),2&e){const e=k.XpG(2);k.Y8G("ngTemplateOutlet",e.selected?e.selected.content:null)}}function ql(e,t){1&e&&k.nrm(0,"div",6)}function _l(e,t){if(1&e){const e=k.RV6();k.j41(0,"li")(1,"app-vertical-step-content",2),k.bIt("onSelectStep",function(){const t=C.eBV(e).index,i=k.XpG();return C.Njj(i.selectStepByIndex(t))}),k.k0s(),k.DNE(2,Kl,1,1,"div",3)(3,ql,1,0,"div",4),k.k0s()}if(2&e){const e=t.$implicit,i=t.index,n=t.last,r=k.XpG();k.R7$(),k.Y8G("disabled",r.isStepDisabled(i))("selected",r.selectedIndex===i)("step",e)("stepNumber",i+1),k.R7$(),k.Y8G("ngIf",r.selectedIndex===i),k.R7$(),k.Y8G("ngIf",!(n||r.selectedIndex===i))}}Ll.ɵfac=function(e){return new(e||Ll)},Ll.ɵcmp=k.VBU({type:Ll,selectors:[["app-vertical-step-content"]],inputs:{disabled:"disabled",selected:"selected",step:"step",stepNumber:"stepNumber"},outputs:{onSelectStep:"onSelectStep"},standalone:!1,decls:9,vars:15,consts:[[1,"tw-m-2.5","tw-h-16","tw-text-center"],["type","button",1,"tw-flex","tw-w-full","tw-items-center","tw-border-none","tw-bg-transparent",3,"click","disabled","ngClass"],["class","tw-mr-3.5 tw-w-9 tw-rounded-full tw-font-medium tw-leading-9",3,"ngClass",4,"ngIf"],["class","tw-mr-3.5 tw-w-9 tw-rounded-full tw-bg-primary-600 tw-font-medium tw-leading-9 tw-text-contrast",4,"ngIf"],[1,"tw-txt-main","tw-mt-3.5","tw-h-12","tw-text-left","tw-leading-snug",3,"ngClass"],[1,"main-label","text","tw-mb-1","tw-text-main",3,"ngClass"],[1,"sub-label","small","tw-text-muted"],[1,"tw-mr-3.5","tw-w-9","tw-rounded-full","tw-font-medium","tw-leading-9",3,"ngClass"],[1,"tw-mr-3.5","tw-w-9","tw-rounded-full","tw-bg-primary-600","tw-font-medium","tw-leading-9","tw-text-contrast"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-check","tw-p-1"]],template:function(e,t){1&e&&(k.j41(0,"div",0)(1,"button",1),k.bIt("click",function(){return t.selectStep()}),k.DNE(2,Bl,2,6,"span",2)(3,zl,2,0,"span",3),k.j41(4,"div",4)(5,"p",5),k.EFF(6),k.k0s(),k.j41(7,"p",6),k.EFF(8),k.k0s()()()()),2&e&&(k.R7$(),k.Y8G("disabled",t.disabled)("ngClass",k.eq3(9,Gl,!t.disabled&&t.step.editable)),k.BMQ("aria-expanded",t.selected),k.R7$(),k.Y8G("ngIf",!t.step.completed),k.R7$(),k.Y8G("ngIf",t.step.completed),k.R7$(),k.Y8G("ngClass",k.eq3(11,jl,t.selected)),k.R7$(),k.Y8G("ngClass",k.eq3(13,Nl,!t.step.subLabel)),k.R7$(),k.SpI(" ",t.step.label," "),k.R7$(2),k.JRh(t.step.subLabel))},dependencies:[Y.YU,Y.bT],encapsulation:2});class Xl extends Dl.Up{constructor(){super(...arguments),this.activeClass="active"}isNextButtonHidden(){return!(this.steps.length===this.selectedIndex+1)}isStepDisabled(e){var t;return this.selectedIndex!==e&&(this.selectedIndex!==e-1||!(null===(t=this.steps.find((t,i)=>i==e-1))||void 0===t?void 0:t.completed))}selectStepByIndex(e){this.selectedIndex=e}}Xl.ɵfac=(()=>{let e;return function(t){return(e||(e=k.xGo(Xl)))(t||Xl)}})(),Xl.ɵcmp=k.VBU({type:Xl,selectors:[["app-vertical-stepper"]],inputs:{activeClass:"activeClass"},standalone:!1,features:[k.Jv_([{provide:Dl.Up,useExisting:Xl}]),k.Vt3],decls:3,vars:1,consts:[[1,"tw-flex","tw-list-none","tw-flex-col","tw-flex-wrap","tw-p-5"],[4,"ngFor","ngForOf"],[3,"onSelectStep","disabled","selected","step","stepNumber"],["class","tw-inline-block tw-pl-7",3,"ngTemplateOutlet",4,"ngIf"],["class","tw-ml-8 tw-h-6 tw-border-0 tw-border-l tw-border-solid tw-border-secondary-300",4,"ngIf"],[1,"tw-inline-block","tw-pl-7",3,"ngTemplateOutlet"],[1,"tw-ml-8","tw-h-6","tw-border-0","tw-border-l","tw-border-solid","tw-border-secondary-300"]],template:function(e,t){1&e&&(k.j41(0,"div")(1,"ul",0),k.DNE(2,_l,4,6,"li",1),k.k0s()()),2&e&&(k.R7$(2),k.Y8G("ngForOf",t.steps))},dependencies:[Y.Sq,Y.bT,Y.T3,Ll],encapsulation:2});var Yl=i(58605),Hl=i(58688),Wl=i(12610),Jl=i(27442),Zl=i(98221),Ql=i(63734),ec=i(84079),tc=i(14055),ic=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const nc="annually",rc="monthly";class sc{constructor(e,t,i,n,r){this.accountService=e,this.apiService=t,this.organizationBillingService=i,this.taxClient=n,this.configService=r,this.plans$=(0,ec.H)(this.apiService.getPlans()).pipe((0,Jl.t)({bufferSize:1,refCount:!0})),this.getPrices$=(e,t)=>this.plans$.pipe((0,D.v)(this.configService.getFeatureFlag$(M.TO.PM26462_Milestone_3)),(0,m.T)(([i,n])=>{switch(t){case"families":return{annually:i.data.find(e=>e.type===(n?ui.OL.FamiliesAnnually:ui.OL.FamiliesAnnually2025)).PasswordManager.basePrice};case"teams":case"enterprise":{const n=i.data.find(e=>e.type===("teams"===t?ui.OL.TeamsAnnually:ui.OL.EnterpriseAnnually)),r=i.data.find(e=>e.type===("teams"===t?ui.OL.TeamsMonthly:ui.OL.EnterpriseMonthly));switch(e){case"passwordManager":return{annually:n.PasswordManager.seatPrice,monthly:r.PasswordManager.seatPrice};case"secretsManager":return{annually:n.SecretsManager.seatPrice,monthly:r.SecretsManager.seatPrice}}}}})),this.getCosts=(e,t,i,n)=>ic(this,void 0,void 0,function*(){const r=(0,Ql.kx)(n);return yield this.taxClient.previewTaxForOrganizationSubscriptionPurchase({tier:t,cadence:i,passwordManager:{seats:1,additionalStorage:0,sponsored:!1},secretsManager:"secretsManager"===e?{seats:1,additionalServiceAccounts:0,standalone:!0}:void 0},r)}),this.startTrial=(e,t,i,n)=>ic(this,void 0,void 0,function*(){var r;const s=[n.token,(0,tc.x$)(n.type)],o=yield((e,t)=>ic(this,void 0,void 0,function*(){const i=yield(0,u._)(this.plans$),n=(yield this.configService.getFeatureFlag(M.TO.PM26462_Milestone_3))?ui.OL.FamiliesAnnually:ui.OL.FamiliesAnnually2025;switch(e){case"families":return i.data.find(e=>e.type===n).type;case"teams":return i.data.find(e=>e.type===("annually"===t?ui.OL.TeamsAnnually:ui.OL.TeamsMonthly)).type;case"enterprise":return i.data.find(e=>e.type===("annually"===t?ui.OL.EnterpriseAnnually:ui.OL.EnterpriseMonthly)).type}}))(e.tier,t),a={organization:{name:e.organization.name,billingEmail:e.organization.email,initiationPath:"passwordManager"===e.product?"Password Manager trial from marketing website":"Secrets Manager trial from marketing website"},plan:"passwordManager"===e.product?{type:o,passwordManagerSeats:1}:{type:o,passwordManagerSeats:1,subscribeToSecretsManager:!0,isFromSecretsManagerTrial:!0,secretsManagerSeats:1},payment:{paymentMethod:s,billing:{country:i.country,postalCode:i.postalCode,taxId:null!==(r=i.taxId)&&void 0!==r?r:void 0},skipTrial:0===e.length}},l=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));return yield this.organizationBillingService.purchaseSubscription(a,l)})}}sc.ɵfac=function(e){return new(e||sc)(C.KVO(L.Di),C.KVO(fi.G),C.KVO(Yl.Y),C.KVO(Zl.jZ),C.KVO(U.w))},sc.ɵprov=C.jDH({token:sc,factory:sc.ɵfac});var oc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ac=e=>({type:"checkout",supportsTaxId:e});function lc(e,t){1&e&&k.eu8(0)}function cc(e,t){if(1&e&&k.DNE(0,lc,1,0,"ng-container",2),2&e){k.XpG();const e=k.sdS(4);k.Y8G("ngTemplateOutlet",e)}}function dc(e,t){if(1&e&&(k.j41(0,"div",7)(1,"bit-radio-button",16)(2,"bit-label"),k.EFF(3),k.nI1(4,"i18n"),k.nI1(5,"currency"),k.nI1(6,"i18n"),k.k0s()()()),2&e){k.XpG();const e=k.r8f(0);k.R7$(),k.Y8G("value","monthly"),k.R7$(2),k.E5c(" ",k.bMT(4,4,"monthly")," - ",k.i5U(5,6,e.monthly,"$")," /",k.bMT(6,9,"monthAbbr")," ")}}function uc(e,t){if(1&e&&(k.j41(0,"div",12),k.SS7(1),k.nI1(2,"async"),k.j41(3,"div",17),k.EFF(4),k.nI1(5,"i18n"),k.nI1(6,"async"),k.nI1(7,"currency"),k.j41(8,"div"),k.EFF(9),k.nI1(10,"i18n"),k.nI1(11,"currency"),k.k0s()(),k.nrm(12,"hr",18),k.j41(13,"p",19)(14,"strong"),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.EFF(17),k.nI1(18,"currency"),k.nI1(19,"i18n"),k.k0s()()),2&e){const e=k.XpG(2),t="passwordManager"===e.trial().product?"passwordManagerPlanPrice":"secretsManagerPlanPrice",i=k.bMT(2,7,e.selectionCosts$);k.R7$(4),k.Lme(" ",k.bMT(5,9,t),": ",k.i5U(7,13,k.bMT(6,11,e.selectionPrice$),"USD $")," "),k.R7$(5),k.Lme(" ",k.bMT(10,16,"estimatedTax"),": ",k.i5U(11,18,i.tax,"USD $")," "),k.R7$(6),k.SpI("",k.bMT(16,21,"total"),": ");const n="annually"===e.formGroup.value.cadence?"year":"month";k.R7$(2),k.Lme(" ",k.i5U(18,23,i.total,"USD $"),"/",k.bMT(19,26,n)," ")}}function hc(e,t){if(1&e){const e=k.RV6();k.SS7(0),k.nI1(1,"async"),k.j41(2,"form",1)(3,"div",3)(4,"div",4)(5,"h2",5),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"bit-radio-group",6)(9,"div",7)(10,"bit-radio-button",8)(11,"bit-label"),k.EFF(12),k.nI1(13,"i18n"),k.nI1(14,"currency"),k.nI1(15,"i18n"),k.k0s()()(),k.nVh(16,dc,7,11,"div",7),k.k0s()(),k.j41(17,"div",9)(18,"h2",5),k.EFF(19),k.nI1(20,"i18n"),k.k0s(),k.nrm(21,"app-enter-payment-method",10)(22,"app-enter-billing-address",11),k.nVh(23,uc,20,28,"div",12),k.k0s(),k.j41(24,"div",13)(25,"button",14),k.EFF(26),k.nI1(27,"i18n"),k.k0s(),k.j41(28,"button",15),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.stepBack())}),k.EFF(29),k.nI1(30,"i18n"),k.k0s()()()()}if(2&e){const e=k.XpG(),t=k.bH3(k.bMT(1,16,e.prices$));k.R7$(2),k.Y8G("formGroup",e.formGroup)("bitSubmit",e.submit),k.R7$(4),k.JRh(k.bMT(7,19,"billingPlanLabel")),k.R7$(2),k.Y8G("formControl",e.formGroup.controls.cadence),k.R7$(2),k.Y8G("value","annually"),k.R7$(2),k.E5c(" ",k.bMT(13,21,"annual")," - ",k.i5U(14,23,t.annually,"$")," /",k.bMT(15,26,"yr")," "),k.R7$(4),k.vxM(t.monthly?16:-1),k.R7$(3),k.JRh(k.bMT(20,28,"paymentType")),k.R7$(2),k.Y8G("group",e.formGroup.controls.paymentMethod),k.R7$(),k.Y8G("group",e.formGroup.controls.billingAddress)("scenario",k.eq3(34,ac,"families"!==e.trial().tier)),k.R7$(),k.vxM(0===e.trial().length?23:-1),k.R7$(3),k.SpI(" ",k.bMT(27,30,e.trial().length>0?"startTrial":"submit")," "),k.R7$(3),k.SpI(" ",k.bMT(30,32,"back")," ")}}function pc(e,t){1&e&&(k.nrm(0,"i",20),k.nI1(1,"i18n"),k.j41(2,"span",21),k.EFF(3),k.nI1(4,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"loading"))),k.R7$(3),k.JRh(k.bMT(4,5,"loading")))}class mc{constructor(e,t,i){this.i18nService=e,this.toastService=t,this.trialBillingStepService=i,this.trial=r.hFB.required(),this.steppedBack=(0,r.CGW)(),this.organizationCreated=(0,r.CGW)(),this.destroy$=new d.B,this.formGroup=new a.gE({cadence:new a.MJ(nc,{nonNullable:!0}),paymentMethod:Ql.Pu.getFormGroup(),billingAddress:Ql.vU.getFormGroup()}),this.submit=()=>oc(this,void 0,void 0,function*(){if(this.formGroup.markAllAsTouched(),this.formGroup.invalid)return;const e=yield this.enterPaymentMethodComponent.tokenize();if(!e)return;const t=this.formGroup.controls.billingAddress.getRawValue(),i=yield this.trialBillingStepService.startTrial(this.trial(),this.formGroup.value.cadence,t,e);this.toastService.showToast({variant:"success",title:this.i18nService.t("organizationCreated"),message:this.i18nService.t("organizationReadyToGo")}),this.organizationCreated.emit({organizationId:i.id,planDescription:yield(0,u._)(this.selectionDescription$)})}),this.stepBack=()=>this.steppedBack.emit()}ngOnInit(){return oc(this,void 0,void 0,function*(){const{product:e,tier:t}=this.trial();this.prices$=this.trialBillingStepService.getPrices$(e,t);const i=this.formGroup.controls.cadence.valueChanges.pipe((0,Wl.Z)(nc));this.selectionPrice$=(0,Vr.z)([this.prices$,i]).pipe((0,m.T)(([e,t])=>e[t]),(0,h.p)(e=>!!e)),this.selectionCosts$=(0,Vr.z)([i,this.formGroup.controls.billingAddress.valueChanges.pipe((0,Wl.Z)(this.formGroup.controls.billingAddress.value),(0,h.p)(e=>!!e.country&&!!e.postalCode))]).pipe((0,Rn.B)(500),(0,ft.n)(([i,n])=>this.trialBillingStepService.getCosts(e,t,i,n)),(0,Wl.Z)({tax:0,total:0}),(0,Jl.t)({bufferSize:1,refCount:!0})),this.selectionDescription$=(0,Vr.z)([this.selectionPrice$,i]).pipe((0,m.T)(([e,t])=>{switch(t){case nc:return`${this.i18nService.t("annual")} ($${e}/${this.i18nService.t("yr")})`;case rc:return`${this.i18nService.t("monthly")} ($${e}/${this.i18nService.t("monthAbbr")})`}}))})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}mc.ɵfac=function(e){return new(e||mc)(k.rXU(j.W),k.rXU($.f),k.rXU(sc))},mc.ɵcmp=k.VBU({type:mc,selectors:[["app-trial-billing-step"]],viewQuery:function(e,t){if(1&e&&k.GBs(Ql.Pu,5),2&e){let e;k.mGM(e=k.lsd())&&(t.enterPaymentMethodComponent=e.first)}},inputs:{trial:[1,"trial"]},outputs:{steppedBack:"steppedBack",organizationCreated:"organizationCreated"},features:[k.Jv_([Zl.jZ,sc])],decls:5,vars:3,consts:[["loadingSpinner",""],[3,"formGroup","bitSubmit"],[4,"ngTemplateOutlet"],[1,"tw-container","tw-mb-3"],[1,"tw-mb-6"],[1,"tw-mb-3","tw-text-base","tw-font-medium"],[3,"formControl"],[1,"tw-mb-1","tw-items-center"],["id","annual-cadence-button",3,"value"],[1,"tw-mb-4"],[3,"group"],[3,"group","scenario"],["id","price",1,"tw-my-4"],[1,"tw-flex","tw-space-x-2"],["bitButton","","bitFormButton","","buttonType","primary","type","submit"],["bitButton","","type","button","buttonType","secondary",3,"click"],["id","monthly-cadence-button",3,"value"],[1,"tw-text-muted","tw-text-base"],[1,"tw-my-1","tw-grid","tw-grid-cols-3","tw-ml-0"],[1,"tw-text-lg"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&(k.nVh(0,cc,1,1,"ng-container"),k.nI1(1,"async"),k.vZN(2,hc,31,36,"form",1),k.DNE(3,pc,5,7,"ng-template",null,0,k.C5r)),2&e&&k.vxM(k.bMT(1,1,t.prices$)?2:0)},dependencies:[Ql.Pu,Ql.vU,mi.G,Y.T3,a.qT,a.BC,a.cb,a.l_,a.j4,gi.$,yi.L,oe.Q,bi.j,Er.d,Ar.Y,Y.Jj,Y.oe,ae.$],encapsulation:2});var vc=i(54873);function fc(e,t){if(1&e&&(k.j41(0,"p",5),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.SpI(" ",k.i5U(2,1,"trialThankYou",e.orgLabel)," ")}}function gc(e,t){1&e&&(k.j41(0,"p",5),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,1,"smFreeTrialThankYou")," "))}function yc(e,t){if(1&e&&(k.j41(0,"li")(1,"p"),k.EFF(2),k.nI1(3,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.R7$(2),k.SpI(" ",k.i5U(3,1,"trialPaidInfoMessage",e.orgLabel)," ")}}class bc{constructor(){this.product=ui.ch.PasswordManager,this.Product=ui.ch}}bc.ɵfac=function(e){return new(e||bc)},bc.ɵcmp=k.VBU({type:bc,selectors:[["app-trial-confirmation-details"]],inputs:{email:"email",orgLabel:"orgLabel",product:"product",trialLength:"trialLength"},standalone:!1,decls:12,vars:7,consts:[[1,"tw-pb-6","tw-pl-6"],["class","tw-text-xl",4,"ngIf"],[1,"tw-list-disc"],[1,"tw-font-medium"],[4,"ngIf"],[1,"tw-text-xl"]],template:function(e,t){1&e&&(k.j41(0,"div",0),k.DNE(1,fc,3,4,"p",1)(2,gc,3,3,"p",1),k.j41(3,"ul",2)(4,"li")(5,"p"),k.EFF(6),k.nI1(7,"i18n"),k.j41(8,"span",3),k.EFF(9),k.k0s(),k.EFF(10,". "),k.k0s()(),k.DNE(11,yc,4,4,"li",4),k.k0s()()),2&e&&(k.R7$(),k.Y8G("ngIf",t.product===t.Product.PasswordManager),k.R7$(),k.Y8G("ngIf",t.product===t.Product.SecretsManager),k.R7$(4),k.SpI(" ",k.bMT(7,5,"trialConfirmationEmail")," "),k.R7$(3),k.JRh(t.email),k.R7$(2),k.Y8G("ngIf",t.trialLength>0))},dependencies:[Y.bT,ae.$],encapsulation:2});var wc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Sc=["stepper"],Ic=()=>({key:"createAccount"}),kc=e=>["/sm",e],Cc=e=>["/organizations",e,"vault"],Tc=e=>["/organizations",e,"members"];function Fc(e,t){1&e&&(k.j41(0,"div",1),k.nrm(1,"i",2),k.nI1(2,"i18n"),k.j41(3,"span",3),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function Rc(e,t){if(1&e){const e=k.RV6();k.j41(0,"div")(1,"auth-input-password",5),k.bIt("onPasswordFormSubmit",function(t){C.eBV(e);const i=k.XpG(2);return C.Njj(i.handlePasswordSubmit(t))}),k.k0s()()}if(2&e){const e=k.XpG(2);k.R7$(),k.Y8G("flow",e.inputPasswordFlow)("email",e.email)("loading",e.submitting)("masterPasswordPolicyOptions",e.enforcedPolicyOptions)("primaryButtonText",k.lJ4(5,Ic))}}function Pc(e,t){if(1&e){const e=k.RV6();k.j41(0,"app-trial-billing-step",19),k.bIt("steppedBack",function(){C.eBV(e);const t=k.XpG(4);return C.Njj(t.previousStep())})("organizationCreated",function(t){C.eBV(e);const i=k.XpG(4);return C.Njj(i.createdOrganization(t))}),k.k0s()}if(2&e){const e=k.XpG(4);k.Y8G("trial",e.trial)}}function xc(e,t){if(1&e&&(k.j41(0,"app-vertical-step",17),k.DNE(1,Pc,1,1,"app-trial-billing-step",18),k.k0s()),2&e){k.XpG();const e=k.sdS(2),t=k.XpG(2);k.Y8G("subLabel",t.billingSubLabel),k.R7$(),k.Y8G("ngIf",2===e.selectedIndex)}}function $c(e,t){if(1&e){const e=k.RV6();k.j41(0,"div")(1,"app-vertical-stepper",6,0),k.bIt("selectionChange",function(t){C.eBV(e);const i=k.XpG(2);return C.Njj(i.verticalStepChange(t))}),k.j41(3,"app-vertical-step",7)(4,"auth-input-password",5),k.bIt("onPasswordFormSubmit",function(t){C.eBV(e);const i=k.XpG(2);return C.Njj(i.handlePasswordSubmit(t))}),k.k0s()(),k.j41(5,"app-vertical-step",8),k.nrm(6,"app-org-info",9),k.j41(7,"button",10),k.nI1(8,"async"),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.orgNameEntrySubmit())}),k.EFF(9),k.nI1(10,"async"),k.nI1(11,"i18n"),k.nI1(12,"i18n"),k.k0s()(),k.DNE(13,xc,2,2,"app-vertical-step",11),k.nI1(14,"async"),k.j41(15,"app-vertical-step",12),k.nrm(16,"app-trial-confirmation-details",13),k.j41(17,"div",14)(18,"a",15),k.EFF(19),k.nI1(20,"i18n"),k.nI1(21,"titlecase"),k.k0s(),k.j41(22,"a",16),k.EFF(23),k.nI1(24,"i18n"),k.k0s()()()()()}if(2&e){const e=k.XpG(2);k.R7$(3),k.Y8G("editable",!1)("subLabel",e.email),k.R7$(),k.Y8G("flow",e.inputPasswordFlow)("email",e.email)("loading",e.submitting)("masterPasswordPolicyOptions",e.enforcedPolicyOptions)("primaryButtonText",k.lJ4(39,Ic)),k.R7$(),k.Y8G("subLabel",e.orgInfoSubLabel),k.R7$(),k.Y8G("nameOnly",!0)("formGroup",e.orgInfoFormGroup),k.R7$(),k.Y8G("disabled",e.orgInfoFormGroup.controls.name.invalid)("loading",e.loading&&k.bMT(8,23,e.trialPaymentOptional$)),k.R7$(2),k.SpI(" ",k.bMT(10,25,e.trialPaymentOptional$)&&e.trialLength>0?k.bMT(11,27,"startTrial"):k.bMT(12,29,"next")," "),k.R7$(4),k.Y8G("ngIf",k.bMT(14,31,e.showBillingStep$)),k.R7$(2),k.Y8G("applyBorder",!1),k.R7$(),k.Y8G("email",e.email)("orgLabel",e.orgLabel)("product",e.product)("trialLength",e.trialLength),k.R7$(2),k.Y8G("routerLink",e.product===e.ProductType.SecretsManager?k.eq3(40,kc,e.orgId):k.eq3(42,Cc,e.orgId)),k.R7$(),k.SpI(" ",k.bMT(21,35,k.bMT(20,33,"getStarted"))," "),k.R7$(3),k.Y8G("routerLink",k.eq3(44,Tc,e.orgId)),k.R7$(),k.SpI(" ",k.bMT(24,37,"inviteUsers")," ")}}function Ec(e,t){if(1&e&&k.DNE(0,Rc,2,6,"div",4)(1,$c,25,46,"div",4),2&e){const e=k.XpG();k.Y8G("ngIf",!e.useTrialStepper),k.R7$(),k.Y8G("ngIf",e.useTrialStepper)}}class Ac{constructor(e,t,i,n,r,s,o,l,c,u,h,p,v,f,g,y){this.router=e,this.route=t,this.formBuilder=i,this.logService=n,this.policyApiService=r,this.policyService=s,this.i18nService=o,this.routerService=l,this.organizationBillingService=c,this.organizationInviteService=u,this.toastService=h,this.registrationFinishService=p,this.validationService=v,this.loginStrategyService=f,this.configService=g,this.accountService=y,this.inputPasswordFlow=Ae.m5.SetInitialPasswordAccountRegistration,this.initializing=!0,this.stepperProductTypes=[ui.K_.Teams,ui.K_.Enterprise,ui.K_.Families],this.useTrialStepper=!1,this.submitting=!1,this.validProducts=[ui.ch.PasswordManager,ui.ch.SecretsManager],this.orgInfoSubLabel="",this.orgId="",this.orgLabel="",this.billingSubLabel="",this.email="",this.loading=!1,this.orgInfoFormGroup=this.formBuilder.group({name:["",{validators:[a.k0.required,a.k0.maxLength(50)],updateOn:"change"}],billingEmail:[""]}),this.destroy$=new d.B,this.ProductType=ui.ch,this.trialPaymentOptional$=this.configService.getFeatureFlag$(M.TO.TrialPaymentOptional),this.showBillingStep$=this.trialPaymentOptional$.pipe((0,m.T)(e=>!e&&!this.isSecretsManagerFree||e&&0===this.trialLength))}ngOnInit(){return wc(this,void 0,void 0,function*(){this.route.queryParams.pipe((0,li.Q)(this.destroy$)).subscribe(e=>{null!=e.email&&e.email.indexOf("@")>-1&&(this.email=e.email,this.orgInfoFormGroup.controls.billingEmail.setValue(e.email)),e.fromEmail&&"true"===e.fromEmail&&this.toastService.showToast({title:"",message:this.i18nService.t("emailVerifiedV2"),variant:"success"}),null!=e.token&&(this.emailVerificationToken=e.token);const t=parseInt(e.product);this.product=this.validProducts.includes(t)?t:ui.ch.PasswordManager;const i=parseInt(e.productTier);this.productTierValue=i;const n=this.stepperProductTypes.includes(i),r=this.product===ui.ch.SecretsManager;!n&&!r||isNaN(i)||(this.productTier=i,this.orgLabel=this.planTypeDisplay,this.useTrialStepper=!0),this.trialLength=e.trialLength?parseInt(e.trialLength):7,this.setupFamilySponsorship(e.sponsorshipToken)});const e=yield this.organizationInviteService.getOrganizationInvite();let t=null;if(null!=e&&e.organizationId&&e.token&&e.email&&e.organizationUserId)try{t=yield this.policyApiService.getPoliciesByToken(e.organizationId,e.token,e.email,e.organizationUserId)}catch(i){this.logService.error(i)}null!==t&&this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.masterPasswordPolicyOptions$(e,t)),(0,li.Q)(this.destroy$)).subscribe(e=>{this.enforcedPolicyOptions=e}),this.orgInfoFormGroup.controls.name.valueChanges.pipe((0,li.Q)(this.destroy$)).subscribe(()=>{this.orgInfoFormGroup.controls.name.markAsTouched()}),this.initializing=!1})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}verticalStepChange(e){1===e.selectedIndex&&""===this.orgInfoFormGroup.controls.name.value?this.orgInfoSubLabel=this.planInfoLabel:1===e.previouslySelectedIndex&&(this.orgInfoSubLabel=this.orgInfoFormGroup.controls.name.value)}orgNameEntrySubmit(){return wc(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));(yield(0,u._)(this.trialPaymentOptional$))&&this.trialLength>0?yield this.createOrganizationOnTrial(e):yield this.conditionallyCreateOrganization(e)})}createdOrganization(e){this.orgId=e.organizationId,this.billingSubLabel=e.planDescription,this.verticalStepper.next()}createOrganizationOnTrial(e){return wc(this,void 0,void 0,function*(){this.loading=!0;let t="Password Manager trial from marketing website",i={type:yield this.getPlanType(),passwordManagerSeats:1};this.product===ui.ch.SecretsManager&&(t="Secrets Manager trial from marketing website",i=Object.assign(Object.assign({},i),{subscribeToSecretsManager:!0,isFromSecretsManagerTrial:!0,secretsManagerSeats:1}));const n={name:null==this.orgInfoFormGroup.value.name?"":this.orgInfoFormGroup.value.name,billingEmail:null==this.orgInfoFormGroup.value.billingEmail?"":this.orgInfoFormGroup.value.billingEmail,initiationPath:t},r=yield this.organizationBillingService.purchaseSubscriptionNoPaymentMethod({organization:n,plan:i},e);this.orgId=null==r?void 0:r.id,this.billingSubLabel=r.name.toString(),this.loading=!1,this.verticalStepper.next()})}previousStep(){this.verticalStepper.previous()}getPlanType(){return wc(this,void 0,void 0,function*(){const e=(yield this.configService.getFeatureFlag(M.TO.PM26462_Milestone_3))?ui.OL.FamiliesAnnually:ui.OL.FamiliesAnnually2025;switch(this.productTier){case ui.K_.Teams:return ui.OL.TeamsAnnually;case ui.K_.Enterprise:return ui.OL.EnterpriseAnnually;case ui.K_.Families:return e;case ui.K_.Free:return ui.OL.Free;default:return ui.OL.EnterpriseAnnually}})}get isSecretsManagerFree(){return this.product===ui.ch.SecretsManager&&this.productTier===ui.K_.Free}get planTypeDisplay(){switch(this.productTier){case ui.K_.Teams:return"Teams";case ui.K_.Enterprise:return"Enterprise";case ui.K_.Families:return"Families";default:return""}}get planInfoLabel(){switch(this.productTier){case ui.K_.Teams:return this.i18nService.t("enterTeamsOrgInfo");case ui.K_.Enterprise:return this.i18nService.t("enterEnterpriseOrgInfo");case ui.K_.Families:return this.i18nService.t("enterFamiliesOrgInfo");default:return""}}conditionallyCreateOrganization(e){return wc(this,void 0,void 0,function*(){if(!this.isSecretsManagerFree)return void this.verticalStepper.next();const t=yield this.organizationBillingService.startFree({organization:{name:null==this.orgInfoFormGroup.value.name?"":this.orgInfoFormGroup.value.name,billingEmail:null==this.orgInfoFormGroup.value.billingEmail?"":this.orgInfoFormGroup.value.billingEmail,initiationPath:"Password Manager trial from marketing website"},plan:{type:0,subscribeToSecretsManager:!0,isFromSecretsManagerTrial:!0}},e);this.orgId=t.id,this.verticalStepper.next()})}handlePasswordSubmit(e){return wc(this,void 0,void 0,function*(){if(!this.useTrialStepper)return yield this.finishRegistration(e),this.submitting=!1,void(yield this.router.navigate(["/login"],{queryParams:{email:this.email}}));yield this.finishRegistration(e),yield this.logIn(e.newPassword),this.submitting=!1,this.verticalStepper.next()})}setupFamilySponsorship(e){if(null!=e){const t=this.router.createUrlTree(["setup/families-for-enterprise"],{queryParams:{plan:e}});this.routerService.setPreviousUrl(t.toString())}}logIn(e){return wc(this,void 0,void 0,function*(){const t=new f.F2(this.email,e);yield this.loginStrategyService.logIn(t)})}finishRegistration(e){return wc(this,void 0,void 0,function*(){return this.submitting=!0,this.registrationFinishService.finishRegistration(this.email,e,this.emailVerificationToken).catch(e=>(this.validationService.showError(e),this.submitting=!1,null))})}get trial(){const e=this.product===ui.ch.PasswordManager?"passwordManager":"secretsManager",t=this.productTier===ui.K_.Families?"families":this.productTier===ui.K_.Teams?"teams":"enterprise";return{organization:{name:this.orgInfoFormGroup.value.name,email:this.orgInfoFormGroup.value.billingEmail},product:e,tier:t,length:this.trialLength}}}Ac.ɵfac=function(e){return new(e||Ac)(k.rXU(x.Ix),k.rXU(x.nX),k.rXU(a.ok),k.rXU(ve.K),k.rXU(ze.m),k.rXU(Le.m),k.rXU(j.W),k.rXU(Al.H),k.rXU(Yl.Y),k.rXU(Bi.i),k.rXU($.f),k.rXU(Ae.mZ),k.rXU(Se.B),k.rXU(f.sg),k.rXU(U.w),k.rXU(L.Di))},Ac.ɵcmp=k.VBU({type:Ac,selectors:[["app-complete-trial-initiation"]],viewQuery:function(e,t){if(1&e&&k.GBs(Sc,5),2&e){let e;k.mGM(e=k.lsd())&&(t.verticalStepper=e.first)}},standalone:!1,decls:2,vars:1,consts:[["stepper",""],[1,"tw-flex","tw-items-center","tw-justify-center"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-muted",3,"title"],[1,"tw-sr-only"],[4,"ngIf"],[3,"onPasswordFormSubmit","flow","email","loading","masterPasswordPolicyOptions","primaryButtonText"],["linear","",3,"selectionChange"],["label","Create Account",3,"editable","subLabel"],["label","Organization Information",3,"subLabel"],[3,"nameOnly","formGroup"],["type","button","bitButton","","buttonType","primary",3,"click","disabled","loading"],["label","Billing",3,"subLabel",4,"ngIf"],["label","Confirmation Details",3,"applyBorder"],[3,"email","orgLabel","product","trialLength"],[1,"tw-mb-3","tw-flex"],["type","button","bitButton","","buttonType","primary",3,"routerLink"],["type","button","bitButton","","buttonType","secondary",1,"tw-ml-3","tw-inline-flex","tw-items-center","tw-px-3",3,"routerLink"],["label","Billing",3,"subLabel"],[3,"trial","steppedBack","organizationCreated",4,"ngIf"],[3,"steppedBack","organizationCreated","trial"]],template:function(e,t){1&e&&k.nVh(0,Fc,6,7,"div",1)(1,Ec,2,2),2&e&&k.vxM(t.initializing?0:1)},dependencies:[Y.bT,a.cb,a.j4,ne.Wk,oe.Q,Xl,Ul,Hl.T,mc,vc.t,bc,Y.Jj,Y.PV,ae.$],encapsulation:2});const Dc=e=>{const{product:t}=e.queryParams,i=(null!=t?t:"").split(",").map(e=>parseInt(e)),n=e.queryParams.trialLength?parseInt(e.queryParams.trialLength):7,r=1===i.length&&i[0]===ui.ch.PasswordManager,s=1===i.length&&i[0]===ui.ch.SecretsManager;switch(!0){case r:return{key:n>0?"continueSettingUpFreeTrialPasswordManager":"continueSettingUpPasswordManager"};case s:return{key:n>0?"continueSettingUpFreeTrialSecretsManager":"continueSettingUpSecretsManager"};default:return{key:n>0?"continueSettingUpFreeTrial":"continueSettingUp"}}};var Oc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Mc=()=>[];function Uc(e,t){if(1&e&&(k.j41(0,"a",8),k.nrm(1,"i",9),k.EFF(2),k.k0s()),2&e){const e=t.$implicit,i=k.XpG(2);k.BMQ("href",e==i.currentRegion?"javascript:void(0)":e.urls.webVault+i.routeAndParams,k.B4B),k.R7$(),k.xc7("visibility",e==i.currentRegion?"visible":"hidden"),k.R7$(),k.SpI(" ",e.domain," ")}}function Gc(e,t){if(1&e&&(k.j41(0,"div",2)(1,"bit-menu",null,0),k.DNE(3,Uc,3,4,"a",3),k.k0s(),k.j41(4,"div",4),k.EFF(5),k.nI1(6,"i18n"),k.j41(7,"a",5)(8,"b",6),k.EFF(9),k.k0s(),k.nrm(10,"i",7),k.k0s()()()),2&e){const e=k.sdS(2),t=k.XpG();k.R7$(3),k.Y8G("ngForOf",t.availableRegions),k.R7$(2),k.SpI(" ",k.bMT(6,5,"accessing"),": "),k.R7$(2),k.Y8G("routerLink",k.lJ4(7,Mc))("bitMenuTriggerFor",e),k.R7$(2),k.JRh(null==t.currentRegion?null:t.currentRegion.domain)}}class jc{constructor(e,t,i){this.platformUtilsService=e,this.environmentService=t,this.router=i,this.availableRegions=this.environmentService.availableRegions(),this.showRegionSelector=!1}ngOnInit(){return Oc(this,void 0,void 0,function*(){this.showRegionSelector=!this.platformUtilsService.isSelfHost(),this.routeAndParams=`/#${this.router.url}`;const e=Pn.A.getHost(window.location.href);this.currentRegion=this.availableRegions.find(t=>Pn.A.getHost(t.urls.webVault)===e)})}}jc.ɵfac=function(e){return new(e||jc)(k.rXU(N.y),k.rXU(St.v),k.rXU(x.Ix))},jc.ɵcmp=k.VBU({type:jc,selectors:[["environment-selector"]],decls:1,vars:1,consts:[["environmentOptions",""],["class","tw-mb-1",4,"ngIf"],[1,"tw-mb-1"],["bitMenuItem","",4,"ngFor","ngForOf"],["bitTypography","body2"],[3,"routerLink","bitMenuTriggerFor"],[1,"tw-text-primary-600","tw-font-medium"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sm","bwi-angle-down"],["bitMenuItem",""],["aria-hidden","true",1,"bwi","bwi-fw","bwi-sm","bwi-check"]],template:function(e,t){1&e&&k.DNE(0,Gc,11,8,"div",1),2&e&&k.Y8G("ngIf",t.showRegionSelector)},dependencies:[mi.G,Y.Sq,Y.bT,ne.Wk,Hr.Z,Wr.O,Jr.S,Ce.r,ae.$],encapsulation:2});var Nc=i(80504),Vc=i(45872),Bc=i(53127),zc=i(56634),Lc=i(41103);class Kc{constructor(e){this.logService=e,this.logs=[]}record(e){this.logs.push(e),this.logService.info(`[DataRecovery] ${e}`)}getLogs(){return[...this.logs]}}var qc=i(50451),_c=i(64194),Xc=i(23293),Yc=i(84274),Hc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Wc{constructor(e){this.apiService=e,this.title="recoveryStepSyncTitle"}runDiagnostics(e,t){return Hc(this,void 0,void 0,function*(){var i,n,r,s,o,a;const l=yield this.apiService.getSync();return e.ciphers=l.ciphers.map(e=>new Xc.o(new qc.A(e))),t.record(`Fetched ${e.ciphers.length} ciphers from server`),e.folders=l.folders.map(e=>new Yc.v(new _c.p(e))),t.record(`Fetched ${e.folders.length} folders from server`),e.encryptedPrivateKey=null!==(s=null===(r=null===(n=null===(i=l.profile)||void 0===i?void 0:i.accountKeys)||void 0===n?void 0:n.publicKeyEncryptionKeyPair)||void 0===r?void 0:r.wrappedPrivateKey)&&void 0!==s?s:null,t.record(`Fetched encrypted private key of length ${null!==(a=null===(o=e.encryptedPrivateKey)||void 0===o?void 0:o.length)&&void 0!==a?a:0} from server`),!0})}canRecover(e){return!1}runRecovery(e,t){return Promise.resolve()}}var Jc=i(68467),Zc=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Qc{constructor(e,t){this.accountService=e,this.keyService=t,this.title="recoveryStepUserInfoTitle"}runDiagnostics(e,t){return Zc(this,void 0,void 0,function*(){const i=yield(0,u._)(this.accountService.activeAccount$);if(!i)return t.record("No active account found"),!1;const n=i.id;e.userId=n,t.record(`User ID: ${n}`);const r=yield(0,u._)(this.keyService.userKey$(n));return r?(e.userKey=r,t.record("User encryption type: "+(r.inner().type===Jc.Qd.AesCbc256_HmacSha256_B64?"V1":r.inner().type===Jc.Qd.CoseEncrypt0?"Cose":"Unknown")),!0):(t.record("No user key found"),!1)})}canRecover(e){return!1}runRecovery(e,t){return Promise.resolve()}}var ed=i(62870),td=i(82781),id=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class nd{constructor(e,t,i){this.privateKeyRegenerationService=e,this.dialogService=t,this.cryptoFunctionService=i,this.title="recoveryStepPrivateKeyTitle"}runDiagnostics(e,t){return id(this,void 0,void 0,function*(){if(!e.userId||!e.userKey)return t.record("Missing user ID or user key"),!1;const i=e.encryptedPrivateKey;if(!i)return t.record("No encrypted private key found"),!1;let n;t.record("Private key length: "+i.length);try{yield ed.B.Ready,n=td.PureCrypto.unwrap_decapsulation_key(i,e.userKey.toEncoded())}catch(r){return t.record("Private key was un-decryptable"),e.isPrivateKeyCorrupt=!0,!1}try{const e=yield this.cryptoFunctionService.rsaExtractPublicKey(n);t.record("Public key length: "+e.length)}catch(s){return t.record("Public key could not be derived; private key is corrupt"),e.isPrivateKeyCorrupt=!0,!1}return!0})}canRecover(e){return e.isPrivateKeyCorrupt&&null!==e.userKey&&e.userKey.inner().type===Jc.Qd.AesCbc256_HmacSha256_B64}runRecovery(e,t){return id(this,void 0,void 0,function*(){t.record("Showing confirmation dialog for private key replacement");if(!(yield this.dialogService.openSimpleDialog({title:{key:"recoveryReplacePrivateKeyTitle"},content:{key:"recoveryReplacePrivateKeyDesc"},acceptButtonText:{key:"ok"},cancelButtonText:{key:"cancel"},type:"danger"})))throw t.record("User cancelled private key replacement"),new Error("Private key recovery cancelled by user");t.record("Replacing private key"),yield this.privateKeyRegenerationService.regenerateUserPublicKeyEncryptionKeyPair(e.userId),t.record("Private key replaced successfully")})}}var rd=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class sd{constructor(e,t){this.folderService=e,this.dialogService=t,this.title="recoveryStepFoldersTitle",this.undecryptableFolderIds=[]}runDiagnostics(e,t){return rd(this,void 0,void 0,function*(){var i;if(!e.userKey)return t.record("Missing user key"),!1;this.undecryptableFolderIds=[];for(const r of e.folders)if(null===(i=r.name)||void 0===i?void 0:i.encryptedString)try{yield ed.B.Ready,td.PureCrypto.symmetric_decrypt_string(r.name.encryptedString,e.userKey.toEncoded())}catch(n){t.record(`Folder name for folder ID ${r.id} was undecryptable`),this.undecryptableFolderIds.push(r.id)}else t.record(`Folder ID ${r.id} has no name`),this.undecryptableFolderIds.push(r.id);return t.record(`Found ${this.undecryptableFolderIds.length} undecryptable folders`),0==this.undecryptableFolderIds.length})}canRecover(e){return this.undecryptableFolderIds.length>0}runRecovery(e,t){return rd(this,void 0,void 0,function*(){if(0===this.undecryptableFolderIds.length)return void t.record("No undecryptable folders to recover");if(!e.userId)throw t.record("Missing user ID"),new Error("Missing user ID");t.record(`Showing confirmation dialog for ${this.undecryptableFolderIds.length} folders`);if(!(yield this.dialogService.openSimpleDialog({title:{key:"recoveryDeleteFoldersTitle"},content:{key:"recoveryDeleteFoldersDesc"},acceptButtonText:{key:"ok"},cancelButtonText:{key:"cancel"},type:"danger"})))throw t.record("User cancelled folder deletion"),new Error("Folder recovery cancelled by user");t.record(`Deleting ${this.undecryptableFolderIds.length} folders`);for(const n of this.undecryptableFolderIds)try{yield this.folderService.delete(n,e.userId),t.record(`Deleted folder ${n}`)}catch(i){t.record(`Failed to delete folder ${n}: ${i}`)}t.record(`Successfully deleted ${this.undecryptableFolderIds.length} folders`)})}getUndecryptableFolderIds(){return this.undecryptableFolderIds}}var od=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ad{constructor(e,t,i){this.apiService=e,this.cipherService=t,this.dialogService=i,this.title="recoveryStepCipherTitle",this.undecryptableCipherIds=[]}runDiagnostics(e,t){return od(this,void 0,void 0,function*(){if(!e.userId)return t.record("Missing user ID"),!1;this.undecryptableCipherIds=[];for(const n of e.ciphers)try{yield this.cipherService.decrypt(n,e.userId)}catch(i){t.record(`Cipher ID ${n.id} was undecryptable`),this.undecryptableCipherIds.push(n.id)}return t.record(`Found ${this.undecryptableCipherIds.length} undecryptable ciphers`),0==this.undecryptableCipherIds.length})}canRecover(e){return this.undecryptableCipherIds.length>0}runRecovery(e,t){return od(this,void 0,void 0,function*(){if(0===this.undecryptableCipherIds.length)return void t.record("No undecryptable ciphers to recover");t.record(`Showing confirmation dialog for ${this.undecryptableCipherIds.length} ciphers`);if(!(yield this.dialogService.openSimpleDialog({title:{key:"recoveryDeleteCiphersTitle"},content:{key:"recoveryDeleteCiphersDesc"},acceptButtonText:{key:"ok"},cancelButtonText:{key:"cancel"},type:"danger"})))throw t.record("User cancelled cipher deletion"),new Error("Cipher recovery cancelled by user");t.record(`Deleting ${this.undecryptableCipherIds.length} ciphers`);for(const i of this.undecryptableCipherIds)try{yield this.apiService.deleteCipher(i),t.record(`Deleted cipher ${i}`)}catch(e){const n=e instanceof Error?e.message:String(e);throw t.record(`Failed to delete cipher ${i}: ${n}`),e}t.record(`Successfully deleted ${this.undecryptableCipherIds.length} ciphers`)})}}var ld=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function cd(e,t){if(1&e&&(k.j41(0,"button",3),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.Y8G("bitAction",e.runDiagnostics),k.R7$(),k.SpI(" ",k.bMT(2,2,"runDiagnostics")," ")}}function dd(e,t){1&e&&k.nrm(0,"i",8)}function ud(e,t){1&e&&k.nrm(0,"i",9)}function hd(e,t){1&e&&k.nrm(0,"i",10)}function pd(e,t){1&e&&k.nrm(0,"i",11)}function md(e,t){if(1&e&&(k.j41(0,"div",6)(1,"div",7),k.nVh(2,dd,1,0,"i",8)(3,ud,1,0,"i",9)(4,hd,1,0,"i",10)(5,pd,1,0,"i",11),k.k0s(),k.j41(6,"div")(7,"span"),k.EFF(8),k.k0s()()()),2&e){const e=k.XpG().$implicit,t=k.XpG();k.R7$(2),k.vxM(e.status===t.StepStatus.Failed?2:e.status===t.StepStatus.Completed?3:e.status===t.StepStatus.InProgress?4:5),k.R7$(5),k.AVh("tw-text-danger",e.status===t.StepStatus.Failed)("tw-text-success",e.status===t.StepStatus.Completed)("tw-text-primary-600",e.status===t.StepStatus.InProgress)("tw-font-semibold",e.status===t.StepStatus.InProgress)("tw-text-secondary-500",e.status===t.StepStatus.NotStarted),k.R7$(),k.SpI(" ",e.title," ")}}function vd(e,t){if(1&e&&k.nVh(0,md,9,12,"div",6),2&e){const e=t.$index,i=k.XpG();k.vxM(0===e&&i.hasStarted()||e>0&&(i.steps()[e-1].status===i.StepStatus.Completed||i.steps()[e-1].status===i.StepStatus.Failed)?0:-1)}}function fd(e,t){if(1&e&&(k.j41(0,"button",12),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG(2);k.Y8G("disabled",e.status()===e.StepStatus.InProgress)("bitAction",e.runRecovery),k.R7$(),k.SpI(" ",k.bMT(2,3,"repairIssues")," ")}}function gd(e,t){if(1&e&&(k.j41(0,"div",5),k.nVh(1,fd,3,5,"button",12),k.j41(2,"button",13),k.nrm(3,"i",14),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.R7$(),k.vxM(e.hasIssues()&&!e.recoveryCompleted()?1:-1),k.R7$(),k.Y8G("bitAction",e.saveDiagnosticLogs),k.R7$(2),k.SpI(" ",k.bMT(5,3,"saveDiagnosticLogs")," ")}}const yd=Object.freeze({NotStarted:0,InProgress:1,Completed:2,Failed:3});class bd{constructor(){this.StepStatus=yd,this.i18nService=(0,C.WQX)(j.W),this.apiService=(0,C.WQX)(fi.G),this.accountService=(0,C.WQX)(L.Di),this.keyService=(0,C.WQX)(I.Lu),this.folderApiService=(0,C.WQX)(Lc.w),this.cipherEncryptService=(0,C.WQX)(zc.q),this.dialogService=(0,C.WQX)(E.o3),this.privateKeyRegenerationService=(0,C.WQX)(I.wM),this.cryptoFunctionService=(0,C.WQX)(Vc.R),this.logService=(0,C.WQX)(no.Kc),this.fileDownloadService=(0,C.WQX)(Bc.y),this.logger=new Kc(this.logService),this.recoverySteps=[new Qc(this.accountService,this.keyService),new Wc(this.apiService),new nd(this.privateKeyRegenerationService,this.dialogService,this.cryptoFunctionService),new sd(this.folderApiService,this.dialogService),new ad(this.apiService,this.cipherEncryptService,this.dialogService)],this.workingData=null,this.status=(0,C.vPA)(yd.NotStarted),this.hasStarted=(0,C.vPA)(!1),this.diagnosticsCompleted=(0,C.vPA)(!1),this.recoveryCompleted=(0,C.vPA)(!1),this.steps=(0,C.vPA)(this.recoverySteps.map(e=>({title:this.i18nService.t(e.title),status:yd.NotStarted}))),this.hasIssues=(0,C.vPA)(!1),this.runDiagnostics=()=>ld(this,void 0,void 0,function*(){this.status()!==yd.InProgress&&(this.hasStarted.set(!0),this.status.set(yd.InProgress),this.diagnosticsCompleted.set(!1),this.logger.record("Starting diagnostics..."),this.workingData={userId:null,userKey:null,isPrivateKeyCorrupt:!1,encryptedPrivateKey:null,ciphers:[],folders:[]},yield this.runDiagnosticsInternal(),this.status.set(yd.Completed),this.diagnosticsCompleted.set(!0))}),this.runRecovery=()=>ld(this,void 0,void 0,function*(){if(this.status()!==yd.InProgress&&this.workingData){this.status.set(yd.InProgress),this.recoveryCompleted.set(!1),this.logger.record("Starting recovery process...");try{for(let e=0;e<this.recoverySteps.length;e++){const t=this.recoverySteps[e];t.canRecover(this.workingData)&&(this.logger.record(`Running recovery for step: ${t.title}`),yield t.runRecovery(this.workingData,this.logger))}this.logger.record("Recovery process completed"),this.recoveryCompleted.set(!0),this.logger.record("Re-running diagnostics to verify recovery..."),yield this.runDiagnosticsInternal(),this.status.set(yd.Completed)}catch(e){this.logger.record(`Recovery process cancelled or failed: ${e.message}`),this.status.set(yd.Failed)}}}),this.saveDiagnosticLogs=()=>{const e=this.logger.getLogs(),t=`data-recovery-logs-${(new Date).toISOString().replace(/[:.]/g,"-")}.txt`,i=e.join("\n");this.fileDownloadService.download({fileName:t,blobData:i,blobOptions:{type:"text/plain"}}),this.logger.record("Diagnostic logs saved")}}runDiagnosticsInternal(){return ld(this,void 0,void 0,function*(){if(!this.workingData)return void this.logger.record("No working data available");const e=this.steps();let t=!1;for(let r=0;r<this.recoverySteps.length;r++){const i=this.recoverySteps[r];e[r].status=yd.InProgress,this.steps.set([...e]),this.logger.record(`Running diagnostics for step: ${i.title}`);try{const n=yield i.runDiagnostics(this.workingData,this.logger);e[r].status=n?yd.Completed:yd.Failed,n||(t=!0),this.steps.set([...e]),this.logger.record(`Diagnostics completed for step: ${i.title}`)}catch(n){e[r].status=yd.Failed,e[r].message=n.message,this.steps.set([...e]),this.logger.record(`Diagnostics failed for step: ${i.title} with error: ${n.message}`),t=!0}}t?this.logger.record("Diagnostics completed with errors"):this.logger.record("Diagnostics completed successfully");const i=this.recoverySteps.some(e=>e.canRecover(this.workingData));this.hasIssues.set(i)})}}bd.ɵfac=function(e){return new(e||bd)},bd.ɵcmp=k.VBU({type:bd,selectors:[["app-data-recovery"]],decls:12,vars:8,consts:[[1,"tw-mt-6","tw-mb-2","tw-pb-2.5"],[1,"tw-max-w-lg"],["bitTypography","body1",1,"tw-mb-4"],["type","button","bitButton","","buttonType","primary",1,"tw-mb-6",3,"bitAction"],[1,"tw-space-y-3","tw-mb-6"],[1,"tw-flex","tw-gap-3"],[1,"tw-flex","tw-items-start","tw-gap-3"],[1,"tw-mt-1"],["aria-hidden","true",1,"bwi","bwi-close","tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-check","tw-text-success"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-primary-600"],["aria-hidden","true",1,"bwi","bwi-circle","tw-text-secondary-300"],["type","button","bitButton","","buttonType","primary",3,"disabled","bitAction"],["type","button","bitButton","","buttonType","secondary",3,"bitAction"],["aria-hidden","true",1,"bwi","bwi-download"]],template:function(e,t){1&e&&(k.j41(0,"h2",0),k.EFF(1),k.nI1(2,"i18n"),k.k0s(),k.j41(3,"div",1)(4,"p",2),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.nVh(7,cd,3,4,"button",3),k.j41(8,"div",4),k.Z7z(9,vd,1,1,null,null,k.Vm6),k.k0s(),k.nVh(11,gd,6,5,"div",5),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,4,"dataRecoveryTitle")),k.R7$(4),k.SpI(" ",k.bMT(6,6,"dataRecoveryDescription")," "),k.R7$(2),k.vxM(t.diagnosticsCompleted()||t.recoveryCompleted()?-1:7),k.R7$(2),k.Dyx(t.steps()),k.R7$(2),k.vxM(t.diagnosticsCompleted()?11:-1))},dependencies:[re.p,se.t,oe.Q,Y.MD,mi.G,Qt.p,Ce.r,ae.$],encapsulation:2,changeDetection:0});var wd=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Sd{constructor(e){this.routerService=e,this.onBeforeNavigation=()=>wd(this,void 0,void 0,function*(){yield this.routerService.getAndClearLoginRedirectUrl()})}}Sd.ɵfac=function(e){return new(e||Sd)(k.rXU(ie.HM))},Sd.ɵcmp=k.VBU({type:Sd,selectors:[["app-confirm-key-connector-domain"]],decls:1,vars:1,consts:[[3,"onBeforeNavigation"]],template:function(e,t){1&e&&k.nrm(0,"confirm-key-connector-domain",0),2&e&&k.Y8G("onBeforeNavigation",t.onBeforeNavigation)},dependencies:[_t.O0],encapsulation:2});var Id=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class kd{constructor(e){this.platformUtilsService=e,this.year="2015"}ngOnInit(){return Id(this,void 0,void 0,function*(){this.year=(new Date).getFullYear().toString(),this.version=yield this.platformUtilsService.getApplicationVersion(),document.body.classList.add("layout_frontend")})}ngOnDestroy(){document.body.classList.remove("layout_frontend")}}kd.ɵfac=function(e){return new(e||kd)(k.rXU(N.y))},kd.ɵcmp=k.VBU({type:kd,selectors:[["app-frontend-layout"]],decls:12,vars:1,consts:[[1,"tw-text-center","tw-my-12"],["bitTypography","body2"],["bitTypography","helper","id","vw-disclaimer"]],template:function(e,t){1&e&&(k.nrm(0,"router-outlet"),k.j41(1,"footer",0),k.nrm(2,"environment-selector"),k.j41(3,"div",1),k.EFF(4,"Vaultwarden Web"),k.k0s(),k.j41(5,"div",1),k.EFF(6),k.k0s(),k.nrm(7,"br"),k.j41(8,"div",2),k.EFF(9," A modified version of the Bitwarden® Web Vault for Vaultwarden (an unofficial rewrite of the Bitwarden® server)."),k.nrm(10,"br"),k.EFF(11," Vaultwarden is not associated with the Bitwarden® project nor Bitwarden Inc. "),k.k0s()()),2&e&&(k.R7$(6),k.JRh(t.version))},dependencies:[mi.G,x.n3,Ce.r,jc],encapsulation:2});const Cd=$e.Sm`
<svg version="1.1" viewBox="0 0 800 200" xmlns="http://www.w3.org/2000/svg">
<g class="tw-fill-text-alt2" clip-path="url(#password-manager-logo-clip)">
 <path d="m457.16 129.39-11.407-36.49q-1.0783-3.3482-4.0292-15.209h-.454q-2.27 9.9313-3.9725 15.322l-11.747 36.377h-10.896l-16.968-62.197h9.8744q6.0158 23.438 9.137 35.696 3.178 12.258 3.632 16.514h.454q.62424-3.2347 1.9863-8.342 1.4188-5.1642 2.4402-8.1717l11.407-35.696h10.215l11.123 35.696q3.178 9.7611 4.313 16.401h.454q.227-2.043 1.1918-6.2993 1.0215-4.2562 11.861-45.797h9.7611l-17.195 62.197zm77.858 0-1.8727-8.8528h-.454q-4.6535 5.8455-9.3072 7.9451-4.5968 2.043-11.52 2.043-9.2503 0-14.528-4.767-5.221-4.767-5.221-13.563 0-18.841 30.134-19.749l10.555-.3405v-3.859q0-7.3209-3.178-10.783-3.1212-3.5185-10.045-3.5185-7.7748 0-17.592 4.767l-2.8943-7.207q4.5968-2.497 10.045-3.9158 5.5048-1.4187 11.009-1.4187 11.123 0 16.457 4.9373 5.3912 4.9373 5.3912 15.833v42.449zm-21.281-6.6399q8.7964 0 13.79-4.8238 5.0508-4.8238 5.0508-13.506v-5.6183l-9.4205.39725q-11.237.39725-16.231 3.5185-4.9372 3.0645-4.9372 9.5908 0 5.1075 3.0645 7.7748 3.1212 2.6672 8.6825 2.6672zm76.045-56.693q4.1428 0 7.4343.68101l-1.3053 8.7395q-3.859-.85122-6.8101-.85122-7.5476 0-12.939 6.1291-5.3345 6.1291-5.3345 15.266v33.369h-9.4205v-62.197h7.7748l1.0783 11.52h.454q3.4617-6.0721 8.3425-9.3636 4.8805-3.2915 10.726-3.2915zm59.077 54.991h-.51081q-6.526 9.4775-19.522 9.4775-12.201 0-19.011-8.342-6.7532-8.342-6.7532-23.721t6.8102-23.892q6.8101-8.5122 18.954-8.5122 12.655 0 19.408 9.1933h.73779l-.39725-4.4832-.22704-4.3697v-25.311h9.4205v88.301h-7.6615zm-18.841 1.589q9.6478 0 13.96-5.221 4.3697-5.2777 4.3697-16.968v-1.9863q0-13.223-4.4264-18.841-4.3698-5.675-14.017-5.675-8.2856 0-12.712 6.4696-4.3698 6.4127-4.3698 18.16 0 11.918 4.3698 17.99 4.3697 6.0721 12.825 6.0721zm74 7.8881q-13.79 0-21.792-8.3989-7.9451-8.3989-7.9451-23.324 0-15.039 7.3773-23.892 7.4343-8.8528 19.919-8.8528 11.69 0 18.501 7.7179 6.8101 7.6615 6.8101 20.26v5.9588h-42.846q.28376 10.953 5.5048 16.628 5.2777 5.675 14.812 5.675 10.045 0 19.863-4.1995v8.3989q-4.994 2.1565-9.4775 3.0645-4.4265.96478-10.726.96478zm-2.5537-56.58q-7.4912 0-11.975 4.8805-4.4265 4.8805-5.221 13.506h32.518q0-8.9097-3.9725-13.62-3.9725-4.767-11.35-4.767zm84.047 55.445v-40.236q0-7.6045-3.4617-11.35-3.4618-3.7455-10.839-3.7455-9.7611 0-14.301 5.2777t-4.54 17.422v32.631h-9.4205v-62.197h7.6615l1.5322 8.5122h.45403q2.8942-4.5968 8.1153-7.0937 5.221-2.5537 11.634-2.5537 11.237 0 16.912 5.448 5.675 5.3912 5.675 17.309v40.576z"/>
 <path d="m213.24 129.39-3.3482-8.6261h-.454q-4.3697 5.5048-9.023 7.6615-4.5968 2.0998-12.031 2.0998-9.137 0-14.415-5.221-5.221-5.221-5.221-14.869 0-10.102 7.0368-14.869 7.0937-4.8238 21.338-5.3345l11.009-.3405v-2.7808q0-9.6478-9.8744-9.6478-7.6045 0-17.876 4.5968l-5.7318-11.69q10.953-5.7318 24.289-5.7318 12.769 0 19.579 5.5615 6.8102 5.5615 6.8102 16.912v42.279zm-5.1075-29.397-6.6962.227q-7.5476.227-11.237 2.724-3.6888 2.497-3.6888 7.6045 0 7.321 8.3989 7.321 6.0158 0 9.5908-3.4617 3.632-3.4617 3.632-9.1933zm79.962 29.397-2.3268-8.1153h-.908q-2.7808 4.4265-7.8881 6.8665-5.1075 2.3835-11.634 2.3835-11.18 0-16.855-5.9588-5.675-6.0158-5.675-17.252v-41.371h17.309v37.058q0 6.8665 2.4402 10.328 2.4402 3.405 7.7748 3.405 7.264 0 10.499-4.8238 3.2348-4.8805 3.2348-16.117v-29.85h17.309v63.447zm48.748 0h-17.309v-88.301h17.309zm44.889-12.655q4.54 0 10.896-1.9863v12.882q-6.4696 2.8943-15.89 2.8943-10.385 0-15.152-5.221-4.7103-5.2777-4.7103-15.776v-30.588h-8.2856v-7.321l9.5338-5.7885 4.994-13.393h11.066v13.506h17.763v12.996h-17.763v30.588q0 3.6887 2.043 5.448 2.0998 1.7592 5.5047 1.7592z"/>
 <path d="m51.982 33.947-15.322.002 41.131 115.17h14.518l41.131-115.17h-15.162l-25.971 73.872c-1.7205 4.7315-3.1706 9.1927-4.3535 13.387-1.1829 4.086-2.1516 8.0119-2.9043 11.775-.75272-3.7636-1.7195-7.7417-2.9023-11.936-1.1829-4.1938-2.635-8.7098-4.3555-13.549l-25.809-73.552z"/>
 <path d="m84.264 5.0749a2.3288 2.3288 0 00-1.2122.99654l-4.145 6.9077c-.72599.06029-1.4502.12529-2.1701.20657l-5.406-5.9599a2.3288 2.3288 0 00-3.9203.77975l-2.7161 7.5796c-.7008.20184-1.4008.40458-2.0929.62653l-6.4616-4.7875a2.3288 2.3288 0 00-3.691 1.53l-1.1884 7.9871c-.63834.33084-1.2749.66363-1.9023 1.0124l-7.297-3.4482a2.3288 2.3288 0 00-3.3222 2.2201l.39272 8.0937c-.55229.44111-1.0997.8874-1.639 1.3438l-7.8588-1.9647a2.3288 2.3288 0 00-2.825 2.825l1.9647 7.8588c-.45646.53923-.90273 1.0867-1.3439 1.639l-8.0937-.39271a2.3288 2.3288 0 00-2.2201 3.3222l3.4482 7.297c-.3488.62737-.68158 1.2639-1.0124 1.9023l-7.9871 1.1884a2.3288 2.3288 0 00-1.53 3.6911l4.7875 6.4616c-.22196.69217-.4247 1.3921-.62653 2.093l-7.5796 2.7161a2.3288 2.3288 0 00-.77976 3.9203l5.9599 5.4061c-.08128.71995-.14628 1.4442-.20657 2.1701l-6.9077 4.1451a2.3288 2.3288 0 000 3.9952l6.9077 4.1439c.06028.72636.12524 1.451.20657 2.1713l-5.9599 5.4061a2.3288 2.3288 0 00.77976 3.9192l7.5796 2.7161c.20188.70099.4045 1.4017.62653 2.0941l-4.7875 6.4605a2.3288 2.3288 0 001.53 3.6922l7.9871 1.1884c.33079.63822.6637 1.275 1.0124 1.9023l-3.4482 7.297a2.3288 2.3288 0 002.2201 3.3222l8.0937-.39272c.44117.55235.88734 1.0997 1.3439 1.639l-1.9647 7.8588a2.3288 2.3288 0 002.825 2.825l7.8588-1.9647c.53923.45647 1.0867.90273 1.639 1.3438l-.39272 8.0926a2.3288 2.3288 0 003.3222 2.2201l7.297-3.447c.62736.34881 1.2639.68158 1.9023 1.0124l1.1884 7.987a2.3288 2.3288 0 003.691 1.5289l6.4616-4.7864c.69217.22197 1.3921.4247 2.0929.62654l2.7161 7.5796a2.3288 2.3288 0 003.9203.7786l5.4049-5.9588c.72031.0813 1.4449.14624 2.1713.20656l4.145 6.9077a2.3288 2.3288 0 003.9952 0l4.1439-6.9077c.72674-.0603 1.4517-.12518 2.1724-.20656l5.4049 5.9588a2.3288 2.3288 0 003.9192-.7786l2.7161-7.5796c.70103-.20189 1.4017-.4045 2.0941-.62654l6.4605 4.7864a2.3288 2.3288 0 003.6922-1.5289l1.1884-7.987c.63823-.33079 1.275-.6637 1.9023-1.0124l7.297 3.447a2.3288 2.3288 0 003.3222-2.2201l-.39271-8.0926c.55234-.44117 1.0997-.88734 1.639-1.3438l7.8588 1.9647a2.3288 2.3288 0 002.825-2.825l-1.9647-7.8588c.4565-.53928.90269-1.0866 1.3438-1.639l8.0926.39272a2.3288 2.3288 0 002.2201-3.3222l-3.447-7.297c.34872-.62723.68163-1.264 1.0124-1.9023l7.987-1.1884a2.3288 2.3288 0 001.5289-3.6922l-4.7863-6.4605c.22202-.69235.42462-1.3931.62652-2.0941l7.5796-2.7161a2.3288 2.3288 0 00.77862-3.9192l-5.9588-5.4049c.0814-.72069.14623-1.4457.20658-2.1724l6.9077-4.1439a2.3288 2.3288 0 000-3.9952l-6.9077-4.1451c-.0603-.72635-.12524-1.451-.20658-2.1713l5.9588-5.4049a2.3288 2.3288 0 00-.77862-3.9203l-7.5796-2.7161c-.20184-.70082-.40457-1.4008-.62652-2.093l4.7863-6.4616a2.3288 2.3288 0 00-1.5289-3.6911l-7.987-1.1884c-.33084-.63836-.66362-1.2749-1.0124-1.9023l3.447-7.297a2.3288 2.3288 0 00-2.2201-3.3222l-8.0926.39271c-.44112-.55229-.8874-1.0997-1.3438-1.639l1.9647-7.8588a2.3288 2.3288 0 00-2.825-2.825l-7.8588 1.9647c-.53927-.4565-1.0866-.9027-1.639-1.3438l.39271-8.0937a2.3288 2.3288 0 00-3.3222-2.2201l-7.297 3.4482c-.62726-.34873-1.264-.68165-1.9023-1.0124l-1.1884-7.9871a2.3288 2.3288 0 00-3.6922-1.53l-6.4605 4.7875c-.69236-.22201-1.3931-.42463-2.0941-.62653l-2.7161-7.5796a2.3288 2.3288 0 00-3.9192-.77975l-5.406 5.9599c-.72032-.08133-1.4449-.14626-2.1713-.20657l-4.1439-6.9077a2.3288 2.3288 0 00-2.783-.99654zm.78543 14.613a4.657 4.657 0 014.6569 4.6569 4.657 4.657 0 01-4.6569 4.6569 4.657 4.657 0 01-4.6569-4.6569 4.657 4.657 0 014.6569-4.6569zm-10.998 8.0064 7.7056 7.7056a4.6575 4.6575 0 006.5853 0l7.7056-7.7056c17.959 3.3214 33.023 14.65 41.468 30.141l-4.943 9.6998a4.6575 4.6575 0 002.0351 6.263l9.7123 4.9486c.32157 2.5182.49487 5.0839.49487 7.692 0 15.934-6.1974 30.369-16.306 41.066l-10.796-1.7093a4.6575 4.6575 0 00-5.3277 3.8704l-1.7116 10.804c-7.7603 3.6739-16.443 5.734-25.624 5.734-9.1812 0-17.864-2.0608-25.625-5.7352l-1.7116-10.803a4.6575 4.6575 0 00-5.3277-3.8715l-10.795 1.7105c-10.108-10.697-16.306-25.132-16.306-41.066 0-2.608.1733-5.1738.49487-7.692l9.7111-4.9486a4.6575 4.6575 0 002.0351-6.263l-4.9418-9.6986c8.4449-15.492 23.508-26.821 41.468-30.142zm-47.923 34.902a4.657 4.657 0 011.3064.22587 4.657 4.657 0 012.9896 5.868 4.657 4.657 0 01-5.868 2.9907 4.657 4.657 0 01-2.9907-5.8691 4.657 4.657 0 014.5627-3.2155zm117.84 0a4.657 4.657 0 014.5616 3.2155 4.657 4.657 0 01-2.9896 5.8691 4.657 4.657 0 01-5.868-2.9907 4.657 4.657 0 012.9896-5.868 4.657 4.657 0 011.3064-.22587zm-95.153 69.428a4.657 4.657 0 012.4709.88189 4.657 4.657 0 011.0306 6.5047 4.657 4.657 0 01-6.5047 1.0306 4.657 4.657 0 01-1.0306-6.5047 4.657 4.657 0 014.0338-1.9125zm72.463 0a4.657 4.657 0 014.0338 1.9125 4.657 4.657 0 01-1.0306 6.5047 4.657 4.657 0 01-6.5047-1.0306 4.657 4.657 0 011.0306-6.5047 4.657 4.657 0 012.4709-.88189z"/>
 <path d="m304.87 145.51q7.8436 0 11.429 3.0814t3.5857 8.684q0 3.3055-1.5127 6.2189-1.4567 2.8573-4.9863 4.6502-3.4736 1.7928-9.4684 1.7928h-4.5941v15.575h-5.0423v-40.003zm-.44821 4.314h-5.0984v15.799h4.0339q5.7147 0 8.516-1.8489 2.8013-1.8488 2.8013-6.2749 0-3.8658-2.4652-5.7707-2.4651-1.9049-7.7876-1.9049zm34.456 5.1544q5.4906 0 8.1238 2.4091t2.6332 7.6756v20.449h-3.5857l-.95244-4.258h-.2241q-1.9609 2.4651-4.1459 3.6417-2.129 1.1765-5.9388 1.1765-4.0899 0-6.7792-2.129-2.6892-2.185-2.6892-6.7791 0-4.4821 3.5296-6.8912 3.5296-2.4651 10.869-2.6892l5.0984-.16808v-1.7928q0-3.7537-1.6248-5.2104t-4.5941-1.4567q-2.3531 0-4.4821.72834-2.129.67231-3.9778 1.5687l-1.5127-3.6977q1.9609-1.0645 4.6502-1.7928 2.6892-.78437 5.6026-.78437zm1.4567 16.023q-5.6026.2241-7.7876 1.7928-2.129 1.5687-2.129 4.426 0 2.5212 1.5127 3.6977 1.5687 1.1766 3.9778 1.1766 3.8098 0 6.3309-2.073 2.5212-2.129 2.5212-6.499v-2.6892zm38.154 6.2189q0 4.37-3.2495 6.6111-3.2495 2.241-8.7401 2.241-3.1375 0-5.4345-.50423-2.241-.50424-3.9778-1.4006v-4.4821q1.7928.89641 4.314 1.6808 2.5772.72834 5.2104.72834 3.7537 0 5.4345-1.1766 1.6808-1.2326 1.6808-3.2495 0-1.1205-.61628-2.0169-.61629-.89642-2.241-1.7928-1.5687-.89641-4.5381-2.0169-2.9134-1.1205-4.9863-2.241t-3.1935-2.6892-1.1205-4.0339q0-3.8098 3.0814-5.8827 3.1374-2.073 8.1798-2.073 2.7453 0 5.0984.56026 2.4091.50423 4.4821 1.4567l-1.6808 3.9218q-1.9049-.78436-3.9778-1.3446t-4.258-.56026q-3.0254 0-4.6502 1.0085-1.5687.95244-1.5687 2.6332 0 1.2326.72834 2.129.72834.84039 2.4091 1.6808 1.7368.78436 4.5941 1.9049 2.8573 1.0645 4.8743 2.185t3.0814 2.7453q1.0645 1.5687 1.0645 3.9778zm26.836 0q0 4.37-3.2495 6.6111t-8.74 2.241q-3.1375 0-5.4345-.50423-2.241-.50424-3.9778-1.4006v-4.4821q1.7928.89641 4.314 1.6808 2.5772.72834 5.2104.72834 3.7537 0 5.4345-1.1766 1.6808-1.2326 1.6808-3.2495 0-1.1205-.61629-2.0169-.61628-.89642-2.241-1.7928-1.5687-.89641-4.5381-2.0169-2.9134-1.1205-4.9863-2.241-2.073-1.1205-3.1935-2.6892t-1.1205-4.0339q0-3.8098 3.0814-5.8827 3.1375-2.073 8.1798-2.073 2.7453 0 5.0984.56026 2.4091.50423 4.4821 1.4567l-1.6808 3.9218q-1.9049-.78436-3.9778-1.3446t-4.258-.56026q-3.0254 0-4.6502 1.0085-1.5687.95244-1.5687 2.6332 0 1.2326.72833 2.129.72834.84039 2.4091 1.6808 1.7368.78436 4.5941 1.9049 2.8573 1.0645 4.8743 2.185 2.0169 1.1205 3.0814 2.7453 1.0645 1.5687 1.0645 3.9778zm26.668-8.684q-.72834-2.2971-1.2886-4.4821-.50424-2.241-.78437-3.4736h-.2241q-.2241 1.2326-.72834 3.4736-.50423 2.185-1.2886 4.5381l-5.3785 16.864h-5.6026l-8.2358-30.03h5.0984l4.1459 16.023q.61628 2.4091 1.1765 4.8743.56026 2.4651.78437 4.0899h.2241q.2241-.95245.50423-2.3531.33616-1.4006.72834-2.9134.39218-1.5687.78437-2.8013l5.3225-16.92h5.3785l5.1544 16.92q.61629 1.9049 1.1766 4.1459.61629 2.241.84039 3.8658h.2241q.16808-1.4006.72834-3.8658.61629-2.4652 1.2886-5.0423l4.202-16.023h5.0423l-8.3479 30.03h-5.7707zm50.76 1.9049q0 7.4515-3.8098 11.541-3.7537 4.0899-10.197 4.0899-3.9778 0-7.1153-1.7928-3.0814-1.8489-4.8743-5.3225-1.7928-3.5296-1.7928-8.516 0-7.4515 3.7537-11.485t10.197-4.0339q4.0899 0 7.1713 1.8488 3.1375 1.7928 4.8743 5.2664 1.7928 3.4176 1.7928 8.4039zm-22.691 0q0 5.3225 2.073 8.4599 2.129 3.0814 6.7231 3.0814 4.5381 0 6.6671-3.0814 2.129-3.1374 2.129-8.4599t-2.129-8.3479q-2.129-3.0254-6.7231-3.0254t-6.6671 3.0254q-2.073 3.0254-2.073 8.3479zm44.485-15.519q.84039 0 1.7928.11205 1.0085.056 1.7368.2241l-.61628 4.5381q-.72834-.16808-1.6248-.28013-.84039-.11205-1.6248-.11205-2.2971 0-4.314 1.2886-2.0169 1.2326-3.2495 3.5296-1.1766 2.241-1.1766 5.2664v16.023h-4.9303v-30.03h4.0339l.56026 5.4905h.2241q1.4567-2.4651 3.7537-4.258 2.2971-1.7928 5.4345-1.7928zm18.657 31.15q-5.6026 0-8.9642-3.8658-3.3616-3.9218-3.3616-11.653t3.3616-11.653q3.4176-3.9778 9.0202-3.9778 3.4736 0 5.6586 1.2886 2.241 1.2886 3.6417 3.1375h.33615q-.056-.72834-.2241-2.129-.11205-1.4567-.11205-2.2971v-11.99h4.9303v42.58h-3.9778l-.72834-4.0339h-.2241q-1.3446 1.9049-3.5857 3.2495-2.241 1.3446-5.7707 1.3446zm.78437-4.0899q4.7622 0 6.6671-2.5772 1.9609-2.6332 1.9609-7.8997v-.89641q0-5.6026-1.8488-8.572-1.8489-3.0254-6.8352-3.0254-3.9778 0-5.9948 3.1935-1.9609 3.1374-1.9609 8.4599 0 5.3785 1.9609 8.3479 2.0169 2.9694 6.0508 2.9694zm55.914 3.5296-13.166-35.072h-.2241q.16808 1.7368.28013 4.7062.11205 2.9134.11205 6.1068v24.259h-4.6502v-40.003h7.4515l12.326 32.775h.22411l12.55-32.775h7.3954v40.003h-4.9863v-24.595q0-2.9134.11205-5.7707.16808-2.8573.28013-4.6502h-.2241l-13.334 35.016zm43.868-30.534q5.4906 0 8.1238 2.4091t2.6332 7.6756v20.449h-3.5857l-.95244-4.258h-.22411q-1.9609 2.4651-4.1459 3.6417-2.129 1.1765-5.9388 1.1765-4.0899 0-6.7791-2.129-2.6892-2.185-2.6892-6.7791 0-4.4821 3.5296-6.8912 3.5296-2.4651 10.869-2.6892l5.0984-.16808v-1.7928q0-3.7537-1.6248-5.2104t-4.5941-1.4567q-2.3531 0-4.4821.72834-2.129.67231-3.9778 1.5687l-1.5127-3.6977q1.9609-1.0645 4.6502-1.7928 2.6892-.78437 5.6026-.78437zm1.4567 16.023q-5.6026.2241-7.7876 1.7928-2.129 1.5687-2.129 4.426 0 2.5212 1.5127 3.6977 1.5687 1.1766 3.9778 1.1766 3.8098 0 6.3309-2.073 2.5212-2.129 2.5212-6.499v-2.6892zm33.055-16.079q5.3785 0 8.1238 2.6332 2.7453 2.5772 2.7453 8.4039v19.553h-4.8743v-19.217q0-7.2274-6.7231-7.2274-4.9863 0-6.8912 2.8013t-1.9049 8.0677v15.575h-4.9303v-30.03h3.9778l.72834 4.0899h.28013q1.4567-2.3531 4.0339-3.4736 2.5772-1.1765 5.4345-1.1765zm31.543.056q5.4906 0 8.1238 2.4091t2.6332 7.6756v20.449h-3.5857l-.95245-4.258h-.2241q-1.9609 2.4651-4.1459 3.6417-2.129 1.1765-5.9388 1.1765-4.0899 0-6.7792-2.129-2.6892-2.185-2.6892-6.7791 0-4.4821 3.5296-6.8912 3.5296-2.4651 10.869-2.6892l5.0984-.16808v-1.7928q0-3.7537-1.6248-5.2104t-4.5941-1.4567q-2.3531 0-4.4821.72834-2.129.67231-3.9778 1.5687l-1.5127-3.6977q1.9609-1.0645 4.6502-1.7928 2.6892-.78437 5.6026-.78437zm1.4567 16.023q-5.6026.2241-7.7876 1.7928-2.129 1.5687-2.129 4.426 0 2.5212 1.5127 3.6977 1.5687 1.1766 3.9778 1.1766 3.8098 0 6.3309-2.073 2.5212-2.129 2.5212-6.499v-2.6892zm29.246-16.079q2.9694 0 5.3225 1.1205 2.4091 1.1205 4.0899 3.4176h.28013l.67231-3.9778h3.9218v30.534q0 6.443-3.3055 9.6925-3.2495 3.2495-10.141 3.2495-6.6111 0-10.813-1.9049v-4.5381q4.426 2.3531 11.093 2.3531 3.8658 0 6.0508-2.2971 2.241-2.241 2.241-6.1629v-1.1766q0-.67231.056-1.9049.056-1.2886.11205-1.7928h-.2241q-3.0254 4.5381-9.3003 4.5381-5.8267 0-9.1322-4.0899-3.2495-4.0899-3.2495-11.429 0-7.1713 3.2495-11.373 3.3055-4.258 9.0762-4.258zm.67232 4.1459q-3.7538 0-5.8267 3.0254-2.073 2.9694-2.073 8.516t2.0169 8.516q2.073 2.9134 5.9948 2.9134 4.5381 0 6.6111-2.4091 2.073-2.4651 2.073-7.8997v-1.1766q0-6.1629-2.129-8.7961-2.129-2.6892-6.6671-2.6892zm34.736-4.1459q3.8658 0 6.6111 1.6808 2.8013 1.6808 4.258 4.7622 1.5127 3.0254 1.5127 7.1153v2.9694h-20.562q.11206 5.0984 2.5772 7.7876 2.5212 2.6332 7.0032 2.6332 2.8573 0 5.0423-.50423 2.241-.56026 4.5941-1.5687v4.314q-2.2971 1.0085-4.5381 1.4567-2.241.50423-5.3225.50423-4.258 0-7.5635-1.7368-3.2495-1.7368-5.0984-5.1544-1.7928-3.4736-1.7928-8.4599 0-4.9303 1.6248-8.4599 1.6808-3.5296 4.6502-5.4345 3.0254-1.9049 7.0032-1.9049zm-.056 4.0339q-3.5296 0-5.6026 2.2971-2.0169 2.241-2.4091 6.2749h15.295q-.056-3.8098-1.7928-6.1629-1.7368-2.4091-5.4906-2.4091zm34.064-4.0339q.84039 0 1.7928.11205 1.0085.056 1.7368.2241l-.61629 4.5381q-.72834-.16808-1.6248-.28013-.84039-.11205-1.6248-.11205-2.2971 0-4.314 1.2886-2.0169 1.2326-3.2495 3.5296-1.1765 2.241-1.1765 5.2664v16.023h-4.9303v-30.03h4.0339l.56026 5.4905h.22411q1.4567-2.4651 3.7537-4.258 2.2971-1.7928 5.4345-1.7928z"/>
</g>
<defs>
  <clipPath id="password-manager-logo-clip">
    <path class="tw-fill-text-alt2" d="M0 0h800v200H0z"/>
  </clipPath>
</defs>
</svg>
`;var Td=i(24137),Fd=i(37806),Rd=i(65067);function Pd(e,t){1&e&&(k.nrm(0,"bit-nav-item",1),k.nI1(1,"i18n")),2&e&&k.Y8G("text",k.bMT(1,1,"sponsoredFamilies"))}class xd{constructor(e){this.freeFamiliesPolicyService=e,this.showFreeFamilies$=this.freeFamiliesPolicyService.showFreeFamilies$}}xd.ɵfac=function(e){return new(e||xd)(k.rXU(fl.A))},xd.ɵcmp=k.VBU({type:xd,selectors:[["billing-free-families-nav-item"]],decls:2,vars:3,consts:[["route","settings/sponsored-families",3,"text",4,"ngIf"],["route","settings/sponsored-families",3,"text"]],template:function(e,t){1&e&&(k.DNE(0,Pd,2,3,"bit-nav-item",0),k.nI1(1,"async")),2&e&&k.Y8G("ngIf",k.bMT(1,1,t.showFreeFamilies$))},dependencies:[Td.f,Rd.u,Fd.r,Y.bT,Y.Jj,ae.$],encapsulation:2});var $d=i(81740),Ed=i(44087),Ad=i(59557),Dd=i(1463),Od=i(41607),Md=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ud(e,t){1&e&&(k.nrm(0,"bit-nav-item",11),k.nI1(1,"i18n")),2&e&&k.Y8G("text",k.bMT(1,1,"appearance"))}function Gd(e,t){1&e&&(k.nrm(0,"bit-nav-item",12),k.nI1(1,"i18n")),2&e&&k.Y8G("text",k.bMT(1,1,"preferences"))}function jd(e,t){1&e&&(k.nrm(0,"bit-nav-item",16),k.nI1(1,"i18n")),2&e&&k.Y8G("text",k.bMT(1,1,"subscription"))}function Nd(e,t){1&e&&(k.nrm(0,"bit-nav-item",15),k.nI1(1,"i18n")),2&e&&k.Y8G("text",k.bMT(1,1,"emergencyAccess"))}class Vd{constructor(e,t,i,n,r){this.syncService=e,this.billingAccountProfileStateService=t,this.accountService=i,this.policyService=n,this.configService=r,this.logo=Cd,this.showSubscription$=(0,gt.of)(!1),this.showEmergencyAccess=(0,c.ot)((0,Vr.z)([this.configService.getFeatureFlag$(M.TO.AutoConfirm),this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policyAppliesToUser$(ci.tt.AutoConfirm,e)))]).pipe((0,m.T)(([e,t])=>!e||!t))),this.consolidatedSessionTimeoutComponent$=this.configService.getFeatureFlag$(M.TO.ConsolidatedSessionTimeoutComponent)}ngOnInit(){return Md(this,void 0,void 0,function*(){document.body.classList.remove("layout_frontend"),yield this.syncService.fullSync(!1),this.hasFamilySponsorshipAvailable$=(0,gt.of)(!1),this.showSponsoredFamilies$=(0,gt.of)(!1)})}}Vd.ɵfac=function(e){return new(e||Vd)(k.rXU(Ue.H),k.rXU(Xr.Q),k.rXU(L.Di),k.rXU(Le.m),k.rXU(U.w))},Vd.ɵcmp=k.VBU({type:Vd,selectors:[["app-user-layout"]],decls:34,vars:44,consts:[["route",".",3,"openIcon","label"],["icon","bwi-vault","route","vault",3,"text"],["icon","bwi-send","route","sends",3,"text"],["icon","bwi-wrench","route","tools",3,"text"],["route","tools/generator",3,"text"],["route","tools/import",3,"text"],["route","tools/export",3,"text"],["icon","bwi-sliders","route","reports",3,"text"],["icon","bwi-cog","route","settings",3,"text"],["route","settings/account",3,"text"],["route","settings/security",3,"text"],["route","settings/appearance",3,"text"],["route","settings/preferences",3,"text"],["route","settings/subscription",3,"text",4,"ngIf"],["route","settings/domain-rules",3,"text"],["route","settings/emergency-access",3,"text"],["route","settings/subscription",3,"text"]],template:function(e,t){1&e&&(k.j41(0,"app-layout")(1,"app-side-nav"),k.nrm(2,"bit-nav-logo",0),k.nI1(3,"i18n"),k.nrm(4,"bit-nav-item",1),k.nI1(5,"i18n"),k.nrm(6,"bit-nav-item",2),k.nI1(7,"i18n"),k.j41(8,"bit-nav-group",3),k.nI1(9,"i18n"),k.nrm(10,"bit-nav-item",4),k.nI1(11,"i18n"),k.nrm(12,"bit-nav-item",5),k.nI1(13,"i18n"),k.nrm(14,"bit-nav-item",6),k.nI1(15,"i18n"),k.k0s(),k.nrm(16,"bit-nav-item",7),k.nI1(17,"i18n"),k.j41(18,"bit-nav-group",8),k.nI1(19,"i18n"),k.nrm(20,"bit-nav-item",9),k.nI1(21,"i18n"),k.nrm(22,"bit-nav-item",10),k.nI1(23,"i18n"),k.nVh(24,Ud,2,3,"bit-nav-item",11),k.nI1(25,"async"),k.vZN(26,Gd,2,3,"bit-nav-item",12),k.DNE(27,jd,2,3,"bit-nav-item",13),k.nI1(28,"async"),k.nrm(29,"bit-nav-item",14),k.nI1(30,"i18n"),k.nVh(31,Nd,2,3,"bit-nav-item",15),k.nrm(32,"billing-free-families-nav-item"),k.k0s()(),k.nrm(33,"router-outlet"),k.k0s()),2&e&&(k.R7$(2),k.Y8G("openIcon",t.logo)("label",k.bMT(3,16,"passwordManager")),k.R7$(2),k.Y8G("text",k.bMT(5,18,"vaults")),k.R7$(2),k.Y8G("text",k.bMT(7,20,"send")),k.R7$(2),k.Y8G("text",k.bMT(9,22,"tools")),k.R7$(2),k.Y8G("text",k.bMT(11,24,"generator")),k.R7$(2),k.Y8G("text",k.bMT(13,26,"import")),k.R7$(2),k.Y8G("text",k.bMT(15,28,"export")),k.R7$(2),k.Y8G("text",k.bMT(17,30,"reports")),k.R7$(2),k.Y8G("text",k.bMT(19,32,"settings")),k.R7$(2),k.Y8G("text",k.bMT(21,34,"myAccount")),k.R7$(2),k.Y8G("text",k.bMT(23,36,"security")),k.R7$(2),k.vxM(k.bMT(25,38,t.consolidatedSessionTimeoutComponent$)?24:26),k.R7$(3),k.Y8G("ngIf",k.bMT(28,40,t.showSubscription$)),k.R7$(2),k.Y8G("text",k.bMT(30,42,"domainRules")),k.R7$(2),k.vxM(t.showEmergencyAccess()?31:-1))},dependencies:[Y.MD,Y.bT,ne.iI,x.n3,re.p,$d.P,Ed.O,Rd.u,Ad.K,Dd.s,Od.y,ge.o,xd,Y.Jj,ae.$],encapsulation:2});var Bd=i(60893),zd=i(59525),Ld=i(82522),Kd=i(32501);class qd{}qd.ɵfac=function(e){return new(e||qd)},qd.ɵmod=k.$C({type:qd}),qd.ɵinj=C.G2t({imports:[mi.G]});class _d{}_d.ɵfac=function(e){return new(e||_d)},_d.ɵmod=k.$C({type:_d}),_d.ɵinj=C.G2t({providers:[Y.PV],imports:[mi.G,Dl.uY,qd,Wn.L,Kd.Y,mc,Ae.tu]});var Xd=i(14092),Yd=i(10840);class Hd{}Hd.ɵfac=function(e){return new(e||Hd)},Hd.ɵmod=k.$C({type:Hd}),Hd.ɵinj=C.G2t({imports:[Zt.G,Ei.G,Xd.t,Yd.Y]});var Wd=i(46798),Jd=i(17989),Zd=i(58389),Qd=i(48550);class eu{constructor(e){this.id=null,this.name=null,this.type=null,this.text=new Qd.t,this.file=new Zd.Q,this.expirationDate=null,this.creatorIdentifier=null,e&&(this.id=e.id,this.type=e.type,this.expirationDate=e.expirationDate,this.creatorIdentifier=e.creatorIdentifier)}}var tu=i(23385),iu=i(95668),nu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class ru extends Jd.A{constructor(e){if(super(),null!=e)switch(this.buildDomainModel(this,e,{id:null,name:null,expirationDate:null,creatorIdentifier:null},["id","expirationDate","creatorIdentifier"]),this.type=e.type,this.type){case Wd.N.Text:this.text=new iu.u(e.text);break;case Wd.N.File:this.file=new tu.l(e.file)}}decrypt(e){return nu(this,void 0,void 0,function*(){const t=new eu(this);switch(yield this.decryptObj(this,t,["name"],e),this.type){case Wd.N.File:t.file=yield this.file.decrypt(e);break;case Wd.N.Text:t.text=yield this.text.decrypt(e)}return t})}}class su{}var ou=i(35004),au=i(90250),lu=(i(43890),i(89105)),cu=i(74867),du=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class uu{constructor(e,t,i,n,r){this.i18nService=e,this.toastService=t,this.encryptService=i,this.fileDownloadService=n,this.sendApiService=r,this.download=()=>du(this,void 0,void 0,function*(){if(null==this.send||null==this.decKey)return;const e=yield this.sendApiService.getSendFileDownloadData(this.send,this.accessRequest);if(Pn.A.isNullOrWhitespace(e.url))return void this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("missingSendFile")});const t=yield fetch(new Request(e.url,{cache:"no-store"}));if(200===t.status)try{const e=yield au.q.fromResponse(t),i=yield this.encryptService.decryptFileData(e,this.decKey);this.fileDownloadService.download({fileName:this.send.file.fileName,blobData:i,downloadMethod:"save"})}catch(i){this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("errorOccurred")})}else this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("errorOccurred")})})}}uu.ɵfac=function(e){return new(e||uu)(k.rXU(j.W),k.rXU($.f),k.rXU(lu.N),k.rXU(Bc.y),k.rXU(cu.M))},uu.ɵcmp=k.VBU({type:uu,selectors:[["app-send-access-file"]],inputs:{send:"send",decKey:"decKey",accessRequest:"accessRequest"},decls:6,vars:7,consts:[[1,"tw-text-wrap","tw-break-all"],["bitButton","","type","button","buttonType","primary",3,"bitAction","block"],["aria-hidden","true",1,"bwi","bwi-download"]],template:function(e,t){1&e&&(k.j41(0,"p",0),k.EFF(1),k.k0s(),k.j41(2,"button",1),k.nrm(3,"i",2),k.EFF(4),k.nI1(5,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(t.send.file.fileName),k.R7$(),k.Y8G("bitAction",t.download)("block",!0),k.R7$(2),k.Lme(" ",k.bMT(5,5,"downloadAttachments")," (",t.send.file.sizeName,")\n"))},dependencies:[mi.G,Qt.p,oe.Q,ae.$],encapsulation:2});var hu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class pu{constructor(e){this.formBuilder=e,this.destroy$=new d.B,this.formGroup=this.formBuilder.group({password:["",[a.k0.required]]}),this.setPasswordEvent=new k.bkB}ngOnInit(){return hu(this,void 0,void 0,function*(){this.formGroup.controls.password.valueChanges.pipe((0,li.Q)(this.destroy$)).subscribe(e=>{this.setPasswordEvent.emit(e)})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}pu.ɵfac=function(e){return new(e||pu)(k.rXU(a.ok))},pu.ɵcmp=k.VBU({type:pu,selectors:[["app-send-access-password"]],inputs:{loading:"loading"},outputs:{setPasswordEvent:"setPasswordEvent"},decls:19,vars:15,consts:[["bitTypography","body1"],[1,"tw-mb-3",3,"formGroup"],["bitInput","","type","password","formControlName","password","required","","appInputVerbatim","","appAutofocus",""],["type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],[1,"tw-flex"],["bitButton","","bitFormButton","","type","submit","buttonType","primary",3,"loading","block"],["aria-hidden","true",1,"bwi","bwi-sign-in"]],template:function(e,t){1&e&&(k.j41(0,"p",0),k.EFF(1),k.nI1(2,"i18n"),k.k0s(),k.j41(3,"p",0),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"div",1)(7,"bit-form-field")(8,"bit-label"),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.nrm(11,"input",2)(12,"button",3),k.k0s(),k.j41(13,"div",4)(14,"button",5)(15,"span"),k.nrm(16,"i",6),k.EFF(17),k.nI1(18,"i18n"),k.k0s()()()()),2&e&&(k.R7$(),k.JRh(k.bMT(2,7,"sendProtectedPassword")),k.R7$(3),k.JRh(k.bMT(5,9,"sendProtectedPasswordDontKnow")),k.R7$(2),k.Y8G("formGroup",t.formGroup),k.R7$(3),k.JRh(k.bMT(10,11,"password")),k.R7$(5),k.Y8G("loading",t.loading)("block",!0),k.R7$(3),k.SpI(" ",k.bMT(18,13,"continue")," "))},dependencies:[mi.G,a.me,a.BC,a.cb,a.YS,a.j4,a.JD,qi.B,_i.q,gi.$,oe.Q,bi.j,Xi.J,wi.h,on.e,an.a,ln.s,Ce.r,ae.$],encapsulation:2});const mu=(e,t)=>({"bwi-eye":e,"bwi-eye-slash":t});function vu(e,t){1&e&&(k.j41(0,"bit-callout",7),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e&&(k.R7$(),k.JRh(k.bMT(2,1,"sendHiddenByDefault")))}function fu(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",8),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.toggleText())}),k.nrm(1,"i",9),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("block",!0),k.R7$(),k.Y8G("ngClass",k.l_i(5,mu,!e.showText,e.showText)),k.R7$(),k.SpI(" ",k.bMT(3,3,"toggleVisibility")," ")}}class gu{constructor(e,t,i,n){this.i18nService=e,this.platformUtilsService=t,this.formBuilder=i,this.toastService=n,this._send=null,this.showText=!1,this.formGroup=this.formBuilder.group({sendText:[""]})}get send(){return this._send}set send(e){this._send=e,this.showText=null==this.send.text||!this.send.text.hidden,null!=this.send&&null!=this.send.text&&this.formGroup.controls.sendText.patchValue(this.showText?this.send.text.text:this.send.text.maskedText)}copyText(){this.platformUtilsService.copyToClipboard(this.send.text.text),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("valueCopied",this.i18nService.t("sendTypeText"))})}toggleText(){this.showText=!this.showText,this.formGroup.controls.sendText.patchValue(this.showText?this.send.text.text:this.send.text.maskedText)}}gu.ɵfac=function(e){return new(e||gu)(k.rXU(j.W),k.rXU(N.y),k.rXU(a.ok),k.rXU($.f))},gu.ɵcmp=k.VBU({type:gu,selectors:[["app-send-access-text"]],inputs:{send:"send"},decls:10,vars:7,consts:[["type","info",4,"ngIf"],[3,"formGroup"],["id","text","bitInput","","rows","8","name","Text","formControlName","sendText","readonly",""],[1,"tw-mb-3"],["bitButton","","type","button","buttonType","secondary",3,"block","click",4,"ngIf"],["bitButton","","type","button","buttonType","primary",3,"click","block"],["aria-hidden","true",1,"bwi","bwi-clone"],["type","info"],["bitButton","","type","button","buttonType","secondary",3,"click","block"],["aria-hidden","true",1,"bwi","bwi-lg",3,"ngClass"]],template:function(e,t){1&e&&(k.DNE(0,vu,3,3,"bit-callout",0),k.j41(1,"bit-form-field",1),k.nrm(2,"textarea",2),k.k0s(),k.j41(3,"div",3),k.DNE(4,fu,4,8,"button",4),k.k0s(),k.j41(5,"div",3)(6,"button",5),k.bIt("click",function(){return t.copyText()}),k.nrm(7,"i",6),k.EFF(8),k.nI1(9,"i18n"),k.k0s()()),2&e&&(k.Y8G("ngIf",t.send.text.hidden),k.R7$(),k.Y8G("formGroup",t.formGroup),k.R7$(3),k.Y8G("ngIf",t.send.text.hidden),k.R7$(2),k.Y8G("block",!0),k.R7$(2),k.SpI(" ",k.bMT(9,5,"copyValue")," "))},dependencies:[mi.G,Y.YU,Y.bT,a.me,a.BC,a.cb,a.j4,a.JD,oe.Q,Ge.G,Xi.J,wi.h,ae.$],encapsulation:2});var yu=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function bu(e,t){1&e&&(k.j41(0,"bit-callout",4),k.nI1(1,"i18n"),k.EFF(2),k.nI1(3,"i18n"),k.j41(4,"a",5),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.EFF(7,". "),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,4,"warning"))),k.R7$(2),k.SpI(" ",k.bMT(3,6,"viewSendHiddenEmailWarning")," "),k.R7$(3),k.JRh(k.bMT(6,8,"learnMore")))}function wu(e,t){if(1&e){const e=k.RV6();k.j41(0,"app-send-access-password",9),k.bIt("setPasswordEvent",function(t){C.eBV(e);const i=k.XpG(2);return C.Njj(i.setPassword(t))}),k.k0s()}}function Su(e,t){1&e&&(k.j41(0,"div",10)(1,"p",11),k.EFF(2),k.nI1(3,"i18n"),k.k0s()()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,1,"sendAccessUnavailable")))}function Iu(e,t){1&e&&(k.j41(0,"div",10)(1,"p",11),k.EFF(2),k.nI1(3,"i18n"),k.k0s()()),2&e&&(k.R7$(2),k.JRh(k.bMT(3,1,"unexpectedErrorSend")))}function ku(e,t){if(1&e&&(k.qex(0),k.nrm(1,"app-send-access-text",14),k.bVm()),2&e){const e=k.XpG(3);k.R7$(),k.Y8G("send",e.send)}}function Cu(e,t){if(1&e&&(k.qex(0),k.nrm(1,"app-send-access-file",15),k.bVm()),2&e){const e=k.XpG(3);k.R7$(),k.Y8G("send",e.send)("decKey",e.decKey)("accessRequest",e.accessRequest)}}function Tu(e,t){if(1&e&&(k.j41(0,"p",16),k.EFF(1),k.nI1(2,"date"),k.k0s()),2&e){const e=k.XpG(3);k.R7$(),k.SpI(" Expires: ",k.i5U(2,1,e.expirationDate,"medium")," ")}}function Fu(e,t){if(1&e&&(k.j41(0,"div")(1,"p",12)(2,"b"),k.EFF(3),k.k0s()(),k.nrm(4,"hr"),k.DNE(5,ku,2,1,"ng-container",8)(6,Cu,2,3,"ng-container",8)(7,Tu,3,4,"p",13),k.k0s()),2&e){const e=k.XpG(2);k.R7$(3),k.JRh(e.send.name),k.R7$(2),k.Y8G("ngIf",e.send.type===e.sendType.Text),k.R7$(),k.Y8G("ngIf",e.send.type===e.sendType.File),k.R7$(),k.Y8G("ngIf",e.expirationDate)}}function Ru(e,t){if(1&e&&(k.qex(0),k.DNE(1,wu,1,0,"app-send-access-password",6)(2,Su,4,3,"div",7)(3,Iu,4,3,"div",7)(4,Fu,8,4,"div",8),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",e.passwordRequired&&!e.error),k.R7$(),k.Y8G("ngIf",e.unavailable),k.R7$(),k.Y8G("ngIf",e.error),k.R7$(),k.Y8G("ngIf",!e.passwordRequired&&e.send&&!e.error&&!e.unavailable)}}function Pu(e,t){1&e&&(k.j41(0,"div",12),k.nrm(1,"i",17),k.nI1(2,"i18n"),k.j41(3,"span",18),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}class xu{constructor(e,t,i,n,r,s,o,a){this.cryptoFunctionService=e,this.route=t,this.keyService=i,this.sendApiService=n,this.toastService=r,this.i18nService=s,this.layoutWrapperDataService=o,this.formBuilder=a,this.sendType=Wd.N,this.loading=!0,this.passwordRequired=!1,this.unavailable=!1,this.error=!1,this.hideEmail=!1,this.formGroup=this.formBuilder.group({}),this.load=()=>yu(this,void 0,void 0,function*(){this.unavailable=!1,this.error=!1,this.hideEmail=!1;try{const e=Pn.A.fromUrlB64ToArray(this.key);if(this.accessRequest=new su,null!=this.password){const t=yield this.cryptoFunctionService.pbkdf2(this.password,e,"sha256",ou.o);this.accessRequest.password=Pn.A.fromBufferToB64(t)}let t=null;this.loading?t=yield this.sendApiService.postSendAccess(this.id,this.accessRequest):(this.formPromise=this.sendApiService.postSendAccess(this.id,this.accessRequest),t=yield this.formPromise),this.passwordRequired=!1;const i=new ru(t);this.decKey=yield this.keyService.makeSendKey(e),this.send=yield i.decrypt(this.decKey)}catch(e){e instanceof me._?401===e.statusCode?this.passwordRequired=!0:404===e.statusCode?this.unavailable=!0:400===e.statusCode?this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:e.message}):this.error=!0:this.error=!0}this.loading=!1,this.hideEmail=null==this.creatorIdentifier&&!this.passwordRequired&&!this.loading&&!this.unavailable,null!=this.creatorIdentifier&&this.layoutWrapperDataService.setAnonLayoutWrapperData({pageSubtitle:{key:"sendAccessCreatorIdentifier",placeholders:[this.creatorIdentifier]}})})}get expirationDate(){return null==this.send||null==this.send.expirationDate?null:this.send.expirationDate}get creatorIdentifier(){return null==this.send||null==this.send.creatorIdentifier?null:this.send.creatorIdentifier}ngOnInit(){return yu(this,void 0,void 0,function*(){this.route.params.subscribe(e=>yu(this,void 0,void 0,function*(){this.id=e.sendId,this.key=e.key,null!=this.key&&null!=this.id&&(yield this.load())}))})}setPassword(e){this.password=e}}xu.ɵfac=function(e){return new(e||xu)(k.rXU(Vc.R),k.rXU(x.nX),k.rXU(I.Lu),k.rXU(cu.M),k.rXU($.f),k.rXU(j.W),k.rXU(Ie.f),k.rXU(a.ok))},xu.ɵcmp=k.VBU({type:xu,selectors:[["app-send-access"]],decls:5,vars:5,consts:[["spinner",""],[3,"formGroup","bitSubmit"],["type","warning",3,"title",4,"ngIf"],[4,"ngIf","ngIfElse"],["type","warning",3,"title"],["bitLink","","href","https://bitwarden.com/help/receive-send/","target","_blank","rel","noreferrer"],[3,"setPasswordEvent",4,"ngIf"],["class","tw-text-main tw-text-center",4,"ngIf"],[4,"ngIf"],[3,"setPasswordEvent"],[1,"tw-text-main","tw-text-center"],["bitTypography","body1"],[1,"tw-text-center"],["class","tw-text-center tw-text-muted",4,"ngIf"],[3,"send"],[3,"send","decKey","accessRequest"],[1,"tw-text-center","tw-text-muted"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-2x","tw-text-muted",3,"title"],[1,"tw-sr-only"]],template:function(e,t){if(1&e&&(k.j41(0,"form",1),k.DNE(1,bu,8,10,"bit-callout",2)(2,Ru,5,4,"ng-container",3)(3,Pu,6,7,"ng-template",null,0,k.C5r),k.k0s()),2&e){const e=k.sdS(4);k.Y8G("formGroup",t.formGroup)("bitSubmit",t.load),k.R7$(),k.Y8G("ngIf",t.hideEmail),k.R7$(),k.Y8G("ngIf",!t.loading)("ngIfElse",e)}},dependencies:[uu,gu,pu,mi.G,Y.bT,a.qT,a.cb,a.j4,yi.L,Ge.G,ke.L,Ce.r,Y.vh,ae.$],encapsulation:2});var $u=i(17197),Eu=i(18990),Au=i(91240),Du=i(74956);class Ou{}Ou.ɵfac=function(e){return new(e||Ou)},Ou.ɵmod=k.$C({type:Ou}),Ou.ɵinj=C.G2t({providers:[{provide:Au.u,useClass:Du.u}],imports:[Eu.m,Bd.t,$u.t]});var Mu=i(52981),Uu=i(57516),Gu=i(67819),ju=i(91267),Nu=i(32661),Vu=i(34067),Bu=i(45524),zu=i(46215),Lu=i(51728),Ku=i(2570),qu=i(85096),_u=i(53011),Xu=i(34423),Yu=i(56773),Hu=i(26293),Wu=i(62263),Ju=i(92348),Zu=i(64008),Qu=i(60573),eh=i(11006),th=i(25367),ih=i(90973),nh=i(56693),rh=i(63757),sh=i(39140),oh=i(99911),ah=i(32435),lh=i(19711),ch=i(98330),dh=i(18371),uh=i(83049),hh=i(97369),ph=i(6433),mh=i(11128),vh=i(85884),fh=i(92837),gh=i(62118),yh=i(87970),bh=i(15069),wh=i(9799),Sh=i(77058),Ih=i(79516),kh=i(11625),Ch=i(58146),Th=i(85528),Fh=i(74341),Rh=i(70860),Ph=i(17476),xh=i(41829),$h=i(93323),Eh=i(5205),Ah=i(89672),Dh=i(65906),Oh=i(21819),Mh=i(50121),Uh=i(82437),Gh=i(52611),jh=i(95175),Nh=i(64068),Vh=i(12854),Bh=i(28416),zh=i(97413),Lh=i(37447),Kh=i(60294);(0,Mu.EO)(Uu.A,"af"),(0,Mu.EO)(Gu.A,"ar"),(0,Mu.EO)(ju.A,"az"),(0,Mu.EO)(Nu.A,"be"),(0,Mu.EO)(Vu.A,"bg"),(0,Mu.EO)(Bu.A,"bn"),(0,Mu.EO)(zu.A,"bs"),(0,Mu.EO)(Lu.A,"ca"),(0,Mu.EO)(Ku.A,"cs"),(0,Mu.EO)(qu.A,"cy"),(0,Mu.EO)(_u.A,"da"),(0,Mu.EO)(Xu.A,"de"),(0,Mu.EO)(Yu.A,"el"),(0,Mu.EO)(Hu.A,"en-GB"),(0,Mu.EO)(Wu.A,"en-IN"),(0,Mu.EO)(Ju.A,"eo"),(0,Mu.EO)(Zu.A,"es"),(0,Mu.EO)(Qu.A,"et"),(0,Mu.EO)(eh.A,"eu"),(0,Mu.EO)(ih.A,"fa"),(0,Mu.EO)(nh.A,"fi"),(0,Mu.EO)(rh.A,"fil"),(0,Mu.EO)(sh.A,"fr"),(0,Mu.EO)(oh.A,"gl"),(0,Mu.EO)(ah.A,"he"),(0,Mu.EO)(lh.A,"hi"),(0,Mu.EO)(ch.A,"hr"),(0,Mu.EO)(dh.A,"hu"),(0,Mu.EO)(uh.A,"id"),(0,Mu.EO)(hh.A,"it"),(0,Mu.EO)(ph.A,"ja"),(0,Mu.EO)(mh.A,"ka"),(0,Mu.EO)(vh.A,"km"),(0,Mu.EO)(fh.A,"kn"),(0,Mu.EO)(gh.A,"ko"),(0,Mu.EO)(yh.A,"lv"),(0,Mu.EO)(bh.A,"ml"),(0,Mu.EO)(wh.A,"mr"),(0,Mu.EO)(Sh.A,"my"),(0,Mu.EO)(Ih.A,"nb"),(0,Mu.EO)(kh.A,"ne"),(0,Mu.EO)(Ch.A,"nl"),(0,Mu.EO)(Th.A,"nn"),(0,Mu.EO)(Fh.A,"or"),(0,Mu.EO)(Rh.A,"pl"),(0,Mu.EO)(Ph.A,"pt-BR"),(0,Mu.EO)(xh.A,"pt-PT"),(0,Mu.EO)($h.A,"ro"),(0,Mu.EO)(Eh.A,"ru"),(0,Mu.EO)(Ah.A,"si"),(0,Mu.EO)(Dh.A,"sk"),(0,Mu.EO)(Oh.A,"sl"),(0,Mu.EO)(Mh.A,"sr"),(0,Mu.EO)(Uh.A,"sv"),(0,Mu.EO)(Gh.A,"ta"),(0,Mu.EO)(jh.A,"te"),(0,Mu.EO)(Nh.A,"th"),(0,Mu.EO)(Vh.A,"tr"),(0,Mu.EO)(Bh.A,"uk"),(0,Mu.EO)(zh.A,"vi"),(0,Mu.EO)(Lh.A,"zh-CN"),(0,Mu.EO)(Kh.A,"zh-TW",th.A);class qh{}qh.ɵfac=function(e){return new(e||qh)},qh.ɵmod=k.$C({type:qh}),qh.ɵinj=C.G2t({imports:[mi.G,Hd,Ei.G,_d,Ou,Xd.t,Ld.r,xu,mi.G,Ei.G,_d,Ou,Xd.t]});class _h{}var Xh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Yh{constructor(e){this.apiService=e}requestSMAccessFromAdmins(e){return Xh(this,void 0,void 0,function*(){yield this.apiService.send("POST","/request-access/request-sm-access",e,!0,!1)})}}Yh.ɵfac=function(e){return new(e||Yh)(C.KVO(fi.G))},Yh.ɵprov=C.jDH({token:Yh,factory:Yh.ɵfac,providedIn:"root"});var Hh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Wh(e,t){if(1&e&&k.nrm(0,"bit-option",10),2&e){const e=t.$implicit;k.Y8G("value",e)("label",e.name)}}class Jh{constructor(e,t,i,n,r,s){this.router=e,this.i18nService=t,this.organizationService=i,this.smLandingApiService=n,this.toastService=r,this.accountService=s,this.requestAccessForm=new a.gE({requestAccessEmailContents:new a.MJ(this.i18nService.t("requestAccessSMDefaultEmailContent"),[a.k0.required]),selectedOrganization:new a.MJ(null,[a.k0.required])}),this.organizations=[],this.submit=()=>Hh(this,void 0,void 0,function*(){if(this.requestAccessForm.markAllAsTouched(),this.requestAccessForm.invalid)return;const e=this.requestAccessForm.value,t=new _h;t.OrganizationId=e.selectedOrganization.id,t.EmailContent=e.requestAccessEmailContents,yield this.smLandingApiService.requestSMAccessFromAdmins(t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("smAccessRequestEmailSent")}),yield this.router.navigate(["/"])})}ngOnInit(){return Hh(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$));this.organizations=(yield(0,u._)(this.organizationService.organizations$(e))).filter(e=>e.enabled).sort((e,t)=>e.name.localeCompare(t.name)),(null===this.organizations||this.organizations.length<1)&&(yield this.navigateToCreateOrganizationPage())})}navigateToCreateOrganizationPage(){return Hh(this,void 0,void 0,function*(){yield this.router.navigate(["/create-organization"])})}}Jh.ɵfac=function(e){return new(e||Jh)(k.rXU(x.Ix),k.rXU(j.W),k.rXU(g.PV),k.rXU(Yh),k.rXU($.f),k.rXU(L.Di))},Jh.ɵcmp=k.VBU({type:Jh,selectors:[["app-request-sm-access"]],decls:26,vars:19,consts:[[3,"formGroup","bitSubmit"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-9"],["bitTypography","body1"],["rows","20","id","request_access_textarea","bitInput","","formControlName","requestAccessEmailContents"],["formControlName","selectedOrganization"],["required","",3,"value","label",4,"ngFor","ngForOf"],[1,"tw-flex","tw-gap-x-4","tw-mt-4"],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["type","button","bitButton","","buttonType","secondary",3,"routerLink"],["required","",3,"value","label"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container")(2,"form",0)(3,"div",1)(4,"div",2)(5,"p",3),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"bit-form-field")(9,"bit-label"),k.EFF(10),k.nI1(11,"i18n"),k.k0s(),k.nrm(12,"textarea",4),k.k0s(),k.j41(13,"bit-form-field")(14,"bit-label"),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.j41(17,"bit-select",5),k.DNE(18,Wh,1,2,"bit-option",6),k.k0s()(),k.j41(19,"div",7)(20,"button",8),k.EFF(21),k.nI1(22,"i18n"),k.k0s(),k.j41(23,"button",9),k.EFF(24),k.nI1(25,"i18n"),k.k0s()()()()()()),2&e&&(k.R7$(2),k.Y8G("formGroup",t.requestAccessForm)("bitSubmit",t.submit),k.R7$(4),k.JRh(k.bMT(7,9,"youNeedApprovalFromYourAdminToTrySecretsManager")),k.R7$(4),k.JRh(k.bMT(11,11,"addANote")),k.R7$(5),k.JRh(k.bMT(16,13,"organization")),k.R7$(3),k.Y8G("ngForOf",t.organizations),k.R7$(3),k.SpI(" ",k.bMT(22,15,"sendRequest")," "),k.R7$(2),k.Y8G("routerLink","/sm-landing"),k.R7$(),k.SpI(" ",k.bMT(25,17,"cancel")," "))},dependencies:[Zt.G,Y.Sq,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,ne.Wk,gi.$,yi.L,oe.Q,Ai.H,bi.j,Xi.J,wi.h,Si.w,Ii.P,Ce.r,Bd.t,zd.s,Ei.G,Di.f,qh,ae.$],encapsulation:2});var Zh=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Qh(e,t){1&e&&(k.j41(0,"bit-container")(1,"p",8),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"ul",9)(5,"li",10)(6,"b"),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.j41(11,"li",10)(12,"b"),k.EFF(13),k.nI1(14,"i18n"),k.k0s(),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.j41(17,"li",10)(18,"b"),k.EFF(19),k.nI1(20,"i18n"),k.k0s(),k.EFF(21),k.nI1(22,"i18n"),k.k0s(),k.j41(23,"li",10)(24,"b"),k.EFF(25),k.nI1(26,"i18n"),k.k0s(),k.EFF(27),k.nI1(28,"i18n"),k.k0s()()()),2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,9,"developmentDevOpsAndITTeamsChooseBWSecret")," "),k.R7$(5),k.JRh(k.bMT(8,11,"centralizeSecretsManagement")),k.R7$(2),k.SpI(" ",k.bMT(10,13,"centralizeSecretsManagementDescription")," "),k.R7$(4),k.JRh(k.bMT(14,15,"preventSecretLeaks")),k.R7$(2),k.SpI(" ",k.bMT(16,17,"preventSecretLeaksDescription")," "),k.R7$(4),k.JRh(k.bMT(20,19,"enhanceDeveloperProductivity")),k.R7$(2),k.SpI(" ",k.bMT(22,21,"enhanceDeveloperProductivityDescription")," "),k.R7$(4),k.JRh(k.bMT(26,23,"strengthenBusinessSecurity")),k.R7$(2),k.SpI(" ",k.bMT(28,25,"strengthenBusinessSecurityDescription")," "))}function ep(e,t){1&e&&(k.j41(0,"bit-container")(1,"p",8),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"ul",9)(5,"li",10),k.EFF(6),k.nI1(7,"i18n"),k.j41(8,"b"),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.j41(13,"li",10),k.EFF(14),k.nI1(15,"i18n"),k.j41(16,"b"),k.EFF(17),k.nI1(18,"i18n"),k.k0s(),k.EFF(19),k.nI1(20,"i18n"),k.k0s()()()),2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,7,"giveMembersAccess")," "),k.R7$(4),k.SpI(" ",k.bMT(7,9,"openYourOrganizations")," "),k.R7$(3),k.JRh(k.bMT(10,11,"members")),k.R7$(2),k.SpI(" ",k.bMT(12,13,"viewAndSelectTheMembers")," "),k.R7$(3),k.SpI(" ",k.bMT(15,15,"usingTheMenuSelect")," "),k.R7$(3),k.JRh(k.bMT(18,17,"activateSecretsManager")),k.R7$(2),k.SpI(" ",k.bMT(20,19,"toGrantAccessToSelectedMembers")," "))}class tp{constructor(e,t){this.organizationService=e,this.accountService=t,this.learnMoreUrl="https://bitwarden.com/help/secrets-manager-overview/",this.imageSrc="../images/sm.webp",this.showSecretsManagerInformation=!0,this.showGiveMembersAccessInstructions=!1}ngOnInit(){return Zh(this,void 0,void 0,function*(){const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),t=(yield(0,u._)(this.organizationService.organizations$(e))).filter(e=>e.enabled);t.length>0?this.handleEnabledOrganizations(t):this.tryItNowUrl="/create-organization"})}handleEnabledOrganizations(e){const t=e.find(e=>e.isAdmin&&e.useSecretsManager),i=e.find(e=>e.isOwner&&!e.useSecretsManager);null!=t?this.showHowToEnableSMForMembers(t.id):this.tryItNowUrl=null!=i?`/organizations/${i.id}/billing/subscription`:"/request-sm-access"}showHowToEnableSMForMembers(e){this.showGiveMembersAccessInstructions=!0,this.showSecretsManagerInformation=!1,this.learnMoreUrl="https://bitwarden.com/help/secrets-manager-quick-start/#give-members-access",this.imageSrc="../images/sm-give-access.png",this.tryItNowUrl=`/organizations/${e}/members`}}tp.ɵfac=function(e){return new(e||tp)(k.rXU(g.PV),k.rXU(L.Di))},tp.ɵcmp=k.VBU({type:tp,selectors:[["app-sm-landing"]],decls:16,vars:14,consts:[[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-6"],["alt","Bitwarden","aria-hidden","true",1,"tw-max-w-full",3,"src"],[1,"tw-col-span-6","tw-mx-4"],["bitTypography","h1"],[4,"ngIf"],["type","button","bitButton","","buttonType","primary",3,"routerLink"],["bitLink","","linkType","primary","target","_blank",1,"tw-m-5",3,"href"],["bitTypography","body1"],[1,"tw-list-outside"],["bitTypography","body1",1,"tw-mb-2"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"div",0)(2,"div",1),k.nrm(3,"img",2),k.k0s(),k.j41(4,"div",3)(5,"h1",4),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.DNE(8,Qh,29,27,"bit-container",5)(9,ep,21,21,"bit-container",5),k.j41(10,"button",6),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.j41(13,"a",7),k.EFF(14),k.nI1(15,"i18n"),k.k0s()()()),2&e&&(k.R7$(3),k.Y8G("src",t.imageSrc,k.B4B),k.R7$(3),k.JRh(k.bMT(7,8,"bitwardenSecretsManager")),k.R7$(2),k.Y8G("ngIf",t.showSecretsManagerInformation),k.R7$(),k.Y8G("ngIf",t.showGiveMembersAccessInstructions),k.R7$(),k.Y8G("routerLink",t.tryItNowUrl),k.R7$(),k.SpI(" ",k.bMT(12,10,"tryItNow")," "),k.R7$(2),k.Y8G("href",t.learnMoreUrl,k.B4B),k.R7$(),k.SpI(" ",k.bMT(15,12,"learnMore")," "))},dependencies:[Zt.G,Y.bT,ne.Wk,oe.Q,Ai.H,ke.L,Ce.r,Bd.t,zd.s,Ei.G,Di.f,ae.$],encapsulation:2});var ip=i(60276),np=i(83234),rp=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const sp=(e,t)=>t.value;function op(e,t){if(1&e&&k.nrm(0,"bit-option",2),2&e){const e=t.$implicit;k.Y8G("value",e.value)("label",e.name)}}function ap(e,t){if(1&e&&k.nrm(0,"bit-option",2),2&e){const e=t.$implicit;k.Y8G("value",e.value)("label",e.name)}}class lp{constructor(e,t,i,n,r){this.formBuilder=e,this.i18nService=t,this.themeStateService=i,this.domainSettingsService=n,this.destroyRef=r,this.form=this.formBuilder.group({enableFavicons:!0,theme:[Jc.NJ.Light],locale:[null]});const s=[];t.supportedTranslationLocales.forEach(e=>{let i=e;t.localeNames.has(e)&&(i+=" - "+t.localeNames.get(e)),s.push({name:i,value:e})}),s.sort(Pn.A.getSortFunction(t,"name")),s.splice(0,0,{name:t.t("default"),value:null}),this.localeOptions=s,this.themeOptions=[{name:t.t("themeLight"),value:Jc.NJ.Light},{name:t.t("themeDark"),value:Jc.NJ.Dark},{name:t.t("themeSystem"),value:Jc.NJ.System}]}ngOnInit(){return rp(this,void 0,void 0,function*(){var e;this.form.setValue({enableFavicons:yield(0,u._)(this.domainSettingsService.showFavicons$),theme:yield(0,u._)(this.themeStateService.selectedTheme$),locale:null!==(e=yield(0,u._)(this.i18nService.userSetLocale$))&&void 0!==e?e:null},{emitEvent:!1}),this.form.controls.enableFavicons.valueChanges.pipe((0,h.p)(e=>null!=e),(0,ft.n)(e=>rp(this,void 0,void 0,function*(){yield this.domainSettingsService.setShowFavicons(e)})),(0,c.pQ)(this.destroyRef)).subscribe(),this.form.controls.theme.valueChanges.pipe((0,h.p)(e=>null!=e),(0,ft.n)(e=>rp(this,void 0,void 0,function*(){yield this.themeStateService.setSelectedTheme(e)})),(0,c.pQ)(this.destroyRef)).subscribe(),this.form.controls.locale.valueChanges.pipe((0,ft.n)(e=>rp(this,void 0,void 0,function*(){yield this.i18nService.setLocale(e),window.location.reload()})),(0,c.pQ)(this.destroyRef)).subscribe()})}}lp.ɵfac=function(e){return new(e||lp)(k.rXU(a.ok),k.rXU(j.W),k.rXU(np.oO),k.rXU(ip.V),k.rXU(C.abz))},lp.ɵcmp=k.VBU({type:lp,selectors:[["app-appearance"]],decls:34,vars:20,consts:[[1,"tw-w-full","tw-max-w-md",3,"formGroup"],["formControlName","theme","id","theme"],[3,"value","label"],["bitLink","","href","https://bitwarden.com/help/localization/","target","_blank","rel","noreferrer","slot","end",1,"tw-float-right",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["formControlName","locale","id","locale"],[1,"tw-flex","tw-items-start","tw-gap-1.5"],["type","checkbox","bitCheckbox","","formControlName","enableFavicons"],[1,"-tw-mt-0.5"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container")(2,"form",0)(3,"bit-form-field")(4,"bit-label"),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"bit-select",1),k.Z7z(8,op,1,2,"bit-option",2,sp),k.k0s(),k.j41(10,"bit-hint"),k.EFF(11),k.nI1(12,"i18n"),k.k0s()(),k.j41(13,"bit-form-field")(14,"bit-label"),k.EFF(15),k.nI1(16,"i18n"),k.j41(17,"a",3),k.nI1(18,"i18n"),k.nrm(19,"i",4),k.k0s()(),k.j41(20,"bit-select",5),k.Z7z(21,ap,1,2,"bit-option",2,sp),k.k0s(),k.j41(23,"bit-hint"),k.EFF(24),k.nI1(25,"i18n"),k.k0s()(),k.j41(26,"div",6)(27,"bit-form-control"),k.nrm(28,"input",7),k.j41(29,"bit-label"),k.EFF(30),k.nI1(31,"i18n"),k.k0s()(),k.j41(32,"div",8),k.nrm(33,"vault-permit-cipher-details-popover"),k.k0s()()()()),2&e&&(k.R7$(2),k.Y8G("formGroup",t.form),k.R7$(3),k.JRh(k.bMT(6,8,"theme")),k.R7$(3),k.Dyx(t.themeOptions),k.R7$(3),k.JRh(k.bMT(12,10,"themeDesc")),k.R7$(4),k.SpI(" ",k.bMT(16,12,"language")," "),k.R7$(2),k.Y8G("appA11yTitle",k.mNQ(k.bMT(18,14,"learnMoreAboutLocalization"))),k.R7$(4),k.Dyx(t.localeOptions),k.R7$(3),k.JRh(k.bMT(25,16,"languageDesc")),k.R7$(6),k.SpI(" ",k.bMT(31,18,"showIconsChangePasswordUrls")," "))},dependencies:[mi.G,a.qT,a.Zm,a.BC,a.cb,a.j4,a.JD,xr.C,Cr.P,Ai.H,Tr.f,bi.j,$r.I,wi.h,ke.L,Si.w,Ii.P,Ei.G,Di.f,js.tW,ae.$],encapsulation:2,changeDetection:0});class cp{}var dp=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const up=e=>({"table-list-strike":e});function hp(e,t){1&e&&(k.j41(0,"p",1),k.nrm(1,"i",10),k.nI1(2,"i18n"),k.j41(3,"span",11),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function pp(e,t){if(1&e){const e=k.RV6();k.j41(0,"div",17)(1,"bit-form-field",18)(2,"bit-label"),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.nrm(5,"textarea",19),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"button",20),k.nI1(8,"i18n"),k.bIt("click",function(){const t=C.eBV(e).index,i=k.XpG(2);return C.Njj(i.remove(t))}),k.k0s()()}if(2&e){const e=t.$implicit,i=t.index;k.R7$(),k.Y8G("formGroupName",k.mNQ(i)),k.R7$(2),k.SpI("",k.i5U(4,8,"customDomainX",i+1)," "),k.R7$(2),k.Y8G("placeholder",k.VkB("",k.bMT(6,11,"ex")," google.com, gmail.com"))("value",e),k.R7$(2),k.Y8G("label",k.mNQ(k.bMT(8,13,"remove")))}}function mp(e,t){if(1&e){const e=k.RV6();k.qex(0,12),k.DNE(1,pp,9,15,"div",13),k.j41(2,"button",14),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.add())}),k.nrm(3,"i",15),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"small",16),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.bVm()}if(2&e){const e=k.XpG();k.R7$(),k.Y8G("ngForOf",e.custom)("ngForTrackBy",e.indexTrackBy),k.R7$(3),k.SpI(" ",k.bMT(5,4,"newCustomDomain")," "),k.R7$(3),k.JRh(k.bMT(8,6,"newCustomDomainDesc"))}}function vp(e,t){1&e&&(k.j41(0,"p",1),k.nrm(1,"i",10),k.nI1(2,"i18n"),k.j41(3,"span",11),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function fp(e,t){if(1&e){const e=k.RV6();k.j41(0,"a",28),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.toggleExcluded(t))}),k.nrm(1,"i",30),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"exclude")," "))}function gp(e,t){if(1&e){const e=k.RV6();k.j41(0,"a",28),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.toggleExcluded(t))}),k.nrm(1,"i",31),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"include")," "))}function yp(e,t){if(1&e){const e=k.RV6();k.j41(0,"tr",23)(1,"td",24),k.EFF(2),k.k0s(),k.j41(3,"td",25),k.nrm(4,"button",26),k.nI1(5,"i18n"),k.j41(6,"bit-menu",null,0),k.DNE(8,fp,4,3,"a",27)(9,gp,4,3,"a",27),k.j41(10,"a",28),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.customize(t))}),k.nrm(11,"i",29),k.EFF(12),k.nI1(13,"i18n"),k.k0s()()()()}if(2&e){const e=t.$implicit,i=k.sdS(7);k.R7$(),k.Y8G("ngClass",k.eq3(11,up,e.excluded)),k.R7$(),k.JRh(e.domains),k.R7$(2),k.Y8G("bitMenuTriggerFor",i)("label",k.bMT(5,7,"editDomain")),k.R7$(4),k.Y8G("ngIf",!e.excluded),k.R7$(),k.Y8G("ngIf",e.excluded),k.R7$(3),k.SpI(" ",k.bMT(13,9,"customize")," ")}}function bp(e,t){if(1&e&&k.DNE(0,yp,14,13,"tr",22),2&e){const e=k.XpG(2);k.Y8G("ngForOf",e.global)}}function wp(e,t){1&e&&(k.j41(0,"bit-table"),k.DNE(1,bp,1,1,"ng-template",21),k.k0s())}class Sp{constructor(e,t,i,n,r){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.logService=n,this.formBuilder=r,this.loading=!0,this.custom=[],this.global=[],this.formGroup=this.formBuilder.group({customDomain:this.formBuilder.array([])}),this.submit=()=>dp(this,void 0,void 0,function*(){const e=this.formGroup.get("customDomain").value;this.custom=e.map(e=>e.domain);const t=new cp;t.excludedGlobalEquivalentDomains=this.global.filter(e=>e.excluded).map(e=>e.key),0===t.excludedGlobalEquivalentDomains.length&&(t.excludedGlobalEquivalentDomains=null),t.equivalentDomains=this.custom.filter(e=>null!=e&&""!==e.trim()).map(e=>e.split(",").map(e=>e.trim())),0===t.equivalentDomains.length&&(t.equivalentDomains=null),yield this.apiService.putSettingsDomains(t),this.platformUtilsService.showToast("success",null,this.i18nService.t("domainsUpdated"))})}ngOnInit(){return dp(this,void 0,void 0,function*(){const e=yield this.apiService.getSettingsDomains();this.loading=!1,null!=e.equivalentDomains&&(this.custom=e.equivalentDomains.map(e=>e.join(", "))),null!=e.globalEquivalentDomains&&(this.global=e.globalEquivalentDomains.map(e=>({domains:e.domains.join(", "),excluded:e.excluded,key:e.type}))),this.patch()})}patch(){const e=this.formGroup.get("customDomain");e.clear(),this.custom.forEach((t,i)=>{e.insert(i,this.patchValues(t))}),this.formGroup.updateValueAndValidity()}patchValues(e){return this.formBuilder.group({domain:[e]})}toggleExcluded(e){e.excluded=!e.excluded}customize(e){e.excluded=!0,this.custom.push(e.domains),this.patch()}remove(e){this.custom.splice(e,1),this.patch()}add(){this.custom.push(""),this.patch()}indexTrackBy(e,t){return e}}Sp.ɵfac=function(e){return new(e||Sp)(k.rXU(fi.G),k.rXU(j.W),k.rXU(N.y),k.rXU(ve.K),k.rXU(a.ok))},Sp.ɵcmp=k.VBU({type:Sp,selectors:[["app-domain-rules"]],decls:22,vars:21,consts:[["appListDropdown",""],["bitTypography","body1"],[3,"formGroup","bitSubmit"],["bitTypography","h2"],["bitTypography","body1",4,"ngIf"],["formArrayName","customDomain",4,"ngIf"],["type","submit","bitButton","","bitFormButton","","buttonType","primary"],["bitTypography","h2",1,"tw-mt-16"],[4,"ngIf"],["type","submit","bitButton","","buttonType","primary"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["formArrayName","customDomain"],["class","tw-flex tw-items-center tw-gap-2 tw-mb-6",4,"ngFor","ngForOf","ngForTrackBy"],["bitButton","","type","button","buttonType","secondary",1,"tw-mb-2",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"],[1,"tw-text-muted","tw-block","tw-mb-3"],[1,"tw-flex","tw-items-center","tw-gap-2","tw-mb-6"],[1,"tw-flex-1","!tw-mb-0",3,"formGroupName"],["rows","2","bitInput","","formControlName","domain",3,"value","placeholder"],["bitIconButton","bwi-minus-circle","type","button","buttonType","danger",3,"click","label"],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",3,"ngClass"],["bitCell",""],["type","button","bitIconButton","bwi-ellipsis-v",1,"tw-border-0","tw-bg-transparent","tw-p-0",3,"bitMenuTriggerFor","label"],["href","#","bitMenuItem","","appStopClick","",3,"click",4,"ngIf"],["href","#","bitMenuItem","","appStopClick","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-minus-circle"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-plus-circle"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container")(2,"p",1),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"form",2)(6,"h2",3),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.DNE(9,hp,6,7,"p",4)(10,mp,9,8,"ng-container",5),k.j41(11,"button",6),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.j41(14,"h2",7),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.DNE(17,vp,6,7,"p",4)(18,wp,2,0,"bit-table",8),k.j41(19,"button",9),k.EFF(20),k.nI1(21,"i18n"),k.k0s()()()),2&e&&(k.R7$(3),k.JRh(k.bMT(4,11,"domainRulesDesc")),k.R7$(2),k.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),k.R7$(2),k.JRh(k.bMT(8,13,"customEqDomains")),k.R7$(2),k.Y8G("ngIf",t.loading),k.R7$(),k.Y8G("ngIf",!t.loading),k.R7$(2),k.SpI(" ",k.bMT(13,15,"save")," "),k.R7$(3),k.JRh(k.bMT(16,17,"globalEqDomains")),k.R7$(2),k.Y8G("ngIf",t.loading),k.R7$(),k.Y8G("ngIf",!t.loading&&t.global.length>0),k.R7$(2),k.SpI(" ",k.bMT(21,19,"save")," "))},dependencies:[mi.G,Y.YU,Y.Sq,Y.bT,a.qT,a.me,a.BC,a.cb,a.j4,a.JD,a.$R,a.v8,On.Y,gi.$,yi.L,oe.Q,Ai.H,bi.j,Xi.J,wi.h,ln.s,Hr.Z,Wr.O,Jr.S,Qr.Q,es.Y,ts._,ts.O,Ce.r,Ei.G,Di.f,ae.$],encapsulation:2});var Ip=i(73276),kp=i(685),Cp=i(16184),Tp=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Fp(e,t){if(1&e&&(k.j41(0,"span"),k.EFF(1),k.nI1(2,"i18n"),k.nI1(3,"i18n"),k.k0s()),2&e){const e=k.XpG().ngIf;k.R7$(),k.SpI(" ",k.ii3(3,3,"vaultTimeoutPolicyWithActionInEffect",e.timeout.hours,e.timeout.minutes,k.bMT(2,1,e.action))," ")}}function Rp(e,t){if(1&e&&(k.j41(0,"span"),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG().ngIf;k.R7$(),k.SpI(" ",k.brH(2,1,"vaultTimeoutPolicyInEffect",e.timeout.hours,e.timeout.minutes)," ")}}function Pp(e,t){if(1&e&&(k.j41(0,"span"),k.EFF(1),k.nI1(2,"i18n"),k.nI1(3,"i18n"),k.k0s()),2&e){const e=k.XpG().ngIf;k.R7$(),k.SpI(" ",k.i5U(3,3,"vaultTimeoutActionPolicyInEffect",k.bMT(2,1,e.action))," ")}}function xp(e,t){if(1&e&&(k.j41(0,"bit-callout",14),k.DNE(1,Fp,4,8,"span",4)(2,Rp,3,5,"span",4)(3,Pp,4,6,"span",4),k.k0s()),2&e){const e=t.ngIf;k.R7$(),k.Y8G("ngIf",e.timeout&&e.action),k.R7$(),k.Y8G("ngIf",e.timeout&&!e.action),k.R7$(),k.Y8G("ngIf",!e.timeout&&e.action)}}function $p(e,t){if(1&e&&(k.j41(0,"bit-radio-button",19)(1,"bit-label"),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"bit-hint"),k.EFF(5),k.nI1(6,"i18n"),k.k0s()()),2&e){const e=k.XpG(3);k.Y8G("value",e.VaultTimeoutAction.Lock),k.R7$(2),k.JRh(k.bMT(3,3,"lock")),k.R7$(3),k.JRh(k.bMT(6,5,"vaultTimeoutActionLockDesc"))}}function Ep(e,t){if(1&e&&(k.j41(0,"bit-radio-button",20)(1,"bit-label"),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"bit-hint"),k.EFF(5),k.nI1(6,"i18n"),k.k0s()()),2&e){const e=k.XpG(3);k.Y8G("value",e.VaultTimeoutAction.LogOut),k.R7$(2),k.JRh(k.bMT(3,3,"logOut")),k.R7$(3),k.JRh(k.bMT(6,5,"vaultTimeoutActionLogOutDesc"))}}function Ap(e,t){if(1&e&&(k.j41(0,"bit-radio-group",16)(1,"bit-label"),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.DNE(4,$p,7,7,"bit-radio-button",17)(5,Ep,7,7,"bit-radio-button",18),k.k0s()),2&e){const e=k.XpG().ngIf,t=k.XpG();k.R7$(2),k.JRh(k.bMT(3,3,"vaultTimeoutAction")),k.R7$(2),k.Y8G("ngIf",e.includes(t.VaultTimeoutAction.Lock)),k.R7$(),k.Y8G("ngIf",e.includes(t.VaultTimeoutAction.LogOut))}}function Dp(e,t){if(1&e&&(k.qex(0),k.DNE(1,Ap,6,5,"bit-radio-group",15),k.bVm()),2&e){const e=t.ngIf;k.R7$(),k.Y8G("ngIf",e.length>1)}}function Op(e,t){if(1&e&&k.nrm(0,"bit-option",21),2&e){const e=t.$implicit;k.Y8G("value",e.value)("label",e.name)}}function Mp(e,t){if(1&e&&k.nrm(0,"bit-option",21),2&e){const e=t.$implicit;k.Y8G("value",e.value)("label",e.name)}}class Up{constructor(e,t,i,n,r,s,o,a,l){this.formBuilder=e,this.policyService=t,this.i18nService=i,this.vaultTimeoutSettingsService=n,this.platformUtilsService=r,this.themeStateService=s,this.domainSettingsService=o,this.dialogService=a,this.accountService=l,this.VaultTimeoutAction=Cp.W4,this.destroy$=new d.B,this.form=this.formBuilder.group({vaultTimeout:[null],vaultTimeoutAction:[Cp.W4.Lock],enableFavicons:!0,theme:[Jc.NJ.System],locale:[null]}),this.submit=()=>Tp(this,void 0,void 0,function*(){if(!this.form.controls.vaultTimeout.valid)return void this.platformUtilsService.showToast("error",null,this.i18nService.t("vaultTimeoutRangeError"));const e=this.form.getRawValue(),t=yield(0,u._)(this.accountService.activeAccount$);yield this.vaultTimeoutSettingsService.setVaultTimeoutOptions(t.id,e.vaultTimeout,e.vaultTimeoutAction),yield this.domainSettingsService.setShowFavicons(e.enableFavicons),yield this.themeStateService.setSelectedTheme(e.theme),yield this.i18nService.setLocale(e.locale),e.locale!==this.startingLocale?window.location.reload():this.platformUtilsService.showToast("success",null,this.i18nService.t("preferencesUpdated"))}),this.vaultTimeoutOptions=[{name:i.t("oneMinute"),value:1},{name:i.t("fiveMinutes"),value:5},{name:i.t("fifteenMinutes"),value:15},{name:i.t("thirtyMinutes"),value:30},{name:i.t("oneHour"),value:60},{name:i.t("fourHours"),value:240},{name:i.t("onRefresh"),value:Cp.Lw.OnRestart}],this.platformUtilsService.isDev()&&this.vaultTimeoutOptions.push({name:i.t("never"),value:Cp.Lw.Never});const c=[];i.supportedTranslationLocales.forEach(e=>{let t=e;i.localeNames.has(e)&&(t+=" - "+i.localeNames.get(e)),c.push({name:t,value:e})}),c.sort(Pn.A.getSortFunction(i,"name")),c.splice(0,0,{name:i.t("default"),value:null}),this.localeOptions=c,this.themeOptions=[{name:i.t("themeLight"),value:Jc.NJ.Light},{name:i.t("themeDark"),value:Jc.NJ.Dark},{name:i.t("themeSystem"),value:Jc.NJ.System}]}ngOnInit(){return Tp(this,void 0,void 0,function*(){var e;this.availableVaultTimeoutActions$=this.vaultTimeoutSettingsService.availableVaultTimeoutActions$(),this.vaultTimeoutPolicyCallout=this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policiesByType$(ci.tt.MaximumVaultTimeout,e)),kp.Zc,(0,h.p)(e=>null!=e),(0,m.T)(e=>{var t,i,n,r;let s;return(null===(t=e.data)||void 0===t?void 0:t.minutes)&&(s={hours:Math.floor((null===(i=e.data)||void 0===i?void 0:i.minutes)/60),minutes:(null===(n=e.data)||void 0===n?void 0:n.minutes)%60}),{timeout:s,action:null===(r=e.data)||void 0===r?void 0:r.action}}),(0,O.M)(e=>{e.action?this.form.controls.vaultTimeoutAction.disable({emitEvent:!1}):this.form.controls.vaultTimeoutAction.enable({emitEvent:!1})})),this.form.controls.vaultTimeoutAction.valueChanges.pipe((0,Ip.H)(e=>Tp(this,void 0,void 0,function*(){if(e===Cp.W4.LogOut){if(!(yield this.dialogService.openSimpleDialog({title:{key:"vaultTimeoutLogOutConfirmationTitle"},content:{key:"vaultTimeoutLogOutConfirmation"},type:"warning"})))return void this.form.controls.vaultTimeoutAction.patchValue(Cp.W4.Lock,{emitEvent:!1})}})),(0,li.Q)(this.destroy$)).subscribe();const t=yield(0,u._)(this.accountService.activeAccount$),i={vaultTimeout:yield(0,u._)(this.vaultTimeoutSettingsService.getVaultTimeoutByUserId$(t.id)),vaultTimeoutAction:yield(0,u._)(this.vaultTimeoutSettingsService.getVaultTimeoutActionByUserId$(t.id)),enableFavicons:yield(0,u._)(this.domainSettingsService.showFavicons$),theme:yield(0,u._)(this.themeStateService.selectedTheme$),locale:null!==(e=yield(0,u._)(this.i18nService.userSetLocale$))&&void 0!==e?e:null};this.startingLocale=i.locale,this.form.setValue(i,{emitEvent:!1})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}}Up.ɵfac=function(e){return new(e||Up)(k.rXU(a.ok),k.rXU(Le.m),k.rXU(j.W),k.rXU(Cp.ep),k.rXU(N.y),k.rXU(np.oO),k.rXU(ip.V),k.rXU(E.o3),k.rXU(L.Di))},Up.ɵcmp=k.VBU({type:Up,selectors:[["app-preferences"]],decls:43,vars:37,consts:[["bitTypography","body1"],[1,"tw-w-full","tw-max-w-md",3,"formGroup","bitSubmit"],["type","info",4,"ngIf"],["ngDefaultControl","",3,"vaultTimeoutOptions","formControl"],[4,"ngIf"],["bitLink","","href","https://bitwarden.com/help/localization/","target","_blank","rel","noreferrer","slot","end",1,"tw-float-right",3,"appA11yTitle"],["aria-hidden","true",1,"bwi","bwi-question-circle"],["formControlName","locale","id","locale"],[3,"value","label",4,"ngFor","ngForOf"],[1,"tw-flex","tw-items-start","tw-gap-1.5"],["type","checkbox","bitCheckbox","","formControlName","enableFavicons"],[1,"-tw-mt-0.5"],["formControlName","theme","id","theme"],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["type","info"],["formControlName","vaultTimeoutAction",4,"ngIf"],["formControlName","vaultTimeoutAction"],["id","vaultTimeoutActionLock",3,"value",4,"ngIf"],["id","vaultTimeoutActionLogOut",3,"value",4,"ngIf"],["id","vaultTimeoutActionLock",3,"value"],["id","vaultTimeoutActionLogOut",3,"value"],[3,"value","label"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container")(2,"p",0),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"form",1),k.DNE(6,xp,4,3,"bit-callout",2),k.nI1(7,"async"),k.nrm(8,"bit-session-timeout-input-legacy",3),k.DNE(9,Dp,2,1,"ng-container",4),k.nI1(10,"async"),k.j41(11,"bit-form-field")(12,"bit-label"),k.EFF(13),k.nI1(14,"i18n"),k.j41(15,"a",5),k.nI1(16,"i18n"),k.nrm(17,"i",6),k.k0s()(),k.j41(18,"bit-select",7),k.DNE(19,Op,1,2,"bit-option",8),k.k0s(),k.j41(20,"bit-hint"),k.EFF(21),k.nI1(22,"i18n"),k.k0s()(),k.j41(23,"div",9)(24,"bit-form-control"),k.nrm(25,"input",10),k.j41(26,"bit-label"),k.EFF(27),k.nI1(28,"i18n"),k.k0s()(),k.j41(29,"div",11),k.nrm(30,"vault-permit-cipher-details-popover"),k.k0s()(),k.j41(31,"bit-form-field")(32,"bit-label"),k.EFF(33),k.nI1(34,"i18n"),k.k0s(),k.j41(35,"bit-select",12),k.DNE(36,Mp,1,2,"bit-option",8),k.k0s(),k.j41(37,"bit-hint"),k.EFF(38),k.nI1(39,"i18n"),k.k0s()(),k.j41(40,"button",13),k.EFF(41),k.nI1(42,"i18n"),k.k0s()()()),2&e&&(k.R7$(3),k.JRh(k.bMT(4,17,"preferencesDesc")),k.R7$(2),k.Y8G("formGroup",t.form)("bitSubmit",t.submit),k.R7$(),k.Y8G("ngIf",k.bMT(7,19,t.vaultTimeoutPolicyCallout)),k.R7$(2),k.Y8G("vaultTimeoutOptions",t.vaultTimeoutOptions)("formControl",t.form.controls.vaultTimeout),k.R7$(),k.Y8G("ngIf",k.bMT(10,21,t.availableVaultTimeoutActions$)),k.R7$(4),k.SpI(" ",k.bMT(14,23,"language")," "),k.R7$(2),k.Y8G("appA11yTitle",k.mNQ(k.bMT(16,25,"learnMoreAboutLocalization"))),k.R7$(4),k.Y8G("ngForOf",t.localeOptions),k.R7$(2),k.JRh(k.bMT(22,27,"languageDesc")),k.R7$(6),k.SpI(" ",k.bMT(28,29,"showIconsChangePasswordUrls")," "),k.R7$(6),k.JRh(k.bMT(34,31,"theme")),k.R7$(3),k.Y8G("ngForOf",t.themeOptions),k.R7$(2),k.JRh(k.bMT(39,33,"themeDesc")),k.R7$(3),k.JRh(k.bMT(42,35,"save")))},dependencies:[mi.G,Y.Sq,Y.bT,a.qT,a.me,a.Zm,a.BC,a.cb,a.l_,a.j4,a.JD,xr.C,gi.$,yi.L,oe.Q,Ge.G,Cr.P,Ai.H,Tr.f,bi.j,$r.I,wi.h,ke.L,Er.d,Ar.Y,Si.w,Ii.P,Ce.r,Ei.G,Di.f,js.tW,_t.Yz,Y.Jj,ae.$],encapsulation:2});var Gp=i(27545),jp=i(286);class Np{constructor(e){this.dialogService=e,this.openHistoryDialog=()=>{this.dialogService.open(Gp.gA)}}}Np.ɵfac=function(e){return new(e||Np)(k.rXU(E.o3))},Np.ɵcmp=k.VBU({type:Np,selectors:[["credential-generator"]],decls:6,vars:3,consts:[["bitLink","","type","button","linkType","primary","aria-haspopup","dialog",3,"click"]],template:function(e,t){1&e&&(k.nrm(0,"app-header"),k.j41(1,"bit-container"),k.nrm(2,"tools-credential-generator"),k.j41(3,"button",0),k.bIt("click",function(){return t.openHistoryDialog()}),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(4),k.SpI(" ",k.bMT(5,1,"generatorHistory")," "))},dependencies:[mi.G,Ai.H,ke.o,Ei.G,Di.f,Gp.Im,jp.y,se.t,ye.V,ae.$],encapsulation:2});class Vp{constructor(){}}Vp.ɵfac=function(e){return new(e||Vp)},Vp.ɵcmp=k.VBU({type:Vp,selectors:[["app-send-access-explainer"]],decls:2,vars:0,consts:[[1,"tw-text-center","tw-text-muted"],["bitTypography","body2",1,"tw-mb-0"]],template:function(e,t){1&e&&(k.j41(0,"div",0),k.nrm(1,"p",1),k.k0s())},dependencies:[mi.G,Ce.r],encapsulation:2});i(43219);var Bp=i(56986);var zp=i(55159),Lp=i(60954),Kp=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class qp{get filteredSends(){return this._filteredSends}set filteredSends(e){this._filteredSends=e}get searchText(){return this._searchText$.value}set searchText(e){this._searchText$.next(e)}constructor(e,t,i,n,r,s,o,a,l,c,u,h){this.sendService=e,this.i18nService=t,this.platformUtilsService=i,this.environmentService=n,this.ngZone=r,this.searchService=s,this.policyService=o,this.logService=a,this.sendApiService=l,this.dialogService=c,this.toastService=u,this.accountService=h,this.disableSend=!1,this.sendType=Wd.N,this.loaded=!1,this.loading=!0,this.refreshing=!1,this.expired=!1,this.type=null,this.sends=[],this.searchPending=!1,this.hasSearched=!1,this.destroy$=new d.B,this._searchText$=new Fn.t(""),this.isSearchable=!1}ngOnInit(){return Kp(this,void 0,void 0,function*(){this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policyAppliesToUser$(ci.tt.DisableSend,e)),(0,li.Q)(this.destroy$)).subscribe(e=>{this.disableSend=e}),(0,Vr.z)([this._searchText$,this.accountService.activeAccount$.pipe(b.F6)]).pipe((0,ft.n)(([e,t])=>(0,ec.H)(this.searchService.isSearchable(t,e))),(0,li.Q)(this.destroy$)).subscribe(e=>{this.isSearchable=e})})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}load(){return Kp(this,arguments,void 0,function*(e=null){this.loading=!0,this.sendService.sendViews$.pipe((0,zp.Z)(e=>Kp(this,void 0,void 0,function*(){this.sends=e,yield this.search(null)})),(0,li.Q)(this.destroy$)).subscribe(),null!=this.onSuccessfulLoad?yield this.onSuccessfulLoad():this.selectAll(),this.loading=!1,this.loaded=!0})}reload(){return Kp(this,arguments,void 0,function*(e=null){this.loaded=!1,this.sends=[],yield this.load(e)})}refresh(){return Kp(this,void 0,void 0,function*(){try{this.refreshing=!0,yield this.reload(this.filter)}finally{this.refreshing=!1}})}applyFilter(){return Kp(this,arguments,void 0,function*(e=null){this.filter=e,yield this.search(null)})}search(){return Kp(this,arguments,void 0,function*(e=null){if(this.searchPending=!1,null!=this.searchTimeout&&clearTimeout(this.searchTimeout),null==e)return this.hasSearched=this.isSearchable,this.filteredSends=this.sends.filter(e=>null==this.filter||this.filter(e)),void this.applyTextSearch();this.searchPending=!0,this.searchTimeout=setTimeout(()=>Kp(this,void 0,void 0,function*(){this.hasSearched=this.isSearchable,this.filteredSends=this.sends.filter(e=>null==this.filter||this.filter(e)),this.applyTextSearch(),this.searchPending=!1}),e)})}removePassword(e){return Kp(this,void 0,void 0,function*(){if(null!=this.actionPromise||null==e.password)return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"removePassword"},content:{key:"removePasswordConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.sendApiService.removePassword(e.id),yield this.actionPromise,null!=this.onSuccessfulRemovePassword?this.onSuccessfulRemovePassword():(this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("removedPassword")}),yield this.load())}catch(t){this.logService.error(t)}this.actionPromise=null})}delete(e){return Kp(this,void 0,void 0,function*(){if(null!=this.actionPromise)return!1;if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendConfirmation"},type:"warning"})))return!1;try{this.actionPromise=this.sendApiService.delete(e.id),yield this.actionPromise,null!=this.onSuccessfulDelete?this.onSuccessfulDelete():(this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedSend")}),yield this.refresh())}catch(t){this.logService.error(t)}return this.actionPromise=null,!0})}copy(e){return Kp(this,void 0,void 0,function*(){const t=(yield(0,u._)(this.environmentService.environment$)).getSendUrl()+e.accessId+"/"+e.urlB64Key;this.platformUtilsService.copyToClipboard(t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("valueCopied",this.i18nService.t("sendLink"))})})}searchTextChanged(){this.search(200)}selectAll(){this.clearSelections(),this.selectedAll=!0,this.applyFilter(null)}selectType(e){this.clearSelections(),this.selectedType=e,this.applyFilter(t=>t.type===e)}clearSelections(){this.selectedAll=!1,this.selectedType=null}applyTextSearch(){null!=this.searchText&&(this.filteredSends=this.searchService.searchSends(this.filteredSends,this.searchText))}}qp.ɵfac=function(e){return new(e||qp)(k.rXU(Lp.u),k.rXU(j.W),k.rXU(N.y),k.rXU(St.v),k.rXU(k.SKi),k.rXU(V.S),k.rXU(Le.m),k.rXU(ve.K),k.rXU(cu.M),k.rXU(E.o3),k.rXU($.f),k.rXU(L.Di))},qp.ɵdir=k.FsC({type:qp});const _p=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="9 4 83.89 91">
    <path class="tw-fill-illustration-bg-secondary" d="M67 12a2 2 0 0 1 2 2v76a2 2 0 0 1-2 2H11a2 2 0 0 1-2-2V14a2 2 0 0 1 2-2h56Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M67 90V14H11v76h56Zm2-76a2 2 0 0 0-2-2H11a2 2 0 0 0-2 2v76a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2V14Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M77 82V6a2 2 0 0 0-2-2H32.328c-.53 0-1.034.206-1.41.581L17.585 17.916A1.993 1.993 0 0 0 17 19.328V82a2 2 0 0 0 2 2h56a2 2 0 0 0 2-2Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M75 82V6H32.328L19 19.328V82h56ZM32.333 5.995ZM77 6v76a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V19.328c0-.53.209-1.037.584-1.412L30.919 4.581c.375-.375.879-.581 1.41-.581H75a2 2 0 0 1 2 2Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33 5a1 1 0 0 1 1 1v15H19a1 1 0 1 1 0-2h13V6a1 1 0 0 1 1-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M37 35a3 3 0 0 1 3-3h14a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H40a3 3 0 0 1-3-3V35Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M54 34H40a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V35a1 1 0 0 0-1-1Zm-14-2a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V35a3 3 0 0 0-3-3H40Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M46 38a1 1 0 1 1 2 0v4a1 1 0 1 1-2 0v-4Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M42 31a5 5 0 0 1 10 0v1h-2v-1a3 3 0 1 0-6 0v1h-2v-1Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M62 92.058V78l12 6.4-8.658 9.004A1.942 1.942 0 0 1 62 92.058Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="m61 76.333 14.637 7.807-9.574 9.957A2.942 2.942 0 0 1 61 92.057V76.333Zm2 3.333v12.391a.942.942 0 0 0 1.621.653l7.742-8.05L63 79.666Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M42.55 65.971 88.334 44.54c1.76-.824 3.746.587 3.546 2.52l-4.604 44.648c-.197 1.91-2.386 2.895-3.946 1.773L62.5 78.5l-19.82-7.944c-2.03-.813-2.11-3.657-.13-4.585Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M90.886 46.957a1.5 1.5 0 0 0-2.128-1.512L42.974 66.878c-1.188.556-1.14 2.262.078 2.75l19.164 7.681 12.867-14.613a1 1 0 1 1 1.501 1.321L63.98 78.333l19.934 14.336a1.5 1.5 0 0 0 2.367-1.064l4.605-44.648ZM62.015 79.383l-19.707-7.898c-2.842-1.139-2.955-5.12-.182-6.419L87.91 43.634c2.464-1.154 5.244.822 4.965 3.529L88.271 91.81c-.276 2.675-3.341 4.053-5.525 2.482L62.015 79.383Z" clip-rule="evenodd"/>
  </svg>
  `;class Xp{}var Yp=i(1758);class Hp{}var Wp=i(58950),Jp=i(14318),Zp=i(47135),Qp=i(20377),em=i(29776),tm=i(25024),im=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function nm(e,t){if(1&e&&(k.j41(0,"bit-hint"),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.SpI(" ",k.i5U(2,1,"limitSendViewsCount",e.viewsLeft))}}function rm(e,t){1&e&&k.nrm(0,"button",11)}function sm(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",12),k.nI1(1,"i18n"),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.generatePassword())}),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("label",k.bMT(1,2,"generatePassword"))("disabled",!e.config.areSendsAllowed)}}function om(e,t){if(1&e&&(k.nrm(0,"button",13),k.nI1(1,"i18n"),k.nI1(2,"i18n")),2&e){const e=k.XpG();k.Y8G("label",k.bMT(1,4,"copyPassword"))("disabled",!e.config.areSendsAllowed||!e.sendOptionsForm.get("password").value)("valueLabel",k.bMT(2,6,"password"))("appCopyClick",e.sendOptionsForm.get("password").value)}}function am(e,t){if(1&e&&(k.nrm(0,"button",14),k.nI1(1,"i18n")),2&e){const e=k.XpG();k.Y8G("label",k.bMT(1,2,"removePassword"))("bitAction",e.removePassword)}}function lm(e,t){if(1&e&&(k.j41(0,"bit-form-control"),k.nrm(1,"input",15),k.j41(2,"bit-label"),k.EFF(3),k.nI1(4,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.R7$(),k.Y8G("disabled",e.disableHideEmail&&!e.sendOptionsForm.get("hideEmail").value),k.R7$(2),k.JRh(k.bMT(4,2,"hideYourEmail"))}}class cm{get hasPassword(){return this.originalSendView&&null!==this.originalSendView.password}get shouldShowCount(){return"edit"===this.config.mode&&null!==this.sendOptionsForm.value.maxAccessCount}get viewsLeft(){return String(this.sendOptionsForm.value.maxAccessCount?this.sendOptionsForm.value.maxAccessCount-this.sendOptionsForm.value.accessCount:0)}constructor(e,t,i,n,r,s,o,a,l){this.sendFormContainer=e,this.dialogService=t,this.sendApiService=i,this.formBuilder=n,this.policyService=r,this.i18nService=s,this.toastService=o,this.generatorService=a,this.accountService=l,this.disableHideEmail=!1,this.passwordRemoved=!1,this.sendOptionsForm=this.formBuilder.group({maxAccessCount:[null],accessCount:[null],notes:[null],password:[null],hideEmail:[!1]}),this.generatePassword=()=>im(this,void 0,void 0,function*(){const e=new Fn.t({source:"send",type:em.ZU.password}),t=this.accountService.activeAccount$.pipe((0,Qp.y_)({name:()=>"send-options.component",distinct:(e,t)=>e.id===t.id})),i=yield(0,u._)(this.generatorService.generate$({on$:e,account$:t}));this.sendOptionsForm.patchValue({password:i.credential})}),this.removePassword=()=>im(this,void 0,void 0,function*(){var e;if(!this.originalSendView||!this.originalSendView.password)return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"removePassword"},content:{key:"removePasswordConfirmation"},type:"warning"})))return!1;this.passwordRemoved=!0,yield this.sendApiService.removePassword(this.originalSendView.id),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("removedPassword")}),this.originalSendView.password=null,this.sendOptionsForm.patchValue({password:null}),null===(e=this.sendOptionsForm.get("password"))||void 0===e||e.enable()}),this.sendFormContainer.registerChildForm("sendOptionsForm",this.sendOptionsForm),this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policiesByType$(ci.tt.SendOptions,e)),(0,m.T)(e=>null==e?void 0:e.some(e=>e.data.disableHideEmail)),(0,c.pQ)()).subscribe(e=>{this.disableHideEmail=e}),this.sendOptionsForm.valueChanges.pipe((0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>(Object.assign(t,{maxAccessCount:e.maxAccessCount,accessCount:e.accessCount,password:e.password,hideEmail:e.hideEmail,notes:e.notes}),t))})}ngOnInit(){var e;this.sendFormContainer.originalSendView&&this.sendOptionsForm.patchValue({maxAccessCount:this.sendFormContainer.originalSendView.maxAccessCount,accessCount:this.sendFormContainer.originalSendView.accessCount,password:this.hasPassword?"************":null,hideEmail:this.sendFormContainer.originalSendView.hideEmail,notes:this.sendFormContainer.originalSendView.notes}),this.hasPassword&&(null===(e=this.sendOptionsForm.get("password"))||void 0===e||e.disable()),this.config.areSendsAllowed||this.sendOptionsForm.disable()}}function dm(e,t){if(1&e&&(k.j41(0,"div")(1,"div",3),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"div",4),k.EFF(5),k.k0s(),k.j41(6,"div",5),k.EFF(7),k.k0s()()),2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,3,"file")),k.R7$(3),k.SpI(" ",e.originalSendView().file.fileName," "),k.R7$(2),k.JRh(e.originalSendView().file.sizeName)}}function um(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-form-field")(1,"bit-label",6),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"div",7)(5,"button",8),k.bIt("click",function(){C.eBV(e);const t=k.sdS(12);return C.Njj(t.click())}),k.EFF(6),k.nI1(7,"i18n"),k.k0s(),k.j41(8,"span",9),k.EFF(9),k.nI1(10,"i18n"),k.k0s()(),k.j41(11,"input",10,0),k.bIt("change",function(t){C.eBV(e);const i=k.XpG();return C.Njj(i.onFileSelected(t))}),k.k0s(),k.j41(13,"bit-hint"),k.EFF(14),k.nI1(15,"i18n"),k.k0s()()}if(2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,5,"fileToShare")),k.R7$(4),k.SpI(" ",k.bMT(7,7,"chooseFile")," "),k.R7$(2),k.Y8G("ngClass",e.fileName?"tw-text-main":"tw-text-muted"),k.R7$(),k.SpI(" ",e.fileName||k.bMT(10,9,"noFileChosen")),k.R7$(5),k.SpI(" ",k.bMT(15,11,"maxFileSize")," ")}}cm.ɵfac=function(e){return new(e||cm)(k.rXU(Hp),k.rXU(E.o3),k.rXU(cu.M),k.rXU(a.ok),k.rXU(Le.m),k.rXU(j.W),k.rXU($.f),k.rXU(em.iE),k.rXU(L.Di))},cm.ɵcmp=k.VBU({type:cm,selectors:[["tools-send-options"]],inputs:{config:"config",originalSendView:"originalSendView"},decls:33,vars:25,consts:[["disableMargin","",3,"formGroup"],["bitTypography","h6",1,"tw-mt-4"],["bitInput","","type","number","formControlName","maxAccessCount","min","1"],[4,"ngIf"],["bitInput","","type","password","formControlName","password","autocomplete","new-password"],["data-testid","toggle-visibility-for-password","type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle","",4,"ngIf"],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-password",3,"label","disabled","click",4,"ngIf"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","",3,"label","disabled","valueLabel","appCopyClick",4,"ngIf"],["class","tw-border-l-0 last:tw-rounded-r focus-visible:tw-border-l focus-visible:tw-ml-[-1px]","bitSuffix","","type","button","buttonType","danger","bitIconButton","bwi-minus-circle","showToast","",3,"label","bitAction",4,"ngIf"],["disableMargin",""],["bitInput","","rows","3","formControlName","notes"],["data-testid","toggle-visibility-for-password","type","button","bitIconButton","","bitSuffix","","bitPasswordInputToggle",""],["type","button","bitIconButton","bwi-generate","bitSuffix","","data-testid","generate-password",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","bitSuffix","","showToast","",3,"label","disabled","valueLabel","appCopyClick"],["bitSuffix","","type","button","buttonType","danger","bitIconButton","bwi-minus-circle","showToast","",1,"tw-border-l-0","last:tw-rounded-r","focus-visible:tw-border-l","focus-visible:tw-ml-[-1px]",3,"label","bitAction"],["bitCheckbox","","type","checkbox","formControlName","hideEmail",3,"disabled"]],template:function(e,t){1&e&&(k.j41(0,"bit-section",0)(1,"bit-section-header")(2,"h2",1),k.EFF(3),k.nI1(4,"i18n"),k.k0s()(),k.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.nrm(10,"input",2),k.j41(11,"bit-hint"),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.DNE(14,nm,3,4,"bit-hint",3),k.k0s(),k.j41(15,"bit-form-field")(16,"bit-label"),k.EFF(17),k.nI1(18,"i18n"),k.k0s(),k.nrm(19,"input",4),k.DNE(20,rm,1,0,"button",5)(21,sm,2,4,"button",6)(22,om,3,8,"button",7)(23,am,2,4,"button",8),k.j41(24,"bit-hint"),k.EFF(25),k.nI1(26,"i18n"),k.k0s()(),k.DNE(27,lm,5,4,"bit-form-control",3),k.j41(28,"bit-form-field",9)(29,"bit-label"),k.EFF(30),k.nI1(31,"i18n"),k.k0s(),k.nrm(32,"textarea",10),k.k0s()()()),2&e&&(k.Y8G("formGroup",t.sendOptionsForm),k.R7$(3),k.JRh(k.bMT(4,13,"additionalOptions")),k.R7$(5),k.JRh(k.bMT(9,15,"limitSendViews")),k.R7$(4),k.JRh(k.bMT(13,17,"limitSendViewsHint")),k.R7$(2),k.Y8G("ngIf",t.shouldShowCount),k.R7$(3),k.JRh(k.bMT(18,19,t.passwordRemoved?"newPassword":"password")),k.R7$(3),k.Y8G("ngIf",!t.hasPassword),k.R7$(),k.Y8G("ngIf",!t.hasPassword),k.R7$(),k.Y8G("ngIf",!t.hasPassword),k.R7$(),k.Y8G("ngIf",t.hasPassword),k.R7$(2),k.JRh(k.bMT(26,21,"sendPasswordDescV3")),k.R7$(2),k.Y8G("ngIf",!t.disableHideEmail||(null==t.originalSendView?null:t.originalSendView.hideEmail)),k.R7$(3),k.JRh(k.bMT(31,23,"privateNote")))},dependencies:[Jn.C,Qt.p,se.t,Jp.i,Zp.q,Cr.P,Y.MD,Y.bT,Wn.L,Tr.f,bi.j,$r.I,Xi.J,wi.h,on.e,an.a,Zn.Q,ln.s,re.p,tm.D,a.X1,a.me,a.Q0,a.Zm,a.BC,a.cb,a.VZ,a.j4,a.JD,Zr.n,Wp.U,be.E,Ce.r,ae.$],encapsulation:2});class hm{constructor(e,t){this.formBuilder=e,this.sendFormContainer=t,this.config=r.hFB.required(),this.originalSendView=(0,r.hFB)(),this.sendFileDetailsForm=this.formBuilder.group({file:this.formBuilder.control(null,a.k0.required)}),this.FileSendType=Wd.N.File,this.fileName="",this.onFileSelected=e=>{var t;const i=null===(t=e.target.files)||void 0===t?void 0:t[0];i&&(this.fileName=i.name,this.sendFormContainer.onFileSelected(i))},this.sendFormContainer.registerChildForm("sendFileDetailsForm",this.sendFileDetailsForm),this.sendFileDetailsForm.valueChanges.pipe((0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>Object.assign(t,{file:e.file}))})}ngOnInit(){var e;this.originalSendView()&&this.sendFileDetailsForm.patchValue({file:null===(e=this.originalSendView())||void 0===e?void 0:e.file}),this.config().areSendsAllowed||this.sendFileDetailsForm.disable()}}hm.ɵfac=function(e){return new(e||hm)(k.rXU(a.ok),k.rXU(Hp))},hm.ɵcmp=k.VBU({type:hm,selectors:[["tools-send-file-details"]],inputs:{config:[1,"config"],originalSendView:[1,"originalSendView"]},decls:3,vars:3,consts:[["fileSelector",""],[3,"formGroup"],[4,"ngIf"],["bitTypography","body2",1,"tw-text-muted"],["data-testid","file-name",1,"tw-text-wrap","tw-break-all"],["data-testid","file-size",1,"tw-text-muted"],["for","file"],[1,"tw-flex","tw-mt-2","tw-mb-1"],["bitButton","","type","button","buttonType","secondary",3,"click"],[1,"tw-flex","tw-items-center","tw-pl-3",3,"ngClass"],["bitInput","","type","file","formControlName","file","hidden","",3,"change"]],template:function(e,t){1&e&&(k.j41(0,"bit-section",1),k.DNE(1,dm,8,5,"div",2)(2,um,16,13,"bit-form-field",2),k.k0s()),2&e&&(k.Y8G("formGroup",t.sendFileDetailsForm),k.R7$(),k.Y8G("ngIf","edit"===t.config().mode),k.R7$(),k.Y8G("ngIf","edit"!==t.config().mode))},dependencies:[se.t,oe.Q,Y.MD,Y.YU,Y.bT,re.p,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,Wn.L,bi.j,$r.I,Xi.J,wi.h,Zr.n,a.YN,be.E,Ce.r,ae.$],encapsulation:2});var pm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class mm{constructor(e,t){this.formBuilder=e,this.sendFormContainer=t,this.config=r.hFB.required(),this.originalSendView=(0,r.hFB)(),this.sendTextDetailsForm=this.formBuilder.group({text:new a.MJ("",a.k0.required),hidden:new a.MJ(!1)}),this.sendFormContainer.registerChildForm("sendTextDetailsForm",this.sendTextDetailsForm),this.sendTextDetailsForm.valueChanges.pipe((0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>Object.assign(t,{text:{text:e.text,hidden:e.hidden}}))})}ngOnInit(){return pm(this,void 0,void 0,function*(){var e,t,i,n;this.sendTextDetailsForm.patchValue({text:(null===(t=null===(e=this.originalSendView())||void 0===e?void 0:e.text)||void 0===t?void 0:t.text)||"",hidden:(null===(n=null===(i=this.originalSendView())||void 0===i?void 0:i.text)||void 0===n?void 0:n.hidden)||!1}),this.config().areSendsAllowed||this.sendTextDetailsForm.disable()})}}mm.ɵfac=function(e){return new(e||mm)(k.rXU(a.ok),k.rXU(Hp))},mm.ɵcmp=k.VBU({type:mm,selectors:[["tools-send-text-details"]],inputs:{config:[1,"config"],originalSendView:[1,"originalSendView"]},decls:11,vars:7,consts:[["disableMargin","",3,"formGroup"],["bitInput","","id","text","rows","3","formControlName","text"],["bitCheckbox","","type","checkbox","formControlName","hidden"]],template:function(e,t){1&e&&(k.j41(0,"bit-section",0)(1,"bit-form-field")(2,"bit-label"),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.nrm(5,"textarea",1),k.k0s(),k.j41(6,"bit-form-control"),k.nrm(7,"input",2),k.j41(8,"bit-label"),k.EFF(9),k.nI1(10,"i18n"),k.k0s()()()),2&e&&(k.Y8G("formGroup",t.sendTextDetailsForm),k.R7$(3),k.JRh(k.bMT(4,3,"sendTypeTextToShare")),k.R7$(6),k.JRh(k.bMT(10,5,"hideTextByDefault")))},dependencies:[Zp.q,Cr.P,Y.MD,re.p,a.X1,a.me,a.Zm,a.BC,a.cb,a.j4,a.JD,Wn.L,Tr.f,bi.j,Xi.J,wi.h,Zr.n,ae.$],encapsulation:2});var vm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function fm(e,t){if(1&e&&k.nrm(0,"tools-send-text-details",9),2&e){const e=k.XpG();k.Y8G("config",e.config)("originalSendView",e.originalSendView)}}function gm(e,t){if(1&e&&k.nrm(0,"tools-send-file-details",9),2&e){const e=k.XpG();k.Y8G("config",e.config)("originalSendView",e.originalSendView)}}function ym(e,t){if(1&e&&(k.j41(0,"bit-form-field")(1,"bit-label"),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.nrm(4,"input",10)(5,"button",11),k.nI1(6,"i18n"),k.k0s()),2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,4,"sendLink")),k.R7$(2),k.Y8G("value",e.sendLink),k.R7$(),k.Y8G("appCopyClick",e.sendLink)("label",k.bMT(6,6,"copySendLink"))}}function bm(e,t){if(1&e&&k.nrm(0,"bit-option",12),2&e){const e=t.$implicit;k.Y8G("value",e.value)("label",e.name)}}const wm=Object.freeze({OneHour:1,OneDay:24,TwoDays:48,ThreeDays:72,SevenDays:168,FourteenDays:336,ThirtyDays:720}),Sm=new Map(Object.entries(wm).map(([e,t])=>[t,e]));function Im(e){return Sm.has(e)}class km{constructor(e,t,i,n,r){this.sendFormContainer=e,this.formBuilder=t,this.i18nService=i,this.datePipe=n,this.environmentService=r,this.FileSendType=Wd.N.File,this.TextSendType=Wd.N.Text,this.sendLink=null,this.customDeletionDateOption=null,this.datePresetOptions=[],this.sendDetailsForm=this.formBuilder.group({name:new a.MJ("",a.k0.required),selectedDeletionDatePreset:new a.MJ(wm.SevenDays||"",a.k0.required)}),this.sendDetailsForm.valueChanges.pipe((0,c.pQ)()).subscribe(e=>{this.sendFormContainer.patchSend(t=>Object.assign(t,{name:e.name,deletionDate:new Date(this.formattedDeletionDate),expirationDate:new Date(this.formattedDeletionDate)}))}),this.sendFormContainer.registerChildForm("sendDetailsForm",this.sendDetailsForm)}ngOnInit(){return vm(this,void 0,void 0,function*(){if(this.setupDeletionDatePresets(),this.originalSendView){this.sendDetailsForm.patchValue({name:this.originalSendView.name,selectedDeletionDatePreset:this.originalSendView.deletionDate.toString()}),this.originalSendView.deletionDate&&(this.customDeletionDateOption={name:this.datePipe.transform(this.originalSendView.deletionDate,"short"),value:this.originalSendView.deletionDate.toString()},this.datePresetOptions.unshift(this.customDeletionDateOption));const e=yield(0,u._)(this.environmentService.environment$);this.sendLink=e.getSendUrl()+this.originalSendView.accessId+"/"+this.originalSendView.urlB64Key}this.config.areSendsAllowed||this.sendDetailsForm.disable()})}setupDeletionDatePresets(){const e=[{name:this.i18nService.t("oneHour"),value:wm.OneHour},{name:this.i18nService.t("oneDay"),value:wm.OneDay},{name:this.i18nService.t("days","2"),value:wm.TwoDays},{name:this.i18nService.t("days","3"),value:wm.ThreeDays},{name:this.i18nService.t("days","7"),value:wm.SevenDays},{name:this.i18nService.t("days","14"),value:wm.FourteenDays},{name:this.i18nService.t("days","30"),value:wm.ThirtyDays}];this.datePresetOptions=e}get formattedDeletionDate(){const e=new Date,t=this.sendDetailsForm.controls.selectedDeletionDatePreset.value;if("string"==typeof t)return t;const i=Im(n=t)?n:void 0;var n;if(!Im(i))return new Date(e).toString();const r=e.setTime(e.getTime()+60*i*60*1e3);return new Date(r).toString()}}km.ɵfac=function(e){return new(e||km)(k.rXU(Hp),k.rXU(a.ok),k.rXU(j.W),k.rXU(Y.vh),k.rXU(St.v))},km.ɵcmp=k.VBU({type:km,selectors:[["tools-send-details"]],inputs:{config:"config",originalSendView:"originalSendView"},decls:24,vars:19,consts:[["disableMargin","",3,"formGroup"],[1,"tw-mt-2"],["bitTypography","h6"],["appAutofocus","","bitInput","","type","text","formControlName","name"],[3,"config","originalSendView",4,"ngIf"],[4,"ngIf"],["disableMargin",""],["id","deletionDate","name","SelectedDeletionDatePreset","formControlName","selectedDeletionDatePreset"],[3,"value","label",4,"ngFor","ngForOf"],[3,"config","originalSendView"],["data-testid","send-link","bitInput","","type","text","disabled","",3,"value"],["type","button","bitSuffix","","showToast","","bitIconButton","bwi-clone",3,"appCopyClick","label"],[3,"value","label"]],template:function(e,t){1&e&&(k.j41(0,"bit-section",0)(1,"bit-section-header",1)(2,"h2",2),k.EFF(3),k.nI1(4,"i18n"),k.k0s()(),k.j41(5,"bit-card")(6,"bit-form-field")(7,"bit-label"),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.nrm(10,"input",3),k.k0s(),k.DNE(11,fm,1,2,"tools-send-text-details",4)(12,gm,1,2,"tools-send-file-details",4)(13,ym,7,8,"bit-form-field",5),k.j41(14,"bit-form-field",6)(15,"bit-label"),k.EFF(16),k.nI1(17,"i18n"),k.k0s(),k.j41(18,"bit-select",7),k.DNE(19,bm,1,2,"bit-option",8),k.k0s(),k.j41(20,"bit-hint"),k.EFF(21),k.nI1(22,"i18n"),k.k0s()()(),k.nrm(23,"tools-send-options",9),k.k0s()),2&e&&(k.Y8G("formGroup",t.sendDetailsForm),k.R7$(3),k.JRh(k.bMT(4,11,"sendDetails")),k.R7$(5),k.JRh(k.bMT(9,13,"name")),k.R7$(3),k.Y8G("ngIf",t.config.sendType===t.TextSendType),k.R7$(),k.Y8G("ngIf",t.config.sendType===t.FileSendType),k.R7$(),k.Y8G("ngIf",t.sendLink),k.R7$(3),k.JRh(k.bMT(17,15,"deletionDate")),k.R7$(3),k.Y8G("ngForOf",t.datePresetOptions),k.R7$(2),k.JRh(k.bMT(22,17,"deletionDateDescV2")),k.R7$(2),k.Y8G("config",t.config)("originalSendView",t.originalSendView))},dependencies:[Zr.n,Wp.U,be.E,Ce.r,re.p,qi.B,tm.D,Jp.i,Wn.L,bi.j,$r.I,Xi.J,wi.h,an.a,a.X1,a.me,a.BC,a.cb,a.j4,a.JD,mm,hm,cm,Zn.Q,ln.s,Zp.q,Y.MD,Y.Sq,Y.bT,Qn.p,Si.w,Ii.P,ae.$],encapsulation:2});var Cm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Tm(e,t){if(1&e&&(k.qex(0),k.nrm(1,"tools-send-details",2),k.bVm()),2&e){const e=k.XpG();k.R7$(),k.Y8G("config",e.config)("originalSendView",e.originalSendView)}}class Fm{ngAfterViewInit(){this.submitBtn&&(this.bitSubmit.loading$.pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.loading.set(e)}),this.bitSubmit.disabled$.pipe((0,c.pQ)(this.destroyRef)).subscribe(e=>{this.submitBtn.disabled.set(e)}))}registerChildForm(e,t){this.sendForm.setControl(e,t)}patchSend(e){this.updatedSendView=e(this.updatedSendView)}ngOnChanges(){return Cm(this,void 0,void 0,function*(){this._firstInitialized&&(yield this.init())})}ngOnInit(){return Cm(this,void 0,void 0,function*(){yield this.init(),this._firstInitialized=!0})}init(){return Cm(this,void 0,void 0,function*(){if(this.loading=!0,this.updatedSendView=new Yp.u,this.originalSendView=null,this.sendForm.reset(),null!=this.config){if("add"!==this.config.mode){if(null==this.config.originalSend)throw new Error("Original send is required for edit or clone mode");this.originalSendView=yield this.addEditFormService.decryptSend(this.config.originalSend),this.updatedSendView=Object.assign(this.updatedSendView,this.originalSendView)}else this.updatedSendView.type=this.config.sendType;this.loading=!1}})}constructor(e,t,i,n){this.formBuilder=e,this.addEditFormService=t,this.toastService=i,this.i18nService=n,this.destroyRef=(0,C.WQX)(C.abz),this._firstInitialized=!1,this.file=null,this.onSendCreated=new k.bkB,this.onSendUpdated=new k.bkB,this.sendForm=this.formBuilder.group({}),this.loading=!0,this.SendType=Wd.N,this.submit=()=>Cm(this,void 0,void 0,function*(){if(this.sendForm.invalid)return void this.sendForm.markAllAsTouched();const e=yield this.addEditFormService.saveSend(this.updatedSendView,this.file,this.config);"add"!==this.config.mode?(Pn.A.isNullOrWhitespace(this.updatedSendView.password)&&(this.updatedSendView.password=null),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("editedItem")}),this.onSendUpdated.emit(this.updatedSendView)):this.onSendCreated.emit(e)})}onFileSelected(e){this.file=e}}Fm.ɵfac=function(e){return new(e||Fm)(k.rXU(a.ok),k.rXU(Xp),k.rXU($.f),k.rXU(j.W))},Fm.ɵcmp=k.VBU({type:Fm,selectors:[["tools-send-form"]],viewQuery:function(e,t){if(1&e&&k.GBs(yi.L,5),2&e){let e;k.mGM(e=k.lsd())&&(t.bitSubmit=e.first)}},inputs:{formId:"formId",config:"config",submitBtn:"submitBtn"},outputs:{onSendCreated:"onSendCreated",onSendUpdated:"onSendUpdated"},features:[k.Jv_([{provide:Hp,useExisting:(0,C.Rfq)(()=>Fm)}]),k.OA$],decls:2,vars:4,consts:[[3,"id","formGroup","bitSubmit"],[4,"ngIf"],[3,"config","originalSendView"]],template:function(e,t){1&e&&(k.j41(0,"form",0),k.DNE(1,Tm,2,2,"ng-container",1),k.k0s()),2&e&&(k.Y8G("id",t.formId)("formGroup",t.sendForm)("bitSubmit",t.submit),k.R7$(),k.Y8G("ngIf",!t.loading))},dependencies:[Jn.C,yi.L,be.E,mo.k,Wn.L,a.X1,a.qT,a.cb,a.j4,Qn.p,Y.bT,km],encapsulation:2});var Rm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Pm{constructor(){this.accountService=(0,C.WQX)(L.Di),this.sendApiService=(0,C.WQX)(cu.M),this.sendService=(0,C.WQX)(Lp.u)}decryptSend(e){return Rm(this,void 0,void 0,function*(){const t=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));return yield e.decrypt(t)})}saveSend(e,t,i){return Rm(this,void 0,void 0,function*(){const i=yield this.sendService.encrypt(e,t,e.password,null),n=yield this.sendApiService.save(i);return yield this.decryptSend(n)})}}Pm.ɵfac=function(e){return new(e||Pm)},Pm.ɵprov=C.jDH({token:Pm,factory:Pm.ɵfac});class xm{}xm.ɵfac=function(e){return new(e||xm)},xm.ɵmod=k.$C({type:xm}),xm.ɵinj=C.G2t({providers:[{provide:Xp,useClass:Pm}],imports:[Fm,Gp._h]});var $m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Em{constructor(){this.policyService=(0,C.WQX)(Le.m),this.sendService=(0,C.WQX)(Lp.u),this.accountService=(0,C.WQX)(L.Di),this.areSendsEnabled$=this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policyAppliesToUser$(ci.tt.DisableSend,e)),(0,m.T)(e=>!e))}buildConfig(e,t,i){return $m(this,void 0,void 0,function*(){var n,r;const[s,o]=yield(0,u._)((0,Vr.z)([this.areSendsEnabled$,this.getSend(t)]));return{mode:e,sendType:null!==(r=null!==(n=null==o?void 0:o.type)&&void 0!==n?n:i)&&void 0!==r?r:Wd.N.Text,areSendsAllowed:s,originalSend:o}})}getSend(e){return null==e?Promise.resolve(null):this.sendService.get$(e)}}Em.ɵfac=function(e){return new(e||Em)},Em.ɵprov=C.jDH({token:Em,factory:Em.ɵfac});var Am=i(90647),Dm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Om(e,t){1&e&&k.nrm(0,"i",8)}class Mm{constructor(e,t,i,n){this.billingAccountProfileStateService=e,this.accountService=t,this.router=i,this.premiumUpgradePromptService=n,this.hideIcon=!1,this.buttonType="primary",this.sendType=Wd.N,this.hasNoPremium=!1}ngOnInit(){return Dm(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$);this.hasNoPremium=!e||!(yield(0,u._)(this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id)))})}buildRouterLink(){return"/add-send"}buildQueryParams(e){return{type:e,isNew:!0}}sendFileClick(){return Dm(this,void 0,void 0,function*(){this.hasNoPremium?yield this.premiumUpgradePromptService.promptForPremium():yield this.router.navigate([this.buildRouterLink()],{queryParams:this.buildQueryParams(Wd.N.File)})})}}Mm.ɵfac=function(e){return new(e||Mm)(k.rXU(Xr.Q),k.rXU(L.Di),k.rXU(x.Ix),k.rXU(Vs.l))},Mm.ɵcmp=k.VBU({type:Mm,selectors:[["tools-new-send-dropdown"]],inputs:{hideIcon:"hideIcon",buttonType:"buttonType"},decls:16,vars:14,consts:[["itemOptions",""],["bitButton","","type","button",3,"bitMenuTriggerFor","buttonType"],["class","bwi bwi-plus tw-me-2","aria-hidden","true",4,"ngIf"],["bitMenuItem","",3,"routerLink","queryParams"],["slot","start","aria-hidden","true",1,"bwi","bwi-file-text"],["bitMenuItem","",3,"click"],[1,"tw-flex","tw-items-center","tw-gap-2"],["slot","start","aria-hidden","true",1,"bwi","bwi-file"],["aria-hidden","true",1,"bwi","bwi-plus","tw-me-2"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",1),k.DNE(1,Om,1,0,"i",2),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"bit-menu",null,0)(6,"a",3),k.nrm(7,"i",4),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.j41(10,"a",5),k.bIt("click",function(){return C.eBV(e),C.Njj(t.sendFileClick())}),k.j41(11,"div",6),k.nrm(12,"i",7),k.EFF(13),k.nI1(14,"i18n"),k.nrm(15,"app-premium-badge"),k.k0s()()()}if(2&e){const e=k.sdS(5);k.Y8G("bitMenuTriggerFor",e)("buttonType",t.buttonType),k.R7$(),k.Y8G("ngIf",!t.hideIcon),k.R7$(),k.SpI(" ",k.bMT(3,8,t.hideIcon?"createSend":"new"),"\n"),k.R7$(4),k.Y8G("routerLink",t.buildRouterLink())("queryParams",t.buildQueryParams(t.sendType.Text)),k.R7$(2),k.SpI(" ",k.bMT(9,10,"sendTypeText")," "),k.R7$(5),k.SpI(" ",k.bMT(14,12,"sendTypeFile")," ")}},dependencies:[re.p,Y.MD,Y.bT,se.t,oe.Q,ne.Wk,Am.M,Hr.Z,Wr.O,Jr.S,yr.a,ae.$],encapsulation:2});var Um=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Gm(e,t){if(1&e&&(k.nrm(0,"button",11),k.nI1(1,"i18n")),2&e){const e=k.XpG();k.Y8G("label",k.mNQ(k.bMT(1,3,"delete")))("bitAction",e.deleteSend)}}const jm=Object.freeze({Saved:"saved",Deleted:"deleted"});class Nm{constructor(e,t,i,n,r,s){this.params=e,this.dialogRef=t,this.i18nService=i,this.sendApiService=n,this.toastService=r,this.dialogService=s,this.deleteSend=()=>Um(this,void 0,void 0,function*(){var e;if(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendPermanentConfirmation"},type:"warning"})){try{yield this.sendApiService.delete(null===(e=this.config.originalSend)||void 0===e?void 0:e.id)}catch(t){return void this.toastService.showToast({variant:"error",title:null,message:t.message})}yield this.onSendDeleted()}}),this.config=e.formConfig,this.headerText=this.getHeaderText(this.config.mode,this.config.sendType)}onSendCreated(e){return Um(this,void 0,void 0,function*(){this.dialogRef.close(jm.Saved)})}onSendUpdated(e){return Um(this,void 0,void 0,function*(){this.dialogRef.close(jm.Saved)})}onSendDeleted(){return Um(this,void 0,void 0,function*(){this.dialogRef.close(jm.Deleted),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedSend")})})}getHeaderText(e,t){const i="edit"===e||"partial-edit"===e,n={[Wd.N.Text]:i?"editItemHeaderTextSend":"newItemHeaderTextSend",[Wd.N.File]:i?"editItemHeaderFileSend":"newItemHeaderFileSend"};return this.i18nService.t(n[t])}static open(e,t){return e.open(Nm,{data:t})}}Nm.ɵfac=function(e){return new(e||Nm)(k.rXU(xn.Qs),k.rXU(E.ce),k.rXU(j.W),k.rXU(cu.M),k.rXU($.f),k.rXU(E.o3))},Nm.ɵcmp=k.VBU({type:Nm,selectors:[["ng-component"]],decls:16,vars:10,consts:[["dialog",""],["submitBtn",""],["dialogSize","large","background","alt"],["bitDialogTitle",""],["bitDialogContent",""],["formId","sendForm",3,"onSendCreated","onSendUpdated","config","submitBtn"],["bitDialogFooter",""],["bitButton","","type","submit","form","sendForm","buttonType","primary"],["bitButton","","type","button","buttonType","secondary","bitDialogClose",""],[1,"tw-ml-auto"],["type","button","buttonType","danger","slot","end","bitIconButton","bwi-trash",3,"bitAction","label",4,"ngIf"],["type","button","buttonType","danger","slot","end","bitIconButton","bwi-trash",3,"bitAction","label"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-dialog",2,0)(2,"span",3),k.EFF(3),k.k0s(),k.j41(4,"span",4)(5,"tools-send-form",5),k.bIt("onSendCreated",function(i){return C.eBV(e),C.Njj(t.onSendCreated(i))})("onSendUpdated",function(i){return C.eBV(e),C.Njj(t.onSendUpdated(i))}),k.k0s()(),k.qex(6,6),k.j41(7,"button",7,1),k.EFF(9),k.nI1(10,"i18n"),k.k0s(),k.j41(11,"button",8),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.j41(14,"div",9),k.DNE(15,Gm,2,5,"button",10),k.k0s(),k.bVm(),k.k0s()}if(2&e){const e=k.sdS(8);k.R7$(3),k.SpI(" ",t.headerText," "),k.R7$(2),k.Y8G("config",t.config)("submitBtn",e),k.R7$(4),k.SpI(" ",k.bMT(10,6,"save")," "),k.R7$(3),k.SpI(" ",k.bMT(13,8,"cancel")," "),k.R7$(3),k.Y8G("ngIf","add"!==(null==t.config?null:t.config.mode))}},dependencies:[Y.MD,Y.bT,Bd.t,re.p,a.YN,se.t,oe.Q,Zn.Q,ln.s,xm,Fm,Jn.C,Qt.p,ir.P,fn.I,gn.m,ae.$],encapsulation:2});var Vm=i(4017),Bm=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const zm=(e,t)=>({sendId:e,type:t});function Lm(e,t){1&e&&k.nrm(0,"i",14)}function Km(e,t){1&e&&k.nrm(0,"i",15)}function qm(e,t){1&e&&(k.qex(0),k.nrm(1,"i",16),k.nI1(2,"i18n"),k.j41(3,"span",17),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"maxAccessCountReached"))),k.R7$(3),k.JRh(k.bMT(5,5,"maxAccessCountReached")))}function _m(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-item")(1,"button",5),k.nI1(2,"i18n"),k.j41(3,"div",6),k.DNE(4,Lm,1,0,"i",7)(5,Km,1,0,"i",8),k.k0s(),k.EFF(6),k.DNE(7,qm,6,7,"ng-container",9),k.j41(8,"span",10),k.EFF(9),k.nI1(10,"i18n"),k.nI1(11,"date"),k.k0s()(),k.qex(12,11),k.j41(13,"bit-item-action")(14,"button",12),k.nI1(15,"i18n"),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(2);return C.Njj(i.copySendLink(t))}),k.k0s()(),k.j41(16,"bit-item-action")(17,"button",13),k.nI1(18,"i18n"),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(2);return C.Njj(i.deleteSend(t))}),k.k0s()(),k.bVm(),k.k0s()}if(2&e){const e=t.$implicit,i=k.XpG(2);k.R7$(),k.Y8G("appA11yTitle",k.ai1("",k.bMT(2,16,"edit")," - ",e.name))("queryParams",k.l_i(27,zm,e.id,e.type)),k.R7$(3),k.Y8G("ngIf",e.type===i.sendType.Text),k.R7$(),k.Y8G("ngIf",e.type===i.sendType.File),k.R7$(),k.SpI(" ",e.name," "),k.R7$(),k.Y8G("ngIf",e.maxAccessCountReached),k.R7$(2),k.Lme(" ",k.bMT(10,18,"deletionDate"),": ",k.i5U(11,20,e.deletionDate,"mediumDate")," "),k.R7$(5),k.Y8G("label",k.ai1("",k.bMT(15,23,"copyLink")," - ",e.name)),k.R7$(3),k.Y8G("label",k.ai1("",k.bMT(18,25,"delete")," - ",e.name))}}function Xm(e,t){if(1&e&&(k.j41(0,"bit-section",1)(1,"bit-section-header")(2,"h2",2),k.EFF(3),k.k0s(),k.j41(4,"span",3),k.EFF(5),k.k0s()(),k.j41(6,"bit-item-group"),k.DNE(7,_m,19,30,"bit-item",4),k.k0s()()),2&e){const e=k.XpG();k.R7$(3),k.SpI(" ",e.headerText," "),k.R7$(2),k.JRh(e.sends.length),k.R7$(2),k.Y8G("ngForOf",e.sends)}}class Ym{constructor(e,t,i,n,r,s,o){this.dialogService=e,this.environmentService=t,this.i18nService=i,this.logService=n,this.platformUtilsService=r,this.sendApiService=s,this.toastService=o,this.sendType=Wd.N,this.sends=[]}deleteSend(e){return Bm(this,void 0,void 0,function*(){if(!(yield this.dialogService.openSimpleDialog({title:{key:"deleteSend"},content:{key:"deleteSendPermanentConfirmation"},type:"warning"})))return!1;yield this.sendApiService.delete(e.id);try{this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedSend")})}catch(t){this.logService.error(t)}})}copySendLink(e){return Bm(this,void 0,void 0,function*(){const t=(yield(0,u._)(this.environmentService.environment$)).getSendUrl()+e.accessId+"/"+e.urlB64Key;this.platformUtilsService.copyToClipboard(t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("valueCopied",this.i18nService.t("sendLink"))})})}}Ym.ɵfac=function(e){return new(e||Ym)(k.rXU(E.o3),k.rXU(St.v),k.rXU(j.W),k.rXU(ve.K),k.rXU(N.y),k.rXU(cu.M),k.rXU($.f))},Ym.ɵcmp=k.VBU({type:Ym,selectors:[["app-send-list-items-container"]],inputs:{sends:"sends",headerText:"headerText"},decls:1,vars:1,consts:[["disableMargin","",4,"ngIf"],["disableMargin",""],["bitTypography","h6",1,"tw-font-medium"],["bitTypography","body1","slot","end"],[4,"ngFor","ngForOf"],["bit-item-content","","routerLink","/edit-send","appStopClick","","type","button",3,"appA11yTitle","queryParams"],["slot","start",1,"tw-justify-start"],["class","bwi bwi-lg bwi-file-text tw-text-muted tw-w-6",4,"ngIf"],["class","bwi bwi-lg bwi-file tw-text-muted tw-w-6",4,"ngIf"],[4,"ngIf"],["slot","secondary"],["slot","end"],["bitIconButton","bwi-clone","size","small","type","button",1,"tw-p-1",3,"click","label"],["bitIconButton","bwi-trash","size","small","type","button",3,"click","label"],[1,"bwi","bwi-lg","bwi-file-text","tw-text-muted","tw-w-6"],[1,"bwi","bwi-lg","bwi-file","tw-text-muted","tw-w-6"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle",3,"title"],[1,"tw-sr-only"]],template:function(e,t){1&e&&k.DNE(0,Xm,8,3,"bit-section",0),2&e&&k.Y8G("ngIf",(null==t.sends?null:t.sends.length)>0)},dependencies:[Y.MD,Y.Sq,Y.bT,mo.k,vo.J,fo.g,Vm.D,go._,se.t,po.E,Zn.Q,ln.s,Zr.n,be.E,Ce.r,re.p,xr.C,On.Y,zn.x,Wp.U,ne.Wk,Y.vh,ae.$],encapsulation:2});var Hm=i(83892),Wm=i(34040);const Jm={sendType:null};class Zm{constructor(e,t){this.i18nService=e,this.formBuilder=t,this.filterForm=this.formBuilder.group(Jm),this.filters$=this.filterForm.valueChanges.pipe((0,Wl.Z)(Jm)),this.filterFunction$=this.filters$.pipe((0,m.T)(e=>t=>t.filter(t=>null===e.sendType||t.type===e.sendType))),this.sendTypes=[{value:Wd.N.File,label:this.i18nService.t("sendTypeFile"),icon:"bwi-file"},{value:Wd.N.Text,label:this.i18nService.t("sendTypeText"),icon:"bwi-file-text"}]}resetFilterForm(){this.filterForm.reset(Jm)}convertToChipSelectOption(e,t){return{value:e.node,label:e.node.name,icon:t,children:e.children?e.children.map(e=>this.convertToChipSelectOption(e,t)):void 0}}}Zm.ɵfac=function(e){return new(e||Zm)(C.KVO(j.W),C.KVO(a.ok))},Zm.ɵprov=C.jDH({token:Zm,factory:Zm.ɵfac,providedIn:"root"});class Qm{constructor(e,t,i,n){this.sendService=e,this.sendListFiltersService=t,this.searchService=i,this.accountService=n,this._searchText$=new Fn.t(""),this._sendsLoading$=new d.B,this.latestSearchText$=this._searchText$.asObservable(),this._sendList$=this.sendService.sendViews$,this.filteredAndSortedSends$=(0,Vr.z)([this._sendList$,this._searchText$,this.sendListFiltersService.filterFunction$]).pipe((0,O.M)(()=>{this._sendsLoading$.next()}),(0,m.T)(([e,t,i])=>[i(e),t]),(0,m.T)(([e,t])=>this.searchService.searchSends(e,t)),(0,m.T)(e=>e.sort((e,t)=>e.name.localeCompare(t.name))),(0,Jl.t)({refCount:!0,bufferSize:1})),this.loading$=(0,Hm.h)(this._sendsLoading$.pipe((0,m.T)(()=>!0)),this.filteredAndSortedSends$.pipe((0,m.T)(()=>!1))).pipe((0,Wl.Z)(!0),(0,Wm.F)(),(0,Jl.t)({refCount:!1,bufferSize:1})),this.hasFilterApplied$=(0,Vr.z)([this._searchText$,this.sendListFiltersService.filters$,(0,b.F6)(this.accountService.activeAccount$)]).pipe((0,ft.n)(([e,t,i])=>(0,ec.H)(this.searchService.isSearchable(i,e)).pipe((0,m.T)(e=>e||Object.values(t).some(e=>null!==e))))),this.emptyList$=this._sendList$.pipe((0,m.T)(e=>!e.length)),this.noFilteredResults$=this.filteredAndSortedSends$.pipe((0,m.T)(e=>!e.length))}applyFilter(e){this._searchText$.next(e)}}Qm.ɵfac=function(e){return new(e||Qm)(C.KVO(Lp.u),C.KVO(Zm),C.KVO(V.S),C.KVO(L.Di))},Qm.ɵprov=C.jDH({token:Qm,factory:Qm.ɵfac,providedIn:"root"});var ev=i(5520);class tv{constructor(e){this.sendListItemService=e,this.searchText="",this.searchText$=new d.B,this.subscribeToLatestSearchText(),this.subscribeToApplyFilter()}onSearchTextChanged(){this.searchText$.next(this.searchText)}subscribeToLatestSearchText(){return this.sendListItemService.latestSearchText$.pipe((0,c.pQ)(),(0,h.p)(e=>!!e)).subscribe(e=>{this.searchText=e})}subscribeToApplyFilter(){return this.searchText$.pipe((0,Rn.B)(200),(0,c.pQ)()).subscribe(e=>{this.sendListItemService.applyFilter(e)})}}tv.ɵfac=function(e){return new(e||tv)(k.rXU(Qm))},tv.ɵcmp=k.VBU({type:tv,selectors:[["tools-send-search"]],decls:2,vars:4,consts:[["appAutofocus","",3,"ngModelChange","placeholder","ngModel"]],template:function(e,t){1&e&&(k.j41(0,"bit-search",0),k.nI1(1,"i18n"),k.mxI("ngModelChange",function(e){return k.DH7(t.searchText,e)||(t.searchText=e),e}),k.bIt("ngModelChange",function(){return t.onSearchTextChanged()}),k.k0s()),2&e&&(k.Y8G("placeholder",k.bMT(1,2,"search")),k.R50("ngModel",t.searchText))},dependencies:[Y.MD,Bd.t,ev.S,re.p,qi.B,a.YN,a.BC,a.vS,ae.$],encapsulation:2});var iv=i(33277),nv=i(90586);const rv=["chipSelectButton"],sv=(e,t,i,n,r)=>({"tw-bg-text-muted hover:tw-bg-secondary-700 tw-text-contrast hover:!tw-border-secondary-700":e,"tw-bg-transparent hover:tw-border-secondary-700 !tw-text-muted hover:tw-bg-secondary-100":t,"tw-bg-secondary-300 tw-text-muted tw-border-transparent":i,"tw-border-text-muted":n,"tw-ring-2 tw-ring-primary-600 tw-ring-offset-1":r}),ov=(e,t)=>({"tw-cursor-not-allowed":e,"group-hover/chip-select:tw-text-secondary-700":t}),av=e=>({"tw-cursor-not-allowed":e}),lv=e=>({width:e});function cv(e,t){if(1&e&&k.nrm(0,"i",7),2&e){k.XpG();const e=k.sdS(2);k.Y8G("ngClass",e.isOpen?"bwi-angle-up":"bwi-angle-down")}}function dv(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",11),k.nI1(1,"i18n"),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.clear())}),k.nrm(2,"i",12),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("disabled",e.disabled())("ngClass",k.eq3(6,av,e.disabled())),k.BMQ("aria-label",k.i5U(1,3,"removeItem",e.label))}}function uv(e,t){var i,n;if(1&e){const e=k.RV6();k.j41(0,"button",14),k.nI1(1,"i18n"),k.bIt("click",function(t){const i=C.eBV(e),n=k.XpG(2);return C.Njj(n.viewOption(i,t))}),k.nrm(2,"i",15),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"button",14),k.nI1(6,"i18n"),k.bIt("click",function(t){C.eBV(e);const i=k.XpG(2);return C.Njj(i.selectOption(i.renderedOptions,t))}),k.nrm(7,"i",16),k.EFF(8),k.nI1(9,"i18n"),k.k0s()}if(2&e){const e=t,r=k.XpG(2);k.Y8G("title",k.i5U(1,4,"backTo",null!==(i=e.label)&&void 0!==i?i:r.placeholderText())),k.R7$(3),k.SpI(" ",k.i5U(4,7,"backTo",null!==(n=e.label)&&void 0!==n?n:r.placeholderText())," "),k.R7$(2),k.Y8G("title",k.i5U(6,10,"viewItemsIn",r.renderedOptions.label)),k.R7$(3),k.SpI(" ",k.i5U(9,13,"viewItemsIn",r.renderedOptions.label)," ")}}function hv(e,t){if(1&e&&k.nrm(0,"i",18),2&e){const e=k.XpG().$implicit;k.Y8G("ngClass",e.icon)}}function pv(e,t){1&e&&k.nrm(0,"i",19)}function mv(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",17),k.bIt("click",function(t){const i=C.eBV(e).$implicit,n=k.XpG(2);return C.Njj(null!=i.children&&i.children.length?n.viewOption(i,t):n.selectOption(i,t))}),k.nVh(1,hv,1,1,"i",18),k.EFF(2),k.nVh(3,pv,1,0,"i",19),k.k0s()}if(2&e){const e=t.$implicit;k.Y8G("disabled",e.disabled)("title",e.label),k.BMQ("aria-haspopup",null!=e.children&&e.children.length?"menu":null),k.R7$(),k.vxM(e.icon?1:-1),k.R7$(),k.SpI(" ",e.label," "),k.R7$(),k.vxM(null!=e.children&&e.children.length?3:-1)}}function vv(e,t){if(1&e&&(k.j41(0,"div",10),k.nVh(1,uv,10,16),k.Z7z(2,mv,4,6,"button",13,k.fX1),k.k0s()),2&e){let e;const t=k.XpG();k.Y8G("ngStyle",t.menuWidth&&k.eq3(2,lv,t.menuWidth+"px")),k.R7$(),k.vxM((e=t.getParent(t.renderedOptions))?1:-1,e),k.R7$(),k.Dyx(t.renderedOptions.children)}}class fv{onFocusIn(e){this.focusVisibleWithin.set(e.matches("[data-fvw-target]:focus-visible"))}onFocusOut(){this.focusVisibleWithin.set(!1)}get classList(){return["tw-inline-block",this.fullWidth()?"tw-w-full":"tw-max-w-52"]}constructor(){this.cdr=(0,C.WQX)(r.gRc),this.menu=(0,r.ebz)(Hr.Z),this.menuItems=(0,r.dtW)(Jr.S),this.chipSelectButton=(0,r.ebz)("chipSelectButton"),this.menuTrigger=(0,r.ebz)(Wr.O),this.placeholderText=r.hFB.required(),this.placeholderIcon=(0,r.hFB)(),this.options=r.hFB.required(),this.disabledInput=(0,r.hFB)(!1,{alias:"disabled",transform:r.L39}),this.disabledState=(0,C.vPA)(!1),this.disabled=(0,iv.EW)(()=>this.disabledInput()||this.disabledState()),this.fullWidth=(0,r.hFB)(void 0,{transform:r.L39}),this.focusVisibleWithin=(0,C.vPA)(!1),this.menuWidth=null,this.childParentMap=new Map,(0,iv.QZ)(()=>{this.initializeRootTree(this.options()),void 0!==this.pendingValue&&(this.selectedOption=this.findOption(this.rootTree,this.pendingValue),this.setOrResetRenderedOptions(),this.pendingValue=void 0,this.cdr.markForCheck())}),(0,iv.QZ)(()=>{var e;const t=this.menuItems(),i=this.menu(),n=this.menuTrigger();t.length>0&&(null==n?void 0:n.isOpen)&&(null===(e=null==i?void 0:i.keyManager)||void 0===e||e.setFirstItemActive())})}get label(){var e;return(null===(e=this.selectedOption)||void 0===e?void 0:e.label)||this.placeholderText()}get icon(){var e;return(null===(e=this.selectedOption)||void 0===e?void 0:e.icon)||this.placeholderIcon()}setOrResetRenderedOptions(){var e,t;this.renderedOptions=this.selectedOption?(null!==(t=null===(e=this.selectedOption.children)||void 0===e?void 0:e.length)&&void 0!==t?t:0)>0?this.selectedOption:this.getParent(this.selectedOption):this.rootTree}handleMenuClosed(){this.setOrResetRenderedOptions(),this.menuWidth=null}selectOption(e,t){this.selectedOption=e,this.onChange(e)}viewOption(e,t){this.renderedOptions=e,t.preventDefault(),t.stopImmediatePropagation()}clear(){this.renderedOptions=this.rootTree,this.selectedOption=null,this.onChange(null)}findOption(e,t){if(!e)return null;let i=null;return null!==e.value&&(0,nv.c)(e.value,t)?e:(Array.isArray(e.children)&&e.children.length>0&&e.children.some(e=>(i=this.findOption(e,t),i)),i)}markParents(e){var t;null===(t=e.children)||void 0===t||t.forEach(t=>{this.childParentMap.set(t,e),this.markParents(t)})}getParent(e){return this.childParentMap.get(e)}initializeRootTree(e){const t={children:e,value:null};this.markParents(t),this.rootTree=t,this.renderedOptions=this.rootTree}setMenuWidth(){var e,t,i,n,r;const s=null!==(t=null===(e=this.chipSelectButton())||void 0===e?void 0:e.nativeElement.getBoundingClientRect().width)&&void 0!==t?t:0,o=null!==(r=null===(n=null===(i=this.menu())||void 0===i?void 0:i.menuItems().at(0))||void 0===n?void 0:n.elementRef.nativeElement.getBoundingClientRect().width)&&void 0!==r?r:0;this.menuWidth=Math.max(s,o)}writeValue(e){this.rootTree?(this.selectedOption=this.findOption(this.rootTree,e),this.setOrResetRenderedOptions(),this.cdr.markForCheck()):this.pendingValue=e}registerOnChange(e){this.notifyOnChange=e}registerOnTouched(e){this.notifyOnTouched=e}setDisabledState(e){this.disabledState.set(e)}onChange(e){var t;this.notifyOnChange&&this.notifyOnChange(null!==(t=null==e?void 0:e.value)&&void 0!==t?t:null)}onBlur(){this.notifyOnTouched&&this.notifyOnTouched()}}function gv(e,t){if(1&e&&(k.j41(0,"div",1),k.nI1(1,"i18n"),k.j41(2,"form",2),k.nrm(3,"bit-chip-select",3),k.nI1(4,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.Y8G("ariaLabel",k.bMT(1,4,"filters")),k.R7$(2),k.Y8G("formGroup",e.filterForm),k.R7$(),k.Y8G("placeholderText",k.bMT(4,6,"type"))("options",e.sendTypes)}}fv.ɵfac=function(e){return new(e||fv)},fv.ɵcmp=k.VBU({type:fv,selectors:[["bit-chip-select"]],viewQuery:function(e,t){1&e&&(k.wEZ(t.menu,Hr.Z,5),k.wEZ(t.menuItems,Jr.S,5),k.wEZ(t.chipSelectButton,rv,5),k.wEZ(t.menuTrigger,Wr.O,5)),2&e&&k.NyB(4)},hostVars:2,hostBindings:function(e,t){1&e&&k.bIt("focusin",function(e){return t.onFocusIn(e.target)})("focusout",function(){return t.onFocusOut()}),2&e&&k.HbH(t.classList)},inputs:{placeholderText:[1,"placeholderText"],placeholderIcon:[1,"placeholderIcon"],options:[1,"options"],disabledInput:[1,"disabled","disabledInput"],fullWidth:[1,"fullWidth"]},features:[k.Jv_([{provide:a.kq,useExisting:fv,multi:!0}])],decls:13,vars:19,consts:[["menuTrigger","menuTrigger","chipSelectButton",""],["menu",""],["bitTypography","body2",1,"tw-inline-flex","tw-items-center","tw-rounded-full","tw-w-full","tw-border-solid","tw-border","tw-gap-1.5","tw-group/chip-select",3,"ngClass"],["type","button","data-fvw-target","",1,"tw-inline-flex","tw-gap-1.5","tw-items-center","tw-justify-between","tw-bg-transparent","hover:tw-bg-transparent","tw-border-none","tw-outline-none","tw-w-full","tw-py-1","tw-ps-3","last:tw-pe-3","[&:not(:last-child)]:tw-pe-0","tw-truncate","tw-text-[color:inherit]","tw-text-[length:inherit]",3,"click","ngClass","bitMenuTriggerFor","disabled","title"],[1,"tw-inline-flex","tw-items-center","tw-gap-1.5","tw-truncate"],["aria-hidden","true",1,"bwi","!tw-text-[inherit]",3,"ngClass"],[1,"tw-truncate"],["aria-hidden","true",1,"bwi","tw-mt-0.5",3,"ngClass"],["type","button",1,"tw-bg-transparent","hover:tw-bg-hover-contrast","tw-outline-none","tw-rounded-full","tw-py-0.5","tw-px-1","tw-me-1","tw-text-[color:inherit]","tw-text-[length:inherit]","tw-border-solid","tw-border","tw-border-transparent","tw-flex","tw-items-center","tw-justify-center","focus-visible:tw-ring-2","tw-ring-text-contrast","hover:disabled:tw-bg-transparent",3,"disabled","ngClass"],[3,"closed"],[1,"tw-max-h-80","tw-min-w-32","tw-max-w-80","tw-text-sm",3,"ngStyle"],["type","button",1,"tw-bg-transparent","hover:tw-bg-hover-contrast","tw-outline-none","tw-rounded-full","tw-py-0.5","tw-px-1","tw-me-1","tw-text-[color:inherit]","tw-text-[length:inherit]","tw-border-solid","tw-border","tw-border-transparent","tw-flex","tw-items-center","tw-justify-center","focus-visible:tw-ring-2","tw-ring-text-contrast","hover:disabled:tw-bg-transparent",3,"click","disabled","ngClass"],["aria-hidden","true",1,"bwi","bwi-close","tw-text-xs"],["type","button","bitMenuItem","",1,"tw-text-[length:inherit]",3,"disabled","title"],["type","button","bitMenuItem","",1,"tw-text-[length:inherit]",3,"click","title"],["slot","start","aria-hidden","true",1,"bwi","bwi-angle-left"],["slot","start","aria-hidden","true",1,"bwi","bwi-list"],["type","button","bitMenuItem","",1,"tw-text-[length:inherit]",3,"click","disabled","title"],["slot","start","aria-hidden","true",1,"bwi",3,"ngClass"],["slot","end","aria-hidden","true",1,"bwi","bwi-angle-right"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"div",2)(1,"button",3,0),k.bIt("click",function(){return C.eBV(e),C.Njj(t.setMenuWidth())}),k.j41(4,"span",4),k.nrm(5,"i",5),k.j41(6,"span",6),k.EFF(7),k.k0s()(),k.nVh(8,cv,1,1,"i",7),k.k0s(),k.nVh(9,dv,3,8,"button",8),k.k0s(),k.j41(10,"bit-menu",9,1),k.bIt("closed",function(){return C.eBV(e),C.Njj(t.handleMenuClosed())}),k.nVh(12,vv,4,4,"div",10),k.k0s()}if(2&e){const e=k.sdS(11);k.Y8G("ngClass",k.s1E(10,sv,t.selectedOption&&!t.disabled(),!t.selectedOption&&!t.disabled(),t.disabled(),!t.disabled(),t.focusVisibleWithin())),k.R7$(),k.Y8G("ngClass",k.l_i(16,ov,t.disabled(),!t.selectedOption&&!t.disabled()))("bitMenuTriggerFor",e)("disabled",t.disabled())("title",t.label),k.R7$(4),k.Y8G("ngClass",t.icon),k.R7$(2),k.JRh(t.label),k.R7$(),k.vxM(t.selectedOption?-1:8),k.R7$(),k.vxM(t.selectedOption?9:-1),k.R7$(3),k.vxM(t.renderedOptions?12:-1)}},dependencies:[kt.G,Y.YU,Y.B3,se.t,Zn.Q,Am.M,Hr.Z,Wr.O,Jr.S,be.E,Ce.r,Tt.$],encapsulation:2,changeDetection:0});class yv{constructor(e,t,i){this.sendListFiltersService=e,this.filterForm=this.sendListFiltersService.filterForm,this.sendTypes=this.sendListFiltersService.sendTypes,this.canAccessPremium$=i.activeAccount$.pipe((0,ft.n)(e=>e?t.hasPremiumFromAnySource$(e.id):(0,gt.of)(!1)))}ngOnDestroy(){this.sendListFiltersService.resetFilterForm()}}function bv(e,t){1&e&&k.nrm(0,"i",12)}function wv(e,t){1&e&&k.nrm(0,"i",13)}function Sv(e,t){1&e&&(k.nrm(0,"i",24),k.nI1(1,"i18n"),k.j41(2,"span",25),k.EFF(3),k.nI1(4,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"disabled"))),k.R7$(3),k.JRh(k.bMT(4,5,"disabled")))}function Iv(e,t){1&e&&(k.nrm(0,"i",26),k.nI1(1,"i18n"),k.j41(2,"span",25),k.EFF(3),k.nI1(4,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"password"))),k.R7$(3),k.JRh(k.bMT(4,5,"password")))}function kv(e,t){1&e&&(k.nrm(0,"i",24),k.nI1(1,"i18n"),k.j41(2,"span",25),k.EFF(3),k.nI1(4,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"maxAccessCountReached"))),k.R7$(3),k.JRh(k.bMT(4,5,"maxAccessCountReached")))}function Cv(e,t){1&e&&(k.nrm(0,"i",27),k.nI1(1,"i18n"),k.j41(2,"span",25),k.EFF(3),k.nI1(4,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"expired"))),k.R7$(3),k.JRh(k.bMT(4,5,"expired")))}function Tv(e,t){1&e&&(k.nrm(0,"i",28),k.nI1(1,"i18n"),k.j41(2,"span",25),k.EFF(3),k.nI1(4,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"pendingDeletion"))),k.R7$(3),k.JRh(k.bMT(4,5,"pendingDeletion")))}function Fv(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",19),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(2);return C.Njj(i.onRemovePassword(t))}),k.nrm(1,"i",29),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"removePassword")," "))}function Rv(e,t){if(1&e){const e=k.RV6();k.j41(0,"tr",8)(1,"td",9),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(2);return C.Njj(i.onEditSend(t))}),k.j41(2,"div",10)(3,"span",11),k.nVh(4,bv,1,0,"i",12),k.nVh(5,wv,1,0,"i",13),k.k0s(),k.j41(6,"button",14),k.EFF(7),k.k0s(),k.nVh(8,Sv,5,7),k.nVh(9,Iv,5,7),k.nVh(10,kv,5,7),k.nVh(11,Cv,5,7),k.nVh(12,Tv,5,7),k.k0s()(),k.j41(13,"td",15),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(2);return C.Njj(i.onEditSend(t))}),k.j41(14,"small",16),k.EFF(15),k.nI1(16,"date"),k.k0s()(),k.j41(17,"td",17),k.nrm(18,"button",18),k.nI1(19,"i18n"),k.j41(20,"bit-menu",null,0)(22,"button",19),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(2);return C.Njj(i.onCopy(t))}),k.nrm(23,"i",20),k.EFF(24),k.nI1(25,"i18n"),k.k0s(),k.nVh(26,Fv,4,3,"button",21),k.j41(27,"button",19),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(2);return C.Njj(i.onDelete(t))}),k.j41(28,"span",22),k.nrm(29,"i",23),k.EFF(30),k.nI1(31,"i18n"),k.k0s()()()()()}if(2&e){const e=t.$implicit,i=k.sdS(21),n=k.XpG(2);k.R7$(4),k.vxM(e.type==n.sendType.File?4:-1),k.R7$(),k.vxM(e.type==n.sendType.Text?5:-1),k.R7$(2),k.SpI(" ",e.name," "),k.R7$(),k.vxM(e.disabled?8:-1),k.R7$(),k.vxM(e.password?9:-1),k.R7$(),k.vxM(e.maxAccessCountReached?10:-1),k.R7$(),k.vxM(e.expired?11:-1),k.R7$(),k.vxM(e.pendingDelete?12:-1),k.R7$(3),k.JRh(k.i5U(16,15,e.deletionDate,"medium")),k.R7$(3),k.Y8G("label",k.mNQ(k.bMT(19,18,"options")))("bitMenuTriggerFor",i),k.R7$(6),k.SpI(" ",k.bMT(25,20,"copySendLink")," "),k.R7$(2),k.vxM(e.password&&!n.disableSend()?26:-1),k.R7$(4),k.SpI(" ",k.bMT(31,22,"delete")," ")}}function Pv(e,t){if(1&e&&(k.DNE(0,Rv,32,24,"tr",7),k.nI1(1,"async")),2&e){const e=t.$implicit;k.Y8G("ngForOf",k.bMT(1,1,e))}}yv.ɵfac=function(e){return new(e||yv)(k.rXU(Zm),k.rXU(Xr.Q),k.rXU(L.Di))},yv.ɵcmp=k.VBU({type:yv,selectors:[["app-send-list-filters"]],decls:2,vars:3,consts:[["role","toolbar",3,"ariaLabel",4,"ngIf"],["role","toolbar",3,"ariaLabel"],[1,"tw-flex","tw-flex-wrap","tw-gap-2","tw-mt-2",3,"formGroup"],["formControlName","sendType","placeholderIcon","bwi-list",3,"placeholderText","options"]],template:function(e,t){1&e&&(k.DNE(0,gv,5,8,"div",0),k.nI1(1,"async")),2&e&&k.Y8G("ngIf",k.bMT(1,1,t.canAccessPremium$))},dependencies:[Y.MD,Y.bT,re.p,fv,a.X1,a.qT,a.BC,a.cb,a.j4,a.JD,Y.Jj,ae.$],encapsulation:2});class xv{constructor(){this.sendType=Wd.N,this.dataSource=(0,r.hFB)(),this.disableSend=(0,r.hFB)(!1),this.editSend=(0,r.CGW)(),this.copySend=(0,r.CGW)(),this.removePassword=(0,r.CGW)(),this.deleteSend=(0,r.CGW)()}onEditSend(e){this.editSend.emit(e)}onCopy(e){this.copySend.emit(e)}onRemovePassword(e){this.removePassword.emit(e)}onDelete(e){this.deleteSend.emit(e)}}xv.ɵfac=function(e){return new(e||xv)},xv.ɵcmp=k.VBU({type:xv,selectors:[["tools-send-table"]],inputs:{dataSource:[1,"dataSource"],disableSend:[1,"disableSend"]},outputs:{editSend:"editSend",copySend:"copySend",removePassword:"removePassword",deleteSend:"deleteSend"},decls:13,vars:10,consts:[["sendOptions",""],[3,"dataSource"],["header",""],["bitCell","","bitSortable","name","default",""],["bitCell","","bitSortable","deletionDate"],["bitCell",""],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",1,"tw-cursor-pointer",3,"click"],[1,"tw-flex","tw-gap-2","tw-items-center"],["aria-hidden","true"],[1,"bwi","bwi-fw","bwi-lg","bwi-file"],[1,"bwi","bwi-fw","bwi-lg","bwi-file-text"],["type","button","bitLink",""],["bitCell","",1,"tw-text-muted","tw-cursor-pointer",3,"click"],["bitTypography","body2","appStopProp",""],["bitCell","",1,"tw-w-0","tw-text-right"],["type","button","bitIconButton","bwi-ellipsis-v",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-clone"],["type","button","bitMenuItem",""],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle",3,"title"],[1,"tw-sr-only"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-key",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-clock",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-trash",3,"title"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close"]],template:function(e,t){1&e&&(k.j41(0,"bit-table",1),k.qex(1,2),k.j41(2,"tr")(3,"th",3),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"th",4),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.j41(9,"th",5),k.EFF(10),k.nI1(11,"i18n"),k.k0s()(),k.bVm(),k.DNE(12,Pv,2,3,"ng-template",6),k.k0s()),2&e&&(k.Y8G("dataSource",t.dataSource()),k.R7$(4),k.JRh(k.bMT(5,4,"name")),k.R7$(3),k.JRh(k.bMT(8,6,"deletionDate")),k.R7$(3),k.JRh(k.bMT(11,8,"options")))},dependencies:[Y.MD,Y.Sq,re.p,zn.x,Fo.b,Qr.Q,es.Y,Po.O,ts._,ts.O,se.t,ye.V,ke.o,Zn.Q,ln.s,Am.M,Hr.Z,Wr.O,Jr.S,po.E,be.E,Ce.r,Y.Jj,Y.vh,ae.$],encapsulation:2,changeDetection:0});var $v=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Ev(e,t){1&e&&k.nrm(0,"i",7)}class Av{constructor(e,t,i,n){this.billingAccountProfileStateService=e,this.accountService=t,this.dialogService=i,this.addEditFormConfigService=n,this.hideIcon=!1,this.sendType=Wd.N,this.canAccessPremium$=this.accountService.activeAccount$.pipe((0,ft.n)(e=>e?this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id):(0,gt.of)(!1)))}createSend(e){return $v(this,void 0,void 0,function*(){if(!(yield(0,u._)(this.canAccessPremium$))&&e===Wd.N.File)return;const t=yield this.addEditFormConfigService.buildConfig("add",void 0,e);Nm.open(this.dialogService,{formConfig:t})})}}Av.ɵfac=function(e){return new(e||Av)(k.rXU(Xr.Q),k.rXU(L.Di),k.rXU(E.o3),k.rXU(Em))},Av.ɵcmp=k.VBU({type:Av,selectors:[["tools-new-send-dropdown"]],inputs:{hideIcon:"hideIcon"},features:[k.Jv_([Em])],decls:16,vars:11,consts:[["itemOptions",""],["bitButton","","buttonType","primary","type","button",3,"bitMenuTriggerFor"],["class","bwi bwi-plus","aria-hidden","true",4,"ngIf"],["bitMenuItem","",3,"click"],["slot","start","aria-hidden","true",1,"bwi","bwi-file-text"],["slot","start","aria-hidden","true",1,"bwi","bwi-file"],[1,"tw-flex","tw-items-center","tw-gap-2"],["aria-hidden","true",1,"bwi","bwi-plus"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",1),k.DNE(1,Ev,1,0,"i",2),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"bit-menu",null,0)(6,"a",3),k.bIt("click",function(){return C.eBV(e),C.Njj(t.createSend(t.sendType.Text))}),k.nrm(7,"i",4),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.j41(10,"a",3),k.bIt("click",function(){return C.eBV(e),C.Njj(t.createSend(t.sendType.File))}),k.nrm(11,"i",5),k.j41(12,"div",6),k.EFF(13),k.nI1(14,"i18n"),k.nrm(15,"app-premium-badge"),k.k0s()()()}if(2&e){const e=k.sdS(5);k.Y8G("bitMenuTriggerFor",e),k.R7$(),k.Y8G("ngIf",!t.hideIcon),k.R7$(),k.SpI(" ",k.bMT(3,5,t.hideIcon?"createSend":"new"),"\n"),k.R7$(6),k.SpI(" ",k.bMT(9,7,"sendTypeText")," "),k.R7$(5),k.SpI(" ",k.bMT(14,9,"sendTypeFile")," ")}},dependencies:[re.p,Y.MD,Y.bT,se.t,oe.Q,Am.M,Hr.Z,Wr.O,Jr.S,yr.a,ae.$],encapsulation:2});var Dv=i(5771),Ov=i(22690),Mv=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Uv=e=>({active:e});function Gv(e,t){1&e&&(k.qex(0),k.nrm(1,"i",24),k.nI1(2,"i18n"),k.j41(3,"span",25),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function jv(e,t){1&e&&k.nrm(0,"tools-new-send-dropdown")}function Nv(e,t){1&e&&(k.j41(0,"bit-callout",26),k.nI1(1,"i18n"),k.EFF(2),k.nI1(3,"i18n"),k.k0s()),2&e&&(k.Y8G("title",k.mNQ(k.bMT(1,3,"sendDisabled"))),k.R7$(2),k.SpI(" ",k.bMT(3,5,"sendDisabledWarning"),"\n"))}function Vv(e,t){1&e&&k.nrm(0,"i",50)}function Bv(e,t){1&e&&k.nrm(0,"i",51)}function zv(e,t){1&e&&(k.qex(0),k.nrm(1,"i",52),k.nI1(2,"i18n"),k.j41(3,"span",25),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"disabled"))),k.R7$(3),k.JRh(k.bMT(5,5,"disabled")))}function Lv(e,t){1&e&&(k.qex(0),k.nrm(1,"i",53),k.nI1(2,"i18n"),k.j41(3,"span",25),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"password"))),k.R7$(3),k.JRh(k.bMT(5,5,"password")))}function Kv(e,t){1&e&&(k.qex(0),k.nrm(1,"i",52),k.nI1(2,"i18n"),k.j41(3,"span",25),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"maxAccessCountReached"))),k.R7$(3),k.JRh(k.bMT(5,5,"maxAccessCountReached")))}function qv(e,t){1&e&&(k.qex(0),k.nrm(1,"i",54),k.nI1(2,"i18n"),k.j41(3,"span",25),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"expired"))),k.R7$(3),k.JRh(k.bMT(5,5,"expired")))}function _v(e,t){1&e&&(k.qex(0),k.nrm(1,"i",55),k.nI1(2,"i18n"),k.j41(3,"span",25),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"pendingDeletion"))),k.R7$(3),k.JRh(k.bMT(5,5,"pendingDeletion")))}function Xv(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",45),k.bIt("click",function(){C.eBV(e);const t=k.XpG().$implicit,i=k.XpG(3);return C.Njj(i.removePassword(t))}),k.nrm(1,"i",56),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"removePassword")," "))}function Yv(e,t){if(1&e){const e=k.RV6();k.j41(0,"tr",34)(1,"td",35),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.editSend(t))}),k.j41(2,"div",36)(3,"span",37),k.DNE(4,Vv,1,0,"i",38)(5,Bv,1,0,"i",39),k.k0s(),k.j41(6,"button",40),k.EFF(7),k.k0s(),k.DNE(8,zv,6,7,"ng-container",4)(9,Lv,6,7,"ng-container",4)(10,Kv,6,7,"ng-container",4)(11,qv,6,7,"ng-container",4)(12,_v,6,7,"ng-container",4),k.k0s()(),k.j41(13,"td",41),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.editSend(t))}),k.j41(14,"small",42),k.EFF(15),k.nI1(16,"date"),k.k0s()(),k.j41(17,"td",43),k.nrm(18,"button",44),k.nI1(19,"i18n"),k.j41(20,"bit-menu",null,1)(22,"button",45),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.copy(t))}),k.nrm(23,"i",46),k.EFF(24),k.nI1(25,"i18n"),k.k0s(),k.DNE(26,Xv,4,3,"button",47),k.j41(27,"button",45),k.bIt("click",function(){const t=C.eBV(e).$implicit,i=k.XpG(3);return C.Njj(i.delete(t))}),k.j41(28,"span",48),k.nrm(29,"i",49),k.EFF(30),k.nI1(31,"i18n"),k.k0s()()()()()}if(2&e){const e=t.$implicit,i=k.sdS(21),n=k.XpG(3);k.R7$(4),k.Y8G("ngIf",e.type==n.sendType.File),k.R7$(),k.Y8G("ngIf",e.type==n.sendType.Text),k.R7$(2),k.SpI(" ",e.name," "),k.R7$(),k.Y8G("ngIf",e.disabled),k.R7$(),k.Y8G("ngIf",e.password),k.R7$(),k.Y8G("ngIf",e.maxAccessCountReached),k.R7$(),k.Y8G("ngIf",e.expired),k.R7$(),k.Y8G("ngIf",e.pendingDelete),k.R7$(3),k.SpI(" ",k.i5U(16,15,e.deletionDate,"medium")," "),k.R7$(3),k.Y8G("label",k.mNQ(k.bMT(19,18,"options")))("bitMenuTriggerFor",i),k.R7$(6),k.SpI(" ",k.bMT(25,20,"copySendLink")," "),k.R7$(2),k.Y8G("ngIf",e.password&&!n.disableSend),k.R7$(4),k.SpI(" ",k.bMT(31,22,"delete")," ")}}function Hv(e,t){if(1&e&&(k.DNE(0,Yv,32,24,"tr",33),k.nI1(1,"async")),2&e){const e=t.$implicit;k.Y8G("ngForOf",k.bMT(1,1,e))}}function Wv(e,t){if(1&e&&(k.j41(0,"bit-table",27),k.qex(1,28),k.j41(2,"tr")(3,"th",29),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"th",30),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.j41(9,"th",31),k.EFF(10),k.nI1(11,"i18n"),k.k0s()(),k.bVm(),k.DNE(12,Hv,2,3,"ng-template",32),k.k0s()),2&e){const e=k.XpG();k.Y8G("dataSource",e.dataSource),k.R7$(4),k.JRh(k.bMT(5,4,"name")),k.R7$(3),k.SpI(" ",k.bMT(8,6,"deletionDate")," "),k.R7$(3),k.JRh(k.bMT(11,8,"options"))}}function Jv(e,t){1&e&&(k.qex(0),k.nrm(1,"i",24),k.nI1(2,"i18n"),k.j41(3,"span",25),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function Zv(e,t){1&e&&k.nrm(0,"tools-new-send-dropdown",61),2&e&&k.Y8G("hideIcon",!0)}function Qv(e,t){if(1&e&&(k.qex(0),k.j41(1,"bit-no-items",57),k.qex(2,58),k.EFF(3),k.nI1(4,"i18n"),k.bVm(),k.qex(5,59),k.EFF(6),k.nI1(7,"i18n"),k.bVm(),k.DNE(8,Zv,1,1,"tools-new-send-dropdown",60),k.k0s(),k.bVm()),2&e){const e=k.XpG(2);k.R7$(),k.Y8G("icon",e.noItemIcon),k.R7$(2),k.JRh(k.bMT(4,4,"sendsTitleNoItems")),k.R7$(3),k.JRh(k.bMT(7,6,"sendsBodyNoItems")),k.R7$(2),k.Y8G("ngIf",!e.disableSend)}}function ef(e,t){if(1&e&&(k.j41(0,"div"),k.DNE(1,Jv,6,7,"ng-container",4)(2,Qv,9,8,"ng-container",4),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",!e.loaded),k.R7$(),k.Y8G("ngIf",e.loaded)}}const tf="SendComponent";class nf extends qp{set filteredSends(e){super.filteredSends=e,this.dataSource.data=e}get filteredSends(){return super.filteredSends}constructor(e,t,i,n,r,s,o,a,l,c,d,u,h,p){super(e,t,i,n,r,s,o,l,c,d,u,p),this.broadcasterService=a,this.addEditFormConfigService=h,this.noItemIcon=_p,this.dataSource=new To.s}ngOnInit(){const e=Object.create(null,{ngOnInit:{get:()=>super.ngOnInit}});return Mv(this,void 0,void 0,function*(){yield e.ngOnInit.call(this),yield this.load(),this.broadcasterService.subscribe(tf,e=>{this.ngZone.run(()=>Mv(this,void 0,void 0,function*(){if("syncCompleted"===e.command)e.successfully&&(yield this.load())}))})})}ngOnDestroy(){this.dialogService.closeAll(),this.broadcasterService.unsubscribe(tf)}addSend(){return Mv(this,void 0,void 0,function*(){if(this.disableSend)return;const e=yield this.addEditFormConfigService.buildConfig("add",null,0);yield this.openSendItemDialog(e)})}editSend(e){return Mv(this,void 0,void 0,function*(){const t=yield this.addEditFormConfigService.buildConfig(null==e?"add":"edit",null==e?null:e.id,e.type);yield this.openSendItemDialog(t)})}openSendItemDialog(e){return Mv(this,void 0,void 0,function*(){if(this.sendItemDialogRef)return;this.sendItemDialogRef=Nm.open(this.dialogService,{formConfig:e});const t=yield(0,oi.s)(this.sendItemDialogRef.closed);this.sendItemDialogRef=void 0,t!==jm.Deleted&&t!==jm.Saved||(yield this.load())})}}nf.ɵfac=function(e){return new(e||nf)(k.rXU(Lp.u),k.rXU(j.W),k.rXU(N.y),k.rXU(St.v),k.rXU(k.SKi),k.rXU(V.S),k.rXU(Le.m),k.rXU(T.y),k.rXU(ve.K),k.rXU(cu.M),k.rXU(E.o3),k.rXU($.f),k.rXU(Em),k.rXU(L.Di))},nf.ɵcmp=k.VBU({type:nf,selectors:[["app-send"]],features:[k.Jv_([Em]),k.Vt3],decls:46,vars:34,consts:[["actionSpinner",""],["sendOptions",""],["slot","title-suffix"],[3,"appApiAction"],[4,"ngIf"],["type","warning",3,"title",4,"ngIf"],[1,"tw-grid","tw-grid-cols-12","tw-gap-4"],[1,"tw-col-span-3"],["data-testid","filters",1,"tw-border","tw-border-solid","tw-border-secondary-300","tw-rounded"],["data-testid","filters-header",1,"tw-bg-background-alt","tw-border-0","tw-border-b","tw-border-solid","tw-border-secondary-100","tw-rounded-t","tw-px-5","tw-py-2.5","tw-font-medium","tw-uppercase"],["data-testid","filters-body",1,"tw-p-5"],[1,"tw-mb-4"],["appAutofocus","",3,"ngModelChange","input","ngModel","placeholder"],[1,"filter"],[1,"filter-options"],[1,"filter-option",3,"ngClass"],[1,"filter-buttons"],["type","button","appStopClick","",1,"filter-button",3,"click"],[1,"bwi","bwi-fw","bwi-filter"],[1,"filter-heading"],[1,"bwi","bwi-fw","bwi-file-text"],[1,"bwi","bwi-fw","bwi-file"],[1,"tw-col-span-9","tw-@container/send-table"],[3,"dataSource",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],["type","warning",3,"title"],[3,"dataSource"],["header",""],["bitCell","","bitSortable","name","default",""],["bitCell","","bitSortable","deletionDate",1,"@lg/send-table:tw-table-cell","tw-hidden"],["bitCell",""],["body",""],["bitRow","",4,"ngFor","ngForOf"],["bitRow",""],["bitCell","",1,"tw-cursor-pointer",3,"click"],[1,"tw-flex","tw-gap-2","tw-items-center"],["aria-hidden","true"],["class","bwi bwi-fw bwi-lg bwi-file",4,"ngIf"],["class","bwi bwi-fw bwi-lg bwi-file-text",4,"ngIf"],["type","button","bitLink",""],["bitCell","",1,"tw-text-muted","tw-cursor-pointer","@lg/send-table:tw-table-cell","tw-hidden",3,"click"],["bitTypography","body2","appStopProp",""],["bitCell","",1,"tw-w-0","tw-text-right"],["type","button","bitIconButton","bwi-ellipsis-v",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-clone"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],[1,"bwi","bwi-fw","bwi-lg","bwi-file"],[1,"bwi","bwi-fw","bwi-lg","bwi-file-text"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-exclamation-triangle",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-key",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-clock",3,"title"],["appStopProp","","aria-hidden","true",1,"bwi","bwi-trash",3,"title"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-close"],[1,"tw-text-main",3,"icon"],["slot","title"],["slot","description"],["slot","button",3,"hideIcon",4,"ngIf"],["slot","button",3,"hideIcon"]],template:function(e,t){if(1&e){const e=k.RV6();k.j41(0,"app-header"),k.qex(1,2),k.j41(2,"small",3,0),k.DNE(4,Gv,6,7,"ng-container",4),k.k0s(),k.bVm(),k.DNE(5,jv,1,0,"tools-new-send-dropdown",4),k.k0s(),k.DNE(6,Nv,4,7,"bit-callout",5),k.j41(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.j41(13,"div",10)(14,"div",11)(15,"bit-search",12),k.nI1(16,"i18n"),k.mxI("ngModelChange",function(i){return C.eBV(e),k.DH7(t.searchText,i)||(t.searchText=i),C.Njj(i)}),k.bIt("input",function(){return C.eBV(e),C.Njj(t.searchTextChanged())}),k.k0s()(),k.j41(17,"div",13)(18,"ul",14)(19,"li",15)(20,"span",16)(21,"button",17),k.bIt("click",function(){return C.eBV(e),C.Njj(t.selectAll())}),k.nrm(22,"i",18),k.EFF(23),k.nI1(24,"i18n"),k.k0s()()()()(),k.j41(25,"div",13)(26,"div",19)(27,"h3"),k.EFF(28),k.nI1(29,"i18n"),k.k0s()(),k.j41(30,"ul",14)(31,"li",15)(32,"span",16)(33,"button",17),k.bIt("click",function(){return C.eBV(e),C.Njj(t.selectType(t.sendType.Text))}),k.nrm(34,"i",20),k.EFF(35),k.nI1(36,"i18n"),k.k0s()()(),k.j41(37,"li",15)(38,"span",16)(39,"button",17),k.bIt("click",function(){return C.eBV(e),C.Njj(t.selectType(t.sendType.File))}),k.nrm(40,"i",21),k.EFF(41),k.nI1(42,"i18n"),k.k0s()()()()()()()(),k.j41(43,"div",22),k.DNE(44,Wv,13,10,"bit-table",23)(45,ef,3,2,"div",4),k.k0s()()}if(2&e){const e=k.sdS(3);k.R7$(2),k.Y8G("appApiAction",t.actionPromise),k.R7$(2),k.Y8G("ngIf",e.loading),k.R7$(),k.Y8G("ngIf",!t.disableSend),k.R7$(),k.Y8G("ngIf",t.disableSend),k.R7$(5),k.SpI(" ",k.bMT(12,16,"filters")," "),k.R7$(4),k.R50("ngModel",t.searchText),k.Y8G("placeholder",k.bMT(16,18,"searchSends")),k.R7$(4),k.Y8G("ngClass",k.eq3(28,Uv,t.selectedAll)),k.R7$(4),k.SpI("",k.bMT(24,20,"allSends")," "),k.R7$(5),k.JRh(k.bMT(29,22,"types")),k.R7$(3),k.Y8G("ngClass",k.eq3(30,Uv,t.selectedType===t.sendType.Text)),k.R7$(4),k.SpI("",k.bMT(36,24,"sendTypeText")," "),k.R7$(2),k.Y8G("ngClass",k.eq3(32,Uv,t.selectedType===t.sendType.File)),k.R7$(4),k.SpI("",k.bMT(42,26,"sendTypeFile")," "),k.R7$(3),k.Y8G("ngIf",t.filteredSends&&t.filteredSends.length),k.R7$(),k.Y8G("ngIf",t.filteredSends&&!t.filteredSends.length)}},dependencies:[mi.G,Y.YU,Y.Sq,Y.bT,a.BC,a.vS,Dv.k,qi.B,On.Y,zn.x,Ge.G,ln.s,ke.o,Hr.Z,Wr.O,Jr.S,Ov.D,Qr.Q,es.Y,Po.O,ts._,ts.O,Ce.r,Bd.t,ev.S,zd.s,Ei.G,Di.f,Av,Y.Jj,Y.vh,ae.$],encapsulation:2});var rf=i(31436);const sf={HasBwInstalled:"hasBwInstalled",checkBwInstalled:"checkIfBWExtensionInstalled",OpenAtRiskPasswords:"openAtRiskPasswords",OpenBrowserExtensionToUrl:"openBrowserExtensionToUrl",PopupOpened:"popupOpened"};var of=i(25479),af=i(30082),lf=i(61687),cf=i(8029),df=i(58363);class uf{constructor(){this.destroyRef=(0,C.WQX)(C.abz),this.messages$=(0,rf.R)(window,"message").pipe((0,c.pQ)(this.destroyRef)),this.extensionInstalled$=this.checkForExtension().pipe((0,ft.n)(e=>e?(0,gt.of)(!0):(0,Bp.x)((0,gt.of)(!1),(0,of.Y)(2500).pipe((0,ft.n)(()=>this.checkForExtension()),(0,af.v)(e=>!e,!0),(0,h.p)(e=>e)))),(0,Jl.t)({bufferSize:1,refCount:!0})),this.openExtension=e=>new Promise((t,i)=>{(0,lf.O)(this.messages$.pipe((0,h.p)(e=>e.data.command===sf.PopupOpened),(0,m.T)(()=>!0)),(0,cf.O)(2e3).pipe((0,m.T)(()=>!1))).pipe((0,df.s)(1)).subscribe(e=>{if(!e)return i("Failed to open the extension");t()}),window.postMessage({command:sf.OpenBrowserExtensionToUrl,url:e})})}checkForExtension(){return(0,lf.O)(this.messages$.pipe((0,h.p)(e=>e.data.command===sf.HasBwInstalled),(0,m.T)(()=>!0)),(0,cf.O)(25).pipe((0,m.T)(()=>!1))).pipe((0,O.M)({subscribe:()=>{window.postMessage({command:sf.checkBwInstalled})}}),(0,df.s)(1))}}uf.ɵfac=function(e){return new(e||uf)},uf.ɵprov=C.jDH({token:uf,factory:uf.ɵfac,providedIn:"root"});var hf=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const pf={Loading:"loading",Error:"error",Success:"success",ManualOpen:"manualOpen",MobileBrowser:"mobileBrowser"};class mf{constructor(e,t,i,n){this.anonLayoutWrapperDataService=e,this.destroyRef=t,this.platformUtilsService=i,this.webBrowserInteractionService=n,this._pageState$=new Fn.t(pf.Loading),this.pageState$=this._pageState$.asObservable()}start(){Pn.A.isMobileBrowser?this.setMobileState():this.platformUtilsService.isFirefox()&&this.setErrorState(pf.ManualOpen)}registerPopupUrl(e){this.checkForBrowserExtension(e)}openExtension(e){return hf(this,arguments,void 0,function*(e,t=!1){e==sf.OpenAtRiskPasswords?window.postMessage({command:e}):yield this.webBrowserInteractionService.openExtension(zs.XS[e]),t&&(this.clearExtensionCheckTimeout(),this.extensionCheckTimeout=window.setTimeout(()=>{this.setErrorState(pf.ManualOpen)},750))})}checkForBrowserExtension(e){(0,rf.R)(window,"message").pipe((0,c.pQ)(this.destroyRef)).subscribe(t=>{this.getMessages(t,e)}),window.postMessage({command:sf.checkBwInstalled}),this.extensionCheckTimeout=window.setTimeout(()=>{this.setErrorState()},1e3)}getMessages(e,t){return hf(this,void 0,void 0,function*(){e.data.command===sf.HasBwInstalled&&(yield this.openExtension(t)),e.data.command===sf.PopupOpened&&this.setSuccessState()})}setMobileState(){this.clearExtensionCheckTimeout(),this._pageState$.next(pf.MobileBrowser),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"desktopRequired"}})}setSuccessState(){this.clearExtensionCheckTimeout(),this._pageState$.next(pf.Success),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"openedExtension"}})}setErrorState(e){this.clearExtensionCheckTimeout(),this._pageState$.next(null!=e?e:pf.Error),this.anonLayoutWrapperDataService.setAnonLayoutWrapperData({pageTitle:{key:"somethingWentWrong"}})}clearExtensionCheckTimeout(){window.clearTimeout(this.extensionCheckTimeout),this.extensionCheckTimeout=void 0}}function vf(e,t){if(1&e&&(k.j41(0,"div",1)(1,"p",2),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"a",3),k.EFF(5),k.nI1(6,"i18n"),k.k0s()()),2&e){const e=k.XpG();k.R7$(2),k.JRh(k.bMT(3,3,"doNotHaveExtension")),k.R7$(2),k.Y8G("href",e.webStoreUrl,k.B4B),k.R7$(),k.SpI(" ",k.bMT(6,5,"installExtension")," ")}}mf.ɵfac=function(e){return new(e||mf)(C.KVO(Ie.f),C.KVO(C.abz),C.KVO(N.y),C.KVO(uf))},mf.ɵprov=C.jDH({token:mf,factory:mf.ɵfac,providedIn:"root"});const ff={[pe.bq.ChromeBrowser]:"https://chrome.google.com/webstore/detail/bitwarden-password-manage/nngceckbapebfimnlniiiahkandclblb",[pe.bq.FirefoxBrowser]:"https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/",[pe.bq.SafariBrowser]:"https://apps.apple.com/us/app/bitwarden/id1352778147?mt=12",[pe.bq.OperaBrowser]:"https://addons.opera.com/extensions/details/bitwarden-free-password-manager/",[pe.bq.EdgeBrowser]:"https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh"};class gf{constructor(e,t){this.browserExtensionPromptService=e,this.platformService=t,this.shouldShow$=this.browserExtensionPromptService.pageState$.pipe((0,m.T)(e=>e===pf.Error||e===pf.ManualOpen)),this.BrowserPromptState=pf,this.webStoreUrl="https://bitwarden.com/download/#downloads-web-browser"}ngOnInit(){this.setBrowserStoreLink()}setBrowserStoreLink(){const e=this.platformService.getDevice(),t=ff[e];t&&(this.webStoreUrl=t)}}gf.ɵfac=function(e){return new(e||gf)(k.rXU(mf),k.rXU(N.y))},gf.ɵcmp=k.VBU({type:gf,selectors:[["vault-browser-extension-prompt-install"]],decls:2,vars:3,consts:[["class","tw-text-center",4,"ngIf"],[1,"tw-text-center"],[1,"tw-mb-0"],["bitLink","","target","_blank","rel","noreferrer",3,"href"]],template:function(e,t){1&e&&(k.DNE(0,vf,7,7,"div",0),k.nI1(1,"async")),2&e&&k.Y8G("ngIf",k.bMT(1,1,t.shouldShow$))},dependencies:[Y.MD,Y.bT,ye.V,ke.L,Y.Jj,je.$Z],encapsulation:2});const yf=$e.Sm`
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  <g clip-path="url(#clip0_11934_25684)">
    <path d="M17.3333 0H2.66667C1.19391 0 0 1.19391 0 2.66667V17.3333C0 18.8061 1.19391 20 2.66667 20H17.3333C18.8061 20 20 18.8061 20 17.3333V2.66667C20 1.19391 18.8061 0 17.3333 0Z" class="tw-fill-bw-blue" />
      <mask id="mask0_11934_25684" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="3" y="3" width="14" height="14">
      <path d="M17 3H3V17H17V3Z" class="tw-fill-text-alt2"/>
    </mask>
    <g mask="url(#mask0_11934_25684)">
      <path d="M15.6599 3.17501C15.607 3.11944 15.5435 3.07526 15.4731 3.04507C15.4027 3.01489 15.327 2.99958 15.2504 3.00001H4.75052C4.67396 2.99958 4.59784 3.01489 4.5274 3.04507C4.45696 3.07526 4.39352 3.11944 4.34102 3.17501C4.28546 3.22751 4.24127 3.29138 4.21109 3.36182C4.1809 3.43226 4.16559 3.50794 4.16602 3.58451V10.5844C4.16821 11.1173 4.27146 11.6449 4.47052 12.1393C4.65996 12.6271 4.91458 13.0874 5.22739 13.5069C5.54895 13.9274 5.90901 14.3163 6.30276 14.6698C6.66807 15.0049 7.05306 15.3186 7.4551 15.6086C7.8051 15.8571 8.1726 16.0925 8.5576 16.3148C8.9426 16.537 9.21431 16.6871 9.3731 16.7654C9.53322 16.8441 9.66272 16.9063 9.75897 16.9474C9.83422 16.9837 9.91694 17.0016 10.0005 16.9999C10.0827 17.0012 10.1641 16.982 10.2376 16.9448C10.3356 16.9019 10.4633 16.8415 10.6252 16.7628C10.7871 16.684 11.0627 16.5335 11.4407 16.3121C11.8187 16.0908 12.1906 15.8545 12.5432 15.606C12.9457 15.3155 13.3311 15.0023 13.6973 14.6671C14.0915 14.3141 14.4515 13.9247 14.7727 13.5043C15.085 13.0843 15.3397 12.6245 15.5295 12.1367C15.729 11.6423 15.8323 11.1147 15.834 10.5818V3.58188C15.8345 3.50576 15.8192 3.43051 15.789 3.36051C15.7588 3.29051 15.715 3.22751 15.6599 3.17501ZM14.3063 10.6483C14.3063 13.1858 10.0005 15.3654 10.0005 15.3654V4.49975H14.3063V10.6483Z" class="tw-fill-text-alt2"/>
    </g>
  </g>
  <defs>
    <clipPath id="clip0_11934_25684">
      <rect width="20" height="20" class="tw-fill-text-alt2"/>
    </clipPath>
  </defs>
</svg>
`;class bf{constructor(){this.BitwardenIcon=yf}}bf.ɵfac=function(e){return new(e||bf)},bf.ɵcmp=k.VBU({type:bf,selectors:[["vault-manually-open-extension"]],decls:6,vars:7,consts:[["bitTypography","body1",1,"tw-mb-0"],[1,"!tw-inline-block","[&>svg]:tw-align-baseline","[&>svg]:-tw-mb-[0.25rem]",3,"icon"]],template:function(e,t){1&e&&(k.j41(0,"p",0),k.EFF(1),k.nI1(2,"i18n"),k.nrm(3,"bit-icon",1),k.EFF(4),k.nI1(5,"i18n"),k.k0s()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,3,"openExtensionFromToolbarPart1")," "),k.R7$(2),k.Y8G("icon",t.BitwardenIcon),k.R7$(),k.SpI(" ",k.bMT(5,5,"openExtensionFromToolbarPart2"),"\n"))},dependencies:[ge.o,Ct.i,je.$Z],encapsulation:2,changeDetection:0});var wf=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Sf(e,t){1&e&&(k.qex(0),k.nrm(1,"i",3),k.j41(2,"p",4),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(3),k.JRh(k.bMT(4,1,"openingExtension")))}function If(e,t){if(1&e){const e=k.RV6();k.qex(0),k.j41(1,"p",5),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"button",6),k.bIt("click",function(){C.eBV(e),k.XpG();const t=k.r8f(2),i=k.XpG();return C.Njj(i.openExtension(t))}),k.EFF(5),k.nI1(6,"i18n"),k.nrm(7,"i",7),k.k0s(),k.bVm()}2&e&&(k.R7$(2),k.JRh(k.bMT(3,2,"openingExtensionError")),k.R7$(3),k.SpI(" ",k.bMT(6,4,"openExtension")," "))}function kf(e,t){if(1&e&&(k.qex(0),k.nrm(1,"i",8),k.j41(2,"p",5),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.bVm()),2&e){k.XpG();const e=k.r8f(2),t=k.XpG();k.R7$(3),k.SpI(" ",k.bMT(4,1,t.pageToI18nKeyMap[e])," ")}}function Cf(e,t){1&e&&(k.qex(0),k.nrm(1,"vault-manually-open-extension"),k.bVm())}function Tf(e,t){1&e&&(k.qex(0),k.j41(1,"p",9),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.bVm()),2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"reopenLinkOnDesktop")," "))}function Ff(e,t){if(1&e&&(k.j41(0,"div",1),k.DNE(1,Sf,5,3,"ng-container",2),k.SS7(2),k.nI1(3,"async"),k.DNE(4,If,8,6,"ng-container",2)(5,kf,5,3,"ng-container",2)(6,Cf,2,0,"ng-container",2)(7,Tf,4,3,"ng-container",2),k.k0s()),2&e){const e=t.ngIf,i=k.XpG();k.R7$(),k.Y8G("ngIf",e===i.BrowserPromptState.Loading),k.R7$(),k.bH3(k.bMT(3,5,i.extensionPage$)),k.R7$(2),k.Y8G("ngIf",e===i.BrowserPromptState.Error),k.R7$(),k.Y8G("ngIf",e===i.BrowserPromptState.Success),k.R7$(),k.Y8G("ngIf",e===i.BrowserPromptState.ManualOpen),k.R7$(),k.Y8G("ngIf",e===i.BrowserPromptState.MobileBrowser)}}class Rf{constructor(e,t,i){this.browserExtensionPromptService=e,this.route=t,this.document=i,this.VaultMessages=sf,this.pageState$=this.browserExtensionPromptService.pageState$,this.BrowserPromptState=pf,this.viewportContent=null,this.pageToI18nKeyMap={[sf.OpenAtRiskPasswords]:"openedExtensionViewAtRiskPasswords",AutoConfirm:"autoConfirmExtensionOpened"},this.extensionPage$=(0,gt.of)(sf.OpenAtRiskPasswords),this.extensionPage$=this.route.queryParamMap.pipe((0,m.T)(e=>{var t;return null!==(t=e.get("url"))&&void 0!==t?t:sf.OpenAtRiskPasswords})),this.extensionPage$.pipe((0,O.M)(e=>this.browserExtensionPromptService.registerPopupUrl(e)),(0,c.pQ)()).subscribe()}ngOnInit(){var e;this.browserExtensionPromptService.start(),this.document.body.style.minWidth="auto";const t=this.document.querySelector('meta[name="viewport"]');this.viewportContent=null!==(e=null==t?void 0:t.getAttribute("content"))&&void 0!==e?e:null,null==t||t.setAttribute("content","width=device-width, initial-scale=1.0")}ngOnDestroy(){var e;this.document.body.style.minWidth="",null!==this.viewportContent&&(null===(e=this.document.querySelector('meta[name="viewport"]'))||void 0===e||e.setAttribute("content",this.viewportContent))}openExtension(e){return wf(this,void 0,void 0,function*(){yield this.browserExtensionPromptService.openExtension(e,!0)})}}Rf.ɵfac=function(e){return new(e||Rf)(k.rXU(mf),k.rXU(x.nX),k.rXU(C.qQL))},Rf.ɵcmp=k.VBU({type:Rf,selectors:[["vault-browser-extension-prompt"]],decls:2,vars:3,consts:[["class","tw-text-center",4,"ngIf"],[1,"tw-text-center"],[4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-primary-600"],["bitTypography","body1",1,"tw-mb-0","tw-mt-2"],["bitTypography","body1",1,"tw-mb-4","tw-text-xl"],["bitButton","","buttonType","primary","type","button","id","bw-extension-prompt-button",3,"click"],["aria-hidden","true",1,"bwi","bwi-external-link","tw-ml-2"],["aria-hidden","true",1,"bwi","tw-text-2xl","bwi-check-circle","tw-text-success-700"],["bitTypography","body1",1,"tw-mb-0","tw-text-xl"]],template:function(e,t){1&e&&(k.DNE(0,Ff,8,8,"div",0),k.nI1(1,"async")),2&e&&k.Y8G("ngIf",k.bMT(1,1,t.pageState$))},dependencies:[Y.MD,Y.bT,oe.Q,ge.o,bf,Y.Jj,je.$Z],encapsulation:2,changeDetection:0});var Pf=i(39444);const xf=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="3.76 4 88.24 88.24">
    <path class="tw-fill-illustration-tertiary" d="M61.342 69.774 10.61 90.912a4.223 4.223 0 0 1-5.523-5.523l21.138-50.73a8 8 0 0 1 9.683-4.586l1.43.428a42 42 0 0 1 28.16 28.16l.428 1.43a8 8 0 0 1-4.585 9.683Z"/>
    <path class="tw-fill-illustration-bg-tertiary" fill-rule="evenodd" d="M29.603 82.999a87.777 87.777 0 0 1-8.85-7.751A87.763 87.763 0 0 1 13 66.397l.893-2.143a85.302 85.302 0 0 0 8.273 9.58c3.099 3.099 6.32 5.863 9.579 8.272l-2.143.893Zm-8.438 3.516a104.44 104.44 0 0 1-6.07-5.61 104.496 104.496 0 0 1-5.61-6.07l-.86 2.066a106.756 106.756 0 0 0 5.056 5.418 106.754 106.754 0 0 0 5.418 5.056l2.066-.86Zm19.768-8.237c-4.415-2.637-8.845-6.073-12.991-10.22-4.147-4.147-7.583-8.576-10.22-12.991l.967-2.321c2.625 4.678 6.212 9.443 10.667 13.898s9.22 8.042 13.898 10.667l-2.32.967Zm-17.882-36c1.659 6.049 5.736 12.863 11.772 18.899 6.036 6.036 12.85 10.113 18.9 11.772l3.242-1.351a23.334 23.334 0 0 1-3.26-.734c-5.523-1.644-11.815-5.448-17.468-11.101-5.653-5.654-9.458-11.945-11.101-17.469a23.344 23.344 0 0 1-.734-3.259l-1.351 3.243Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M52.657 43.343c8.2 8.201 12.316 17.382 9.192 20.506-3.124 3.124-12.305-.991-20.506-9.192-8.2-8.201-12.316-17.382-9.192-20.506 3.124-3.124 12.305.991 20.506 9.192Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.675 56.318c-1.54-3.437-4.459-7.587-8.432-11.56-3.974-3.974-8.124-6.892-11.561-8.433-1.726-.773-3.171-1.155-4.267-1.212-1.096-.057-1.61.212-1.85.452-.24.24-.51.754-.452 1.85.057 1.096.439 2.541 1.212 4.267 1.54 3.437 4.459 7.587 8.432 11.56 3.974 3.974 8.124 6.892 11.561 8.433 1.726.773 3.171 1.155 4.267 1.212 1.096.057 1.61-.212 1.85-.452.24-.24.51-.754.452-1.85-.057-1.096-.439-2.541-1.212-4.267Zm2.174 7.531c3.124-3.124-.991-12.305-9.192-20.506-8.201-8.2-17.382-12.316-20.506-9.192-3.124 3.124.991 12.305 9.192 20.506 8.201 8.2 17.382 12.316 20.506 9.192Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M35.622 31.03a7 7 0 0 0-8.473 4.013L6.01 85.773a3.223 3.223 0 0 0 4.215 4.216l50.731-21.138a7 7 0 0 0 4.012-8.473l-.428-1.429a41 41 0 0 0-27.49-27.49l-1.43-.428Zm-10.32 3.244a9 9 0 0 1 10.894-5.16l1.43.43a43 43 0 0 1 28.83 28.83l.43 1.43a9 9 0 0 1-5.16 10.894l-50.73 21.137a5.224 5.224 0 0 1-6.831-6.83l21.138-50.731Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" d="M47.264 4.584a.756.756 0 0 1 1.472 0l.038.16a6 6 0 0 0 4.481 4.482l.16.038a.756.756 0 0 1 0 1.472l-.16.037a6 6 0 0 0-4.482 4.482l-.037.16a.756.756 0 0 1-1.472 0l-.038-.16a6 6 0 0 0-4.481-4.482l-.16-.037a.756.756 0 0 1 0-1.472l.16-.038a6 6 0 0 0 4.482-4.481l.037-.16ZM85.264 19.584a.756.756 0 0 1 1.472 0l.037.16a6 6 0 0 0 4.482 4.483l.16.037a.756.756 0 0 1 0 1.472l-.16.037a6 6 0 0 0-4.481 4.482l-.038.16a.756.756 0 0 1-1.472 0l-.037-.16a6 6 0 0 0-4.482-4.482l-.16-.037a.756.756 0 0 1 0-1.472l.16-.037a6 6 0 0 0 4.481-4.482l.038-.16ZM72.264 80.584a.756.756 0 0 1 1.472 0l.037.16a6 6 0 0 0 4.482 4.483l.16.037a.756.756 0 0 1 0 1.472l-.16.037a6 6 0 0 0-4.481 4.482l-.038.16a.756.756 0 0 1-1.472 0l-.037-.16a6 6 0 0 0-4.482-4.481l-.16-.038a.756.756 0 0 1 0-1.472l.16-.037a6 6 0 0 0 4.481-4.482l.038-.16Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M80.607 52.364a7 7 0 0 0-9.9 0 1 1 0 0 1-1.414-1.414 9 9 0 0 1 12.728 0 1 1 0 0 1-1.414 1.414ZM85.125 42.317c-5.693-3.286-12.972-1.336-16.259 4.357a1 1 0 1 1-1.732-1c3.839-6.65 12.342-8.928 18.991-5.089a1 1 0 1 1-1 1.732ZM24 18a7 7 0 0 1 7 7 1 1 0 1 0 2 0 9 9 0 0 0-9-9 1 1 0 1 0 0 2ZM29.445 9.937a7 7 0 0 1 4.114 9.004 1 1 0 1 0 1.874.699 9 9 0 0 0-5.29-11.577 1 1 0 0 0-.698 1.874Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M65 21a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M61 23a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm0 2a4 4 0 1 0 0-8 4 4 0 0 0 0 8Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M71 33a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M68 34a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 2a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M60 82a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M57 83a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 2a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M88 64a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M83 67a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm0 2a5 5 0 1 0 0-10 5 5 0 0 0 0 10Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M55 27.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M51.5 29a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm0 2a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M84 11a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M77 16a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2a7 7 0 1 0 0-14 7 7 0 0 0 0 14Z" clip-rule="evenodd"/>
  </svg>
`,$f=e=>{switch(e){case pe.bq.ChromeBrowser:return"https://chromewebstore.google.com/detail/bitwarden-password-manage/nngceckbapebfimnlniiiahkandclblb";case pe.bq.FirefoxBrowser:return"https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/";case pe.bq.SafariBrowser:return"https://apps.apple.com/us/app/bitwarden/id1352778147?mt=12";case pe.bq.OperaBrowser:return"https://addons.opera.com/extensions/details/bitwarden-free-password-manager/";case pe.bq.EdgeBrowser:return"https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh";default:return"https://bitwarden.com/download/#downloads-web-browser"}};var Ef=i(11451),Af=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Df=new S.Ok(S.q9,"setupExtensionDismissed",{deserializer:e=>e,clearOn:[]});var Of=i(67311),Mf=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Uf{constructor(){this.platformUtilsService=(0,C.WQX)(N.y),this.data=(0,C.WQX)(xn.Qs),this.webStoreUrl=""}ngOnInit(){this.webStoreUrl=$f(this.platformUtilsService.getDevice())}dismissExtensionPage(){return Mf(this,void 0,void 0,function*(){this.data.onDismiss()})}}Uf.ɵfac=function(e){return new(e||Uf)},Uf.ɵcmp=k.VBU({type:Uf,selectors:[["vault-add-extension-later-dialog"]],decls:17,vars:13,consts:[["bitDialogIcon",""],["aria-hidden","true",1,"bwi","bwi-info-circle","bwi-2x","tw-text-info"],["bitDialogContent",""],["bitTypography","h3"],["bitTypography","body1"],["bitDialogFooter",""],["bitButton","","buttonType","primary","target","_blank","rel","noopener noreferrer",3,"href"],["bitButton","","buttonType","secondary","routerLink","/vault","bitDialogClose","",3,"click"]],template:function(e,t){1&e&&(k.j41(0,"bit-simple-dialog")(1,"div",0),k.nrm(2,"i",1),k.k0s(),k.qex(3,2),k.j41(4,"div",3),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"div",4),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.bVm(),k.qex(10,5),k.j41(11,"a",6),k.EFF(12),k.nI1(13,"i18n"),k.k0s(),k.j41(14,"a",7),k.bIt("click",function(){return t.dismissExtensionPage()}),k.EFF(15),k.nI1(16,"i18n"),k.k0s(),k.bVm(),k.k0s()),2&e&&(k.R7$(5),k.SpI(" ",k.bMT(6,5,"cannotAutofillPasswordsWithoutExtensionTitle")," "),k.R7$(3),k.JRh(k.bMT(9,7,"cannotAutofillPasswordsWithoutExtensionDesc")),k.R7$(3),k.Y8G("href",t.webStoreUrl,k.B4B),k.R7$(),k.SpI(" ",k.bMT(13,9,"getTheExtension")," "),k.R7$(3),k.SpI(" ",k.bMT(16,11,"skipToWebApp")," "))},dependencies:[ir.P,fn.I,Of.L,Of.o,re.p,be.E,Ce.r,oe.Q,ne.iI,ne.Wk,ae.$],encapsulation:2});var Gf=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const jf=["video"],Nf=e=>({"tw-opacity-0":e});function Vf(e,t){if(1&e){const e=k.RV6();k.j41(0,"video",9,3),k.bIt("loadeddata",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.onVideoLoad())}),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("ngClass",k.eq3(2,Nf,!e.allVideosLoaded)),k.BMQ("aria-hidden",!e.allVideosLoaded)}}function Bf(e,t){if(1&e){const e=k.RV6();k.j41(0,"video",10,3),k.bIt("loadeddata",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.onVideoLoad())}),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("ngClass",k.eq3(2,Nf,!e.allVideosLoaded)),k.BMQ("aria-hidden",!e.allVideosLoaded)}}function zf(e,t){if(1&e){const e=k.RV6();k.j41(0,"video",11,3),k.bIt("loadeddata",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.onVideoLoad())}),k.k0s()}if(2&e){const e=k.XpG();k.Y8G("ngClass",k.eq3(2,Nf,!e.allVideosLoaded)),k.BMQ("aria-hidden",!e.allVideosLoaded)}}function Lf(e,t){1&e&&k.nrm(0,"div",12)}function Kf(e,t){1&e&&k.eu8(0)}function qf(e,t){1&e&&k.nrm(0,"div",12)}function _f(e,t){1&e&&k.eu8(0)}function Xf(e,t){1&e&&k.nrm(0,"div",12)}function Yf(e,t){1&e&&k.eu8(0)}class Hf{get allVideosLoaded(){return this.numberOfLoadedVideos>=3}constructor(){this.document=(0,C.WQX)(C.qQL),this.cssOverlayVariable="--overlay-opacity",this.cssBorderVariable="--border-opacity",this.variant="desktop",this.numberOfLoadedVideos=0,this.prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches,this.videoContainerClass=["tw-absolute tw-left-0 tw-top-0 tw-w-[15rem] tw-opacity-0 md:tw-opacity-100 md:tw-relative lg:tw-w-[17rem] tw-max-w-full tw-aspect-[0.807]","[--overlay-opacity:0.7] after:tw-absolute after:tw-top-0 after:tw-left-0 after:tw-size-full after:tw-bg-primary-100 after:tw-content-[''] after:tw-rounded-lg after:tw-opacity-[--overlay-opacity]","[--border-opacity:0] before:tw-absolute before:tw-top-0 before:tw-left-0 before:tw-w-full before:tw-h-2 before:tw-bg-primary-600 before:tw-content-[''] before:tw-rounded-t-lg before:tw-opacity-[--border-opacity]","after:tw-transition-opacity after:tw-duration-400 after:tw-ease-linear","before:tw-transition-opacity before:tw-duration-400 before:tw-ease-linear"].join(" "),(0,rf.R)(window,"resize").pipe((0,c.pQ)(),(0,Rn.B)(25)).subscribe(()=>this.onResize())}onResize(){const e=this.variant;this.variant=this.document.documentElement.clientWidth<768?"mobile":"desktop",this.variant!==e&&"mobile"===this.variant&&this.videoElements.forEach(e=>{e.nativeElement.paused?this.hideElement(e.nativeElement.parentElement):this.showElement(e.nativeElement.parentElement)}),this.variant!==e&&"desktop"===this.variant&&this.videoElements.forEach(e=>{this.showElement(e.nativeElement.parentElement)})}onVideoLoad(){this.numberOfLoadedVideos=this.numberOfLoadedVideos+1,this.allVideosLoaded&&this.startVideoSequence(0)}startVideoSequence(e){return Gf(this,void 0,void 0,function*(){let t=e;const i=t>=this.videoElements.length;if(i&&this.prefersReducedMotion)return;i&&(this.videoElements.forEach(e=>{e.nativeElement.currentTime=0}),t=0);const n=this.videoElements.toArray()[t].nativeElement;n.onended=()=>{this.startVideoSequence(t+1),this.addPausedStyles(n)},this.mobileTransitionIn(t),n.muted=!0,this.addPlayingStyles(n),yield n.play()})}mobileTransitionIn(e){if(this.isAboveTabletBreakpoint())return;const t=this.videoElements.toArray()[e].nativeElement.parentElement,i=0===e?this.videoElements.length-1:e-1,n=this.videoElements.toArray()[i].nativeElement.parentElement;this.hideElement(n,!0),this.showElement(t,!0)}isAboveTabletBreakpoint(){return this.document.documentElement.clientWidth>=768}hideElement(e,t=!1){e.style.transition=t?"opacity 0.5s linear":"",e.style.opacity="0"}showElement(e,t=!1){e.style.transition=t?"opacity 0.5s linear":"",e.style.opacity="1"}addPausedStyles(e){const t=e.parentElement;t&&(t.style.setProperty(this.cssBorderVariable,"0"),t.style.setProperty(this.cssOverlayVariable,"0.7"))}addPlayingStyles(e){const t=e.parentElement;t&&(t.style.setProperty(this.cssBorderVariable,"1"),t.style.setProperty(this.cssOverlayVariable,"0"))}}Hf.ɵfac=function(e){return new(e||Hf)},Hf.ɵcmp=k.VBU({type:Hf,selectors:[["vault-add-extension-videos"]],viewQuery:function(e,t){if(1&e&&k.GBs(jf,5,k.aKT),2&e){let e;k.mGM(e=k.lsd())&&(t.videoElements=e)}},decls:17,vars:12,consts:[["newLoginItem",""],["browserExtensionEasyAccess",""],["onboardingAutofill",""],["video",""],[1,"tw-mx-auto","tw-w-[15rem]","tw-mb-8","tw-relative","md:tw-grid","md:tw-gap-10","md:tw-w-auto","md:tw-grid-rows-1","md:tw-grid-cols-3","md:tw-justify-center","md:tw-justify-items-center","xl:tw-gap-12"],[3,"ngClass"],["class","tw-animate-pulse tw-bg-secondary-300 tw-size-full tw-absolute tw-left-0 tw-top-0 tw-rounded-lg","data-testid","video-pulse",4,"ngIf"],[4,"ngTemplateOutlet"],[1,"tw-relative",3,"ngClass"],["muted","","src","/videos/new-login-item.mp4","appDarkImgSrc","/videos/new-login-item-dark.mp4","aria-hidden","",1,"tw-block","tw-max-w-full","tw-shadow-md","tw-rounded-lg",3,"loadeddata","ngClass"],["muted","","src","/videos/browser-extension-easy-access.mp4","appDarkImgSrc","/videos/browser-extension-easy-access-dark.mp4","aria-hidden","",1,"tw-block","tw-max-w-full","tw-shadow-md","tw-rounded-lg",3,"loadeddata","ngClass"],["muted","","src","/videos/onboarding-autofill.mp4","appDarkImgSrc","/videos/onboarding-autofill-dark.mp4","aria-hidden","",1,"tw-block","tw-max-w-full","tw-shadow-md","tw-rounded-lg",3,"loadeddata","ngClass"],["data-testid","video-pulse",1,"tw-animate-pulse","tw-bg-secondary-300","tw-size-full","tw-absolute","tw-left-0","tw-top-0","tw-rounded-lg"]],template:function(e,t){if(1&e&&(k.DNE(0,Vf,2,4,"ng-template",null,0,k.C5r)(2,Bf,2,4,"ng-template",null,1,k.C5r)(4,zf,2,4,"ng-template",null,2,k.C5r),k.j41(6,"div",4),k.nI1(7,"i18n"),k.j41(8,"div",5),k.DNE(9,Lf,1,0,"div",6)(10,Kf,1,0,"ng-container",7),k.k0s(),k.j41(11,"div",8),k.DNE(12,qf,1,0,"div",6)(13,_f,1,0,"ng-container",7),k.k0s(),k.j41(14,"div",5),k.DNE(15,Xf,1,0,"div",6)(16,Yf,1,0,"ng-container",7),k.k0s()()),2&e){const e=k.sdS(1),i=k.sdS(3),n=k.sdS(5);k.R7$(6),k.BMQ("aria-label",k.bMT(7,10,"setupExtensionContentAlt")),k.R7$(2),k.Y8G("ngClass",t.videoContainerClass),k.R7$(),k.Y8G("ngIf",!t.allVideosLoaded),k.R7$(),k.Y8G("ngTemplateOutlet",e),k.R7$(),k.Y8G("ngClass",t.videoContainerClass),k.R7$(),k.Y8G("ngIf",!t.allVideosLoaded),k.R7$(),k.Y8G("ngTemplateOutlet",i),k.R7$(),k.Y8G("ngClass",t.videoContainerClass),k.R7$(),k.Y8G("ngIf",!t.allVideosLoaded),k.R7$(),k.Y8G("ngTemplateOutlet",n)}},dependencies:[Y.MD,Y.YU,Y.bT,Y.T3,re.p,js.Mr,ae.$],encapsulation:2});var Wf=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Jf(e,t){1&e&&(k.nrm(0,"i",3),k.nI1(1,"i18n")),2&e&&k.Y8G("appA11yTitle",k.bMT(1,1,"loading"))}function Zf(e,t){if(1&e){const e=k.RV6();k.j41(0,"section",4)(1,"h1",5),k.EFF(2),k.nI1(3,"i18n"),k.k0s(),k.j41(4,"h2",6),k.EFF(5),k.nI1(6,"i18n"),k.k0s(),k.nrm(7,"vault-add-extension-videos"),k.j41(8,"div",7)(9,"a",8),k.EFF(10),k.nI1(11,"i18n"),k.k0s(),k.j41(12,"button",9),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.addItLater())}),k.EFF(13),k.nI1(14,"i18n"),k.k0s()()()}if(2&e){const e=k.XpG();k.R7$(2),k.SpI(" ",k.bMT(3,5,"setupExtensionPageTitle")," "),k.R7$(3),k.SpI(" ",k.bMT(6,7,"setupExtensionPageDescription")," "),k.R7$(4),k.Y8G("href",e.webStoreUrl,k.B4B),k.R7$(),k.SpI(" ",k.bMT(11,9,"getTheExtension")," "),k.R7$(3),k.SpI(" ",k.bMT(14,11,"addItLater")," ")}}function Qf(e,t){1&e&&(k.j41(0,"div",21),k.nrm(1,"vault-manually-open-extension"),k.k0s())}function eg(e,t){if(1&e){const e=k.RV6();k.j41(0,"section",10)(1,"div",11),k.nrm(2,"bit-icon",12),k.k0s(),k.j41(3,"h1",13),k.EFF(4),k.nI1(5,"i18n"),k.k0s(),k.j41(6,"div",14)(7,"p"),k.EFF(8),k.nI1(9,"i18n"),k.k0s(),k.j41(10,"button",15),k.bIt("click",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.openExtension())}),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.j41(13,"a",16),k.EFF(14),k.nI1(15,"i18n"),k.k0s(),k.DNE(16,Qf,2,0,"div",17),k.k0s(),k.j41(17,"p",18),k.EFF(18),k.nI1(19,"i18n"),k.j41(20,"a",19),k.EFF(21),k.nI1(22,"i18n"),k.k0s(),k.EFF(23),k.nI1(24,"i18n"),k.j41(25,"a",20),k.EFF(26),k.nI1(27,"i18n"),k.k0s()()()}if(2&e){const e=k.XpG();k.R7$(2),k.Y8G("icon",e.PartyIcon),k.R7$(2),k.SpI(" ",k.bMT(5,10,e.state===e.SetupExtensionState.Success?"bitwardenExtensionInstalled":"bitwardenExtensionIsInstalled")," "),k.R7$(4),k.SpI(" ",k.bMT(9,12,"openExtensionToAutofill")," "),k.R7$(3),k.SpI(" ",k.bMT(12,14,"openBitwardenExtension")," "),k.R7$(3),k.SpI(" ",k.bMT(15,16,"skipToWebApp")," "),k.R7$(2),k.Y8G("ngIf",e.state===e.SetupExtensionState.ManualOpen),k.R7$(2),k.SpI(" ",k.bMT(19,18,"gettingStartedWithBitwardenPart1")," "),k.R7$(3),k.SpI(" ",k.bMT(22,20,"gettingStartedWithBitwardenPart2")," "),k.R7$(2),k.SpI(" ",k.bMT(24,22,"and")," "),k.R7$(3),k.SpI(" ",k.bMT(27,24,"gettingStartedWithBitwardenPart3")," ")}}const tg={Loading:"loading",NeedsExtension:"needs-extension",Success:"success",AlreadyInstalled:"already-installed",ManualOpen:"manual-open"};class ig{constructor(){this.webBrowserExtensionInteractionService=(0,C.WQX)(uf),this.router=(0,C.WQX)(x.Ix),this.destroyRef=(0,C.WQX)(C.abz),this.platformUtilsService=(0,C.WQX)(N.y),this.dialogService=(0,C.WQX)(E.o3),this.stateProvider=(0,C.WQX)(S.v2),this.accountService=(0,C.WQX)(L.Di),this.document=(0,C.WQX)(C.qQL),this.SetupExtensionState=tg,this.PartyIcon=xf,this.state=tg.Loading,this.webStoreUrl="",this.dialogRef=null,this.viewportContent=null}ngOnInit(){return Wf(this,void 0,void 0,function*(){var e;this.document.body.style.minWidth="auto";const t=this.document.querySelector('meta[name="viewport"]');this.viewportContent=null!==(e=null==t?void 0:t.getAttribute("content"))&&void 0!==e?e:null,null==t||t.setAttribute("content","width=device-width, initial-scale=1.0"),yield this.conditionallyRedirectUser(),this.webStoreUrl=$f(this.platformUtilsService.getDevice()),this.webBrowserExtensionInteractionService.extensionInstalled$.pipe((0,c.pQ)(this.destroyRef),(0,Wl.Z)(null),(0,Pf.J)()).subscribe(([e,t])=>{var i;null===e&&t&&(this.dismissExtensionPage(),this.state=tg.AlreadyInstalled),!1===e&&t&&(null===(i=this.dialogRef)||void 0===i||i.close(),this.dismissExtensionPage(),this.state=tg.Success),!1===t&&(this.state=tg.NeedsExtension)})})}ngOnDestroy(){var e;this.document.body.style.minWidth="",null!==this.viewportContent&&(null===(e=this.document.querySelector('meta[name="viewport"]'))||void 0===e||e.setAttribute("content",this.viewportContent))}conditionallyRedirectUser(){return Wf(this,void 0,void 0,function*(){Pn.A.isMobileBrowser&&(yield this.dismissExtensionPage(),yield this.router.navigate(["/vault"]))})}get showSuccessUI(){return[tg.Success,tg.AlreadyInstalled,tg.ManualOpen].includes(this.state)}addItLater(){this.dialogRef=this.dialogService.open(Uf,{data:{onDismiss:this.dismissExtensionPage.bind(this)},positionStrategy:new E.u3})}openExtension(){return Wf(this,void 0,void 0,function*(){yield this.webBrowserExtensionInteractionService.openExtension().catch(()=>{this.state=tg.ManualOpen})})}dismissExtensionPage(){return Wf(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));this.stateProvider.getUser(e,Df).update(()=>!0)})}}ig.ɵfac=function(e){return new(e||ig)},ig.ɵcmp=k.VBU({type:ig,selectors:[["vault-setup-extension"]],decls:3,vars:3,consts:[["class","bwi bwi-spinner bwi-spin bwi-3x tw-text-muted","aria-hidden","true",3,"appA11yTitle",4,"ngIf"],["class","tw-text-center tw-mt-4",4,"ngIf"],["class","tw-flex tw-flex-col tw-items-center",4,"ngIf"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","bwi-3x","tw-text-muted",3,"appA11yTitle"],[1,"tw-text-center","tw-mt-4"],[1,"tw-text-xl","tw-font-medium","tw-text-main","sm:tw-text-2xl"],[1,"tw-text-sm","tw-text-main","tw-mb-6","tw-font-normal","sm:tw-text-base"],[1,"tw-flex","tw-flex-col","tw-gap-4","tw-items-center"],["bitButton","","buttonType","primary","target","_blank","rel","noopener noreferrer",3,"href"],["type","button","bitLink","",3,"click"],[1,"tw-flex","tw-flex-col","tw-items-center"],[1,"tw-size-[90px]"],[3,"icon"],["bitTypography","h2",1,"tw-mb-6","tw-mt-4","tw-text-center"],[1,"tw-flex","tw-flex-col","tw-rounded-2xl","tw-bg-background","tw-border","tw-border-solid","tw-border-secondary-300","tw-p-8","tw-max-w-md","md:tw-w-[28rem]","tw-text-center"],["type","button","bitButton","","buttonType","primary",1,"tw-mb-2",3,"click"],["bitButton","","buttonType","secondary","routerLink","/vault"],["aria-live","polite","class","tw-text-center tw-mt-4",4,"ngIf"],[1,"tw-mt-4","tw-max-w-96","tw-text-center"],["bitLink","","href","https://bitwarden.com/help/learning-center/"],["bitLink","","href","https://bitwarden.com/help"],["aria-live","polite",1,"tw-text-center","tw-mt-4"]],template:function(e,t){1&e&&k.DNE(0,Jf,2,3,"i",0)(1,Zf,15,13,"section",1)(2,eg,28,26,"section",2),2&e&&(k.Y8G("ngIf",t.state===t.SetupExtensionState.Loading),k.R7$(),k.Y8G("ngIf",t.state===t.SetupExtensionState.NeedsExtension),k.R7$(),k.Y8G("ngIf",t.showSuccessUI))},dependencies:[Y.bT,re.p,xr.C,oe.Q,ye.V,ke.L,ke.o,ge.o,Ct.i,ne.iI,ne.Wk,Hf,bf,ae.$],encapsulation:2});var ng=i(20798),rg=i(79303),sg=i(2195);class og{}og.ɵfac=function(e){return new(e||og)},og.ɵmod=k.$C({type:og}),og.ɵinj=C.G2t({imports:[mi.G]});var ag=i(88507),lg=i(34530);const cg=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0.22 7 95.71 88">
    <path class="tw-fill-illustration-bg-primary" d="M.232 9.21A2 2 0 0 1 2.222 7h67.556a2 2 0 0 1 1.99 2.21l-7.014 66.627A8 8 0 0 1 56.798 83H15.202a8 8 0 0 1-7.956-7.162L.232 9.209Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M60.283 80.99C63.59 80.76 61.313 77 58 77H14c-3.314 0-5.59 3.759-2.284 3.99.094.007.189.01.284.01h48c.095 0 .19-.003.283-.01Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M69.778 9H2.221l7.014 66.628A6 6 0 0 0 15.202 81h41.596a6 6 0 0 0 5.967-5.372L69.778 9ZM2.221 7A2 2 0 0 0 .232 9.21l7.014 66.627A8 8 0 0 0 15.202 83h41.596a8 8 0 0 0 7.956-7.162l7.013-66.629A2 2 0 0 0 69.778 7H2.221Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M36 25a1 1 0 0 1 1 1v38a1 1 0 1 1-2 0V26a1 1 0 0 1 1-1ZM27.079 64.997a1 1 0 0 1-1.076-.918l-3-38a1 1 0 1 1 1.994-.158l3 38a1 1 0 0 1-.918 1.076ZM44.921 64.997a1 1 0 0 0 1.076-.918l3-38a1 1 0 1 0-1.994-.158l-3 38a1 1 0 0 0 .918 1.076ZM80.91 29.443a1 1 0 0 0 .688 1.236l5.522 1.573a3 3 0 0 1 2.09 2.168l4.63 18.795a3 3 0 0 1-.844 2.891l-4.159 3.958a1 1 0 1 0 1.379 1.449l4.158-3.958a5 5 0 0 0 1.408-4.818l-4.63-18.795a5 5 0 0 0-3.484-3.613l-5.522-1.573a1 1 0 0 0-1.235.687Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M73.248 10.117c-1.526-.79-3.272.586-2.861 2.254l17.026 69.12c.411 1.668 2.596 2.075 3.581.667l1.486-2.124a8 8 0 0 0 1.213-6.5L79.643 16.5a8 8 0 0 0-4.093-5.192l-2.302-1.191Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M89.355 81.012 72.33 11.893l2.303 1.191a6 6 0 0 1 3.07 3.894L91.75 74.013a6 6 0 0 1-.91 4.875l-1.486 2.124Zm-18.968-68.64c-.411-1.669 1.335-3.045 2.86-2.255l2.303 1.19a8 8 0 0 1 4.093 5.193l14.05 57.035a8 8 0 0 1-1.213 6.5l-1.486 2.123c-.985 1.408-3.17 1-3.58-.668L70.386 12.372Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" d="M48 83c0 6.627-5.373 12-12 12s-12-5.373-12-12 5.373-12 12-12 12 5.373 12 12Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M36 93c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10Zm0 2c6.627 0 12-5.373 12-12s-5.373-12-12-12-12 5.373-12 12 5.373 12 12 12Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M41.707 79.293a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 1.414-1.414L34 85.586l6.293-6.293a1 1 0 0 1 1.414 0Z" clip-rule="evenodd"/>
  </svg>
`,dg=$e.Sm`
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="5.29 4.98 86.89 90.19">
<g clip-path="url(#clip0_2211_2391)">
<path class="tw-stroke-illustration-outline tw-fill-illustration-bg-primary" d="M45.7322 7.73645C46.8425 5.06767 50.6228 5.06767 51.7332 7.73645L60.8269 29.5929C61.511 31.2373 63.0575 32.3607 64.8328 32.5031L88.4343 34.3947C91.316 34.6257 92.4843 38.2221 90.2888 40.1027L72.3083 55.5001C70.9554 56.6589 70.3647 58.4773 70.7781 60.2101L76.2712 83.2335C76.9419 86.0452 73.8838 88.2672 71.4167 86.7609L51.2078 74.422C49.688 73.4941 47.7773 73.4941 46.2576 74.422L26.0486 86.7609C23.5815 88.2672 20.5234 86.0452 21.1941 83.2335L26.6873 60.2101C27.1007 58.4773 26.51 56.6589 25.157 55.5001L7.17651 40.1027C4.98107 38.2221 6.14942 34.6258 9.03101 34.3947L32.6326 32.5031C34.4079 32.3607 35.9543 31.2373 36.6384 29.5929L45.7322 7.73645Z" stroke-width="1.5"/>
<path class="tw-stroke-illustration-outline tw-fill-illustration-bg-tertiary" d="M86.5363 75.5456L67.0229 86.8083L64.3035 82.0996C63.2768 82.3932 60.0282 82.2577 55.7085 78.0915C51.1997 73.7429 53.1 69.4322 54.8897 67.3528L51.1991 60.9624C51.1991 60.9624 49.0085 57.1701 47.5085 54.572C46.5871 52.9761 46.8445 50.4707 48.594 49.461C50.3435 48.4512 52.9064 49.1601 53.9008 50.8825C56.3862 55.1873 60.6993 62.6543 60.6993 62.6543L60.3136 61.9865C59.0344 59.7715 57.8733 56.6618 60.0887 55.3831C60.1803 55.3302 60.2715 55.2816 60.3624 55.2371C62.6556 54.1121 64.7529 56.4687 66.0303 58.6805C65.81 57.9107 65.7395 56.1576 67.2199 55.3032C69.5661 53.949 71.7744 56.9755 73.1292 59.3214L72.6308 58.4584C72.1365 57.4731 71.6772 55.4212 73.4319 54.4084C75.2982 53.3313 76.7992 54.9314 77.3409 55.7398C78.3682 57.3892 80.6222 61.1108 81.42 62.8029C82.2178 64.495 82.7029 67.7429 82.8457 69.1553L86.5363 75.5456Z"/>
<path class="tw-stroke-illustration-outline" d="M66.0303 58.6805C65.81 57.9107 65.7395 56.1576 67.2199 55.3032V55.3032C69.5661 53.949 71.7744 56.9755 73.1292 59.3214L73.9905 60.8128L72.6308 58.4584C72.1365 57.4731 71.6772 55.4212 73.4319 54.4084C75.2982 53.3313 76.7992 54.9314 77.3409 55.7398C78.3682 57.3892 80.6222 61.1108 81.42 62.8029C82.2178 64.495 82.7029 67.7429 82.8457 69.1553L86.5363 75.5456L67.0229 86.8083L64.3035 82.0996C63.2768 82.3932 60.0282 82.2577 55.7085 78.0915C51.1997 73.7429 53.1 69.4322 54.8897 67.3528M66.0303 58.6805L67.9727 62.0439M66.0303 58.6805V58.6805C64.7529 56.4687 62.6556 54.1121 60.3624 55.2371C60.2715 55.2816 60.1803 55.3302 60.0887 55.3831V55.3831C57.8733 56.6618 59.0344 59.7715 60.3136 61.9865L60.6993 62.6543C60.6993 62.6543 56.3862 55.1873 53.9008 50.8825C52.9064 49.1601 50.3435 48.4512 48.594 49.461C46.8445 50.4707 46.5871 52.9761 47.5085 54.572C49.0085 57.1701 51.1991 60.9624 51.1991 60.9624L54.8897 67.3528M57.6091 72.0616L54.8897 67.3528" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path class="tw-stroke-illustration-outline tw-fill-illustration-bg-secondary" d="M70.9905 93.6786L67.5232 87.6748C67.247 87.1965 67.4108 86.585 67.8892 86.309L85.6704 76.046C86.1487 75.7699 86.7604 75.9338 87.0366 76.4121L90.5039 82.4159C90.7802 82.8942 90.6163 83.5057 90.138 83.7818L72.3567 94.0447C71.8784 94.3208 71.2667 94.1569 70.9905 93.6786Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<g clip-path="url(#clip1_2211_2391)">
<path class="tw-stroke-illustration-tertiary" d="M41.5571 37.1704L45.0496 43.2177" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M54.9774 35.4178L53.187 42.1557" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M65.7288 43.6858L59.6986 47.1663" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M35.1155 61.3549L41.1457 57.8744" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
<path class="tw-stroke-illustration-tertiary" d="M33.329 47.9126L40.0662 49.7286" stroke-width="1.5" stroke-miterlimit="10" stroke-linecap="round"/>
</g>
</g>
<defs>
<clipPath id="clip0_2211_2391">
<rect width="96" height="96" class="tw-fill-bg-tertiary" transform="translate(0.5 0.400024)"/>
</clipPath>
<clipPath id="clip1_2211_2391">
<rect width="37.6674" height="20.0537" class="tw-fill-bg-tertiary" transform="matrix(0.86609 -0.499888 0.500112 0.86596 25.2179 45.5771)"/>
</clipPath>
</defs>
</svg>`,ug=$e.Sm`
  <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 18.75 150 112.5">
    <path class="tw-fill-illustration-bg-secondary" d="M0 28.125a9.375 9.375 0 0 1 9.375-9.375h50a9.375 9.375 0 0 1 9.375 9.375v31.25a9.375 9.375 0 0 1-9.375 9.375h-50A9.375 9.375 0 0 1 0 59.375v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.375 21.875h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125A9.375 9.375 0 0 0 0 28.125v31.25a9.375 9.375 0 0 0 9.375 9.375h50a9.375 9.375 0 0 0 9.375-9.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M0 90.625a9.375 9.375 0 0 1 9.375-9.375h50a9.375 9.375 0 0 1 9.375 9.375v31.25a9.375 9.375 0 0 1-9.375 9.375h-50A9.375 9.375 0 0 1 0 121.875v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M59.375 84.375h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125A9.375 9.375 0 0 0 0 90.625v31.25a9.375 9.375 0 0 0 9.375 9.375h50a9.375 9.375 0 0 0 9.375-9.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-primary" d="M81.25 28.125a9.375 9.375 0 0 1 9.375-9.375h50A9.375 9.375 0 0 1 150 28.125v31.25a9.375 9.375 0 0 1-9.375 9.375h-50a9.375 9.375 0 0 1-9.375-9.375v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M140.625 21.875h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125a9.375 9.375 0 0 0-9.375 9.375v31.25a9.375 9.375 0 0 0 9.375 9.375h50A9.375 9.375 0 0 0 150 59.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M81.25 90.625a9.375 9.375 0 0 1 9.375-9.375h50A9.375 9.375 0 0 1 150 90.625v31.25a9.375 9.375 0 0 1-9.375 9.375h-50a9.375 9.375 0 0 1-9.375-9.375v-31.25Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M140.625 84.375h-50a6.25 6.25 0 0 0-6.25 6.25v31.25a6.25 6.25 0 0 0 6.25 6.25h50a6.25 6.25 0 0 0 6.25-6.25v-31.25a6.25 6.25 0 0 0-6.25-6.25Zm-50-3.125a9.375 9.375 0 0 0-9.375 9.375v31.25a9.375 9.375 0 0 0 9.375 9.375h50a9.375 9.375 0 0 0 9.375-9.375v-31.25a9.375 9.375 0 0 0-9.375-9.375h-50Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-secondary" d="M84.375 31.25h62.5v6.25h-62.5v-6.25ZM90.625 54.688c0-.863.7-1.563 1.563-1.563h9.374a1.563 1.563 0 1 1 0 3.125h-9.374c-.863 0-1.563-.7-1.563-1.563Z"/>
    <path class="tw-fill-illustration-outline" d="M92.188 95.313c0-.863.7-1.563 1.562-1.563h43.75a1.562 1.562 0 0 1 0 3.125H93.75c-.863 0-1.563-.7-1.563-1.563ZM92.188 106.25c0-.863.7-1.562 1.562-1.562h43.75a1.562 1.562 0 1 1 0 3.124H93.75a1.562 1.562 0 0 1-1.563-1.562ZM92.188 117.188c0-.863.7-1.563 1.562-1.563h20.312a1.563 1.563 0 0 1 0 3.125H93.75c-.863 0-1.563-.7-1.563-1.562ZM39.063 95.313c0-.863.7-1.563 1.562-1.563h18.75a1.563 1.563 0 0 1 0 3.125h-18.75c-.863 0-1.563-.7-1.563-1.563ZM39.063 101.562c0-.862.7-1.562 1.562-1.562h7.813a1.563 1.563 0 0 1 0 3.125h-7.813c-.863 0-1.563-.7-1.563-1.563Z"/>
    <path class="tw-fill-illustration-bg-secondary" d="M107.812 54.688c0-.863.7-1.563 1.563-1.563h14.063a1.563 1.563 0 0 1 0 3.125h-14.063c-.863 0-1.563-.7-1.563-1.563Z"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M32.813 97.656a8.594 8.594 0 1 1-17.189 0 8.594 8.594 0 0 1 17.188 0Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M24.219 103.125a5.468 5.468 0 1 0 0-10.937 5.468 5.468 0 0 0 0 10.937Zm0 3.125a8.594 8.594 0 1 0 0-17.188 8.594 8.594 0 0 0 0 17.188Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-bg-tertiary" d="M40.82 115.663c.903 2.158 1.367 3.877 1.367 6.212 0 .863-.7 1.563-1.562 1.563H7.812c-.862 0-1.562-.7-1.562-1.563 0-2.335.465-4.054 1.368-6.212a17.77 17.77 0 0 1 3.895-5.768 17.974 17.974 0 0 1 5.83-3.854 18.125 18.125 0 0 1 6.876-1.353c2.36 0 4.696.459 6.876 1.353 2.18.893 4.161 2.203 5.83 3.854a17.77 17.77 0 0 1 3.895 5.768Z"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M38.964 120.312c-.15-1.105-.478-2.131-1.027-3.442a14.634 14.634 0 0 0-3.21-4.753 14.865 14.865 0 0 0-4.817-3.185 15.012 15.012 0 0 0-11.382 0 14.865 14.865 0 0 0-4.817 3.185 14.634 14.634 0 0 0-3.21 4.753c-.55 1.311-.877 2.337-1.027 3.442h29.49Zm3.224 1.563c0-2.335-.465-4.054-1.368-6.212a17.77 17.77 0 0 0-3.895-5.768 17.974 17.974 0 0 0-5.83-3.854 18.125 18.125 0 0 0-6.876-1.353c-2.36 0-4.697.459-6.877 1.353a17.974 17.974 0 0 0-5.83 3.854 17.77 17.77 0 0 0-3.894 5.768c-.903 2.158-1.368 3.877-1.368 6.212 0 .863.7 1.563 1.563 1.563h32.812c.863 0 1.563-.7 1.563-1.563Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-tertiary" fill-rule="evenodd" d="M21.875 59.375c5.784 0 10.833-3.142 13.535-7.813h2.358c.829 0 1.624-.329 2.21-.915l2.21-2.21 2.93 2.345c.57.456 1.381.456 1.952 0L50 48.438l2.21 2.21c.586.585 1.38.914 2.21.914h1.89c.95 0 1.848-.431 2.44-1.172l4.532-5.664a1.562 1.562 0 0 0 0-1.952L58.75 37.11a3.125 3.125 0 0 0-2.44-1.172H35.41c-2.702-4.67-7.751-7.813-13.535-7.813-8.63 0-15.625 6.996-15.625 15.625 0 8.63 6.996 15.625 15.625 15.625Zm-3.125-12.5a3.125 3.125 0 1 0 0-6.25 3.125 3.125 0 0 0 0 6.25Z" clip-rule="evenodd"/>
    <path class="tw-fill-illustration-outline" fill-rule="evenodd" d="M33.607 48.438h4.161l4.188-4.188 4.138 3.31 4.138-3.31 4.187 4.188h1.892l3.75-4.688-3.75-4.688H33.606l-.902-1.56a12.494 12.494 0 0 0-10.83-6.252c-6.904 0-12.5 5.596-12.5 12.5s5.596 12.5 12.5 12.5c4.623 0 8.664-2.508 10.83-6.252l.902-1.56Zm27.234-5.664-.001.002.001-.002ZM25 43.75a6.25 6.25 0 1 1-12.5 0 6.25 6.25 0 0 1 12.5 0Zm10.41 7.813c-2.702 4.67-7.751 7.812-13.535 7.812-8.63 0-15.625-6.996-15.625-15.625 0-8.63 6.996-15.625 15.625-15.625 5.784 0 10.833 3.142 13.535 7.813h20.9c.95 0 1.848.431 2.44 1.172l4.532 5.664c.456.57.456 1.381 0 1.952L58.75 50.39a3.125 3.125 0 0 1-2.44 1.172h-1.892c-.828 0-1.623-.329-2.21-.915L50 48.437l-2.93 2.345a1.562 1.562 0 0 1-1.952 0l-2.93-2.344-2.21 2.21a3.125 3.125 0 0 1-2.21.914H35.41ZM21.875 43.75a3.125 3.125 0 1 1-6.25 0 3.125 3.125 0 0 1 6.25 0Z" clip-rule="evenodd"/>
  </svg>
`;var hg=i(78510),pg=i(66523),mg=i(36501),vg=i(75751),fg=i(23567),gg=i(66983),yg=i(14688),bg=i(61325),wg=i(97432),Sg=i(91968),Ig=i(27485),kg=i(11009),Cg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Tg=new Sg.Ok(Sg.Cg,"premiumModalDismissed",{deserializer:e=>e,clearOn:[]});class Fg{constructor(e,t,i,n,r,s,o,a,l,c){this.accountService=e,this.configService=t,this.billingAccountProfileStateService=i,this.vaultProfileService=n,this.syncService=r,this.dialogService=s,this.organizationService=o,this.platformUtilsService=a,this.stateProvider=l,this.logService=c,this.unifiedUpgradeDialogRef=null,this.shouldShowPrompt$=this.accountService.activeAccount$.pipe((0,ft.n)(e=>{if(this.platformUtilsService.isSelfHost())return(0,gt.of)(!1);if(!e)return(0,gt.of)(!1);const t=(0,ec.H)(this.isProfileLessThanFiveMinutesOld(e.id)),i=(0,ec.H)(this.hasOrganizations(e.id)),n=this.hasDismissedModal$(e.id);return(0,Vr.z)([t,i,this.billingAccountProfileStateService.hasPremiumFromAnySource$(e.id),this.configService.getFeatureFlag$(M.TO.PM24996_ImplementUpgradeFromFreeDialog),n]).pipe((0,m.T)(([e,t,i,n,r])=>e&&!t&&!i&&n&&!r))}),(0,df.s)(1))}displayUpgradePromptConditionally(){return Cg(this,void 0,void 0,function*(){return(yield(0,u._)(this.shouldShowPrompt$))?this.launchUpgradeDialog():null})}isProfileLessThanFiveMinutesOld(e){return Cg(this,void 0,void 0,function*(){const t=yield this.vaultProfileService.getProfileCreationDate(e);if(!t)return!1;const i=t.getTime(),n=(new Date).getTime()-i;return Math.round(n/6e4)<=5})}launchUpgradeDialog(){return Cg(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$);if(!e)return null;this.unifiedUpgradeDialogRef=Ig.gY.open(this.dialogService,{data:{account:e}});const t=yield(0,u._)(this.unifiedUpgradeDialogRef.closed);if(this.unifiedUpgradeDialogRef=null,(null==t?void 0:t.status)===Ig.PD.Closed)try{yield this.stateProvider.setUserState(Tg,!0,e.id)}catch(i){this.logService.error("Failed to save premium modal dismissal state:",i)}return t||null})}hasOrganizations(e){return Cg(this,void 0,void 0,function*(){yield this.syncService.fullSync(!1),yield(0,u._)(this.syncService.lastSync$(e).pipe((0,h.p)(e=>null!==e),(0,df.s)(1),(0,p.w)(3e4)));return(yield(0,u._)(this.organizationService.memberOrganizations$(e))).length>0})}hasDismissedModal$(e){return this.stateProvider.getUserState$(Tg,e).pipe((0,m.T)(e=>null!=e&&e))}}Fg.ɵfac=function(e){return new(e||Fg)(C.KVO(L.Di),C.KVO(U.w),C.KVO(Xr.Q),C.KVO(Ef.r),C.KVO(kg.H),C.KVO(E.o3),C.KVO(g.PV),C.KVO(N.y),C.KVO(Sg.v2),C.KVO(ve.K))},Fg.ɵprov=C.jDH({token:Fg,factory:Fg.ɵfac,providedIn:"root"});var Rg=i(27760),Pg=i(54607),xg=i(85494),$g=i(24593),Eg=i(85523),Ag=i(93817),Dg=i(9083),Og=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function Mg(e,t){if(1&e&&k.nrm(0,"bit-option",10),2&e){const e=t.$implicit;k.Y8G("value",e.id)("label",e.name)}}const Ug="moved",Gg="canceled";class jg{constructor(e,t,i,n,r,s,o,l,c){var d;this.dialogRef=t,this.cipherService=i,this.platformUtilsService=n,this.i18nService=r,this.folderService=s,this.formBuilder=o,this.toastService=l,this.accountService=c,this.cipherIds=[],this.formGroup=this.formBuilder.group({folderId:["",[a.k0.nullValidator]]}),this.submit=()=>Og(this,void 0,void 0,function*(){if(this.formGroup.invalid)return;const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.cipherService.moveManyWithServer(this.cipherIds,this.formGroup.value.folderId,e),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("movedItems")}),this.close(Ug)}),this.cipherIds=null!==(d=e.cipherIds)&&void 0!==d?d:[]}ngOnInit(){return Og(this,void 0,void 0,function*(){const e=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));this.folders$=this.folderService.folderViews$(e),this.formGroup.patchValue({folderId:(yield(0,u._)(this.folders$))[0].id})})}cancel(){this.close(Gg)}close(e){this.dialogRef.close(e)}}jg.ɵfac=function(e){return new(e||jg)(k.rXU(xn.Qs),k.rXU(E.ce),k.rXU(R.p),k.rXU(N.y),k.rXU(j.W),k.rXU(F.k),k.rXU(a.ok),k.rXU($.f),k.rXU(L.Di))},jg.ɵcmp=k.VBU({type:jg,selectors:[["ng-component"]],standalone:!1,decls:23,vars:21,consts:[[3,"formGroup","bitSubmit"],["dialogSize","small"],["bitDialogTitle",""],["bitDialogContent",""],["for","folder"],["formControlName","folderId"],[3,"value","label",4,"ngFor","ngForOf"],["bitDialogFooter",""],["bitButton","","bitFormButton","","type","submit","buttonType","primary"],["bitButton","","bitFormButton","","type","button","buttonType","secondary",3,"click"],[3,"value","label"]],template:function(e,t){1&e&&(k.j41(0,"form",0)(1,"bit-dialog",1)(2,"span",2),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"span",3)(6,"p"),k.EFF(7),k.nI1(8,"i18n"),k.k0s(),k.j41(9,"bit-form-field")(10,"bit-label",4),k.EFF(11),k.nI1(12,"i18n"),k.k0s(),k.j41(13,"bit-select",5),k.DNE(14,Mg,1,2,"bit-option",6),k.nI1(15,"async"),k.k0s()()(),k.qex(16,7),k.j41(17,"button",8),k.EFF(18),k.nI1(19,"i18n"),k.k0s(),k.j41(20,"button",9),k.bIt("click",function(){return t.cancel()}),k.EFF(21),k.nI1(22,"i18n"),k.k0s(),k.bVm(),k.k0s()()),2&e&&(k.Y8G("formGroup",t.formGroup)("bitSubmit",t.submit),k.R7$(3),k.SpI(" ",k.bMT(4,8,"addToFolder")," "),k.R7$(4),k.JRh(k.i5U(8,10,"moveSelectedItemsDesc",t.cipherIds.length)),k.R7$(4),k.JRh(k.bMT(12,13,"selectFolder")),k.R7$(3),k.Y8G("ngForOf",k.bMT(15,15,t.folders$)),k.R7$(4),k.SpI(" ",k.bMT(19,17,"save")," "),k.R7$(3),k.SpI(" ",k.bMT(22,19,"cancel")," "))},dependencies:[Y.Sq,a.qT,a.BC,a.cb,a.j4,a.JD,gi.$,yi.L,oe.Q,gn.m,bi.j,wi.h,Si.w,Ii.P,Y.Jj,ae.$],encapsulation:2});var Ng=i(90097),Vg=i(1094),Bg=i(91326),zg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Lg{constructor(e,t,i,n,r){this.apiService=e,this.i18nService=t,this.platformUtilsService=i,this.tokenService=n,this.toastService=r,this.onVerified=new k.bkB,this.onDismiss=new k.bkB,this.send=()=>zg(this,void 0,void 0,function*(){yield this.verifyEmail()})}verifyEmail(){return zg(this,void 0,void 0,function*(){if(yield this.apiService.refreshIdentityToken(),yield this.tokenService.getEmailVerified())return this.onVerified.emit(!0),void this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("emailVerified")});yield this.apiService.postAccountVerifyEmail(),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("checkInboxForVerification")})})}}Lg.ɵfac=function(e){return new(e||Lg)(k.rXU(fi.G),k.rXU(j.W),k.rXU(N.y),k.rXU(X.B),k.rXU($.f))},Lg.ɵcmp=k.VBU({type:Lg,selectors:[["app-verify-email"]],outputs:{onVerified:"onVerified",onDismiss:"onDismiss"},decls:6,vars:6,consts:[["bannerType","warning",3,"onClose"],["id","sendBtn","bitLink","","linkType","secondary","type","button","buttonType","unstyled",3,"click"]],template:function(e,t){1&e&&(k.j41(0,"bit-banner",0),k.bIt("onClose",function(){return t.onDismiss.emit()}),k.EFF(1),k.nI1(2,"i18n"),k.j41(3,"button",1),k.bIt("click",function(){return t.send()}),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,2,"verifyEmailDesc")," "),k.R7$(3),k.SpI(" ",k.bMT(5,4,"sendEmail")," "))},dependencies:[Jn.C,Ng.H,Bg.K,se.t,Y.MD,re.p,ye.V,ke.o,ae.$],encapsulation:2});var Kg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const qg={OutdatedBrowser:"outdated-browser",Premium:"premium",VerifyEmail:"verify-email",PendingAuthRequest:"pending-auth-request"},_g=new S.Ok(S.Bh,"bannerReprompt",{deserializer:e=>e,clearOn:[]}),Xg=new S.Ok(S.Iw,"bannersDismissed",{deserializer:e=>e,clearOn:[]});class Yg{constructor(e,t,i,n,r,s){this.accountService=e,this.stateProvider=t,this.billingAccountProfileStateService=i,this.platformUtilsService=n,this.syncService=r,this.authRequestService=s}shouldShowPendingAuthRequestBanner(e){return Kg(this,void 0,void 0,function*(){const t=(yield this.getBannerDismissedState(e)).includes(qg.PendingAuthRequest);return(yield(0,u._)(this.authRequestService.getPendingAuthRequests$())).length>0&&!t})}shouldShowPremiumBanner$(e){const t=this.premiumBannerState(e),i=(0,Vr.z)([this.billingAccountProfileStateService.hasPremiumFromAnySource$(e),t.state$]);return this.syncService.lastSync$(e).pipe((0,h.p)(e=>null!==e),(0,df.s)(1),(0,zp.Z)(()=>i),(0,m.T)(([e,t])=>{const i=!e&&!this.platformUtilsService.isSelfHost();if(i&&(null==t?void 0:t.nextPromptDate)){const e=new Date(t.nextPromptDate);return new Date>=e}return i}))}shouldShowUpdateBrowserBanner(e){return Kg(this,void 0,void 0,function*(){const t=-1!==window.navigator.userAgent.indexOf("MSIE"),i=(yield this.getBannerDismissedState(e)).includes(qg.OutdatedBrowser);return t&&!i})}shouldShowVerifyEmailBanner(e){return Kg(this,void 0,void 0,function*(){var t;const i=!(null===(t=yield(0,u._)(this.accountService.accounts$.pipe((0,m.T)(t=>t[e]))))||void 0===t?void 0:t.emailVerified),n=(yield this.getBannerDismissedState(e)).includes(qg.VerifyEmail);return i&&!n})}dismissBanner(e,t){return Kg(this,void 0,void 0,function*(){t===qg.Premium?yield this.dismissPremiumBanner(e):yield this.sessionBannerState(e).update(e=>[...null!=e?e:[],t])})}premiumBannerState(e){return this.stateProvider.getUser(e,_g)}sessionBannerState(e){return this.stateProvider.getUser(e,Xg)}getBannerDismissedState(e){return Kg(this,void 0,void 0,function*(){var t;return null!==(t=yield(0,u._)(this.sessionBannerState(e).state$))&&void 0!==t?t:[]})}dismissPremiumBanner(e){return Kg(this,void 0,void 0,function*(){yield this.premiumBannerState(e).update(e=>{var t;const i=null!==(t=null==e?void 0:e.numberOfDismissals)&&void 0!==t?t:0,n=new Date;if(n.setHours(0,0,0,0),0===i)return n.setDate(n.getDate()+7),{numberOfDismissals:1,nextPromptDate:n.getTime()};if(1===i)return n.setMonth(n.getMonth()+1),{numberOfDismissals:2,nextPromptDate:n.getTime()};const r=new Date(n.getFullYear()+1,n.getMonth(),n.getDate());return r.setHours(0,0,0,0),{numberOfDismissals:i+1,nextPromptDate:r.getTime()}})})}}Yg.ɵfac=function(e){return new(e||Yg)(C.KVO(L.Di),C.KVO(S.v2),C.KVO(Xr.Q),C.KVO(N.y),C.KVO(hi.H),C.KVO(f.XF))},Yg.ɵprov=C.jDH({token:Yg,factory:Yg.ɵfac});var Hg=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Wg=(e,t)=>t.id;function Jg(e,t){if(1&e){const e=k.RV6();k.j41(0,"app-organization-free-trial-warning",5),k.bIt("clicked",function(){const t=C.eBV(e).$implicit,i=k.XpG();return C.Njj(i.navigateToPaymentMethod(t.id))}),k.k0s()}if(2&e){const e=t.$implicit;k.Y8G("organization",e)("includeOrganizationNameInMessaging",!0)}}function Zg(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-banner",6),k.bIt("onClose",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.dismissBanner(t.VisibleVaultBanner.OutdatedBrowser))}),k.EFF(1),k.nI1(2,"i18n"),k.j41(3,"a",7),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()}2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,2,"updateBrowserDesc")," "),k.R7$(3),k.SpI(" ",k.bMT(5,4,"updateBrowser")," "))}function Qg(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-banner",8),k.bIt("onClose",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.dismissBanner(t.VisibleVaultBanner.PendingAuthRequest))}),k.EFF(1),k.nI1(2,"i18n"),k.j41(3,"a",9),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()}2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,2,"youHaveAPendingLoginRequest")," "),k.R7$(3),k.SpI(" ",k.bMT(5,4,"reviewLoginRequest")," "))}function ey(e,t){if(1&e){const e=k.RV6();k.j41(0,"app-verify-email",10),k.bIt("onDismiss",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.dismissBanner(t.VisibleVaultBanner.VerifyEmail))})("onVerified",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.dismissBanner(t.VisibleVaultBanner.VerifyEmail))}),k.k0s()}}function ty(e,t){if(1&e){const e=k.RV6();k.j41(0,"bit-banner",11),k.bIt("onClose",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.dismissBanner(t.VisibleVaultBanner.Premium))}),k.EFF(1),k.nI1(2,"i18n"),k.j41(3,"a",12),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()}2&e&&(k.R7$(),k.SpI(" ",k.bMT(2,2,"premiumUpgradeUnlockFeatures")," "),k.R7$(3),k.SpI(" ",k.bMT(5,4,"goPremium")," "))}class iy{constructor(e,t,i,n,r){this.vaultBannerService=e,this.router=t,this.accountService=i,this.messageListener=n,this.configService=r,this.visibleBanners=[],this.VisibleVaultBanner=qg,this.organizations=[],this.activeUserId$=this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.id)),this.premiumBannerVisible$=this.activeUserId$.pipe((0,h.p)(e=>null!=e),(0,ft.n)(e=>(0,Vr.z)([this.vaultBannerService.shouldShowPremiumBanner$(e),this.configService.getFeatureFlag$(M.TO.PM24996_ImplementUpgradeFromFreeDialog)]).pipe((0,m.T)(([e,t])=>e&&!t)))),this.messageListener.allMessages$.pipe((0,h.p)(e=>"openLoginApproval"===e.command),(0,c.pQ)()).subscribe(()=>{this.visibleBanners.includes(qg.PendingAuthRequest)||(this.visibleBanners=[...this.visibleBanners,qg.PendingAuthRequest])})}ngOnInit(){return Hg(this,void 0,void 0,function*(){yield this.determineVisibleBanners()})}dismissBanner(e){return Hg(this,void 0,void 0,function*(){const t=yield(0,u._)(this.activeUserId$);t&&(yield this.vaultBannerService.dismissBanner(t,e),yield this.determineVisibleBanners())})}navigateToPaymentMethod(e){return Hg(this,void 0,void 0,function*(){yield this.router.navigate(["organizations",e,"billing","payment-details"],{state:{launchPaymentModalAutomatically:!0}})})}determineVisibleBanners(){return Hg(this,void 0,void 0,function*(){const e=yield(0,u._)(this.activeUserId$);if(!e)return;const t=yield this.vaultBannerService.shouldShowUpdateBrowserBanner(e),i=yield this.vaultBannerService.shouldShowVerifyEmailBanner(e),n=yield this.vaultBannerService.shouldShowPendingAuthRequestBanner(e);this.visibleBanners=[t?qg.OutdatedBrowser:null,i?qg.VerifyEmail:null,n?qg.PendingAuthRequest:null].filter(e=>null!==e)})}}iy.ɵfac=function(e){return new(e||iy)(k.rXU(Yg),k.rXU(x.Ix),k.rXU(L.Di),k.rXU(to.qk),k.rXU(U.w))},iy.ɵcmp=k.VBU({type:iy,selectors:[["app-vault-banners"]],inputs:{organizations:"organizations"},features:[k.Jv_([Yg])],decls:7,vars:6,consts:[[3,"organization","includeOrganizationNameInMessaging"],["id","update-browser-banner","bannerType","warning",3,"onClose",4,"ngIf"],["id","pending-auth-request-banner","bannerType","info","icon","bwi-info-circle",3,"onClose",4,"ngIf"],["id","verify-email-banner",3,"onDismiss","onVerified",4,"ngIf"],["id","premium-banner","bannerType","premium",3,"onClose",4,"ngIf"],[3,"clicked","organization","includeOrganizationNameInMessaging"],["id","update-browser-banner","bannerType","warning",3,"onClose"],["bitLink","","linkType","secondary","target","_blank","href","https://browser-update.org/update-browser.html","rel","noreferrer noopener"],["id","pending-auth-request-banner","bannerType","info","icon","bwi-info-circle",3,"onClose"],["bitLink","","linkType","secondary","routerLink","/settings/security/device-management"],["id","verify-email-banner",3,"onDismiss","onVerified"],["id","premium-banner","bannerType","premium",3,"onClose"],["bitLink","","linkType","secondary","routerLink","/settings/subscription/premium"]],template:function(e,t){1&e&&(k.Z7z(0,Jg,1,2,"app-organization-free-trial-warning",0,Wg),k.DNE(2,Zg,6,6,"bit-banner",1)(3,Qg,6,6,"bit-banner",2)(4,ey,1,0,"app-verify-email",3)(5,ty,6,6,"bit-banner",4),k.nI1(6,"async")),2&e&&(k.Dyx(t.organizations),k.R7$(2),k.Y8G("ngIf",t.visibleBanners.includes(t.VisibleVaultBanner.OutdatedBrowser)),k.R7$(),k.Y8G("ngIf",t.visibleBanners.includes(t.VisibleVaultBanner.PendingAuthRequest)),k.R7$(),k.Y8G("ngIf",t.visibleBanners.includes(t.VisibleVaultBanner.VerifyEmail)),k.R7$(),k.Y8G("ngIf",k.bMT(6,4,t.premiumBannerVisible$)))},dependencies:[Lg,mi.G,Y.bT,ne.Wk,ke.L,Ng.H,Bg.K,Vg.z,Y.Jj,ae.$],encapsulation:2});var ny=i(85111),ry=i(39738),sy=i(8144),oy=i(47911),ay=i(30550),ly=i(51122),cy=i(56615),dy=i(1576),uy=i(88547),hy=i(91975),py=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const my=()=>[],vy=(e,t)=>({organizationId:e,collectionId:t}),fy=e=>({collectionId:e});function gy(e,t){if(1&e&&(k.j41(0,"bit-breadcrumb",9),k.EFF(1),k.nI1(2,"orgNameFromId"),k.nI1(3,"i18n"),k.nI1(4,"lowercase"),k.k0s()),2&e){const e=k.XpG(2);k.Y8G("route",k.lJ4(11,my))("queryParams",k.l_i(12,vy,e.activeOrganizationId,e.All)),k.R7$(),k.Lme(" ",k.i5U(2,4,e.activeOrganizationId,e.organizations)," ",k.bMT(4,9,k.bMT(3,7,"vault"))," ")}}function yy(e,t){if(1&e&&(k.j41(0,"bit-breadcrumb",10),k.EFF(1),k.k0s()),2&e){const e=t.$implicit;k.Y8G("route",k.lJ4(3,my))("queryParams",k.eq3(4,fy,e.id)),k.R7$(),k.SpI(" ",e.name," ")}}function by(e,t){if(1&e&&(k.j41(0,"bit-breadcrumbs",6),k.DNE(1,gy,5,15,"bit-breadcrumb",7),k.qex(2),k.DNE(3,yy,2,6,"bit-breadcrumb",8),k.bVm(),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.Y8G("ngIf",e.activeOrganizationId),k.R7$(2),k.Y8G("ngForOf",e.collections)}}function wy(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",13),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.editCollection(t.CollectionDialogTabType.Info))}),k.nrm(1,"i",14),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"editInfo")," "))}function Sy(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",13),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.editCollection(t.CollectionDialogTabType.Access))}),k.nrm(1,"i",15),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"access")," "))}function Iy(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",13),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.deleteCollection())}),k.j41(1,"span",16),k.nrm(2,"i",17),k.EFF(3),k.nI1(4,"i18n"),k.k0s()()}2&e&&(k.R7$(3),k.SpI(" ",k.bMT(4,1,"delete")," "))}function ky(e,t){if(1&e&&(k.qex(0),k.nrm(1,"button",11),k.nI1(2,"i18n"),k.j41(3,"bit-menu",null,0),k.DNE(5,wy,4,3,"button",12)(6,Sy,4,3,"button",12)(7,Iy,5,3,"button",12),k.k0s(),k.bVm()),2&e){const e=k.sdS(4),t=k.XpG();k.R7$(),k.Y8G("bitMenuTriggerFor",e)("label",k.bMT(2,5,"editCollection")),k.R7$(4),k.Y8G("ngIf",t.canEditCollection),k.R7$(),k.Y8G("ngIf",t.canEditCollection),k.R7$(),k.Y8G("ngIf",t.canDeleteCollection)}}function Cy(e,t){1&e&&(k.j41(0,"small"),k.nrm(1,"i",18),k.nI1(2,"i18n"),k.j41(3,"span",19),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function Ty(e,t){if(1&e){const e=k.RV6();k.j41(0,"div",20)(1,"vault-new-cipher-menu",21),k.bIt("cipherAdded",function(t){C.eBV(e);const i=k.XpG();return C.Njj(i.addCipher(t))})("folderAdded",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.addFolder())})("collectionAdded",function(){C.eBV(e);const t=k.XpG();return C.Njj(t.addCollection())}),k.k0s()()}if(2&e){const e=k.XpG();k.R7$(),k.Y8G("canCreateCipher",!0)("canCreateFolder",!0)("canCreateSshKey",!0)("canCreateCollection",e.canCreateCollections)}}class Fy{constructor(e,t,i,n,r,s){this.i18nService=e,this.collectionAdminService=t,this.dialogService=i,this.router=n,this.configService=r,this.accountService=s,this.Unassigned=v.I_,this.All=ay.u,this.CollectionDialogTabType=sg._K,this.CipherType=zs.gC,this.loading=!0,this.organizations=[],this.canCreateCollections=!1,this.onAddCipher=new k.bkB,this.onAddCollection=new k.bkB,this.onAddFolder=new k.bkB,this.onEditCollection=new k.bkB,this.onDeleteCollection=new k.bkB}get activeOrganizationId(){var e;return null!=this.collection?this.collection.node.organizationId:void 0!==(null===(e=this.filter)||void 0===e?void 0:e.organizationId)?this.filter.organizationId:void 0}get activeOrganization(){var e;const t=this.activeOrganizationId;return null===(e=this.organizations)||void 0===e?void 0:e.find(e=>e.id===t)}get showBreadcrumbs(){var e;return void 0!==(null===(e=this.filter)||void 0===e?void 0:e.collectionId)&&this.filter.collectionId!==ay.u}get title(){if(void 0===this.filter)return"";if(this.filter.collectionId===v.I_)return this.i18nService.t("unassigned");if(this.collection)return this.collection.node.name;if(this.filter.organizationId===v.I_)return this.i18nService.t("myVault");if("archive"===this.filter.type)return this.i18nService.t("archiveNoun");const e=this.activeOrganization;return e?`${e.name} ${this.i18nService.t("vault").toLowerCase()}`:this.i18nService.t("allVaults")}get icon(){var e,t;return(null===(e=this.filter)||void 0===e?void 0:e.collectionId)&&this.filter.collectionId!==ay.u?(null===(t=this.collection)||void 0===t?void 0:t.node.type)===v.it.DefaultUserCollection?"bwi-user":"bwi-collection-shared":""}get collections(){if(null==this.collection)return[];const e=[this.collection];for(;null!=e[e.length-1].parent;)e.push(e[e.length-1].parent);return e.slice(1).reverse().map(e=>e.node)}get canEditCollection(){if(null==this.collection)return!1;const e=this.organizations.find(e=>{var t;return e.id===(null===(t=this.collection)||void 0===t?void 0:t.node.organizationId)});return this.collection.node.canEdit(e)}editCollection(e){return py(this,void 0,void 0,function*(){this.onEditCollection.emit({tab:e})})}get canDeleteCollection(){if(void 0===this.collection)return!1;const e=this.organizations.find(e=>{var t;return e.id===(null===(t=this.collection)||void 0===t?void 0:t.node.organizationId)});return this.collection.node.canDelete(e)}deleteCollection(){this.onDeleteCollection.emit()}addCipher(e){this.onAddCipher.emit(e)}addFolder(){return py(this,void 0,void 0,function*(){this.onAddFolder.emit()})}addCollection(){return py(this,void 0,void 0,function*(){var e,t;const i=null===(e=this.organizations)||void 0===e?void 0:e.find(e=>e.productTierType===ui.K_.Free);if(1==(null===(t=this.organizations)||void 0===t?void 0:t.length)&&i){if((yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.collectionAdminService.collectionAdminViews$(i.id,e))))).length===i.maxCollections)return void(yield this.showFreeOrgUpgradeDialog(i))}this.onAddCollection.emit()})}showFreeOrgUpgradeDialog(e){return py(this,void 0,void 0,function*(){const t={title:this.i18nService.t("upgradeOrganization"),content:this.i18nService.t(e.canEditSubscription?"freeOrgMaxCollectionReachedManageBilling":"freeOrgMaxCollectionReachedNoManageBilling",e.maxCollections),type:"primary"};e.canEditSubscription?t.acceptButtonText=this.i18nService.t("upgrade"):(t.acceptButtonText=this.i18nService.t("ok"),t.cancelButtonText=null);const i=this.dialogService.openSimpleDialogRef(t);(yield(0,u._)(i.closed))&&e.canEditSubscription&&(yield this.router.navigate(["/organizations",e.id,"billing","subscription"],{queryParams:{upgrade:!0}}))})}}Fy.ɵfac=function(e){return new(e||Fy)(k.rXU(j.W),k.rXU(v.vE),k.rXU(E.o3),k.rXU(x.Ix),k.rXU(U.w),k.rXU(L.Di))},Fy.ɵcmp=k.VBU({type:Fy,selectors:[["app-vault-header"]],inputs:{loading:"loading",filter:"filter",organizations:"organizations",collection:"collection",canCreateCollections:"canCreateCollections"},outputs:{onAddCipher:"onAddCipher",onAddCollection:"onAddCollection",onAddFolder:"onAddFolder",onEditCollection:"onEditCollection",onDeleteCollection:"onDeleteCollection"},decls:6,vars:6,consts:[["editCollectionMenu",""],[3,"title","icon"],["slot","breadcrumbs",4,"ngIf"],["slot","title-suffix"],[4,"ngIf"],["class","tw-shrink-0",4,"ngIf"],["slot","breadcrumbs"],["queryParamsHandling","merge",3,"route","queryParams",4,"ngIf"],["icon","bwi-collection-shared","queryParamsHandling","merge",3,"route","queryParams",4,"ngFor","ngForOf"],["queryParamsHandling","merge",3,"route","queryParams"],["icon","bwi-collection-shared","queryParamsHandling","merge",3,"route","queryParams"],["bitIconButton","bwi-angle-down","size","small","type","button",3,"bitMenuTriggerFor","label"],["type","button","bitMenuItem","",3,"click",4,"ngIf"],["type","button","bitMenuItem","",3,"click"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-pencil-square"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-users"],[1,"tw-text-danger"],["aria-hidden","true",1,"bwi","bwi-fw","bwi-trash"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[1,"tw-shrink-0"],[3,"cipherAdded","folderAdded","collectionAdded","canCreateCipher","canCreateFolder","canCreateSshKey","canCreateCollection"]],template:function(e,t){1&e&&(k.j41(0,"app-header",1),k.DNE(1,by,4,2,"bit-breadcrumbs",2),k.qex(2,3),k.nVh(3,ky,8,7,"ng-container"),k.DNE(4,Cy,6,7,"small",4),k.bVm(),k.DNE(5,Ty,2,4,"div",5),k.k0s()),2&e&&(k.Y8G("title",t.title)("icon",t.icon),k.R7$(),k.Y8G("ngIf",t.showBreadcrumbs),k.R7$(2),k.vxM(null!=t.collection&&(t.canEditCollection||t.canDeleteCollection)?3:-1),k.R7$(),k.Y8G("ngIf",t.loading),k.R7$(),k.Y8G("ngIf","trash"!==t.filter.type))},dependencies:[Y.MD,Y.Sq,Y.bT,Am.M,Hr.Z,Wr.O,Jr.S,mi.G,ln.s,cy.V,dy.m,uy.D,Ei.G,Di.f,Yd.Y,re.p,js.eG,Y.GH,ae.$,hy.t],encapsulation:2,changeDetection:0});var Ry=i(7919),Py=i(83691);class xy{}xy.ɵfac=function(e){return new(e||xy)},xy.ɵmod=k.$C({type:xy}),xy.ɵinj=C.G2t({imports:[Zt.G,Py.E]});class $y{}var Ey=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Ay=new S.Ok(S.iK,"tasks",{deserializer:e=>e,clearOn:[]});class Dy{constructor(e){this.stateProvider=e}vaultOnboardingState(e){return this.stateProvider.getUser(e,Ay)}vaultOnboardingState$(e){return this.vaultOnboardingState(e).state$}setVaultOnboardingTasks(e,t){return Ey(this,void 0,void 0,function*(){const i=this.vaultOnboardingState(e);yield i.update(()=>Object.assign({},t))})}}Dy.ɵfac=function(e){return new(e||Dy)(C.KVO(S.v2))},Dy.ɵprov=C.jDH({token:Dy,factory:Dy.ɵfac});const Oy=e=>({"tw-opacity-50":e}),My=e=>({"tw-text-primary-700 tw-line-through tw-decoration-primary-700 tw-opacity-50":e});function Uy(e,t){if(1&e&&(k.nrm(0,"i",5),k.j41(1,"span",6),k.EFF(2),k.nrm(3,"i",7),k.k0s()),2&e){const e=k.XpG();k.Y8G("ngClass",e.completed?"bwi-check tw-text-success":e.icon),k.R7$(),k.Y8G("ngClass",k.eq3(3,My,e.completed)),k.R7$(),k.JRh(e.title)}}function Gy(e,t){1&e&&k.eu8(0)}function jy(e,t){if(1&e&&(k.j41(0,"a",8),k.DNE(1,Gy,1,0,"ng-container",9),k.k0s()),2&e){const e=k.XpG(),t=k.sdS(1);k.Y8G("routerLink",e.route),k.R7$(),k.Y8G("ngTemplateOutlet",t)}}function Ny(e,t){1&e&&k.eu8(0)}function Vy(e,t){if(1&e&&(k.j41(0,"button",10),k.DNE(1,Ny,1,0,"ng-container",9),k.k0s()),2&e){const e=k.XpG(),t=k.sdS(1);k.Y8G("disabled",e.isDisabled),k.R7$(),k.Y8G("ngTemplateOutlet",t)}}class By{constructor(){this.completed=!1,this.icon="bwi-info-circle",this.isDisabled=!1}handleClick(e){e.stopPropagation()}}By.ɵfac=function(e){return new(e||By)},By.ɵcmp=k.VBU({type:By,selectors:[["app-onboarding-task"]],hostAttrs:[1,"tw-max-w-max"],inputs:{completed:"completed",icon:"icon",title:"title",route:"route",isDisabled:"isDisabled"},standalone:!1,ngContentSelectors:["*"],decls:7,vars:5,consts:[["content",""],[1,"tw-list-none"],["bitLink","",3,"routerLink",4,"ngIf"],["type","button","bitLink","",3,"disabled",4,"ngIf"],[1,"tw-ml-8","tw-mt-1","tw-text-sm",3,"click","ngClass"],[1,"bwi","bwi-fw","!tw-mr-4",3,"ngClass"],[3,"ngClass"],[1,"bwi","bwi-angle-right","tw-ml-1"],["bitLink","",3,"routerLink"],[4,"ngTemplateOutlet"],["type","button","bitLink","",3,"disabled"]],template:function(e,t){if(1&e){const e=k.RV6();k.NAR(),k.DNE(0,Uy,4,5,"ng-template",null,0,k.C5r),k.j41(2,"li",1),k.DNE(3,jy,2,2,"a",2)(4,Vy,2,2,"button",3),k.j41(5,"div",4),k.bIt("click",function(i){return C.eBV(e),C.Njj(t.handleClick(i))}),k.SdG(6),k.k0s()()}2&e&&(k.R7$(3),k.Y8G("ngIf",t.route),k.R7$(),k.Y8G("ngIf",!t.route),k.R7$(),k.Y8G("ngClass",k.eq3(3,Oy,t.completed)))},dependencies:[Y.YU,Y.bT,Y.T3,ne.Wk,ke.L,ke.o],encapsulation:2});var zy=i(38140);function Ly(e,t){if(1&e&&(k.j41(0,"span"),k.EFF(1),k.nI1(2,"i18n"),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.SpI(" ",k.brH(2,1,"complete",e.amountCompleted,e.tasks.length)," ")}}function Ky(e,t){1&e&&k.nrm(0,"i",12)}class qy{constructor(){this.dismiss=new k.bkB,this.open=!0,this.visible=!1}get amountCompleted(){return this.tasks.filter(e=>e.completed).length}get barWidth(){return 0===this.tasks.length?0:this.amountCompleted/this.tasks.length*100}toggle(){this.open=!this.open}}qy.ɵfac=function(e){return new(e||qy)},qy.ɵcmp=k.VBU({type:qy,selectors:[["app-onboarding"]],contentQueries:function(e,t,i){if(1&e&&k.wni(i,By,4),2&e){let e;k.mGM(e=k.lsd())&&(t.tasks=e)}},inputs:{title:"title"},outputs:{dismiss:"dismiss"},standalone:!1,ngContentSelectors:["*"],decls:17,vars:9,consts:[["details",""],["spinner",""],["open","",1,"tw-rounded-sm","tw-bg-background-alt","tw-text-main",3,"toggle"],[1,"tw-list-none","tw-p-2","tw-px-4"],[1,"tw-flex","tw-select-none","tw-items-center","tw-gap-4"],[1,"tw-text-lg"],[1,"tw-flex-1",3,"showText","barWidth"],[4,"ngIf","ngIfElse"],["aria-hidden","true",1,"bwi","tw-my-auto",3,"ngClass"],[1,"tw-mb-0","tw-ml-6","tw-flex","tw-flex-col","tw-gap-4"],[1,"tw-p-4","tw-pt-0"],["bitLink","","type","button",1,"tw-ml-auto","tw-block",3,"click"],[1,"bwi","bwi-spinner","bwi-spin"]],template:function(e,t){if(1&e){const e=k.RV6();k.NAR(),k.j41(0,"details",2,0),k.bIt("toggle",function(){return C.eBV(e),C.Njj(t.toggle())}),k.j41(2,"summary",3)(3,"div",4)(4,"div",5),k.EFF(5),k.k0s(),k.nrm(6,"bit-progress",6),k.DNE(7,Ly,3,5,"span",7),k.nrm(8,"i",8),k.k0s()(),k.j41(9,"ul",9),k.SdG(10),k.k0s(),k.j41(11,"div",10)(12,"button",11),k.bIt("click",function(){return C.eBV(e),C.Njj(t.dismiss.emit())}),k.EFF(13),k.nI1(14,"i18n"),k.k0s()()(),k.DNE(15,Ky,1,0,"ng-template",null,1,k.C5r)}if(2&e){const e=k.sdS(16);k.R7$(5),k.JRh(t.title),k.R7$(),k.Y8G("showText",!1)("barWidth",t.barWidth),k.R7$(),k.Y8G("ngIf",t.tasks.length>0)("ngIfElse",e),k.R7$(),k.Y8G("ngClass",t.open?"bwi-angle-down":"bwi-angle-up"),k.R7$(5),k.SpI(" ",k.bMT(14,7,"dismiss")," ")}},dependencies:[Y.YU,Y.bT,ke.o,zy.X,ae.$],encapsulation:2});var _y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const Xy=()=>["/tools/import"];function Yy(e,t){if(1&e){const e=k.RV6();k.j41(0,"app-onboarding",3),k.nI1(1,"i18n"),k.bIt("dismiss",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.hideOnboarding())}),k.nrm(2,"app-onboarding-task",4),k.nI1(3,"i18n"),k.j41(4,"app-onboarding-task",5),k.nI1(5,"i18n"),k.j41(6,"p",6),k.EFF(7),k.nI1(8,"i18n"),k.j41(9,"button",7),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.emitToAddCipher())}),k.EFF(10),k.nI1(11,"i18n"),k.k0s(),k.j41(12,"span"),k.EFF(13),k.nI1(14,"i18n"),k.k0s()()(),k.j41(15,"app-onboarding-task",8),k.nI1(16,"i18n"),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.navigateToExtension())}),k.j41(17,"span",6),k.EFF(18),k.nI1(19,"i18n"),k.k0s()()()}if(2&e){const e=k.XpG().ngIf;k.Y8G("title",k.bMT(1,13,"getStarted")),k.R7$(2),k.Y8G("title",k.bMT(3,15,"createAnAccount"))("completed",e.createAccount)("isDisabled",!0),k.R7$(2),k.Y8G("title",k.bMT(5,17,"importData"))("route",k.lJ4(29,Xy))("completed",e.importData),k.R7$(3),k.SpI(" ",k.bMT(8,19,"onboardingImportDataDetailsPartOne")," "),k.R7$(3),k.SpI(" ",k.bMT(11,21,"onboardingImportDataDetailsLoginLink")," "),k.R7$(3),k.SpI(" ",k.bMT(14,23,"onboardingImportDataDetailsPartTwoNoOrgs")," "),k.R7$(2),k.Y8G("title",k.bMT(16,25,"installBrowserExtension"))("completed",e.installExtension),k.R7$(3),k.SpI(" ",k.bMT(19,27,"installBrowserExtensionDetails")," ")}}function Hy(e,t){if(1&e&&(k.j41(0,"div",1),k.DNE(1,Yy,20,30,"app-onboarding",2),k.k0s()),2&e){const e=t.ngIf;k.R7$(),k.Y8G("ngIf",e)}}class Wy{constructor(e,t,i,n,r){this.platformUtilsService=e,this.policyService=t,this.apiService=i,this.vaultOnboardingService=n,this.accountService=r,this.onAddCipher=new k.bkB,this.destroy$=new d.B,this.onboardingReleaseDate=new Date("2024-04-02"),this.showOnboarding=!1}ngOnInit(){return _y(this,void 0,void 0,function*(){this.activeId=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),this.onboardingTasks$=this.vaultOnboardingService.vaultOnboardingState$(this.activeId),yield this.setOnboardingTasks(),this.setInstallExtLink(),this.individualVaultPolicyCheck(),this.checkForBrowserExtension()})}ngOnChanges(e){return _y(this,void 0,void 0,function*(){if(this.showOnboarding&&(null==e?void 0:e.ciphers)){const e=yield(0,u._)(this.onboardingTasks$),t={createAccount:!0,importData:this.ciphers.length>0,installExtension:e.installExtension};yield this.vaultOnboardingService.setVaultOnboardingTasks(this.activeId,t)}})}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}checkForBrowserExtension(){this.showOnboarding&&((0,rf.R)(window,"message").pipe((0,li.Q)(this.destroy$)).subscribe(e=>{this.getMessages(e)}),window.postMessage({command:sf.checkBwInstalled}))}getMessages(e){return _y(this,void 0,void 0,function*(){if(e.data.command===sf.HasBwInstalled&&this.showOnboarding){const e=yield(0,u._)(this.onboardingTasks$),t={createAccount:e.createAccount,importData:e.importData,installExtension:!0};yield this.vaultOnboardingService.setVaultOnboardingTasks(this.activeId,t)}})}checkCreationDate(){return _y(this,void 0,void 0,function*(){const e=yield this.apiService.getProfile(),t=new Date(e.creationDate);this.isNewAccount=this.onboardingReleaseDate<t,this.isNewAccount||(yield this.hideOnboarding())})}hideOnboarding(){return _y(this,void 0,void 0,function*(){yield this.saveCompletedTasks({createAccount:!0,importData:!0,installExtension:!0})})}setOnboardingTasks(){return _y(this,void 0,void 0,function*(){var e;const t=yield(0,u._)(this.onboardingTasks$);if(null==t){const t={createAccount:!0,importData:(null===(e=this.ciphers)||void 0===e?void 0:e.length)>0,installExtension:!1};yield this.saveCompletedTasks(t)}else t&&(this.showOnboarding=Object.values(t).includes(!1));this.showOnboarding&&(yield this.checkCreationDate())})}saveCompletedTasks(e){return _y(this,void 0,void 0,function*(){this.showOnboarding=Object.values(e).includes(!1),yield this.vaultOnboardingService.setVaultOnboardingTasks(this.activeId,e)})}individualVaultPolicyCheck(){this.accountService.activeAccount$.pipe(b.F6,(0,ft.n)(e=>this.policyService.policyAppliesToUser$(ci.tt.OrganizationDataOwnership,e)),(0,li.Q)(this.destroy$)).subscribe(e=>{this.isIndividualPolicyVault=e})}emitToAddCipher(){this.onAddCipher.emit(Ry.gC.Login)}setInstallExtLink(){this.platformUtilsService.isChrome()?this.extensionUrl="https://chromewebstore.google.com/detail/bitwarden-password-manage/nngceckbapebfimnlniiiahkandclblb":this.platformUtilsService.isFirefox()?this.extensionUrl="https://addons.mozilla.org/en-US/firefox/addon/bitwarden-password-manager/":this.platformUtilsService.isSafari()?this.extensionUrl="https://apps.apple.com/us/app/bitwarden/id1352778147?mt=12":this.platformUtilsService.isOpera()?this.extensionUrl="https://addons.opera.com/extensions/details/bitwarden-free-password-manager/":this.platformUtilsService.isEdge()?this.extensionUrl="https://microsoftedge.microsoft.com/addons/detail/jbkfoedolllekgbhcbcoahefnbanhhlh":this.extensionUrl="https://bitwarden.com/download/#downloads-web-browser"}navigateToExtension(){window.open(this.extensionUrl,"_blank")}}Wy.ɵfac=function(e){return new(e||Wy)(k.rXU(N.y),k.rXU(Le.m),k.rXU(fi.G),k.rXU($y),k.rXU(L.Di))},Wy.ɵcmp=k.VBU({type:Wy,selectors:[["app-vault-onboarding"]],inputs:{ciphers:"ciphers",orgs:"orgs"},outputs:{onAddCipher:"onAddCipher"},features:[k.Jv_([{provide:$y,useClass:Dy}]),k.OA$],decls:2,vars:3,consts:[["class","tw-mb-6",4,"ngIf"],[1,"tw-mb-6"],[3,"title","dismiss",4,"ngIf"],[3,"dismiss","title"],[3,"title","completed","isDisabled"],["icon","bwi-import",3,"title","route","completed"],[1,"tw-pl-1"],["type","button","bitLink","",3,"click"],["icon","bwi-cli","route","[]",3,"click","title","completed"]],template:function(e,t){1&e&&(k.DNE(0,Hy,2,1,"div",0),k.nI1(1,"async")),2&e&&k.Y8G("ngIf",k.bMT(1,1,t.isNewAccount&&t.showOnboarding&&t.onboardingTasks$))},dependencies:[xy,qy,By,Y.MD,Y.bT,re.p,ye.V,ke.o,Y.Jj,ae.$],encapsulation:2});var Jy=i(63098),Zy=i(81582),Qy=i(48180),eb=i(92411),tb=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const ib=["vaultFilter"],nb=["vaultItems"];function rb(e,t){if(1&e&&(k.j41(0,"bit-callout",13),k.EFF(1),k.k0s()),2&e){const e=k.XpG();k.R7$(),k.SpI(" ",e.trashCleanupWarning," ")}}function sb(e,t){1&e&&(k.j41(0,"bit-callout",14),k.nI1(1,"i18n"),k.j41(2,"p"),k.EFF(3),k.nI1(4,"i18n"),k.k0s(),k.j41(5,"a",15),k.EFF(6),k.nI1(7,"i18n"),k.k0s()()),2&e&&(k.Y8G("title",k.bMT(1,3,"premiumSubscriptionEnded")),k.R7$(3),k.JRh(k.bMT(4,5,"premiumSubscriptionEndedDesc")),k.R7$(3),k.JRh(k.bMT(7,7,"restartPremium")))}function ob(e,t){1&e&&(k.j41(0,"div",16),k.nrm(1,"i",17),k.nI1(2,"i18n"),k.j41(3,"span",18),k.EFF(4),k.nI1(5,"i18n"),k.k0s()()),2&e&&(k.R7$(),k.Y8G("title",k.mNQ(k.bMT(2,3,"loading"))),k.R7$(3),k.JRh(k.bMT(5,5,"loading")))}function ab(e,t){if(1&e){const e=k.RV6();k.j41(0,"button",23),k.bIt("click",function(){C.eBV(e);const t=k.XpG(2);return C.Njj(t.addCipher())}),k.nrm(1,"i",24),k.EFF(2),k.nI1(3,"i18n"),k.k0s()}2&e&&(k.R7$(2),k.SpI(" ",k.bMT(3,1,"newItem")," "))}function lb(e,t){if(1&e&&(k.j41(0,"div",16)(1,"bit-no-items",19),k.nI1(2,"async"),k.j41(3,"div",20),k.EFF(4),k.nI1(5,"async"),k.nI1(6,"i18n"),k.k0s(),k.j41(7,"p",21),k.EFF(8),k.nI1(9,"async"),k.nI1(10,"i18n"),k.k0s(),k.DNE(11,ab,4,3,"button",22),k.k0s()()),2&e){let e,t,i;const n=k.XpG();k.R7$(),k.Y8G("icon",null==(e=k.bMT(2,4,n.emptyState$))?null:e.icon),k.R7$(3),k.SpI(" ",k.bMT(6,8,null==(t=k.bMT(5,6,n.emptyState$))?null:t.title)," "),k.R7$(4),k.SpI(" ",k.bMT(10,12,null==(i=k.bMT(9,10,n.emptyState$))?null:i.description)," "),k.R7$(3),k.Y8G("ngIf",n.showAddCipherBtn)}}const cb="VaultComponent";class db{constructor(e,t,i,n,r,s,o,a,l,c,h,p,v,f,g,y,w,S,I,k,C,T,F,R,P,x,$,E,A,D,O,M,U,G,j,N,V){this.syncService=e,this.route=t,this.router=i,this.changeDetectorRef=n,this.i18nService=r,this.dialogService=s,this.messagingService=o,this.platformUtilsService=a,this.broadcasterService=l,this.ngZone=c,this.organizationService=h,this.vaultFilterService=p,this.routedVaultFilterService=v,this.routedVaultFilterBridgeService=f,this.cipherService=g,this.passwordRepromptService=y,this.collectionService=w,this.logService=S,this.totpService=I,this.eventCollectionService=k,this.searchService=C,this.searchPipe=T,this.apiService=F,this.billingAccountProfileStateService=R,this.toastService=P,this.accountService=x,this.cipherFormConfigService=$,this.billingApiService=E,this.restrictedItemTypesService=A,this.cipherArchiveService=D,this.organizationWarningsService=O,this.policyService=M,this.unifiedUpgradePromptService=U,this.premiumUpgradePromptService=G,this.autoConfirmService=j,this.configService=N,this.vaultItemTransferService=V,this.trashCleanupWarning=null,this.activeFilter=new ly.$,this.deactivatedOrgIcon=Ee,this.emptyTrashIcon=cg,this.favoritesIcon=dg,this.itemTypesIcon=ug,this.noResultsIcon=hg.a,this.performingInitialLoad=!0,this.refreshing=!1,this.processingEvent=!1,this.filter={},this.allOrganizations=[],this.canCreateCollections=!1,this.currentSearchText$=this.route.queryParams.pipe((0,m.T)(e=>e.search)),this.searchText$=new d.B,this.refresh$=new Fn.t(null),this.destroy$=new d.B,this.showAddCipherBtn=!1,this.organizations$=this.accountService.activeAccount$.pipe((0,m.T)(e=>null==e?void 0:e.id)).pipe((0,ft.n)(e=>this.organizationService.organizations$(e))),this.emptyState$=(0,Vr.z)([this.currentSearchText$,this.routedVaultFilterService.filter$,this.organizations$]).pipe((0,m.T)(([e,t,i])=>{const n=null==i?void 0:i.find(e=>e.id===t.organizationId);if(n&&!n.enabled)return this.showAddCipherBtn=!1,{title:"organizationIsSuspended",description:"organizationIsSuspendedDesc",icon:this.deactivatedOrgIcon};if(e)return{title:"noSearchResults",description:"clearFiltersOrTryAnother",icon:this.noResultsIcon};const r={trash:{title:"noItemsInTrash",description:"noItemsInTrashDesc",icon:this.emptyTrashIcon},favorites:{title:"emptyFavorites",description:"emptyFavoritesDesc",icon:this.favoritesIcon},archive:{title:"noItemsInArchive",description:"noItemsInArchiveDesc",icon:this.itemTypesIcon}};return(null==t?void 0:t.type)&&t.type in r?(this.showAddCipherBtn=!1,r[t.type]):(this.showAddCipherBtn=!0,{title:"noItemsInVault",description:"emptyVaultDescription",icon:this.itemTypesIcon})})),this.userId$=this.accountService.activeAccount$.pipe(b.F6),this.enforceOrgDataOwnershipPolicy$=this.userId$.pipe((0,ft.n)(e=>this.policyService.policyAppliesToUser$(ci.tt.OrganizationDataOwnership,e))),this.userCanArchive$=this.userId$.pipe((0,ft.n)(e=>this.cipherArchiveService.userCanArchive$(e))),this.showSubscriptionEndedMessaging$=this.userId$.pipe((0,ft.n)(e=>(0,Vr.z)([this.routedVaultFilterBridgeService.activeFilter$,this.cipherArchiveService.showSubscriptionEndedMessaging$(e)]).pipe((0,m.T)(([e,t])=>e.isArchived&&t)))),this.addFolder=()=>{js.px.open(this.dialogService)},this.editFolder=e=>tb(this,void 0,void 0,function*(){var t;const i=js.px.open(this.dialogService,{editFolderConfig:{folder:Object.assign(Object.assign({},e),{name:null!==(t=e.fullName)&&void 0!==t?t:e.name})}});(yield(0,oi.s)(i.closed))===js.np.Deleted&&(yield this.router.navigate([],{queryParams:{folderId:null},queryParamsHandling:"merge",replaceUrl:!0}))}),this.restore=e=>tb(this,void 0,void 0,function*(){if(bg.n.isDeleted(e))if(e.edit){if(yield this.repromptCipher([e]))try{const t=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.cipherService.restoreWithServer((0,pg.zw)(e.id),t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("restoredItem")}),this.refresh()}catch(t){this.logService.error(t)}}else this.showMissingPermissionsError()})}ngOnInit(){return tb(this,void 0,void 0,function*(){this.trashCleanupWarning=this.i18nService.t(this.platformUtilsService.isSelfHost()?"trashCleanupWarningSelfHosted":"trashCleanupWarning");const e=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),t=this.route.queryParams.pipe((0,ai.$)(),(0,ft.n)(e=>tb(this,void 0,void 0,function*(){yield this.syncService.fullSync(!1);const t=ub(e);if(!t)return;const i=new vg.f;i.id=t,"clone"===e.action?yield this.cloneCipher(i):"view"===e.action?yield this.viewCipher(i):"edit"===e.action&&(yield this.editCipher(i))})),(0,Jl.t)({refCount:!0,bufferSize:1}));this.broadcasterService.subscribe(cb,e=>{this.ngZone.run(()=>tb(this,void 0,void 0,function*(){if("syncCompleted"===e.command)e.successfully&&(this.refresh(),this.changeDetectorRef.detectChanges())}))}),this.routedVaultFilterBridgeService.activeFilter$.pipe((0,li.Q)(this.destroy$)).subscribe(e=>{this.activeFilter=e});const i=this.routedVaultFilterService.filter$,n=this.collectionService.decryptedCollections$(e),r=n.pipe((0,m.T)(e=>(0,ng.mw)(e)));this.searchText$.pipe((0,Rn.B)(yg.eM),(0,Wm.F)(),(0,li.Q)(this.destroy$)).subscribe(e=>this.router.navigate([],{queryParams:{search:Pn.A.isNullOrEmpty(e)?null:e},queryParamsHandling:"merge",replaceUrl:!0}));const s=this.cipherService.cipherListViews$(e).pipe((0,h.p)(e=>null!==e)),o=(0,Vr.z)([s,this.restrictedItemTypesService.restricted$]).pipe((0,m.T)(([e,t])=>e.filter(e=>!this.restrictedItemTypesService.isCipherRestricted(e,t)))),a=(0,Vr.z)([o,i,this.currentSearchText$,this.cipherArchiveService.hasArchiveFlagEnabled$]).pipe((0,h.p)(([e,t])=>null!=e&&null!=t),(0,Ip.H)(t=>tb(this,[t],void 0,function*([t,i,n,r]){var s;const o=null!==(s=yield(0,u._)(this.cipherService.failedToDecryptCiphers$(e)))&&void 0!==s?s:[],a=(0,oy.J)(i,r),l=[...o,...t];return(yield this.searchService.isSearchable(e,n))?yield this.searchService.searchCiphers(e,n,[a],l):t.filter(a)})),(0,Jl.t)({refCount:!0,bufferSize:1})),l=(0,Vr.z)([r,i,this.currentSearchText$]).pipe((0,h.p)(([e,t])=>null!=e&&null!=t),(0,Ip.H)(t=>tb(this,[t],void 0,function*([t,i,n]){var r;if(void 0===i.collectionId||i.collectionId===v.I_)return[];let s=[];if(void 0!==i.organizationId&&i.collectionId===ay.u)s=t.filter(e=>e.node.organizationId===i.organizationId);else if(i.collectionId===ay.u)s=t;else{const e=fg.F.getTreeNodeObjectFromList(t,i.collectionId);s=null!==(r=null==e?void 0:e.children)&&void 0!==r?r:[]}if(yield this.searchService.isSearchable(e,n)){const e=(0,ng.eO)(s);return this.searchPipe.transform(e,n,e=>e.name,e=>e.id)}return s.map(e=>e.node)})),(0,Jl.t)({refCount:!0,bufferSize:1})),c=(0,Vr.z)([r,i]).pipe((0,h.p)(([e,t])=>null!=e&&null!=t),(0,m.T)(([e,t])=>{if(void 0!==t.collectionId&&t.collectionId!==ay.u&&t.collectionId!==v.I_)return fg.F.getTreeNodeObjectFromList(e,t.collectionId)}),(0,Jl.t)({refCount:!0,bufferSize:1}));t.pipe((0,ft.n)(()=>this.route.queryParams),(0,h.p)(()=>null==this.vaultItemDialogRef),(0,ft.n)(t=>tb(this,void 0,void 0,function*(){const i=ub(t);if(i)if(yield this.cipherService.get(i,e)){let e=t.action;if(null==e&&(e="view"),"showFailedToDecrypt"==e)return js.Tp.open(this.dialogService,{cipherIds:[i]}),void(yield this.router.navigate([],{queryParams:{itemId:null,cipherId:null,action:null},queryParamsHandling:"merge",replaceUrl:!0}));"view"===e?yield this.viewCipherById(i):yield this.editCipherId(i)}else yield this.handleUnknownCipher()})),(0,li.Q)(this.destroy$)).subscribe(),t.pipe((0,ft.n)(()=>this.cipherService.failedToDecryptCiphers$(e)),(0,wg.w)(),(0,m.T)(e=>e.filter(e=>!e.isDeleted)),(0,h.p)(e=>e.length>0),(0,df.s)(1),(0,li.Q)(this.destroy$)).subscribe(e=>{js.Tp.open(this.dialogService,{cipherIds:e.map(e=>e.id)})}),this.organizations$.pipe((0,h.p)(e=>1===e.length),(0,m.T)(e=>e[0]),(0,ft.n)(e=>this.organizationWarningsService.showInactiveSubscriptionDialog$(e)),(0,li.Q)(this.destroy$)).subscribe(),t.pipe((0,ft.n)(()=>this.refresh$),(0,O.M)(()=>this.refreshing=!0),(0,ft.n)(()=>(0,Vr.z)([i,this.billingAccountProfileStateService.hasPremiumFromAnySource$(e),n,this.organizations$,a,l,c])),(0,li.Q)(this.destroy$)).subscribe(([e,t,i,n,r,s,o])=>{this.filter=e,this.canAccessPremium=t,this.allCollections=i,this.allOrganizations=n,this.ciphers=r,this.collections=s,this.selectedCollection=o,this.canCreateCollections=null==n?void 0:n.some(e=>e.canCreateNewCollections&&!e.isProviderUser),this.showBulkMove="trash"!==e.type,this.isEmpty=0===(null==s?void 0:s.length)&&0===(null==r?void 0:r.length),this.performingInitialLoad=!1,this.refreshing=!1,this.changeDetectorRef.markForCheck()}),this.unifiedUpgradePromptService.displayUpgradePromptConditionally(),this.setupAutoConfirm(),this.vaultItemTransferService.enforceOrganizationDataOwnership(e)})}ngOnDestroy(){this.broadcasterService.unsubscribe(cb),this.destroy$.next(),this.destroy$.complete(),this.vaultFilterService.clearOrganizationFilter()}onVaultItemsEvent(e){return tb(this,void 0,void 0,function*(){this.processingEvent=!0;try{switch(e.type){case"viewAttachments":yield this.editCipherAttachments(e.item);break;case"clone":yield this.cloneCipher(e.item);break;case"restore":1===e.items.length?yield this.restore(e.items[0]):yield this.bulkRestore(e.items);break;case"delete":yield this.handleDeleteEvent(e.items);break;case"moveToFolder":yield this.bulkMove(e.items);break;case"copyField":yield this.copy(e.item,e.field);break;case"editCollection":yield this.editCollection(e.item,sg._K.Info);break;case"viewCollectionAccess":yield this.editCollection(e.item,sg._K.Access);break;case"assignToCollections":yield this.bulkAssignToCollections(e.items);break;case"archive":1===e.items.length?yield this.archive(e.items[0]):yield this.bulkArchive(e.items);break;case"unarchive":1===e.items.length?yield this.unarchive(e.items[0]):yield this.bulkUnarchive(e.items);break;case"toggleFavorite":yield this.handleFavoriteEvent(e.item);break;case"editCipher":yield this.editCipher(e.item)}}finally{this.processingEvent=!1}})}handleUnknownCipher(){return tb(this,void 0,void 0,function*(){this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("unknownCipher")}),yield this.router.navigate([],{queryParams:{itemId:null,cipherId:null},queryParamsHandling:"merge"})})}archive(e){return tb(this,void 0,void 0,function*(){if(!(yield this.passwordRepromptService.passwordRepromptCheck(e)))return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"archiveItem"},content:{key:"archiveItemConfirmDesc"},type:"info"})))return;const t=yield(0,u._)(this.userId$);try{yield this.cipherArchiveService.archiveWithServer(e.id,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemWasSentToArchive")}),this.refresh()}catch(i){this.logService.error("Error archiving cipher",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}bulkArchive(e){return tb(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;if(!(yield this.dialogService.openSimpleDialog({title:{key:"archiveBulkItems"},content:{key:"archiveBulkItemsConfirmDesc"},type:"info"})))return;const t=yield(0,u._)(this.userId$),i=e.map(e=>e.id);try{yield this.cipherArchiveService.archiveWithServer(i,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemsWereSentToArchive")}),this.refresh()}catch(n){this.logService.error("Error archiving ciphers",n),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}unarchive(e){return tb(this,void 0,void 0,function*(){if(!(yield this.passwordRepromptService.passwordRepromptCheck(e)))return;const t=yield(0,u._)(this.userId$);try{yield this.cipherArchiveService.unarchiveWithServer(e.id,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("itemUnarchived")}),this.refresh()}catch(i){this.logService.error("Error unarchiving cipher",i),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}bulkUnarchive(e){return tb(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;const t=yield(0,u._)(this.userId$),i=e.map(e=>e.id);try{yield this.cipherArchiveService.unarchiveWithServer(i,t),this.toastService.showToast({variant:"success",message:this.i18nService.t("bulkUnarchiveItems")}),this.refresh()}catch(n){this.logService.error("Error unarchiving ciphers",n),this.toastService.showToast({variant:"error",message:this.i18nService.t("errorOccurred")})}})}applyOrganizationFilter(e){return tb(this,void 0,void 0,function*(){var t,i;null==e&&(e="MyVault");const n=yield(0,u._)(this.filterComponent.filters.organizationFilter.data$),r=fg.F.getTreeNodeObject(n,e);yield null===(i=null===(t=this.filterComponent.filters)||void 0===t?void 0:t.organizationFilter)||void 0===i?void 0:i.action(r)})}filterSearchText(e){this.searchText$.next(e)}editCipherAttachments(e){return tb(this,void 0,void 0,function*(){if(0!==(null==e?void 0:e.reprompt)&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void(yield this.go({cipherId:null,itemId:null}));if(null==e.organizationId&&!this.canAccessPremium)return void(yield this.premiumUpgradePromptService.promptForPremium());if(null!=e.organizationId){const t=yield(0,u._)(this.organizations$.pipe((0,g.Sw)((0,pg.zw)(e.organizationId))));if(null!=t&&(null==t.maxStorageGb||0===t.maxStorageGb))return void this.messagingService.send("upgradeOrganization",{organizationId:e.organizationId})}const t=js._A.open(this.dialogService,{cipherId:e.id,organizationId:e.organizationId}),i=yield(0,oi.s)(t.closed);i.action!==js.NY.Uploaded&&i.action!==js.NY.Removed||this.refresh()})}openVaultItemDialog(e,t,i){return tb(this,void 0,void 0,function*(){this.vaultItemDialogRef=$g.V.open(this.dialogService,{mode:e,formConfig:t,activeCollectionId:i,restore:this.restore});const n=yield(0,oi.s)(this.vaultItemDialogRef.closed);this.vaultItemDialogRef=void 0,n!==$g.r.PremiumUpgrade&&(n!==$g.r.Deleted&&n!==$g.r.Saved||this.refresh(),yield this.go({cipherId:null,itemId:null,action:null}))})}addCipher(e){return tb(this,void 0,void 0,function*(){var t;const i=null!=e?e:this.activeFilter.cipherType,n=yield this.cipherFormConfigService.buildConfig("add",null,i),r="AllCollections"!==this.activeFilter.collectionId&&null!=this.activeFilter.collectionId?this.activeFilter.collectionId:null;let s="MyVault"!==this.activeFilter.organizationId&&null!=this.activeFilter.organizationId?this.activeFilter.organizationId:null;if(r){const e=null===(t=(yield(0,u._)(this.vaultFilterService.filteredCollections$)).find(e=>e.id===this.activeFilter.collectionId))||void 0===t?void 0:t.organizationId;e&&(s=e)}n.initialValues={organizationId:s,collectionIds:[r],folderId:this.activeFilter.folderId},yield this.openVaultItemDialog("form",n)})}editCipher(e,t){return tb(this,void 0,void 0,function*(){return this.editCipherId((0,pg.zw)(null==e?void 0:e.id),t)})}editCipherId(e,t){return tb(this,void 0,void 0,function*(){const i=yield(0,u._)((0,b.F6)(this.accountService.activeAccount$)),n=yield this.cipherService.get(e,i);if(!n)return void(yield this.handleUnknownCipher());if(n&&0!==n.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void(yield this.go({cipherId:null,itemId:null,action:null}));const r=yield this.cipherFormConfigService.buildConfig(t?"clone":"edit",n.id,n.type);yield this.openVaultItemDialog("form",r)})}viewCipher(e){return this.viewCipherById(e.id)}viewCipherById(e){return tb(this,void 0,void 0,function*(){var t;const i=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6)),n=yield this.cipherService.get(e,i);if(!n)return void(yield this.handleUnknownCipher());if(n&&0!==n.reprompt&&!(yield this.passwordRepromptService.showPasswordPrompt()))return void(yield this.go({cipherId:null,itemId:null,action:null}));const r=yield this.cipherFormConfigService.buildConfig(n.edit?"edit":"partial-edit",n.id,n.type);yield this.openVaultItemDialog("view",r,null===(t=this.selectedCollection)||void 0===t?void 0:t.node.id)})}addCollection(){return tb(this,void 0,void 0,function*(){const e=(0,sg.jN)(this.dialogService,{data:{organizationId:this.allOrganizations.filter(e=>e.canCreateNewCollections&&!e.isProviderUser).sort(Pn.A.getSortFunction(this.i18nService,"name"))[0].id,parentCollectionId:this.filter.collectionId,showOrgSelector:!0,limitNestedCollections:!0}}),t=yield(0,oi.s)(e.closed);if(t.action===sg.RZ.Saved){if(t.collection){const e=new v.Fw(t.collection),i=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.collectionService.upsert(e,i)}this.refresh()}})}editCollection(e,t){return tb(this,void 0,void 0,function*(){var i,n,r;const s=(0,sg.jN)(this.dialogService,{data:{collectionId:null==e?void 0:e.id,organizationId:e.organizationId,initialTab:t,limitNestedCollections:!0}}),o=yield(0,oi.s)(s.closed),a=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));if(o.action===sg.RZ.Saved){if(o.collection){const e=new v.Fw(o.collection);yield this.collectionService.upsert(e,a)}this.refresh()}else if(o.action===sg.RZ.Deleted){const t=null===(i=this.selectedCollection)||void 0===i?void 0:i.parent,s=this.selectedCollection&&this.selectedCollection.node.id===e.id;yield this.collectionService.delete([null===(n=o.collection)||void 0===n?void 0:n.id],a),this.refresh(),s&&(yield this.router.navigate([],{queryParams:{collectionId:null!==(r=null==t?void 0:t.node.id)&&void 0!==r?r:null},queryParamsHandling:"merge",replaceUrl:!0}))}})}deleteCollection(e){return tb(this,void 0,void 0,function*(){var t,i;const n=yield(0,u._)(this.organizations$.pipe((0,g.Sw)(e.organizationId)));if(!e.canDelete(n))return void this.showMissingPermissionsError();if(yield this.dialogService.openSimpleDialog({title:e.name,content:{key:"deleteCollectionConfirmation"},type:"warning"}))try{const n=null===(t=this.selectedCollection)||void 0===t?void 0:t.parent,r=this.selectedCollection&&this.selectedCollection.node.id===e.id;yield this.apiService.deleteCollection(e.organizationId,e.id);const s=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.collectionService.delete([e.id],s),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("deletedCollectionId",e.name)}),r&&(yield this.router.navigate([],{queryParams:{collectionId:null!==(i=null==n?void 0:n.node.id)&&void 0!==i?i:null},queryParamsHandling:"merge",replaceUrl:!0})),this.refresh()}catch(r){this.logService.error(r)}})}bulkAssignToCollections(e){return tb(this,void 0,void 0,function*(){var t,i,n;if(!(yield this.repromptCipher(e)))return;if(0===e.length)return void this.toastService.showToast({variant:"error",title:this.i18nService.t("errorOccurred"),message:this.i18nService.t("nothingSelected")});let r=[];const s=this.activeFilter.organizationId||(null===(t=e.find(e=>null!==e.organizationId))||void 0===t?void 0:t.organizationId);if(s&&"MyVault"!==s){const e=this.allOrganizations.find(e=>e.id===s);r=this.allCollections.filter(t=>t.organizationId===e.id)}let o;if(e.some(bg.n.isCipherListView)){const t=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));o=yield(0,u._)(this.cipherService.cipherViews$(t).pipe((0,m.T)(t=>t.filter(t=>e.some(e=>e.id===t.id)))))}else o=e;const a=xg.G.open(this.dialogService,{data:{ciphers:o,organizationId:s,availableCollections:r,activeCollection:null===(n=null===(i=this.activeFilter)||void 0===i?void 0:i.selectedCollectionNode)||void 0===n?void 0:n.node}});(yield(0,oi.s)(a.closed))===js.f$.Saved&&this.refresh()})}cloneCipher(e){return tb(this,void 0,void 0,function*(){if(bg.n.hasFido2Credentials(e)){if(!(yield this.dialogService.openSimpleDialog({title:{key:"passkeyNotCopied"},content:{key:"passkeyNotCopiedAlert"},type:"info"})))return!1}yield this.editCipher(e,!0)})}bulkRestore(e){return tb(this,void 0,void 0,function*(){if(e.some(e=>!e.edit))return void this.showMissingPermissionsError();if(!(yield this.repromptCipher(e)))return;const t=e.map(e=>(0,pg.zw)(e.id));if(0===t.length)return void this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("nothingSelected")});const i=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.cipherService.restoreManyWithServer(t,i),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t("restoredItems")}),this.refresh()})}handleDeleteEvent(e){return tb(this,void 0,void 0,function*(){const t=e.filter(e=>void 0===e.collection).map(e=>e.cipher),i=e.filter(e=>void 0===e.cipher).map(e=>e.collection);if(1===t.length&&0===i.length)yield this.deleteCipher(t[0]);else if(0===t.length&&1===i.length)yield this.deleteCollection(i[0]);else{const n=e.filter(e=>void 0===e.cipher).map(e=>e.collection.organizationId),r=yield(0,u._)(this.organizations$.pipe((0,m.T)(e=>e.filter(e=>n.includes(e.id)))));yield this.bulkDelete(t,i,r)}})}deleteCipher(e){return tb(this,void 0,void 0,function*(){if(!(yield this.repromptCipher([e])))return;if(!e.edit)return void this.showMissingPermissionsError();const t=bg.n.isDeleted(e);if(!(yield this.dialogService.openSimpleDialog({title:{key:t?"permanentlyDeleteItem":"deleteItem"},content:{key:t?"permanentlyDeleteItemConfirmation":"deleteItemConfirmation"},type:"warning"})))return!1;try{const i=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6));yield this.deleteCipherWithServer((0,pg.zw)(e.id),i,t),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(t?"permanentlyDeletedItem":"deletedItem")}),this.refresh()}catch(i){this.logService.error(i)}})}bulkDelete(e,t,i){return tb(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;if(0===e.length&&0===t.length)return void this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("nothingSelected")});const n=null==t||t.every(e=>e.canDelete(i.find(t=>t.id==e.organizationId))),r=null==e||e.every(e=>e.edit);if(!n||!r)return void this.showMissingPermissionsError();const s=(0,Dg.Q0)(this.dialogService,{data:{permanent:"trash"===this.filter.type,cipherIds:e.map(e=>(0,pg.zw)(e.id)),organizations:i,collections:t}});(yield(0,oi.s)(s.closed))===Dg.vA.Deleted&&this.refresh()})}bulkMove(e){return tb(this,void 0,void 0,function*(){if(!(yield this.repromptCipher(e)))return;const t=e.map(e=>(0,pg.zw)(e.id));if(0===t.length)return void this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("nothingSelected")});const i=(n=this.dialogService,r={data:{cipherIds:t}},n.open(jg,r));var n,r;(yield(0,oi.s)(i.closed))===Ug&&this.refresh()})}copy(e,t){return tb(this,void 0,void 0,function*(){let i,n,r;const s=bg.n.getLogin(e);if(s||this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("unexpectedError")}),"username"===t)i="Username",n=s.username,r="username";else if("password"===t)i="Password",n=yield this.getPasswordFromCipherViewLike(e),r="password";else{if("totp"!==t)return void this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("unexpectedError")});i="TOTP";n=(yield(0,u._)(this.totpService.getCode$(s.totp))).code,r="verificationCodeTotp"}this.passwordRepromptService.protectedFields().includes(i)&&!(yield this.repromptCipher([e]))||e.viewPassword&&(this.platformUtilsService.copyToClipboard(n,{window}),this.toastService.showToast({variant:"info",title:null,message:this.i18nService.t("valueCopied",this.i18nService.t(r))}),"password"===t?yield this.eventCollectionService.collect(pe.Bx.Cipher_ClientCopiedPassword,(0,pg.zw)(e.id)):"totp"===t&&(yield this.eventCollectionService.collect(pe.Bx.Cipher_ClientCopiedHiddenField,(0,pg.zw)(e.id))))})}handleFavoriteEvent(e){return tb(this,void 0,void 0,function*(){const t=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6)),i=yield this.cipherService.getFullCipherView(e);i.favorite=!i.favorite;const n=yield this.cipherService.encrypt(i,t);yield this.cipherService.updateWithServer(n),this.toastService.showToast({variant:"success",title:null,message:this.i18nService.t(i.favorite?"itemAddedToFavorites":"itemRemovedFromFavorites")}),this.refresh()})}deleteCipherWithServer(e,t,i){return i?this.cipherService.deleteWithServer(e,t):this.cipherService.softDeleteWithServer(e,t)}repromptCipher(e){return tb(this,void 0,void 0,function*(){const t=!e.find(e=>e.reprompt!==mg.b.None);return t||(yield this.passwordRepromptService.showPasswordPrompt())})}refresh(){var e;this.refresh$.next(),null===(e=this.vaultItemsComponent)||void 0===e||e.clearSelection()}go(){return tb(this,arguments,void 0,function*(e=null){null==e&&(e={favorites:this.activeFilter.isFavorites||null,type:this.activeFilter.cipherType,folderId:this.activeFilter.folderId,collectionId:this.activeFilter.collectionId,deleted:this.activeFilter.isDeleted||null}),yield this.router.navigate([],{relativeTo:this.route,queryParams:e,queryParamsHandling:"merge",replaceUrl:!0})})}showMissingPermissionsError(){this.toastService.showToast({variant:"error",title:null,message:this.i18nService.t("missingPermissions")})}getPasswordFromCipherViewLike(e){return tb(this,void 0,void 0,function*(){var t,i;if(!bg.n.isCipherListView(e))return Promise.resolve(null===(t=e.login)||void 0===t?void 0:t.password);const n=yield(0,u._)(this.accountService.activeAccount$.pipe(b.F6)),r=yield this.cipherService.get((0,pg.zw)(e.id),n);return null===(i=(yield this.cipherService.decrypt(r,n)).login)||void 0===i?void 0:i.password})}openAutoConfirmFeatureDialog(e){return tb(this,void 0,void 0,function*(){this.autoConfirmDialogRef||(this.autoConfirmDialogRef=Pg.PI.open(this.dialogService,{data:{policy:new Pg.WS,organizationId:e.id,firstTimeDialog:!0}}),yield(0,oi.s)(this.autoConfirmDialogRef.closed),this.autoConfirmDialogRef=void 0)})}setupAutoConfirm(){const e=this.organizations$.pipe((0,m.T)(e=>e[0])),t=this.configService.getFeatureFlag$(M.TO.AutoConfirm),i=this.userId$.pipe((0,ft.n)(e=>this.autoConfirmService.configuration$(e))),n=(0,Vr.z)([this.userId$.pipe((0,ft.n)(e=>this.policyService.policies$(e)),(0,m.T)(e=>e.find(e=>e.type===ci.tt.AutoConfirm&&e.enabled))),e]).pipe((0,m.T)(([e,t])=>{var i;return null!==(i=e&&e.organizationId===(null==t?void 0:t.id))&&void 0!==i&&i}));(0,ag.y)([e,t,i,n,this.userId$]).pipe((0,ai.$)(),(0,ft.n)(e=>tb(this,[e],void 0,function*([e,t,i,n,r]){t&&!n&&i.showSetupDialog&&!!e&&e.canEnableAutoConfirmPolicy&&(yield this.openAutoConfirmFeatureDialog(e),yield this.autoConfirmService.upsert(r,Object.assign(Object.assign({},i),{showSetupDialog:!1})))})),(0,li.Q)(this.destroy$)).subscribe({error:e=>this.logService.error("Failed to update auto-confirm state",e)})}}db.ɵfac=function(e){return new(e||db)(k.rXU(Ue.H),k.rXU(x.nX),k.rXU(x.Ix),k.rXU(r.gRc),k.rXU(j.W),k.rXU(E.o3),k.rXU(fe.U),k.rXU(N.y),k.rXU(T.y),k.rXU(k.SKi),k.rXU(g.PV),k.rXU(Au.u),k.rXU(sy.B),k.rXU(ry.a),k.rXU(R.p),k.rXU(js.qX),k.rXU(v.YD),k.rXU(ve.K),k.rXU(Jy.R),k.rXU(Zy.c),k.rXU(V.S),k.rXU(lg.R),k.rXU(fi.G),k.rXU(Xr.Q),k.rXU($.f),k.rXU(L.Di),k.rXU(js.Ws),k.rXU(Qy.P),k.rXU(gg.b),k.rXU(eb.J),k.rXU(Rg.S),k.rXU(Le.m),k.rXU(Fg),k.rXU(Vs.l),k.rXU(v.zh),k.rXU(U.w),k.rXU(js.DL))},db.ɵcmp=k.VBU({type:db,selectors:[["app-vault"]],viewQuery:function(e,t){if(1&e&&(k.GBs(ib,7),k.GBs(nb,5)),2&e){let e;k.mGM(e=k.lsd())&&(t.filterComponent=e.first),k.mGM(e=k.lsd())&&(t.vaultItemsComponent=e.first)}},features:[k.Jv_([sy.B,ry.a,js.Ws,{provide:js.DL,useClass:js._8}])],decls:19,vars:40,consts:[["vaultFilter",""],["vaultItems",""],[3,"organizations"],[3,"onAddCipher","onAddCollection","onAddFolder","onEditCollection","onDeleteCollection","filter","loading","organizations","canCreateCollections","collection"],[3,"onAddCipher","ciphers","orgs"],[1,"tw-flex","tw-flex-row","-tw-mx-2.5"],[1,"tw-basis-1/4","tw-max-w-1/4","tw-px-2.5"],[3,"searchTextChanged","onEditFolder","activeFilter","searchText"],[1,"tw-basis-3/4","tw-max-w-3/4","tw-px-2.5"],["type","warning",4,"ngIf"],["type","info",3,"title",4,"ngIf"],[3,"onEvent","ciphers","collections","allCollections","allOrganizations","disabled","showOwner","showCollections","showGroups","showPremiumFeatures","showBulkMove","showBulkTrashOptions","useEvents","showAdminActions","showBulkAddToCollections","userCanArchive","enforceOrgDataOwnershipPolicy"],["class","tw-mt-6 tw-flex tw-h-full tw-flex-col tw-items-center tw-justify-start",4,"ngIf"],["type","warning"],["type","info",3,"title"],["routerLink","/settings/subscription/premium","bitButton","","buttonType","primary"],[1,"tw-mt-6","tw-flex","tw-h-full","tw-flex-col","tw-items-center","tw-justify-start"],["aria-hidden","true",1,"bwi","bwi-spinner","bwi-spin","tw-text-muted",3,"title"],[1,"tw-sr-only"],[3,"icon"],["slot","title"],["slot","description","bitTypography","body2",1,"tw-max-w-md","tw-text-center"],["type","button","buttonType","primary","bitButton","","slot","button",3,"click",4,"ngIf"],["type","button","buttonType","primary","bitButton","","slot","button",3,"click"],["aria-hidden","true",1,"bwi","bwi-plus","bwi-fw"]],template:function(e,t){if(1&e){const e=k.RV6();k.nrm(0,"app-vault-banners",2),k.nI1(1,"async"),k.j41(2,"app-vault-header",3),k.bIt("onAddCipher",function(i){return C.eBV(e),C.Njj(t.addCipher(i))})("onAddCollection",function(){return C.eBV(e),C.Njj(t.addCollection())})("onAddFolder",function(){return C.eBV(e),C.Njj(t.addFolder())})("onEditCollection",function(i){return C.eBV(e),C.Njj(t.editCollection(t.selectedCollection.node,i.tab))})("onDeleteCollection",function(){return C.eBV(e),C.Njj(t.deleteCollection(t.selectedCollection.node))}),k.k0s(),k.j41(3,"app-vault-onboarding",4),k.bIt("onAddCipher",function(i){return C.eBV(e),C.Njj(t.addCipher(i))}),k.k0s(),k.j41(4,"div",5)(5,"div",6)(6,"app-vault-filter",7,0),k.nI1(8,"async"),k.bIt("searchTextChanged",function(i){return C.eBV(e),C.Njj(t.filterSearchText(i))})("onEditFolder",function(i){return C.eBV(e),C.Njj(t.editFolder(i))}),k.k0s()(),k.j41(9,"div",8),k.DNE(10,rb,2,1,"bit-callout",9)(11,sb,8,9,"bit-callout",10),k.nI1(12,"async"),k.j41(13,"app-vault-items",11,1),k.nI1(15,"async"),k.nI1(16,"async"),k.bIt("onEvent",function(i){return C.eBV(e),C.Njj(t.onVaultItemsEvent(i))}),k.k0s(),k.DNE(17,ob,6,7,"div",12)(18,lb,12,14,"div",12),k.k0s()()}2&e&&(k.Y8G("organizations",k.bMT(1,30,t.organizations$)),k.R7$(2),k.Y8G("filter",t.filter)("loading",t.refreshing&&!t.performingInitialLoad)("organizations",t.allOrganizations)("canCreateCollections",t.canCreateCollections)("collection",t.selectedCollection),k.R7$(),k.Y8G("ciphers",t.ciphers)("orgs",t.allOrganizations),k.R7$(3),k.Y8G("activeFilter",t.activeFilter)("searchText",k.bMT(8,32,t.currentSearchText$)),k.R7$(4),k.Y8G("ngIf",t.activeFilter.isDeleted),k.R7$(),k.Y8G("ngIf",k.bMT(12,34,t.showSubscriptionEndedMessaging$)),k.R7$(2),k.Y8G("ciphers",t.ciphers)("collections",t.collections)("allCollections",t.allCollections)("allOrganizations",t.allOrganizations)("disabled",t.refreshing)("showOwner",!0)("showCollections",!1)("showGroups",!1)("showPremiumFeatures",t.canAccessPremium)("showBulkMove",t.showBulkMove)("showBulkTrashOptions","trash"===t.filter.type)("useEvents",!1)("showAdminActions",!1)("showBulkAddToCollections",!0)("userCanArchive",k.bMT(15,36,t.userCanArchive$))("enforceOrgDataOwnershipPolicy",k.bMT(16,38,t.enforceOrgDataOwnershipPolicy$)),k.R7$(4),k.Y8G("ngIf",t.performingInitialLoad),k.R7$(),k.Y8G("ngIf",t.isEmpty&&!t.performingInitialLoad))},dependencies:[Fy,Wy,iy,Ou,ny.C,Ag.l,Eg.W_,Zt.G,Y.bT,ne.Wk,oe.Q,Ge.G,Ov.D,Ce.r,$u.t,Y.Jj,ae.$],encapsulation:2});const ub=e=>e.itemId||e.cipherId,hb=[{path:"",component:db,data:{titleId:"vaults"}}];class pb{}pb.ɵfac=function(e){return new(e||pb)},pb.ɵmod=k.$C({type:pb}),pb.ɵinj=C.G2t({imports:[ne.iI.forChild(hb),ne.iI]});class mb{}mb.ɵfac=function(e){return new(e||mb)},mb.ɵmod=k.$C({type:mb}),mb.ɵinj=C.G2t({imports:[pb,Xd.t,rg.B,ng.KW,Yd.Y,mi.G,og,sg.GW,db]});const vb=[{path:"register",redirectTo:ce.SignUp,pathMatch:"full"},{path:"trial",redirectTo:ce.SignUp,pathMatch:"full"},{path:"",component:kd,data:{doNotSaveUrl:!0},children:[{path:"",pathMatch:"full",children:[],canActivate:[(0,de.EO)()]},{path:"verify-email",component:hl},{path:Gi.AcceptOrganizationInvite,canActivate:[(0,ji.i)()],component:Li,data:{titleId:"joinOrganization",doNotSaveUrl:!1}},{path:"accept-families-for-enterprise",component:si,canActivate:[(0,ji.i)()],data:{titleId:"acceptFamilySponsorship",doNotSaveUrl:!1}},{path:"recover",pathMatch:"full",redirectTo:Gi.RecoverTwoFactor},{path:"verify-recover-delete-org",component:ti,canActivate:[(0,de.Z6)()],data:{titleId:"deleteOrganization"}}]},{path:"",component:qt,children:[{path:ce.LoginWithPasskey,canActivate:[(0,de.Z6)()],data:{pageIcon:ue.s,titleId:"logInWithPasskey",pageTitle:{key:"logInWithPasskey"},pageSubtitle:{key:"readingPasskeyLoadingInfo"}},children:[{path:"",component:Pe},{path:"",component:jc,outlet:"environment-selector"}]},{path:ce.SignUp,canActivate:[(0,de.Z6)()],data:{pageIcon:it.R,pageTitle:{key:"createAccount"},titleId:"createAccount"},children:[{path:"",component:Ae.dz},{path:"",component:Ae.Xj,outlet:"secondary",data:{loginRoute:"/login"}}]},{path:ce.FinishSignUp,canActivate:[(0,de.Z6)()],data:{pageIcon:nt.X,titleId:"setAStrongPassword"},children:[{path:"",component:Ae.el}]},{path:ce.Login,canActivate:[(0,de.Z6)()],data:{pageTitle:{key:"logIn"},pageIcon:rt.E},children:[{path:"",component:Ae.XJ},{path:"",component:Ae.O_,outlet:"secondary"},{path:"",component:jc,outlet:"environment-selector"}]},{path:ce.LoginWithDevice,data:{pageIcon:st,pageTitle:{key:"logInRequestSent"},pageSubtitle:{key:"aNotificationWasSentToYourDevice"},titleId:"loginInitiated"},children:[{path:"",component:Ae.Mf},{path:"",component:jc,outlet:"environment-selector"}]},{path:ce.AdminApprovalRequested,data:{pageIcon:st,pageTitle:{key:"adminApprovalRequested"},pageSubtitle:{key:"adminApprovalRequestSentToAdmins"},titleId:"adminApprovalRequested"},children:[{path:"",component:Ae.Mf}]},{path:ce.PasswordHint,canActivate:[(0,de.Z6)()],data:{pageTitle:{key:"requestPasswordHint"},pageSubtitle:{key:"enterYourAccountEmailAddressAndYourPasswordHintWillBeSentToYou"},pageIcon:ot.u,state:"hint"},children:[{path:"",component:Ae.s7},{path:"",component:jc,outlet:"environment-selector"}]},{path:ce.LoginInitiated,canActivate:[(0,de.Xt)()],data:{pageIcon:st},children:[{path:"",component:Ae.K3}]},{path:"send/:sendId/:key",data:{pageTitle:{key:"viewSend"},showReadonlyHostname:!0,pageIcon:at},children:[{path:"",component:xu},{path:"",outlet:"secondary",component:Vp}]},{path:ce.SetInitialPassword,canActivate:[de.W_],component:Qe,data:{maxWidth:"lg",pageIcon:nt.X}},{path:Gi.SignUpLinkExpired,canActivate:[(0,de.Z6)()],data:{pageIcon:lt.c,pageTitle:{key:"expiredLink"}},children:[{path:"",component:Ae.MP,data:{loginRoute:`/${ce.Login}`}}]},{path:ce.Sso,canActivate:[(0,de.Z6)()],data:{pageTitle:{key:"singleSignOn"},titleId:"enterpriseSingleSignOn",pageSubtitle:{key:"singleSignOnEnterOrgIdentifierText"},pageIcon:ct},children:[{path:"",component:Ae.r0},{path:"",component:jc,outlet:"environment-selector"}]},{path:ce.TwoFactor,component:Ae.Yi,canActivate:[(0,de.Z6)(),Ae.lA],children:[{path:"",component:Ae.Yi},{path:"",component:jc,outlet:"environment-selector"}],data:{pageTitle:{key:"verifyYourIdentity"},pageIcon:null}},{path:"lock",canActivate:[(0,ji.i)(),(0,de.HG)()],children:[{path:"",component:_t.jN}],data:{pageTitle:{key:"yourVaultIsLockedV2"},pageIcon:nt.X,showReadonlyHostname:!0}},{path:ce.AuthenticationTimeout,canActivate:[(0,de.Z6)()],children:[{path:"",component:le},{path:"",component:jc,outlet:"environment-selector"}],data:{pageIcon:lt.c,pageTitle:{key:"authenticationTimeout"},titleId:"authenticationTimeout"}},{path:Gi.RecoverTwoFactor,canActivate:[(0,de.Z6)()],children:[{path:"",component:Zi},{path:"",component:jc,outlet:"environment-selector"}],data:{pageTitle:{key:"recoverAccountTwoStep"},titleId:"recoverAccountTwoStep",pageIcon:dt.m}},{path:ce.NewDeviceVerification,canActivate:[(0,de.Z6)(),(0,de.CV)()],children:[{path:"",component:Ae.l$}],data:{pageIcon:ut.f,pageTitle:{key:"verifyYourIdentity"},pageSubtitle:{key:"weDontRecognizeThisDevice"}}},{path:Gi.AcceptEmergencyAccessInvite,canActivate:[(0,ji.i)()],data:{pageTitle:{key:"emergencyAccess"},titleId:"acceptEmergency",doNotSaveUrl:!1,pageIcon:rt.E},children:[{path:"",loadComponent:()=>i.e(825).then(i.bind(i,33825)).then(e=>e.AcceptEmergencyComponent)}]},{path:Gi.RecoverDeleteAccount,canActivate:[(0,de.Z6)()],data:{pageTitle:{key:"deleteAccount"},titleId:"deleteAccount",pageIcon:ht},children:[{path:"",component:Hi},{path:"",component:jc,outlet:"environment-selector"}]},{path:Gi.VerifyRecoverDeleteAccount,canActivate:[(0,de.Z6)()],data:{pageTitle:{key:"deleteAccount"},titleId:"deleteAccount",pageIcon:ht},children:[{path:"",component:vl}]},{path:"remove-password",component:_t.jg,canActivate:[de.W_],data:{pageTitle:{key:"verifyYourOrganization"},titleId:"verifyYourOrganization",pageIcon:nt.X}},{path:"confirm-key-connector-domain",component:Sd,canActivate:[],data:{pageTitle:{key:"verifyYourOrganization"},titleId:"verifyYourOrganization",pageIcon:pt}},{path:"trial-initiation",canActivate:[(0,de.Z6)()],component:Ac,resolve:{pageTitle:Dc},data:{maxWidth:"3xl",pageIcon:mt}},{path:"secrets-manager-trial-initiation",canActivate:[(0,de.Z6)()],component:Ac,resolve:{pageTitle:Dc},data:{maxWidth:"3xl",pageIcon:mt}},{path:"browser-extension-prompt",data:{pageIcon:vt},children:[{path:"",component:Rf},{path:"",component:gf,outlet:"secondary"}]},{path:ce.ChangePassword,component:xe.h5,canActivate:[de.W_],data:{pageIcon:nt.X}},{path:"setup-extension",data:{hideCardWrapper:!0,pageIcon:null,maxWidth:"4xl"},children:[{path:"",component:ig}]}]},{path:"",component:Vd,canActivate:[(0,ji.i)(),de.W_],children:[{path:"vault",canActivate:[()=>Yt(void 0,void 0,void 0,function*(){const e=(0,C.WQX)(x.Ix),t=(0,C.WQX)(L.Di),i=(0,C.WQX)(Xt.a),n=(0,C.WQX)(ve.K);try{const n=yield(0,u._)(t.activeAccount$);if(!n)return e.createUrlTree(["/login"]);return!(yield i.getPremiumInterest(n.id))||e.createUrlTree(["/settings/subscription/premium"],{queryParams:{callToAction:"upgradeToPremium"}})}catch(r){return n.error("Error in premiumInterestRedirectGuard",r),!0}}),()=>Af(void 0,void 0,void 0,function*(){const e=(0,C.WQX)(x.Ix),t=(0,C.WQX)(L.Di),i=(0,C.WQX)(Ef.r),n=(0,C.WQX)(S.v2);if(Pn.A.isMobileBrowser)return!0;const r=yield(0,u._)(t.activeAccount$);if(!r)return e.createUrlTree(["/login"]);const s=yield(0,u._)(n.getUser(r.id,Df).state$.pipe((0,m.T)(e=>null!=e&&e))),o=yield function(e,t){return Af(this,void 0,void 0,function*(){return function(e){if(!e)return!1;const t=new Date(e).getTime(),i=(new Date).getTime()-t,n=864e5;return Math.round(i/n)>30}(yield e.getProfileCreationDate(t))})}(i,r.id).catch(()=>!0);return!(!s&&!o)||e.createUrlTree(["/setup-extension"])})],loadChildren:()=>mb},{path:"sends",component:nf,data:{titleId:"send"}},{path:"sm-landing",component:tp,data:{titleId:"moreProductsFromBitwarden"}},{path:"request-sm-access",component:Jh,data:{titleId:"requestAccessToSecretsManager"}},{path:"create-organization",component:Mi,data:{titleId:"newOrganization"}},{path:"settings",children:[{path:"",pathMatch:"full",redirectTo:Ui.Account},{path:Ui.Account,component:fr,data:{titleId:"myAccount"}},{path:"appearance",component:lp,canActivate:[tt(M.TO.ConsolidatedSessionTimeoutComponent,!0,"/settings/preferences",!1)],data:{titleId:"appearance"}},{path:"preferences",component:Up,canActivate:[tt(M.TO.ConsolidatedSessionTimeoutComponent,!1,"/settings/appearance",!1)],data:{titleId:"preferences"}},{path:"security",loadChildren:()=>cl},{path:"data-recovery",component:bd,canActivate:[tt(M.TO.DataRecoveryTool)],data:{titleId:"dataRecovery"}},{path:"domain-rules",component:Sp,data:{titleId:"domainRules"}},{path:"subscription",loadChildren:()=>Promise.all([i.e(281),i.e(453)]).then(i.bind(i,37453)).then(e=>e.IndividualBillingModule)},{path:Ui.EmergencyAccess,children:[{path:"",component:Gs,canActivate:[Wt(g.KP)],data:{titleId:"emergencyAccess"}},{path:":id",component:Qs,canActivate:[Wt(g.KP)],data:{titleId:"emergencyAccess"}}]},{path:"sponsored-families",component:El,data:{titleId:"sponsoredFamilies"}}]},{path:"tools",canActivate:[de.W_],children:[{path:"",pathMatch:"full",redirectTo:"generator"},{path:"import",loadComponent:()=>i.e(782).then(i.bind(i,74782)).then(e=>e.ImportWebComponent),data:{titleId:"import"}},{path:"export",loadComponent:()=>Promise.all([i.e(573),i.e(677)]).then(i.bind(i,47677)).then(e=>e.ExportWebComponent),data:{titleId:"export"}},{path:"generator",component:Np,data:{titleId:"generator"}}]},{path:"reports",loadChildren:()=>Nc.AX},{path:"setup/families-for-enterprise",component:$i}]},{path:"organizations",loadChildren:()=>i.e(155).then(i.bind(i,47155)).then(e=>e.OrganizationModule)}];class fb{}fb.ɵfac=function(e){return new(e||fb)},fb.ɵmod=k.$C({type:fb}),fb.ɵinj=C.G2t({imports:[ne.iI.forRoot(vb,{useHash:!0,paramsInheritanceStrategy:"always"}),ne.iI]});class gb{}gb.ɵfac=function(e){return new(e||gb)},gb.ɵmod=k.$C({type:gb}),gb.ɵinj=C.G2t({imports:[ne.iI.forChild([{path:"**",redirectTo:""}]),ne.iI]});class yb{}yb.ɵfac=function(e){return new(e||yb)},yb.ɵmod=k.$C({type:yb,bootstrap:[te]}),yb.ɵinj=C.G2t({imports:[qh,l.wb,a.YN,ie.Ui,s.ad,o.RH,fb,gb]}),(0,r.SmG)(),n.sG().bootstrapModule(yb)},96540:(e,t,i)=>{"use strict";i.d(t,{E:()=>n});class n{constructor(e){null!=e&&(this.privateKey=e.privateKey,this.publicKey=e.publicKey,this.keyFingerprint=e.keyFingerprint)}}},97212:(e,t,i)=>{"use strict";i.d(t,{A:()=>n,i:()=>r});class n{}function r(e){var t;return"Found"===e.exposed_result.type&&e.exposed_result.value>0||(null!==(t=e.reuse_count)&&void 0!==t?t:1)>1||e.password_strength<3}},97315:(e,t,i)=>{"use strict";i.d(t,{l:()=>m});class n{constructor(e){if(this.securityState=null,"object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("securityState"in e)||"string"!=typeof e.securityState)throw new TypeError("Response must contain a valid securityState");this.securityState=e.securityState}}var r=i(78781);class s{constructor(e){if(this.signedPublicKey=null,"object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("publicKey"in e)||"string"!=typeof e.publicKey)throw new TypeError("Response must contain a valid publicKey");if(this.publicKey=r.A.fromB64ToArray(e.publicKey),!("wrappedPrivateKey"in e)||"string"!=typeof e.wrappedPrivateKey)throw new TypeError("Response must contain a valid wrappedPrivateKey");this.wrappedPrivateKey=e.wrappedPrivateKey,"signedPublicKey"in e&&"string"==typeof e.signedPublicKey?this.signedPublicKey=e.signedPublicKey:this.signedPublicKey=null}}class o{constructor(e){if("object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("wrappedSigningKey"in e)||"string"!=typeof e.wrappedSigningKey)throw new TypeError("Response must contain a valid wrappedSigningKey");if(this.wrappedSigningKey=e.wrappedSigningKey,!("verifyingKey"in e)||"string"!=typeof e.verifyingKey)throw new TypeError("Response must contain a valid verifyingKey");this.verifyingKey=e.verifyingKey}}class a{constructor(e){if(this.signatureKeyPair=null,this.securityState=null,"object"!=typeof e||null==e)throw new TypeError("Response must be an object");if(!("publicKeyEncryptionKeyPair"in e)||"object"!=typeof e.publicKeyEncryptionKeyPair)throw new TypeError("Response must contain a valid publicKeyEncryptionKeyPair");if(this.publicKeyEncryptionKeyPair=new s(e.publicKeyEncryptionKeyPair),"signatureKeyPair"in e&&"object"==typeof e.signatureKeyPair&&null!=e.signatureKeyPair&&(this.signatureKeyPair=new o(e.signatureKeyPair)),"securityState"in e&&"object"==typeof e.securityState&&null!=e.securityState&&(this.securityState=new n(e.securityState)),null!==this.signatureKeyPair&&null===this.securityState||null===this.signatureKeyPair&&null!==this.securityState)throw new TypeError("Both signatureKeyPair and securityState must be present or absent together")}}var l=i(72868);class c extends l.C{constructor(e){super(e),this.keyConnectorEnabled=!1}}var d=i(20702),u=i(95919);class h extends d.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.key=this.getResponseProperty("Key"),this.status=this.getResponseProperty("Status"),this.type=this.getResponseProperty("Type"),this.enabled=this.getResponseProperty("Enabled"),this.permissions=new u.n(this.getResponseProperty("permissions")),this.userId=this.getResponseProperty("UserId"),this.useEvents=this.getResponseProperty("UseEvents"),this.providerStatus=this.getResponseProperty("ProviderStatus"),this.providerType=this.getResponseProperty("ProviderType")}}var p=i(39306);class m extends d.r{constructor(e){var t,i,n;super(e),this.accountKeys=null,this.organizations=[],this.providers=[],this.providerOrganizations=[],this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.email=this.getResponseProperty("Email"),this.emailVerified=this.getResponseProperty("EmailVerified"),this.premiumPersonally=this.getResponseProperty("Premium"),this.premiumFromOrganization=this.getResponseProperty("PremiumFromOrganization"),this.culture=this.getResponseProperty("Culture"),this.twoFactorEnabled=this.getResponseProperty("TwoFactorEnabled");const r=this.getResponseProperty("Key");r&&(this.key=new p.k(r)),null!=this.getResponseProperty("AccountKeys")&&(this.accountKeys=new a(this.getResponseProperty("AccountKeys"))),this.avatarColor=this.getResponseProperty("AvatarColor"),this.creationDate=this.getResponseProperty("CreationDate"),this.privateKey=this.getResponseProperty("PrivateKey"),this.securityStamp=this.getResponseProperty("SecurityStamp"),this.forcePasswordReset=null!==(t=this.getResponseProperty("ForcePasswordReset"))&&void 0!==t&&t,this.usesKeyConnector=null!==(i=this.getResponseProperty("UsesKeyConnector"))&&void 0!==i&&i,this.verifyDevices=null===(n=this.getResponseProperty("VerifyDevices"))||void 0===n||n;const s=this.getResponseProperty("Organizations");null!=s&&(this.organizations=s.map(e=>new l.C(e)));const o=this.getResponseProperty("Providers");null!=o&&(this.providers=o.map(e=>new h(e)));const d=this.getResponseProperty("ProviderOrganizations");null!=d&&(this.providerOrganizations=d.map(e=>new c(e)))}}},97432:(e,t,i)=>{"use strict";i.d(t,{j:()=>l,w:()=>c});var n=i(83892),r=i(99969),s=i(69194),o=i(3204),a=i(27442);function l(e,t=void 0){const i=new Map;return l=>{let c=i.get(l);return c||(null!=t||(t=r.w),c=(0,n.h)(e(l),t.pipe((0,s.p)(e=>e===l||null===e),(0,o.T)(()=>null))).pipe((0,a.t)({bufferSize:1,refCount:!1})),i.set(l,c)),c}}function c(){return(0,s.p)(e=>null!=e)}},97434:(e,t,i)=>{"use strict";i.d(t,{m:()=>o});var n=i(25065),r=i(74208),s=i(33812);class o{}o.ɵfac=function(e){return new(e||o)},o.ɵmod=s.$C({type:o}),o.ɵinj=r.G2t({imports:[n.G]})},97440:(e,t,i)=>{"use strict";i.d(t,{bZ:()=>s,j8:()=>r});const n="\\"+["/","-","."," "].join("\\").replace(" ","s"),r=(new RegExp(`[${n}]`,"g"),new RegExp(`[^\\d${n}]`,"g"),new RegExp("^(([1]{1}[0-2]{1})|(0?[1-9]{1}))$"),new RegExp("^2[0-1]{1}\\d{2}$"),{Never:null,TenSeconds:10,TwentySeconds:20,ThirtySeconds:30,OneMinute:60,TwoMinutes:120,FiveMinutes:300}),s={Off:0,OnButtonClick:1,OnFieldFocus:2}},97445:(e,t,i)=>{"use strict";i.d(t,{p:()=>y});var n=i(21991),r=i(72737),s=i(44500),o=i(69514),a=i(30082),l=i(3204),c=i(24999),d=i(7222),u=i(14803),h=i(20377),p=i(9764);class m{}var v=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class f extends m{constructor(e,t,i,n){super(),this.organizationId=e,this.encryptService=t,this.key=i,this.dataPacker=n,this.assertHasValue("organizationId",e),this.assertHasValue("key",i),this.assertHasValue("dataPacker",n),this.assertHasValue("encryptService",t)}encrypt(e){return v(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=this.dataPacker.pack(e);const i=yield this.encryptService.encryptString(t,this.key);return t=null,i})}decrypt(e){return v(this,void 0,void 0,function*(){this.assertHasValue("secret",e);let t=yield this.encryptService.decryptString(e,this.key);const i=this.dataPacker.unpack(t);return t=null,i})}assertHasValue(e,t){if(null==t)throw new Error(`${e} cannot be null or undefined`)}}var g=i(22327);class y{constructor(e,t){this.encryptService=e,this.keyService=t}userEncryptor$(e,t){const i=new p.n(e);return t.singleUserId$.pipe((0,h.eO)(e=>e,(e,t)=>({expectedUserId:e,actualUserId:t})),(0,n.N)(e=>{const t=new r.m(1);return e.subscribe(t),t.pipe((0,s.n)(e=>this.keyService.userKey$(e).pipe((0,o.j)(e=>!e),(0,a.v)(e=>!!e),(0,l.T)(t=>{const n=new g.f(e,this.encryptService,t,i);return{userId:e,encryptor:n}}),(0,c.O)())),(0,d.Z)(),(0,u.Q)((0,h.E)(t)))}))}organizationEncryptor$(e,t){const i=new p.n(e);return t.singleOrganizationId$.pipe((0,h.eO)(e=>e.userId,(e,t)=>({expectedUserId:e,actualUserId:t})),(0,h.eO)(e=>e.organizationId,(e,t)=>({expectedOrganizationId:e,actualOrganizationId:t})),(0,n.N)(e=>{const t=new r.m(1);return e.subscribe(t),t.pipe((0,s.n)(e=>this.keyService.orgKeys$(e.userId).pipe((0,o.j)(e=>!e),(0,a.v)(e=>!!e),(0,l.T)(t=>{const n=e.organizationId,r=t[n];return{organizationId:n,encryptor:new f(n,this.encryptService,r,i)}}),(0,c.O)())),(0,d.Z)(),(0,u.Q)((0,h.E)(t)))}))}}},97553:(e,t,i)=>{"use strict";i.d(t,{J:()=>d,V:()=>c});var n=i(94573),r=i(51757),s=i(22949),o=i(33812),a=i(43759);let l=0;function c(e){return["tw-border","!tw-border-solid",e?"tw-border-danger-600":"tw-border-secondary-500","focus:tw-outline-none"]}class d{classList(){const e=["tw-block","tw-w-full","tw-h-full","tw-px-1","tw-text-main","tw-placeholder-text-muted","tw-bg-background","tw-border-none","focus:tw-outline-none","[&:is(input,textarea):disabled]:tw-bg-secondary-100"];return null===this.parentFormField&&e.push(...c(this.hasError),...this.standaloneInputClasses),e.filter(e=>""!=e)}get ariaInvalid(){return!!this.hasError||void 0}get required(){var e,t,i,n;return null!==(n=null!==(e=this._required)&&void 0!==e?e:null===(i=null===(t=this.ngControl)||void 0===t?void 0:t.control)||void 0===i?void 0:i.hasValidator(r.k0.required))&&void 0!==n&&n}set required(e){this._required=null!=e&&!1!==e}get labelForId(){return this.id()}onInput(){var e,t;null===(t=null===(e=this.ngControl)||void 0===e?void 0:e.control)||void 0===t||t.markAsUntouched()}get hasError(){var e,t,i,n,r,s;return this.showErrorsWhenDisabled()?!("INVALID"!==(null===(e=this.ngControl)||void 0===e?void 0:e.status)&&"DISABLED"!==(null===(t=this.ngControl)||void 0===t?void 0:t.status)||!(null===(i=this.ngControl)||void 0===i?void 0:i.touched)||null==(null===(n=this.ngControl)||void 0===n?void 0:n.errors)):!("INVALID"!==(null===(r=this.ngControl)||void 0===r?void 0:r.status)||!(null===(s=this.ngControl)||void 0===s?void 0:s.touched))}get error(){var e;const t=null!==(e=this.ngControl.errors)&&void 0!==e?e:{},i=Object.keys(t)[0];return[i,t[i]]}constructor(e,t,i,r){this.ngControl=e,this.ngZone=t,this.elementRef=i,this.parentFormField=r,this.id=(0,n.hFB)("bit-input-"+l++),this.type=(0,n.geq)(),this.spellcheck=(0,n.geq)(),this.hasPrefix=(0,n.hFB)(!1),this.hasSuffix=(0,n.hFB)(!1),this.showErrorsWhenDisabled=(0,n.hFB)(!1)}focus(){this.ngZone.runOutsideAngular(()=>{const e=this.elementRef.nativeElement.value.length;this.elementRef.nativeElement.setSelectionRange(e,e),this.elementRef.nativeElement.focus()})}get readOnly(){return this.elementRef.nativeElement.readOnly}get standaloneInputClasses(){return["tw-px-3","tw-py-2","tw-rounded-lg",this.hasError?"hover:tw-border-danger-700":"hover:tw-border-primary-600","focus:hover:tw-border-primary-600","disabled:tw-bg-secondary-100","disabled:hover:tw-border-secondary-500","focus:tw-border-primary-600","focus:tw-ring-1","focus:tw-ring-inset","focus:tw-ring-primary-600","focus:tw-z-10"]}}d.ɵfac=function(e){return new(e||d)(o.rXU(r.vO,10),o.rXU(o.SKi),o.rXU(o.aKT),o.rXU(a.h,8))},d.ɵdir=o.FsC({type:d,selectors:[["input","bitInput",""],["select","bitInput",""],["textarea","bitInput",""]],hostVars:8,hostBindings:function(e,t){1&e&&o.bIt("input",function(){return t.onInput()}),2&e&&(o.Avn("id",t.id())("required",t.required),o.BMQ("type",t.type())("spellcheck",t.spellcheck())("aria-describedby",t.ariaDescribedBy)("aria-invalid",t.ariaInvalid),o.HbH(t.classList()))},inputs:{id:[1,"id"],type:[1,"type"],spellcheck:[1,"spellcheck"],required:"required",hasPrefix:[1,"hasPrefix"],hasSuffix:[1,"hasSuffix"],showErrorsWhenDisabled:[1,"showErrorsWhenDisabled"]},outputs:{type:"typeChange",spellcheck:"spellcheckChange"},features:[o.Jv_([{provide:s.p,useExisting:d}])]})},97560:(e,t,i)=>{"use strict";i.d(t,{T:()=>p});var n=i(74208),r=i(94573),s=i(83731),o=i(6056),a=i(39200),l=i(33812),c=i(39805);const d=["rla"],u=["*",[["","slot","end"]]],h=()=>({focusMainAfterNav:!1});class p{onKeyDown(e){"Space"===e.code&&this.tabItem().click()}get active(){var e,t;return null!==(t=null===(e=this.routerLinkActive())||void 0===e?void 0:e.isActive)&&void 0!==t&&t}constructor(e){this._tabNavBar=e,this.destroyRef=(0,n.WQX)(n.abz),this.tabItem=r.ebz.required(a.y),this.routerLinkActive=r.ebz.required("rla"),this.routerLinkMatchOptions={queryParams:"ignored",matrixParams:"ignored",paths:"subset",fragment:"ignored"},this.route=(0,r.hFB)(),this.disabled=!1}focus(){this.tabItem().focus()}ngAfterViewInit(){this.routerLinkActive().isActiveChange.pipe((0,s.pQ)(this.destroyRef)).subscribe(e=>this._tabNavBar.updateActiveLink())}}p.ɵfac=function(e){return new(e||p)(l.rXU(c.J))},p.ɵcmp=l.VBU({type:p,selectors:[["bit-tab-link"]],viewQuery:function(e,t){1&e&&(l.wEZ(t.tabItem,a.y,5),l.wEZ(t.routerLinkActive,d,5)),2&e&&l.NyB(2)},hostBindings:function(e,t){1&e&&l.bIt("keydown",function(e){return t.onKeyDown(e)})},inputs:{route:[1,"route"],disabled:"disabled"},ngContentSelectors:["*","[slot=end]"],decls:6,vars:7,consts:[["rla","routerLinkActive"],["bitTabListItem","","routerLinkActive","","ariaCurrentWhenActive","page","role","link",1,"tw-flex","tw-group/tab","hover:tw-no-underline",3,"routerLink","routerLinkActiveOptions","active","info","disabled"],[1,"group-hover/tab:tw-underline"],[1,"tw-font-normal","tw-ms-2","empty:tw-ms-0"]],template:function(e,t){if(1&e&&(l.NAR(u),l.j41(0,"a",1,0)(2,"div",2),l.SdG(3),l.k0s(),l.j41(4,"div",3),l.SdG(5,1),l.k0s()()),2&e){const e=l.sdS(1);l.Y8G("routerLink",t.disabled?null:t.route())("routerLinkActiveOptions",t.routerLinkMatchOptions)("active",e.isActive)("info",l.lJ4(6,h))("disabled",t.disabled),l.BMQ("aria-disabled",t.disabled)}},dependencies:[a.y,o.iI,o.Wk,o.wQ],encapsulation:2})},97741:(e,t,i)=>{"use strict";i.d(t,{bf:()=>Gt,Bd:()=>s,RI:()=>n,H7:()=>jt,UN:()=>Et,XM:()=>$t,Tt:()=>o});class n{}var r=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class s{constructor(e){this.apiService=e}postImportCiphers(e){return r(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/ciphers/import",e,!0,!1)})}postImportOrganizationCiphers(e,t){return r(this,void 0,void 0,function*(){return yield this.apiService.send("POST","/ciphers/import-organization?organizationId="+e,t,!0,!1)})}}class o{}var a=i(72245),l=i(3204),c=i(28202),d=i(3633);class u{constructor(){this.ciphers=[],this.folders=[],this.folderRelationships=[]}}class h{constructor(){this.ciphers=[],this.collections=[],this.collectionRelationships=[]}}class p{constructor(e,t){this.key=e,this.value=t}}var m=i(7861),v=i(78781),f=i(31442),g=i(45113),y=i(89177),b=i(78078);class w{constructor(){this.success=!1,this.ciphers=[],this.folders=[],this.folderRelationships=[],this.collections=[],this.collectionRelationships=[]}}var S=i(98869),I=i(39907),k=i(62627),C=i(75751),T=i(11766),F=i(16671),R=i(14093),P=i(86346);class x{constructor(){this.organizationId=null,this.logService=new k.V(!1),this.newLineRegex=/(?:\r\n|\r|\n)/,this.passwordFieldNames=["password","pass word","passphrase","pass phrase","pass","code","code word","codeword","secret","secret word","personpwd","key","keyword","key word","keyphrase","key phrase","form_pw","wppassword","pin","pwd","pw","pword","passwd","p","serial","serial#","license key","reg #","passwort"],this.usernameFieldNames=["user","name","user name","username","login name","email","e-mail","id","userid","user id","login","form_loginname","wpname","mail","loginid","login id","log","personlogin","first name","last name","card#","account #","member","member #","nom","benutzername"],this.notesFieldNames=["note","notes","comment","comments","memo","description","free form","freeform","free text","freetext","free","kommentar"],this.uriFieldNames=["url","hyper link","hyperlink","link","host","hostname","host name","server","address","hyper ref","href","web","website","web site","site","web-site","uri","ort","adresse"],this.parseCsvOptions={encoding:"UTF-8",skipEmptyLines:!1}}get organization(){return null!=this.organizationId}parseXml(e){if(!this.validateNoExternalEntities(e))return null;const t=(new DOMParser).parseFromString(e,"application/xml");return null!=t&&null==t.querySelector("parsererror")?t:null}parseCsv(e,t,i={}){const n=Object.assign({header:t},this.parseCsvOptions,i);e=this.splitNewLine(e).join("\n").trim();const r=S.parse(e,n);return null!=r.errors&&r.errors.length>0&&r.errors.forEach(e=>{null!=e.row&&this.logService.warning("Error parsing row "+e.row+": "+e.message)}),r.data&&r.data.length>0?r.data:null}parseSingleRowCsv(e){if(this.isNullOrWhitespace(e))return null;const t=this.parseCsv(e,!1);return null!=t&&t.length>0&&t[0].length>0?t[0]:null}makeUriArray(e){if(null==e)return null;if("string"==typeof e){const t=new F.z;return t.uri=this.fixUri(e),this.isNullOrWhitespace(t.uri)?null:[t]}if(e.length>0){const t=[];return e.forEach(e=>{const i=new F.z;i.uri=this.fixUri(e),this.isNullOrWhitespace(i.uri)||t.push(i)}),0===t.length?null:t}return null}fixUri(e){return null==e?null:(-1===(e=e.trim()).indexOf("://")&&e.indexOf(".")>=0&&(e="http://"+e),e.length>1e3?e.substring(0,1e3):e)}nameFromUrl(e){const t=v.A.getHostname(e);return this.isNullOrWhitespace(t)?null:t.startsWith("www.")?t.replace("www.",""):t}isNullOrWhitespace(e){return v.A.isNullOrWhitespace(e)}getValueOrDefault(e,t=null){return this.isNullOrWhitespace(e)?t:e}splitNewLine(e){return e.split(this.newLineRegex)}setCardExpiration(e,t){if(this.isNullOrWhitespace(t))return!1;t=t.replace(/\s/g,"");const i=new RegExp("^0?(?<month>[1-9]|1[0-2])/(?<year>(?:[1-2][0-9])?[0-9]{2})$"),n=t.match(i);if(!n)return!1;e.card.expMonth=n.groups.month;const r=n.groups.year;return e.card.expYear=(0,I.jd)(r),!0}moveFoldersToCollections(e){e.folderRelationships.forEach(t=>e.collectionRelationships.push(t)),e.collections=e.folders.map(e=>new c.iY({name:e.name,organizationId:this.organizationId,id:c.pM.isCollectionId(e.id)?e.id:null})),e.folderRelationships=[],e.folders=[]}querySelectorDirectChild(e,t){const i=this.querySelectorAllDirectChild(e,t);return 0===i.length?null:i[0]}querySelectorAllDirectChild(e,t){return Array.from(e.querySelectorAll(t)).filter(t=>t.parentNode===e)}initLoginCipher(){const e=new C.f;return e.favorite=!1,e.notes="",e.fields=[],e.login=new R.r,e.type=f.gC.Login,e}cleanupCipher(e){null!=e&&(e.type!==f.gC.Login&&(e.login=null),this.isNullOrWhitespace(e.name)&&(e.name="--"),this.isNullOrWhitespace(e.notes)?e.notes=null:e.notes=e.notes.trim())}processKvp(e,t,i,n=f.PU.Text){if(!this.isNullOrWhitespace(i))if(this.isNullOrWhitespace(t)&&(t=""),i.length>200||i.trim().search(this.newLineRegex)>-1)null==e.notes&&(e.notes=""),e.notes+=t+": "+this.splitNewLine(i).join("\n")+"\n";else{null==e.fields&&(e.fields=[]);const r=new T.g;r.type=n,r.name=t,r.value=i,e.fields.push(r)}}processFolder(e,t,i=!0){if(this.isNullOrWhitespace(t))return;let n=e.folders.length;t=t.replace(/\\/g,"/");let r=!0;for(let o=0;o<e.folders.length;o++)if(e.folders[o].name===t){r=!1,n=o;break}if(r){const i=new b.u;i.name=t,e.folders.push(i)}i&&e.folderRelationships.push([e.ciphers.length,n]);const s=t.split("/");for(let o=s.length-1;o>0;o--){const t=s.slice(0,o).join("/");if(null==e.folders.find(e=>e.name===t)){const i=new b.u;i.name=t,e.folders.push(i)}}}convertToNoteIfNeeded(e){e.type===f.gC.Login&&this.isNullOrWhitespace(e.login.username)&&this.isNullOrWhitespace(e.login.password)&&(null==e.login.uris||0===e.login.uris.length)&&(e.type=f.gC.SecureNote,e.secureNote=new P.Z,e.secureNote.type=f.ak.Generic)}processFullName(e,t){if(this.isNullOrWhitespace(t))return;const i=t.split(" ");i.length>0&&(e.identity.firstName=this.getValueOrDefault(i[0])),2===i.length?e.identity.lastName=this.getValueOrDefault(i[1]):i.length>=3&&(e.identity.middleName=this.getValueOrDefault(i[1]),e.identity.lastName=i.slice(2,i.length).join(" "))}validateNoExternalEntities(e){return!new RegExp("<!ENTITY","i").test(e)}}class $ extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(e.length<2)return;const i=this.initLoginCipher();if(i.notes=this.getValueOrDefault(e[e.length-1]),i.name=this.getValueOrDefault(e[0],"--"),e.length>2&&e.length%2==0)for(let t=0;t<e.length-2;t+=2){const n=e[t+2],r=e[t+1];if(this.isNullOrWhitespace(n)||this.isNullOrWhitespace(r))continue;const s=r.toLowerCase();null==i.login.password&&this.passwordFieldNames.indexOf(s)>-1?i.login.password=this.getValueOrDefault(n):null==i.login.username&&this.usernameFieldNames.indexOf(s)>-1?i.login.username=this.getValueOrDefault(n):(null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(s)>-1?i.login.uris=this.makeUriArray(n):this.processKvp(i,r,n)}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class E extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.name),i.login.uris=this.makeUriArray(e.web),i.login.password=this.getValueOrDefault(e.password),i.login.username=this.getValueOrDefault(e.login),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}var A=i(6528);class D extends x{parse(e){const t=new w,i=JSON.parse(e);return null==i?(t.success=!1,Promise.resolve(t)):(null!=i.logins&&i.logins.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.custName),i.notes=this.getValueOrDefault(e.note),i.login.uris=this.makeUriArray(e.url),i.login.password=this.getValueOrDefault(e.pwd),i.login.username=this.getValueOrDefault(e.loginName),this.cleanupCipher(i),t.ciphers.push(i)}),null!=i.notes&&i.notes.forEach(e=>{const i=this.initLoginCipher();i.type=f.gC.SecureNote,i.secureNote.type=f.ak.Generic,i.name=this.getValueOrDefault(e.label),i.notes=this.getValueOrDefault(e.text),this.cleanupCipher(i),t.ciphers.push(i)}),null!=i.cards&&i.cards.forEach(e=>{const i=this.initLoginCipher();i.type=f.gC.Card,i.name=this.getValueOrDefault(e.custName),i.notes=this.getValueOrDefault(e.note),i.card.cardholderName=this.getValueOrDefault(e.holderName),i.card.number=this.getValueOrDefault(e.cardNumber),i.card.code=this.getValueOrDefault(e.cvv),i.card.brand=A.G.getCardBrandByPatterns(i.card.number),null!=e.expirationDate&&(null!=e.expirationDate.month&&(i.card.expMonth=e.expirationDate.month+""),null!=e.expirationDate.year&&(i.card.expYear=e.expirationDate.year+"")),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class O extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.name,this.getValueOrDefault(this.nameFromUrl(e.website),"--")),i.login.uris=this.makeUriArray(e.website),i.login.password=this.getValueOrDefault(e.password),this.isNullOrWhitespace(e.username)&&!this.isNullOrWhitespace(e.secondary_username)?i.login.username=e.secondary_username:(i.login.username=this.getValueOrDefault(e.username),i.notes=this.getValueOrDefault(e.secondary_username)),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class M extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if("list"===e.grouping)return;const i=this.initLoginCipher();i.favorite="1"===e.fav,i.name=this.getValueOrDefault(e.name),i.notes=this.getValueOrDefault(e.extra),"note"!==e.grouping&&(i.login.uris=this.makeUriArray(e.url),i.login.password=this.getValueOrDefault(e.password),i.login.username=this.getValueOrDefault(e.username)),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class U extends x{constructor(){super(...arguments),this.androidPatternRegex=new RegExp("^android:\\/\\/.*(?<=@)(.*)(?=\\/)")}normalizeAndroidUrl(e){const t=null==e?void 0:e.match(this.androidPatternRegex);return t?`androidapp://${t[1]}`:e}parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher(),n=this.normalizeAndroidUrl(e.url);let r=e.name;!r&&this.androidPatternRegex.test(e.url)&&(r=e.url.match(this.androidPatternRegex)[1]),i.name=this.getValueOrDefault(r,"--"),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(n),i.notes=this.getValueOrDefault(e.note),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}var G=i(36501);class j extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(this.organization&&!this.isNullOrWhitespace(e.collections)){e.collections.split(",").forEach(e=>{this.processFolder(t,e)})}else this.organization||this.processFolder(t,e.folder);const i=new C.f;i.favorite=!this.organization&&"0"!==this.getValueOrDefault(e.favorite,"0"),i.type=f.gC.Login,i.notes=this.getValueOrDefault(e.notes),i.name=this.getValueOrDefault(e.name,"--");try{i.reprompt=parseInt(this.getValueOrDefault(e.reprompt,G.b.None.toString()),10)}catch(n){console.error("Unable to parse reprompt value",n),i.reprompt=G.b.None}if(!this.isNullOrWhitespace(e.fields)){const t=this.splitNewLine(e.fields);for(let e=0;e<t.length;e++){if(this.isNullOrWhitespace(t[e]))continue;const n=t[e].lastIndexOf(": ");if(-1===n)continue;null==i.fields&&(i.fields=[]);const r=new T.g;r.name=t[e].substr(0,n),r.value=null,r.type=f.PU.Text,t[e].length>n+2&&(r.value=t[e].substr(n+2)),i.fields.push(r)}}switch(null!=e.type?e.type.toLowerCase():null){case"note":i.type=f.gC.SecureNote,i.secureNote=new P.Z,i.secureNote.type=f.ak.Generic;break;default:{i.type=f.gC.Login,i.login=new R.r,i.login.totp=this.getValueOrDefault(e.login_totp||e.totp),i.login.username=this.getValueOrDefault(e.login_username||e.username),i.login.password=this.getValueOrDefault(e.login_password||e.password);const t=this.parseSingleRowCsv(e.login_uri||e.uri);i.login.uris=this.makeUriArray(t);break}}t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}var N=i(69194),V=i(39306),B=i(56455),z=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class L extends x{constructor(e,t,i,n,r){super(),this.keyService=e,this.encryptService=t,this.i18nService=i,this.cipherService=n,this.accountService=r}parse(e){return z(this,void 0,void 0,function*(){const t=yield(0,a._)(this.accountService.activeAccount$);this.result=new w;const i=JSON.parse(e);return null==i||null==i.items?(this.result.success=!1,this.result):(i.encrypted?yield this.parseEncrypted(i,t.id):yield this.parseDecrypted(i,t.id),this.result)})}parseEncrypted(e,t){return z(this,void 0,void 0,function*(){if(null!=e.encKeyValidation_DO_NOT_EDIT){const i=yield(0,a._)(this.keyService.orgKeys$(t));let r=null==i?void 0:i[this.organizationId];null==r&&(r=yield(0,a._)(this.keyService.userKey$(t)));const s=new V.k(e.encKeyValidation_DO_NOT_EDIT);try{yield this.encryptService.decryptString(s,r)}catch(n){return this.result.success=!1,void(this.result.errorMessage=this.i18nService.t("importEncKeyError"))}}const i=this.organization?yield this.parseCollections(e,t):yield this.parseFolders(e,t);for(const r of e.items){const e=B.pU.toDomain(r);e.id=null,e.organizationId=this.organizationId,e.collectionIds=null,null!=e.passwordHistory&&e.passwordHistory.length>5&&(e.passwordHistory=e.passwordHistory.slice(0,5)),!this.organization&&null!=r.folderId&&i.has(r.folderId)?this.result.folderRelationships.push([this.result.ciphers.length,i.get(r.folderId)]):this.organization&&null!=r.collectionIds&&r.collectionIds.forEach(e=>{i.has(e)&&this.result.collectionRelationships.push([this.result.ciphers.length,i.get(e)])});const n=yield this.cipherService.decrypt(e,t);this.cleanupCipher(n),this.result.ciphers.push(n)}this.result.success=!0})}parseDecrypted(e,t){return z(this,void 0,void 0,function*(){const i=this.organization?yield this.parseCollections(e,t):yield this.parseFolders(e,t);e.items.forEach(e=>{const t=B.pU.toView(e);t.id=null,t.organizationId=null,t.collectionIds=null,null!=t.passwordHistory&&t.passwordHistory.length>5&&(t.passwordHistory=t.passwordHistory.slice(0,5)),!this.organization&&null!=e.folderId&&i.has(e.folderId)?this.result.folderRelationships.push([this.result.ciphers.length,i.get(e.folderId)]):this.organization&&null!=e.collectionIds&&e.collectionIds.forEach(e=>{i.has(e)&&this.result.collectionRelationships.push([this.result.ciphers.length,i.get(e)])}),this.cleanupCipher(t),this.result.ciphers.push(t)}),this.result.success=!0})}parseFolders(e,t){return z(this,void 0,void 0,function*(){if(null==e.folders)return null;const i=yield(0,a._)(this.keyService.userKey$(t)),n=new Map;for(const t of e.folders){let r;if(e.encrypted){const e=B.wG.toDomain(t);null!=e&&(r=yield e.decrypt(i))}else r=B.wG.toView(t);null!=r&&(n.set(t.id,this.result.folders.length),this.result.folders.push(r))}return n})}parseCollections(e,t){return z(this,void 0,void 0,function*(){if(null==e.collections)return null;const i=yield(0,a._)(this.keyService.orgKeys$(t).pipe((0,N.p)(e=>null!=e))),n=new Map;for(const t of e.collections){let r;if(e.encrypted){const e=B.MA.toDomain(t,new c.pM({id:t.id,name:new V.k(t.name),organizationId:this.organizationId})),n=i[t.organizationId];r=yield e.decrypt(n,this.encryptService)}else r=B.MA.toView(t),r.organizationId=null;null!=r&&(n.set(t.id,this.result.collections.length),this.result.collections.push(r))}return n})}}var K=i(22848),q=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class _ extends L{constructor(e,t,i,n,r,s,o){super(e,t,i,n,s),this.keyGenerationService=r,this.promptForPassword_callback=o}parse(e){const t=Object.create(null,{parse:{get:()=>super.parse}});return q(this,void 0,void 0,function*(){const i=new w,n=JSON.parse(e);if(!n)return i.success=!1,i;if(!(null==n?void 0:n.encrypted))return yield t.parse.call(this,e);if(!(null==n?void 0:n.passwordProtected))return yield t.parse.call(this,e);if(this.cannotParseFile(n))return i.success=!1,i;const r=yield this.promptForPassword_callback();if(!(yield this.checkPassword(n,r)))return i.success=!1,i.errorMessage=this.i18nService.t("invalidFilePassword"),i;const s=new V.k(n.data),o=yield this.encryptService.decryptString(s,this.key);return yield t.parse.call(this,o)})}checkPassword(e,t){return q(this,void 0,void 0,function*(){if(this.isNullOrWhitespace(t))return!1;const i=e.kdfType===K.ao.PBKDF2_SHA256?new K.n1(e.kdfIterations):new K.hU(e.kdfIterations,e.kdfMemory,e.kdfParallelism);this.key=yield this.keyGenerationService.deriveVaultExportKey(t,e.salt,i);const n=new V.k(e.encKeyValidation_DO_NOT_EDIT);try{return yield this.encryptService.decryptString(n,this.key),!0}catch(r){return!1}})}cannotParseFile(e){return!(e&&e.encrypted&&e.passwordProtected&&e.salt&&e.kdfIterations&&"number"==typeof e.kdfIterations&&null!=e.kdfType&&null!=K.ao[e.kdfType]&&e.encKeyValidation_DO_NOT_EDIT&&e.data)}}class X extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{"null"===e.label&&(e.label=null);const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.label,this.getValueOrDefault(this.nameFromUrl(e.domain),"--")),i.login.uris=this.makeUriArray(e.domain),i.login.password=this.getValueOrDefault(e.password),this.isNullOrWhitespace(e.email)&&!this.isNullOrWhitespace(e.username)?i.login.username=e.username:(i.login.username=this.getValueOrDefault(e.email),i.notes=this.getValueOrDefault(e.username)),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}const Y=["!group_id","!group_name","title","username","password","URL","id"];class H extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{this.processFolder(t,this.getValueOrDefault(e["!group_name"]));const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.title,"--"),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.URL);let n=!1;for(const t in e)e.hasOwnProperty(t)&&(n||-1!==Y.indexOf(t)||(n=!0),n&&this.processKvp(i,t,e[t]));this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class W extends x{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelector("textarea");if(null==n||this.isNullOrWhitespace(n.textContent))return t.errorMessage="Missing textarea.",t.success=!1,Promise.resolve(t);return JSON.parse(n.textContent).forEach(e=>{const i=this.initLoginCipher();if(this.isNullOrWhitespace(e.label)||(i.name=e.label.split(" ")[0]),null==e.data||this.isNullOrWhitespace(e.data.notes)||(i.notes=e.data.notes.split("\\n").join("\n")),null!=e.currentVersion&&null!=e.currentVersion.fields)for(const t in e.currentVersion.fields){if(!e.currentVersion.fields.hasOwnProperty(t))continue;const n=e.currentVersion.fields[t];switch(null!=n.actionType?n.actionType.toLowerCase():null){case"password":i.login.password=this.getValueOrDefault(n.value);break;case"email":case"username":case"user":case"name":i.login.username=this.getValueOrDefault(n.value);break;case"url":i.login.uris=this.makeUriArray(n.value);break;default:{const e=null!=n.label?n.label.toLowerCase():null;null==i.login.password&&this.passwordFieldNames.indexOf(e)>-1?i.login.password=this.getValueOrDefault(n.value):null==i.login.username&&this.usernameFieldNames.indexOf(e)>-1?i.login.username=this.getValueOrDefault(n.value):(null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(e)>-1?i.login.uris=this.makeUriArray(n.value):this.processKvp(i,n.label,n.value);break}}}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t)}}class J extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{this.processFolder(t,this.getValueOrDefault(e.Category));const i=this.initLoginCipher();i.favorite="True"===this.getValueOrDefault(e.Favorite),i.name=this.getValueOrDefault(e.Entry,"--"),i.notes=this.getValueOrDefault(e.Note),i.login.username=this.getValueOrDefault(e.Username,e.Email),i.login.password=this.getValueOrDefault(e.Password),i.login.totp=this.getValueOrDefault(e.TOTP),i.login.uris=this.makeUriArray(e.Website),this.isNullOrWhitespace(e.Username)||this.processKvp(i,"Email",e.Email),this.processKvp(i,"Phone",e.Phone),this.processKvp(i,"PIN",e.PIN),this.processKvp(i,"Account",e.Account),this.processKvp(i,"Date",e.Date),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}var Z=i(67036);const Q=new Set(["title","note","username","password","url","otpSecret","category"]),ee=new Set(["type","title","first_name","middle_name","last_name","login","email","phone_number","address","country","state","city","zip","item_name"]),te=new Set(["title","note"]);class ie extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);if(null==i)return t.success=!1,Promise.resolve(t);if(null!=i[0].type&&null!=i[0].title){if(1===i.filter(e=>"name"===e.type).length){const e=this.initLoginCipher();return e.type=f.gC.Identity,e.identity=new Z.O,i.forEach(t=>{this.parsePersonalInformationRecordAsIdentity(e,t)}),this.cleanupCipher(e),t.ciphers.push(e),t.success=!0,Promise.resolve(t)}}return i.forEach(e=>{const i=this.initLoginCipher(),n=Object.keys(e);"username"===n[0]&&(this.processFolder(t,e.category),this.parseCredentialsRecord(i,e)),"type"===n[0]&&"account_name"===n[1]&&this.parsePaymentRecord(i,e),"type"===n[0]&&"number"===n[1]&&this.parseIdRecord(i,e),"type"===n[0]&&"title"===n[1]&&this.parsePersonalInformationRecord(i,e),"title"===n[0]&&"note"===n[1]&&this.parseSecureNoteRecords(i,e),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}parseCredentialsRecord(e,t){e.type=f.gC.Login,e.login=new R.r,e.name=t.title,e.notes=t.note,e.login.username=t.username,e.login.password=t.password,e.login.totp=Object.keys(t).includes("otpUrl")?t.otpUrl:t.otpSecret,e.login.uris=this.makeUriArray(t.url),this.importUnmappedFields(e,t,Q)}parsePaymentRecord(e,t){e.type=f.gC.Card,e.card=new A.G,e.name=t.account_name;let i=[];switch(t.type){case"credit_card":e.card.cardholderName=t.account_name,e.card.number=t.cc_number,e.card.brand=A.G.getCardBrandByPatterns(e.card.number),e.card.code=t.code,this.setCardExpiration(e,`${t.expiration_month}/${t.expiration_year}`),i=["account_name","account_holder","cc_number","code","expiration_month","expiration_year"];break;case"bank":e.card.cardholderName=t.account_holder,e.card.number=t.account_number,i=["account_name","account_holder","account_number"]}this.importUnmappedFields(e,t,new Set(i))}parseIdRecord(e,t){e.type=f.gC.Identity,e.identity=new Z.O;const i=["name","number"];switch(t.type){case"card":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.licenseNumber=t.number;break;case"passport":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.passportNumber=t.number;break;case"license":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.licenseNumber=t.number,e.identity.state=t.state,i.push("state");break;case"social_security":e.name=`${t.name} ${t.type}`,this.processFullName(e,t.name),e.identity.ssn=t.number;break;case"tax_number":e.name=t.type,e.identity.licenseNumber=t.number}this.importUnmappedFields(e,t,new Set(i))}parsePersonalInformationRecord(e,t){e.type=f.gC.SecureNote,e.secureNote.type=f.ak.Generic,"name"===t.type?e.name=`${t.title} ${t.first_name} ${t.middle_name} ${t.last_name}`.replace("  "," ").trim():e.name=t.item_name;const i=t;Object.keys(t).forEach(t=>{this.processKvp(e,t,i[t])})}parsePersonalInformationRecordAsIdentity(e,t){switch(t.type){case"name":this.processFullName(e,`${t.first_name} ${t.middle_name} ${t.last_name}`),e.identity.title=t.title,e.name=e.identity.fullName,e.identity.username=t.login;break;case"email":e.identity.email=t.email;break;case"number":e.identity.phone=t.phone_number;break;case"address":e.identity.address1=t.address,e.identity.city=t.city,e.identity.postalCode=t.zip,e.identity.state=t.state,e.identity.country=t.country}this.importUnmappedFields(e,t,ee)}parseSecureNoteRecords(e,t){e.type=f.gC.SecureNote,e.secureNote.type=f.ak.Generic,e.name=t.title,e.notes=t.note,this.importUnmappedFields(e,t,te)}importUnmappedFields(e,t,i){Object.keys(t).filter(e=>!i.has(e)).forEach(i=>{const n=t;this.processKvp(e,i,n[i])})}}const ne=new Set(["ADDRESS","AUTHENTIFIANT","BANKSTATEMENT","IDCARD","IDENTITY","PAYMENTMEANS_CREDITCARD","PAYMENTMEAN_PAYPAL","EMAIL"]);class re extends x{parse(e){this.result=new w;const t=JSON.parse(e);if(null==t||0===t.length)return this.result.success=!1,Promise.resolve(this.result);null!=t.ADDRESS&&this.processAddress(t.ADDRESS),null!=t.AUTHENTIFIANT&&this.processAuth(t.AUTHENTIFIANT),null!=t.BANKSTATEMENT&&this.processNote(t.BANKSTATEMENT,"BankAccountName"),null!=t.IDCARD&&this.processNote(t.IDCARD,"Fullname"),null!=t.PAYMENTMEANS_CREDITCARD&&this.processCard(t.PAYMENTMEANS_CREDITCARD),null!=t.IDENTITY&&this.processIdentity(t.IDENTITY);for(const i in t)t.hasOwnProperty(i)&&!ne.has(i)&&this.processNote(t[i],null,"Generic Note");return this.result.success=!0,Promise.resolve(this.result)}processAuth(e){e.forEach(e=>{const t=this.initLoginCipher();t.name=this.getValueOrDefault(e.title),t.login.username=this.getValueOrDefault(e.login,this.getValueOrDefault(e.secondaryLogin)),this.isNullOrWhitespace(t.login.username)?t.login.username=this.getValueOrDefault(e.email):this.isNullOrWhitespace(e.email)||(t.notes="Email: "+e.email+"\n"),t.login.password=this.getValueOrDefault(e.password),t.login.uris=this.makeUriArray(e.domain),t.notes+=this.getValueOrDefault(e.note,""),this.convertToNoteIfNeeded(t),this.cleanupCipher(t),this.result.ciphers.push(t)})}processIdentity(e){e.forEach(e=>{const t=new C.f;t.identity=new Z.O,t.type=f.gC.Identity,t.name=this.getValueOrDefault(e.fullName,"");const i=t.name.split(" ");i.length>0&&(t.identity.firstName=this.getValueOrDefault(i[0])),2===i.length?t.identity.lastName=this.getValueOrDefault(i[1]):3===i.length&&(t.identity.middleName=this.getValueOrDefault(i[1]),t.identity.lastName=this.getValueOrDefault(i[2])),t.identity.username=this.getValueOrDefault(e.pseudo),this.cleanupCipher(t),this.result.ciphers.push(t)})}processAddress(e){e.forEach(e=>{const t=new C.f;t.identity=new Z.O,t.type=f.gC.Identity,t.name=this.getValueOrDefault(e.addressName),t.identity.address1=this.getValueOrDefault(e.addressFull),t.identity.city=this.getValueOrDefault(e.city),t.identity.state=this.getValueOrDefault(e.state),t.identity.postalCode=this.getValueOrDefault(e.zipcode),t.identity.country=this.getValueOrDefault(e.country),null!=t.identity.country&&(t.identity.country=t.identity.country.toUpperCase()),this.cleanupCipher(t),this.result.ciphers.push(t)})}processCard(e){e.forEach(e=>{const t=new C.f;t.card=new A.G,t.type=f.gC.Card,t.name=this.getValueOrDefault(e.bank),t.card.number=this.getValueOrDefault(e.cardNumber),t.card.brand=A.G.getCardBrandByPatterns(t.card.number),t.card.cardholderName=this.getValueOrDefault(e.owner),this.isNullOrWhitespace(t.card.brand)||(this.isNullOrWhitespace(t.name)?t.name=t.card.brand:t.name+=" - "+t.card.brand),this.cleanupCipher(t),this.result.ciphers.push(t)})}processNote(e,t,i=null){e.forEach(e=>{const n=new C.f;n.secureNote=new P.Z,n.type=f.gC.SecureNote,n.secureNote.type=f.ak.Generic,n.name=null!=i?i:this.getValueOrDefault(e[t]);for(const i in e)e.hasOwnProperty(i)&&i!==t&&this.processKvp(n,i,e[i].toString());this.cleanupCipher(n),this.result.ciphers.push(n)})}}class se extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.Label,"--"),i.notes=this.getValueOrDefault(e.Notes);const n=this.getValueOrDefault(e.Text);this.isNullOrWhitespace(n)||(this.isNullOrWhitespace(i.notes)?i.notes=n:i.notes+="\n\n"+n);const r=e["Entry Type"];if("Password"===r)i.login.username=this.getValueOrDefault(e.Username),i.login.password=this.getValueOrDefault(e.Password),i.login.uris=this.makeUriArray(e["Site URL"]);else if("Credit Card"===r){i.type=f.gC.Card,i.card=new A.G,i.card.cardholderName=this.getValueOrDefault(e["Name on card"]),i.card.number=this.getValueOrDefault(e["Card Number"]),i.card.brand=A.G.getCardBrandByPatterns(i.card.number),i.card.code=this.getValueOrDefault(e.CVV);const t=this.getValueOrDefault(e.Expiry);if(!this.isNullOrWhitespace(t)){const e=t.split("/");e.length>1&&(i.card.expMonth=parseInt(e[0],null).toString(),i.card.expYear=(2e3+parseInt(e[1],null)).toString())}}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class oe extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);if(null==i)return t.success=!1,Promise.resolve(t);let n=!0;return i.forEach(e=>{if(e.length<2||n&&("Title"===e[0]||"title"===e[0]))return void(n=!1);const i=this.initLoginCipher();if(i.notes=this.getValueOrDefault(e[e.length-1]),i.name=this.getValueOrDefault(e[0],"--"),2!==e.length&&(this.containsField(e,"username")||this.containsField(e,"password")||this.containsField(e,"email")||this.containsField(e,"url"))||(i.type=f.gC.SecureNote,i.secureNote=new P.Z,i.secureNote.type=f.ak.Generic),this.containsField(e,"cardholder")&&this.containsField(e,"number")&&this.containsField(e,"expiry date")&&(i.type=f.gC.Card,i.card=new A.G),e.length>2&&e.length%2==0)for(let t=0;t<e.length-2;t+=2){const n=e[t+2];if(this.isNullOrWhitespace(n))continue;const r=e[t+1],s=r.toLowerCase();if(i.type===f.gC.Login){if("url"===s&&(null==i.login.uris||0===i.login.uris.length)){i.login.uris=this.makeUriArray(n);continue}if(("username"===s||"email"===s)&&this.isNullOrWhitespace(i.login.username)){i.login.username=n;continue}if("password"===s&&this.isNullOrWhitespace(i.login.password)){i.login.password=n;continue}if("totp"===s&&this.isNullOrWhitespace(i.login.totp)){i.login.totp=n;continue}}else if(i.type===f.gC.Card){if("cardholder"===s&&this.isNullOrWhitespace(i.card.cardholderName)){i.card.cardholderName=n;continue}if("number"===s&&this.isNullOrWhitespace(i.card.number)){i.card.number=n,i.card.brand=A.G.getCardBrandByPatterns(i.card.number);continue}if("cvc"===s&&this.isNullOrWhitespace(i.card.code)){i.card.code=n;continue}if("expiry date"===s&&this.isNullOrWhitespace(i.card.expMonth)&&this.isNullOrWhitespace(i.card.expYear)){if(this.setCardExpiration(i,n))continue}else if("type"===s)continue}this.processKvp(i,r,n)}this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t)}containsField(e,t){return null!=e&&null!=t&&e.filter(e=>!this.isNullOrWhitespace(e)&&e.toLowerCase()===t.toLowerCase()).length>0}}const ae=new RegExp("androidapp://.*==@","g");class le extends x{parse(e){const t=new w,i=JSON.parse(e);if(null==i||null==i.items||0===i.items.length)return t.success=!1,Promise.resolve(t);const n=new Map,r=new Map,s=this.buildFolderTree(i.folders);return this.flattenFolderTree(null,s,n),n.forEach((e,i)=>{r.set(i,t.folders.length);const n=new b.u;n.name=e,t.folders.push(n)}),i.items.forEach(e=>{null!=e.folders&&e.folders.length>0&&r.has(e.folders[0])&&t.folderRelationships.push([t.ciphers.length,r.get(e.folders[0])]);const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.title),i.favorite=e.favorite>0,null!=e.template_type&&null!=e.fields&&e.fields.length>0&&(0===e.template_type.indexOf("login.")||0===e.template_type.indexOf("password.")?this.processLogin(i,e.fields):0===e.template_type.indexOf("creditcard.")?this.processCard(i,e.fields):e.template_type.indexOf("identity.")<0&&e.fields.some(e=>"password"===e.type&&!this.isNullOrWhitespace(e.value))?this.processLogin(i,e.fields):this.processNote(i,e.fields)),i.notes+="\n"+this.getValueOrDefault(e.note,""),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t)}processLogin(e,t){const i=[];t.forEach(t=>{if(!this.isNullOrWhitespace(t.value)&&"section"!==t.type)if("username"!==t.type&&"email"!==t.type||!this.isNullOrWhitespace(e.login.username))if("password"===t.type&&this.isNullOrWhitespace(e.login.password))e.login.password=t.value;else if("totp"===t.type&&this.isNullOrWhitespace(e.login.totp))e.login.totp=t.value;else if("url"===t.type)i.push(t.value);else if(".Android#"===t.type){let e=t.value.startsWith("androidapp://")?t.value:"androidapp://"+t.value;e=e.replace("android://",""),e=e.replace(ae,"androidapp://"),i.push(e)}else this.processKvp(e,t.label,t.value,1===t.sensitive?f.PU.Hidden:f.PU.Text);else e.login.username=t.value}),e.login.uris=this.makeUriArray(i)}processCard(e,t){e.card=new A.G,e.type=f.gC.Card,t.forEach(t=>{this.isNullOrWhitespace(t.value)||"section"===t.type||"ccType"===t.type||("ccName"===t.type&&this.isNullOrWhitespace(e.card.cardholderName)?e.card.cardholderName=t.value:"ccNumber"===t.type&&this.isNullOrWhitespace(e.card.number)?(e.card.number=t.value,e.card.brand=A.G.getCardBrandByPatterns(e.card.number)):"ccCvc"===t.type&&this.isNullOrWhitespace(e.card.code)?e.card.code=t.value:"ccExpiry"===t.type&&this.isNullOrWhitespace(e.card.expYear)&&this.setCardExpiration(e,t.value)||this.processKvp(e,t.label,t.value,1===t.sensitive?f.PU.Hidden:f.PU.Text))})}processNote(e,t){t.forEach(t=>{this.isNullOrWhitespace(t.value)||"section"===t.type||this.processKvp(e,t.label,t.value,1===t.sensitive?f.PU.Hidden:f.PU.Text)})}buildFolderTree(e){if(null==e)return[];const t=[],i=new Map([]);return e.forEach(e=>{i.set(e.uuid,e),e.children=[]}),e.forEach(e=>{null!=e.parent_uuid&&""!==e.parent_uuid&&i.has(e.parent_uuid)?i.get(e.parent_uuid).children.push(e):t.push(e)}),t}flattenFolderTree(e,t,i){null!=t&&t.forEach(t=>{if(null!=t.title&&""!==t.title.trim()){let n=t.title.trim();null!=e&&""!==e.trim()&&(n=e+"/"+n),i.set(t.uuid,n),null!=t.children&&0!==t.children.length&&this.flattenFolderTree(n,t.children,i)}})}}class ce extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.filter(e=>"chrome://FirefoxAccounts"!==e.url).forEach(e=>{const i=this.initLoginCipher(),n=this.getValueOrDefault(e.url,this.getValueOrDefault(e.hostname));i.name=this.getValueOrDefault(this.nameFromUrl(n),"--"),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(n),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}const de=Object.freeze({Login:1,CreditCard:2});class ue extends x{parse(e){const t=new w,i=JSON.parse(e);if(null==i||null==i.data)return t.success=!1,Promise.resolve(t);for(const[,n]of Object.entries(i.data)){const e=this.parseEntry(n);null!=e&&t.ciphers.push(e)}return t.success=!0,Promise.resolve(t)}parseEntry(e){const t=this.initLoginCipher();switch(t.name=this.getValueOrDefault(e.service),t.notes=this.getValueOrDefault(e.notes),t.favorite=e.favorite>0,e.type){case de.Login:this.handleLoginEntry(e,t);break;case de.CreditCard:this.handleCreditCardEntry(e,t);break;default:return}return this.convertToNoteIfNeeded(t),this.cleanupCipher(t),t}handleLoginEntry(e,t){t.login.username=this.getValueOrDefault(e.username),t.login.password=this.getValueOrDefault(e.password),t.login.uris=this.makeUriArray(e.url)}handleCreditCardEntry(e,t){t.type=f.gC.Card,t.card=new A.G,t.card.cardholderName=this.getValueOrDefault(e.username),t.card.number=this.getValueOrDefault(e.creditNumber),t.card.brand=A.G.getCardBrandByPatterns(t.card.number),t.card.code=this.getValueOrDefault(e.creditCvv),this.isNullOrWhitespace(e.creditExpiry)||this.setCardExpiration(t,e.creditExpiry)||this.processKvp(t,"Expiration",e.creditExpiry),this.isNullOrWhitespace(e.password)||this.processKvp(t,"PIN",e.password)}}class he extends x{parse(e){const t=new w,i=JSON.parse(e);if(null==i||0===Object.keys(i).length)return t.success=!1,Promise.resolve(t);for(const n in i)i.hasOwnProperty(n)&&!this.isNullOrWhitespace(n)&&0!==i[n].length&&i[n].forEach(e=>{if(this.isNullOrWhitespace(e.display_name)||0!==e.display_name.indexOf("http"))return;this.processFolder(t,n);const i=this.initLoginCipher();if(i.name=e.display_name.replace("http://","").replace("https://",""),i.name.length>30&&(i.name=i.name.substring(0,30)),i.login.password=this.getValueOrDefault(e.secret),i.login.uris=this.makeUriArray(e.display_name),null!=e.attributes){i.login.username=null!=e.attributes?this.getValueOrDefault(e.attributes.username_value):null;for(const t in e.attributes)e.attributes.hasOwnProperty(t)&&"username_value"!==t&&"xdg:schema"!==t&&this.processKvp(i,t,e.attributes[t])}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)});return this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}const pe="Notes\n\n",me="Applications\n\n",ve="Websites\n\n",fe="\n---\n";class ge extends x{parse(e){const t=new w;let i,n,r,s=this.splitNewLine(e).join("\n");if(-1!==s.indexOf(pe)){const e=s.split(pe);e.length>1&&(s=e[0],i=e[1])}if(-1!==s.indexOf(me)){const e=s.split(me);e.length>1&&(s=e[0],n=e[1])}if(0===s.indexOf(ve)){const e=s.split(ve);e.length>1&&(s=e[0],r=e[1])}const o=this.parseDataCategory(i),a=this.parseDataCategory(n),l=this.parseDataCategory(r);return o.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.get("Name")),i.notes=this.getValueOrDefault(e.get("Text")),this.cleanupCipher(i),t.ciphers.push(i)}),l.concat(a).forEach(e=>{const i=this.initLoginCipher(),n=e.has("Website name")?"Website name":"Application";i.name=this.getValueOrDefault(e.get(n),""),this.isNullOrWhitespace(e.get("Login name"))||(this.isNullOrWhitespace(i.name)||(i.name+=": "),i.name+=e.get("Login name")),i.notes=this.getValueOrDefault(e.get("Comment")),e.has("Website URL")&&(i.login.uris=this.makeUriArray(e.get("Website URL"))),i.login.username=this.getValueOrDefault(e.get("Login")),i.login.password=this.getValueOrDefault(e.get("Password")),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t)}parseDataCategory(e){if(this.isNullOrWhitespace(e)||-1===e.indexOf(fe))return[];const t=[];return e.split(fe).forEach(e=>{if(-1===e.indexOf("\n"))return;const i=new Map;let n,r;e.split("\n").forEach(e=>{if(null!=n)return void(n+="\n"+e);const t=e.indexOf(":");let s,o;-1!==t&&(s=e.substring(0,t),e.length>t+1&&(o=e.substring(t+2)),null!=s&&i.set(s,o),"Comment"!==s&&"Text"!==s||(n=o,r=s))}),null!=n&&null!=r&&i.set(r,n),0!==i.size&&t.push(i)}),t}}class ye extends x{constructor(){super(...arguments),this.result=new w}parse(e){const t=this.parseXml(e);if(null==t)return this.result.success=!1,Promise.resolve(this.result);const i=t.querySelector("KeePassFile");if(null==i)return this.result.errorMessage="Missing `KeePassFile` node.",this.result.success=!1,Promise.resolve(this.result);const n=i.querySelector("Root");if(null==n)return this.result.errorMessage="Missing `KeePassFile > Root` node.",this.result.success=!1,Promise.resolve(this.result);const r=n.querySelector("Group");return null==r?(this.result.errorMessage="Missing `KeePassFile > Root > Group` node.",this.result.success=!1,Promise.resolve(this.result)):(this.traverse(r,!0,""),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,Promise.resolve(this.result))}traverse(e,t,i){const n=this.result.folders.length;let r=i;if(!t){""!==r&&(r+="/");const t=this.querySelectorDirectChild(e,"Name");r+=null==t?"-":t.textContent;const i=new b.u;i.name=r,this.result.folders.push(i)}this.querySelectorAllDirectChild(e,"Entry").forEach(e=>{const i=this.result.ciphers.length,r=this.initLoginCipher();this.querySelectorAllDirectChild(e,"String").forEach(e=>{const t=this.querySelectorDirectChild(e,"Value"),i=null!=t?t.textContent:null;if(this.isNullOrWhitespace(i))return;const n=this.querySelectorDirectChild(e,"Key"),s=null!=n?n.textContent:null;if("URL"===s)r.login.uris=this.makeUriArray(i);else if("UserName"===s)r.login.username=i;else if("Password"===s)r.login.password=i;else if("otp"===s)r.login.totp=i.replace("key=","");else if("Title"===s)r.name=i;else if("Notes"===s)r.notes+=i+"\n";else{let e=f.PU.Text;const n=t.attributes;n.length>0&&null!=n.ProtectInMemory&&"True"===n.ProtectInMemory.value&&(e=f.PU.Hidden),this.processKvp(r,s,i,e)}}),this.cleanupCipher(r),this.result.ciphers.push(r),t||this.result.folderRelationships.push([i,n])}),this.querySelectorAllDirectChild(e,"Group").forEach(e=>{this.traverse(e,!1,r)})}}class be extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(this.isNullOrWhitespace(e.Title))return;e.Group=!this.isNullOrWhitespace(e.Group)&&e.Group.startsWith("Root/")?e.Group.replace("Root/",""):e.Group;const i=this.isNullOrWhitespace(e.Group)?null:e.Group;this.processFolder(t,i);const n=this.initLoginCipher();n.notes=this.getValueOrDefault(e.Notes),n.name=this.getValueOrDefault(e.Title,"--"),n.login.username=this.getValueOrDefault(e.Username),n.login.password=this.getValueOrDefault(e.Password),n.login.uris=this.makeUriArray(e.URL),n.login.totp=this.getValueOrDefault(e.TOTP),this.cleanupCipher(n),t.ciphers.push(n)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class we extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(e.length<6)return;this.processFolder(t,e[0]);const i=this.initLoginCipher(),n=this.getValueOrDefault(e[5]);if(n&&(i.notes=`${n}\n`),i.name=this.getValueOrDefault(e[1],"--"),i.login.username=this.getValueOrDefault(e[2]),i.login.password=this.getValueOrDefault(e[3]),i.login.uris=this.makeUriArray(e[4]),e.length>7)for(let t=7;t<e.length;t+=2)"TFC:Keeper"==e[t]?i.login.totp=e[t+1]:this.processKvp(i,e[t],e[t+1]);this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class Se extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=t.ciphers.length;let n=t.folders.length,r=e.grouping;null!=r&&(r=r.replace(/\\/g,"/").replace(/[\x00-\x1F\x7F-\x9F]/g,""));const s="(none)"!==this.getValueOrDefault(r,"(none)");let o=s;if(s)for(let l=0;l<t.folders.length;l++)if(t.folders[l].name===r){o=!1,n=l;break}const a=this.buildBaseCipher(e);if(a.type===f.gC.Login)a.notes=this.getValueOrDefault(e.extra),a.login=new R.r,a.login.uris=this.makeUriArray(e.url),a.login.username=this.getValueOrDefault(e.username),a.login.password=this.getValueOrDefault(e.password),a.login.totp=this.getValueOrDefault(e.totp);else if(a.type===f.gC.SecureNote)this.parseSecureNote(e,a);else if(a.type===f.gC.Card)a.card=this.parseCard(e),a.notes=this.getValueOrDefault(e.notes);else if(a.type===f.gC.Identity&&(a.identity=this.parseIdentity(e),a.notes=this.getValueOrDefault(e.notes),!this.isNullOrWhitespace(e.ccnum))){const i=this.buildBaseCipher(e);i.identity=null,i.type=f.gC.Card,i.card=this.parseCard(e),t.ciphers.push(i)}if(t.ciphers.push(a),o){const e=new b.u;e.name=r,t.folders.push(e)}s&&t.folderRelationships.push([i,n])}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}buildBaseCipher(e){const t=new C.f;return e.hasOwnProperty("profilename")&&e.hasOwnProperty("profilelanguage")?(t.favorite=!1,t.name=this.getValueOrDefault(e.profilename,"--"),t.type=f.gC.Card,this.isNullOrWhitespace(e.title)&&this.isNullOrWhitespace(e.firstname)&&this.isNullOrWhitespace(e.lastname)&&this.isNullOrWhitespace(e.address1)&&this.isNullOrWhitespace(e.phone)&&this.isNullOrWhitespace(e.username)&&this.isNullOrWhitespace(e.email)||(t.type=f.gC.Identity)):(t.favorite=!this.organization&&"1"===this.getValueOrDefault(e.fav,"0"),t.name=this.getValueOrDefault(e.name,"--"),t.type="http://sn"===e.url?f.gC.SecureNote:f.gC.Login),t}parseCard(e){const t=new A.G;if(t.cardholderName=this.getValueOrDefault(e.ccname),t.number=this.getValueOrDefault(e.ccnum),t.code=this.getValueOrDefault(e.cccsc),t.brand=A.G.getCardBrandByPatterns(t.number),!this.isNullOrWhitespace(e.ccexp)&&e.ccexp.indexOf("-")>-1){const i=e.ccexp.split("-");i.length>1&&(t.expYear=i[0],t.expMonth=i[1],2===t.expMonth.length&&"0"===t.expMonth[0]&&(t.expMonth=t.expMonth[1]))}return t}parseIdentity(e){const t=new Z.O;return t.title=this.getValueOrDefault(e.title),t.firstName=this.getValueOrDefault(e.firstname),t.middleName=this.getValueOrDefault(e.middlename),t.lastName=this.getValueOrDefault(e.lastname),t.username=this.getValueOrDefault(e.username),t.company=this.getValueOrDefault(e.company),t.ssn=this.getValueOrDefault(e.ssn),t.address1=this.getValueOrDefault(e.address1),t.address2=this.getValueOrDefault(e.address2),t.address3=this.getValueOrDefault(e.address3),t.city=this.getValueOrDefault(e.city),t.state=this.getValueOrDefault(e.state),t.postalCode=this.getValueOrDefault(e.zip),t.country=this.getValueOrDefault(e.country),t.email=this.getValueOrDefault(e.email),t.phone=this.getValueOrDefault(e.phone),this.isNullOrWhitespace(t.title)||(t.title=t.title.charAt(0).toUpperCase()+t.title.slice(1)),t}parseSecureNote(e,t){const i=this.splitNewLine(e.extra);let n=!1;if(i.length){const e=i[0].split(":");if(e.length>1&&"NoteType"===e[0]&&("Credit Card"===e[1]||"Address"===e[1])){if("Credit Card"===e[1]){const e=this.parseSecureNoteMapping(t,i,{Number:"number","Name on Card":"cardholderName","Security Code":"code","Expiration Date":"expMonth"});if(this.isNullOrWhitespace(e.expMonth)||","===e.expMonth)e.expMonth=void 0;else{const[t,i]=e.expMonth.split(",");if(this.isNullOrWhitespace(t))e.expMonth=void 0;else{const i=new Date(Date.parse(t.trim()+" 1, 2012")).getMonth()+1;isNaN(i)?e.expMonth=void 0:e.expMonth=i.toString()}this.isNullOrWhitespace(i)||(e.expYear=i)}t.type=f.gC.Card,t.card=e}else if("Address"===e[1]){const e=this.parseSecureNoteMapping(t,i,{Title:"title","First Name":"firstName","Last Name":"lastName","Middle Name":"middleName",Company:"company","Address 1":"address1","Address 2":"address2","Address 3":"address3","City / Town":"city",State:"state","Zip / Postal Code":"postalCode",Country:"country","Email Address":"email",Username:"username"});t.type=f.gC.Identity,t.identity=e}n=!0}}n||(t.secureNote=new P.Z,t.secureNote.type=f.ak.Generic,t.notes=this.getValueOrDefault(e.extra))}parseSecureNoteMapping(e,t,i){const n={};let r=!1;return t.forEach(t=>{let s=null,o=null;if(!r){if(this.isNullOrWhitespace(t))return;const e=t.indexOf(":");if(-1===e?s=t:(s=t.substring(0,e),t.length>e&&(o=t.substring(e+1))),this.isNullOrWhitespace(s)||this.isNullOrWhitespace(o)||"NoteType"===s)return}r?e.notes+="\n"+t:"Notes"===s?(this.isNullOrWhitespace(e.notes)?e.notes=o:e.notes+="\n"+o,r=!0):i.hasOwnProperty(s)?n[i[s]]=o:this.processKvp(e,s,o)}),n}}class Ie extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(e.length<4)return;const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--"),i.login.username=this.getValueOrDefault(e[2]),i.login.password=this.getValueOrDefault(e[3]),i.login.uris=this.makeUriArray(e[1]),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class ke extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.DisplayName,"--"),i.notes=this.getValueOrDefault(e.Notes),i.login.username=this.getValueOrDefault(e.UserName),i.login.password=this.getValueOrDefault(e.Password),i.login.uris=this.makeUriArray(e.Url),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class Ce extends x{parse(e){const t=new w,i=this.parseCsv(e,!1,{delimiter:","});return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(e.length<3)return;const i="Unassigned"!==this.getValueOrDefault(e[2],"Unassigned")?e[2]:null;this.processFolder(t,i);const n=this.initLoginCipher();if(n.name=this.getValueOrDefault(e[0].split("|")[0],"--"),"Web Logins"===e[1]||"Login"===e[1])n.login.username=this.getValueOrDefault(this.splitValueRetainingLastPart(e[5])),n.login.uris=this.makeUriArray(this.splitValueRetainingLastPart(e[4])),n.login.password=this.getValueOrDefault(this.splitValueRetainingLastPart(e[6])),n.notes=this.isNullOrWhitespace(e[3])?null:e[3].split("\\n").join("\n");else if("Credit Card"===e[1]){n.type=f.gC.Card,n.card.number=this.getValueOrDefault(this.splitValueRetainingLastPart(e[4]));const[t,i]=this.getValueOrDefault(this.splitValueRetainingLastPart(e[5])).split("/");n.card.expMonth=t.trim(),n.card.expYear=i.trim();const r=RegExp("^Security Code\\|\\d*\\|"),s=e.find(e=>r.test(e));n.card.code=this.getValueOrDefault(this.splitValueRetainingLastPart(s));const o=RegExp("^Name on Card\\|\\d*\\|"),a=e.find(e=>e.match(o));n.card.cardholderName=this.getValueOrDefault(this.splitValueRetainingLastPart(a)),n.card.brand=this.getValueOrDefault(this.splitValueRetainingLastPart(e[9]),"");const l=RegExp("\\|\\d*\\|"),c=e.slice(2).filter(e=>!this.isNullOrWhitespace(e)&&!l.test(e)),d=[8,10,11].filter(t=>e[t]&&l.test(e[t])).map(t=>e[t]).map(e=>`${e.split("|")[0]}: ${this.getValueOrDefault(this.splitValueRetainingLastPart(e),"")}`);n.notes=[...c,...d].join("\n")}else if(e.length>3){n.type=f.gC.SecureNote,n.secureNote=new P.Z,n.secureNote.type=f.ak.Generic;for(let t=3;t<e.length;t++)this.isNullOrWhitespace(e[t])||(n.notes+=e[t]+"\n")}this.isNullOrWhitespace(e[1])||n.type===f.gC.Login||n.type===f.gC.Card||(n.name=e[1]+": "+n.name),this.cleanupCipher(n),t.ciphers.push(n)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}splitValueRetainingLastPart(e){return e&&e.split("|").slice(0,2).concat(e.split("|").slice(2).join("|")).pop()}}const Te=["nickname","additionalInfo"],Fe=new Set(Te.concat(["url","username","password","twofaSecret"])),Re=new Set(Te.concat(["cardNumber","cardName","exp_month","exp_year","cvv"])),Pe=new Set(Te.concat(["title","firstName","middleName","lastName","email","firstAddressLine","secondAddressLine","city","country","zipCode"])),xe=new Set(Te.concat(["idName","idNumber","idCountry"])),$e=new Set(Te.concat(["authToken"])),Ee=new Set(Te.concat(["content"]));class Ae extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();if(i.name=this.getValueOrDefault(e.nickname,"--"),i.notes=this.getValueOrDefault(e.additionalInfo),void 0!==e.url)i.login.uris=this.makeUriArray(e.url),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.totp=this.getValueOrDefault(e.twofaSecret),this.importUnmappedFields(i,e,Fe);else if(void 0!==e.authToken)i.login.totp=this.getValueOrDefault(e.authToken),this.importUnmappedFields(i,e,$e);else if(void 0!==e.cardNumber)i.card=new A.G,i.type=f.gC.Card,i.card.cardholderName=this.getValueOrDefault(e.cardName),i.card.number=this.getValueOrDefault(e.cardNumber),i.card.brand=A.G.getCardBrandByPatterns(i.card.number),i.card.expMonth=this.getValueOrDefault(e.exp_month),i.card.expYear=this.getValueOrDefault(e.exp_year),i.card.code=this.getValueOrDefault(e.cvv),this.importUnmappedFields(i,e,Re);else if(void 0!==e.firstName)i.identity=new Z.O,i.type=f.gC.Identity,i.identity.title=this.getValueOrDefault(e.title),i.identity.firstName=this.getValueOrDefault(e.firstName),i.identity.middleName=this.getValueOrDefault(e.middleName),i.identity.lastName=this.getValueOrDefault(e.lastName),i.identity.phone=this.getValueOrDefault(e.number),i.identity.email=this.getValueOrDefault(e.email),i.identity.address1=this.getValueOrDefault(e.firstAddressLine),i.identity.address2=this.getValueOrDefault(e.secondAddressLine),i.identity.city=this.getValueOrDefault(e.city),i.identity.country=this.getValueOrDefault(e.country),i.identity.postalCode=this.getValueOrDefault(e.zipCode),this.importUnmappedFields(i,e,Pe);else if(void 0!==e.idType){switch(i.identity=new Z.O,i.type=f.gC.Identity,this.processFullName(i,e.idName),i.identity.country=this.getValueOrDefault(e.idCountry),e.idType){case"Passport":i.identity.passportNumber=e.idNumber;break;case"Social Security":i.identity.ssn=e.idNumber;break;default:i.identity.licenseNumber=e.idNumber}this.importUnmappedFields(i,e,xe)}else{if(void 0===e.content)return;i.secureNote=new P.Z,i.type=f.gC.SecureNote,i.secureNote.type=f.ak.Generic,i.notes=this.getValueOrDefault(e.content),this.importUnmappedFields(i,e,Ee)}this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}importUnmappedFields(e,t,i){Object.keys(t).filter(e=>!i.has(e)).forEach(i=>{const n=t;this.processKvp(e,i,n[i])})}}const De=new Set(["Organisationseinheit","Informationen","Beschreibung","Benutzername","Passwort","Internetseite","One-Time Passwort"]);class Oe extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{this.processFolder(t,e.Organisationseinheit);const i=this.initLoginCipher(),n=this.getValueOrDefault(e.Informationen);n&&(i.notes=`${n}\n`),i.name=this.getValueOrDefault(e.Beschreibung,"--"),i.login.username=this.getValueOrDefault(e.Benutzername),i.login.password=this.getValueOrDefault(e.Passwort),i.login.uris=this.makeUriArray(e.Internetseite),i.login.totp=this.getValueOrDefault(e["One-Time Passwort"]),this.importUnmappedFields(i,e,De),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}importUnmappedFields(e,t,i){Object.keys(t).filter(e=>!i.has(e)).forEach(i=>{const n=t;this.processKvp(e,i,n[i])})}}class Me extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.evaluateType(e);if(void 0===i)return;this.processFolder(t,e.folder);const n=new C.f;if(n.name=this.getValueOrDefault(e.name,"--"),n.notes=this.getValueOrDefault(e.note),e.custom_fields){const t=JSON.parse(e.custom_fields);t&&t.length>0&&t.forEach(e=>{let t=f.PU.Text;"hidden"==e.type&&(t=f.PU.Hidden),this.processKvp(n,e.label,e.value,t)})}switch(i){case f.gC.Login:if(n.type=f.gC.Login,n.login=new R.r,n.login.username=this.getValueOrDefault(e.username),n.login.password=this.getValueOrDefault(e.password),e.additional_urls){const t=JSON.parse(e.additional_urls),i=[e.url,...t];n.login.uris=this.makeUriArray(i)}else n.login.uris=this.makeUriArray(e.url);break;case f.gC.Card:n.type=f.gC.Card,n.card.cardholderName=this.getValueOrDefault(e.cardholdername),n.card.number=this.getValueOrDefault(e.cardnumber),n.card.code=this.getValueOrDefault(e.cvc),n.card.brand=A.G.getCardBrandByPatterns(n.card.number),this.setCardExpiration(n,e.expirydate);break;case f.gC.Identity:n.type=f.gC.Identity,this.processFullName(n,this.getValueOrDefault(e.full_name)),n.identity.address1=this.getValueOrDefault(e.address1),n.identity.address2=this.getValueOrDefault(e.address2),n.identity.city=this.getValueOrDefault(e.city),n.identity.state=this.getValueOrDefault(e.state),n.identity.postalCode=this.getValueOrDefault(e.zipcode),n.identity.country=this.getValueOrDefault(e.country),null!=n.identity.country&&(n.identity.country=n.identity.country.toUpperCase()),n.identity.email=this.getValueOrDefault(e.email),n.identity.phone=this.getValueOrDefault(e.phone_number);break;case f.gC.SecureNote:n.type=f.gC.SecureNote,n.secureNote.type=f.ak.Generic}this.cleanupCipher(n),t.ciphers.push(n)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}evaluateType(e){switch(e.type){case"password":return f.gC.Login;case"credit_card":return f.gC.Card;case"note":return f.gC.SecureNote;case"identity":return f.gC.Identity}}}var Ue=i(12022);class Ge extends x{constructor(){super(...arguments),this.result=new w}parse(e){return e.split(this.newLineRegex).forEach(e=>{if(this.isNullOrWhitespace(e)||"{"!==e[0])return;const t=JSON.parse(e);if(!0===t.trashed)return;const i=this.initLoginCipher();this.isNullOrWhitespace(t.hmac)?this.processStandardItem(t,i):this.processWinOpVaultItem(t,i),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),this.result.ciphers.push(i)}),this.result.success=!0,Promise.resolve(this.result)}processWinOpVaultItem(e,t){if(null!=e.overview&&(t.name=this.getValueOrDefault(e.overview.title),null!=e.overview.URLs)){const i=[];e.overview.URLs.forEach(e=>{this.isNullOrWhitespace(e.u)||i.push(e.u)}),t.login.uris=this.makeUriArray(i)}null!=e.details&&(null!=e.details.passwordHistory&&this.parsePasswordHistory(e.details.passwordHistory,t),this.isNullOrWhitespace(e.details.ccnum)&&this.isNullOrWhitespace(e.details.cvv)?this.isNullOrWhitespace(e.details.firstname)&&this.isNullOrWhitespace(e.details.address1)||(t.type=f.gC.Identity,t.identity=new Z.O):(t.type=f.gC.Card,t.card=new A.G),t.type!==f.gC.Login||this.isNullOrWhitespace(e.details.password)||(t.login.password=e.details.password),this.isNullOrWhitespace(e.details.notesPlain)||(t.notes=e.details.notesPlain.split(this.newLineRegex).join("\n")+"\n"),null!=e.details.fields&&this.parseFields(e.details.fields,t,"designation","value","name"),null!=e.details.sections&&e.details.sections.forEach(e=>{null!=e.fields&&this.parseFields(e.fields,t,"n","v","t")}))}processStandardItem(e,t){if(t.favorite=!(!e.openContents||!e.openContents.faveIndex),t.name=this.getValueOrDefault(e.title),"securenotes.SecureNote"===e.typeName?(t.type=f.gC.SecureNote,t.secureNote=new P.Z,t.secureNote.type=f.ak.Generic):"wallet.financial.CreditCard"===e.typeName?(t.type=f.gC.Card,t.card=new A.G):"identities.Identity"===e.typeName?(t.type=f.gC.Identity,t.identity=new Z.O):t.login.uris=this.makeUriArray(e.location),null!=e.secureContents){if(null!=e.secureContents.passwordHistory&&this.parsePasswordHistory(e.secureContents.passwordHistory,t),this.isNullOrWhitespace(e.secureContents.notesPlain)||(t.notes=e.secureContents.notesPlain.split(this.newLineRegex).join("\n")+"\n"),t.type===f.gC.Login&&(this.isNullOrWhitespace(e.secureContents.password)||(t.login.password=e.secureContents.password),null!=e.secureContents.URLs)){const i=[];e.secureContents.URLs.forEach(e=>{this.isNullOrWhitespace(e.url)||i.push(e.url)}),i.length>0&&(t.login.uris=this.makeUriArray(i))}null!=e.secureContents.fields&&this.parseFields(e.secureContents.fields,t,"designation","value","name"),null!=e.secureContents.sections&&e.secureContents.sections.forEach(e=>{null!=e.fields&&this.parseFields(e.fields,t,"n","v","t")})}}parsePasswordHistory(e,t){const i=e.length>5?5:e.length;t.passwordHistory=e.filter(e=>!this.isNullOrWhitespace(e.value)&&null!=e.time).sort((e,t)=>t.time-e.time).slice(0,i).map(e=>{const t=new Ue.j;return t.password=e.value,t.lastUsedDate=new Date((""+e.time).length>=13?e.time:1e3*e.time),t})}parseFields(e,t,i,n,r){e.forEach(e=>{if(null==e[n]||""===e[n].toString().trim())return;const s="date"===e.k?new Date(1e3*e[n]).toUTCString():e[n].toString(),o=null!=e[i]?e[i].toString():null;if(t.type===f.gC.Login){if(this.isNullOrWhitespace(t.login.username)&&"username"===o)return void(t.login.username=s);if(this.isNullOrWhitespace(t.login.password)&&"password"===o)return void(t.login.password=s);if(this.isNullOrWhitespace(t.login.totp)&&null!=o&&o.startsWith("TOTP_"))return void(t.login.totp=s)}else if(t.type===f.gC.Card){if(this.isNullOrWhitespace(t.card.number)&&"ccnum"===o)return t.card.number=s,void(t.card.brand=A.G.getCardBrandByPatterns(t.card.number));if(this.isNullOrWhitespace(t.card.code)&&"cvv"===o)return void(t.card.code=s);if(this.isNullOrWhitespace(t.card.cardholderName)&&"cardholder"===o)return void(t.card.cardholderName=s);if(this.isNullOrWhitespace(t.card.expiration)&&"expiry"===o&&6===s.length)return t.card.expMonth=s.substr(4,2),"0"===t.card.expMonth[0]&&(t.card.expMonth=t.card.expMonth.substr(1,1)),void(t.card.expYear=s.substr(0,4));if("type"===o)return}else if(t.type===f.gC.Identity){const i=t.identity;if(this.isNullOrWhitespace(i.firstName)&&"firstname"===o)return void(i.firstName=s);if(this.isNullOrWhitespace(i.lastName)&&"lastname"===o)return void(i.lastName=s);if(this.isNullOrWhitespace(i.middleName)&&"initial"===o)return void(i.middleName=s);if(this.isNullOrWhitespace(i.phone)&&"defphone"===o)return void(i.phone=s);if(this.isNullOrWhitespace(i.company)&&"company"===o)return void(i.company=s);if(this.isNullOrWhitespace(i.email)&&"email"===o)return void(i.email=s);if(this.isNullOrWhitespace(i.username)&&"username"===o)return void(i.username=s);if("address"===o){const{street:t,city:r,country:s,zip:o}=e[n];return i.address1=this.getValueOrDefault(t),i.city=this.getValueOrDefault(r),this.isNullOrWhitespace(s)||(i.country=s.toUpperCase()),void(i.postalCode=this.getValueOrDefault(o))}}const a=this.isNullOrWhitespace(e[r])?"no_name":e[r];if("password"===a&&null!=t.passwordHistory&&t.passwordHistory.some(e=>e.password===s))return;const l="concealed"===e.k?f.PU.Hidden:f.PU.Text;this.processKvp(t,a,s,l)})}}const je=Object.freeze({Login:"001",CreditCard:"002",SecureNote:"003",Identity:"004",Password:"005",Document:"006",SoftwareLicense:"100",BankAccount:"101",Database:"102",DriversLicense:"103",OutdoorLicense:"104",Membership:"105",Passport:"106",RewardsProgram:"107",SocialSecurityNumber:"108",WirelessRouter:"109",Server:"110",EmailAccount:"111",API_Credential:"112",MedicalRecord:"113"}),Ne=Object.freeze({TextOrHtml:"T",EmailAddress:"E",URL:"U",Number:"N",Password:"P",TextArea:"A",PhoneNumber:"TEL",CheckBox:"C"});class Ve extends x{constructor(){super(...arguments),this.result=new w}parse(e){return JSON.parse(e).accounts[0].vaults.forEach(e=>{e.items.forEach(e=>{if("archived"===e.state)return;const t=this.initLoginCipher(),i=e.categoryUuid;switch(i){case je.Login:case je.Database:case je.Password:case je.WirelessRouter:case je.Server:case je.API_Credential:t.type=f.gC.Login,t.login=new R.r;break;case je.CreditCard:case je.BankAccount:t.type=f.gC.Card,t.card=new A.G;break;case je.SecureNote:case je.SoftwareLicense:case je.EmailAccount:case je.MedicalRecord:t.type=f.gC.SecureNote,t.secureNote=new P.Z,t.secureNote.type=f.ak.Generic;break;case je.Identity:case je.DriversLicense:case je.OutdoorLicense:case je.Membership:case je.Passport:case je.RewardsProgram:case je.SocialSecurityNumber:t.type=f.gC.Identity,t.identity=new Z.O}t.favorite=1===e.favIndex,this.processOverview(e.overview,t),this.processLoginFields(e,t),this.processDetails(i,e.details,t),this.parsePasswordHistory(e.details.passwordHistory,t),this.processSections(i,e.details.sections,t),this.isNullOrWhitespace(e.details.notesPlain)||(t.notes=e.details.notesPlain.split(this.newLineRegex).join("\n")+"\n"),this.convertToNoteIfNeeded(t),this.cleanupCipher(t),this.result.ciphers.push(t)})}),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,Promise.resolve(this.result)}processOverview(e,t){if(null!=e){if(t.name=this.getValueOrDefault(e.title),null!=e.urls){const i=[];e.urls.forEach(e=>{this.isNullOrWhitespace(e.url)||i.push(e.url)}),t.login.uris=this.makeUriArray(i)}if(null!=e.tags&&e.tags.length>0){const t=this.capitalize(e.tags[0]);this.processFolder(this.result,t)}}}capitalize(e){return e.trim().replace(/\w\S*/g,e=>e.replace(/^\w/,e=>e.toUpperCase()))}processLoginFields(e,t){null!=e.details&&null!=e.details.loginFields&&0!==e.details.loginFields.length&&e.details.loginFields.forEach(e=>{if("username"===e.designation&&""!==e.value)return t.type=f.gC.Login,void(t.login.username=e.value);if("password"===e.designation&&""!==e.value)return t.type=f.gC.Login,void(t.login.password=e.value);let i=e.value,n=f.PU.Text;switch(e.fieldType){case Ne.Password:n=f.PU.Hidden;break;case Ne.CheckBox:i=""!==e.value?"true":"false",n=f.PU.Boolean}this.processKvp(t,e.name,i,n)})}processDetails(e,t,i){e===je.Password&&null!=t&&(i.login.password=t.password)}processSections(e,t,i){null!=t&&0!==t.length&&t.forEach(t=>{null!=t.fields&&this.parseSectionFields(e,t.fields,i,t.title)})}parseSectionFields(e,t,i,n){t.forEach(t=>{const r=Object.keys(t.value)[0],s=t;if(null==s.value||null==s.value[r]||""===s.value[r])return;const o=this.getFieldName(t.title,n),a=this.extractValue(t.value,r);if(i.type===f.gC.Login){if(this.fillLogin(t,a,i))return;switch(e){case je.Login:case je.Database:case je.EmailAccount:case je.WirelessRouter:break;case je.Server:if(this.isNullOrWhitespace(i.login.uri)&&"url"===t.id)return void(i.login.uris=this.makeUriArray(a));break;case je.API_Credential:if(this.fillApiCredentials(t,a,i))return}}else if(i.type===f.gC.Card){if(this.fillCreditCard(t,a,i))return;if(e===je.BankAccount&&this.fillBankAccount(t,a,i))return}else if(i.type===f.gC.Identity){if(this.fillIdentity(t,a,i,r))return;if("address"===r){const{street:e,city:n,country:r,zip:s,state:o}=t.value.address;return i.identity.address1=this.getValueOrDefault(e),i.identity.city=this.getValueOrDefault(n),this.isNullOrWhitespace(r)||(i.identity.country=r.toUpperCase()),i.identity.postalCode=this.getValueOrDefault(s),void(i.identity.state=this.getValueOrDefault(o))}switch(e){case je.Identity:break;case je.DriversLicense:if(this.fillDriversLicense(t,a,i))return;break;case je.OutdoorLicense:if(this.fillOutdoorLicense(t,a,i))return;break;case je.Membership:if(this.fillMembership(t,a,i))return;break;case je.Passport:if(this.fillPassport(t,a,i))return;break;case je.RewardsProgram:if(this.fillRewardsProgram(t,a,i))return;break;case je.SocialSecurityNumber:if(this.fillSSN(t,a,i))return}}if("email"===r){const{email_address:e,provider:n}=t.value.email;return this.processKvp(i,o,e,f.PU.Text),void this.processKvp(i,"provider",n,f.PU.Text)}if("password"===t.title&&null!=i.passwordHistory&&i.passwordHistory.some(e=>e.password===a))return;t.guarded&&i.reprompt===G.b.None&&(i.reprompt=G.b.Password);const l="concealed"===r?f.PU.Hidden:f.PU.Text;this.processKvp(i,o,a,l)})}getFieldName(e,t){return this.isNullOrWhitespace(e)?this.isNullOrWhitespace(t)?"":t:e}extractValue(e,t){return"date"===t?new Date(1e3*e.date).toUTCString():"monthYear"===t?e.monthYear.toString():e[t]}fillLogin(e,t,i){const n=this.getFieldName(e.title);return this.isNullOrWhitespace(i.login.username)&&"username"===n?(i.login.username=t,!0):this.isNullOrWhitespace(i.login.password)&&"password"===n?(i.login.password=t,!0):!(!this.isNullOrWhitespace(i.login.totp)||null==e.id||!e.id.startsWith("TOTP_"))&&(i.login.totp=t,!0)}fillApiCredentials(e,t,i){const n=this.getFieldName(e.title);return this.isNullOrWhitespace(i.login.password)&&"credential"===n?(i.login.password=t,!0):!(!this.isNullOrWhitespace(i.login.uri)||"hostname"!==n)&&(i.login.uris=this.makeUriArray(t),!0)}fillCreditCard(e,t,i){if(this.isNullOrWhitespace(i.card.number)&&"ccnum"===e.id)return i.card.number=t,i.card.brand=A.G.getCardBrandByPatterns(i.card.number),!0;if(this.isNullOrWhitespace(i.card.code)&&"cvv"===e.id)return i.card.code=t,!0;if(this.isNullOrWhitespace(i.card.cardholderName)&&"cardholder"===e.id)return i.card.cardholderName=t,!0;if(this.isNullOrWhitespace(i.card.expiration)&&"expiry"===e.id){const e=t.toString().trim();return i.card.expMonth=e.substring(4,6),"0"===i.card.expMonth[0]&&(i.card.expMonth=i.card.expMonth.substring(1,2)),i.card.expYear=e.substring(0,4),!0}return"type"===e.id}fillBankAccount(e,t,i){return!(!this.isNullOrWhitespace(i.card.cardholderName)||"owner"!==e.id)&&(i.card.cardholderName=t,!0)}fillIdentity(e,t,i,n){if(this.isNullOrWhitespace(i.identity.firstName)&&"firstname"===e.id)return i.identity.firstName=t,!0;if(this.isNullOrWhitespace(i.identity.lastName)&&"lastname"===e.id)return i.identity.lastName=t,!0;if(this.isNullOrWhitespace(i.identity.middleName)&&"initial"===e.id)return i.identity.middleName=t,!0;if(this.isNullOrWhitespace(i.identity.phone)&&"defphone"===e.id)return i.identity.phone=t,!0;if(this.isNullOrWhitespace(i.identity.company)&&"company"===e.id)return i.identity.company=t,!0;if(this.isNullOrWhitespace(i.identity.email)){if("email"===n){const{email_address:t,provider:n}=e.value.email;return i.identity.email=this.getValueOrDefault(t),this.processKvp(i,"provider",n,f.PU.Text),!0}if("email"===e.id)return i.identity.email=t,!0}return!(!this.isNullOrWhitespace(i.identity.username)||"username"!==e.id)&&(i.identity.username=t,!0)}fillDriversLicense(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"fullname"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.address1)&&"address"===e.id?(i.identity.address1=t,!0):this.isNullOrWhitespace(i.identity.country)&&"country"===e.id?(i.identity.country=t,!0):this.isNullOrWhitespace(i.identity.state)&&"state"===e.id?(i.identity.state=t,!0):!(!this.isNullOrWhitespace(i.identity.licenseNumber)||"number"!==e.id)&&(i.identity.licenseNumber=t,!0)}fillOutdoorLicense(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"name"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.country)&&"country"===e.id?(i.identity.country=t,!0):!(!this.isNullOrWhitespace(i.identity.state)||"state"!==e.id)&&(i.identity.state=t,!0)}fillMembership(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"member_name"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.company)&&"org_name"===e.id?(i.identity.company=t,!0):!(!this.isNullOrWhitespace(i.identity.phone)||"phone"!==e.id)&&(i.identity.phone=t,!0)}fillPassport(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"fullname"===e.id?(this.processFullName(i,t),!0):this.isNullOrWhitespace(i.identity.country)&&"issuing_country"===e.id?(i.identity.country=t,!0):!(!this.isNullOrWhitespace(i.identity.passportNumber)||"number"!==e.id)&&(i.identity.passportNumber=t,!0)}fillRewardsProgram(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"member_name"===e.id?(this.processFullName(i,t),!0):!(!this.isNullOrWhitespace(i.identity.company)||"company_name"!==e.id)&&(i.identity.company=t,!0)}fillSSN(e,t,i){return this.isNullOrWhitespace(i.identity.firstName)&&"name"===e.id?(this.processFullName(i,t),!0):!(!this.isNullOrWhitespace(i.identity.ssn)||"number"!==e.id)&&(i.identity.ssn=t,!0)}parsePasswordHistory(e,t){if(null==e||0===e.length)return;const i=e.length>5?5:e.length;t.passwordHistory=e.filter(e=>!this.isNullOrWhitespace(e.value)&&null!=e.time).sort((e,t)=>t.time-e.time).slice(0,i).map(e=>{const t=new Ue.j;return t.password=e.value,t.lastUsedDate=new Date((""+e.time).length>=13?e.time:1e3*e.time),t})}}class Be{constructor(e,t,i){this.importRecord=e,this.property=t,this.cipher=i,this.lowerProperty=t.toLowerCase()}}const ze=["ainfo","autosubmit","notesplain","ps","scope","tags","title","uuid","notes"];class Le extends x{constructor(){super(...arguments),this.loginPropertyParsers=[this.setLoginUsername,this.setLoginPassword,this.setLoginUris],this.creditCardPropertyParsers=[this.setCreditCardNumber,this.setCreditCardVerification,this.setCreditCardCardholderName,this.setCreditCardExpiry],this.identityPropertyParsers=[this.setIdentityFirstName,this.setIdentityInitial,this.setIdentityLastName,this.setIdentityUserName,this.setIdentityEmail,this.setIdentityPhone,this.setIdentityCompany]}parse(e){const t=new w,i=this.parseCsv(e,!0,{quoteChar:'"',escapeChar:"\\"});return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(this.isNullOrWhitespace(this.getProp(e,"title")))return;const i=this.initLoginCipher();i.name=this.getValueOrDefault(this.getProp(e,"title"),"--"),this.setNotes(e,i),this.setCipherType(e,i);let n=null;for(const t in e){if(!e.hasOwnProperty(t)||this.isNullOrWhitespace(e[t]))continue;const r=new Be(e,t,i);i.type===f.gC.Login&&this.setKnownLoginValue(r)||(i.type===f.gC.Card&&this.setKnownCreditCardValue(r)||i.type===f.gC.Identity&&this.setKnownIdentityValue(r)||(n=this.setUnknownValue(r,n)))}i.type===f.gC.Login&&!this.isNullOrWhitespace(n)&&this.isNullOrWhitespace(i.login.username)&&-1===n.indexOf("://")&&(i.login.username=n),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}getProp(e,t){return Object.entries(e).reduce((e,t)=>(e[t[0].toLowerCase()]=t[1],e),{})[t.toLowerCase()]}getPropByRegexp(e,t){const i=Object.keys(e).reduce((e,i)=>(i.match(t)&&e.push(i),e),[]);return 0===i.length?null:e[i[0]]}getPropIncluding(e,t){const i=Object.keys(e).reduce((e,i)=>(i.toLowerCase().includes(t.toLowerCase())&&e.push(i),e),[]);return 0===i.length?null:e[i[0]]}setNotes(e,t){t.notes=this.getValueOrDefault(this.getProp(e,"notesPlain"),"")+"\n"+this.getValueOrDefault(this.getProp(e,"notes"),"")+"\n",t.notes.trim()}setKnownLoginValue(e){return this.loginPropertyParsers.reduce((t,i)=>(t||(t=i.bind(this)(e)),t),!1)}setKnownCreditCardValue(e){return this.creditCardPropertyParsers.reduce((t,i)=>(t||(t=i.bind(this)(e)),t),!1)}setKnownIdentityValue(e){return this.identityPropertyParsers.reduce((t,i)=>(t||(t=i.bind(this)(e)),t),!1)}setUnknownValue(e,t){if(-1===ze.indexOf(e.lowerProperty)&&!e.lowerProperty.startsWith("section:")&&!e.lowerProperty.startsWith("section ")){if(null==t&&"email"===e.lowerProperty)return e.importRecord[e.property];if("created date"===e.lowerProperty||"modified date"===e.lowerProperty){const t=new Date(1e3*parseInt(e.importRecord[e.property],10)).toUTCString();return this.processKvp(e.cipher,"1Password "+e.property,t),null}e.lowerProperty.includes("password")||e.lowerProperty.includes("key")||e.lowerProperty.includes("secret")?this.processKvp(e.cipher,e.property,e.importRecord[e.property],f.PU.Hidden):this.processKvp(e.cipher,e.property,e.importRecord[e.property])}return null}setIdentityFirstName(e){return!(!this.isNullOrWhitespace(e.cipher.identity.firstName)||!e.lowerProperty.includes("first name"))&&(e.cipher.identity.firstName=e.importRecord[e.property],!0)}setIdentityInitial(e){return!(!this.isNullOrWhitespace(e.cipher.identity.middleName)||!e.lowerProperty.includes("initial"))&&(e.cipher.identity.middleName=e.importRecord[e.property],!0)}setIdentityLastName(e){return!(!this.isNullOrWhitespace(e.cipher.identity.lastName)||!e.lowerProperty.includes("last name"))&&(e.cipher.identity.lastName=e.importRecord[e.property],!0)}setIdentityUserName(e){return!(!this.isNullOrWhitespace(e.cipher.identity.username)||!e.lowerProperty.includes("username"))&&(e.cipher.identity.username=e.importRecord[e.property],!0)}setIdentityCompany(e){return!(!this.isNullOrWhitespace(e.cipher.identity.company)||!e.lowerProperty.includes("company"))&&(e.cipher.identity.company=e.importRecord[e.property],!0)}setIdentityPhone(e){return!(!this.isNullOrWhitespace(e.cipher.identity.phone)||!e.lowerProperty.includes("default phone"))&&(e.cipher.identity.phone=e.importRecord[e.property],!0)}setIdentityEmail(e){return!(!this.isNullOrWhitespace(e.cipher.identity.email)||!e.lowerProperty.includes("email"))&&(e.cipher.identity.email=e.importRecord[e.property],!0)}setCreditCardNumber(e){return!(!this.isNullOrWhitespace(e.cipher.card.number)||!e.lowerProperty.includes("number"))&&(e.cipher.card.number=e.importRecord[e.property],e.cipher.card.brand=A.G.getCardBrandByPatterns(e.cipher.card.number),!0)}setCreditCardVerification(e){return!(!this.isNullOrWhitespace(e.cipher.card.code)||!e.lowerProperty.includes("verification number"))&&(e.cipher.card.code=e.importRecord[e.property],!0)}setCreditCardCardholderName(e){return!(!this.isNullOrWhitespace(e.cipher.card.cardholderName)||!e.lowerProperty.includes("cardholder name"))&&(e.cipher.card.cardholderName=e.importRecord[e.property],!0)}setCreditCardExpiry(e){return!(!this.isNullOrWhitespace(e.cipher.card.expiration)||!e.lowerProperty.includes("expiry date")||7!==e.importRecord[e.property].length)&&(e.cipher.card.expMonth=e.importRecord[e.property].substr(0,2),"0"===e.cipher.card.expMonth[0]&&(e.cipher.card.expMonth=e.cipher.card.expMonth.substr(1,1)),e.cipher.card.expYear=e.importRecord[e.property].substr(3,4),!0)}setLoginPassword(e){return!(!this.isNullOrWhitespace(e.cipher.login.password)||"password"!==e.lowerProperty)&&(e.cipher.login.password=e.importRecord[e.property],!0)}setLoginUsername(e){return!(!this.isNullOrWhitespace(e.cipher.login.username)||"username"!==e.lowerProperty)&&(e.cipher.login.username=e.importRecord[e.property],!0)}setLoginUris(e){if((null==e.cipher.login.uris||0===e.cipher.login.uris.length)&&"urls"===e.lowerProperty){const t=e.importRecord[e.property].split(this.newLineRegex);return e.cipher.login.uris=this.makeUriArray(t),!0}return"url"===e.lowerProperty&&(null==e.cipher.login.uris&&(e.cipher.login.uris=[]),e.cipher.login.uris.concat(this.makeUriArray(e.importRecord[e.property])),!0)}}class Ke extends Le{setCipherType(e,t){switch(this.getValueOrDefault(this.getProp(e,"type"),"Login")){case"Credit Card":t.type=f.gC.Card,t.card=new A.G,ze.push("type");break;case"Identity":t.type=f.gC.Identity,t.identity=new Z.O,ze.push("type");break;case"Login":case"Secure Note":ze.push("type")}}}class qe extends Le{constructor(){super(),this.identityPropertyParsers.push(this.setIdentityAddress)}setCipherType(e,t){t.type=f.gC.Login,t.login=new R.r,this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: number/i))||this.isNullOrWhitespace(this.getPropByRegexp(e,/\d+: expiry date/i))||(t.type=f.gC.Card,t.card=new A.G),this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: first name/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: initial/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/name \d+: last name/i))&&this.isNullOrWhitespace(this.getPropByRegexp(e,/internet \d+: email/i))||(t.type=f.gC.Identity,t.identity=new Z.O)}setIdentityAddress(e){return!!e.lowerProperty.match(/address \d+: address/i)&&(this.processKvp(e.cipher,"address",e.importRecord[e.property]),!0)}setCreditCardExpiry(e){if(this.isNullOrWhitespace(e.cipher.card.expiration)&&e.lowerProperty.includes("expiry date")){const t=e.importRecord[e.property].split("/");return e.cipher.card.expMonth=t[0],"0"===e.cipher.card.expMonth[0]&&2===e.cipher.card.expMonth.length&&(e.cipher.card.expMonth=e.cipher.card.expMonth.substr(1,1)),e.cipher.card.expYear=t[2].length>4?t[2].substr(0,4):t[2],!0}return!1}}class _e extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);if(null==i)return t.success=!1,Promise.resolve(t);let n=null;return i.forEach(e=>{if(null==n)return void(n=e.map(e=>e));if(e.length<2||e.length!==n.length)return;if(!this.isNullOrWhitespace(e[1]))if(this.organization){e[1].split(",").forEach(e=>{e=e.trim();let i=!0,n=t.collections.length;for(let r=0;r<t.collections.length;r++)if(t.collections[r].name===e){i=!1,n=r;break}if(i){const i=new c.iY({name:e});t.collections.push(i)}t.collectionRelationships.push([t.ciphers.length,n])})}else{const i=e[1].split(","),n=i.length>0?i[0].trim():null;this.processFolder(t,n)}const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--");for(let t=2;t<e.length;t++){const r=n[t].trim().toLowerCase();this.isNullOrWhitespace(e[t])||this.isNullOrWhitespace(r)||(this.usernameFieldNames.indexOf(r)>-1?i.login.username=e[t]:this.passwordFieldNames.indexOf(r)>-1?i.login.password=e[t]:this.uriFieldNames.indexOf(r)>-1?i.login.uris=this.makeUriArray(e[t]):this.processKvp(i,n[t],e[t]))}this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t)}}class Xe extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{this.processFolder(t,this.getValue("category",e));const i=this.initLoginCipher();i.notes=this.getValue("description",e),i.name=this.getValueOrDefault(this.getValue("title",e),"--"),i.login.username=this.getValue("username",e),i.login.password=this.getValue("password",e),i.login.uris=this.makeUriArray(this.getValue("site",e)),this.processKvp(i,"Password 2",this.getValue("password2",e)),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}getValue(e,t){return this.getValueOrDefault(t[e],this.getValueOrDefault(t[" "+e]))}}class Ye extends x{parse(e){const t=new w,i=JSON.parse(e);return null==i||null==i.passwords||0===i.passwords.length?(t.success=!1,Promise.resolve(t)):1==i.encrypted?(t.success=!1,t.errorMessage="Unable to import an encrypted passky backup.",Promise.resolve(t)):(i.passwords.forEach(e=>{const i=this.initLoginCipher();i.name=e.website,i.login.username=e.username,i.login.password=e.password,i.login.uris=this.makeUriArray(e.website),i.notes=e.message,this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class He extends x{parse(e){const t=new w,i=JSON.parse(e);return null==i||0===i.length?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(null!=e.tags&&e.tags.length>0){const i=e.tags[0].text;this.processFolder(t,i)}const i=this.initLoginCipher();i.name=e.label,i.login.username=this.getValueOrDefault(e.username),this.isNullOrWhitespace(i.login.username)?i.login.username=this.getValueOrDefault(e.email):this.isNullOrWhitespace(e.email)||(i.notes="Email: "+e.email+"\n"),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.url),i.notes+=this.getValueOrDefault(e.description,""),null!=e.otp&&(i.login.totp=this.getValueOrDefault(e.otp.secret)),null!=e.custom_fields&&e.custom_fields.forEach(e=>{switch(e.field_type){case"text":case"password":this.processKvp(i,e.label,e.value)}}),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}class We extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.isNullOrWhitespace(e.Tags)?null:JSON.parse(e.Tags),n=null!=i&&null!=i.tags&&i.tags.length>0?i.tags.map(e=>{try{const t=JSON.parse(e);return this.getValueOrDefault(t.tag)}catch(t){}return null}).filter(e=>!this.isNullOrWhitespace(e)):null;this.organization&&null!=n&&n.length>0?n.forEach(e=>{let i=!0,n=t.collections.length;for(let r=0;r<t.collections.length;r++)if(t.collections[r].name===e){i=!1,n=r;break}if(i){const i=new c.iY({name:e});t.collections.push(i)}t.collectionRelationships.push([t.ciphers.length,n])}):!this.organization&&null!=n&&n.length>0&&this.processFolder(t,n[0]);const r=this.initLoginCipher();r.notes=this.getValueOrDefault(e.Notes,""),r.notes+="\n\n"+this.getValueOrDefault(e["Shared Notes"],"")+"\n",r.name=this.getValueOrDefault(e["Entry Name"],"--"),r.login.username=this.getValueOrDefault(e["User ID"]),r.login.password=this.getValueOrDefault(e.Password),r.login.uris=this.makeUriArray(e.URL),null!=e.__parsed_extra&&e.__parsed_extra.length>0&&e.__parsed_extra.forEach(e=>{this.isNullOrWhitespace(e)||(r.notes+="\n"+e)});const s=this.isNullOrWhitespace(e["Extra Fields"])?null:JSON.parse(e["Extra Fields"]),o=null!=s&&null!=s.extraFields&&s.extraFields.length>0?s.extraFields.map(e=>{try{return JSON.parse(e)}catch(t){}return null}):null;null!=o&&o.forEach(e=>{null!=e&&this.processKvp(r,e.name,e.data)}),this.cleanupCipher(r),t.ciphers.push(r)}),t.success=!0,Promise.resolve(t))}}class Je extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);if(null==i)return t.success=!1,Promise.resolve(t);let n=!0;return i.forEach(e=>{if(5!==e.length&&e.length<9)return;const i=10===e.length&&"0"===e[0],r=this.initLoginCipher();if(r.name=this.getValueOrDefault(e[i?1:0],"--"),r.login.username=this.getValueOrDefault(e[i?2:1]),r.login.password=this.getValueOrDefault(e[i?3:2]),5===e.length)n=!1,r.notes=this.getValueOrDefault(e[4]),r.login.uris=this.makeUriArray(e[3]);else{const n=this.getValueOrDefault(e[i?9:8],"(None)");let s="(None)"!==n?n.split("\\").join("/"):null;null!=s&&(s=n.split(" > ").join("/"),s=n.split(">").join("/")),this.processFolder(t,s),r.notes=this.getValueOrDefault(e[i?5:3]),r.login.uris=this.makeUriArray(e[4])}this.convertToNoteIfNeeded(r),this.cleanupCipher(r),t.ciphers.push(r)}),n&&this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class Ze extends x{parse(e){const t=new w,i=JSON.parse(e);if(null==i||null==i.items)return t.success=!1,Promise.resolve(t);const n=new Map;i.folders.forEach(e=>{n.set(e.id,e.name)});const r=new Map;return n.forEach((e,i)=>{r.set(i,t.folders.length);const n=new b.u;n.name=e,t.folders.push(n)}),i.items.forEach(e=>{const i=this.initLoginCipher();if(i.name=this.getValueOrDefault(e.name,"--"),i.login.uris=this.makeUriArray(e.login_url),null!=e.folder&&r.has(e.folder)&&t.folderRelationships.push([t.ciphers.length,r.get(e.folder)]),null!=e.identifiers){this.isNullOrWhitespace(e.identifiers.notes)||(i.notes=e.identifiers.notes.split("\\r\\n").join("\n").split("\\n").join("\n")),"CreditCard"===e.type&&(i.card=new A.G,i.type=f.gC.Card);for(const t in e.identifiers){if(!e.identifiers.hasOwnProperty(t))continue;const r=e.identifiers[t],s=null!=r?r.toString():null;if(!this.isNullOrWhitespace(s)&&"notes"!==t&&"ignoreItemInSecurityScore"!==t)if("custom_fields"!==t){if(i.type===f.gC.Card){if("cardNumber"===t){i.card.number=s,i.card.brand=A.G.getCardBrandByPatterns(i.card.number);continue}if("nameOnCard"===t){i.card.cardholderName=s;continue}if("security_code"===t){i.card.code=s;continue}if("expires"===t){try{const e=new Date(s);i.card.expYear=e.getFullYear().toString(),i.card.expMonth=(e.getMonth()+1).toString()}catch(n){}continue}if("cardType"===t)continue}else{if(("username"===t||"email"===t)&&this.isNullOrWhitespace(i.login.username)){i.login.username=s;continue}if("password"===t){i.login.password=s;continue}if("totp"===t){i.login.totp=s;continue}if((null==i.login.uris||0===i.login.uris.length)&&this.uriFieldNames.indexOf(t)>-1){i.login.uris=this.makeUriArray(s);continue}}this.processKvp(i,t,s)}else r.forEach(e=>{this.processKvp(i,e.name,e.value)})}this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}}),t.success=!0,Promise.resolve(t)}}const Qe=Object.freeze({Password:"0",CreditCard:"1",SoftwareLicense:"2",Identity:"3",Information:"4",Banking:"5",EncryptedFile:"6",Document:"7",RDP:"8",Putty:"9",TeamViewer:"10",Certificate:"11"}),et=Object.freeze({Password:"1",Memo:"2",Date:"3",Number:"4",Boolean:"5",Decimal:"6",Email:"7",URL:"8"});class tt extends x{constructor(){super(...arguments),this.result=new w,this._favouritesLookupTable=new Set}parse(e){const t=this.parseXml(e);if(null==t)return this.result.success=!1,Promise.resolve(this.result);const i=t.querySelector("passwordfile");if(null==i)return this.result.errorMessage="Missing `passwordfile` node.",this.result.success=!1,Promise.resolve(this.result);const n=this.querySelectorDirectChild(i,"header");if(null==n)return this.result.success=!1,Promise.resolve(this.result);let r=this.querySelectorDirectChild(n,"version");if(null==r&&(r=this.querySelectorDirectChild(n,"dataformat"),null==r))return this.result.success=!1,Promise.resolve(this.result);if(!r.textContent.startsWith("17"))return this.result.errorMessage="Unsupported export version detected - (only 17.0 is supported)",this.result.success=!1,Promise.resolve(this.result);const s=this.querySelectorDirectChild(n,"encrypted");if(null!=s&&"True"==s.textContent)return this.result.errorMessage="Encrypted Password Depot files are not supported.",this.result.success=!1,Promise.resolve(this.result);const o=i.querySelector("passwords");return null==o?(this.result.errorMessage="Missing `passwordfile > passwords` node.",this.result.success=!1,Promise.resolve(this.result)):(this.buildFavouritesLookupTable(i),this.querySelectorAllDirectChild(o,"group").forEach(e=>{this.traverse(e,"")}),this.organization&&this.moveFoldersToCollections(this.result),this.result.success=!0,Promise.resolve(this.result))}traverse(e,t){const i=this.result.folders.length;let n=t;""!==n&&(n+="/");const r=e.attributes.getNamedItem("fingerprint");if(""!=(null==r?void 0:r.textContent)&&"null"!=r.textContent){const t=e.attributes.getNamedItem("name");n+=null==t?"-":t.textContent;const i=new b.u;i.name=n,this.result.folders.push(i)}this.querySelectorAllDirectChild(e,"item").forEach(e=>{const t=this.result.ciphers.length,r=this.initLoginCipher();let s=Qe.Password;const o=e.children;for(let i=0;i<o.length;i++){const e=o[i];if("hitems"!==e.tagName)if("description"!==e.tagName)if("comment"!==e.tagName)if("type"!==e.tagName)(s!==Qe.Password&&s!==Qe.RDP&&s!==Qe.Putty&&s!==Qe.TeamViewer&&s!==Qe.Banking&&s!==Qe.Certificate&&s!==Qe.EncryptedFile||!this.parseLoginFields(e,r))&&("fingerprint"===e.tagName&&this._favouritesLookupTable.has(e.textContent)&&(r.favorite=!0),"customfields"!==e.tagName?s!==Qe.Banking||"tans"!==e.tagName?this.processKvp(r,e.tagName,e.textContent,f.PU.Text):this.querySelectorAllDirectChild(e,"tan").forEach(e=>{this.parseBankingTANs(e,r)}):this.parseCustomFields(e,s,r));else switch(s=e.textContent,s){case Qe.Password:case Qe.RDP:case Qe.Putty:case Qe.TeamViewer:case Qe.Banking:case Qe.Certificate:case Qe.EncryptedFile:r.type=f.gC.Login,r.login=new R.r;break;case Qe.CreditCard:r.type=f.gC.Card,r.card=new A.G;break;case Qe.SoftwareLicense:case Qe.Information:case Qe.Document:r.type=f.gC.SecureNote,r.secureNote=new P.Z,r.secureNote.type=f.ak.Generic;break;case Qe.Identity:r.type=f.gC.Identity,r.identity=new Z.O}else r.notes=e.textContent;else r.name=e.textContent}this.cleanupCipher(r),this.result.ciphers.push(r),""!==n&&this.result.folderRelationships.push([t,i])}),this.querySelectorAllDirectChild(e,"group").forEach(e=>{this.traverse(e,n)})}parseCustomFields(e,t,i){this.querySelectorAllDirectChild(e,"field").forEach(e=>{const n=this.parseCustomField(e);if(null!=n){switch(t){case Qe.CreditCard:if(this.parseCreditCardCustomFields(n,i))return;break;case Qe.Identity:if(this.parseIdentityCustomFields(n,i))return;break;case Qe.Information:if(this.parseInformationCustomFields(n,i))return}this.processKvp(i,n.name,n.value,n.type)}})}parseLoginFields(e,t){return"username"===e.tagName?(t.login.username=e.textContent,!0):"password"===e.tagName?(t.login.password=e.textContent,!0):"url"===e.tagName&&(t.login.uris=this.makeUriArray(e.textContent),!0)}parseCustomField(e){let t,i,n,r=et.Memo;if(e.hasAttributes()){if(t=e.getAttribute("name"),null==t)return null;i=e.getAttribute("value");const s=e.getAttribute("type");r=null!=s?s:et.Memo,n=e.getAttribute("visible")}else{const s=this.querySelectorDirectChild(e,"name");if(t=null!=s?s.textContent:null,null==t)return null;const o=this.querySelectorDirectChild(e,"value");i=null!=o?o.textContent:null;const a=this.querySelectorDirectChild(e,"type");r=null!=a?a.textContent:et.Memo;const l=this.querySelectorDirectChild(e,"visible");n=null!=l?l.textContent:null}if(r===et.Date&&!isNaN(i)){const e=parseInt(i);i=new Date((e-25569)*(1e3*86400)).toLocaleDateString()}return r===et.Password?{name:t,value:i,type:f.PU.Hidden,linkedId:null}:r===et.Boolean?{name:t,value:i,type:f.PU.Boolean,linkedId:null}:"0"==n?{name:t,value:i,type:f.PU.Hidden,linkedId:null}:{name:t,value:i,type:f.PU.Text,linkedId:null}}parseCreditCardCustomFields(e,t){return"IDS_CardHolder"===e.name?(t.card.cardholderName=e.value,!0):"IDS_CardNumber"===e.name?(t.card.number=e.value,t.card.brand=A.G.getCardBrandByPatterns(t.card.number),!0):"IDS_CardExpires"===e.name?(this.setCardExpiration(t,e.value),!0):"IDS_CardCode"===e.name&&(t.card.code=e.value,!0)}parseIdentityCustomFields(e,t){return"IDS_IdentityName"===e.name?(this.processFullName(t,e.value),!0):"IDS_IdentityEmail"===e.name?(t.identity.email=e.value,!0):"IDS_IdentityFirstName"===e.name?(t.identity.firstName=e.value,!0):"IDS_IdentityLastName"===e.name?(t.identity.lastName=e.value,!0):"IDS_IdentityCompany"===e.name?(t.identity.company=e.value,!0):"IDS_IdentityAddress1"===e.name?(t.identity.address1=e.value,!0):"IDS_IdentityAddress2"===e.name?(t.identity.address2=e.value,!0):"IDS_IdentityCity"===e.name?(t.identity.city=e.value,!0):"IDS_IdentityState"===e.name?(t.identity.state=e.value,!0):"IDS_IdentityZIP"===e.name?(t.identity.postalCode=e.value,!0):"IDS_IdentityCountry"===e.name?(t.identity.country=e.value,!0):"IDS_IdentityPhone"===e.name&&(t.identity.phone=e.value,!0)}parseInformationCustomFields(e,t){return"IDS_InformationText"===e.name&&(t.notes=e.value,!0)}parseBankingTANs(e,t){let i="0";const n=e.children;for(let r=0;r<n.length;r++){const e=n[r];"number"!==e.tagName?this.processKvp(t,`tan_${i}_${e.tagName}`,e.textContent):i=e.textContent}}buildFavouritesLookupTable(e){const t=this.querySelectorDirectChild(e,"favorites");if(null==t)return;const i=atob(t.textContent);i.indexOf("\r\n")>0?i.split("\r\n").forEach(e=>{this._favouritesLookupTable.add(e)}):i.split("\n").forEach(e=>{this._favouritesLookupTable.add(e)})}}class it extends x{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelectorAll("PasswordManager > record");return Array.from(n).forEach(e=>{const i=this.querySelectorDirectChild(e,"Category"),n=null==i||this.isNullOrWhitespace(i.textContent)||"Unfiled"===i.textContent?null:i.textContent;this.processFolder(t,n);const r=this.querySelectorDirectChild(e,"Account-Name"),s=this.querySelectorDirectChild(e,"User-Id"),o=this.querySelectorDirectChild(e,"Password"),a=this.querySelectorDirectChild(e,"URL"),l=this.querySelectorDirectChild(e,"Notes"),c=this.initLoginCipher();c.name=null!=r?this.getValueOrDefault(r.textContent,"--"):"--",c.notes=null!=l?this.getValueOrDefault(l.textContent):"",c.login.username=null!=s?this.getValueOrDefault(s.textContent):null,c.login.password=null!=o?this.getValueOrDefault(o.textContent):null,c.login.uris=null!=a?this.makeUriArray(a.textContent):null;const d=[];for(let t=1;t<=10;t++)d.push("Attribute-"+t);this.querySelectorAllDirectChild(e,d.join(",")).forEach(e=>{this.isNullOrWhitespace(e.textContent)||"null"===e.textContent||this.processKvp(c,e.tagName,e.textContent)}),this.cleanupCipher(c),t.ciphers.push(c)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class nt extends x{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelector("passwordsafe");if(null==n)return t.errorMessage="Missing `passwordsafe` node.",t.success=!1,Promise.resolve(t);const r=n.getAttribute("delimiter"),s=i.querySelectorAll("passwordsafe > entry");return Array.from(s).forEach(e=>{const i=this.querySelectorDirectChild(e,"group"),n=null==i||this.isNullOrWhitespace(i.textContent)?null:i.textContent.split(".").join("/");this.processFolder(t,n);const s=this.querySelectorDirectChild(e,"title"),o=this.querySelectorDirectChild(e,"username"),a=this.querySelectorDirectChild(e,"email"),l=this.querySelectorDirectChild(e,"password"),c=this.querySelectorDirectChild(e,"url"),d=this.querySelectorDirectChild(e,"notes"),u=this.initLoginCipher();u.name=null!=s?this.getValueOrDefault(s.textContent,"--"):"--",u.notes=null!=d?this.getValueOrDefault(d.textContent,"").split(r).join("\n"):null,u.login.username=null!=o?this.getValueOrDefault(o.textContent):null,u.login.password=null!=l?this.getValueOrDefault(l.textContent):null,u.login.uris=null!=c?this.makeUriArray(c.textContent):null,this.isNullOrWhitespace(u.login.username)&&null!=a?u.login.username=this.getValueOrDefault(a.textContent):null==a||this.isNullOrWhitespace(a.textContent)||(u.notes=this.isNullOrWhitespace(u.notes)?"Email: "+a.textContent:u.notes+"\nEmail: "+a.textContent),this.cleanupCipher(u),t.ciphers.push(u)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}}class rt extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(e.length<1)return;e.length>5&&this.processFolder(t,e[5]);const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--"),e.length>4&&(i.notes=this.getValueOrDefault(e[4],"").split("¬").join("\n")),e.length>2&&(i.login.username=this.getValueOrDefault(e[2])),e.length>3&&(i.login.password=this.getValueOrDefault(e[3])),e.length>1&&(i.login.uris=this.makeUriArray(e[1])),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}}const st={Titel:"Title",Gebruikersnaam:"Username",Wachtwoord:"Password",Gewijzigd:"Modified",Gemaakt:"Created","Verloopt op":"Expire on",Beschrijving:"Description","Gewijzigd door":"Modified by"},ot={Titel:"Title",Benutzername:"Username",Konto:"Account",Passwort:"Password","Geändert am":"Modified","Erstellt am":"Created","Läuft ab am":"Expire on",Beschreibung:"Description","Geändert von":"Modified by"},at=new Set(["Title","Username","URL","Password","Description"]);function lt(e){return Object.assign(Object.assign({"User name":"Username"},ot),st)[e]||e}class ct extends x{parse(e){const t=new w,i=this.parseCsv(e,!0,{skipEmptyLines:!0,transformHeader:lt});if(null==i)return t.success=!1,Promise.resolve(t);if(!i[0].Title)return t.success=!1,Promise.resolve(t);let n="";return i.forEach(e=>{if(">>>"==e.Title)return;const i=e.Title;if(i.startsWith("[")&&i.endsWith("]"))return void(n=i.startsWith("/")?i.replace("/",""):i.substring(1,i.length-1));v.A.isNullOrWhitespace(n)||this.processFolder(t,n);const r=this.initLoginCipher();r.name=this.getValueOrDefault(e.Title),r.login.username=this.getValueOrDefault(e.Username),r.notes=this.getValueOrDefault(e.Description),r.login.uris=this.makeUriArray(e.URL),r.login.password=this.getValueOrDefault(e.Password),this.importUnmappedFields(r,e,at),this.convertToNoteIfNeeded(r),this.cleanupCipher(r),t.ciphers.push(r)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}importUnmappedFields(e,t,i){Object.keys(t).filter(e=>!i.has(e)).forEach(i=>{const n=t;this.processKvp(e,i,n[i])})}}function dt(e,t,i,n){let r=t,s=i,o=n;if(e){const a=e.trim().split(/\s+/);r=a[0]||t,o=a.length>1?a[a.length-1]:n,s=a.length>2?a.slice(1,-1).join(" "):i}return{mappedFirstName:r,mappedMiddleName:s,mappedLastName:o}}const ut=Object.freeze({ACTIVE:1,TRASHED:2});class ht extends x{constructor(e){super(),this.i18nService=e,this.mappedIdentityItemKeys=["fullName","firstName","middleName","lastName","email","phoneNumber","company","socialSecurityNumber","passportNumber","licenseNumber","organization","streetAddress","floor","county","city","stateOrProvince","zipOrPostalCode","countryOrRegion"],this.identityItemExtraFieldsKeys=["extraPersonalDetails","extraAddressDetails","extraContactDetails","extraWorkDetails","extraSections"]}processIdentityItemUnmappedAndExtraFields(e,t){Object.keys(t).forEach(i=>{if(this.mappedIdentityItemKeys.includes(i)||this.identityItemExtraFieldsKeys.includes(i)){if(this.identityItemExtraFieldsKeys.includes(i))if("extraSections"!==i){const n=t[i];null==n||n.forEach(t=>{this.processKvp(e,t.fieldName,t.data.content,"hidden"===t.type?f.PU.Hidden:f.PU.Text)})}else{const n=t[i];null==n||n.forEach(t=>{var i;null===(i=t.sectionFields)||void 0===i||i.forEach(t=>{this.processKvp(e,t.fieldName,t.data.content,"hidden"===t.type?f.PU.Hidden:f.PU.Text)})})}}else this.processKvp(e,i,t[i])})}parse(e){var t,i;const n=new w,r=JSON.parse(e);if(null==r||null==r.vaults)return n.success=!1,Promise.resolve(n);if(r.encrypted)return n.success=!1,n.errorMessage=this.i18nService.t("unsupportedEncryptedImport"),Promise.resolve(n);for(const[,s]of Object.entries(r.vaults))for(const e of s.items){if(e.state==ut.TRASHED)continue;const r=this.initLoginCipher();switch(r.name=this.getValueOrDefault(e.data.metadata.name,"--"),r.notes=this.getValueOrDefault(e.data.metadata.note),r.favorite=e.pinned,e.data.type){case"login":{const t=e.data.content;r.login.uris=this.makeUriArray(t.urls),r.login.username=this.getValueOrDefault(t.itemUsername),null==r.login.username?r.login.username=this.getValueOrDefault(t.itemEmail):this.processKvp(r,"email",t.itemEmail),r.login.password=this.getValueOrDefault(t.password),r.login.totp=this.getValueOrDefault(t.totpUri);for(const i of e.data.extraFields)this.processKvp(r,i.fieldName,"totp"==i.type?i.data.totpUri:i.data.content,"text"==i.type?f.PU.Text:f.PU.Hidden);break}case"note":r.type=f.gC.SecureNote,r.secureNote=new P.Z,r.secureNote.type=f.ak.Generic;break;case"creditCard":{const t=e.data.content;r.type=f.gC.Card,r.card=new A.G,r.card.cardholderName=this.getValueOrDefault(t.cardholderName),r.card.number=this.getValueOrDefault(t.number),r.card.brand=A.G.getCardBrandByPatterns(t.number),r.card.code=this.getValueOrDefault(t.verificationNumber),this.isNullOrWhitespace(t.expirationDate)||(r.card.expMonth=t.expirationDate.substring(5,7),r.card.expMonth=r.card.expMonth.replace(/^0+/,""),r.card.expYear=t.expirationDate.substring(0,4)),this.isNullOrWhitespace(t.pin)||this.processKvp(r,"PIN",t.pin,f.PU.Hidden);break}case"identity":{const n=e.data.content;r.type=f.gC.Identity,r.identity=new Z.O;const{mappedFirstName:s,mappedMiddleName:o,mappedLastName:a}=dt(this.getValueOrDefault(n.fullName),this.getValueOrDefault(n.firstName),this.getValueOrDefault(n.middleName),this.getValueOrDefault(n.lastName));r.identity.firstName=s,r.identity.middleName=o,r.identity.lastName=a,r.identity.email=this.getValueOrDefault(n.email),r.identity.phone=this.getValueOrDefault(n.phoneNumber),r.identity.company=this.getValueOrDefault(n.company),r.identity.ssn=this.getValueOrDefault(n.socialSecurityNumber),r.identity.passportNumber=this.getValueOrDefault(n.passportNumber),r.identity.licenseNumber=this.getValueOrDefault(n.licenseNumber);const l=`${null!==(t=n.floor)&&void 0!==t?t:""} ${null!==(i=n.county)&&void 0!==i?i:""}`.trim();r.identity.address1=this.getValueOrDefault(n.organization),r.identity.address2=this.getValueOrDefault(n.streetAddress),r.identity.address3=this.getValueOrDefault(l),r.identity.city=this.getValueOrDefault(n.city),r.identity.state=this.getValueOrDefault(n.stateOrProvince),r.identity.postalCode=this.getValueOrDefault(n.zipOrPostalCode),r.identity.country=this.getValueOrDefault(n.countryOrRegion),this.processIdentityItemUnmappedAndExtraFields(r,n);for(const t of e.data.extraFields)this.processKvp(r,t.fieldName,t.data.content,"hidden"===t.type?f.PU.Hidden:f.PU.Text);break}default:continue}this.processFolder(n,s.name),this.cleanupCipher(r),n.ciphers.push(r)}return this.organization&&this.moveFoldersToCollections(n),n.success=!0,Promise.resolve(n)}}class pt extends x{constructor(){super(...arguments),this.WEBSITE_mappedValues=new Set(["type","name","website_password_title","website_password_notes","website_password_username","website_password_password","website_password_url","autosubmit","website_password_auto_submit","urlfilter","website_password_url_filter"]),this.APP_PWD_mappedValues=new Set(["type","name","application_password_title","application_password_notes","application_password_username","application_password_password"]),this.BOOKMARK_mappedValues=new Set(["type","name","bookmark_title","bookmark_notes","bookmark_url"]),this.NOTES_mappedValues=new Set(["type","name","note_title","note_notes"]),this.TOTP_mappedValues=new Set(["type","name","totp_title","totp_notes","totp_code"]),this.ENV_VARIABLES_mappedValues=new Set(["type","name","environment_variables_title","environment_variables_notes","environment_variables_variables"]),this.GPG_mappedValues=new Set(["type","name","mail_gpg_own_key_title","mail_gpg_own_key_public","mail_gpg_own_key_name","mail_gpg_own_key_email","mail_gpg_own_key_private"])}parse(e){const t=new w,i=JSON.parse(e);return null==i?(t.success=!1,Promise.resolve(t)):(this.parseFolders(t,i.folders),this.handleItemParsing(t,i.items),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}parseFolders(e,t,i){null!=t&&0!==t.length&&t.forEach(t=>{const n=null!=t.items&&t.items.length>0,r=null!=t.folders&&t.folders.length>0;(n||r)&&(v.A.isNullOrWhitespace(i)||(t.name=i+"/"+t.name),r&&this.parseFolders(e,t.folders,t.name),n?this.handleItemParsing(e,t.items,t.name):this.processFolder(e,t.name,n))})}handleItemParsing(e,t,i){null!=t&&0!==t.length&&t.forEach(t=>{const n=this.parsePsonoItem(t);this.processFolder(e,i,!0),this.cleanupCipher(n),e.ciphers.push(n)})}parsePsonoItem(e){const t=this.initLoginCipher();switch(e.type){case"website_password":this.parseWebsiteLogins(e,t);break;case"application_password":this.parseApplicationPasswords(e,t);break;case"environment_variables":this.parseEnvironmentVariables(e,t);break;case"totp":this.parseTOTP(e,t);break;case"bookmark":this.parseBookmarks(e,t);break;case"note":this.parseNotes(e,t)}return t}parseWebsiteLogins(e,t){var i;null!=e&&"website_password"==e.type&&(t.name=e.website_password_title,t.notes=e.website_password_notes,t.login.username=e.website_password_username,t.login.password=e.website_password_password,t.login.uris=this.makeUriArray(e.website_password_url),this.processKvp(t,"website_password_auto_submit",null===(i=e.website_password_auto_submit)||void 0===i?void 0:i.toString(),f.PU.Boolean),this.processKvp(t,"website_password_url_filter",e.website_password_url_filter),this.importUnmappedFields(t,e,this.WEBSITE_mappedValues))}parseApplicationPasswords(e,t){null!=e&&"application_password"==e.type&&(t.name=e.application_password_title,t.notes=e.application_password_notes,t.login.username=e.application_password_username,t.login.password=e.application_password_password,this.importUnmappedFields(t,e,this.APP_PWD_mappedValues))}parseBookmarks(e,t){null!=e&&"bookmark"==e.type&&(t.name=e.bookmark_title,t.notes=e.bookmark_notes,t.login.uris=this.makeUriArray(e.bookmark_url),this.importUnmappedFields(t,e,this.BOOKMARK_mappedValues))}parseNotes(e,t){null!=e&&"note"==e.type&&(t.type=f.gC.SecureNote,t.secureNote=new P.Z,t.secureNote.type=f.ak.Generic,t.name=e.note_title,t.notes=e.note_notes,this.importUnmappedFields(t,e,this.NOTES_mappedValues))}parseTOTP(e,t){null!=e&&"totp"==e.type&&(t.name=e.totp_title,t.notes=e.totp_notes,t.login.totp=e.totp_code,this.importUnmappedFields(t,e,this.TOTP_mappedValues))}parseEnvironmentVariables(e,t){null!=e&&"environment_variables"==e.type&&(t.type=f.gC.SecureNote,t.secureNote=new P.Z,t.secureNote.type=f.ak.Generic,t.name=e.environment_variables_title,t.notes=e.environment_variables_notes,e.environment_variables_variables.forEach(e=>{this.processKvp(t,e.key,e.value)}),this.importUnmappedFields(t,e,this.ENV_VARIABLES_mappedValues))}parseGPG(e,t){null!=e&&"mail_gpg_own_key"==e.type&&(t.type=f.gC.SecureNote,t.secureNote=new P.Z,t.secureNote.type=f.ak.Generic,t.name=e.mail_gpg_own_key_title,t.notes=e.mail_gpg_own_key_public,this.processKvp(t,"mail_gpg_own_key_name",e.mail_gpg_own_key_name),this.processKvp(t,"mail_gpg_own_key_email",e.mail_gpg_own_key_email),this.processKvp(t,"mail_gpg_own_key_private",e.mail_gpg_own_key_private,f.PU.Hidden),this.importUnmappedFields(t,e,this.GPG_mappedValues))}importUnmappedFields(e,t,i){Object.keys(t).filter(e=>!i.has(e)).forEach(i=>{const n=t;this.processKvp(e,i,n[i].toString())})}}class mt extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if("true"===e.trash)return;const i=this.initLoginCipher();if(i.name=this.getValueOrDefault(e.name),i.notes=this.getValueOrDefault(e.notes),"LoginItem"===e.type)i.login.uris=this.makeUriArray(e.website),i.login.password=this.getValueOrDefault(e.password),i.login.username=this.getValueOrDefault(e.username);else if("CreditCardItem"===e.type){i.type=f.gC.Card,i.card=new A.G,i.card.cardholderName=this.getValueOrDefault(e.cardholder),i.card.number=this.getValueOrDefault(e.number),i.card.brand=A.G.getCardBrandByPatterns(i.card.number),i.card.code=this.getValueOrDefault(e.verification);try{const t=this.getValueOrDefault(e.expiryMonth);if(null!=t){const e=parseInt(t,null);null!=e&&e>=1&&e<=12&&(i.card.expMonth=e.toString())}}catch(n){}try{const t=this.getValueOrDefault(e.expiryYear);if(null!=t){const e=parseInt(t,null);null!=e&&(i.card.expYear=e.toString())}}catch(r){}const t=this.getValueOrDefault(e.pin);null!=t&&this.processKvp(i,"PIN",t);const s=this.getValueOrDefault(e.zipCode);null!=s&&this.processKvp(i,"Zip Code",s)}this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class vt extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);if(null==i)return t.success=!1,Promise.resolve(t);let n=1;return i.forEach(e=>{const r=!this.isNullOrWhitespace(e.Folder)&&e.Folder.startsWith("/")?e.Folder.replace("/",""):e.Folder,s=this.isNullOrWhitespace(r)?null:r;this.processFolder(t,s);const o=this.initLoginCipher();o.notes=this.getValueOrDefault(e.Note),o.name=this.getValueOrDefault(e.Name,"--"),o.login.username=this.getValueOrDefault(e.Login),o.login.password=this.getValueOrDefault(e.Pwd),o.login.uris=this.makeUriArray(e.Url),this.isNullOrWhitespace(e.Rf_fields)?this.isNullOrWhitespace(e.RfFieldsV2)||this.parseRfFieldsV2(o,e):this.parseRfFields(o,e),this.convertToNoteIfNeeded(o),this.cleanupCipher(o),n===i.length&&"--"===o.name&&this.isNullOrWhitespace(o.login.password)||(t.ciphers.push(o),n++)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}parseRfFields(e,t){let i=[t.Rf_fields];null!=t.__parsed_extra&&t.__parsed_extra.length>0&&(i=i.concat(t.__parsed_extra)),i.forEach(t=>{const i=t.split(":");if(i.length<3)return;const n="-no-name-"===i[0]?null:i[0],r=4===i.length&&"rck"===i[2]?i[1]:i[2];this.processKvp(e,n,r)})}parseRfFieldsV2(e,t){let i=[t.RfFieldsV2];null!=t.__parsed_extra&&t.__parsed_extra.length>0&&(i=i.concat(t.__parsed_extra));let n=1,r=1;i.forEach(t=>{const i=t.split(",");if(i.length<5)return;const s="-no-name-"===i[0]?null:i[0],o="pwd"===i[3]?f.PU.Hidden:f.PU.Text,a=i[4];if("TOTP KEY$"===s)return void(e.login.totp=a);if("User ID$"===s&&a===e.login.username)return;if("Password$"===s&&a===e.login.password)return;let l=s;"User ID$"===s?l="Alternate User ID "+n++:"Password$"===s&&(l="Alternate Password "+r++),this.processKvp(e,l,a,o)})}}class ft extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{var i;const n=this.initLoginCipher();n.name=this.getValueOrDefault(e.Title,"--"),n.login.username=this.getValueOrDefault(e.Username),n.login.password=this.getValueOrDefault(e.Password),n.login.uris=this.makeUriArray(null!==(i=e.Url)&&void 0!==i?i:e.URL),n.login.totp=this.getValueOrDefault(e.OTPAuth),n.notes=this.getValueOrDefault(e.Notes),this.cleanupCipher(n),t.ciphers.push(n)}),t.success=!0,Promise.resolve(t))}}class gt extends x{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);if(null==i.querySelector("database"))return t.errorMessage="Missing `database` node.",t.success=!1,Promise.resolve(t);const n=new Map;return Array.from(i.querySelectorAll("database > label")).forEach(e=>{const i=e.getAttribute("name"),r=e.getAttribute("id");if(!this.isNullOrWhitespace(i)&&!this.isNullOrWhitespace(r)){n.set(r,t.folders.length);const e=new b.u;e.name=i,t.folders.push(e)}}),Array.from(i.querySelectorAll("database > card")).forEach(e=>{if("true"===e.getAttribute("template")||"true"===e.getAttribute("deleted"))return;const i=this.querySelectorDirectChild(e,"label_id");if(null!=i){const e=i.textContent;!this.isNullOrWhitespace(e)&&n.has(e)&&t.folderRelationships.push([t.ciphers.length,n.get(e)])}const r=this.initLoginCipher();r.name=this.getValueOrDefault(e.getAttribute("title"),"--"),"true"===e.getAttribute("star")&&(r.favorite=!0);"note"===e.getAttribute("type")?(r.type=f.gC.SecureNote,r.secureNote=new P.Z,r.secureNote.type=f.ak.Generic):Array.from(this.querySelectorAllDirectChild(e,"field")).forEach(e=>{const t=e.textContent;if(this.isNullOrWhitespace(t))return;const i=e.getAttribute("name"),n=this.getValueOrDefault(e.getAttribute("type"),"").toLowerCase();"login"===n?r.login.username=t:"password"===n||"secret"===n?this.processKvp(r,i,t,f.PU.Hidden):"one_time_password"===n?r.login.totp=t:"notes"===n?r.notes+=t+"\n":"weblogin"===n||"website"===n?r.login.uris.push(...this.makeUriArray(t)):this.processKvp(r,i,t)}),Array.from(this.querySelectorAllDirectChild(e,"notes")).forEach(e=>{r.notes+=e.textContent+"\n"}),this.setPassword(r),this.cleanupCipher(r),t.ciphers.push(r)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}setPassword(e){const t=e.fields.filter(e=>e.type===f.PU.Hidden);if(!t.length)return;let i;for(const n of t)if(this.passwordFieldNames.includes(n.name.toLowerCase())){i=n,e.fields=e.fields.filter(e=>e!==i);break}i||(i=t[0]),e.login.password=i.value}}class yt extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(this.nameFromUrl(e.url),"--"),i.notes=this.getValueOrDefault(e.notes),i.login.username=this.getValueOrDefault(e.username),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.url),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class bt extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);if(null==i)return t.success=!1,Promise.resolve(t);const n=Object.keys(i[0]).find(e=>/url/i.test(e));return i.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.Title),i.notes=this.getValueOrDefault(e.Comment),i.login.uris=this.makeUriArray(e[n]),i.login.password=this.getValueOrDefault(e.Password),i.login.username=this.getValueOrDefault(e.Username),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t)}}class wt extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(e.length<3)return;this.processFolder(t,this.getValueOrDefault(e[e.length-1]));const i=this.initLoginCipher();i.notes=this.getValueOrDefault(e[e.length-2],""),i.name=this.getValueOrDefault(e[1],"--"),"Web Logins"===e[0]||"Servers"===e[0]||"Email Accounts"===e[0]?(i.login.username=this.getValueOrDefault(e[2]),i.login.password=this.getValueOrDefault(e[3]),i.login.uris=this.makeUriArray(e[4]),this.parseFieldsToNotes(i,5,e)):this.parseFieldsToNotes(i,2,e),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}parseFieldsToNotes(e,t,i){for(let n=t;n<i.length-3;n++)this.isNullOrWhitespace(i[n])||(e.notes+=i[n]+"\n")}}class St extends x{parse(e){const t=new w,i=this.parseXml(e);if(null==i)return t.success=!1,Promise.resolve(t);const n=i.querySelectorAll("root > Database > Logins > Login");return Array.from(n).forEach(e=>{const n=e.getAttribute("ID");if(this.isNullOrWhitespace(n))return;const r=e.getAttribute("Name"),s=e.getAttribute("Password");let o=null,a=null,l=null,c=null,d=null;const u=i.querySelector('root > Database > Accounts > Account > LoginLinks > Login[SourceLoginID="'+n+'"]');if(null!=u){const e=u.parentElement.parentElement;null!=e&&(o=e.getAttribute("Name"),a=e.getAttribute("Link"),c=e.getAttribute("ParentID"),l=e.getAttribute("Comments"),this.isNullOrWhitespace(l)||(l=l.split("/n").join("\n")))}this.isNullOrWhitespace(c)||(d=this.buildGroupText(i,c,""),this.processFolder(t,d));const h=this.initLoginCipher();h.name=this.getValueOrDefault(o,"--"),h.notes=this.getValueOrDefault(l),h.login.username=this.getValueOrDefault(r),h.login.password=this.getValueOrDefault(s),h.login.uris=this.makeUriArray(a),this.cleanupCipher(h),t.ciphers.push(h)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t)}buildGroupText(e,t,i){const n=e.querySelector('root > Database > Groups > Group[ID="'+t+'"]');return null==n?i:(this.isNullOrWhitespace(i)||(i="/"+i),i=n.getAttribute("Name")+i,this.buildGroupText(e,n.getAttribute("ParentID"),i))}}const It=["kind","autologin","favorite","hexcolor","protectedwithpassword","subdomainonly","type","tk_export_version","note","title","document_content"];class kt extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();if(i.favorite="true"===this.getValueOrDefault(e.favorite,"").toLowerCase(),i.name=this.getValueOrDefault(e.name,"--"),i.notes=this.getValueOrDefault(e.memo,""),i.login.username=this.getValueOrDefault(e.login),i.login.password=this.getValueOrDefault(e.password),i.login.uris=this.makeUriArray(e.url),"login"!==e.kind&&(i.name=this.getValueOrDefault(e.title,"--"),i.notes=this.getValueOrDefault(e.note,"")),"cc"===e.kind){if(i.type=f.gC.Card,i.card=new A.G,i.card.cardholderName=this.getValueOrDefault(e.cardholder),i.card.number=this.getValueOrDefault(e.number),i.card.brand=A.G.getCardBrandByPatterns(i.card.number),!this.isNullOrWhitespace(e.expiryDate))try{const t=new Date(e.expiryDate);i.card.expYear=t.getFullYear().toString(),i.card.expMonth=(t.getMonth()+1).toString()}catch(n){}}else if("login"!==e.kind){i.type=f.gC.SecureNote,i.secureNote=new P.Z,i.secureNote.type=f.ak.Generic,this.isNullOrWhitespace(i.notes)||(i.notes=this.getValueOrDefault(e.document_content,""));for(const t in e)e.hasOwnProperty(t)&&It.indexOf(t.toLowerCase())<0&&!this.isNullOrWhitespace(e[t])&&this.processKvp(i,t,e[t])}this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class Ct extends x{parse(e){const t=new w,i=this.parseCsv(e,!1);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(5!==e.length)return;const i=this.initLoginCipher();i.name=this.getValueOrDefault(e[0],"--"),i.notes=this.getValueOrDefault(e[4]),i.login.username=this.getValueOrDefault(e[1]),i.login.password=this.getValueOrDefault(e[2]),i.login.uris=this.makeUriArray(e[3]),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class Tt extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{const i=this.initLoginCipher();i.name=this.getValueOrDefault(e.Name,"--"),i.login.username=this.getValueOrDefault(e["User name"]),i.login.password=this.getValueOrDefault(e.Password),i.login.uris=this.makeUriArray(e.URL),this.cleanupCipher(i),t.ciphers.push(i)}),t.success=!0,Promise.resolve(t))}}class Ft extends x{parse(e){const t=new w,i=this.parseCsv(e,!0);return null==i?(t.success=!1,Promise.resolve(t)):(i.forEach(e=>{if(this.isNullOrWhitespace(e["Password Name"])&&this.isNullOrWhitespace(e["Secret Name"]))return;this.processFolder(t,this.getValueOrDefault(e["Folder Name"]));const i=this.initLoginCipher();i.favorite="1"===this.getValueOrDefault(e.Favorite,"0"),i.notes=this.getValueOrDefault(e.Notes),i.name=this.getValueOrDefault(e["Password Name"],this.getValueOrDefault(e["Secret Name"],"--")),i.login.uris=this.makeUriArray(this.getValueOrDefault(e["Password URL"],this.getValueOrDefault(e["Secret URL"]))),i.login.totp=this.getValueOrDefault(e.login_totp),this.parseData(i,e.SecretData),this.parseData(i,e.CustomData),this.convertToNoteIfNeeded(i),this.cleanupCipher(i),t.ciphers.push(i)}),this.organization&&this.moveFoldersToCollections(t),t.success=!0,Promise.resolve(t))}parseData(e,t){if(this.isNullOrWhitespace(t))return;this.splitNewLine(t).forEach(t=>{const i=t.indexOf(":");if(i<0)return;const n=t.substring(0,i),r=t.length>i?t.substring(i+1):null;if(this.isNullOrWhitespace(n)||this.isNullOrWhitespace(r)||"SecretType"===n)return;const s=n.toLowerCase();null==e.login.username&&this.usernameFieldNames.indexOf(s)>-1?e.login.username=r:null==e.login.password&&this.passwordFieldNames.indexOf(s)>-1?e.login.password=r:this.processKvp(e,n,r)})}}const Rt=[{id:"bitwardenjson",name:"Bitwarden (json)"},{id:"bitwardencsv",name:"Bitwarden (csv)"},{id:"chromecsv",name:"Chrome"},{id:"dashlanecsv",name:"Dashlane (csv)"},{id:"firefoxcsv",name:"Firefox (csv)"},{id:"keepass2xml",name:"KeePass 2 (xml)"},{id:"lastpasscsv",name:"LastPass"},{id:"safaricsv",name:"Safari and macOS (csv)"},{id:"1password1pux",name:"1Password (1pux/json)"}],Pt=[{id:"keepassxcsv",name:"KeePassX (csv)"},{id:"1password1pif",name:"1Password (1pif)"},{id:"1passwordwincsv",name:"1Password 6 and 7 Windows (csv)"},{id:"1passwordmaccsv",name:"1Password 6 and 7 Mac (csv)"},{id:"dashlanejson",name:"Dashlane (json)"},{id:"roboformcsv",name:"RoboForm (csv)"},{id:"keepercsv",name:"Keeper (csv)"},{id:"enpasscsv",name:"Enpass (csv)"},{id:"enpassjson",name:"Enpass (json)"},{id:"protonpass",name:"ProtonPass (zip/json)"},{id:"safeincloudxml",name:"SafeInCloud (xml)"},{id:"pwsafexml",name:"Password Safe - pwsafe.org (xml)"},{id:"stickypasswordxml",name:"Sticky Password (xml)"},{id:"msecurecsv",name:"mSecure (csv)"},{id:"truekeycsv",name:"True Key (csv)"},{id:"passwordbossjson",name:"Password Boss (json)"},{id:"zohovaultcsv",name:"Zoho Vault (csv)"},{id:"splashidcsv",name:"SplashID (csv)"},{id:"passworddragonxml",name:"Password Dragon (xml)"},{id:"padlockcsv",name:"Padlock (csv)"},{id:"passboltcsv",name:"Passbolt (csv)"},{id:"clipperzhtml",name:"Clipperz (html)"},{id:"aviracsv",name:"Avira (csv)"},{id:"saferpasscsv",name:"SaferPass (csv)"},{id:"upmcsv",name:"Universal Password Manager (csv)"},{id:"ascendocsv",name:"Ascendo DataVault (csv)"},{id:"meldiumcsv",name:"Meldium (csv)"},{id:"passkeepcsv",name:"PassKeep (csv)"},{id:"edgecsv",name:"Edge"},{id:"operacsv",name:"Opera"},{id:"vivaldicsv",name:"Vivaldi"},{id:"bravecsv",name:"Brave"},{id:"gnomejson",name:"GNOME Passwords and Keys/Seahorse (json)"},{id:"blurcsv",name:"Blur (csv)"},{id:"passwordagentcsv",name:"Password Agent (csv)"},{id:"passpackcsv",name:"Passpack (csv)"},{id:"passmanjson",name:"Passman (json)"},{id:"avastcsv",name:"Avast Passwords (csv)"},{id:"avastjson",name:"Avast Passwords (json)"},{id:"fsecurefsk",name:"F-Secure KEY (fsk)"},{id:"kasperskytxt",name:"Kaspersky Password Manager (txt)"},{id:"remembearcsv",name:"RememBear (csv)"},{id:"passwordwallettxt",name:"PasswordWallet (txt)"},{id:"mykicsv",name:"Myki (csv)"},{id:"securesafecsv",name:"SecureSafe (csv)"},{id:"logmeoncecsv",name:"LogMeOnce (csv)"},{id:"blackberrycsv",name:"BlackBerry Password Keeper (csv)"},{id:"buttercupcsv",name:"Buttercup (csv)"},{id:"codebookcsv",name:"Codebook (csv)"},{id:"encryptrcsv",name:"Encryptr (csv)"},{id:"yoticsv",name:"Yoti (csv)"},{id:"nordpasscsv",name:"Nordpass (csv)"},{id:"psonojson",name:"Psono (json)"},{id:"passkyjson",name:"Passky (json)"},{id:"passwordxpcsv",name:"Password XP (csv)"},{id:"netwrixpasswordsecure",name:"Netwrix Password Secure (csv)"},{id:"passworddepot17xml",name:"Password Depot 17 (xml)"}];var xt=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class $t{constructor(e,t,i,n,r,s,o,a,l,c){this.cipherService=e,this.folderService=t,this.importApiService=i,this.i18nService=n,this.collectionService=r,this.keyService=s,this.encryptService=o,this.keyGenerationService=a,this.accountService=l,this.restrictedItemTypesService=c,this.featuredImportOptions=Rt,this.regularImportOptions=Pt}getImportOptions(){return this.featuredImportOptions.concat(this.regularImportOptions)}import(e,t){return xt(this,arguments,void 0,function*(e,t,i=null,n=null,r){let s;try{s=yield e.parse(t)}catch(c){if(c instanceof SyntaxError)throw new Error(this.i18nService.t("importFormatError"));throw c}if(!s.success){if(!v.A.isNullOrWhitespace(s.errorMessage))throw new Error(s.errorMessage);throw new Error(this.i18nService.t("importFormatError"))}if(0===s.folders.length&&0===s.ciphers.length)throw new Error(this.i18nService.t("importNothingError"));if(s.ciphers.length>0){const e=Math.floor(s.ciphers.length/2),t=s.ciphers.length-1;if(this.badData(s.ciphers[0])&&this.badData(s.ciphers[e])&&this.badData(s.ciphers[t]))throw new Error(this.i18nService.t("importFormatError"))}const o=yield(0,a._)(this.restrictedItemTypesService.restricted$.pipe((0,l.T)(e=>e.map(e=>e.cipherType))));if(s.ciphers=s.ciphers.filter(e=>!o.includes(e.type)),i&&!n&&!r){if(s.collectionRelationships.length<s.ciphers.length)throw new Error(this.i18nService.t("importUnassignedItemsError"))}try{yield this.setImportTarget(s,i,n);const e=yield(0,a._)(this.accountService.activeAccount$.pipe(d.F6));null!=i?yield this.handleOrganizationalImport(s,i,e):yield this.handleIndividualImport(s,e)}catch(c){const e=new m._(c,400);throw this.handleServerError(e,s)}return s})}getImporter(e,t,i=null){if(null==t)return null;const n=this.getImporterInstance(e,t);return null==n?null:(n.organizationId=i,n)}getImporterInstance(e,t){if(null==e)return null;switch(e){case"bitwardencsv":return new j;case"bitwardenjson":case"bitwardenpasswordprotected":return new _(this.keyService,this.encryptService,this.i18nService,this.cipherService,this.keyGenerationService,this.accountService,t);case"lastpasscsv":case"passboltcsv":return new Se;case"keepassxcsv":return new be;case"aviracsv":return new O;case"blurcsv":return new X;case"safeincloudxml":return new gt;case"padlockcsv":return new _e;case"keepass2xml":return new ye;case"edgecsv":case"chromecsv":case"operacsv":case"vivaldicsv":case"bravecsv":return new U;case"firefoxcsv":return new ce;case"upmcsv":return new Ct;case"saferpasscsv":return new yt;case"safaricsv":return new ft;case"meldiumcsv":return new ke;case"1password1pif":return new Ge;case"1password1pux":return new Ve;case"1passwordwincsv":return new qe;case"1passwordmaccsv":return new Ke;case"keepercsv":return new we;case"passworddragonxml":return new it;case"enpasscsv":return new oe;case"enpassjson":return new le;case"pwsafexml":return new nt;case"dashlanecsv":return new ie;case"dashlanejson":return new re;case"msecurecsv":return new Ce;case"stickypasswordxml":return new St;case"truekeycsv":return new kt;case"clipperzhtml":return new W;case"roboformcsv":return new vt;case"ascendocsv":return new $;case"passwordbossjson":return new Ze;case"zohovaultcsv":return new Ft;case"splashidcsv":return new wt;case"passkeepcsv":return new Xe;case"gnomejson":return new he;case"passwordagentcsv":return new Je;case"passpackcsv":return new We;case"passmanjson":return new He;case"avastcsv":return new E;case"avastjson":return new D;case"fsecurefsk":return new ue;case"kasperskytxt":return new ge;case"remembearcsv":return new mt;case"passwordwallettxt":return new rt;case"mykicsv":return new Ae;case"securesafecsv":return new bt;case"logmeoncecsv":return new Ie;case"blackberrycsv":return new M;case"buttercupcsv":return new H;case"codebookcsv":return new J;case"encryptrcsv":return new se;case"yoticsv":return new Tt;case"nordpasscsv":return new Me;case"psonojson":return new pt;case"passkyjson":return new Ye;case"protonpass":return new ht(this.i18nService);case"passwordxpcsv":return new ct;case"netwrixpasswordsecure":return new Oe;case"passworddepot17xml":return new tt;default:return null}}handleIndividualImport(e,t){return xt(this,void 0,void 0,function*(){const i=new u;for(let r=0;r<e.ciphers.length;r++){const n=yield this.cipherService.encrypt(e.ciphers[r],t);i.ciphers.push(new g.P(n))}const n=yield(0,a._)(this.keyService.userKey$(t));if(null!=e.folders)for(let t=0;t<e.folders.length;t++){const r=yield this.folderService.encrypt(e.folders[t],n);i.folders.push(new y.T(r))}return null!=e.folderRelationships&&e.folderRelationships.forEach(e=>i.folderRelationships.push(new p(e[0],e[1]))),yield this.importApiService.postImportCiphers(i)})}handleOrganizationalImport(e,t,i){return xt(this,void 0,void 0,function*(){const n=new h;for(let r=0;r<e.ciphers.length;r++){e.ciphers[r].organizationId=t;const s=yield this.cipherService.encrypt(e.ciphers[r],i);n.ciphers.push(new g.P(s))}if(null!=e.collections)for(let r=0;r<e.collections.length;r++){e.collections[r].organizationId=t;const s=yield this.collectionService.encrypt(e.collections[r],i);n.collections.push(new c.hQ(s))}return null!=e.collectionRelationships&&e.collectionRelationships.forEach(e=>n.collectionRelationships.push(new p(e[0],e[1]))),yield this.importApiService.postImportOrganizationCiphers(t,n)})}badData(e){return(null==e.name||"--"===e.name)&&e.type===f.gC.Login&&null!=e.login&&v.A.isNullOrWhitespace(e.login.password)}handleServerError(e,t){if(null==e.validationErrors)return new Error(e.message);let i="";return Object.entries(e.validationErrors).forEach(([e,n],r)=>{let s,o;const a=Number(e.match(/[0-9]+/)[0]);switch(e.match(/^\w+/)[0]){case"Ciphers":s=t.ciphers[a],o=(0,f.g7)(s.type);break;case"Folders":s=t.folders[a],o="Folder";break;case"Collections":s=t.collections[a],o="Collection";break;default:return}r>0&&(i+="\n\n"),"Folder"!==o&&"Collection"!==o&&(i+="["+(a+1)+"] "),i+="["+o+'] "'+s.name+'": '+n}),new Error(i)}setImportTarget(e,t,i){return xt(this,void 0,void 0,function*(){if(!i)return;if(t){if(!(i instanceof c.iY))throw new Error(this.i18nService.t("errorAssigningTargetCollection"));const t=[];if(e.ciphers.forEach((i,n)=>{Array.isArray(e.collectionRelationships)&&e.collectionRelationships.some(([e])=>e===n)||t.push([n,0])}),i.type===c.it.DefaultUserCollection){e.collections=[i];const t=[];return e.ciphers.forEach((e,i)=>{t.push([i,0])}),void(e.collectionRelationships=t)}const n=[...e.collections];e.collections=[i],n.map(t=>{const n=new c.iY(t);n.name=`${i.name}/${t.name}`,e.collections.push(n)});const r=[...e.collectionRelationships];return e.collectionRelationships=[...t],void r.map(t=>{e.collectionRelationships.push([t[0],t[1]+1])})}if(!(i instanceof b.u))throw new Error(this.i18nService.t("errorAssigningTargetFolder"));const n=[];e.ciphers.forEach((e,t)=>{v.A.isNullOrEmpty(e.folderId)&&(e.folderId=i.id,n.push([t,0]))});const r=[...e.folders];e.folders=[i],r.map(t=>{const n=`${i.name}/${t.name}`,r=new b.u;r.name=n,e.folders.push(r)});const s=[...e.folderRelationships];e.folderRelationships=[...n],s.map(t=>{e.folderRelationships.push([t[0],t[1]+1])})})}}class Et{}var At=i(33338),Dt=i(11573),Ot=i(82468),Mt=i(83586);var Ut=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class Gt{constructor(e){this.system=e,this.importers=Mt.qi,this.logger=e.log({type:"ImportMetadataService"}),this.chromiumWithABE$=this.system.configService.getFeatureFlag$(Ot.TO.ChromiumImporterWithABE)}init(){return Ut(this,void 0,void 0,function*(){})}metadata$(e){const t=this.system.environment.getClientType();return(0,At.z)([e,this.chromiumWithABE$]).pipe((0,l.T)(([e,i])=>{var n;if(!this.importers)return{type:e,loaders:[]};const r=this.availableLoaders(this.importers,e,t,i);if(!r||0===r.length)return{type:e,loaders:[]};const s={type:e,loaders:r};return e in this.importers&&(s.instructions=null===(n=this.importers[e])||void 0===n?void 0:n.instructions),this.logger.debug({importType:e,capabilities:s},"capabilities updated"),s}))}availableLoaders(e,t,i,n){let r=function(e,t,i){var n,r;if(!e)return;if(!(t in e))return;return(null!==(r=null===(n=e[t])||void 0===n?void 0:n.loaders)&&void 0!==r?r:[]).filter(e=>Mt.Dt[e].includes(i))}(e,t,i);if(n)return r;if("bravecsv"===t||"chromecsv"===t)try{const e=this.system.environment.getDevice();e===Dt.bq.WindowsDesktop&&(r=null==r?void 0:r.filter(e=>e!==Mt.aH.chromium))}catch(s){r=null==r?void 0:r.filter(e=>e!==Mt.aH.chromium)}return r}}class jt{}},97883:(e,t,i)=>{"use strict";i.d(t,{c:()=>s});var n=i(78781);class r{constructor(e){this.id=e.id,this.rawId=n.A.fromBufferToUrlB64(e.rawId),this.type=e.type,this.extensions={}}}class s extends r{constructor(e){if(super(e),!(e.response instanceof AuthenticatorAssertionResponse))throw new Error("Invalid authenticator response");this.response={authenticatorData:n.A.fromBufferToUrlB64(e.response.authenticatorData),signature:n.A.fromBufferToUrlB64(e.response.signature),clientDataJSON:n.A.fromBufferToUrlB64(e.response.clientDataJSON),userHandle:n.A.fromBufferToUrlB64(e.response.userHandle)}}static fromJSON(e){return Object.assign(Object.create(s.prototype),e)}}},98221:(e,t,i)=>{"use strict";i.d(t,{cH:()=>C,cK:()=>v,Hd:()=>b,jZ:()=>I});var n=i(20702),r=i(47438);class s extends n.r{constructor(e){super(e);const t=this.getResponseProperty("FreeTrial");t&&(this.freeTrial=new o(t));const i=this.getResponseProperty("InactiveSubscription");i&&(this.inactiveSubscription=new a(i));const n=this.getResponseProperty("ResellerRenewal");n&&(this.resellerRenewal=new l(n));const s=this.getResponseProperty("TaxId");s&&(this.taxId=new r.c(s))}}class o extends n.r{constructor(e){super(e),this.remainingTrialDays=this.getResponseProperty("RemainingTrialDays")}}class a extends n.r{constructor(e){super(e),this.resolution=this.getResponseProperty("Resolution")}}class l extends n.r{constructor(e){switch(super(e),this.type=this.getResponseProperty("Type"),this.type){case"upcoming":this.upcoming=new c(this.getResponseProperty("Upcoming"));break;case"issued":this.issued=new d(this.getResponseProperty("Issued"));break;case"past_due":this.pastDue=new u(this.getResponseProperty("PastDue"))}}}class c extends n.r{constructor(e){super(e),this.renewalDate=new Date(this.getResponseProperty("RenewalDate"))}}class d extends n.r{constructor(e){super(e),this.issuedDate=new Date(this.getResponseProperty("IssuedDate")),this.dueDate=new Date(this.getResponseProperty("DueDate"))}}class u extends n.r{constructor(e){super(e),this.suspensionDate=new Date(this.getResponseProperty("SuspensionDate"))}}var h=i(74208),p=i(12012),m=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class v{constructor(e){this.apiService=e,this.getWarnings=e=>m(this,void 0,void 0,function*(){const t=yield this.apiService.send("GET",`/organizations/${e}/billing/vnext/warnings`,null,!0,!0);return new s(t)})}}v.ɵfac=function(e){return new(e||v)(h.KVO(p.G))},v.ɵprov=h.jDH({token:v,factory:v.ɵfac});var f=i(7861),g=i(14055),y=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class b{constructor(e){this.apiService=e,this.getEndpoint=e=>{switch(e.type){case"account":return"/account/billing/vnext";case"organization":return`/organizations/${e.data.id}/billing/vnext`;case"provider":return`/providers/${e.data.id}/billing/vnext`}},this.addCreditWithBitPay=(e,t)=>y(this,void 0,void 0,function*(){const i=`${this.getEndpoint(e)}/credit/bitpay`;try{return{type:"success",value:yield this.apiService.send("POST",i,t,!0,!0)}}catch(n){if(n instanceof f._)return{type:"error",message:n.message};throw n}}),this.getBillingAddress=e=>y(this,void 0,void 0,function*(){const t=`${this.getEndpoint(e)}/address`,i=yield this.apiService.send("GET",t,null,!0,!0);return i?new g.TU(i):null}),this.getCredit=e=>y(this,void 0,void 0,function*(){const t=`${this.getEndpoint(e)}/credit`,i=yield this.apiService.send("GET",t,null,!0,!0);return i||null}),this.getPaymentMethod=e=>y(this,void 0,void 0,function*(){const t=`${this.getEndpoint(e)}/payment-method`,i=yield this.apiService.send("GET",t,null,!0,!0);return i?new g.cD(i).value:null}),this.restartSubscription=(e,t,i)=>y(this,void 0,void 0,function*(){const n=`${this.getEndpoint(e)}/subscription/restart`;yield this.apiService.send("POST",n,{paymentMethod:t,billingAddress:i},!0,!1)}),this.updateBillingAddress=(e,t)=>y(this,void 0,void 0,function*(){const i=`${this.getEndpoint(e)}/address`;try{const e=yield this.apiService.send("PUT",i,t,!0,!0);return{type:"success",value:new g.TU(e)}}catch(n){if(n instanceof f._)return{type:"error",message:n.message};throw n}}),this.updatePaymentMethod=(e,t,i)=>y(this,void 0,void 0,function*(){const n=`${this.getEndpoint(e)}/payment-method`;try{const e=Object.assign(Object.assign({},t),{billingAddress:i}),r=yield this.apiService.send("PUT",n,e,!0,!0);return{type:"success",value:new g.cD(r).value}}catch(r){if(r instanceof f._)return{type:"error",message:r.message};throw r}}),this.verifyBankAccount=(e,t)=>y(this,void 0,void 0,function*(){const i=`${this.getEndpoint(e)}/payment-method/verify-bank-account`;try{const e=yield this.apiService.send("POST",i,{descriptorCode:t},!0,!0);return{type:"success",value:new g.cD(e).value}}catch(n){if(n instanceof f._)return{type:"error",message:n.message};throw n}})}}b.ɵfac=function(e){return new(e||b)(h.KVO(p.G))},b.ɵprov=h.jDH({token:b,factory:b.ɵfac});var w=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class S extends n.r{constructor(e){super(e),this.tax=this.getResponseProperty("Tax"),this.total=this.getResponseProperty("Total")}}class I{constructor(e){this.apiService=e,this.previewTaxForOrganizationSubscriptionPurchase=(e,t)=>w(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/billing/tax/organizations/subscriptions/purchase",{purchase:e,billingAddress:t},!0,!0);return new S(i)}),this.previewTaxForOrganizationSubscriptionPlanChange=(e,t,i)=>w(this,void 0,void 0,function*(){const n=yield this.apiService.send("POST",`/billing/tax/organizations/${e}/subscription/plan-change`,{plan:t,billingAddress:i},!0,!0);return new S(n)}),this.previewTaxForOrganizationSubscriptionUpdate=(e,t)=>w(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST",`/billing/tax/organizations/${e}/subscription/update`,{update:t},!0,!0);return new S(i)}),this.previewTaxForPremiumSubscriptionPurchase=(e,t)=>w(this,void 0,void 0,function*(){const i=yield this.apiService.send("POST","/billing/tax/premium/subscriptions/purchase",{additionalStorage:e,billingAddress:t},!0,!0);return new S(i)})}}I.ɵfac=function(e){return new(e||I)(h.KVO(p.G))},I.ɵprov=h.jDH({token:I,factory:I.ɵfac});var k=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};class C{constructor(e){this.endpoint="/account/billing/vnext",this.purchasePremiumSubscription=(e,t)=>k(this,void 0,void 0,function*(){const i=`${this.endpoint}/subscription`,n="token"in e?{tokenizedPaymentMethod:e,billingAddress:t}:{nonTokenizedPaymentMethod:e,billingAddress:t};yield this.apiService.send("POST",i,n,!0,!0)}),this.apiService=e}}C.ɵfac=function(e){return new(e||C)(h.KVO(p.G))},C.ɵprov=h.jDH({token:C,factory:C.ɵfac})},98403:(e,t,i)=>{"use strict";i.d(t,{k:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},98479:(e,t,i)=>{"use strict";i.d(t,{p:()=>s});var n=i(74208),r=i(33812);class s{}s.ɵfac=function(e){return new(e||s)},s.ɵmod=r.$C({type:s}),s.ɵinj=n.G2t({})},98850:(e,t,i)=>{"use strict";i.d(t,{s:()=>r});var n=i(20702);class r extends n.r{constructor(e){super(e),this.id=this.getResponseProperty("Id"),this.name=this.getResponseProperty("Name"),this.revisionDate=this.getResponseProperty("RevisionDate")}}},99327:(e,t,i)=>{"use strict";i.d(t,{d:()=>se});var n=i(93161),r=i(77468),s=i(33812),o=i(51757),a=i(66046),l=i(16878),c=i(72737),d=i(72245),u=i(33338),h=i(75811),p=i(80909),m=i(34040),v=i(69194),f=i(3204),g=i(14803),y=i(36359),b=i(8131),w=i(58625),S=i(56962),I=i(20136),k=i(25024),C=i(88832),T=i(75583),F=i(26411),R=i(14318),P=i(27520),x=i(36288),$=i(58950),E=i(33886),A=i(29776),D=i(192),O=i(36801),M=i(8245),U=i(23979),G=i(91261),j=i(58503),N=i(18030),V=i(74208),B=i(69855),z=i(50700),L=i(35500),K=i(60989),q=i(58806),_=i(86226),X=i(93199),Y=i(43759),H=function(e,t,i,n){return new(i||(i=Promise))(function(r,s){function o(e){try{l(n.next(e))}catch(t){s(t)}}function a(e){try{l(n.throw(e))}catch(t){s(t)}}function l(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};const W=e=>({"tw-mb-4":e});function J(e,t){if(1&e&&(s.j41(0,"bit-hint"),s.EFF(1),s.nI1(2,"async"),s.k0s()),2&e){const e=s.XpG();s.R7$(),s.JRh(s.bMT(2,1,e.credentialTypeHint$))}}function Z(e,t){if(1&e&&(s.j41(0,"form",9)(1,"bit-form-field")(2,"bit-label"),s.EFF(3),s.nI1(4,"i18n"),s.k0s(),s.nrm(5,"bit-select",13),s.nI1(6,"async"),s.k0s()()),2&e){const e=s.XpG();s.Y8G("formGroup",e.forwarder),s.R7$(3),s.JRh(s.bMT(4,3,"service")),s.R7$(2),s.Y8G("items",s.bMT(6,5,e.forwarderOptions$))}}function Q(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-catchall-settings",14),s.bIt("onUpdated",function(){V.eBV(e);const t=s.XpG();return V.Njj(t.generate("catchall settings"))}),s.k0s()}if(2&e){s.XpG();const e=s.r8f(37);s.Y8G("account",e)}}function ee(e,t){if(1&e&&s.nrm(0,"tools-forwarder-settings",12),2&e){s.XpG();const e=s.r8f(37);s.Y8G("forwarder",t)("account",e)}}function te(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-subaddress-settings",14),s.bIt("onUpdated",function(){V.eBV(e);const t=s.XpG();return V.Njj(t.generate("subaddress settings"))}),s.k0s()}if(2&e){s.XpG();const e=s.r8f(37);s.Y8G("account",e)}}function ie(e,t){if(1&e){const e=s.RV6();s.j41(0,"tools-username-settings",14),s.bIt("onUpdated",function(){V.eBV(e);const t=s.XpG();return V.Njj(t.generate("username settings"))}),s.k0s()}if(2&e){s.XpG();const e=s.r8f(37);s.Y8G("account",e)}}const ne="forwarder",re="none";class se{constructor(e,t,i,n,r,o,d,u,h){this.generatorService=e,this.generatorHistoryService=t,this.toastService=i,this.logService=n,this.i18nService=r,this.accountService=o,this.zone=d,this.formBuilder=u,this.ariaLive=h,this.Algorithm=A.oG,this.account=null,this.account$=new c.m(1),this.debug=!1,this.log=(0,I.S2)({}),this.website=null,this.onGenerated=new s.bkB,this.onAlgorithm=new s.bkB,this.disableMargin=!1,this.username=this.formBuilder.group({nav:[null]}),this.forwarder=this.formBuilder.group({nav:[null]}),this.typeOptions$=new l.t([]),this.forwarderId$=new l.t(null),this.forwarderOptions$=new l.t([]),this.showForwarder$=new l.t(!1),this.maybeAlgorithm$=new c.m(1),this.algorithm$=this.maybeAlgorithm$.pipe((0,v.p)(e=>!!e)),this.credentialTypeHint$=new c.m(1),this.generatedCredential$=new l.t(void 0),this.value$=this.generatedCredential$.pipe((0,f.T)(e=>{var t;return null!==(t=null==e?void 0:e.credential)&&void 0!==t?t:"-"})),this.generate$=new a.B,this.showAlgorithm$=this.maybeAlgorithm$.pipe((0,p.v)(this.showForwarder$),(0,f.T)(([e,t])=>t?null:e)),this.credentialTypeCopyLabel$=this.algorithm$.pipe((0,f.T)(({i18nKeys:{copyCredential:e}})=>(0,N.Tl)(e,this.i18nService))),this.credentialTypeGenerateLabel$=this.algorithm$.pipe((0,f.T)(({i18nKeys:{generateCredential:e}})=>(0,N.Tl)(e,this.i18nService))),this.credentialTypeLabel$=this.algorithm$.pipe((0,f.T)(({i18nKeys:{credentialType:e}})=>(0,N.Tl)(e,this.i18nService))),this.USER_REQUEST="user request",this.destroyed=new a.B}ngOnChanges(e){return H(this,void 0,void 0,function*(){var t,i;const n=null==e?void 0:e.account;n&&n.currentValue.id&&n.previousValue.id!==n.currentValue.id&&(this.log.debug({previousUserId:null===(t=null==n?void 0:n.previousValue)||void 0===t?void 0:t.id,currentUserId:null===(i=null==n?void 0:n.currentValue)||void 0===i?void 0:i.id},"account input change detected"),this.account$.next(n.currentValue.id))})}ngOnInit(){return H(this,void 0,void 0,function*(){if(this.log=(0,I.mJ)(this.debug,this.logService,{type:"UsernameGeneratorComponent"}),!this.account){const e=yield(0,d._)(this.accountService.activeAccount$);e||this.log.panic("active account cannot be `null`."),this.log.info({userId:e.id},"account not specified; using active account settings"),this.account$.next(e)}(0,u.z)([this.generatorService.algorithms$("email",{account$:this.account$}),this.generatorService.algorithms$("username",{account$:this.account$})]).pipe((0,f.T)(e=>e.flat()),(0,f.T)(e=>{const t=e.filter(e=>!(0,A.$S)(e.id));t.sort((e,t)=>e.weight-t.weight);const i=this.toOptions(t);i.splice(-1,0,{value:ne,label:this.i18nService.t("forwardedEmail")});const n=e.filter(e=>(0,A.$S)(e.id));n.sort((e,t)=>e.weight-t.weight);const r=this.toOptions(n);return r.unshift({value:re,label:this.i18nService.t("select")}),[i,r]}),(0,y.M)(e=>this.log.debug({algorithms:e},"algorithms loaded")),(0,g.Q)(this.destroyed)).subscribe(([e,t])=>{this.zone.run(()=>{this.typeOptions$.next(e),this.forwarderOptions$.next(t)})}),this.maybeAlgorithm$.pipe((0,f.T)(e=>{var t;return(null===(t=null==e?void 0:e.i18nKeys)||void 0===t?void 0:t.description)?(0,N.Tl)(e.i18nKeys.description,this.i18nService):""}),(0,g.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{this.credentialTypeHint$.next(e)})}),this.generatorService.generate$({on$:this.generate$,account$:this.account$}).pipe((0,h.W)((e,t)=>("string"==typeof e?this.toastService.showToast({message:e,variant:"error",title:""}):this.logService.error(e),t)),(0,b.E)(this.account$,this.maybeAlgorithm$),(0,g.Q)(this.destroyed)).subscribe(([e,t,i])=>{var n,r;this.log.debug({source:null!==(n=e.source)&&void 0!==n?n:null,algorithm:null!==(r=null==i?void 0:i.id)&&void 0!==r?r:null},"credential generated"),this.generatorHistoryService.track(t.id,e.credential,e.category,e.generationDate).catch(e=>{this.logService.error(e)}),this.zone.run(()=>{i&&e.source===this.USER_REQUEST&&this.announce((0,N.Tl)(i.i18nKeys.credentialGenerated,this.i18nService)),this.generatedCredential$.next(e),this.onGenerated.next(e)})});const e=new a.B,t=new a.B;this.username.valueChanges.pipe((0,f.T)(e=>{if(e.nav===ne)return{nav:e.nav};if(e.nav)return{nav:e.nav,algorithm:JSON.parse(e.nav)};{const[e]=A.I4[A.ZU.username];return{nav:JSON.stringify(e),algorithm:e}}}),(0,g.Q)(this.destroyed)).subscribe(e),this.forwarder.valueChanges.pipe((0,f.T)(e=>e.nav===re?{nav:e.nav}:e.nav?{nav:e.nav,algorithm:JSON.parse(e.nav)}:{nav:re}),(0,g.Q)(this.destroyed)).subscribe(t),(0,u.z)([e,t]).pipe((0,f.T)(([e,t])=>{const i=!e.algorithm;return[i,i&&t.algorithm&&(0,A.$S)(t.algorithm)?t.algorithm.forwarder:null]}),(0,m.F)((e,t)=>e[0]===t[0]&&e[1]===t[1]),(0,g.Q)(this.destroyed)).subscribe(([e,t])=>{this.log.debug({forwarderId:t,showForwarder:e},"forwarder visibility updated"),this.zone.run(()=>{this.showForwarder$.next(e),this.forwarderId$.next(t)})}),(0,u.z)([e,t]).pipe((0,f.T)(([e,t])=>{var i;const n=null!==(i=e.algorithm)&&void 0!==i?i:t.algorithm;return n?this.generatorService.algorithm(n):null}),(0,m.F)((e,t)=>null!==e&&null!==t&&(0,A.W0)(e.id,t.id)),(0,g.Q)(this.destroyed)).subscribe(e=>{var t;this.log.debug({algorithm:null!==(t=null==e?void 0:e.id)&&void 0!==t?t:null},"algorithm selected"),this.zone.run(()=>{this.maybeAlgorithm$.next(e),e?this.onAlgorithm.next((0,N.VI)(e,this.i18nService)):this.onAlgorithm.next(null)})});const i=yield this.generatorService.preferences({account$:this.account$});this.algorithm$.pipe((0,b.E)(i),(0,g.Q)(this.destroyed)).subscribe(([e,t])=>{if((0,A.MP)(e.id))t.email.algorithm=e.id,t.email.updated=new Date;else{if(!(0,A.yJ)(e.id))return;t.username.algorithm=e.id,t.username.updated=new Date}this.log.info({algorithm:e.id,type:e.type},"algorithm preferences updated"),i.next(t)}),i.pipe((0,f.T)(({email:e,username:t})=>{const i=e.updated>t.updated?e:t,n=(0,A.$S)(i.algorithm)?i:null,r=n?JSON.stringify(n.algorithm):re,s=n?ne:JSON.stringify(i.algorithm);return{username:{selection:{nav:s},active:{nav:s,algorithm:n?void 0:i.algorithm}},forwarder:{selection:{nav:r},active:{nav:r,algorithm:null==n?void 0:n.algorithm}}}}),(0,g.Q)(this.destroyed)).subscribe(({username:i,forwarder:n})=>{this.log.debug({username:i.selection,forwarder:n.selection},"navigation updated"),this.username.setValue(i.selection,{emitEvent:!1}),this.forwarder.setValue(n.selection,{emitEvent:!1}),e.next(i.active),t.next(n.active)}),this.maybeAlgorithm$.pipe((0,g.Q)(this.destroyed)).subscribe(e=>{this.zone.run(()=>{var t;(null===(t=null==e?void 0:e.capabilities)||void 0===t?void 0:t.autogenerate)?(this.log.debug("autogeneration enabled"),this.generate("autogenerate").catch(e=>{this.log.error(e,"a failure occurred during autogeneration")})):(this.log.debug("autogeneration disabled; clearing generated credential"),this.generatedCredential$.next(void 0))})}),this.log.debug("component initialized")})}announce(e){this.ariaLive.announce(e).catch(e=>this.logService.error(e))}generate(e){return H(this,void 0,void 0,function*(){const t=yield(0,d._)(this.algorithm$),i={source:e,algorithm:t.id};this.website&&(i.website=this.website),this.log.debug(i,"generation requested"),this.generate$.next(i)})}toOptions(e){return e.map(e=>({value:JSON.stringify(e.id),label:(0,N.Tl)(e.i18nKeys.name,this.i18nService)}))}ngOnDestroy(){this.destroyed.next(),this.destroyed.complete(),this.generate$.complete(),this.generatedCredential$.complete(),this.onGenerated.complete(),this.log.debug("component destroyed")}}se.ɵfac=function(e){return new(e||se)(s.rXU(A.iE),s.rXU(D.ZS),s.rXU(B.f),s.rXU(S.K),s.rXU(z.W),s.rXU(L.Di),s.rXU(s.SKi),s.rXU(o.ok),s.rXU(K.Ai))},se.ɵcmp=s.VBU({type:se,selectors:[["tools-username-generator"]],inputs:{account:"account",debug:"debug",website:"website",disableMargin:[2,"disableMargin","disableMargin",n.he]},outputs:{onGenerated:"onGenerated",onAlgorithm:"onAlgorithm"},features:[s.OA$],decls:44,vars:58,consts:[[1,"tw-flex","tw-justify-between","tw-mb-4"],[1,"tw-grow","tw-flex","tw-items-center"],[1,"tw-font-mono",3,"password"],[1,"tw-flex","tw-items-center","tw-space-x-1"],["type","button","bitIconButton","bwi-generate","buttonType","main",3,"click","label","disabled"],["type","button","bitIconButton","bwi-clone","buttonType","main","showToast","",3,"label","appCopyClick","valueLabel","disabled"],[3,"disableMargin"],["bitTypography","h6"],[3,"ngClass"],[1,"tw-container",3,"formGroup"],["formControlName","nav","data-testid","username-type",3,"items"],[3,"account"],[3,"forwarder","account"],["formControlName","nav","data-testid","email-forwarding-service",3,"items"],[3,"onUpdated","account"]],template:function(e,t){if(1&e){const e=s.RV6();s.j41(0,"bit-card",0)(1,"div",1),s.nrm(2,"bit-color-password",2),s.nI1(3,"async"),s.k0s(),s.j41(4,"div",3)(5,"button",4),s.nI1(6,"async"),s.nI1(7,"async"),s.bIt("click",function(){return V.eBV(e),V.Njj(t.generate(t.USER_REQUEST))}),s.EFF(8),s.nI1(9,"async"),s.k0s(),s.j41(10,"button",5),s.nI1(11,"async"),s.nI1(12,"async"),s.nI1(13,"async"),s.nI1(14,"async"),s.EFF(15),s.nI1(16,"async"),s.k0s()()(),s.j41(17,"bit-section",6)(18,"bit-section-header")(19,"h2",7),s.EFF(20),s.nI1(21,"i18n"),s.k0s()(),s.j41(22,"div",8)(23,"bit-card")(24,"form",9)(25,"bit-form-field")(26,"bit-label"),s.EFF(27),s.nI1(28,"i18n"),s.k0s(),s.nrm(29,"bit-select",10),s.nI1(30,"async"),s.nVh(31,J,3,3,"bit-hint"),s.nI1(32,"async"),s.k0s()(),s.nVh(33,Z,7,7,"form",9),s.nI1(34,"async"),s.SS7(35),s.nI1(36,"async"),s.SS7(37),s.nI1(38,"async"),s.nVh(39,Q,1,1,"tools-catchall-settings",11),s.nVh(40,ee,1,2,"tools-forwarder-settings",12),s.nI1(41,"async"),s.nVh(42,te,1,1,"tools-subaddress-settings",11),s.nVh(43,ie,1,1,"tools-username-settings",11),s.k0s()()()}if(2&e){let e;s.R7$(2),s.Y8G("password",s.bMT(3,21,t.value$)),s.R7$(3),s.Y8G("label",s.bMT(6,23,t.credentialTypeGenerateLabel$))("disabled",!s.bMT(7,25,t.algorithm$)),s.R7$(3),s.SpI(" ",s.bMT(9,27,t.credentialTypeGenerateLabel$)," "),s.R7$(2),s.Y8G("label",s.bMT(11,29,t.credentialTypeCopyLabel$))("appCopyClick",s.bMT(12,31,t.value$))("valueLabel",s.bMT(13,33,t.credentialTypeLabel$))("disabled",!s.bMT(14,35,t.algorithm$)),s.R7$(5),s.SpI(" ",s.bMT(16,37,t.credentialTypeCopyLabel$)," "),s.R7$(2),s.Y8G("disableMargin",t.disableMargin),s.R7$(3),s.JRh(s.bMT(21,39,"options")),s.R7$(2),s.Y8G("ngClass",s.eq3(56,W,!t.disableMargin)),s.R7$(2),s.Y8G("formGroup",t.username),s.R7$(3),s.JRh(s.bMT(28,41,"type")),s.R7$(2),s.Y8G("items",s.bMT(30,43,t.typeOptions$)),s.R7$(2),s.vxM(s.bMT(32,45,t.credentialTypeHint$)?31:-1),s.R7$(2),s.vxM(s.bMT(34,47,t.showForwarder$)?33:-1);const i=s.bMT(36,49,t.showAlgorithm$);s.R7$(4),s.bH3(s.bMT(38,51,t.account$)),s.R7$(2),s.vxM((null==i?null:i.id)===t.Algorithm.catchall?39:-1),s.R7$(),s.vxM((e=s.bMT(41,54,t.forwarderId$))?40:-1,e),s.R7$(2),s.vxM((null==i?null:i.id)===t.Algorithm.plusAddress?42:-1),s.R7$(),s.vxM((null==i?null:i.id)===t.Algorithm.username?43:-1)}},dependencies:[R.i,P.S,x.s,k.D,C.n,$.U,T.E,q.r,r.YU,o.X1,o.qT,o.BC,o.cb,o.j4,o.JD,E.w,F.L,_.j,X.I,Y.h,M.b,U.h,G.z,j.b,w.p,r.Jj,O.$Z],encapsulation:2})},99352:(e,t,i)=>{"use strict";i.d(t,{x:()=>r});var n=i(78781);class r{constructor(e){e&&Object.assign(this,e)}toJSON(){return{id:this.id,privateKey:n.A.fromBufferToByteString(this.privateKey)}}static fromJSON(e){if(null==e)return null;let t=null;return e.privateKey&&(t=n.A.fromByteStringToArray(e.privateKey)),new r({id:e.id,privateKey:t})}}}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,s),i.loaded=!0,i.exports}s.m=n,e=[],s.O=(t,i,n,r)=>{if(!i){var o=1/0;for(d=0;d<e.length;d++){for(var[i,n,r]=e[d],a=!0,l=0;l<i.length;l++)(!1&r||o>=r)&&Object.keys(s.O).every(e=>s.O[e](i[l]))?i.splice(l--,1):(a=!1,r<o&&(o=r));if(a){e.splice(d--,1);var c=n();void 0!==c&&(t=c)}}return t}r=r||0;for(var d=e.length;d>0&&e[d-1][2]>r;d--)e[d]=e[d-1];e[d]=[i,n,r]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce((t,i)=>(s.f[i](e,t),t),[])),s.u=e=>e+"."+{35:"a5925037071c7d20e7c0",155:"d06fd751c6eeada1c84d",281:"7b08cb8ad5fa80c3817b",449:"f9ec1c26355fef21d987",453:"fbb85954401903bbb832",502:"ae02d12143fe68d21925",531:"109af8fb049dada330e0",573:"b479891548a93d8f2e45",614:"0e7b2be70c6c17f67282",677:"98a0060cb9547db54359",712:"36ecc57259a750067d7a",782:"212b9500d97dd24d74d2",825:"acb40a4bcb87700046f9",830:"a7b806778339c8af4112",922:"ffc2c4af29e797b0de35"}[e]+".js",s.miniCssF=e=>{},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},i="@bitwarden/web-vault:",s.l=(e,n,r,o)=>{if(t[e])t[e].push(n);else{var a,l;if(void 0!==r)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==i+r){a=u;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",i+r),a.src=e),t[e]=[n];var h=(i,n)=>{a.onerror=a.onload=null,clearTimeout(p);var r=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),r&&r.forEach(e=>e(n)),i)return i(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.v=(e,t,i,n)=>{var r=fetch(s.p+""+i+".module.wasm"),o=()=>r.then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,n)).then(t=>Object.assign(e,t.instance.exports));return r.then(t=>"function"==typeof WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t,n).then(t=>Object.assign(e,t.instance.exports),e=>{if("application/wasm"!==t.headers.get("Content-Type"))return console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",e),o();throw e}):o())},(()=>{var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var i=t.getElementsByTagName("script");if(i.length)for(var n=i.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=i[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e+"../"})(),(()=>{var e={84:0};s.f.j=(t,i)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise((i,r)=>n=e[t]=[i,r]);i.push(n[2]=r);var o=s.p+s.u(t),a=new Error;s.l(o,i=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,i)=>{var n,r,[o,a,l]=i,c=0;if(o.some(t=>0!==e[t])){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);if(l)var d=l(s)}for(t&&t(i);c<o.length;c++)r=o[c],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return s.O(d)},i=self.webpackChunk_bitwarden_web_vault=self.webpackChunk_bitwarden_web_vault||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})();var o=s.O(void 0,[245],()=>s(95982));o=s.O(o)})();
//# sourceMappingURL=main.2ded08c549b495fd3cc8.js.map