1import {m}from'./chunk-BzzY-3dv.js';import {y as ye$1}from'./chunk-i6vbnLwL.js';import {G}from'./chunk-CWBrHG4i.js';import {f,U}from'./chunk-Ck4AodjT.js';import {N as Ne,c,h}from'./chunk-SDcs1xql.js';import'./chunk-DROiOONM.js';import {x as my,O as Oc,b3 as ii,bi as dn$1,bj as Cu,bh as _e,bb as xu,d3 as r8,f8 as F8,bf as BO,bl as Ga,bk as g6,dG as vO,fR as BI,bx as Ro,bz as Nf,bA as Rf,bB as X9,e2 as Ls,e1 as JI,d5 as No,bG as sB,dm as t8,ak as aa,bn as ne,bm as br,bH as PO,t as de,X,L as Do,P as qT,br as Te$1,a3 as Ms,ad as c_,a5 as rd,a4 as ky,c2 as qy,a6 as mC,aa as mb,ab as gC,dn as XN,dp as JN,cj as H,ci as CI,w as we,V as V$1,d as E$1,E as E$2,cF as eR,cH as co,cI as Ch,cM as j,cN as u,cY as uo,cZ as Nl,cX as X3,c_ as fu,d1 as on$1,d2 as sI,eu as f8,bM as Ys,i_ as fO,fc as Eu,bT as hi,bU as ig,bu as mn$1,a2 as ye,aM as N_,d6 as tT,a8 as Ry,bv as R_,d7 as nT,da as lo,b6 as K,aQ as J,c$ as Pa,d0 as gu,cq as Ws,cr as W8,cs as G8,bK as p,ba as cv,cJ as fh,d_ as ea,d4 as vI,bY as IC,dR as vC,bw as m_,bZ as EC,b_,T as dn$2,bN as Qs,dN as wn,bW as a,b$ as T_,aN as cd,bp as f6,bq as m6,bs as p6,bt as iN,e as ep,d8 as S,aY as xD,aL as RC,dz as E$3,c3 as HC,c1 as CC,c6 as yh,c7 as vh,cC as lv,aO as k_,i$ as dv,c0 as wy,be as na,$ as $N,J as da,v as vM,p as pi$1,h as he,de as w,W,N as N$1,b as $n,c as le,dC as q,dD as G$1,dV as vc,bJ as VO,aS as V$2,dX as lg,dA as J$1,dW as os,f7 as uv}from'./chunk-hxK0xzc4.js';import {E,N}from'./main-UKM7BIED.js';na();$N();da();var li="./media/info-LA3PYU72.svg";vM();$N();var I=N(ep());pi$1();vM();$N();he();da();var A=class t{constructor(i,e,n,c){this.dialog=i;this.translate=e;this.activatedRoute=n;this.router=c;this.isConfirmCancel=new ne;this.issuer=new br(null);this.cid1=new br("");this.cid2=new br("");this.account=new br(null);this.paymentRules=new br(1);this.amount=new br("");this.currency=new br(null);this.isSuccessful=new br(null);this.currencies=[{id:"FI",name:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PREFERRED_LANGUAGE.FINNISH")},{id:"SV",name:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PREFERRED_LANGUAGE.SWEDISH")},{id:"EN",name:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PREFERRED_LANGUAGE.ENGLISH")}];}confirmCancel(i,e){return this.filledData()?(this.ref=this.dialog.open(PO,{data:{content:this.translate.instant(e?"PAGE.FINVOICE.AGREEMENT.EDIT.MODAL.CONTENT":"PAGE.FINVOICE.AGREEMENT.MODAL.CONTENT"),title:this.translate.instant(e?"PAGE.FINVOICE.AGREEMENT.EDIT.MODAL.TITLE":"PAGE.FINVOICE.AGREEMENT.MODAL.TITLE"),cancelButtonText:this.translate.instant(e?"PAGE.FINVOICE.AGREEMENT.EDIT.MODAL.NO":"PAGE.FINVOICE.AGREEMENT.MODAL.NO"),actionButtonText:this.translate.instant(e?"PAGE.FINVOICE.AGREEMENT.EDIT.MODAL.YES":"PAGE.FINVOICE.AGREEMENT.MODAL.YES"),action:()=>this.onAction(i),cancel:()=>this.onCancel()}}),this.ref?.onEscapeKey$?.subscribe(()=>this.ref.close()),this.isConfirmCancel.asObservable()):this.onAction(i)}nextStep(i,e){let n={};return e||(n=E({},this.activatedRoute.snapshot.queryParams)),this.router.navigate(i,{relativeTo:this.activatedRoute,queryParams:n})}resetData(){this.issuer.next(null),this.cid1.next(""),this.cid2.next(""),this.account.next(null),this.paymentRules.next(1),this.amount.next(null),this.currency.next(null),this.isSuccessful.next(null);}mapParams(i){let e={type:"finvoice",finvoiceAgreement:{type:"SenderInfo",paymentInstruction:this.issuer&&this.issuer.getValue()?this.issuer.getValue().finvoiceAgreement.paymentInstruction:void 0,payment:{proposedInvoicePeriod:4,proposedDueDate:1,account:{number:this.account&&this.account.getValue()?this.account.getValue().iban:void 0},approval:{rule:this.paymentRules&&this.paymentRules.getValue()?this.getApprovalRuleByNumber(this.paymentRules.getValue()):void 0,limit:this.amount&&this.amount.getValue()?this.amount.getValue():"0"}},creditor:this.issuer&&this.issuer.getValue()?this.issuer.getValue().finvoiceAgreement.creditor:void 0,invoiceLanguageCode:this.currency&&this.currency.getValue()?this.currency.getValue().id:void 0}};return this.issuer&&this.issuer.getValue()&&(this.issuer.getValue().finvoiceAgreement.cid1&&this.cid1&&this.cid1.getValue()&&(e.finvoiceAgreement.cid1={type:this.issuer.getValue().finvoiceAgreement.cid1.type,value:this.cid1.getValue()}),this.issuer.getValue().finvoiceAgreement.cid2&&this.cid2&&this.cid2.getValue()&&(e.finvoiceAgreement.cid2={type:this.issuer.getValue().finvoiceAgreement.cid2.type,value:this.cid2.getValue()}),i==="create"?e.finvoiceAgreement.issuerId=this.issuer.getValue().id:i==="update"&&(e.id=this.issuer.getValue().id,e.finvoiceAgreement.creditor={businessId:this.issuer.getValue().finvoiceAgreement.creditor.businessId},e.finvoiceAgreement.invoiceSenderAddress=this.issuer.getValue().finvoiceAgreement.invoiceSenderAddress)),e}mapFinvoiceAgreement(i){return {id:i.id,type:i.type,finvoiceAgreement:{creditor:{name:(0, I.get)(i,"finvoiceIssuer.name"),officialName:(0, I.get)(i,"finvoiceIssuer.officialName"),businessId:(0, I.get)(i,"finvoiceIssuer.businessId"),address:{streetName:(0, I.get)(i,"finvoiceIssuer.address.streetName"),postCode:(0, I.get)(i,"finvoiceIssuer.address.postCode"),postOfficeBoxIdentifier:(0, I.get)(i,"finvoiceIssuer.address.postOfficeBoxIdentifier"),townName:(0, I.get)(i,"finvoiceIssuer.address.townName"),countryCode:(0, I.get)(i,"finvoiceIssuer.address.countryCode"),countryName:(0, I.get)(i,"finvoiceIssuer.address.countryName")},account:{number:(0, I.get)(i,"finvoiceIssuer.account.number"),format:(0, I.get)(i,"finvoiceIssuer.account.format")}},paymentInstruction:(0, I.get)(i,"finvoiceIssuer.paymentInstruction"),instruction:(0, I.get)(i,"finvoiceIssuer.instruction"),cid1:{label:(0, I.get)(i,"finvoiceIssuer.cid1.label"),type:(0, I.get)(i,"finvoiceIssuer.cid1.type")},cid2:{label:(0, I.get)(i,"finvoiceIssuer.cid2.label"),type:(0, I.get)(i,"finvoiceIssuer.cid2.type")}}}}getApprovalRuleByValue(i){switch(i){case "APPROVE_NONE":return 1;case "APPROVE_ALL":return 2;case "APPROVE_BELOW_LIMIT":return 3;default:return 1}}getApprovalRuleByNumber(i){switch(i){case 1:return "APPROVE_NONE";case 2:return "APPROVE_ALL";case 3:return "APPROVE_BELOW_LIMIT";default:return "APPROVE_NONE"}}filledData(){return !!(this.issuer.getValue()||this.cid1.getValue()||this.cid2.getValue()||this.account.getValue()||this.amount.getValue()||this.currency.getValue())}onCancel(){this.ref&&this.ref.close(),this.isConfirmCancel.next(false);}onAction(i){return this.ref&&this.ref.close(),i?(this.resetData(),this.nextStep(["page","einvoice","agreement"],true)):this.isConfirmCancel.next(true),true}static{this.\u0275fac=function(e){return new(e||t)(de(VO),de(V$1),de(K),de(V$2))};}static{this.\u0275prov=X({token:t,factory:t.\u0275fac,providedIn:"root"});}};w();vM();var Ie=class t extends S{constructor(){super(...arguments);this.configName="FInvoiceAgreementConfigService";
1this.defaults={displayInformationImage:false,providerDescription:null,eInvoiceOrderHideInformationPage:false};}displayInformationImage(e){this.setConfig("displayInformationImage",true,e);}providerDescription(e,n){this.setConfig("providerDescription",e,n);}eInvoiceOrderHideInformationPage(e){this.setConfig("eInvoiceOrderHideInformationPage",true,e);}static{this.\u0275fac=(()=>{let e;return function(c){return (e||(e=xD(t)))(c||t)}})();}static{this.\u0275prov=X({token:t,factory:t.\u0275fac,providedIn:"root"});}};he();$N();function yi(t,i){if(t&1&&(Ms(0,"div",8),ky(1,"img",9),rd()),t&2){let e=RC();mb(),Ry("src",e.imagesFinvoiceagreementInfo,lg);}}var at=class t{constructor(i,e){this.service=i;this.finvoiceAgreementConfig=e;this.imagesFinvoiceagreementInfo=li;}ngOnInit(){this.finvoiceAgreementConfig.config.eInvoiceOrderHideInformationPage&&this.nextStep();}nextStep(){this.service.nextStep(["page","einvoice","agreement","step1"]);}static{this.\u0275fac=function(e){return new(e||t)(Do(A),Do(Ie))};}static{this.\u0275cmp=qT({type:t,selectors:[["ng-component"]],standalone:false,decls:19,vars:1,consts:[[1,"information-page-section"],[1,"information-page-text-wrap"],[1,"information-page-description"],["translate",""],["translate","",1,"ebank-title-h2"],[1,"information-page-ocs-container"],["location","e-invoice-order-process-information"],[1,"information-page-submit",3,"buttonClick"],[1,"information-page-image-wrap"],["role","presentation",3,"src"]],template:function(e,n){e&1&&(Ms(0,"section",0)(1,"div",1)(2,"div",2)(3,"div",3),c_(4,"PAGE.FINVOICE.AGREEMENT.INFORMATION_PAGE.DESCRIPTION"),rd(),Ms(5,"div")(6,"h2",4),c_(7,"PAGE.FINVOICE.AGREEMENT.INFORMATION_PAGE.DESCRIPTION.H2"),rd(),Ms(8,"ul")(9,"li",3),c_(10,"PAGE.FINVOICE.AGREEMENT.INFORMATION_PAGE.DESCRIPTION.LI_1"),rd(),Ms(11,"li",3),c_(12,"PAGE.FINVOICE.AGREEMENT.INFORMATION_PAGE.DESCRIPTION.LI_2"),rd()()()(),Ms(13,"div",5),ky(14,"cms-for-location",6),rd(),Ms(15,"ebank-button",7),qy("buttonClick",function(){return n.nextStep()}),Ms(16,"span",3),c_(17,"PAGE.FINVOICE.AGREEMENT.INFORMATION_PAGE.ACTION"),rd()()(),mC(18,yi,2,1,"div",8),rd()),e&2&&(mb(18),gC(n.finvoiceAgreementConfig?.config.displayInformationImage?18:-1));},dependencies:[Te$1,Ne,_e],encapsulation:2,changeDetection:1});}};na();var V=N(ep());pi$1();vM();he();da();W();N$1();na();$N();$n();var Ri=()=>["name"],Ti=t=>({currency:t});function Mi(t,i){if(t&1&&(Ms(0,"ebank-radio-button",9),c_(1),rd()),t&2){let e=i.$implicit;Ry("id","paymentRules"+e.value)("value",e.value),mb(),cv(e.label);}}function xi(t,i){if(t&1&&(Ms(0,"ebank-form-field",10)(1,"ebank-label",15),c_(2,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.AMOUNT"),rd(),ky(3,"ebank-amount-field",16,0),tT(),Ms(5,"ebank-form-error-wrapper")(6,"ebank-form-error",17),c_(7),rd(),Ms(8,"ebank-form-error",18),c_(9),rd()()()),t&2){let e=HC(4),n=RC();mb(),Ry("translateParams",T_(6,Ti,n.form.get("account").value?.properties?.currencyCode||"")),mb(2),Ry("disabledDecimal",true),nT(),mb(3),Ry("control",e),mb(),cv(n.errorMessage.amount.required),mb(),Ry("control",e),mb(),cv(n.errorMessage.amount.pattern);}}var pi=/^\d+\.\d+$/,Re=class t{constructor(i,e,n,c,C,dt,At){this.service=i;this.translate=e;this.dataAccounts=n;this.dataAgreements=c;this.activatedRoute=C;this.log=dt;this.alert=At;this.accounts=[];this.form=new XN({account:new JN(this.service.account.getValue(),[lo.required]),currency:new JN(this.service.currency.getValue(),[lo.required]),paymentRules:new JN(this.service.paymentRules.getValue())});this.errorMessage={amount:{required:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.AMOUNT.VALIDATION.REQUIRED"),pattern:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.AMOUNT.VALIDATION.PATTERN")}};this.labelMap={label:"name"};this.paymentRules=[{label:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PAYMENT_RULES.CHECKBOX_1"),value:1},{label:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PAYMENT_RULES.CHECKBOX_2"),value:2},{label:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PAYMENT_RULES.CHECKBOX_3"),value:3}];this.subscription=new H;this.loadingAccounts=new br(false);this.loadingAgreements=new br(false);this.loadingAction=new br(false);}ngOnInit(){this.loading=CI(this.loadingAccounts,this.loadingAction).pipe(we(i=>i.includes(true))),this.currencies=this.service.currencies,this.subscription.add(this.form.get("paymentRules").valueChanges.subscribe(i=>{if(i===3&&!this.form.get("amount")){let e=(0, V.get)(this.issuer,"finvoiceAgreement.payment.approval.limit")?""+(0, V.get)(this.issuer,"finvoiceAgreement.payment.approval.limit"):"";this.form.addControl("amount",new JN(e,[lo.required,lo.pattern(pi)]));}else this.form.get("amount")&&this.form.removeControl("amount");})),this.subscription.add(this.form.valueChanges.subscribe(i=>{i.account&&this.service.account.next(i.account),i.paymentRules&&this.service.paymentRules.next(i.paymentRules),i.amount&&this.service.amount.next(i.amount),i.currency&&this.service.currency.next(i.currency);})),this.subscription.add(CI(this.dataAccounts.get(null,this.loadingAccounts),this.activatedRoute.queryParamMap.pipe(we(i=>i.get("agreement")))).subscribe(([i,e])=>{this.accounts=i.filter(n=>n.rights&&n.rights.paymentFrom&&n.rights.accessPermission),e?this.subscription.add(this.dataAgreements.get({id:e},this.loadingAgreements).subscribe(n=>{this.isEditMode=true,this.issuer=n,this.service.issuer.next(this.issuer),(0, V.get)(this.issuer,"finvoiceAgreement.payment.account.number")&&this.form.get("account").setValue(this.accounts.find(c=>c.iban===this.issuer.finvoiceAgreement.payment.account.number)||this.accounts[0]),(0, V.get)(this.issuer,"finvoiceAgreement.payment.approval.rule")&&this.form.get("paymentRules").setValue(this.service.getApprovalRuleByValue(this.issuer.finvoiceAgreement.payment.approval.rule)),(0, V.get)(this.issuer,"finvoiceAgreement.invoiceLanguageCode")&&this.form.get("currency").setValue(this.currencies.find(c=>c.id===this.issuer.finvoiceAgreement.invoiceLanguageCode)||this.currencies[0]),(0, V.get)(this.issuer,"finvoiceAgreement.cid1.value")&&this.service.cid1.next((0, V.get)(this.issuer,"finvoiceAgreement.cid1.value")),(0, V.get)(this.issuer,"finvoiceAgreement.cid2.value")&&this.service.cid2.next((0, V.get)(this.issuer,"finvoiceAgreement.cid2.value"));},n=>{this.log.error("something wrong happened while fetching agreement",n),this.alert.serverError(n,"PAGE.FINVOICE.AGREEMENT.ERROR.LOAD_AGREEMENT");})):!this.service.issuer.getValue()||!this.service.cid1.getValue()?(this.service.resetData(),this.service.nextStep(["page","einvoice","agreement"],true)):(setTimeout(()=>{this.form.get("account").setValue(this.accounts.find(n=>this.service.account.getValue()?this.service.account.getValue().iban===n.iban:n.isPrimary())||this.accounts[0]);}),this.service.paymentRules.getValue()===3&&this.service.amount.getValue()&&!this.form.get("amount")&&this.form.addControl("amount",new JN(this.service.amount.getValue(),[lo.required,lo.pattern(pi)])));},i=>{this.log.error("something wrong happened while fetching accounts",i),this.alert.serverError(i,"PAGE.FINVOICE.AGREEMENT.ERROR.LOAD_ACCOUNTS");}));}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe();}nextStep(){this.form.valid&&(this.isEditMode?(this.loadingAction.next(true),this.dataAgreements.update(this.service.mapParams("update")).then(()=>{this.alert.success("PAGE.FINVOICE.AGREEMENT.EDIT.SUCCESSFULL"),this.service.resetData(),this.service.nextStep(["page","einvoice","agreement","details"],false);},i=>{this.log.error("something wrong happened while updating agreement",i),this.alert.error("PAGE.FINVOICE.AGREEMENT.EDIT.ER
1ROR");}).finally(()=>{this.loadingAction.next(false);})):this.service.nextStep(["page","einvoice","agreement","step4"]));}static{this.\u0275fac=function(e){return new(e||t)(Do(A),Do(V$1),Do(G),Do(m),Do(K),Do(E$1),Do(E$2))};}static{this.\u0275cmp=qT({type:t,selectors:[["ng-component"]],standalone:false,decls:30,vars:37,consts:[["amount","ebankControl"],[1,"finvoice-agreement-spinner",3,"loading"],[3,"cancelButtonClick","backButtonClick","title","showBackButton"],[1,"payment-settings-page-section"],[3,"ngSubmit","formGroup"],["translate","",1,"ebank-title-h1"],["translate","",1,"payment-settings-page-description"],["id","accountSelector","name","accountSelector","formControlName","account",1,"account-asset-selector",3,"isLoading","label","allowEmpty","required","assets"],["formControlName","paymentRules",3,"legend"],[3,"id","value"],[1,"payment-settings-page-amount-wrap"],["translate",""],["id","currencySelector","formControlName","currency",3,"isLoading","options","searchAttributes","titleOnMobile"],["selectTemplate","single",3,"labelMap"],["type","submit",1,"payment-settings-page-submit"],["translate","",3,"translateParams"],["id","amount","formControlName","amount","maxlength","10",3,"disabledDecimal"],["validation","required",3,"control"],["validation","pattern",3,"control"]],template:function(e,n){e&1&&(Ms(0,"ebank-spinner",1),N_(1,"async"),Ms(2,"ebank-multi-step-header",2),N_(3,"translate"),N_(4,"translate"),qy("cancelButtonClick",function(){return n.service.confirmCancel(true,n.isEditMode)})("backButtonClick",function(){return n.service.nextStep(["page","einvoice","agreement","step2"])}),rd(),Ms(5,"section",3)(6,"form",4),qy("ngSubmit",function(){return n.nextStep()}),Ms(7,"h1",5),c_(8,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.HEADING"),rd(),Ms(9,"div",6),c_(10,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.DESCRIPTION"),rd(),ky(11,"account-asset-selector",7),N_(12,"async"),N_(13,"translate"),tT(),Ms(14,"ebank-radio-button-group",8),N_(15,"translate"),IC(16,Mi,2,3,"ebank-radio-button",9,vC),rd(),tT(),mC(18,xi,10,8,"ebank-form-field",10),Ms(19,"ebank-form-field")(20,"ebank-label",11),c_(21,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PREFERRED_LANGUAGE"),rd(),Ms(22,"ebank-simple-selector",12),N_(23,"async"),N_(24,"translate"),ky(25,"ebank-option-template",13),rd(),tT(),rd(),Ms(26,"ebank-button",14)(27,"span"),c_(28),N_(29,"translate"),rd()()()()()),e&2&&(Ry("loading",R_(1,18,n.loading)),mb(2),Ry("title",n.isEditMode?R_(3,20,"PAGE.FINVOICE.AGREEMENT.MULTI_STEP_HEADER.DETAILS.TITLE"):R_(4,22,"PAGE.FINVOICE.AGREEMENT.MULTI_STEP_HEADER.TITLE"))("showBackButton",!n.isEditMode),mb(4),Ry("formGroup",n.form),mb(5),Ry("isLoading",R_(12,24,n.loading))("label",R_(13,26,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.FROM_ACCOUNT"))("allowEmpty",true)("required",true)("assets",n.accounts),nT(),mb(3),Ry("legend",m_(R_(15,28,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PAYMENT_RULES"))),nT(),mb(2),EC(n.paymentRules),mb(2),gC(n.form.get("paymentRules").value===3&&n.form.get("amount")?18:-1),mb(4),Ry("isLoading",R_(23,30,n.loading))("options",n.currencies)("searchAttributes",b_(36,Ri))("titleOnMobile",R_(24,32,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PREFERRED_LANGUAGE")),nT(),mb(3),Ry("labelMap",n.labelMap),mb(3),cv(R_(29,34,n.isEditMode?"PAGE.FINVOICE.AGREEMENT.EDIT.SAVE_CHANGES":"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.ACTION")));},dependencies:[eR,co,Ch,fh,ea,j,u,Te$1,ye$1,uo,Nl,X3,fu,Pa,gu,on$1,sI,_e,Ys,vI,fO,BI,Ls,JI,No,mn$1,ye],encapsulation:2,changeDetection:1});}};pi$1();na();var Te=N(ep());vM();he();da();le();W();N$1();na();$N();$n();function Di(t,i){if(t&1&&(Ms(0,"div",7),c_(1),rd()),t&2){let e=RC();mb(),cv(e.description);}}function Gi(t,i){if(t&1&&(Ms(0,"div",10)(1,"dt",11),c_(2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.OFFICIAL_NAME"),rd(),Ms(3,"dd",12)(4,"span",13),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.creditor?.officialName);}}function ki(t,i){if(t&1&&(Ms(0,"div",10)(1,"dt",11),c_(2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.ADDRESS"),rd(),Ms(3,"dd",12)(4,"span",14),c_(5),rd()()()),t&2){let e=RC(2);mb(5),dv(" ",e.issuer.finvoiceAgreement.creditor?.address.streetName," ",e.issuer.finvoiceAgreement.creditor?.address.townName," ",e.issuer.finvoiceAgreement.creditor?.address.postCode," ",e.issuer.finvoiceAgreement.creditor?.address.postOfficeBoxIdentifier," ",e.issuer.finvoiceAgreement.creditor?.address.countryName," ",e.issuer.finvoiceAgreement.creditor?.address.countryCode," ");}}function Fi(t,i){if(t&1&&(Ms(0,"div",10)(1,"dt",11),c_(2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.BUSINESS_ID"),rd(),Ms(3,"dd",12)(4,"span",15),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.creditor?.businessId);}}function Vi(t,i){if(t&1&&(Ms(0,"div",10)(1,"dt",11),c_(2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.THE_AGREEMENT_CONCERNS"),rd(),Ms(3,"dd",12)(4,"span",16),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.paymentInstruction);}}function Li(t,i){if(t&1&&(Ms(0,"div",10)(1,"dt",11),c_(2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.ACCOUNT_NUMBER"),rd(),Ms(3,"dd",12)(4,"span",17),c_(5),N_(6,"accountNumberFormat"),rd()()()),t&2){let e=RC(2);mb(5),cv(R_(6,1,e.issuer.finvoiceAgreement.creditor==null?null:e.issuer.finvoiceAgreement.creditor.account.number));}}function Bi(t,i){if(t&1&&(Ms(0,"div",10)(1,"dt",11),c_(2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.ADDITIONAL_INFORMATION"),rd(),Ms(3,"dd",12)(4,"span",18),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.instruction);}}function ji(t,i){if(t&1&&(Ms(0,"ebank-description-list",8),mC(1,Gi,6,1,"div",10),mC(2,ki,6,6,"div",10),mC(3,Fi,6,1,"div",10),mC(4,Vi,6,1,"div",10),mC(5,Li,7,3,"div",10),mC(6,Bi,6,1,"div",10),rd()),t&2){let e=RC();mb(),gC(e.issuer.finvoiceAgreement.creditor?.officialName?1:-1),mb(),gC(e.issuer.finvoiceAgreement.creditor?.address?2:-1),mb(),gC(e.issuer.finvoiceAgreement.creditor?.businessId?3:-1),mb(),gC(e.issuer.finvoiceAgreement.paymentInstruction?4:-1),mb(),gC(e.issuer.finvoiceAgreement.creditor?.account?.number?5:-1),mb(),gC(e.issuer.finvoiceAgreement.instruction?6:-1);}}function wi(t,i){if(t&1&&(Ms(0,"ebank-form-field")(1,"ebank-label"),c_(2),N_(3,"translate"),rd(),ky(4,"ebank-input-field",22,0),tT(),Ms(6,"ebank-form-error-wrapper")(7,"ebank-form-error",23),c_(8),rd()()()),t&2){let e=HC(5),n=RC(2);mb(2),cv(n.issuer.finvoiceAgreement.cid1.label||R_(3,3,"PAGE.FINVOICE.AGREEMENT.PROVIDER.CID1.LABEL")),mb(2),nT(),mb(3),Ry("control",e),mb(),cd(" ",n.errorMessage.cid1.required," ");}}function Ui(t,i){if(t&1&&(Ms(0,"ebank-form-field")(1,"ebank-label"),c_(2),N_(3,"translate"),rd(),ky(4,"ebank-input-field",24,1),tT(),Ms(6,"ebank-form-error-wrapper")(7,"ebank-form-error",23),c_(8),rd()()()),t&2){let e=HC(5),n=RC(2);mb(2),cv(n.issuer.finvoiceAgreement.cid2.label||R_(3,3,"PAGE.FINVOICE.AGREEMENT.PROVIDER.CID2.LABEL")),mb(2),nT(),mb(3),Ry("control",e),mb(),cd(" ",n.errorMessage.cid2.required," ");}}function Yi(t,i){if(t&1&&(Ms(0,"div")(1,"h2",19),c_(2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.IDENTIFICATION_REFERENCE"),rd(),Ms(3,"div",20),c_(4,"PAGE.FINVOICE.AGREEMENT.PROVIDER.REFERENCES_INFO"),rd(),Ms(5,"div",21),mC(6,wi,9,5,"ebank-form-field"),mC(7,Ui,9,5,"ebank-form-field"),rd()()),t&2){let e=RC();mb(6),gC(e.issuer.finvoiceAgreement.cid1?6:-1),mb(),gC(e.issuer.finvoiceAgreement.cid2?7:-1);}}
1var Me=class t{constructor(i,e,n,c,C,dt,At,Ci){this.service=i;this.translate=e;this.dataAgreements=n;this.activatedRoute=c;this.localeService=C;this.finvoiceAgreementConfig=dt;this.log=At;this.alert=Ci;this.form=new XN({});this.errorMessage={cid1:{required:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PROVIDER.CID1.VALIDATION.REQUIRED")},cid2:{required:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PROVIDER.CID2.VALIDATION.REQUIRED")}};this.subscription=new H;this.loadingIssuers=new br(false);this.loadingAgreements=new br(false);this.loadingAction=new br(false);}ngOnInit(){this.loading=CI(this.loadingIssuers,this.loadingAgreements,this.loadingAction).pipe(we(i=>i.includes(true))),this.finvoiceAgreementConfig.config.providerDescription&&(this.description=this.finvoiceAgreementConfig.config.providerDescription[this.localeService.getLanguage()]),this.subscription.add(this.form.valueChanges.subscribe(i=>{i.cid1&&this.service.cid1.next(i.cid1),i.cid2&&this.service.cid2.next(i.cid2);})),this.subscription.add(this.activatedRoute.queryParamMap.pipe(we(i=>i.get("agreement"))).subscribe(i=>{i?this.subscription.add(this.dataAgreements.get({id:i},this.loadingAgreements).subscribe(e=>{this.isEditMode=true,this.issuer=e,this.service.issuer.next(this.issuer),this.issuer&&(this.issuer.finvoiceAgreement.cid1&&this.form.addControl("cid1",new JN(this.issuer.finvoiceAgreement.cid1.value,[lo.required])),this.issuer.finvoiceAgreement.cid2&&this.form.addControl("cid2",new JN(this.issuer.finvoiceAgreement.cid2.value,[lo.required])),(0, Te.get)(this.issuer,"finvoiceAgreement.payment.approval.rule")&&this.service.paymentRules.next(this.service.getApprovalRuleByValue(this.issuer.finvoiceAgreement.payment.approval.rule)),(0, Te.get)(this.issuer,"finvoiceAgreement.payment.approval.limit")&&this.service.amount.next(""+(0, Te.get)(this.issuer,"finvoiceAgreement.payment.approval.limit")),(0, Te.get)(this.issuer,"finvoiceAgreement.invoiceLanguageCode")&&this.service.currency.next(this.service.currencies.find(n=>n.id===this.issuer.finvoiceAgreement.invoiceLanguageCode)));},e=>{this.log.error("something wrong happened while fetching agreement",e),this.alert.serverError(e,"PAGE.FINVOICE.AGREEMENT.ERROR.LOAD_AGREEMENT");})):(this.issuer=this.service.issuer.getValue(),this.issuer?(this.issuer.finvoiceAgreement.cid1&&this.form.addControl("cid1",new JN(this.service.cid1.getValue(),[lo.required])),this.issuer.finvoiceAgreement.cid2&&this.form.addControl("cid2",new JN(this.service.cid2.getValue(),[lo.required]))):(this.service.resetData(),this.service.nextStep(["page","einvoice","agreement"])));}));}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe();}nextStep(){this.form.valid&&(this.isEditMode?(this.loadingAction.next(true),this.dataAgreements.update(this.service.mapParams("update")).then(()=>{this.alert.success("PAGE.FINVOICE.AGREEMENT.EDIT.SUCCESSFULL"),this.service.resetData(),this.service.nextStep(["page","einvoice","agreement","details"],false);},i=>{this.log.error("something wrong happened while updating agreement",i),this.alert.error("PAGE.FINVOICE.AGREEMENT.EDIT.ERROR");}).finally(()=>{this.loadingAction.next(false);})):this.service.nextStep(["page","einvoice","agreement","step3"]));}static{this.\u0275fac=function(e){return new(e||t)(Do(A),Do(V$1),Do(m),Do(K),Do(J),Do(Ie),Do(E$1),Do(E$2))};}
1static{this.\u0275cmp=qT({type:t,selectors:[["ng-component"]],standalone:false,decls:16,vars:17,consts:[["cid1","ebankControl"],["cid2","ebankControl"],[1,"finvoice-agreement-spinner",3,"loading"],[3,"cancelButtonClick","backButtonClick","title","showBackButton"],[1,"provider-page-section"],[3,"ngSubmit","formGroup"],[1,"ebank-title-h1"],[1,"provider-page-description"],["groupHeadingId","providerTitle",1,"provider-page-list"],["type","submit",1,"provider-page-submit"],["ebankDescriptionListItem",""],["ebankDescriptionListTerm","","translate",""],["ebankDescriptionListDesc",""],["id","officialName",1,"value-pair"],["id","address",1,"value-pair"],["id","businessId",1,"value-pair"],["id","paymentInstruction",1,"value-pair"],["id","accountNumber",1,"value-pair"],["id","instruction",1,"value-pair"],["translate","",1,"ebank-title-h2"],["translate","",1,"provider-page-reference-info"],[1,"provider-page-form-fields"],["id","cid1","formControlName","cid1"],["validation","required",3,"control"],["id","cid2","formControlName","cid2"]],template:function(e,n){e&1&&(Ms(0,"ebank-spinner",2),N_(1,"async"),Ms(2,"ebank-multi-step-header",3),N_(3,"translate"),N_(4,"translate"),qy("cancelButtonClick",function(){return n.service.confirmCancel(true,n.isEditMode)})("backButtonClick",function(){return n.service.nextStep(["page","einvoice","agreement","step1"])}),rd(),Ms(5,"section",4)(6,"form",5),qy("ngSubmit",function(){return n.nextStep()}),Ms(7,"h1",6),c_(8),rd(),mC(9,Di,2,1,"div",7),mC(10,ji,7,6,"ebank-description-list",8),mC(11,Yi,8,2,"div"),Ms(12,"ebank-button",9)(13,"span"),c_(14),N_(15,"translate"),rd()()()()()),e&2&&(Ry("loading",R_(1,9,n.loading)),mb(2),Ry("title",n.isEditMode?R_(3,11,"PAGE.FINVOICE.AGREEMENT.MULTI_STEP_HEADER.DETAILS.TITLE"):R_(4,13,"PAGE.FINVOICE.AGREEMENT.MULTI_STEP_HEADER.TITLE"))("showBackButton",!n.isEditMode),mb(4),Ry("formGroup",n.form),mb(2),cv(n.issuer?.finvoiceAgreement?.creditor?.officialName),mb(),gC(n.description?9:-1),mb(),gC(n.issuer?.finvoiceAgreement?10:-1),mb(),gC(n.issuer?.finvoiceAgreement?.cid1||n.issuer?.finvoiceAgreement?.cid2?11:-1),mb(3),cv(R_(15,15,n.isEditMode?"PAGE.FINVOICE.AGREEMENT.EDIT.SAVE_CHANGES":"PAGE.FINVOICE.AGREEMENT.PROVIDER.ACTION")));},dependencies:[eR,co,Ch,j,u,Te$1,uo,Nl,X3,fu,Pa,gu,on$1,sI,_e,Ys,fO,vO,Ws,W8,G8,t8,mn$1,ye,p],encapsulation:2,changeDetection:1});}};vM();U();he();$N();var Hi=t=>({providerName:t});function qi(t,i){if(t&1&&(Ms(0,"ebank-page-alert",1)(1,"ebank-page-alert-header",2),c_(2," PAGE.FINVOICE.AGREEMENT.RECEIPT.HEADING "),rd(),Ms(3,"ebank-page-alert-content")(4,"ebank-page-alert-text",5),c_(5," PAGE.FINVOICE.AGREEMENT.RECEIPT.DESCRIPTION_1 "),rd()()()),t&2){let e=RC();mb(4),Ry("translateParams",T_(1,Hi,e.issuer==null||e.issuer.finvoiceAgreement==null||e.issuer.finvoiceAgreement.creditor==null?null:e.issuer.finvoiceAgreement.creditor.name));}}function Zi(t,i){t&1&&(Ms(0,"ebank-page-alert",4)(1,"ebank-page-alert-header",2),c_(2," PAGE.FINVOICE.AGREEMENT.RECEIPT.ERROR.HEADING_1 "),rd(),Ms(3,"ebank-page-alert-content")(4,"ebank-page-alert-text",2),c_(5," PAGE.FINVOICE.AGREEMENT.RECEIPT.ERROR.DESCRIPTION_1 "),rd()()());}var ot=class t{constructor(i,e){this.service=i;this.sbLinkService=e;this.isSuccessful=false;}ngOnInit(){[true,false].includes(this.service.isSuccessful.getValue())&&this.service.issuer.getValue()?(this.isSuccessful=this.service.isSuccessful.getValue(),this.issuer=this.service.issuer.getValue(),this.service.resetData()):this.service.nextStep(["page","einvoice","agreement"],true);}getEInvoiceOrdersUrl(){return this.sbLinkService.getUrl("URL.PAGE.AGREEMENTS.AGREEMENTS_LIST",null).url}static{this.\u0275fac=function(e){return new(e||t)(Do(A),Do(f))};}
1static{this.\u0275cmp=qT({type:t,selectors:[["ng-component"]],standalone:false,decls:9,vars:3,consts:[[1,"receipt-page-section"],["level","success"],["translate",""],[1,"ebank-text-link",3,"href"],["level","error"],["translate","",3,"translateParams"]],template:function(e,n){e&1&&(Ms(0,"section",0),mC(1,qi,6,3,"ebank-page-alert",1),Ms(2,"ebank-lead-block")(3,"p",2),c_(4," PAGE.FINVOICE.AGREEMENT.RECEIPT.DESCRIPTION_2 "),Ms(5,"a",3)(6,"span",2),c_(7,"PAGE.FINVOICE.AGREEMENT.RECEIPT.LINK.E_INVOICE_ORDERS"),rd()()()(),mC(8,Zi,6,0,"ebank-page-alert",4),rd()),e&2&&(mb(),gC(n.isSuccessful?1:-1),mb(4),Ry("href",n.getEInvoiceOrdersUrl(),lg),mb(3),gC(n.isSuccessful?-1:8));},dependencies:[Te$1,f6,m6,p6,iN,sB],encapsulation:2,changeDetection:1});}};pi$1();na();vM();q();var It=N(ep());vM();G$1();vc();var st=class t extends E$3{constructor(e,n){super();this.dsObservable=e;this.DS=n;this.dsNames=["issuers"];}fetch(e){return this.DS.findAll("issuers",e)}fromCache(e){let n=this.DS.getAll("issuers");return e&&(e.account?n=this.filterByAccount(n,e):e.name&&(n=this.filterByName(n,e))),n}clearCache(){return this.DS.ejectAll("issuers")}filterByAccount(e,n){return (0, It.filter)(e,c=>{let C;return n.agreementtype==="AVTALEGIRO"?C=c.autoPaymentIssuer.account.number.indexOf(n.account)>=0:n.agreementtype==="EFAKTURA"?C=c.ebillIssuer.account.number.indexOf(n.account)>=0:C=c.autoPaymentIssuer?c.autoPaymentIssuer.account.number.indexOf(n.account)>=0:c.ebillIssuer.account.number.indexOf(n.account)>=0,C})}filterByName(e,n){return (0, It.filter)(e,c=>{let C;return n.agreementtype==="AVTALEGIRO"?C=c.autoPaymentIssuer.name.toUpperCase().indexOf(n.name.toUpperCase())>=0:n.agreementtype==="EFAKTURA"?C=c.ebillIssuer.name.toUpperCase().indexOf(n.name.toUpperCase())>=0:C=c.autoPaymentIssuer?c.autoPaymentIssuer.name.toUpperCase().indexOf(n.name)>=0:c.ebillIssuer.name.toUpperCase().indexOf(n.name)>=0,C})}static{this.\u0275fac=function(n){return new(n||t)(de(J$1),de(os))};}static{this.\u0275prov=X({token:t,factory:t.\u0275fac,providedIn:"root"});}};he();U();W();N$1();na();$N();$n();function Wi(t,i){if(t&1){let e=CC();Ms(0,"ebank-link-panel",16),qy("click",function(){yh(e);let c=RC().$implicit,C=RC(3);return vh(C.selectProvider(c))}),Ms(1,"div",17)(2,"div",18)(3,"div",19),c_(4),rd(),Ms(5,"div",20),c_(6),rd()()()();}if(t&2){let e=RC().$implicit,n=RC(3);Ry("url",n.getProviderLink()),mb(4),cv(e.finvoiceAgreement?.creditor?.name),mb(2),cd(" Account nr. ",e.finvoiceAgreement?.creditor?.account?.number," ");}}function Xi(t,i){t&1&&wy(0,Wi,7,3,"ebank-link-panel",15);}function $i(t,i){if(t&1&&(Ms(0,"ebank-panel-list",12),IC(1,Xi,1,0,"ebank-link-panel",14,vC),rd()),t&2){let e=RC(2);mb(),EC(e.issuers);}}function zi(t,i){t&1&&(Ms(0,"ebank-empty-state",13)(1,"ebank-empty-state-title",5),c_(2,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.NO_MATCHING_RESULTS"),rd(),Ms(3,"ebank-empty-state-description",5),c_(4,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.NO_MATCHING_RESULTS.DESCRIPTION"),rd()());}function Qi(t,i){if(t&1&&(Ms(0,"div",10)(1,"div",11)(2,"span"),c_(3),rd(),c_(4),N_(5,"translate"),rd(),mC(6,$i,3,0,"ebank-panel-list",12),mC(7,zi,5,0,"ebank-empty-state",13),rd()),t&2){let e=RC();mb(3),cv(e.issuers?.length),mb(),cd(" ",R_(5,4,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.RESULTS")," "),mb(2),gC(e.issuers?.length?6:-1),mb(),gC(e.issuers?.length?-1:7);}}var ct=class t{constructor(i,e,n,c,C,dt){this.service=i;this.dataIssuers=e;this.translate=n;this.sbLinkService=c;this.log=C;this.alert=dt;this.form=new XN({provider:new JN("")});this.errorMessage={provider:{required:this.translate.instant("PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.AMOUNT.VALIDATION.REQUIRED")}};this.loadingIssuers=new br(false);this.subscription=new H;}ngOnInit(){this.loading=CI(this.loadingIssuers).pipe(we(i=>i.includes(true)));}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe();}searchProvider(){let i=this.form.get("provider").value?{name:this.form.get("provider").value}:void 0;this.subscription.add(this.dataIssuers.get(i,this.loadingIssuers).subscribe(e=>{this.issuers=e.filter(n=>n.type==="finvoice").map(n=>this.service.mapFinvoiceAgreement(n));},e=>{this.log.error("something wrong happened while fetching issuers",e),this.alert.serverError(e,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.ERROR.LOAD_ISSUERS");}));}selectProvider(i){this.service.resetData(),this.service.issuer.next(i);}getProviderLink(){return this.sbLinkService.getUrl("URL.PAGE.FINVOICE.AGREEMENT.STEP2",null).url}static{this.\u0275fac=function(e){return new(e||t)(Do(A),Do(st),Do(V$1),Do(f),Do(E$1),Do(E$2))};}
1static{this.\u0275cmp=qT({type:t,selectors:[["ng-component"]],standalone:false,decls:21,vars:9,consts:[[3,"cancelButtonClick","backButtonClick","title","showBackButton"],[1,"search-provider-page-section"],[3,"ngSubmit","formGroup"],["translate","",1,"ebank-title-h1"],["translate","",1,"search-provider-page-description"],["translate",""],[1,"search-provider-page-form-fields"],["id","provider","formControlName","provider"],["id","searchBtn","type","submit","buttonStyle","secondary",1,"search-provider-page-submit"],[1,"finvoice-agreement-spinner",3,"loading"],[1,"search-provider-page-items-wrapper"],[1,"search-provider-page-items-count"],["groupHeadingId","heading-id",1,"search-provider-page-list"],["id","eInvoiceProviderEmptyList"],[3,"url"],[3,"url","click",4,"ebankPanelList"],[3,"click","url"],[1,"search-provider-page-list-item"],[1,"first-row"],[1,"issuer-name"],[1,"issuer-account"]],template:function(e,n){e&1&&(Ms(0,"ebank-multi-step-header",0),N_(1,"translate"),qy("cancelButtonClick",function(){return n.service.confirmCancel(true)})("backButtonClick",function(){return n.service.nextStep(["page","einvoice","agreement"])}),rd(),Ms(2,"section",1)(3,"form",2),qy("ngSubmit",function(){return n.searchProvider()}),Ms(4,"h1",3),c_(5,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.HEADING"),rd(),Ms(6,"div",4),c_(7,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.DESCRIPTION"),rd(),Ms(8,"ebank-form-field")(9,"ebank-label",5),c_(10,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.SEARCH_FOR_PROVIDER"),rd(),Ms(11,"ebank-sub-label",5),c_(12,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.SEARCH_FOR_PROVIDER.SUB_LABEL"),rd(),Ms(13,"div",6),ky(14,"ebank-input-field",7),tT(),Ms(15,"ebank-button",8)(16,"span",5),c_(17,"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.SEARCH"),rd()()()(),Ms(18,"ebank-spinner",9),N_(19,"async"),mC(20,Qi,8,6,"div",10),rd()()()),e&2&&(Ry("title",R_(1,5,"PAGE.FINVOICE.AGREEMENT.MULTI_STEP_HEADER.TITLE"))("showBackButton",true),mb(3),Ry("formGroup",n.form),mb(11),nT(),mb(4),Ry("loading",R_(19,7,n.loading)),mb(2),gC(n.issuers?20:-1));},dependencies:[eR,co,Ch,j,u,Te$1,uo,Nl,X3,fu,on$1,sI,f8,_e,Ys,fO,Eu,hi,ig,Nf,Rf,X9,t8,mn$1,ye],encapsulation:2,changeDetection:1});}};vM();U();var L=class t{constructor(i){this.sbLinkService=i;}canDeactivate(i,e,n,c){return c.url.indexOf(this.sbLinkService.getUrl("URL.PAGE.FINVOICE.AGREEMENT",null).url.replace("#",""))!==-1||i.service.confirmCancel()}static{this.\u0275fac=function(e){return new(e||t)(de(f))};}static{this.\u0275prov=X({token:t,factory:t.\u0275fac,providedIn:"root"});}};pi$1();var Ae=N(ep());vM();h();da();U();W();N$1();$n();he();$N();var Ji=t=>({"edit-mode":t}),mt=t=>({"create-mode":t});function en(t,i){if(t&1){let e=CC();Ms(0,"ebank-multi-step-header",12),N_(1,"translate"),qy("cancelButtonClick",function(){yh(e);let c=RC();return vh(c.service.confirmCancel(true,c.isEditMode))})("backButtonClick",function(){yh(e);let c=RC();return vh(c.service.nextStep(["page","einvoice","agreement","step3"]))}),rd();}if(t&2){let e=RC();Ry("title",R_(1,2,"PAGE.FINVOICE.AGREEMENT.MULTI_STEP_HEADER.TITLE"))("showBackButton",!e.isEditMode);}}function tn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.OFFICIAL_NAME"),rd(),Ms(3,"dd",14)(4,"span",15),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.creditor?.officialName);}}function nn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.BUSINESS_ID"),rd(),Ms(3,"dd",14)(4,"span",16),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.creditor?.businessId);}}function rn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.ADDRESS"),rd(),Ms(3,"dd",14)(4,"span",17),c_(5),rd()()()),t&2){let e=RC(2);mb(5),dv(" ",e.issuer.finvoiceAgreement.creditor?.address.streetName," ",e.issuer.finvoiceAgreement.creditor?.address.townName," ",e.issuer.finvoiceAgreement.creditor?.address.postCode," ",e.issuer.finvoiceAgreement.creditor?.address.postOfficeBoxIdentifier," ",e.issuer.finvoiceAgreement.creditor?.address.countryName," ",e.issuer.finvoiceAgreement.creditor?.address.countryCode," ");}}function an(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.THE_AGREEMENT_CONCERNS"),rd(),Ms(3,"dd",14)(4,"span",18),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.paymentInstruction);}}function on(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.ACCOUNT_NUMBER"),rd(),Ms(3,"dd",14)(4,"span",19),c_(5),N_(6,"accountNumberFormat"),rd()()()),t&2){let e=RC(2);mb(5),cv(R_(6,1,e.issuer.finvoiceAgreement.creditor==null?null:e.issuer.finvoiceAgreement.creditor.account.number));}}function sn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.DATE_OF_AGREEMENT"),rd(),Ms(3,"dd",14)(4,"span",20),c_(5),N_(6,"date"),rd()()()),t&2){let e=RC(2);mb(5),cv(k_(6,1,e.issuer.finvoiceAgreement.createdAt,"dd.MM.yyyy"));}}function cn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.ADDITIONAL_INFORMATION"),rd(),Ms(3,"dd",14)(4,"span",21),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.issuer.finvoiceAgreement.instruction);}}function mn(t,i){if(t&1&&(Ms(0,"ebank-description-list",6),mC(1,tn,6,1,"div",9),mC(2,nn,6,1,"div",9),mC(3,rn,6,6,"div",9),mC(4,an,6,1,"div",9),mC(5,on,7,3,"div",9),mC(6,sn,7,4,"div",9),mC(7,cn,6,1,"div",9),rd()),t&2){let e=RC();Ry("ngClass",T_(8,mt,!e.isEditMode)),mb(),gC(e.issuer.finvoiceAgreement.creditor?.officialName?1:-1),mb(),gC(e.issuer.finvoiceAgreement.creditor?.businessId?2
1:-1),mb(),gC(e.issuer.finvoiceAgreement.creditor?.address?3:-1),mb(),gC(e.issuer.finvoiceAgreement.paymentInstruction?4:-1),mb(),gC(e.issuer.finvoiceAgreement.creditor?.account?.number?5:-1),mb(),gC(e.issuer.finvoiceAgreement.createdAt?6:-1),mb(),gC(e.issuer.finvoiceAgreement.instruction?7:-1);}}function ln(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",25),c_(2),N_(3,"translate"),rd(),Ms(4,"dd",14)(5,"span",26),c_(6),rd()()()),t&2){let e=RC(2);mb(2),cd(" ",e.issuer.finvoiceAgreement?.cid1?.label||R_(3,2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.CID1.LABEL")," "),mb(4),cv(e.cid1);}}function dn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",27),c_(2),N_(3,"translate"),rd(),Ms(4,"dd",14)(5,"span",28),c_(6),rd()()()),t&2){let e=RC(2);mb(2),cd(" ",e.issuer.finvoiceAgreement?.cid2?.label||R_(3,2,"PAGE.FINVOICE.AGREEMENT.PROVIDER.CID2.LABEL")," "),mb(4),cv(e.cid2);}}function pn(t,i){if(t&1&&(Ms(0,"ebank-link",24),ky(1,"span",29),rd()),t&2){let e=RC(2);Ry("href",e.getEditIdentificationReference());}}function un(t,i){if(t&1&&(Ms(0,"div")(1,"h3",22),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.IDENTIFICATION_REFERENCE"),rd(),Ms(3,"ebank-description-list",23),mC(4,ln,7,4,"div",9),mC(5,dn,7,4,"div",9),rd(),mC(6,pn,2,1,"ebank-link",24),rd()),t&2){let e=RC();mb(3),Ry("ngClass",T_(4,mt,!e.isEditMode)),mb(),gC(e.cid1?4:-1),mb(),gC(e.cid2?5:-1),mb(),gC(e.isEditMode?6:-1);}}function En(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYER_INFORMATION.NAME"),rd(),Ms(3,"dd",14)(4,"span",32),c_(5),rd()()()),t&2){let e=RC(2);mb(5),lv("",e.customer.firstName," ",e.customer.lastName);}}function vn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYER_INFORMATION.STREET"),rd(),Ms(3,"dd",14)(4,"span",33),c_(5),rd()()()),t&2){let e=RC(2);mb(5),uv("",e.customer.address.line1,"",e.customer.address.line2?" "+e.customer.address.line2:"","",e.customer.address.line3?" "+e.customer.address.line3:"");}}function gn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYER_INFORMATION.ZIP_CODE"),rd(),Ms(3,"dd",14)(4,"span",34),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.customer.postcode);}}function fn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYER_INFORMATION.CITY"),rd(),Ms(3,"dd",14)(4,"span",35),c_(5),rd()()()),t&2){let e=RC(2);mb(5),cv(e.customer.town);}}function Cn(t,i){if(t&1&&(Ms(0,"div")(1,"h2",30),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYER_INFORMATION"),rd(),Ms(3,"ebank-description-list",31),mC(4,En,6,2,"div",9),mC(5,vn,6,3,"div",9),mC(6,gn,6,1,"div",9),mC(7,fn,6,1,"div",9),rd()()),t&2){let e=RC();mb(3),Ry("ngClass",T_(5,mt,!e.isEditMode)),mb(),gC(e.customer.firstName||e.customer.lastName?4:-1),mb(),gC(e.customer.address&&(e.customer.address.line1||e.customer.address.line2||e.customer.address.line3)?5:-1),mb(),gC(e.customer.postcode?6:-1),mb(),gC(e.customer.town?7:-1);}}function In(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYMENT_SETTINGS.FROM_ACCOUNT"),rd(),Ms(3,"dd",14)(4,"span",36),c_(5),N_(6,"accountNumberFormat"),rd()()()),t&2){let e=RC();mb(5),lv("",e.account.getName()," (",R_(6,2,e.account.iban),")");}}function An(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYMENT_SETTINGS.PAYMENT_RULES"),rd(),Ms(3,"dd",14)(4,"span",37),c_(5),N_(6,"translate"),N_(7,"amountFormat"),rd()()()),t&2){let e=RC();mb(5),lv("",R_(6,2,"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.PAYMENT_RULES.CHECKBOX_"+e.paymentRules),"",e.amount&&e.paymentRules===3?" ("+(e.account?.properties?.currencyCode?e.account.properties.currencyCode+" ":"")+k_(7,4,e.amount,0)+")":"");}}function bn(t,i){if(t&1&&(Ms(0,"div",9)(1,"dt",13),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYMENT_SETTINGS.PREFERRED_LANGUAGE"),rd(),Ms(3,"dd",14)(4,"span",38),c_(5),rd()()()),t&2){let e=RC();mb(5),cv(e.currency.name);}}function Sn(t,i){if(t&1&&(Ms(0,"ebank-link",10),ky(1,"span",39),rd()),t&2){let e=RC();Ry("href",e.getEditPaymentSettings());}}function hn(t,i){if(t&1){let e=CC();Ms(0,"ebank-button",40),qy("buttonClick",function(){yh(e);let c=RC();return vh(c.nextStep())}),Ms(1,"span",41),c_(2,"PAGE.FINVOICE.AGREEMENT.SUMMARY.ACTION"),rd()();}}
1var xe=class t{constructor(i,e,n,c,C,dt,At,Ci){this.service=i;this.dataCustomers=e;this.dataAgreements=n;this.dataAccounts=c;this.activatedRoute=C;this.sbLinkService=dt;this.log=At;this.alert=Ci;this.isEditMode=true;this.accounts=[];this.loadingAction=new br(false);this.loadingCustomers=new br(false);this.loadingAgreements=new br(false);this.loadingAccounts=new br(false);this.subscription=new H;}ngOnInit(){this.loading=CI(this.loadingAction,this.loadingCustomers,this.loadingAgreements).pipe(we(i=>i.includes(true))),this.currencies=this.service.currencies,this.subscription.add(CI(this.dataCustomers.get(null,this.loadingCustomers),this.dataAccounts.get(null,this.loadingAccounts),this.activatedRoute.queryParamMap.pipe(we(i=>i.get("agreement")))).subscribe(([i,e,n])=>{this.customer=i,this.accounts=e.filter(c=>c.rights&&c.rights.paymentFrom&&c.rights.accessPermission),this.agreement=n,this.agreement?this.subscription.add(this.dataAgreements.get({id:this.agreement},this.loadingAgreements).subscribe(c=>{this.isEditMode=true,this.issuer=c,this.service.issuer.next(this.issuer),this.cid1=(0, Ae.get)(this.issuer,"finvoiceAgreement.cid1.value"),this.cid2=(0, Ae.get)(this.issuer,"finvoiceAgreement.cid2.value"),this.account=this.accounts.find(C=>C.iban===(0, Ae.get)(this.issuer,"finvoiceAgreement.payment.account.number")),this.service.account.next(this.account),this.paymentRules=this.service.getApprovalRuleByValue(this.issuer.finvoiceAgreement.payment.approval.rule),this.amount=this.paymentRules===3?(0, Ae.get)(this.issuer,"finvoiceAgreement.payment.approval.limit"):void 0,this.currency=this.currencies.find(C=>C.id===(0, Ae.get)(this.issuer,"finvoiceAgreement.invoiceLanguageCode"));},c=>{this.log.error("something wrong happened while fetching agreement",c),this.alert.serverError(c,"PAGE.FINVOICE.AGREEMENT.ERROR.LOAD_AGREEMENT");})):(this.isEditMode=false,!this.service.issuer.getValue()||!this.service.cid1.getValue()||!this.service.account.getValue()||!this.service.paymentRules.getValue()||this.service.paymentRules.getValue()===3&&!this.service.amount.getValue()||!this.service.currency.getValue()?(this.service.resetData(),this.service.nextStep(["page","einvoice","agreement"],true)):(this.issuer=this.service.issuer.getValue(),this.cid1=this.service.cid1.getValue(),this.cid2=this.service.cid2.getValue(),this.account=this.service.account.getValue(),this.paymentRules=this.service.paymentRules.getValue(),this.amount=this.service.amount.getValue(),this.currency=this.service.currency.getValue()));},i=>{this.log.error("something wrong happened while fetching accounts",i),this.alert.serverError(i,"PAGE.FINVOICE.AGREEMENT.ERROR.LOAD_ACCOUNTS");}));}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe();}nextStep(){this.loadingAction.next(true),this.dataAgreements.create(this.service.mapParams("create")).then(()=>{this.service.isSuccessful.next(true);},()=>{this.service.isSuccessful.next(false);}).finally(()=>{this.loadingAction.next(false),this.service.nextStep(["page","einvoice","agreement","receipt"]);});}getEditIdentificationReference(){return this.sbLinkService.getUrl("URL.PAGE.FINVOICE.AGREEMENT.PROVIDER",{agreement:this.agreement}).url}getEditPaymentSettings(){return this.sbLinkService.getUrl("URL.PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS",{agreement:this.agreement}).url}static{this.\u0275fac=function(e){return new(e||t)(Do(A),Do(c),Do(m),Do(G),Do(K),Do(f),Do(E$1),Do(E$2))};}
1static{this.\u0275cmp=qT({type:t,selectors:[["ng-component"]],standalone:false,decls:24,vars:24,consts:[[1,"finvoice-agreement-spinner",3,"loading"],[3,"title","showBackButton"],[1,"summary-page-section"],[1,"ebank-title-h1",3,"ngClass"],[1,"summary-page-description"],["id","providerTitle","translate","",1,"ebank-title-h2"],["groupHeadingId","providerTitle",1,"summary-page-list",3,"ngClass"],["id","paymentSettingsTitle","translate","",1,"ebank-title-h2"],["groupHeadingId","paymentSettingsTitle",1,"summary-page-list",3,"ngClass"],["ebankDescriptionListItem",""],["linkStyle","tertiary","id","editPaymentSettingsLink","size","s",1,"summary-page-edit-link",3,"href"],[1,"summary-page-submit"],[3,"cancelButtonClick","backButtonClick","title","showBackButton"],["ebankDescriptionListTerm","","translate",""],["ebankDescriptionListDesc",""],["id","officialName",1,"value-pair"],["id","businessId",1,"value-pair"],["id","address",1,"value-pair"],["id","paymentInstruction",1,"value-pair"],["id","accountNumber",1,"value-pair"],["id","createdAt",1,"value-pair"],["id","instruction",1,"value-pair"],["id","referenceTitle","translate","",1,"ebank-title-h3"],["groupHeadingId","referenceTitle",1,"summary-page-list",3,"ngClass"],["linkStyle","tertiary","id","editReferenceLink","size","s",1,"summary-page-edit-link",3,"href"],["ebankDescriptionListTerm","","id","cid1Label"],["id","cid1",1,"value-pair"],["ebankDescriptionListTerm","","id","cid2Label"],["id","cid2",1,"value-pair"],["translate","PAGE.FINVOICE.AGREEMENT.SUMMARY.DETAILS.EDIT_IDENTIFICATION_REFERENCE"],["id","payerInformationTitle","translate","",1,"ebank-title-h2"],["groupHeadingId","payerInformationTitle",1,"summary-page-list",3,"ngClass"],["id","payerName",1,"value-pair"],["id","payerStreet",1,"value-pair"],["id","payerPostCode",1,"value-pair"],["id","payerTown",1,"value-pair"],["id","fromAccount",1,"value-pair"],["id","paymentRule",1,"value-pair"],["id","currencyLang",1,"value-pair"],["translate","PAGE.FINVOICE.AGREEMENT.SUMMARY.DETAILS.EDIT_PAYMENT_SETTINGS"],[1,"summary-page-submit",3,"buttonClick"],["translate",""]],template:function(e,n){e&1&&(Ms(0,"ebank-spinner",0),N_(1,"async"),mC(2,en,2,4,"ebank-multi-step-header",1),Ms(3,"section",2)(4,"h1",3),c_(5),N_(6,"translate"),rd(),Ms(7,"div",4),c_(8),N_(9,"translate"),rd(),Ms(10,"h2",5),c_(11,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PROVIDER"),rd(),mC(12,mn,8,10,"ebank-description-list",6),mC(13,un,7,6,"div"),mC(14,Cn,8,7,"div"),Ms(15,"div")(16,"h2",7),c_(17,"PAGE.FINVOICE.AGREEMENT.SUMMARY.PAYMENT_SETTINGS"),rd(),Ms(18,"ebank-description-list",8),mC(19,In,7,4,"div",9),mC(20,An,8,7,"div",9),mC(21,bn,6,1,"div",9),rd(),mC(22,Sn,2,1,"ebank-link",10),rd(),mC(23,hn,3,0,"ebank-button",11),rd()()),e&2&&(Ry("loading",R_(1,14,n.loading)),mb(2),gC(n.isEditMode?-1:2),mb(2),Ry("ngClass",T_(20,Ji,n.isEditMode)),mb(),cd(" ",R_(6,16,n.isEditMode?"PAGE.FINVOICE.AGREEMENT.SUMMARY.DETAILS.HEADING":"PAGE.FINVOICE.AGREEMENT.SUMMARY.HEADING")," "),mb(3),cd(" ",R_(9,18,n.isEditMode?"PAGE.FINVOICE.AGREEMENT.SUMMARY.DETAILS.DESCRIPTION":"PAGE.FINVOICE.AGREEMENT.SUMMARY.DESCRIPTION")," "),mb(4),gC(n.issuer?.finvoiceAgreement?12:-1),mb(),gC(n.issuer?.finvoiceAgreement&&(n.cid1||n.cid2)?13:-1),mb(),gC(n.customer?14:-1),mb(4),Ry("ngClass",T_(22,mt,!n.isEditMode)),mb(),gC(n.account?19:-1),mb(),gC(n.paymentRules?20:-1),mb(),gC(n.currency?21:-1),mb(),gC(n.isEditMode?22:-1),mb(),gC(n.isEditMode?-1:23));},dependencies:[dn$2,Te$1,_e,Ys,fO,Qs,vO,Ws,W8,G8,mn$1,wn,ye,p,a],encapsulation:2,changeDetection:1});}};vM();var Nn=[{path:"",pathMatch:"full",component:at,data:{name:"finvoice-agreement-main",breadcrumbLabel:"PAGE.FINVOICE.AGREEMENT.RECEIPT.LINK.E_INVOICE_ORDERS",breadcrumbPath:"agreements/agreementslist",title:"PAGE.FINVOICE.AGREEMENT.INFORMATION_PAGE.HEADING"}},{path:"step1",pathMatch:"full",component:ct,data:{name:"finvoice-agreement-step1",title:"PAGE.FINVOICE.AGREEMENT.SEARCH_PROVIDER.HEADING"},canDeactivate:[L]},{path:"step2",pathMatch:"full",component:Me,data:{name:"finvoice-agreement-step2"},canDeactivate:[L]},{path:"step3",pathMatch:"full",component:Re,data:{name:"finvoice-agreement-step3",title:"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.HEADING"},canDeactivate:[L]},{path:"step4",pathMatch:"full",component:xe,data:{name:"finvoice-agreement-step4",title:"PAGE.FINVOICE.AGREEMENT.SUMMARY.HEADING"}},{path:"receipt",pathMatch:"full",component:ot,data:{name:"finvoice-agreement-receipt",title:"PAGE.FINVOICE.AGREEMENT.RECEIPT.HEADING",ebankuiPage:"half ebankui-alert-page"}},{path:"provider",component:Me,data:{name:"finvoice-agreement-provider"},canDeactivate:[L]},{path:"payment-settings",component:Re,data:{name:"finvoice-agreement-payment-settings",title:"PAGE.FINVOICE.AGREEMENT.PAYMENT_SETTINGS.HEADING"},canDeactivate:[L]},{path:"details",pathMatch:"full",component:xe,data:{name:"finvoice-agreement-details",breadcrumbLabel:"PAGE.FINVOICE.AGREEMENT.RECEIPT.LINK.E_INVOICE_ORDERS",breadcrumbPath:"agreements/agreementslist",title:"PAGE.FINVOICE.AGREEMENT.SUMMARY.DETAILS.HEADING"}}],lt=class t{static{this.\u0275fac=function(e){return new(e||t)};}static{this.\u0275mod=my({type:t});}static{this.\u0275inj=Oc({imports:[aa.forChild(Nn),aa]});}};vM();var fi=class t{static{this.\u0275fac=function(e){return new(e||t)};}static{this.\u0275mod=my({type:t});}static{this.\u0275inj=Oc({providers:[A,L],imports:[ii,lt,dn$1,Cu,_e,xu,r8,F8,BO,Ga,g6,vO,BI,Ro,Nf,Rf,X9,Ls,JI,No,sB,t8]});}};export{fi as FInvoiceAgreementModule};
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.