PageSourceSearch

https://vallalati-ugyintezes.granitbank.hu/chunk-4QSTLGES.js

js granitbank.hu collected 2026-09-24 10:10:17 UTC 76,163 bytes, 1 lines download raw bytes

1import{a as _e}from"./chunk-6A4JAASY.js";import{a as le}from"./chunk-TCKBV4I3.js";import"./chunk-JSPQ43I4.js";import{a as pt}from"./chunk-ISFINBRD.js";import{a as ft}from"./chunk-OS24DUCA.js";import{a as de}from"./chunk-C5QGCK2L.js";import{a as ge}from"./chunk-CCGT3Z5G.js";import{a as ue}from"./chunk-KHGA7Q7M.js";import"./chunk-GGQ7LRWG.js";import"./chunk-W4BNGQYG.js";import{a as me}from"./chunk-QR3NBMXK.js";import{a as ht}from"./chunk-HP7FB37X.js";import"./chunk-PGXFTRGM.js";import"./chunk-GMEA574I.js";import"./chunk-TGK75GYT.js";import{a as Pe}from"./chunk-QADQAQIO.js";import{a as Be}from"./chunk-ZFM77DJD.js";import{a as qe}from"./chunk-73HZGSW4.js";import{a as lt}from"./chunk-65JSELYQ.js";import"./chunk-5MEKF4II.js";import{a as ut}from"./chunk-54AMK74R.js";import{a as mt,b as dt}from"./chunk-DJN2ZATH.js";import"./chunk-AWZHF5U4.js";import"./chunk-ZWTYASQS.js";import{P as Ce}from"./chunk-W5NK66F5.js";import"./chunk-DGYZ5OOB.js";import{A as Fe,B as z,d as M,g as X,h as Z,i as tt,l as ee,o as te,q as ne,r as he,s as De,t as ie,u as ve,z as oe}from"./chunk-NGF6IVEY.js";import{a as ct}from"./chunk-WJIBPV2B.js";import"./chunk-H4HDWUFA.js";import{a as ye}from"./chunk-SJQ53YJP.js";import{b as it}from"./chunk-RS4YFAXQ.js";import{a as ce}from"./chunk-DHOJFGCW.js";import"./chunk-LFN27QFP.js";import{g as ae,h as nt}from"./chunk-EIWXG4QX.js";import{d as Ve}from"./chunk-Z5EYTOZC.js";import"./chunk-YPZ4WJ2N.js";import"./chunk-WECZVP32.js";import"./chunk-L6TR5JYN.js";import{E as v,O as D,P as F,T as Te,a as se,ca as ot,na as rt,sa as st,ta as $}from"./chunk-ZA7ME7NX.js";import"./chunk-CO66P2KO.js";import"./chunk-35TTWY4P.js";import{Aa as Me,Ab as c,Ac as u,Ba as E,Bc as Y,Ca as I,Fc as et,Hb as x,Jb as w,Kb as G,Kc as U,Ke as at,La as Q,Lb as R,Mb as r,Me as ke,Nb as m,Ob as p,Pb as be,Qb as Ee,Ra as V,Sb as B,Ub as S,Vb as l,W as Ue,Za as A,Zb as ze,_a as we,ba as He,cb as o,da as J,e as O,ec as We,fc as f,gb as C,gc as H,ge as W,hc as h,he as re,k as fe,ka as Ye,mb as P,pc as Ie,qa as Xe,qb as Ze,rc as xe,sb as b,sc as Ke,w as Qe,wd as L,xd as q,yd as j,zc as d}from"./chunk-T5IY4XSS.js";var Bt=(i,a)=>({centralAddress:i,centralMap:a}),At=(i,a)=>({westendAddress:i,westendMap:a}),Dt=(()=>{class i{constructor(){this.env=ge}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=P({type:i,selectors:[["app-missing-e-document-dialog"]],decls:37,vars:42,consts:[["title",""],[1,"text-2xl","font-bold","md:px-6","md:py-2"],["content","",1,"flex","flex-col","gap-8","text-neutral-100","md:px-6","max-w-[540px]"],[1,"font-bold"],[3,"innerHTML"],["actions","",1,"flex","gap-4","py-4","md:px-6","justify-center","w-full"],["mat-button","",1,"button-primary","w-full",3,"mat-dialog-close"]],template:function(t,n){t&1&&(r(0,"app-dialog")(1,"div",0)(2,"h4",1),f(3),d(4,"translate"),m()(),r(5,"div",2)(6,"div"),f(7),d(8,"translate"),m(),r(9,"div")(10,"div",3),f(11),d(12,"translate"),m(),p(13,"div",4),d(14,"translate"),r(15,"p"),f(16),d(17,"translate"),m(),r(18,"p"),f(19),d(20,"translate"),m()(),r(21,"div")(22,"div",3),f(23),d(24,"translate"),m(),p(25,"div",4),d(26,"translate"),r(27,"p"),f(28),d(29,"translate"),m(),r(30,"p"),f(31),d(32,"translate"),m()()(),r(33,"div",5)(34,"button",6),f(35),d(36,"translate"),m()()()),t&2&&(o(3),h(" ",u(4,12,"client.dashboard.documents.missing-es3.title")," "),o(4),h(" ",u(8,14,"client.dashboard.documents.missing-es3.message")," "),o(4),h(" ",u(12,16,"client.dashboard.documents.missing-es3.central"),": "),o(2),c("innerHTML",Y(14,18,"client.dashboard.documents.missing-es3.central-address",Ke(36,Bt,n.env.ADDRESS_OF_GRANIT_CENTRAL_OFFICE,n.env.MAP_OF_GRANIT_CENTRAL_OFFICE)),A),o(3),h(" ",u(17,21,"client.dashboard.documents.missing-es3.opening-hours")," "),o(3),h(" ",u(20,23,"client.dashboard.documents.missing-es3.central-opening-hours")," "),o(4),h(" ",u(24,25,"client.dashboard.documents.missing-es3.westend"),": "),o(2),c("innerHTML",Y(26,27,"client.dashboard.documents.missing-es3.westend-address",Ke(39,At,n.env.ADDRESS_OF_GRANIT_WESTEND,n.env.MAP_OF_GRANIT_WESTEND)),A),o(3),h(" ",u(29,30,"client.dashboard.documents.missing-es3.opening-hours")," "),o(3),h(" ",u(32,32,"client.dashboard.documents.missing-es3.westend-opening-hours")," "),o(3),c("mat-dialog-close",!0),o(),h(" ",u(36,34,"common.dialog.ok")," "))},dependencies:[Ce,W,nt,q,it],encapsulation:2})}}return i})();function vt(i){return[D.RepAuthNotarySignOrLawyerCertSign,D.PersonalIdentification,D.TaxAndStatisticalNumberDisclosure,D.NavRegistrationCertificate,D.ChamberMembershipDocument,D.NavRegistrationCertificateForTaxRegisteredIndividual,D.CourtOrderOrCertificateAssociationRegistry,D.RecentChamberMembershipDocument].includes(i)}
1function gt(i){return[D.EntrepreneursIdentityCard,D.AuditorsIdentityCard,D.TaxAndStatisticalNumberDisclosure,D.ChamberMembershipDocument,D.CourtOrderOrCertificateAssociationRegistry,D.RecentCourtDecisionOnRegistration,D.CourtDecisionOnRegistration,D.RecentChamberMembershipDocument,D.DeedsFromLandRegistry,D.TaxDeclarationForApartmentBuilding,D.DecisionOfRegistrationFamilyFarm].includes(i)}var Nt=i=>({docType:i}),wt=i=>({individualEntrepreneurRegistryCertificateRequestUrl:i});function Gt(i,a){i&1&&(r(0,"div"),f(1),d(2,"translate"),m()),i&2&&(o(),h(" ",u(2,1,"client.dashboard.documents.admin-description")," "))}function Rt(i,a){if(i&1&&(p(0,"div",10),d(1,"translate"),r(2,"ul",11)(3,"li")(4,"a",12),f(5),d(6,"translate"),m()(),r(7,"li")(8,"a",12),f(9),d(10,"translate"),m()(),r(11,"li")(12,"a",12),f(13),d(14,"translate"),m()()()),i&2){let e=l(3);c("innerHTML",u(1,7,"client.dashboard.documents.bank-account.description.part-2-es3-required"),A),o(4),c("href",e.env.ES3_1_URL,we),o(),H(u(6,9,"client.dashboard.documents.description.link-1")),o(3),c("href",e.env.ES3_2_URL,we),o(),H(u(10,11,"client.dashboard.documents.description.link-2")),o(3),c("href",e.env.ES3_3_URL,we),o(),H(u(14,13,"client.dashboard.documents.description.link-3"))}}function Ot(i,a){if(i&1&&(p(0,"div",8),d(1,"translate")),i&2){let e=l(3);c("innerHTML",Y(1,1,"client.dashboard.documents.bank-account.description.part-2-entrepreneurs-identity-card-required",xe(4,wt,e.env.INDIVIDUAL_ENTREPRENEUR_REGISTRY_CERTIFICATE_REQUEST_URL)),A)}}function Ut(i,a){if(i&1&&p(0,"div",7),i&2){let e=a.$implicit;c("innerHTML",e,A)}}function Ht(i,a){if(i&1&&G(0,Ut,1,1,"div",7,w),i&2){let e=l(3);R(e.docDescriptionTranslations)}}function Mt(i,a){if(i&1&&(p(0,"div",7),d(1,"translate"),d(2,"translate"),b(3,Rt,15,15)(4,Ot,2,6,"div",8)(5,Ht,2,0),r(6,"div",9),f(7),d(8,"translate"),m()),i&2){let e=l(2);c("innerHTML",e.es3DocRequired()&&e.nonEs3DocRequired()?u(1,5,"client.dashboard.documents.bank-account.description.part-1-both"):Y(2,7,"client.dashboard.documents.bank-account.description.part-1",xe(12,Nt,e.getDocTypeText())),A),o(3),x(e.es3DocRequired()?3:-1),o(),x(e.entrepreneursIdentityCardRequired()?4:-1),o(),x(e.nonEs3DocRequired()?5:-1),o(2),h(" ",u(8,10,"client.dashboard.documents.bank-account.description.part-3")," ")}}function Vt(i,a){if(i&1){let e=B();r(0,"app-info-card",2)(1,"div",4),b(2,Gt,3,3,"div")(3,Mt,9,14),r(4,"form",5)(5,"app-checkbox-input",6),S("click",function(){E(e);let n=l();return I(n.showMissingDocumentDialog())}),f(6),d(7,"translate"),m()()()()}if(i&2){let e=l();c("shadowDisabled",!0),o(2),x(e.isAdminUser?2:3),o(2),c("formGroup",e.missingEDocumentForm),o(),c("disabled",!e.hasRequiredEs3Document()),o(),h(" ",u(7,5,"client.dashboard.documents.bank-account.description.hasEs3")," ")}}function Pt(i,a){if(i&1){let e=B();r(0,"app-svg-asset",22,0),d(2,"translate"),S("click",function(){E(e);let n=We(1);return I(n.toggle())}),m()}if(i&2){let e=l().$implicit;c("matTooltip",u(2,2,"enum.document-name-tooltip."+e))("ds",!1)}}function qt(i,a){if(i&1&&(r(0,"div",17),p(1,"li",20),b(2,Pt,3,4,"app-svg-asset",21),m()),i&2){let e=a.$implicit,t=l(2);o(),c("innerHTML",t.getDocumentNameTranslation(e),A),o(),x(t.hasDocumentTooltip(e)?2:-1)}}function $t(i,a){if(i&1){let e=B();r(0,"app-svg-asset",22,0),d(2,"translate"),S("click",function(){E(e);let n=We(1);return I(n.toggle())}),m()}if(i&2){let e=l().$implicit;c("matTooltip",u(2,2,"enum.document-name-tooltip."+e))("ds",!1)}}function Lt(i,a){if(i&1&&(r(0,"div",17),p(1,"li",20),b(2,$t,3,4,"app-svg-asset",21),m()),i&2){let e=a.$implicit,t=l(2);o(),c("innerHTML",t.getDocumentNameTranslation(e),A),o(),x(t.hasDocumentTooltip(e)?2:-1)}}function jt(i,a){if(i&1&&(r(0,"app-vosz-accordion",3)(1,"div",13),p(2,"app-svg-asset",14),r(3,"span"),f(4),d(5,"translate"),m()(),be(6,15),r(7,"ul",16),G(8,qt,3,2,"div",17,w),G(10,Lt,3,2,"div",17,w),m(),r(12,"div",18)(13,"span"),f(14),d(15,"translate"),m(),r(16,"a",19),f(17),m()(),Ee(),m()),i&2){let e=l();c("expanded",!0),o(4),h(" ",u(5,5,"client.dashboard.documents.required-documents")," "),o(4),R(e.requiredDocuments.es3Documents),o(2),R(e.requiredDocuments.nonEs3Documents),o(4),H(u(15,7,"client.dashboard.documents.more-info")+": "),o(2),c("href",e.env.REQUIRED_DOCUMENTS_MORE_INFO,we),o(),H(e.env.REQUIRED_DOCUMENTS_MORE_INFO)}}var yt=(()=>{class i{constructor(e,t){this.dialog=e,this.translateService=t,this.isAdminUser=!1,this.showRequiredDocumentList=U(()=>this.issueType!==$.AddHolderOfBankAccounts&&this.issueType!==$.AddBankCardToHolderOfBankAccounts&&this.issueType!==$.EditEntitledToRegisterPersonData&&this.issueType!==$.EditHolderOfBankAccountsPersonData),this.displayRequiredDocuments=U(()=>this.issueType!==$.AddHolderOfBankAccounts&&this.issueType!==$.AddBankCardToHolderOfBankAccounts&&this.issueType!==$.EditEntitledToRegisterPersonData&&this.issueType!==$.EditHolderOfBankAccountsPersonData),this.es3DocRequired=V(!1),this.nonEs3DocRequired=V(!1),this.entrepreneursIdentityCardRequired=V(!1),this.companyTypeToNonEs3DocumentDescriptionKeyMap=new Map([[v.Auditor,["tax-and-statistical-number-disclosure","auditor-registration-number-certification"]],[v.NotaryPublic,["chamber-membership-document-for-notary-public"]],[v.Chambers,["tax-and-statistical-number-disclosure","chamber-membership-document-for-lawyer"]],[v.Condominium,["tax-and-statistical-number-disclosure"]],[v.Lawyer,["chamber-membership-document-for-lawyer"]]]),this.docDescriptionTranslations=[],this.env=ge,this.hasDocumentTooltip=vt}ngOnInit(){this.entrepreneursIdentityCardRequired.set(this.companyTypeResponse.type===v.SoleProprietorship||this.companyTypeResponse.type===v.SelfEmployed||this.companyTypeResponse.type===v.NotaryPublic||this.companyTypeResponse.type===v.TaxRegisteredIndividual||this.companyTypeResponse.type===v.PrimaryProducer||this.companyTypeResponse.type===v.Lawyer),this.es3DocRequired.set(this.companyTypeResponse.type===v.LimitedLiabilityCompany||this.companyTypeResponse.type===v.LimitedPartnership||this.companyTypeResponse.type===v.ShareCompany||this.companyTypeResponse.type===v.GeneralPartnership||this.companyTypeResponse.type===v.Cooperative||this.companyTypeResponse.type===v.Association||this.companyTypeResponse.type===v.SportsAssociation||this.companyTypeResponse.type===v.Union||this.companyTypeResponse.type===v.Foundation||this.companyTypeResponse.type===v.NonprofitCorporation||this.companyTypeResponse.type===v.Party||this.companyTypeResponse.type===v.TradeUnion||this.companyTypeResponse.type===v.NotaryPublicOffice||this.companyTypeResponse.type===v.Chambers||this.companyTypeResponse.type===v.Condominium||this.companyTypeResponse.type===v.Church||this.companyTypeResponse.type===v.FamilyFarm||this.companyTypeResponse.type===v.ChamberOfHealthProfessionals||this.companyTypeResponse.type===v.BarAssociation||this.companyTypeResponse.type===v.SocialOrganization||this.companyTypeResponse.type===v.Other),this.nonEs3DocRequired.set(this.companyTypeResponse.type===v.SoleProprietorship||this.companyTypeResponse.type===v.SelfEmployed||this.companyTypeResponse.type===v.Auditor||this.companyTypeResponse.type===v.NotaryPublic||this.companyTypeResponse.type===v.TaxRegisteredIndividual||this.companyTypeResponse.type===v.PrimaryProducer||this.companyTypeResponse.type===v.FamilyFarm||this.companyTypeResponse.type===v.ChamberOfHealthProfessionals||this.companyTypeResponse.type===v.BarAssociation||this.companyTypeResponse.type===v.SocialOrganization||this.companyTypeResponse.type===v.Lawyer||this.companyTypeResponse.type===v.Chambers||this.companyTypeResponse.type===v.Condominium||this.companyTypeResponse.type===v.Other),this.companyTypeToNonEs3DocumentDescriptionKeyMap.has(this.companyTypeResponse.type)&&this.companyTypeToNonEs3DocumentDescriptionKeyMap.get(this.companyTypeResponse.type).forEach(t=>{this.docDescriptionTranslations.push(this.translateService.instant("client.dashboard.documents.bank-account.de
1scription.part-2-document."+t))})}showMissingDocumentDialog(){return O(this,null,function*(){this.missingEDocumentForm.controls.hasEs3.value===!1||this.isAdminUser||(yield Qe(this.dialog.open(Dt,{autoFocus:!1}).afterClosed()))})}getDocTypeText(){return this.translateService.instant(this.es3DocRequired()?"client.dashboard.documents.bank-account.description.doc-type-1":"client.dashboard.documents.bank-account.description.doc-type-2")}getDocumentNameTranslation(e){let t=this.translateService.instant("enum.document-name."+e);return gt(e)?t+this.translateService.instant("client.dashboard.documents.bank-account.electronically-certified-pdf"):t}static{this.\u0275fac=function(t){return new(t||i)(C(ae),C(L))}}static{this.\u0275cmp=P({type:i,selectors:[["app-bank-account-document-upload-information"]],inputs:{issueType:"issueType",companyTypeResponse:"companyTypeResponse",requiredDocuments:"requiredDocuments",missingEDocumentForm:"missingEDocumentForm",hasRequiredEs3Document:"hasRequiredEs3Document",isAdminUser:"isAdminUser"},decls:3,vars:2,consts:[["tooltipEstablishment","matTooltip"],[1,"my-6"],[3,"shadowDisabled"],[1,"md:w-full",3,"expanded"],[1,"flex","flex-col","gap-3"],[3,"formGroup"],["aria-readonly","true","formControlName","hasEs3",3,"click","disabled"],[3,"innerHTML"],[1,"flex","flex-col","gap-3","italic",3,"innerHTML"],[1,"font-bold"],[1,"italic",3,"innerHTML"],[1,"list-disc","list-inside","text-primary-120","font-bold","italic"],["target","_blank",1,"hover:text-primary-140","duration-300","ease",3,"href"],["title","",1,"flex","gap-4","items-center"],["name","icons/information/check-circle",1,"w-6","h-6","text-secondary-120"],["content",""],[1,"list-decimal","pl-5","flex","flex-col","gap-1"],[1,"flex","items-end"],[1,"text-base","pl-1","pt-2"],["target","_blank",1,"text-primary-120","font-bold","hover:text-primary-140","duration-300","ease",3,"href"],[1,"my-auto",3,"innerHTML"],["matTooltipClass","max-w-[300px]","name","icons/common/info-circle-filled",1,"w-6","h-6","transform","origin-left","text-primary","scale-[75%]","cursor-pointer","hover:text-primary-140","ease-in-out","duration-300",3,"matTooltip","ds"],["matTooltipClass","max-w-[300px]","name","icons/common/info-circle-filled",1,"w-6","h-6","transform","origin-left","text-primary","scale-[75%]","cursor-pointer","hover:text-primary-140","ease-in-out","duration-300",3,"click","matTooltip","ds"]],template:function(t,n){t&1&&(r(0,"div",1),b(1,Vt,8,7,"app-info-card",2),m(),b(2,jt,18,9,"app-vosz-accordion",3)),t&2&&(o(),x(n.displayRequiredDocuments()?1:-1),o(),x(n.showRequiredDocumentList()?2:-1))},dependencies:[me,Be,de,Fe,te,X,Z,z,ne,ie,se,j,q,ke,at],encapsulation:2})}}return i})();var K=(()=>{class i{constructor(){this.documentValueChangeSubscriptions=[],this.startingValues=[],this.documentGroupStatuses=[]}loadErrors(e,t,n){e.forEach(s=>{n.push({status:s.status,message:s.message,documentNames:s.documents})}),n.length&&(this.documentGroupStatuses=n,this.setPreviousValues(t),this.onDocumentGroupsChanged(t))}onDocumentGroupsRemoved(e){if(this.documentGroupStatuses.length)for(let t=e;t<this.documentGroupStatuses.length;t++)this.documentGroupStatuses[t].status=F.Uploaded,this.documentGroupStatuses[t].message="",this.documentValueChangeSubscriptions[t].closed||this.documentValueChangeSubscriptions[t].unsubscribe()}onDocumentGroupsRemovedForAdditionalDocuments(e){this.documentGroupStatuses.length&&(this.documentGroupStatuses.splice(e,1),this.documentValueChangeSubscriptions[e].closed||this.documentValueChangeSubscriptions[e].unsubscribe(),this.documentValueChangeSubscriptions.splice(e,1))}onDocumentGroupsChanged(e){e.controls.forEach((t,n)=>{this.documentValueChangeSubscriptions.push(t.valueChanges.subscribe(s=>{this.hasValueChangedInDocumentForm(s,n)&&(this.documentGroupStatuses[n].status=F.Uploaded,this.documentGroupStatuses[n].message="",this.documentValueChangeSubscriptions[n].unsubscribe())}))})}setPreviousValues(e){this.startingValues=[],e.controls.forEach(t=>{let n=this.getDocumentValues(t);this.startingValues.push(n)})}getDocumentValues(e){let t={};for(let[n,s]of Object.entries(e.controls))t[n]=s.value;return t}hasValueChangedInDocumentForm(e,t){for(let[n,s]of Object.entries(this.startingValues[t]))if(e[
1n]!==void 0&&s!==e[n])return!0;return!1}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=Ye({token:i,factory:i.\u0275fac})}}return i})();function Ne(i,a){for(let e of Object.keys(i))if(i[e]===a)return e;throw console.log(a),new Error("Enum value not found.")}function zt(i,a,e){let t={};return e.forEach((n,s)=>{t[s]=a.at(s).get(i)?.value}),t}function pe(i,a){Object.keys(D).forEach(e=>{let t=zt(e,i,a),n=Object.values(t).some(s=>s);a&&(n?a.forEach((s,g)=>{i.at(g).get(e)?.value===!1&&i.at(g).get(e)?.disable()}):a.forEach((s,g)=>{i.at(g).get(e)?.enable()}))})}function $e(i){let a=[];return i.forEach(e=>{if(e!==D.Other){let t=Ne(D,e);t&&a.push(t)}}),a}function Le(i){let a=[];return i.forEach((e,t)=>{a.push({name:String(t+1),value:t+1})}),a}function xt(i,a){let e=[],t=[];i.controls.es3Documents.controls.forEach(y=>{let _=[],N=y.get("file").value,T=y.get("fileId").value;a.forEach(k=>{y.get(k).value===!0&&_.push(D[k])}),N!==null&&(N.type==="unknown"?t.push({documentNames:_,fileId:T}):t.push({documentNames:_,fileIndex:e.length,fileId:T}),e.push(y.get("file").value))});let s=JSON.stringify(t);new TextEncoder().encode(s);let g=new Blob([s],{type:"application/json"});return{files:e,documentGroups:g,confirmDataCorrectness:i.controls.confirmDataCorrectness.value,confirmOtherDocuments:!0}}function St(i,a){let e=[],t=[];i.controls.nonEs3Documents.controls.forEach(y=>{let _=[],N=y.get("file").value,T=y.get("fileId").value;a.forEach(k=>{y.get(k).value===!0&&_.push(D[k])}),N!==null&&(N.type==="unknown"?t.push({documentNames:_,fileId:T}):t.push({documentNames:_,fileIndex:e.length,fileId:T}),e.push(y.get("file").value))});let s=JSON.stringify(t);new TextEncoder().encode(s);let g=new Blob([s],{type:"application/json"});return{files:e,documentGroups:g,confirmDataCorrectness:i.controls.confirmDataCorrectness.value,confirmOtherDocuments:!0}}function bt(i){let a=[],e=[],t=i.controls.credentialDocumentsForRegistrationHolders,n=i.controls.credentialDocumentsForOtherBankAccountBeneficiaries;t.controls.forEach(y=>{let _=y.get("entityId")?.value,N=y.get("personalIdentificationDocumentsArray"),T=y.get("addressCardDocumentsArray");Ct(a,e,_,N,T)}),n.controls.forEach(y=>{let _=y.get("entityId")?.value,N=y.get("personalIdentificationDocumentsArray"),T=y.get("addressCardDocumentsArray");Ct(a,e,_,N,T)});let s=JSON.stringify(e);new TextEncoder().encode(s);let g=new Blob([s],{type:"application/json"});return{files:a,documentGroups:g,confirmDataCorrectness:i.controls.confirmDataCorrectness.value,confirmOtherDocuments:!0}}function Ct(i,a,e,t,n){_t(i,a,e,t,D.PersonalIdentification),_t(i,a,e,n,D.AddressCard)}function _t(i,a,e,t,n){t.controls.forEach(s=>{let g=s.get("file")?.value,y=s.get("fileId")?.value;g!==null&&(g.type==="unknown"?a.push({documentNames:[n],fileId:y,entityId:e}):a.push({documentNames:[n],fileIndex:i.length,fileId:y,entityId:e}),i.push(s.get("file")?.value))})}function Et(i){let a=[],e=[],t=i.controls.additionalDocuments;t.controls.length>0&&t.controls.forEach(g=>{let y=g.get("fileId").value,_=g.get("file").value;_!==null&&(_.type==="unknown"?e.push({documentNames:[D.Other],fileId:y}):e.push({documentNames:[D.Other],fileIndex:a.length,fileId:y}),a.push(_))});let n=JSON.stringify(e);new TextEncoder().encode(n);let s=new Blob([n],{type:"application/json"});return{files:a,documentGroups:s,confirmDataCorrectness:i.controls.confirmDataCorrectness.value,confirmOtherDocuments:!0}}function Wt(i,a){i&1&&p(0,"app-svg-asset",2),i&2&&c("name","icons/information/x-circle")}function Kt(i,a){i&1&&p(0,"app-svg-asset",3),i&2&&c("name","icons/information/check-circle")}function Jt(i,a){if(i&1&&(r(0,"div",24),f(1),m()),i&2){let e=l().$index,t=l();o(),h(" ",t.additionalDocumentGroupStatuses[e].message," ")}}function Qt(i,a){if(i&1){let e=B();r(0,"div",10)(1,"div",18)(2,"div",19),p(3,"app-file-upload",20),d(4,"translate"),d(5,"translate"),r(6,"button",21),S("click",function(){let n=E(e).$index,s=l();return I(s.removeAdditionalFileFormGroup(n))}),r(7,"div",22),p(8,"app-svg-asset",23),r(9,"div"),f(10),d(11,"translate"),m()()()(),b(12,Jt,2,1,"div",24),m()()}if(i&2){let e=a.$index,t=l();o(),c("formGroupName",e),o(2),c("title",u(4,6,"client.dashboard.documents.upload-document"))("description",u(5,8,"client.dashboard.documents.click-to-upload"))("error",t.additionalDocumentGroupStatuses.length>0&&t.additionalDocumentGroupStatuses[e]&&t.additionalDocumentGroupStatuses[e].status===t.DocumentStatus.Invalid),o(7),h(" ",u(11,10,"common.form.action.remove")," "),o(2),x(t.additionalDocumentGroupStatuses.length>0&&t.additionalDocumentGroupStatuses[e]&&t.additionalDocumentGroupStatuses[e].status===t.DocumentStatus.Invalid?12:-1)}}var It=(()=>{class i{constructor(e,t,n,s,g){this.fb=e,this.dialog=t,this.translateService=n,this.documentService=s,this.additionalDocumentErrorHandlerService=g,this.deleteDocumentGroupWithoutConfirm=!1,this.deleteDocument=new Q,this.uploadDocuments=new Q,this.additionalDocumentGroupStatuses=[],this.componentLoading=U(()=>this.isLoading()||this.documentService.isLoading()),this.hasInvalidDocumentStatus=V(!1),this.filteredDocumentFileGroups=[],this.unsubscribe$=new fe,this.DocumentStatus=F,this.fileUploadForm=this.fb.group({additionalDocuments:this.fb.array([]),confirmDataCorrectness:[!1,[M.requiredTrue]]})}ngOnInit(){this.filteredDocumentFileGroups=this.filterUploadedDocuments(),this.initForm(),this.additionalDocumentErrorHandlerService.loadErrors(this.filteredDocumentFileGroups,this.additionalDocuments,this.additionalDocumentGroupStatuses),this.hasInvalidDocumentStatus.set(this.additionalDocumentGroupStatuses.some(e=>e.status===F.Invalid))}uploadFiles(){if(this.issueId){let e=Et(this.fileUploadForm);this.uploadDocuments.emit(e),this.fileUploadForm.controls.confirmDataCorrectness.patchValue(!1),this.fileUploadForm.markAsPristine()}}addAdditionalFileFormGroup(){let e=this.fb.group({file:[null],fileId:[null]});this.additionalDocuments.push(e)}removeAdditionalFileFormGroup(e){let n=this.fileUploadForm.controls.additionalDocuments.at(e).value;this.dialog.open(ye,{data:{title:this.translateService.instant("common.dialog.remove-file"),content:n.file===null?this.translateService.instant("common.dialog.remove-file-from-list"):this.translateService.instant("common.dialog.remove-file-from-list-with-name",{fileName:n.file.name})},autoFocus:!1}).afterClosed().pipe(J(this.unsubscribe$)).subscribe(g=>{if(g){this.additionalDocumentErrorHandlerService.onDocumentGroupsRemovedForAdditionalDocuments(e),this.additionalDocumentGroupStatuses.splice(e,1),this.hasInvalidDocumentStatus.set(this.additionalDocumentGroupStatuses.some(_=>_.status===F.Invalid));let y=this.additionalDocuments.at(e).value.fileId;y&&this.deleteDocument.emit(y),this.additionalDocuments.removeAt(e)}})}filterUploadedDocuments(){return this.uploadedDocuments?this.uploadedDocuments.groups.filter(e=>e.documents.includes(D.Other)):[]}initForm(){this.filteredDocumentFileGroups.length>
10?this.filteredDocumentFileGroups.forEach(e=>{let t=this.fb.group({file:[null,M.required],fileId:[e.fileId]});t.controls.file.setValue(new File(["unknown"],e.fileName,{type:"unknown"})),this.additionalDocuments.push(t)}):this.addAdditionalFileFormGroup()}get additionalDocuments(){return this.fileUploadForm.controls.additionalDocuments}static{this.\u0275fac=function(t){return new(t||i)(C(oe),C(ae),C(L),C(le),C(K))}}static{this.\u0275cmp=P({type:i,selectors:[["app-additional-document-upload-form"]],inputs:{issueId:"issueId",isLoading:"isLoading",uploadedDocuments:"uploadedDocuments",deleteDocumentGroupWithoutConfirm:"deleteDocumentGroupWithoutConfirm",formSave:"formSave"},outputs:{deleteDocument:"deleteDocument",uploadDocuments:"uploadDocuments"},features:[Ie([K])],decls:32,vars:21,consts:[[1,"md:w-full",3,"condenseSignal"],["title","",1,"flex","gap-4","items-center"],[1,"w-6","h-6","text-error",3,"name"],[1,"w-6","h-6","text-secondary-120",3,"name"],["content",""],[1,"flex","flex-wrap","justify-center","md:justify-start","items-center","mb-5"],[1,"w-full",3,"formGroup"],[3,"disabled"],[1,"text-center","bg-primary-10","rounded-xl","p-6","mb-6"],["formArrayName","additionalDocuments"],[1,"pb-4"],[1,"flex","flex-wrap","justify-center","items-center","font-bold","text-base","gap-x-4","my-2","cursor-pointer","text-primary-120","hover:text-primary-140","duration-300","ease","pr-24",3,"click"],["name","icons/information/plus-circle",1,"w-6","h-6","text-primary-120"],[1,"flex","justify-between","items-center","w-full","md:w-[490px]","mx-1","mt-4","py-6"],["formControlName","confirmDataCorrectness",3,"required"],["mat-button","","type","submit",1,"button-secondary","text-primary-180","w-full","md:w-auto","mx-auto",3,"click","loading"],[1,"flex","justify-center","items-center","gap-4"],["name","icons/document/save",1,"w-6","h-6","text-primary-180"],[3,"formGroupName"],[1,"flex"],["formControlName","file",1,"w-full",3,"title","description","error"],[1,"pl-4","text-base","font-bold","!text-error","!hover:text-red-800","duration-300","ease","md:basis-2/12",3,"click"],[1,"flex","items-center","gap-2"],["name","icons/action/trash-can",1,"w-6","h-6","text-error"],[1,"mt-1","text-error","text-base","text-medium"]],template:function(t,n){t&1&&(r(0,"app-vosz-accordion",0)(1,"div",1),b(2,Wt,1,1,"app-svg-asset",2)(3,Kt,1,1,"app-svg-asset",3),r(4,"span"),f(5),d(6,"translate"),m()(),r(7,"div",4)(8,"div",5)(9,"form",6)(10,"fieldset",7)(11,"div",8),f(12),d(13,"translate"),m(),r(14,"div",9),G(15,Qt,13,12,"div",10,w),r(17,"div",11),S("click",function(){return n.addAdditionalFileFormGroup()}),p(18,"app-svg-asset",12),r(19,"div"),f(20),d(21,"translate"),m()()(),r(22,"div",13)(23,"app-checkbox-input",14),f(24),d(25,"translate"),m()()(),r(26,"button",15),S("click",function(){return n.uploadFiles()}),r(27,"div",16),p(28,"app-svg-asset",17),r(29,"span"),f(30),d(31,"translate"),m()()()()()()()),t&2&&(c("condenseSignal",n.formSave),o(2),x(n.hasInvalidDocumentStatus()?2:3),o(3),h(" ",u(6,11,"client.dashboard.documents.bank-account.upload-other-documents"),""),o(4),c("formGroup",n.fileUploadForm),o(),c("disabled",n.componentLoading()),o(2),h(" ",u(13,13,"client.dashboard.documents.bank-account.description.other-documents")," "),o(3),R(n.additionalDocuments.controls),o(5),h(" ",u(21,15,"client.dashboard.documents.add-more-documents")," "),o(3),c("required",!0),o(),h(" ",u(25,17,"client.dashboard.documents.confirm-upload")," "),o(2),c("loading",n.componentLoading()),o(4),H(u(31,19,"client.dashboard.documents.upload-documents")))},dependencies:[me,ce,de,Ce,te,X,Z,ve,W,ne,ie,he,De,q,_e,re,z,se,j],encapsulation:2,data:{animation:[ue]}})}}return i})();function Yt(i,a){i&1&&p(0,"app-svg-asset",2),i&2&&c("name","icons/information/x-circle")}function Xt(i,a){i&1&&p(0,"app-svg-asset",3)}function Zt(i,a){i&1&&(p(0,"div",10),d(1,"translate")),i&2&&c("innerHTML",u(1,1,"client.dashboard.documents.bank-account.description.credential-documents-part-2"),A)}function en(i,a){i&1&&p(0,"app-svg-asset",2),i&2&&c("name","icons/information/x-circle")}function tn(i,a){i&1&&p(0,"app-svg-asset",3)}function nn(i,a){if(i&1&&(r(0,"div",32),f(1),m()),i&2){let e=l().$index,t=l().$index,n=l();o(),h(" ",n.registrationHolderDocumentGroupStatuses[t].personalIdentificationStatuses[e].message," ")}}function on(i,a){if(i&1){let e=B();r(0,"div",23)(1,"div",26)(2,"div",27),p(3,"app-file-upload",28),d(4,"translate"),d(5,"translate"),r(6,"button",29),S("click",function(){let n=E(e).$index,s=l().$index,g=l();return I(g.removeCredentialDocumentFormGroup(n,s,"personalIdentificationDocumentsArray","credentialDocumentsForRegistrationHolders",g.registrationHolderDocumentGroupStatuses[s].personalIdentificationStatuses))}),r(7,"div",30),p(8,"app-svg-asset",31),r(9,"div"),f(10),d(11,"translate"),m()()()(),b(12,nn,2,1,"div",32),m()()}if(i&2){let e=a.$index,t=l().$index,n=l();o(),c("formGroupName",e),o(2),c("title",u(4,6,"client.dashboard.documents.upload-document"))("description",u(5,8,"client.dashboard.documents.click-to-upload"))("error",n.registrationHolderDocumentGroupStatuses[t].personalIdentificationStatuses[e].status===n.DocumentStatus.Invalid),o(7),h(" ",u(11,10,"common.form.action.remove")," "),o(2),x(n.registrationHolderDocumentGroupStatuses[t].personalIdentificationStatuses[e].status===n.DocumentStatus.Invalid?12:-1)}}function rn(i,a){if(i&1&&(r(0,"div",32),f(1),m()),i&2){let e=l().$index,t=l().$index,n=l();o(),h(" ",n.registrationHolderDocumentGroupStatuses[t].addressCardStatuses[e].message," ")}}function sn(i,a){if(i&1){let e=B();r(0,"div",23)(1,"div",26)(2,"div",27),p(3,"app-file-upload",28),d(4,"translate"),d(5,"translate"),r(6,"button",29),S("click",function(){let n=E(e).$index,s=l().$index,g=l();return I(g.removeCredentialDocumentFormGroup(n,s,"addressCardDocumentsArray","credentialDocumentsForRegistrationHolders",g.registrationHolderDocumentGroupStatuses[s].addressCardStatuses))}),r(7,"div",30),p(8,"app-svg-asset",31),r(9,"div"),f(10),d(11,"translate"),m()()()(),b(12,rn,2,1,"div",32),m()()}if(i&2){let e=a.$index,t=l().$index,n=l();o(),c("formGroupName",e),o(2),c("title",u(4,6,"client.dashboard.documents.upload-document"))("description",u(5,8,"client.dashboard.documents.click-to-upload"))("error",n.registrationHolderDocumentGroupStatuses[t].addressCardStatuses[e].status===n.DocumentStatus.Invalid),o(7),h(" ",u(11,10,"common.form.action.remove")," "),o(2),x(n.registrationHolderDocumentGroupStatuses[t].addressCardStatuses[e].status===n.DocumentStatus.Invalid?12:-1)}}function an(i,a){if(i&1){let e=B();r(0,"div",12)(1,"app-vosz-accordion",18)(2,"div",1),b(3,en,1,1,"app-svg-asset",2)(4,tn,1,0,"app-svg-asset",3),r(5,"span"),f(6),p(7,"app-info-chip",19),d(8,"translate"),m()(),r(9,"div",4)(10,"div",5)(11,"div",20),p(12,"div",21),d(13,"translate"),r(14,"div",22),G(15,on,13,12,"div",23,w),r(17,"div",24),S("click",function(){let n=E(e).$index,s=l();return I(s.addCredentialDocumentFormGroup(n,"personalIdentificationDocumentsArray","credentialDocumentsForRegistrationHolders",s.DocumentName.PersonalIdentification,s.registrationHolderDocumentGroupStatuses[n].personalIdentificationStatuses))}),p(18,"app-svg-asset",25),r(19,"div"),f(20),d(21,"translate"),m()()(),p(22,"div",21),d(23,"translate"),r(24,"div",11),G(25,sn,13,12,"div",23,w),r(27,"div",24),S("click",function(){let n=E(e).$index,s=l();return I(s.addCredentialDocumentFormGroup(n,"addressCardDocumentsArray","credentialDocumentsForRegistrationHolders",s.DocumentName.AddressCard,s.registrationHolderDocumentGroupStatuses[n].addressCardStatuses))}),p(28,"app-svg-asset",25),r(29,"div"),f(30),d(31,"translate"),m()()()()()()()()}if(i&2){let e=a.$implicit,t=a.$index,n=l();o(),c("expanded",!0),o(2),x(n.personHasMissingDocumentOrInvalidFeedback(n.registrationHolderDocumentGroupStatuses[t],e.value.entityId)?3:4),o(3),h(" ",e.value.personName," "),o(),ze("chipText","",u(8,12,"enum.position-of-representative."+n.registrationHolderIdToSignerTypeMap.get(e.value.entityId))," "),o(4),c("formGroupName",t),o(),c("innerHTML",u(13,14,"enum.document-name.PERSONAL_IDENTIFICATION"),A),o(2),c("formArrayName","personalIdentificationDocumentsArray"),o(),R(n.getCredentialDocumentArrayByIndexForRegistrationHolder(t,"personalIdentificationDocumentsArray","credentialDocumentsForRegistrationHolders").controls),o(5),h(" ",u(21,16,"client.dashboard.documents.add-more-documents")," "),o(2),c("innerHTML",u(23,18,"enum.document-name.ADDRESS_CARD"),A),o(2),c("formArrayName","addressCardDocumentsArray"),o(),R(n.getCredentialDocumentArrayByIndexForRegistrationHolder(t,"addressCardDocumentsArray","credentialDocumentsForRegistrationHolders").controls),o(5),h(" ",u(31,20,"client.dashboard.documents.add-more-documents")," ")}}
1function cn(i,a){i&1&&p(0,"app-svg-asset",2),i&2&&c("name","icons/information/x-circle")}function mn(i,a){i&1&&p(0,"app-svg-asset",3)}function dn(i,a){if(i&1&&(r(0,"div",32),f(1),m()),i&2){let e=l().$index,t=l().$index,n=l();o(),h(" ",n.otherBankAccountBeneficiaryDocumentGroupStatuses[t].personalIdentificationStatuses[e].message," ")}}function un(i,a){if(i&1){let e=B();r(0,"div",23)(1,"div",26)(2,"div",27),p(3,"app-file-upload",28),d(4,"translate"),d(5,"translate"),r(6,"button",29),S("click",function(){let n=E(e).$index,s=l().$index,g=l();return I(g.removeCredentialDocumentFormGroup(n,s,"personalIdentificationDocumentsArray","credentialDocumentsForOtherBankAccountBeneficiaries",g.otherBankAccountBeneficiaryDocumentGroupStatuses[s].personalIdentificationStatuses))}),r(7,"div",30),p(8,"app-svg-asset",31),r(9,"div"),f(10),d(11,"translate"),m()()()(),b(12,dn,2,1,"div",32),m()()}if(i&2){let e=a.$index,t=l().$index,n=l();o(),c("formGroupName",e),o(2),c("title",u(4,6,"client.dashboard.documents.upload-document"))("description",u(5,8,"client.dashboard.documents.click-to-upload"))("error",n.otherBankAccountBeneficiaryDocumentGroupStatuses[t].personalIdentificationStatuses[e].status===n.DocumentStatus.Invalid),o(7),h(" ",u(11,10,"common.form.action.remove")," "),o(2),x(n.otherBankAccountBeneficiaryDocumentGroupStatuses[t].personalIdentificationStatuses[e].status===n.DocumentStatus.Invalid?12:-1)}}function ln(i,a){if(i&1&&(r(0,"div",32),f(1),m()),i&2){let e=l().$index,t=l().$index,n=l();o(),h(" ",n.otherBankAccountBeneficiaryDocumentGroupStatuses[t].addressCardStatuses[e].message," ")}}function pn(i,a){if(i&1){let e=B();r(0,"div",23)(1,"div",26)(2,"div",27),p(3,"app-file-upload",28),d(4,"translate"),d(5,"translate"),r(6,"button",29),S("click",function(){let n=E(e).$index,s=l().$index,g=l();return I(g.removeCredentialDocumentFormGroup(n,s,"addressCardDocumentsArray","credentialDocumentsForOtherBankAccountBeneficiaries",g.otherBankAccountBeneficiaryDocumentGroupStatuses[s].addressCardStatuses))}),r(7,"div",30),p(8,"app-svg-asset",31),r(9,"div"),f(10),d(11,"translate"),m()()()(),b(12,ln,2,1,"div",32),m()()}if(i&2){let e=a.$index,t=l().$index,n=l();o(),c("formGroupName",e),o(2),c("title",u(4,6,"client.dashboard.documents.upload-document"))("description",u(5,8,"client.dashboard.documents.click-to-upload"))("error",n.otherBankAccountBeneficiaryDocumentGroupStatuses[t].addressCardStatuses[e].status===n.DocumentStatus.Invalid),o(7),h(" ",u(11,10,"common.form.action.remove")," "),o(2),x(n.otherBankAccountBeneficiaryDocumentGroupStatuses[t].addressCardStatuses[e].status===n.DocumentStatus.Invalid?12:-1)}}function fn(i,a){if(i&1){let e=B();r(0,"div",12)(1,"app-vosz-accordion",18)(2,"div",1),b(3,cn,1,1,"app-svg-asset",2)(4,mn,1,0,"app-svg-asset",3),r(5,"span"),f(6),p(7,"app-info-chip",19),d(8,"translate"),m()(),r(9,"div",4)(10,"div",5)(11,"div",20),p(12,"div",21),d(13,"translate"),r(14,"div",22),G(15,un,13,12,"div",23,w),r(17,"div",24),S("click",function(){let n=E(e).$index,s=l();return I(s.addCredentialDocumentFormGroup(n,"personalIdentificationDocumentsArray","credentialDocumentsForOtherBankAccountBeneficiaries",s.DocumentName.PersonalIdentification,s.otherBankAccountBeneficiaryDocumentGroupStatuses[n].personalIdentificationStatuses))}),p(18,"app-svg-asset",25),r(19,"div"),f(20),d(21,"translate"),m()()(),p(22,"div",21),d(23,"translate"),r(24,"div",11),G(25,pn,13,12,"div",23,w),r(27,"div",24),S("click",function(){let n=E(e).$index,s=l();return I(s.addCredentialDocumentFormGroup(n,"addressCardDocumentsArray","credentialDocumentsForOtherBankAccountBeneficiaries",s.DocumentName.AddressCard,s.otherBankAccountBeneficiaryDocumentGroupStatuses[n].addressCardStatuses))}),p(28,"app-svg-asset",25),r(29,"div"),f(30),d(31,"translate"),m()()()()()()()()}if(i&2){let e=a.$implicit,t=a.$index,n=l();o(),c("expanded",!0),o(2),x(n.personHasMissingDocumentOrInvalidFeedback(n.otherBankAccountBeneficiaryDocumentGroupStatuses[t],e.value.entityId)?3:4),o(3),h(" ",e.value.personName," "),o(),ze("chipText","",u(8,12,"client.dashboard.beneficiary-card-holder")," "),o(4),c("formGroupName",t),o(),c("innerHTML",u(13,14,"enum.document-name.PERSONAL_IDENTIFICATION"),A),o(2),c("formArrayName","personalIdentificationDocumentsArray"),o(),R(n.getCredentialDocumentArrayByIndexForRegistrationHolder(t,"personalIdentificationDocumentsArray","credentialDocumentsForOtherBankAccountBeneficiaries").controls),o(5),h(" ",u(21,16,"client.dashboard.documents.add-more-documents")," "),o(2),c("innerHTML",u(23,18,"enum.document-name.ADDRESS_CARD"),A),o(2),c("formArrayName","addressCardDocumentsArray"),o(),R(n.getCredentialDocumentArrayByIndexForRegistrationHolder(t,"addressCardDocumentsArray","credentialDocumentsForOtherBankAccountBeneficiaries").controls),o(5),h(" ",u(31,20,"client.dashboard.documents.add-more-documents")," ")}}var Ft=(()=>{class i{constructor(e,t,n,s){this.fb=e,this.dialog=t,this.translateService=n,this.documentService=s,this.registrationHolderPersons=[],this.otherBankAccountBeneficiaryPersons=[],this.hideNotification=!1,this.deleteDocument=new Q,this.uploadDocuments=new Q,this.registrationHolderDocumentGroupStatuses=[],this.otherBankAccountBeneficiaryDocumentGroupStatuses=[],this.registrationHolderIdToSignerTypeMap=new Map([]),this.componentLoading=U(()=>this.isLoading()||this.documentService.isLoading()),this.unsubscribe$=new fe,this.credentialDocumentNames=[D.PersonalIdentification,D.AddressCard],this.DocumentStatus=F,this.DocumentName=D,this.fileUploadForm=this.fb.group({credentialDocumentsForRegistrationHolders:this.fb.array([]),credentialDocumentsForOwners:this.fb.array([]),credentialDocumentsForOtherBankAccountBeneficiaries:this.fb.array([]),confirmDataCorrectness:[!1,[M.requiredTrue]]})}ngOnInit(){return O(this,null,function*(){this.initForm(),this.mapRegistrationHoldersToSignerType(),this.initDocGroupStatusOnChangeSubscription()})}uploadFiles(){if(this.issueId){let e=bt(this.fileUploadForm);this.uploadDocuments.emit(e),this.fileUploadForm.controls.confirmDataCorrectness.patchValue(!1),this.fileUploadForm.markAsPristine()}}getCredentialDocumentArrayByIndexForRegistrationHolder(e,t,n){return this.fileUploadForm.controls[n].get(e.toString()).get(t)}addCredentialDocumentFormGroup(e,t,n,s,g){let y=this.getCredentialDocumentArrayByIndexForRegistrationHolder(e,t,n);this.addEmptyCredentialDocumentGroup(y,s,g)}removeCredentialDocumentFormGroup(e,t,n,s,g){let y=this.getCredentialDocumentArrayByIndexForRegistrationHolder(t,n,s),_=y.at(e).value;this.dialog.open(ye,{data:{title:this.translateService.instant("common.dialog.remove-file"),content:_.file===null?this.translateService.instant("common.dialog.remove-file-from-list"):this.translateService.instant("common.dialog.remove-file-from-list-with-name",{fileName:_.file.name})},autoFocus:!1}).afterClosed().pipe(J(this.unsubscribe$)).subscribe(T=>{if(T){let k=y.at(e).value.fileId;k&&this.deleteDocument.emit(k),y.removeAt(e),g.splice(e,1)}})}personHasMissingDocumentOrInvalidFeedback(e,t){return this.personHasInvalidFeedback(e)||this.personHasMissingDocument(t)}personHasInvalidFeedback(e){return e.personalIdentificationStatuses.some(t=>t.status===F.Invalid)||e.addressCardStatuses.some(t=>t.status===F.Invalid)}personHasMissingDocument(e){return!this.credentialDocumentNames.every(t=>this.uploadedDocuments.groups.filter(n=>
1n.entityId===e).some(n=>n.documents.includes(t)))}credentialsHaveMissingDocumentOrInvalidFeedback(){return this.registrationHolderDocumentGroupStatuses.some((e,t)=>{let n=this.credentialDocumentsForRegistrationHolders.at(t).get("entityId")?.value;return this.personHasInvalidFeedback(e)||this.personHasMissingDocument(n)})||this.otherBankAccountBeneficiaryDocumentGroupStatuses.some((e,t)=>{let n=this.credentialDocumentsForOtherBankAccountBeneficiaries.at(t).get("entityId")?.value;return this.personHasInvalidFeedback(e)||this.personHasMissingDocument(n)})}initDocGroupStatusOnChangeSubscription(){this.initDocGroupStatusOnChangeSubscriptionForCompanyPersons(this.credentialDocumentsForRegistrationHolders,this.registrationHolderDocumentGroupStatuses),this.initDocGroupStatusOnChangeSubscriptionForCompanyPersons(this.credentialDocumentsForOtherBankAccountBeneficiaries,this.otherBankAccountBeneficiaryDocumentGroupStatuses)}initDocGroupStatusOnChangeSubscriptionForCompanyPersons(e,t){e.controls.forEach((n,s)=>{n.get("personalIdentificationDocumentsArray").controls.forEach((_,N)=>{_.valueChanges.subscribe(()=>{let T=t[s].personalIdentificationStatuses[N],k=_.value.file;this.isFileValid(k)?(T.status=F.Valid,T.message=""):T.status=F.Invalid})}),n.get("addressCardDocumentsArray").controls.forEach((_,N)=>{_.valueChanges.subscribe(()=>{let T=t[s].addressCardStatuses[N],k=_.value.file;this.isFileValid(k)?(T.status=F.Valid,T.message=""):T.status=F.Invalid})})})}isFileValid(e){return e?"."+e.name.split(".").pop()?.toLowerCase()!==".es3":!1}initForm(){this.initRegistrationHolderPersonsForm(),this.initOtherBankAccountBeneficiariesForm()}initRegistrationHolderPersonsForm(){let e=this.registrationHolderPersons.map(t=>t.personalData);this.getCredentialDocumentGroups(e,this.credentialDocumentsForRegistrationHolders,this.registrationHolderDocumentGroupStatuses)}initOtherBankAccountBeneficiariesForm(){let e=this.otherBankAccountBeneficiaryPersons.map(t=>t.personalData);this.getCredentialDocumentGroups(e,this.credentialDocumentsForOtherBankAccountBeneficiaries,this.otherBankAccountBeneficiaryDocumentGroupStatuses)}getCredentialDocumentGroups(e,t,n){e.forEach(s=>{let g=this.uploadedDocuments.groups.filter(k=>k.entityId===s.id),y=this.fb.array([]),_=this.fb.array([]),N=[],T=[];g.forEach(k=>{k.documents.includes(D.PersonalIdentification)?(y.push(this.fb.group({documents:[D.PersonalIdentification],fileId:k.fileId,file:[new File(["unknown"],k.fileName,{type:"unknown"}),M.required]})),this.addCredDocGroupStatus(N,k)):k.documents.includes(D.AddressCard)&&(_.push(this.fb.group({documents:[D.AddressCard],fileId:k.fileId,file:[new File(["unknown"],k.fileName,{type:"unknown"}),M.required]})),this.addCredDocGroupStatus(T,k))}),y.length===0&&this.addEmptyCredentialDocumentGroup(y,D.PersonalIdentification,N),_.length===0&&this.addEmptyCredentialDocumentGroup(_,D.AddressCard,T),n.push({personalIdentificationStatuses:N,addressCardStatuses:T}),t.push(this.fb.group({personalIdentificationDocumentsArray:y,addressCardDocumentsArray:_,personName:s.titlePrefix?this.formatPrefix(s.titlePrefix)+". "+s.lastName+" "+s.firstName:s.lastName+" "+s.firstName,entityId:s.id}))})}formatPrefix(e){if(!e)return"";switch(e){case Te.SmallDr:return"dr";case Te.BigDr:return"Dr";case Te.Ozv:return"\xD6zv";case Te.Ugyved:return"\xDCgyv";case Te.Mernok:return"M\xE9rn"}return String(e).trim().toLowerCase().split("_").filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" ")}addCredDocGroupStatus(e,t){e.push({status:t.status,message:t.message,documentNames:t.documents})}addEmptyCredentialDocumentGroup(e,t,n){e.push(this.fb.group({documents:[t],fileId:void 0,file:[null,M.required]})),n.push({status:F.Uploaded,message:"",documentNames:[t]})}mapRegistrationHoldersToSignerType(){this.registrationHolderPersons.forEach(e=>this.registrationHolderIdToSignerTypeMap.set(e.personalData.id,e.authorizedPersonData.signerType))}get credentialDocumentsForRegistrationHolders(){return this.fileUploadForm.controls.credentialDocumentsForRegistrationHolders}get credentialDocumentsForOtherBankAccountBeneficiaries(){return this.fileUploadForm.controls.credentialDocumentsForOtherBankAccountBeneficiaries}static{this.\u0275fac=function(t){return new(t||i)(C(oe),C(ae),C(L),C(le))}}static{this.\u0275cmp=P({type:i,selectors:[["app-credential-document-upload-form"]],inputs:{issueId:"issueId",isLoading:"isLoading",uploadedDocuments:"uploadedDocuments",registrationHolderPersons:"registrationHolderPersons",otherBankAccountBeneficiaryPersons:"otherBankAccountBeneficiaryPersons",formSave:"formSave",hideNotification:"hideNotification"},outputs:{deleteDocument:"deleteDocument",uploadDocuments:"uploadDocuments"},decls:31,vars:22,consts:[[1,"md:w-full",3,"condenseSignal","expanded"],["title","",1,"flex","gap-4","items-center"],[1,"w-6","h-6","text-error",3,"name"],["name","icons/information/check-circle",1,"w-6","h-6","text-secondary-120"],["content",""],[1,"flex","flex-wrap","justify-center","md:justify-start","items-center","mb-5"],[1,"w-full",3,"formGroup"],[3,"disabled"],[1,"text-center","bg-primary-10","rounded-xl","p-6"],[1,"pb-4",3,"innerHTML"],[3,"innerHTML"],[3,"formArrayName"],[1,"my-8"],[1,"flex","justify-between","items-center","w-full","md:w-[490px]","mx-1","mt-1"],["formControlName","confirmDataCorrectness",3,"required"],["mat-button","","type","submit",1,"button-secondary","text-primary-180","w-full","md:w-auto","mx-auto","mt-4",3,"click","loading"],[1,"flex","justify-center","items-center","gap-4"],["name","icons/document/save",1,"w-6","h-6","text-primary-180"],[1,"md:w-full",3,"expanded"],[3,"chipText"],[1,"w-full",3,"formGroupName"],[1,"text-base","font-thin","text-gray-600","pb-3",3,"innerHTML"],[1,"pb-3",3,"formArrayName"],[1,"pb-4"],[1,"flex","flex-wrap","justify-center","items-center","font-bold","text-base","gap-x-4","my-2","cursor-pointer","text-primary-120","hover:text-primary-140","duration-300","ease","pr-24",3,"click"],["name","icons/information/plus-circle",1,"w-6","h-6","text-primary-120"],[3,"formGroupName"],[1,"flex"],["formControlName","file",1,"w-full",3,"title","description","error"],[1,"pl-4","text-base","font-bold","!text-error","!hover:text-red-800","duration-300","ease","md:basis-2/12",3,"click"],[1,"flex","items-center","gap-2"],["name","icons/action/trash-can",1,"w-6","h-6","text-error"],[1,"mt-1","text-error","text-base","text-medium"]],template:function(t,n){t&1&&(r(0,"app-vosz-accordion",0)(1,"div",1),b(2,Yt,1,1,"app-svg-asset",2)(3,Xt,1,0,"app-svg-asset",3),r(4,"
1span"),f(5),d(6,"translate"),m()(),r(7,"div",4)(8,"div",5)(9,"form",6)(10,"fieldset",7)(11,"div",8),p(12,"div",9),d(13,"translate"),b(14,Zt,2,3,"div",10),m(),r(15,"div",11),G(16,an,32,22,"div",12,w),m(),r(18,"div",11),G(19,fn,32,22,"div",12,w),m(),r(21,"div",13)(22,"app-checkbox-input",14),f(23),d(24,"translate"),m()()(),r(25,"button",15),S("click",function(){return n.uploadFiles()}),r(26,"div",16),p(27,"app-svg-asset",17),r(28,"span"),f(29),d(30,"translate"),m()()()()()()()),t&2&&(c("condenseSignal",n.formSave)("expanded",!0),o(2),x(n.credentialsHaveMissingDocumentOrInvalidFeedback()?2:3),o(3),h(" ",u(6,14,"client.dashboard.documents.bank-account.upload-credential-documents"),""),o(4),c("formGroup",n.fileUploadForm),o(),c("disabled",n.componentLoading()),o(2),c("innerHTML",u(13,16,"client.dashboard.documents.bank-account.description.credential-documents-part-1"),A),o(2),x(n.hideNotification?-1:14),o(),c("formArrayName","credentialDocumentsForRegistrationHolders"),o(),R(n.credentialDocumentsForRegistrationHolders.controls),o(2),c("formArrayName","credentialDocumentsForOtherBankAccountBeneficiaries"),o(),R(n.credentialDocumentsForOtherBankAccountBeneficiaries.controls),o(3),c("required",!0),o(),h(" ",u(24,18,"client.dashboard.documents.confirm-upload")," "),o(2),c("loading",n.componentLoading()),o(4),H(u(30,20,"client.dashboard.documents.upload-documents")))},dependencies:[me,ce,de,Ce,te,X,Z,ve,W,ne,ie,he,De,q,_e,re,z,se,j,ft],encapsulation:2,data:{animation:[ue]}})}}return i})();var hn=i=>({docNumber:i});function Dn(i,a){i&1&&p(0,"app-svg-asset",2),i&2&&c("name","icons/information/x-circle")}function vn(i,a){i&1&&p(0,"app-svg-asset",3),i&2&&c("name","icons/information/check-circle")}function gn(i,a){if(i&1){let e=B();r(0,"div")(1,"app-checkbox-input",23),S("changed",function(){E(e);let n=l(2);return I(n.setCheckboxesForSpecificFormArray(n.es3Documents,n.es3DocumentCheckboxValues))}),p(2,"span",24),d(3,"translate"),m()()}if(i&2){let e=a.$implicit,t=a.$index,n=l(2);o(),c("formControlName",e),o(),c("innerHTML",u(3,2,"enum.document-name."+n.es3DocumentNames[t]),A)}}function yn(i,a){if(i&1&&(r(0,"div",22),f(1),m()),i&2){let e=l().$index,t=l();o(),h(" ",t.es3DocumentGroupStatuses[e].message," ")}}function Cn(i,a){if(i&1&&(be(0,10),r(1,"div",16)(2,"app-info-card",17)(3,"div"),p(4,"app-file-upload",18)(5,"app-text-input",19),r(6,"div",20),f(7),d(8,"translate"),m(),r(9,"div",21),G(10,gn,4,4,"div",null,w),m(),b(12,yn,2,1,"div",22),m()()(),Ee()),i&2){let e=a.$index,t=l();c("formGroupName",e),o(2),c("shadowDisabled",!0)("errorBorder",t.es3DocumentGroupStatuses.length>0&&t.es3DocumentGroupStatuses[e]&&t.es3DocumentGroupStatuses[e].status===t.DocumentStatus.Invalid),o(3),c("hidden",!0),o(2),h(" ",Y(8,6,"client.dashboard.documents.content-of-es3",xe(9,hn,e+1))," "),o(3),R(t.es3DocumentKeys),o(2),x(t.es3DocumentGroupStatuses.length>0&&t.es3DocumentGroupStatuses[e]&&t.es3DocumentGroupStatuses[e].status===t.DocumentStatus.Invalid?12:-1)}}var Tt=(()=>{class i{constructor(e,t,n,s,g){this.fb=e,this.dialog=t,this.translateService=n,this.documentService=s,this.es3DocumentErrorHandlerService=g,this.deleteDocumentGroupWithoutConfirm=!1,this.isCondominium=!1,this.uploadDocuments=new Q,this.numberOfEs3DocumentsOptions=[],this.es3DocumentGroupStatuses=[],this.es3DocumentKeys=[],this.componentLoading=U(()=>this.isLoading()||this.documentService.isLoading()),this.hasMissingDocumentOrInvalidDocumentStatus=V(!1),this.filteredDocumentFileGroups=[],this.unsubscribe$=new fe,this.env=ge,this.DocumentStatus=F,this.setCheckboxesForSpecificFormArray=pe,this.form=this.fb.group({numberOfEs3Documents:new ee(1)}),this.fileUploadForm=this.fb.group({es3Documents:this.fb.array([]),confirmDataCorrectness:[!1,[M.requiredTrue]]})}ngOnChanges(e){e.hasEs3&&this.hasEs3&&this.fileUploadForm.controls.es3Documents.reset(),e.uploadedDocuments&&this.uploadedDocuments&&this.checkMissingDocumentOrInvalidDocumentStatus()}ngOnInit(){this.numberOfEs3DocumentsOptions=Le(this.es3DocumentNames),this.es3DocumentKeys=$e(this.es3DocumentNames),this.filteredDocumentFileGroups=this.filterUploadedDocuments(),this.initForm(),this.es3DocumentErrorHandlerService.loadErrors(this.filteredDocumentFileGroups,this.es3Documents,this.es3DocumentGroupStatuses),this.createNumberOfEs3DocumentsSubscription(),pe(this.es3Documents,this.es3DocumentCheckboxValues),this.checkMissingDocumentOrInvalidDocumentStatus()}checkMissingDocumentOrInvalidDocumentStatus(){this.hasMissingDocumentOrInvalidDocumentStatus.set(this.es3DocumentGroupStatuses.some(e=>e.status===F.Invalid)||!this.es3DocumentNames.every(e=>this.isCondominium&&(e===D.RepAuthNotarySignOrLawyerCertSign||e===D.LegalEntityRecentCompanyExtract)?!0:this.uploadedDocuments.groups.some(t=>t.documents.includes(e))))}filterUploadedDocuments(){return this.uploadedDocuments?this.uploadedDocuments.groups.filter(e=>e.documents.some(t=>this.es3DocumentNames.includes(t))):[]}createNumberOfEs3DocumentsSubscription(){this.form.controls.numberOfEs3Documents.valueChanges.pipe(He(this.form.controls.numberOfEs3Documents.value),Ue(),J(this.unsubscribe$)).subscribe(([e,t])=>{t!==null&&e!==null&&(t<e&&!this.deleteDocumentGroupWithoutConfirm?this.confirmChanges(t,e):this.adjustDocumentsFormArraySize(t),this.deleteDocumentGroupWithoutConfirm&&(this.deleteDocumentGroupWithoutConfirm=!1),pe(this.es3Documents,this.es3DocumentCheckboxValues))})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}confirmChanges(e,t){this.dialog.open(ye,{data:{title:this.translateService.instant("client.dashboard.documents.remove-document"),content:this.translateService.instant("client.dashboard.documents.confirm-remove")},autoFocus:!1}).afterClosed().pipe(J(this.unsubscribe$)).subscribe(s=>{s?(this.adjustDocumentsFormArraySize(e),pe(this.es3Documents,this.es3DocumentCheckboxValues)):this.form.controls.numberOfEs3Documents.setValue(t)})}adjustDocumentsFormArraySize(e){let t=this.es3Documents.length;if(e>t)for(;this.es3Documents.length<e;)this.addDocumentFormGroup();else if(e<t){for(;this.es3Documents.length>e;)this.es3Documents.removeAt(this.es3Documents.length-1);this.es3DocumentErrorHandlerService.onDocumentGroupsRemoved(e),this.checkMissingDocumentOrInvalidDocumentStatus()}}initForm(){this.filteredDocumentFileGroups.length>
10?(this.filteredDocumentFileGroups.forEach(e=>{let t=this.fb.group({file:[null,M.required],fileId:[e.fileId]});this.es3DocumentKeys.forEach(n=>{t.addControl(n,new ee(!1))}),t.controls.file.setValue(new File(["unknown"],e.fileName,{type:"unknown"})),e.documents.forEach(n=>{if(this.es3DocumentNames.includes(n)){let s=Ne(D,n);t.controls[s].setValue(!0)}}),this.es3Documents.push(t)}),this.form.controls.numberOfEs3Documents.setValue(this.es3Documents.length)):this.addDocumentFormGroup()}addDocumentFormGroup(){let e=this.fb.group({file:[null,M.required],fileId:[null]});this.es3DocumentKeys.forEach(t=>{e.addControl(t,new ee(!1))}),this.es3Documents.push(e)}uploadFiles(){if(this.issueId){let e=xt(this.fileUploadForm,this.es3DocumentKeys);this.uploadDocuments.emit(e),this.fileUploadForm.controls.confirmDataCorrectness.patchValue(!1),this.fileUploadForm.markAsPristine()}}get es3Documents(){return this.fileUploadForm.controls.es3Documents}get es3DocumentCheckboxValues(){return this.fileUploadForm.value.es3Documents}static{this.\u0275fac=function(t){return new(t||i)(C(oe),C(ae),C(L),C(le),C(K))}}static{this.\u0275cmp=P({type:i,selectors:[["app-es3-document-upload-form"]],inputs:{issueId:"issueId",isLoading:"isLoading",es3DocumentNames:"es3DocumentNames",uploadedDocuments:"uploadedDocuments",hasEs3:"hasEs3",deleteDocumentGroupWithoutConfirm:"deleteDocumentGroupWithoutConfirm",formSave:"formSave",isCondominium:"isCondominium"},outputs:{uploadDocuments:"uploadDocuments"},features:[Ie([K]),Me],decls:28,vars:24,consts:[[1,"md:w-full",3,"condenseSignal"],["title","",1,"flex","gap-4","items-center"],[1,"w-6","h-6","text-error",3,"name"],[1,"w-6","h-6","text-secondary-120",3,"name"],["content",""],[1,"flex","flex-wrap","justify-center","md:justify-start","items-center"],[1,"w-full",3,"formGroup"],["formControlName","numberOfEs3Documents",1,"mb-2","w-full","md:w-[300px]",3,"label","options","required","placeholder"],[3,"disabled"],["formArrayName","es3Documents"],[3,"formGroupName"],[1,"flex","justify-between","items-center","w-full","md:w-[490px]","mx-1","mt-4"],["formControlName","confirmDataCorrectness",3,"required"],["mat-button","","type","submit",1,"button-secondary","text-primary-180","w-full","md:w-auto","mx-auto","mt-4",3,"click","loading"],[1,"flex","justify-center","items-center","gap-4"],["name","icons/document/save",1,"w-6","h-6","text-primary-180"],[1,"mt-5"],[3,"shadowDisabled","errorBorder"],["formControlName","file"],["formControlName","fileId",3,"hidden"],[1,"my-5","text-base","font-medium"],[1,"flex","flex-wrap","mt-4","gap-x-10"],[1,"text-error","text-base","text-medium"],[3,"changed","formControlName"],[3,"innerHTML"]],template:function(t,n){t&1&&(r(0,"app-vosz-accordion",0)(1,"div",1),b(2,Dn,1,1,"app-svg-asset",2)(3,vn,1,1,"app-svg-asset",3),r(4,"span"),f(5),d(6,"translate"),m()(),r(7,"div",4)(8,"div",5)(9,"form",6),p(10,"app-select-input",7),d(11,"translate"),d(12,"translate"),m(),r(13,"form",6)(14,"fieldset",8)(15,"div",9),G(16,Cn,13,11,"ng-container",10,w),m(),r(18,"div",11)(19,"app-checkbox-input",12),f(20),d(21,"translate"),m()()(),r(22,"button",13),S("click",function(){return n.uploadFiles()}),r(23,"div",14),p(24,"app-svg-asset",15),r(25,"span"),f(26),d(27,"translate"),m()()()()()()()),t&2&&(c("condenseSignal",n.formSave),o(2),x(n.hasMissingDocumentOrInvalidDocumentStatus()?2:3),o(3),h(" ",u(6,14,"client.dashboard.documents.bank-account.upload-base-documents.es3"),""),o(4),c("formGroup",n.form),o(),c("label",u(11,16,"client.dashboard.documents.number-of-documents"))("options",n.numberOfEs3DocumentsOptions)("required",!0)("placeholder",u(12,18,"common.form.placeholder.select")),o(3),c("formGroup",n.fileUploadForm),o(),c("disabled",n.componentLoading()),o(2),R(n.es3Documents.controls),o(3),c("required",!0),o(),h(" ",u(21,20,"client.dashboard.documents.confirm-upload")," "),o(2),c("loading",n.componentLoading()),o(4),H(u(27,22,"client.dashboard.documents.upload-documents")))},dependencies:[me,se,j,q,ke,Be,ce,de,_e,Fe,te,X,Z,ve,re,W,z,ne,ie,he,De,Pe,qe],encapsulation:2,data:{animation:[ue]}})}}return i})();var _n=i=>({docNumber:i});
1function xn(i,a){i&1&&p(0,"app-svg-asset",2),i&2&&c("name","icons/information/x-circle")}function Sn(i,a){i&1&&p(0,"app-svg-asset",3),i&2&&c("name","icons/information/check-circle")}function bn(i,a){if(i&1){let e=B();r(0,"div")(1,"app-checkbox-input",24),S("changed",function(){E(e);let n=l(2);return I(n.setCheckboxesForSpecificFormArray(n.nonEs3Documents,n.nonEs3DocumentCheckboxValues))}),p(2,"span",25),d(3,"translate"),m()()}if(i&2){let e=a.$implicit,t=a.$index,n=l(2);o(),c("formControlName",e),o(),c("innerHTML",u(3,2,"enum.document-name."+n.nonEs3DocumentNames[t]),A)}}function En(i,a){if(i&1&&(r(0,"div",23),f(1),m()),i&2){let e=l().$index,t=l();o(),h(" ",t.nonEs3DocumentGroupStatuses[e].message," ")}}function In(i,a){if(i&1&&(be(0,11),r(1,"div",17)(2,"app-info-card",18)(3,"div"),p(4,"app-file-upload",19)(5,"app-text-input",20),r(6,"div",21),f(7),d(8,"translate"),m(),r(9,"div",22),G(10,bn,4,4,"div",null,w),m(),b(12,En,2,1,"div",23),m()()(),Ee()),i&2){let e=a.$index,t=l();c("formGroupName",e),o(2),c("shadowDisabled",!0)("errorBorder",t.nonEs3DocumentGroupStatuses.length>0&&t.nonEs3DocumentGroupStatuses[e]&&t.nonEs3DocumentGroupStatuses[e].status===t.DocumentStatus.Invalid),o(3),c("hidden",!0),o(2),h(" ",Y(8,6,"client.dashboard.documents.bank-account.content-of-document",xe(9,_n,e+1))," "),o(3),R(t.nonEs3DocumentKeys),o(2),x(t.nonEs3DocumentGroupStatuses.length>0&&t.nonEs3DocumentGroupStatuses[e]&&t.nonEs3DocumentGroupStatuses[e].status===t.DocumentStatus.Invalid?12:-1)}}var kt=(()=>{class i{constructor(e,t,n,s,g){this.fb=e,this.dialog=t,this.translateService=n,this.documentService=s,this.nonEs3DocumentErrorHandlerService=g,this.deleteDocumentGroupWithoutConfirm=!1,this.uploadDocuments=new Q,this.numberOfNonEs3DocumentsOptions=[],this.nonEs3DocumentGroupStatuses=[],this.nonEs3DocumentKeys=[],this.componentLoading=U(()=>this.isLoading()||this.documentService.isLoading()),this.hasMissingDocumentOrInvalidDocumentStatus=V(!1),this.filteredDocumentFileGroups=[],this.unsubscribe$=new fe,this.DocumentStatus=F,this.setCheckboxesForSpecificFormArray=pe,this.form=this.fb.group({numberOfNonEs3Documents:new ee(1)}),this.fileUploadForm=this.fb.group({nonEs3Documents:this.fb.array([]),confirmDataCorrectness:[!1,[M.requiredTrue]]})}ngOnInit(){this.numberOfNonEs3DocumentsOptions=Le(this.nonEs3DocumentNames),this.nonEs3DocumentKeys=$e(this.nonEs3DocumentNames),this.filteredDocumentFileGroups=this.filterUploadedDocuments(),this.initForm(),this.nonEs3DocumentErrorHandlerService.loadErrors(this.filteredDocumentFileGroups,this.nonEs3Documents,this.nonEs3DocumentGroupStatuses),this.createNumberOfNonEs3DocumentsSubscription(),pe(this.nonEs3Documents,this.nonEs3DocumentCheckboxValues),this.checkMissingDocumentOrInvalidDocumentStatus()}ngOnChanges(e){e.uploadedDocuments&&this.uploadedDocuments&&this.checkMissingDocumentOrInvalidDocumentStatus()}checkMissingDocumentOrInvalidDocumentStatus(){this.hasMissingDocumentOrInvalidDocumentStatus.set(this.nonEs3DocumentGroupStatuses.some(e=>e.status===F.Invalid)||!this.nonEs3DocumentNames.every(e=>this.uploadedDocuments.groups.some(t=>t.documents.includes(e))))}filterUploadedDocuments(){return this.uploadedDocuments?this.uploadedDocuments.groups.filter(e=>e.documents.some(t=>this.nonEs3DocumentNames.includes(t))&&e.entityId===null):[]}createNumberOfNonEs3DocumentsSubscription(){this.form.controls.numberOfNonEs3Documents.valueChanges.pipe(He(this.form.controls.numberOfNonEs3Documents.value),Ue(),J(this.unsubscribe$)).subscribe(([e,t])=>{t!==null&&e!==null&&(t<e&&!this.deleteDocumentGroupWithoutConfirm?this.confirmChanges(t,e):this.adjustDocumentsFormArraySize(t),this.deleteDocumentGroupWithoutConfirm&&(this.deleteDocumentGroupWithoutConfirm=!1),pe(this.nonEs3Documents,this.nonEs3DocumentCheckboxValues))})}ngOnDestroy(){this.unsubscribe$.next(),this.unsubscribe$.complete()}initForm(){this.filteredDocumentFileGroups.length>0?(this.filteredDocumentFileGroups.forEach(e=>{let t=this.fb.group({file:[null,M.required],fileId:[e.fileId]});this.nonEs3DocumentKeys.forEach(n=>{t.addControl(n,new ee(!1))}),t.controls.file.setValue(new File(["unknown"],e.fileName,{type:"unknown"}
1)),e.documents.forEach(n=>{if(this.nonEs3DocumentNames.includes(n)){let s=Ne(D,n);t.controls[s].setValue(!0)}}),this.nonEs3Documents.push(t)}),this.form.controls.numberOfNonEs3Documents.setValue(this.nonEs3Documents.length)):this.addDocumentFormGroup()}addDocumentFormGroup(){let e=this.fb.group({file:[null,M.required],fileId:[null]});this.nonEs3DocumentKeys.forEach(t=>{e.addControl(t,new ee(!1))}),this.nonEs3Documents.push(e)}confirmChanges(e,t){this.dialog.open(ye,{data:{title:this.translateService.instant("client.dashboard.documents.remove-document"),content:this.translateService.instant("client.dashboard.documents.confirm-remove")},autoFocus:!1}).afterClosed().pipe(J(this.unsubscribe$)).subscribe(s=>{s?(this.adjustDocumentsFormArraySize(e),pe(this.nonEs3Documents,this.nonEs3DocumentCheckboxValues)):this.form.controls.numberOfNonEs3Documents.setValue(t)})}adjustDocumentsFormArraySize(e){let t=this.nonEs3Documents.length;if(e>t)for(;this.nonEs3Documents.length<e;)this.addDocumentFormGroup();else if(e<t){for(;this.nonEs3Documents.length>e;)this.nonEs3Documents.removeAt(this.nonEs3Documents.length-1);this.nonEs3DocumentErrorHandlerService.onDocumentGroupsRemoved(e),this.checkMissingDocumentOrInvalidDocumentStatus()}}uploadFiles(){if(this.issueId){let e=St(this.fileUploadForm,this.nonEs3DocumentKeys);this.uploadDocuments.emit(e),this.fileUploadForm.controls.confirmDataCorrectness.patchValue(!1),this.fileUploadForm.markAsPristine()}}get nonEs3Documents(){return this.fileUploadForm.controls.nonEs3Documents}get nonEs3DocumentCheckboxValues(){return this.fileUploadForm.value.nonEs3Documents}static{this.\u0275fac=function(t){return new(t||i)(C(oe),C(ae),C(L),C(le),C(K))}}static{this.\u0275cmp=P({type:i,selectors:[["app-non-es3-document-upload-form"]],inputs:{issueId:"issueId",isLoading:"isLoading",nonEs3DocumentNames:"nonEs3DocumentNames",uploadedDocuments:"uploadedDocuments",deleteDocumentGroupWithoutConfirm:"deleteDocumentGroupWithoutConfirm",formSave:"formSave"},outputs:{uploadDocuments:"uploadDocuments"},features:[Ie([K]),Me],decls:31,vars:27,consts:[[1,"md:w-full",3,"condenseSignal"],["title","",1,"flex","gap-4","items-center"],[1,"w-6","h-6","text-error",3,"name"],[1,"w-6","h-6","text-secondary-120",3,"name"],["content",""],[1,"flex","flex-wrap","justify-center","md:justify-start","items-center","mb-5"],[1,"w-full",3,"formGroup"],["formControlName","numberOfNonEs3Documents",1,"mb-2","w-full","md:w-[300px]",3,"label","options","required","placeholder"],[3,"disabled"],[1,"text-center","bg-primary-10","rounded-xl","p-6","mb-6"],["formArrayName","nonEs3Documents"],[3,"formGroupName"],[1,"flex","justify-between","items-center","w-full","md:w-[490px]","mx-1","mt-4"],["formControlName","confirmDataCorrectness",3,"required"],["mat-button","","type","submit",1,"button-secondary","text-primary-180","w-full","md:w-auto","mx-auto","mt-4",3,"click","loading"],[1,"flex","justify-center","items-center","gap-4"],["name","icons/document/save",1,"w-6","h-6","text-primary-180"],[1,"mt-5"],[3,"shadowDisabled","errorBorder"],["formControlName","file"],["formControlName","fileId",3,"hidden"],[1,"my-5","text-base","font-medium"],[1,"flex","flex-wrap","mt-4","gap-x-10"],[1,"text-error","text-base","text-medium"],[3,"changed","formControlName"],[3,"innerHTML"]],template:function(t,n){t&1&&(r(0,"app-vosz-accordion",0)(1,"div",1),b(2,xn,1,1,"app-svg-asset",2)(3,Sn,1,1,"app-svg-asset",3),r(4,"span"),f(5),d(6,"translate"),m()(),r(7,"div",4)(8,"div",5)(9,"form",6),p(10,"app-select-input",7),d(11,"translate"),d(12,"translate"),m(),r(13,"form",6)(14,"fieldset",8)(15,"div",9),f(16),d(17,"translate"),m(),r(18,"div",10),G(19,In,13,11,"ng-container",11,w),m(),r(21,"div",12)(22,"app-checkbox-input",13),f(23),d(24,"translate"),m()()(),r(25,"button",14),S("click",function(){return n.uploadFiles()}),r(26,"div",15),p(27,"app-svg-asset",16),r(28,"span"),f(29),d(30,"translate"),m()()()()()()()),t&2&&(c("condenseSignal",n.formSave),o(2),x(n.hasMissingDocumentOrInvalidDocumentStatus()?2:3),o(3),h(" ",u(6,15,"client.dashboard.documents.bank-account.upload-base-documents.non-e
1s3"),""),o(4),c("formGroup",n.form),o(),c("label",u(11,17,"client.dashboard.documents.bank-account.number-of-documents"))("options",n.numberOfNonEs3DocumentsOptions)("required",!0)("placeholder",u(12,19,"common.form.placeholder.select")),o(3),c("formGroup",n.fileUploadForm),o(),c("disabled",n.componentLoading()),o(2),h(" ",u(17,21,"client.dashboard.documents.bank-account.description.non-es3")," "),o(3),R(n.nonEs3Documents.controls),o(3),c("required",!0),o(),h(" ",u(24,23,"client.dashboard.documents.confirm-upload")," "),o(2),c("loading",n.componentLoading()),o(4),H(u(30,25,"client.dashboard.documents.upload-documents")))},dependencies:[me,Be,ce,de,Ce,te,X,Z,ve,W,ne,ie,he,De,q,_e,re,z,Pe,se,qe,j],encapsulation:2,data:{animation:[ue]}})}}return i})();function Fn(i,a){if(i&1){let e=B();r(0,"app-es3-document-upload-form",10),S("uploadDocuments",function(n){E(e);let s=l(2);return I(s.uploadEs3Documents(n))}),m()}if(i&2){let e=l(2);c("issueId",e.issueId())("isLoading",e.isLoading)("es3DocumentNames",e.requiredDocuments.es3Documents)("uploadedDocuments",e.uploadedDocuments)("hasEs3",e.hasEs3Value)("deleteDocumentGroupWithoutConfirm",e.deleteDocumentGroupWithoutConfirm)("formSave",e.es3DocumentSignal)("isCondominium",e.isCondominium)}}function Tn(i,a){if(i&1){let e=B();r(0,"app-non-es3-document-upload-form",11),S("uploadDocuments",function(n){E(e);let s=l(2);return I(s.uploadNonEs3Documents(n))}),m()}if(i&2){let e=l(2);c("issueId",e.issueId())("isLoading",e.isLoading)("nonEs3DocumentNames",e.requiredDocuments.nonEs3Documents)("uploadedDocuments",e.uploadedDocuments)("deleteDocumentGroupWithoutConfirm",e.deleteDocumentGroupWithoutConfirm)("formSave",e.nonEs3DocumentSignal)}}function kn(i,a){if(i&1){let e=B();r(0,"app-credential-document-upload-form",12),S("uploadDocuments",function(n){E(e);let s=l(2);return I(s.uploadCredentialDocuments(n))})("deleteDocument",function(n){E(e);let s=l(2);return I(s.deleteCredentialDocument(n))}),m()}if(i&2){let e=l(2);c("issueId",e.issueId())("isLoading",e.isLoading)("uploadedDocuments",e.uploadedDocuments)("registrationHolderPersons",e.registrationHolderPersons)("otherBankAccountBeneficiaryPersons",e.otherBankAccountBeneficiaryPersons)("formSave",e.credentialDocumentSignal)}}function Bn(i,a){if(i&1){let e=B();p(0,"app-bank-account-document-upload-information",5),b(1,Fn,1,8,"app-es3-document-upload-form",6)(2,Tn,1,6,"app-non-es3-document-upload-form",7)(3,kn,1,6,"app-credential-document-upload-form",8),r(4,"app-additional-document-upload-form",9),S("uploadDocuments",function(n){E(e);let s=l();return I(s.uploadAdditionalDocuments(n))})("deleteDocument",function(n){E(e);let s=l();return I(s.deleteAdditionalDocument(n))}),m()}if(i&2){let e=l();c("issueType",e.issueType)("companyTypeResponse",e.companyTypeResponse)("missingEDocumentForm",e.missingEDocumentForm)("requiredDocuments",e.requiredDocuments)("hasRequiredEs3Document",e.hasRequiredEs3Document),o(),x(e.displayRequiredEs3Documents()?1:-1),o(),x(e.displayRequiredNonEs3Documents()?2:-1),o(),x(e.displayCredentialDocuments()?3:-1),o(),c("issueId",e.issueId())("isLoading",e.isLoading)("uploadedDocuments",e.uploadedDocuments)("deleteDocumentGroupWithoutConfirm",e.deleteDocumentGroupWithoutConfirm)("formSave",e.additionalDocumentSignal)}}var Cr=(()=>{class i extends dt{constructor(e,t,n,s,g,y,_,N){super(),this.fb=e,this.translateService=t,this.documentService=n,this.companyDataService=s,this.personDataService=g,this.feedbackService=y,this.preloadService=_,this.cdr=N,this.breadcrumbs=[{name:this.translateService.instant("client.dashboard.company.title"),url:"/bank-account-flow/company-data-status"},{name:this.translateService.instant("client.dashboard.documents.upload-documents"),url:"/bank-account-flow/document-upload"}],this.isLoading=U(()=>this.preloadService.isLoading()||this.feedbackService.isLoading()),this.issueId=U(()=>this.formPreloadService.bankAccountIssueId()),this.displayBaseDocuments=U(()=>this.issueType!==$.AddHolderOfBankAccounts&&this.issueType!==$.AddBankCardToHolderOfBankAccounts&&this.issueType!==$.EditEntitledToRegisterPersonData&&this.issueType!==$.EditHolderOfBankAccountsPersonData),this.hasRequiredEs3Document=V(!0),this.displayRequiredEs3Documents=U(()=>this.hasEs3Signal()&&this.hasRequiredEs3Document()&&this.displayBaseDocuments()),this.hasRequiredNonEs3Document=V(!0),this.displayRequiredNonEs3Documents=U(()=>this.hasRequiredNonEs3Document()&&this.displayBaseDocuments()),this.displayCredentialDocuments=V(!0),this.isPageLoading=!0,this.FormGroup=tt,this.DocumentStatus=F,this.IssueCategory=rt,this.feedback=[],this.registrationHolderPersons=[],this.otherBankAccountBeneficiaryPersons=[],this.deleteDocumentGroupWithoutConfirm=!1,this.formPreloadService=Xe(Ve),this.hasEs3Value=!1,this.isCondominium=!1,this.hasEs3Signal=V(!1),this.env=ge,this.missingEDocumentForm=this.fb.group({hasEs3:new ee(!1)}),this.missingEDocumentFormErrorHandler=new ut(this.missingEDocumentForm)}ngOnInit(){return O(this,null,function*(){yield this.getFormFeedback(),yield this.preload(),this.hasRequiredEs3Document.set(this.requiredDocuments.es3Documents.length>0),this.hasRequiredNonEs3Document.set(this.requiredDocuments.nonEs3Documents.length>0),yield this.getPersons().then(()=>{this.displayCredentialDocuments.set(this.registrationHolderPersons.length>0||this.otherBankAccountBeneficiaryPersons.length>0)}
1),this.initMissingEDocumentForm(),this.isCondominium=this.companyTypeResponse.type==="CONDOMINIUM",this.isPageLoading=!1})}getPersons(){return O(this,null,function*(){let e=yield this.personDataService.getAuthorizedForCompanyRegistrationCompanyPersons();this.registrationHolderPersons=e.persons;let t=yield this.personDataService.getOtherBankAccountBeneficiary();this.otherBankAccountBeneficiaryPersons=t.persons})}createHasEs3ValueChangeSubscription(){this.hasEs3.valueChanges.subscribe(e=>O(this,null,function*(){this.onEs3DocumentChanged(!e),this.hasEs3Signal.set(!e),this.companyDataService.patchHasEs3(this.issueId(),{hasEs3:!e})}))}initMissingEDocumentForm(){return O(this,null,function*(){this.issueId()&&this.companyDataService.getHasEs3(this.issueId()).then(e=>{this.hasEs3.setValue(!e.hasEs3),this.hasEs3Signal.set(e.hasEs3),setTimeout(()=>{this.missingEDocumentFormErrorHandler.updateForm(this.missingEDocumentForm),this.missingEDocumentFormErrorHandler?.nextFeedback({feedbacks:this.feedback}),this.cdr.detectChanges()}),this.createHasEs3ValueChangeSubscription()})})}preload(){return O(this,null,function*(){this.companyTypeResponse=yield this.companyDataService.getCompanyType(),this.issueId()!==void 0&&(this.uploadedDocuments=yield this.documentService.getDocuments(this.issueId()),this.requiredDocuments=yield this.documentService.getRequiredDocuments(this.issueId()))})}deleteCredentialDocument(e){return O(this,null,function*(){this.issueId()&&(yield this.documentService.deleteCredentialDocument(this.issueId(),e))})}deleteAdditionalDocument(e){return O(this,null,function*(){this.issueId()&&(yield this.documentService.deleteAdditionalDocument(this.issueId(),e))})}uploadEs3Documents(e){return O(this,null,function*(){this.issueId()&&(yield this.documentService.uploadRequiredDocuments(this.issueId(),!0,e),this.uploadedDocuments=yield this.documentService.getDocuments(this.issueId()))})}uploadNonEs3Documents(e){return O(this,null,function*(){this.issueId()&&(yield this.documentService.uploadRequiredDocuments(this.issueId(),!1,e),this.uploadedDocuments=yield this.documentService.getDocuments(this.issueId()))})}uploadCredentialDocuments(e){return O(this,null,function*(){this.issueId()&&(yield this.documentService.uploadCredentialDocuments(this.issueId(),e),this.uploadedDocuments=yield this.documentService.getDocuments(this.issueId()))})}uploadAdditionalDocuments(e){return O(this,null,function*(){this.issueId()&&(yield this.documentService.uploadAdditionalDocuments(this.issueId(),e),this.uploadedDocuments=yield this.documentService.getDocuments(this.issueId()))})}get hasEs3(){return this.missingEDocumentForm.controls.hasEs3}nextPage(){return O(this,null,function*(){let e=this.activatedRoute.snapshot.url.map(s=>s.path),t=this.formPreloadService.issueType();if(!t)return;let n=!0;this.isFormDirty()&&(n=yield this.openConfirmDialog()),n&&(this.redirectUrl?yield this.router.navigateByUrl(this.redirectUrl):yield this.router.navigate(mt(t,e)))})}onEs3DocumentChanged(e){e&&(this.deleteDocumentGroupWithoutConfirm=!0),this.hasEs3Value=e}getFormFeedback(){return O(this,null,function*(){if(this.preloadService.issueStatus()!==st.ErrorCorrection)return;let e=this.preloadService.bankAccountIssueId();e!==void 0&&(this.feedback=yield this.feedbackService.getFormFeedback(e,ot.Es3Document))})}get es3DocumentSignal(){return this.documentService.es3DocumentSignal}get nonEs3DocumentSignal(){return this.documentService.nonEs3DocumentSignal}get credentialDocumentSignal(){return this.documentService.credentialDocumentSignal}get additionalDocumentSignal(){return this.documentService.additionalDocumentSignal}static{this.\u0275fac=function(t){return new(t||i)(C(oe),C(L),C(le),C(pt),C(ht),C(lt),C(Ve),C(et))}}static{this.\u0275cmp=P({type:i,selectors:[["app-bank-account-document-upload"]],features:[Ze],decls:11,vars:8,consts:[[1,"px-2","mb-10","max-w-[1080px]","container"],[1,"mt-6","mb-2"],[3,"breadcrumbs","issueCategory"],["mat-button","","type","submit",1,"button-primary","text-primary-180","w-full","md:w-auto","ml-auto","mt-10",3,"click"],[1,"flex","justify-center","items-center","gap-4"],[3,"issueType","companyTypeResponse","missingEDocumentForm","requiredDocuments","hasRequiredEs3Document"],[3,"issueId","isLoading","es3DocumentNames","uploadedDocuments","hasEs3","deleteDocumentGroupWithoutConfirm","formSave","isCondominium"],[3,"issueId","isLoading","nonEs3DocumentNames","uploadedDocuments","deleteDocumentGroupWithoutConfirm","formSave"],[3,"issueId","isLoading","uploadedDocuments","registrationHolderPersons","otherBankAccountBeneficiaryPersons","formSave"],[3,"uploadDocuments","deleteDocument","issueId","isLoading","uploadedDocuments","deleteDocumentGroupWithoutConfirm","formSave"],[3,"uploadDocuments","issueId","isLoading","es3DocumentNames","uploadedDocuments","hasEs3","deleteDocumentGroupWithoutConfirm","formSave","isCondominium"],[3,"uploadDocuments","issueId","isLoading","nonEs3DocumentNames","uploadedDocuments","deleteDocumentGroupWithoutConfirm","formSave"],[3,"uploadDocuments","deleteDocument","issueId","isLoading","uploadedDocuments","registrationHolderPersons","otherBankAccountBeneficiaryPersons","formSave"]],template:function(t,n){t&1&&(r(0,"div",0)(1,"div",1),p(2,"app-breadcrumb",2),m(),b(3,Bn,5,13),r(4,"div")(5,"button",3),S("click",function(){return n.nextPage()}),r(6,"div",4)(7,"span"),f(8),d(9,"translate"),d(10,"translate"),m()()()()()),t&2&&(o(2),c("breadcrumbs",n.breadcrumbs)("issueCategory",n.IssueCategory.BankAccount),o(),x(n.isPageLoading?-1:3),o(5),H(n.redirectUrl?u(9,4,"common.dialog.back-to-previous-page"):u(10,6,"common.form.action.next")))},dependencies:[ct,ce,re,W,j,q,Fe,z,Tt,kt,Ft,It,ke,yt],encapsulation:2,data:{animation:[ue]}})}}return i})();export{Cr as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.