1import{a as yl,b as ea,c as ta,d as ia,e as Ai,f as na,g as Al,h as wl,i as Il,j as Ml,k as Pl,l as Ol,p as An,q as kl,r as Fl}from"./chunk-XXVDSALV.js";import{a as Kn,b as Tl,c as gr,d as vr}from"./chunk-QGECKCTM.js";import{b as xl}from"./chunk-LPXUXR5D.js";import"./chunk-TRX77K7W.js";import"./chunk-6PON4GLB.js";import{a as Dl}from"./chunk-XQJ3MZEP.js";import{h as El}from"./chunk-Y2SHU3FQ.js";import{$b as ki,$c as Wt,$j as tl,$k as ei,A as Fr,Aa as C,Ab as yo,Ad as Bo,Ai as Zt,Ak as ll,B as co,Ba as Ln,Bb as qr,Bd as cs,Bh as Ya,Bj as qn,Bk as cl,C as Va,Ca as Vn,Cb as Ao,Cd as vt,Ch as Xa,Ck as pl,D as Rr,Dd as ps,De as H,Dh as Ja,Dj as ri,Dk as M,E as ee,Ea as he,Eb as ae,Ed as Ct,Ee as Et,Eh as er,Ei as yt,Ej as qo,Ek as Pt,El as Xo,Fa as _e,Fb as Le,Fd as we,Fe as Qa,Fh as tr,Fi as At,Fl as hl,G as y,Ga as Vr,Ge as Me,Gh as ir,Gi as wt,Gj as Ys,Ha as F,Hd as q,He as Cs,Hh as nr,Hj as Yt,Hk as dl,I as S,Ia as m,Id as ie,Ie as bs,Ih as or,Ik as zi,Il as _l,Ja as jr,Jd as it,Je as Ss,Jh as ar,Jk as Dn,K as k,Ka as d,Kd as bt,Ke as Es,Kh as rr,Kk as Tn,Kl as _r,L as po,La as _i,Lb as ja,Ld as je,Lh as sr,Lj as si,Lk as Jt,M as G,Ma as Ft,Md as K,Mh as lr,Mi as Rs,Mj as J,Ml as kt,N as v,Na as et,Nb as wo,Nc as Te,Nd as nt,Nh as cr,Ni as Ns,Nj as $,Nk as Qo,Nl as gl,O as P,Oa as me,Oc as es,Od as Ue,Oh as pr,Oi as Bs,Ok as We,P as O,Pa as ue,Pc as ts,Ph as dr,Pi as zs,Pj as Zo,Pk as pe,Pl as Jo,Q as Nr,Qa as _o,Qb as Io,Qc as is,Qd as ds,Qh as mr,Qi as Ls,Qk as Ko,Ra as go,Rc as ns,Rd as Ei,Re as Ni,Rh as ur,Ri as Qt,Rj as Zn,S as ze,Sa as Pi,Sc as os,Sd as Gn,Se as Ka,Si as dn,Ta as re,Tc as gi,Te as Lo,Ti as Vs,Tj as Xs,Tk as ml,Ua as jn,Uc as Wa,Ud as Wn,Ue as Vo,Ui as js,Uj as Js,V as j,Va as ge,Vc as Ha,Vd as W,Ve as jo,Vi as Us,Vl as vl,W as $i,Wa as Oi,Wb as ve,Wc as vi,Wd as Jc,We as sn,Xa as c,Xb as xe,Xc as Ri,Xd as Hn,Xe as ln,Xj as It,Xl as Cl,Y as mo,Ya as g,Yb as De,Yc as Po,Yd as Ht,Ye as xs,Yl as yi,Za as U,Zb as tt,Zc as Oo,Zd as ms,Ze as Ds,Zh as cn,Zi as mn,Zj as el,Zl as bl,_a as te,_b as Zr,_c as Ze,_i as Gs,_k as Ot,_l as Sl,a as Ir,ab as vo,ac as Qr,ad as Ci,ai as Qe,aj as un,ak as il,al as ul,am as He,b as Mr,ba as Br,bb as Co,bc as Mo,bd as bi,be as qa,bj as fn,bk as nl,ca as s,cb as bo,cc as A,cd as Si,ci as Ke,cj as hn,ck as ol,cl as ti,da as qi,dc as _t,dd as ko,de as Za,di as Ye,dj as _n,e as Xc,ea as zr,ee as us,ej as gn,ek as ot,fb as Ut,fe as Y,fg as Uo,fi as Xe,fj as vn,fk as at,g as Pr,gb as So,gc as Ve,ge as Ce,gi as pn,gj as Cn,h as pt,ha as _,hb as Eo,hc as Kr,he as Ie,hh as As,hi as Go,hj as bn,hk as rt,hl as Di,i as za,ia as x,ib as T,ic as gt,id as Xi,ie as $t,ih as ws,ii as Os,ij as Sn,ik as xn,j as Be,ja as uo,jb as B,jc as Zi,jd as X,je as zo,jh as Is,ji as ks,jj as En,jk as Xt,ka as fo,kb as V,kc as Qi,kd as ye,ke as St,kg as Ts,ki as Fs,kj as Ws,l as La,la as ho,lb as Ur,lc as Gt,ld as Ae,le as be,lg as ys,li as Wo,lj as Hs,lk as Mt,m as z,mb as Gr,mc as Yr,md as fe,me as en,mj as $s,na as Z,nb as xo,nc as Ki,nd as Fo,ne as Se,ni as mt,nj as qs,ob as b,oc as Xr,od as Ji,oe as tn,oj as Zs,ok as al,p as L,pb as Rt,pd as Ro,pe as fs,pi as qt,pk as xi,q as so,qa as hi,qb as I,qc as Fi,qd as No,qe as nn,qi as xt,qk as Fe,ql as Ti,r as dt,ra as u,rb as Do,rd as E,re as on,ri as Dt,rj as Qs,s as lo,sa as f,sb as Wr,sd as as,se as hs,sh as Ms,si as Tt,sj as Ks,sl as Li,t as ft,ta as Lr,tb as Hr,tc as Ua,td as rs,ti as Ho,tj as $o,tk as fr,tl as Yo,ua as jt,ub as To,ud as Nt,ue as an,uj as $n,v as ht,va as ne,vc as Ga,vd as ss,ve as rn,vj as Kt,w as ce,wa as oe,wc as Q,wd as $a,we as _s,wj as Bi,wl as yn,x as fi,xa as p,xb as $r,xc as Un,xe as gs,xj as Ge,xl as fl,y as Or,ya as a,yc as Yi,ye as vs,yh as Ps,yk as rl,yl as Qn,z as kr,za as o,zc as Jr,zd as ls,zh as Pe,zj as Ee,zk as sl,zl as hr}from"./chunk-S6Z2KS6P.js";var oa=class{constructor(r){this.errorName=r}isErrorState(r,e){return r?.parent?.invalid&&r.parent.hasError(this.errorName)||r?.invalid||!!e?.errors}};var aa=(()=>{class t{constructor(e,i){this.http=e,this.notificationService=i}create(e){return this.http.post(Uo,e).pipe(L(()=>(this.notificationService.success(E.REALIZATION_SUCCESS),{message:"ok",successful:!0})))}delete(e){let i=new ja().set("bundleIds",e.toString());return this.http.delete(Uo,{params:i})}update(e,i){let n=new ja().set("id",i.toString());return this.http.put(Uo,e,{params:n}).pipe(L(()=>(this.notificationService.success(E.REALIZATION_SUCCESS),{message:"ok",successful:!0})))}static{this.\u0275fac=function(i){return new(i||t)(G(Io),G(K))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function ip(t,r){t&1&&(a(0,"span"),c(1,"Nazwa jest wymagana"),o())}function np(t,r){t&1&&(a(0,"span"),c(1,"Nazwa jest nieprawid\u0142owa"),o())}function op(t,r){t&1&&(a(0,"span"),c(1,"Nazwa jest za d\u0142uga"),o())}function ap(t,r){t&1&&(a(0,"span"),c(1,"Data nie mo\u017Ce by\u0107 wcze\u015Bniejsza"),o())}function rp(t,r){t&1&&(a(0,"span"),c(1,"Data nie mo\u017Ce by\u0107 p\xF3\u017Aniejsza ni\u017C data ost. realizacji"),o())}function sp(t,r){t&1&&(a(0,"span"),c(1,"Data nie mo\u017Ce by\u0107 wcze\u015Bniejsza"),o())}function lp(t,r){if(t&1&&(a(0,"mat-form-field",5)(1,"mat-label"),c(2,"Data ost. realizacji"),o(),C(3,"input",13)(4,"mat-datepicker-toggle",7)(5,"mat-datepicker",null,1),a(7,"mat-error"),u(8,sp,2,0,"span"),o()()),t&2){let e=re(6),i=d();s(3),p("formControl",i.lastDateOfExecutionFC)("matDatepicker",e)("min",i.minExectionDate),s(),p("for",e),s(4),f(i.lastDateOfExecutionFC.hasError("isBeforeToday")?8:-1)}}var Cr=(()=>{class t{constructor(e,i,n,l,h,D){this.dialogRef=e,this.userFacadeService=i,this.accountService=n,this.data=l,this.packagesService=h,this.errorProviderService=D,this.ButtonLabels=Qe,this.FunctionalAuthority=Q,this.isEdit=!1,this.minExectionDate=Nt(new Date,H),this.errorMatcher=new oa("isSameOrAfter"),this.TITLE_MAX_LENGTH=35,this.executionAuth=!1,this.isEdit=!!l.bundle;let R=this.userFacadeService.hasAuthorities([Q.FUNC_TRANSFER_WAGES])&&!this.isEdit;this.packageNameFC=new A("",xe.required),this.lastDateOfExecutionFC=new A(""),this.dateOfExecutionFC=new A(Nt(new Date,H),zi.isBeforeToday),this.chargeFC=new A(""),this.salaryFC=new A({value:!1,disabled:!R}),this.packageFG=new ki({packageNameFC:this.packageNameFC,dateOfExecutionFC:this.dateOfExecutionFC,lastDateOfExecutionFC:this.lastDateOfExecutionFC,chargeFC:this.chargeFC},{validators:zi.isSameOrAfter(this.lastDateOfExecutionFC,this.dateOfExecutionFC)}),this.executionAuth=this.userFacadeService.hasAuthorities([Q.FUNC_MLYNEK]),this.minExecutionDate=l.bundle?.dateOfExecution,this.minFinalExecutionDate=l.bundle?.finalExecuteDate}ngOnInit(){this.accountService.getChargeableAccounts().pipe(S(e=>{this.chargeableAccounts=e,this.isEdit&&this.initFormWithValues(),this.packageFG.markAllAsTouched()})).subscribe()}close(){this.dialogRef.close()}clearContent(){this.packageFG.reset()}save(){this.isEdit?this.packagesService.update(this.getPackageData(),this.data.bundle.id).pipe(this.errorProviderService.processErrorWithLocalFormError(this),S(()=>this.closeAfterAccept())).subscribe():this.packagesService.create(this.getPackageData()).pipe(this.errorProviderService.processErrorWithLocalFormError(this),S(()=>this.closeAfterAccept())).subscribe()}checkExecuteDateFC(){ss(new Date(this.dateOfExecutionFC.value),new Date(this.minExectionDate))&&this.dateOfExecutionFC.setValue(this.minExectionDate,{emitEvent:!1})}getControlByProperty(e){switch(e){case"nazwa":return this.packageNameFC;case"rachunekObciazany":return this.chargeFC;default:return null}}getFormGroup(){return this.packageFG}closeAfterAccept(){this.dialogRef.close(!0)}getPackageData(){let e=this.lastDateOfExecutionFC.value?Nt(new Date(this.lastDateOfExecutionFC.value),H):"";return{name:this.packageNameFC.value,executionDate:Nt(new Date(this.dateOfExecutionFC.value),H),finalExecutionDate:this.executionAuth?e:"",chargedAccountId:this.chargeFC.value,salary:this.salaryFC.value}}findAccountId(e){let i=this.chargeableAccounts.find(n=>n.accountNumber===e);return i?i.accountId:null}initFormWithValues(){let e=this.data.bundle;this.packageNameFC.setValue(e.name),this.dateOfExecutionFC.setValue(this.minExecutionDate),this.lastDateOfExecutionFC.setValue(this.minFinalExecutionDate),this.chargeFC.setValue(this.findAccountId(e.sourceAccount)),this.salaryFC.setValue(this.data.bundle.salary)}static{this.\u0275fac=function(i){return new(i||t)(_(ye),_(Pe),_(Jt),_(Ae),_(aa),_(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-package"]],standalone:!1,decls:31,vars:21,consts:[["executionDatePicker",""],["lastExecutionDatePicker",""],["appearance","outline",1,"flex-fill"],["autocomplete","off","matInput","","required","",3,"formControl","maxlength"],[1,"flex-row","gap-10"],["appearance","outline"],["autocomplete","off","matInput","",3,"focusout","formControl","matDatepicker","errorStateMatcher","min"],["matSuffix","",3,"for"],["appearance","outline",4,"appShowIfHasAuthority"],[1,"box-margin","flex-row","gap-10"],[3,"formControl","disabled"],[3,"accountList","sourceAccountFC","disabledInput"],[3,"cancelAction","resetAction","confirmAction","confirmDisabled","buttonLabelConfirm"],["autocomplete","off","matInput","",3,"formControl","matDatepicker","min"]],template:function(i,n){if(i&1&&(a(0,"app-dialog-container")(1,"app-dialog-header"),c(2),o(),a(3,"a
1pp-dialog-content")(4,"app-dialog-section")(5,"mat-form-field",2)(6,"mat-label"),c(7,"Nazwa paczki"),o(),C(8,"input",3),a(9,"mat-error"),u(10,ip,2,0,"span"),u(11,np,2,0,"span"),u(12,op,2,0,"span"),o()(),a(13,"div",4)(14,"mat-form-field",5)(15,"mat-label"),c(16,"Data p\u0142atno\u015Bci"),o(),a(17,"input",6),m("focusout",function(){return n.checkExecuteDateFC()}),o(),C(18,"mat-datepicker-toggle",7)(19,"mat-datepicker",null,0),a(21,"mat-error"),u(22,ap,2,0,"span"),u(23,rp,2,0,"span"),o()(),Z(24,lp,9,5,"mat-form-field",8),o(),a(25,"div",9)(26,"mat-checkbox",10),c(27," P\u0142acowa "),o()()(),a(28,"app-dialog-section"),C(29,"app-source-account-input",11),o()(),a(30,"app-action-buttons-panel",12),m("cancelAction",function(){return n.close()})("resetAction",function(){return n.clearContent()})("confirmAction",function(){return n.save()}),o()()),i&2){let l=re(20);s(2),g(n.data.title),s(6),p("formControl",n.packageNameFC)("maxlength",n.TITLE_MAX_LENGTH),s(2),f(n.packageNameFC.hasError("required")?10:-1),s(),f(n.packageNameFC.hasError("pattern")?11:-1),s(),f(n.packageNameFC.hasError("nazwa.maxlength")?12:-1),s(5),p("formControl",n.dateOfExecutionFC)("matDatepicker",l)("errorStateMatcher",n.errorMatcher)("min",n.minExectionDate),s(),p("for",l),s(4),f(n.dateOfExecutionFC.hasError("isBeforeToday")?22:-1),s(),f(n.packageFG.hasError("isSameOrAfter")?23:-1),s(),p("appShowIfHasAuthority",n.FunctionalAuthority.FUNC_MLYNEK),s(2),p("formControl",n.salaryFC)("disabled",n.isEdit),s(3),p("accountList",n.chargeableAccounts)("sourceAccountFC",n.chargeFC)("disabledInput",n.salaryFC.value),s(),p("confirmDisabled",n.packageFG.invali
1d)("buttonLabelConfirm",n.ButtonLabels.OK)}},dependencies:[be,Ie,$t,St,rn,xt,Dt,Tt,Se,ve,De,Zi,Qi,Ve,Qo,Ke,Ye,Xe,pn,We,mt],styles:[".box-margin[_ngcontent-%COMP%]{margin-top:10px}.flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.gap-10[_ngcontent-%COMP%]{gap:10px}.flex-fill[_ngcontent-%COMP%]{flex:1 1 100%;box-sizing:border-box;width:100%;min-width:0;min-height:0}"]})}}return t})();var sa=class{constructor(r,e,i){this.property=this.emptyIfNull(r),this.messageKey=this.emptyIfNull(e),this.vals=i==="null"?void 0:i}emptyIfNull(r){return r==="null"||r==null?"":r}};var br="property=",Bl="messageKey=",cp="vals=",la=class{static parse(r){let e=[],i=r.indexOf("["),n=r.length,l=br.length,h=Bl.length;for(;i<n;){let D=r.indexOf(br,i);if(D===-1)break;let R=r.indexOf(qa,D);if(R===-1)break;let se=r.slice(D+l,R),le=r.indexOf(Bl,R);if(le===-1)break;let de=r.indexOf(qa,le);if(de===-1)break;let Re=r.slice(le+h,de);i=de;let Ne=this.extractVals(r,de,r.indexOf(br,de));e=[new sa(se,Re,Ne),...e]}return e}static extractVals(r,e,i){let n=r.indexOf(cp,e);if(n===-1)return;let l=r.indexOf("[",n);if(l===-1||i!==-1&&l>i)return;let h=0;for(let D=l;D<r.length;D++)if(r[D]==="[")h++;else if(r[D]==="]"&&(h--,h===0))return r.slice(l+1,D)||void 0}};var pp={vatNr:"Numer faktury (warto\u015B\u0107 po /INV/)",text:"Dodatkowa tre\u015B\u0107 (warto\u015B\u0107 po /TXT/)",identyfikator:"Identyfikator (warto\u015B\u0107 po /IDC/)",kwotaVat:"Kwota VAT (warto\u015B\u0107 po /VAT/)"},dp={"vatNr.forbiddenChar":"nie mo\u017Ce zawiera\u0107 znaku |","text.forbiddenChar":"nie mo\u017Ce zawiera\u0107 znaku |","identyfikator.forbiddenChar":'nie mo\u017Ce zawiera\u0107 znak\xF3w: / " | , oraz spacji',"vatNr.maxlength":"nie mo\u017Ce by\u0107 d\u0142u\u017Cszy ni\u017C 35 znak\xF3w","text.maxlength":"nie mo\u017Ce by\u0107 d\u0142u\u017Csza ni\u017C 33 znaki","identyfikator.maxlength":"nie mo\u017Ce by\u0107 d\u0142u\u017Cszy ni\u017C 14 znak\xF3w","identyfikator.empty":"nie mo\u017Ce by\u0107 pusty","vatNr.empty":"nie mo\u017Ce by\u0107 pusty","kwotaVat.greaterThan0":"musi by\u0107 wi\u0119ksza od 0,00","kwotaVat.atMostBrutto":"musi by\u0107 mniejsza lub r\xF3wna kwocie brutto"},mp=new Set(["vatNr.invalidSubstrings","text.invalidSubstrings","chars.illegal"]);function up(t){return t?`zawiera niedozwolone znaki: ${t}`:"zawiera niedozwolone znaki lub ci\u0105gi znak\xF3w"}function zl(t,r,e){let i=pp[t];if(!i)return null;if(mp.has(r))return`${i} ${up(e)}`;let n=dp[r];return n?`${i} ${n}`:null}var ca=(()=>{class t{constructor(e){this.transferDialogService=e}openEditTransferDialog(e){return this.transferDialogService.openDialog(Dn.parse(e.disposition.type),qo.getFromImport(e.disposition,e.lineNumber),qn.IMPORT)}static{this.\u0275fac=function(i){return new(i||t)(G(Yo))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var hp=(t,r)=>({invalid:t,failed:r});function _p(t,r){t&1&&(a(0,"mat-header-cell"),c(1,"Lp"),o())}function gp(t,r){if(t&1&&(a(0,"mat-cell")(1,"span"),c(2),o()()),t&2){let e=r.$implicit;s(2),g(e.lineNumber)}}function vp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Nazwa beneficjenta"),o())}function Cp(t,r){if(t&1&&(a(0,"mat-cell")(1,"span"),c(2),T(3,"concatStringPipe"),o()()),t&2){let e=r.$implicit;s(2),g(Ur(3,1,e.disposition==null?null:e.disposition.name,e.disposition==null?null:e.disposition.address1,e.disposition==null?null:e.disposition.address2))}}function bp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Rachunek beneficjenta"),o())}function Sp(t,r){if(t&1&&(a(0,"mat-cell")(1,"span"),c(2),T(3,"ibanFormatPipe"),o()()),t&2){let e=r.$implicit;s(2),g(B(3,1,e.disposition==null?null:e.disposition.targetAccount))}}function Ep(t,r){t&1&&(a(0,"mat-header-cell",25),c(1," Tytu\u0142 "),o())}function xp(t,r){if(t&1&&(a(0,"mat-cell",25)(1,"span"),c(2),o()()),t&2){let e=r.$implicit;s(2),g(e.disposition==null?null:e.disposition.title)}}function Dp(t,r){t&1&&(a(0,"mat-header-cell",25),c(1," Kwota "),o())}function Tp(t,r){if(t&1&&(a(0,"mat-cell",25)(1,"span"),c(2),T(3,"currencyFormatPipe"),o()()),t&2){let e=r.$implicit;s(2),g(B(3,1,e.disposition==null?null:e.disposition.amount))}}function yp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Typ"),o())}function Ap(t,r){if(t&1&&(a(0,"mat-cell")(1,"span"),c(2),T(3,"dispositionTypeView"),o()()),t&2){let e=r.$implicit;s(2),g(V(3,1,e.disposition==null?null:e.disposition.type,!!(e.disposition!=null&&e.disposition.sorbnet)))}}function wp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Waluta"),o())}function Ip(t,r){if(t&1&&(a(0,"mat-cell")(1,"span"),c(2),o()()),t&2){let e=r.$implicit;s(2),g(e.disposition==null?null:e.disposition.currency)}}function Mp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," B\u0142\u0105d"),o())}function Pp(t,r){if(t&1&&(a(0,"mat-cell")(1,"span",26),c(2),o()()),t&2){let e=r.$implicit,i=d();s(2),g(i.invalidReasons.get(e))}}function Op(t,r){t&1&&C(0,"mat-header-cell")}function kp(t,r){if(t&1){let e=F();a(0,"mat-cell",27)(1,"button",28),m("click",function(){let n=P(e).$implicit,l=d();return O(l.editRow(n))}),a(2,"mat-icon"),c(3,"edit"),o()()()}if(t&2){let e=r.$implicit,i=d();s(),p("disabled",!i.canEdit(e))("matTooltip",i.editTooltip(e))}}function Fp(t,r){t&1&&C(0,"mat-header-row",29)}function Rp(t,r){if(t&1&&C(0,"mat-row",30),t&2){let e=r.$implicit,i=d();p("ngClass",Eo(1,hp,e.state===i.STATE.INVALID,e.state===i.STATE.FAILED))}}var Np="Nie uda\u0142o si\u0119 wczyta\u0107 rekordu \u2013 nieprawid\u0142owe dane w pliku.",Bp="Popraw dyspozycj\u0119",zp="Tego rekordu nie mo\u017Cna edytowa\u0107 \u2013 nie uda\u0142o si\u0119 go wczyta\u0107 (nieprawid\u0142owe dane).",Vl=(()=>{class t{constructor(){this.dialogRef=v(ye),this.data=v(Ae),this.notificationService=v(K),this.invalidEditDialogService=v(ca),this.errorProviderService=v(Y),this.sorbnetRequiredService=v(us),this.STATE=Bi,this.ButtonLabels=Qe,this.title=this.data.title,this.dataSource=new Zn,this.displayedColumns=["lineNumber","name","targetAccount","title","amount","type","currency","reason","edit"],this.invalidReasons=new Map,this.invalidDispositions=this.data.details.dispositions,this.summary=this.data.details.summary,this.sorbnetRequiredMessage=Gn[Za]}ngOnInit(){this.dataSource.data=this.invalidDispositions,this.recomputeReasons(),this.sorbnetRequiredService.getRequiredMessage().pipe(co(1)).subscribe(e=>{this.sorbnetRequiredMessage=e,this.recomputeReasons()})}get totalCount(){return this.summary.totalCount}get editableCount(){return this.summary.invalidCount}get nonEditableCount(){return this.summary.failedCount}get validCount(){return this.summary.totalCount-this.summary.failedCount-this.summary.invalidCount}get canImport(){return this.validCount>0}canEdit(e){return e.state===Bi.INVALID}editTooltip(e){return this.canEdit(e)?Bp:zp}editRow(e){this.canEdit(e)&&this.invalidEditDialogService.openEditTransferDialog(e).afterClosed().pipe(this.errorProviderService.processError(E.EDITING_ERROR)).subscribe(i=>this.updateAfterEdit(e,i))}confirmImport(){if(!this.canImport){this.notificationService.error(E.IMPORT_VALID_ER
1ROR);return}this.closeDialog(!0,!0)}cancel(){this.closeDialog(!1,!1)}recomputeReasons(){this.invalidReasons=new Map(this.invalidDispositions.map(e=>[e,this.buildReason(e)]))}buildReason(e){if(e.state===Bi.FAILED)return Np;if(e.state!==Bi.INVALID||!e.message)return"";let i=!!e.disposition&&Dn.parse(e.disposition.type)===ri.VAT_INVOICE,n=la.parse(e.message).map(l=>this.resolveViolation(l.property,l.messageKey,l.vals,i)).filter((l,h,D)=>!!l&&D.indexOf(l)===h);return n.length?n.join(" \u2022 "):e.message}resolveViolation(e,i,n,l){if(i===Za)return this.sorbnetRequiredMessage;if(l){let h=zl(e,i,n);if(h)return h}return Gn[i]??i}recountSummary(){this.summary.failedCount=this.getDispositionsByState(Bi.FAILED),this.summary.invalidCount=this.getDispositionsByState(Bi.INVALID)}getDispositionsByState(e){return this.invalidDispositions.filter(i=>i.state===e).length}closeDialog(e,i){let n={isConfirm:e,isValidOnly:i};this.dialogRef.close(n)}updateAfterEdit(e,i){if(i){let n=this.invalidDispositions.indexOf(e);this.invalidDispositions.splice(n,1),this.invalidDispositions.push(i),this.dataSource.data=this.invalidDispositions,this.recomputeReasons(),this.recountSummary()}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["ng-component"]],standalone:!1,decls:58,vars:14,consts:[[1,"dialog-intro"],[1,"dialog-summary","flex-row-wrap","gap-15rem"],[1,"summary-item"],[1,"legend-dot","editable"],[1,"legend-icon"],[1,"legend-dot","failed"],[1,"data-table-with-position",3,"dataSource"],["matColumnDef","lineNumber"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","name"],["matColumnDef","targetAccount"],["matColumnDef","title"],["class","flex-row justify-end items-center",4,"matHeaderCellDef"],["class","flex-row justify-end items-center",4,"matCellDef"],["matColumnDef","amount"],["matColumnDef","type"],["matColumnDef","currency"],["matColumnDef","reason"],["matColumnDef","edit"],["class","justify-center items-center",4,"matCellDef"],["class","sticky-header-filter default-sticky",4,"matHeaderRowDef"],[3,"ngClass",4,"matRowDef","matRowDefColumns"],[1,"import-note"],[3,"cancelAction","confirmAction","withResetButton","buttonLabelCancel","buttonLabelConfirm","focusConfirmInitially","confirmDisabled"],[1,"flex-row","justify-end","items-center"],[1,"reason-cell"],[1,"justify-center","items-center"],["mat-icon-button","","aria-label","Popraw dyspozycj\u0119",3,"click","disabled","matTooltip"],[1,"sticky-header-filter","default-sticky"],[3,"ngClass"]],template:function(i,n){i&1&&(a(0,"app-dialog-container")(1,"app-dialog-header"),c(2),o(),a(3,"app-dialog-content")(4,"p",0),c(5,"Poni\u017Csze dyspozycje zawieraj\u0105 b\u0142\u0119dy i w obecnej postaci nie zostan\u0105 zaimportowane."),o(),a(6,"div",1)(7,"span",2)(8,"strong"),c(9,"Razem:"),o(),c(10),o(),a(11,"span",2)(12,"strong"),c(13,"Prawid\u0142owe:"),o(),c(14),o(),a(15,"span",2),C(16,"span",3),c(17),a(18,"mat-icon",4),c(19,"edit"),o(),c(20,") "),o(),a(21,"span",2),C(22,"span",5),c(23),o()(),a(24,"mat-table",6),he(25,7),Z(26,_p,2,0,"mat-header-cell",8)(27,gp,3,1,"mat-cell",9),_e(),he(28,10),Z(29,vp,2,0,"mat-header-cell",8)(30,Cp,4,5,"mat-cell",9),_e(),he(31,11),Z(32,bp,2,0,"mat-header-cell",8)(33,Sp,4,3,"mat-cell",9),_e(),he(34,12),Z(35,Ep,2,0,"mat-header-cell",13)(36,xp,3,1,"mat-cell",14),_e(),he(37,15),Z(38,Dp,2,0,"mat-header-cell",13)(39,Tp,4,3,"mat-cell",14),_e(),he(40,16),Z(41,yp,2,0,"mat-header-cell",8)(42,Ap,4,4,"mat-cell",9),_e(),he(43,17),Z(44,wp,2,0,"mat-header-cell",8)(45,Ip,3,1,"mat-cell",9),_e(),he(46,18),Z(47,Mp,2,0,"mat-header-cell",8)(48,Pp,3,1,"mat-cell",9),_e(),he(49,19),Z(50,Op,1,0,"mat-header-cell",8)(51,kp,4,2,"mat-cell",20),_e(),Z(52,Fp,1,0,"mat-header-row",21)(53,Rp,1,4,"mat-row",22),o()(),a(54,"app-dialog-bottom-panel")(55,"p",23),c(56),o(),a(57,"app-action-buttons-panel",24),m("cancelAction",function(){return n.cancel()})("confirmAction",function(){return n.confirmImport()}),o()()()),i&2&&(s(2),g(n.title),s(8),U("\xA0",n.totalCount),s(4),U("\xA0",n.validCount),s(3),U(" Do poprawy:\xA0",n.editableCount," (edytuj "),s(6),U(" B\u0142\u0119dne:\xA0",n.nonEditableCount," (nie mo\u017Cna zaimportowa\u0107) "),s(),p("dataSource",n.dataSource),s(28),p("matHeaderRowDef",n.displayedColumns),s(),p("matRowDefColumns",n.displayedColumns),s(3),U(" ",n.canImport?"Zaimportowane zostan\u0105 wy\u0142\u0105cznie poprawne dyspozycje.":"Brak poprawnych dyspozycji do zaimportowania."," "),s(),p("withResetButton",!1)("buttonLabelCancel",n.ButtonLabels.CANCEL)("buttonLabelConfirm",n.ButtonLabels.IMPORT_DISPOSITIONS)("focusConfirmInitially",!0)("confirmDisabled",!n.canImport))},dependencies:[yo,vt,q,un,hn,Cn,_n,fn,bn,gn,vn,Sn,En,qt,Ke,Ye,Xe,Fs,mt,J,$,kt,_l],styles:["mat-table.data-table-with-position[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:nth-of-type(1), mat-table.data-table-with-position[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:nth-of-type(1){max-width:3rem}mat-table.data-table-with-position[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:last-of-type, mat-table.data-table-with-position[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:last-of-type{max-width:3.5rem}mat-table.data-table-with-position[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:not(:first-of-type):not(:last-of-type), mat-table.data-table-with-position[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:not(:first-of-type):not(:last-of-type){padding:0 .25rem}mat-table.data-table-with-position[_ngcontent-%COMP%] .cdk-column-reason[_ngcontent-%COMP%]{flex:2}mat-table.data-table-with-position[_ngcontent-%COMP%] .cdk-column-reason[_ngcontent-%COMP%] .reason-cell[_ngcontent-%COMP%]{white-space:normal;word-break:break-word}.dialog-intro[_ngcontent-%COMP%]{margin:0 0 .5rem}.dialog-summary[_ngcontent-%COMP%]{margin-bottom:.75rem;font-size:.85rem}.dialog-summary[_ngcontent-%COMP%] .summary-item[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem}.dialog-summary[_ngcontent-%COMP%] .legend-dot[_ngcontent-%COMP%]{display:inline-block;width:.9rem;height:.9rem;border-radius:50%}.dialog-summary[_ngcontent-%COMP%] .legend-dot.editable[_ngcontent-%COMP%]{background:#fc0}.dialog-summary[_ngcontent-%COMP%] .legend-dot.failed[_ngcontent-%COMP%]{background:#7b0000ae}.dialog-summary[_ngcontent-%COMP%] .legend-icon[_ngcontent-%COMP%]{width:1.1rem;height:1.1rem;font-size:1.1rem;vertical-align:middle}.import-note[_ngcontent-%COMP%]{margin:0 0 .5rem;font-style:italic}.invalid-transfers-details[_ngcontent-%COMP%]{padding:.5rem 0 .5rem .5rem;border:1px solid lightgrey}.invalid-transfers-details[_ngcontent-%COMP%] .group[_ngcontent-%COMP%]{padding:.2rem .3rem;margin-bottom:.2rem}.invalid[_ngcontent-%COMP%]{background:#fc0}.invalid.highlighted[_ngcontent-%COMP%]{border-left:solid 10px #d78c12}.failed[_ngcontent-%COMP%]{background:#7b0000ae}.failed.highlighted[_ngcontent-%COMP%]{border-left:solid 10px #b71619}.flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-row-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:wrap}.justify-center[_ngcontent-%COMP%]{justify-content:center}.justify-end[_ngcontent-%COMP%]{justify-content:flex-end}.items-center[_ngcontent-%COMP%]{align-items:center}.gap-15rem[_ngcontent-%COMP%]{gap:1.5rem}"]})}}return t})();var Lp=5,da={replaceCharsDialogTitle:"Potwierdzenie zamiany znak\xF3w",invali
1dChars:t=>`Plik zawiera nieprawid\u0142owe znaki: ${t}. 2 3Je\u017Celi chcesz kontynuowa\u0107, znaki te zostan\u0105 zamienione na spacje. Czy chcesz kontynuowa\u0107?`,encodingHint:t=>Vp(t)>Lp?"Mog\u0142o zosta\u0107 wybrane nieprawid\u0142owe kodowanie pliku - zmie\u0144 je i spr\xF3buj ponownie.":""};function Vp(t){return t.replace(/\s/g,"").length}var In=(()=>{class t{constructor(){this.dialog=v(fe),this.transferImportService=v(Ti)}uploadWithConfirmations(e,i,n){return this.transferImportService.uploadFile(e,i,!1,n).pipe(y(l=>this.resolveInvalidChars(e,i,l,n)))}resolveInvalidChars(e,i,n,l){if(!this.hasMessage(n.invalidChars))return z(n);let h=new X;return h.data={title:da.replaceCharsDialogTitle,message:da.invalidChars(n.invalidChars),hint:da.encodingHint(n.invalidChars)},h.disableClose=!0,this.dialog.open(Ee,h).afterClosed().pipe(y(D=>D.state?this.transferImportService.uploadFile(e,i,!0,l):Be))}hasMessage(e){return e!=null&&e.length>0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();function Gp(t,r){if(t&1&&(a(0,"mat-option",4),c(1),o()),t&2){let e=r.$implicit;p("value",e.viewValue),s(),g(e.viewValue)}}function Wp(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function Hp(t,r){if(t&1&&(a(0,"mat-checkbox",5),c(1," Sprawd\u017C rachunek w wykazie podatnik\xF3w VAT "),o()),t&2){let e=d();p("formControl",e.whiteListCheckBoxCheckedFC)("disabled",e.whiteListCheckBoxDisabled)}}function $p(t,r){t&1&&(a(0,"div",6)(1,"p"),c(2,"- importowane przelewy VAT - zostan\u0105 zweryfikowane automatycznie"),o(),a(3,"p"),c(4,"- importowane przelewy VAT, kt\xF3rych identyfikatorem jest PESEL nie b\u0119d\u0105 weryfikowane"),o(),a(5,"p"),c(6,"- importowane przelewy zwyk\u0142e - weryfikacja VAT poprzez r\u0119czn\u0105 edycj\u0119 po operacji importowania"),o()())}function qp(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function Zp(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function Qp(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function Kp(t,r){if(t&1&&(a(0,"div")(1,"mat-form-field",10)(2,"mat-label"),c(3,"Data ost. realizacji"),o(),C(4,"input",16)(5,"mat-datepicker-toggle",12)(6,"mat-datepicker",null,1),a(8,"mat-error"),u(9,Qp,2,0,"span"),o()()()),t&2){let e=re(7),i=d();s(4),p("formControl",i.lastExecutionDateFC)("matDatepicker",e)("min",i.minDate),s(),p("for",e),s(4),f(i.lastExecutionDateFC.hasError("required")?9:-1)}}function Yp(t,r){if(t&1&&(a(0,"mat-option",4),c(1),o()),t&2){let e=r.$implicit;p("value",e.id),s(),U(" ",e.name," ")}}function Xp(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}var Hl=(()=>{class t{constructor(e,i,n,l,h,D,R,se,le,de,Re,Ne){this.dialogRef=e,this.notificationService=i,this.accountService=n,this.transferImportService=l,this.transferUploadConfirmationService=h,this.errorProviderService=D,this.data=R,this.dialog=se,this.actionButtonsPanelService=le,this.whiteListFacadeService=de,this.whiteListService=Re,this.progressBarService=Ne,this.CharsetType=$n,this.ImportMode=Kt,this.FunctionalAuthority=Q,this.chargeableAccounts=[],this.bundles=[],this.isSpinnerActive=!1,this.ButtonLabels=Qe,this.whiteListCheckBoxDisabled=!0,this.importModeSubscription=new Pr,this.transferSummary={},this.importedQuantity=0,this.MAX_FILE_SIZE_IN_MB=5,this.charsetFC=new A("",[xe.required]),this.importModeFC=new A("",[xe.required]),this.newBundleNameFC=new A("",[xe.required]),this.executionDateFC=new A("",[xe.required]),this.lastExecutionDateFC=new A(""),this.sourceAccountFC=new A(""),this.existingBundleNameFC=new A("",[xe.required]),this.whiteListCheckBoxCheckedFC=new A(!1),this.newBundleFG=new ki({newBundleName:this.newBundleNameFC,executionDate:this.executionDateFC,lastExecutionDate:this.lastExecutionDateFC,sourceAccountId:this.sourceAccountFC}),this.transferImportFG=new ki({charset:this.charsetFC,whiteListCheckBoxChecked:this.whiteListCheckBoxCheckedFC,newBundle:this.newBundleFG,existingBundleName:this.existingBundleNameFC}),this.minDate=rs(new Date),this.acceptedFileExtensions=$o(this.data.transferFileType)}ngOnInit(){this.updateChargeableAccounts(),this.observeImportMode(),this.bundles=this.getBundlesWithoutImportedAndVirtual(),this.patchInitialValues(),this.markAllAsTouched(),this.checkWhiteListPermission()}cancel(){this.dialogRef.close(!1)}reset(){this.transferImportFG.reset()}importFile(e){let l=e.target.files.item(0);if(l)if(this.isProperFileSize(l)){this.isSpinnerActive=!0;let h=l.name;this.transferUploadConfirmationService.uploadWithConfirmations(l,this.charsetFC.value,this.data.transferFileType).pipe(S(()=>this.progressBarService.showProgressBar(E.DEFAULT_REQUEST_PROCESSING)),y(()=>this.importBundleMode(h)),S(D=>this.transferSummary=D),y(()=>this.transferImportService.getInvalidDispositions()),y(D=>D&&D?.length>0?(this.progressBarService.hideProgressBar(),this.openInvalidEditWindow(D)):(this.importedQuantity=this.transferSummary.totalCount,this.transferImportService.saveImportTransfers(!0,this.whiteListCheckBoxCheckedFC.value))),y(D=>this.whiteListCheckBoxCheckedFC.value?this.whiteListService.checkList(D):z(!0)),S(()=>{this.notificationService.success(`Pomy\u015Blnie zaimportowano ${this.importedQuantity} pozycji`),this.dialogRef.close(!0)}),this.errorProviderService.processError(E.SAVING_ERROR),ee(()=>{this.progressBarService.hideProgressBar(),this.isSpinnerActive=!1})).subscribe()}else this.notificationService.error(E.UPLOADED_FILE_TOO_LARGE)}importAction(){this.actionButtonsPanelService.emitClickAction()}ngOnDestroy(){this.importModeSubscription?.unsubscribe()}updateChargeableAccounts(){this.accountService.getChargeableAccounts().pipe(this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([]))).subscribe(e=>this.chargeableAccounts=e)}observeImportMode(){this.importModeSubscription=this.importModeFC.valueChanges.subscribe(e=>{switch(e){case Kt.NEW_BUNDLE:{this.newBundleFG.enable(),this.existingBundleNameFC.disable();break}case Kt.EXISTING_BUNDLE:{this.existingBundleNameFC.enable(),this.newBundleFG.disable();break}case Kt.WITHOUT_BUNDLE:{this.existingBundleNameFC.disable(),this.newBundleFG.disable();break}default:{this.notificationService.error("Wybierz jedn\u0105 opcj\u0119 wyszukiwania");break}}})}importBundleMode(e){let i=this.transferImportService.prepareTransferImportRequest
3(this.data.transferFileType,this.charsetFC.value,e);switch(this.importModeFC.value){case Kt.NEW_BUNDLE:return i.bundleData=this.transferImportService.prepareBundleCreateRequest(!1,Me.formatDate(this.executionDateFC.value),this.lastExecutionDateFC.value?Me.formatDate(this.lastExecutionDateFC.value):"",this.sourceAccountFC.value,this.newBundleNameFC.value),this.transferImportService.importNewBundle(i);case Kt.EXISTING_BUNDLE:return this.transferImportService.importToBundle(this.existingBundleNameFC.value,i);case Kt.WITHOUT_BUNDLE:return this.transferImportService.importNoBundle(i);default:return z()}}getBundlesWithoutImportedAndVirtual(){return this.data.bundles.filter(e=>!e.virtual&&!e.imported)??[]}openInvalidEditWindow(e){let i=new X;return i.data={title:"Importowane dyspozycje",details:{dispositions:e,summary:this.transferSummary}},i.disableClose=!0,i.panelClass=Ce.LARGE,this.dialog.open(Vl,i).afterClosed().pipe(y(l=>{if(l.isConfirm){let h=this.transferSummary;return this.importedQuantity=l.isValidOnly?h.totalCount-(h.failedCount+h.invalidCount):h.totalCount,this.transferImportService.saveImportTransfers(l.isValidOnly,this.whiteListCheckBoxCheckedFC.value)}else return Be}))}markAllAsTouched(){this.newBundleFG.markAllAsTouched(),this.transferImportFG.markAllAsTouched()}patchInitialValues(){this.charsetFC.patchValue($n.WINDOWS_1250),this.executionDateFC.patchValue(this.minDate),this.data.selectedBundle&&this.bundles.includes(this.data.selectedBundle)?(this.existingBundleNameFC.patchValue(this.data.selectedBundle.id),this.importModeFC.patchValue(Kt.EXISTING_BUNDLE)):this.importModeFC.patchValue(Kt.NEW_BUNDLE)}checkWhiteListPermission(){this.whiteListFacadeService.isWhiteListEnabled().subscribe(e=>this.whiteListCheckBoxDisabled=!e)}isProperFileSize(e){return e.size<=this.MAX_FILE_SIZE_IN_MB*1024*1024}static{this.\u0275fac=function(i){return new(i||t)(_(ye),_(K),_(Jt),_(Ti),_(In),_(Y),_(Ae),_(fe),_(Wo),_(rl),_(ea),_(ml))}}static{this.\u0275cmp=x({type:t,selectors:[["app-transfer-import-dialog"]],standalone:!1,decls:57,vars:30,consts:[["executionPicker",""],["lastExecutionDatePicker",""],["appearance","outline",1,"flex-fill"],[3,"formControl"],[3,"value"],[3,"formControl","disabled"],[2,"margin-top","10px"],[1,"flex-col","gap-10"],["autocomplete","off","matInput","",3,"formControl"],[1,"flex-row","gap-5"],["appearance","outline"],["autocomplete","off","matInput","","readonly","",3,"formControl","matDatepicker","min"],["matSuffix","",3,"for"],[4,"appShowIfHasAuthority"],["fieldLabel","Rachunek \u017Ar\xF3d\u0142owy",3,"sourceAccountFC","accountList"],[3,"cancelAction","resetAction","confirmAction","importFileAction","loading","confirmDisabled","withImportAction","buttonLabelConfirm","acceptedFileExtensions"],["autocomplete","off","matInput","",3,"formControl","matDatepicker","min"]],template:function(i,n){if(i&1&&(a(0,"app-dialog-container")(1,"app-dialog-header"),c(2,"Import przelew\xF3w"),o(),a(3,"app-dialog-content")(4,"app-dialog-section")(5,"app-dialog-section-header"),c(6,"Kodowanie znak\xF3w"),o(),a(7,"mat-form-field",2)(8,"mat-label"),c(9,"Kodowanie znak\xF3w"),o(),a(10,"mat-select",3),ne(11,Gp,2,2,"mat-option",4,jt),T(13,"enumToArray"),o(),a(14,"mat-error"),u(15,Wp,2,0,"span"),o()(),u(16,Hp,2,2,"mat-checkbox",5),u(17,$p,7,0,"div",6),o(),a(18,"app-dialog-section")(19,"app-dialog-section-header"),c(20,"Wybierz tryb"),o(),a(21,"mat-radio-group",3)(22,"div",7)(23,"mat-radio-button",4),c(24),o(),a(25,"mat-form-field",2)(26,"mat-label"),c(27,"Nazwa paczki"),o(),C(28,"input",8),a(29,"mat-error"),u(30,qp,2,0,"span"),o()(),a(31,"div",9)(32,"mat-form-field",10)(33,"mat-label"),c(34,"Data wykonania"),o(),C(35,"input",11)(36,"mat-datepicker-toggle",12)(37,"mat-datepicker",null,0),a(39,"mat-error"),u(40,Zp,2,0,"span"),o()(),Z(41,Kp,10,5,"div",13),o(),C(42,"app-source-account-input",14),o(),a(43,"div",7)(44,"mat-radio-button",4),c(45),o(),a(46,"mat-form-field",2)(47,"mat-label"),c(48,"Nazwa paczki"),o(),a(49,"mat-select",3),ne(50,Yp,2,2,"mat-option",4,jt),o(),a(52,"mat-error"),u(53,Xp,2,0,"span"),o()()(),a(54,"mat-radio-button",4),c(55),o()()()(),a(56,"app-action-buttons-panel",15),m("cancelAction",function(){return n.cancel()})("resetAction",function(){return n.reset()})("confirmAction",function(){return n.importAction()})("importFileAction",function(h){return n.importFile(h)}),o()()),i&2){let l=re(38);s(10),p("formControl",n.charsetFC),s(),oe(B(13,28,n.CharsetType)),s(4),f(n.charsetFC.hasError("required")?15:-1),s(),f(n.whiteListCheckBoxDisabled?-1:16),s(),f(n.whiteListCheckBoxCheckedFC.value?17:-1),s(4),p("formControl",n.importModeFC),s(2),p("value",n.ImportMode.NEW_BUNDLE),s(),g(n.ImportMode.NEW_BUNDLE),s(4),p("formControl",n.newBundleNameFC),s(2),f(n.newBundleNameFC.hasError("required")?30:-1),s(5),p("formControl",n.executionDateFC)("matDatepicker",l)("min",n.minDate),s(),p("for",l),s(4),f(n.executionDateFC.hasError("required")?40:-1),s(),p("appShowIfHasAuthority",n.FunctionalAuthority.FUNC_MLYNEK),s(),p("sourceAccountFC",n.sourceAccountFC)("accountList",n.chargeableAccounts),s(2),p("value",n.ImportMode.EXISTING_BUNDLE),s(),g(n.ImportMode.EXISTING_BUNDLE),s(4),p("formControl",n.existingBundleNameFC),s(),oe(n.bundles),s(3),f(n.existingBundleNameFC.hasError("required")?53:-1),s(),p("value",n.ImportMode.WITHOUT_BUNDLE),s(),g(n.ImportMode.WITHOUT_BUNDLE),s(),p("loading",n.isSpinnerActive)("confirmDisabled",n.transferImportFG.invali
3d)("withImportAction",!0)("buttonLabelConfirm",n.ButtonLabels.IMPORT)("acceptedFileExtensions",n.acceptedFileExtensions)}},dependencies:[be,Ie,$t,St,nn,rn,xt,Dt,Tt,Se,Vs,js,on,ve,De,Ve,Qo,Ke,Ye,Xe,pn,Go,We,mt,gl],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}",".flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}",".gap-5[_ngcontent-%COMP%]{gap:5px}",".gap-10[_ngcontent-%COMP%]{gap:10px}",".flex-fill[_ngcontent-%COMP%]{flex:1 1 100%;box-sizing:border-box;width:100%;min-width:0;min-height:0}"]})}}return t})();function Jp(t,r){t&1&&(a(0,"span"),c(1,"Nazwa paczki jest wymagana"),o())}var $l=(()=>{class t{constructor(e,i,n,l,h,D,R){this.dialogRef=e,this.notificationService=i,this.transferImportService=n,this.transferUploadConfirmationService=l,this.data=h,this.actionButtonsPanelService=D,this.errorProviderService=R,this.NAME_MAX_LENGTH=35,this.isSpinnerActive=!1,this.ButtonLabels=Qe,this.MAX_FILE_SIZE_IN_MB=5,this.defaultEconding=$n.WINDOWS_1250,this.importSummary={totalCount:0,invalidCount:0,failedCount:0,hasWrongLengthAppeared:!1},this.bundleNameFC=new A("",[xe.required,xe.maxLength(this.NAME_MAX_LENGTH)]),this.acceptedFileExtensions=$o(this.data.transferFileType)}cancel(){this.dialogRef.close(!1)}importFile(e){let l=e.target.files.item(0);if(l)if(this.isProperFileSize(l)){this.isSpinnerActive=!0;let h=l.name;this.transferUploadConfirmationService.uploadWithConfirmations(l,this.defaultEconding,this.data.transferFileType).pipe(y(()=>this.importBundleMode(h)),y(()=>this.transferImportService.getInvalidDispositions()),y(()=>this.transferImportService.saveImportTransfers(!0,!1)),S(()=>{this.showNotification()}),S(()=>{this.dialogRef.close(!0)}),this.errorProviderService.processError(E.SAVING_ERROR),ee(()=>this.isSpinnerActive=!1)).subscribe()}else this.notificationService.error(E.UPLOADED_FILE_TOO_LARGE)}importBundleMode(e){let i=this.transferImportService.prepareTransferImportRequest(this.data.transferFileType,this.defaultEconding,e);return i.bundleData={name:this.bundleNameFC.value},this.transferImportService.importSalaryBundle(i).pipe(S(n=>this.importSummary=n))}importAction(){this.actionButtonsPanelService.emitClickAction()}showNotification(){let{failedCount:e,invalidCount:i,totalCount:n}=this.importSummary;if(e===0&&i===0)this.notificationService.success(`${E.SAVING_SUCCESS}. Dodano ${n} dyspozycji`);else{let l={title:"Import",component:new Bo(bl,{successCount:n-i,invalidCount:i})};this.notificationService.warningWithHTML(l)}}isProperFileSize(e){return e.size<=this.MAX_FILE_SIZE_IN_MB*1024*1024}static{this.\u0275fac=function(i){return new(i||t)(_(ye),_(K),_(Ti),_(In),_(Ae),_(Wo),_(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-transfer-salary-import-dialog"]],standalone:!1,decls:14,vars:9,consts:[["appearance","outline",1,"flex-fill"],["autocomplete","off","appConfirmOnEnter","","matInput","","required","",3,"formControl","maxlength"],[3,"cancelAction","confirmAction","importFileAction","confirmDisabled","withResetButton","loading","withImportAction","buttonLabelConfirm","acceptedFileExtensions"]],template:function(i,n){i&1&&(a(0,"app-dialog-container")(1,"app-dialog-header"),c(2,"Import przelew\xF3w p\u0142acowych"),o(),a(3,"app-dialog-content")(4,"app-dialog-section")(5,"app-dialog-section-header"),c(6,"Import z lokalnego pliku tekstowego"),o(),a(7,"mat-form-field",0)(8,"mat-label"),c(9,"Nazwa paczki"),o(),C(10,"input",1),a(11,"mat-error"),u(12,Jp,2,0,"span"),o()()()(),a(13,"a
3pp-action-buttons-panel",2),m("cancelAction",function(){return n.cancel()})("confirmAction",function(){return n.importAction()})("importFileAction",function(h){return n.importFile(h)}),o()()),i&2&&(s(10),p("formControl",n.bundleNameFC)("maxlength",n.NAME_MAX_LENGTH),s(2),f(n.bundleNameFC.hasError("required")?12:-1),s(),p("confirmDisabled",n.bundleNameFC.invalid)("withResetButton",!1)("loading",n.isSpinnerActive)("withImportAction",!0)("buttonLabelConfirm",n.ButtonLabels.IMPORT)("acceptedFileExtensions",n.acceptedFileExtensions))},dependencies:[be,Ie,$t,Se,ve,De,Zi,Qi,Ve,Ys,Ke,Ye,Xe,pn,Go,mt],styles:[".flex-fill[_ngcontent-%COMP%]{flex:1 1 100%;box-sizing:border-box;width:100%;min-width:0;min-height:0}"]})}}return t})();var ed=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isAutomaticRenewal","isCapitalizationOfInterest","isInterestRate","isDocumentNumber"],td=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isInterestRate","isDocumentNumber"],id=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isOperator","isTelephoneNumber","isReferenceNumber"],nd=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isAutomaticRenewal","isCapitalizationOfInterest","isInterestRate","isMaturityDate"],od=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isDoEvery","isContent"],ad=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent","isDocumentNumber","isWhiteList"],rd=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent","isDocumentNumber","isWhiteList"],sd=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent","isDocumentNumber"],ld=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent"],cd=["isDateOfExecution","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isWhiteList"],ql=(()=>{class t{constructor(){this.isAccountNumber=!1,this.isDateOfExecution=!1,this.isCreatedBy=!1,this.isCreatedAt=!1,this.isModifiedBy=!1,this.isModifiedAt=!1,this.isDoEvery=!1,this.isContent=!1,this.isAutomaticRenewal=!1,this.isCapitalizationOfInterest=!1,this.isInterestRate=!1,this.isMaturityDate=!1,this.isOperator=!1,this.isReferenceNumber=!1,this.isDocumentNumber=!1,this.isRejectionDescription=!1,this.isWhiteList=!1,this.operator="",this.phoneNumber="",this.referenceNumber="",this.intervalWithUnit=""}prepareBundleExecuteDetails(e,i){return this.setDetailsConfiguration(e),this.fetchSingleSelectedDetails(e,i)}setDetailsConfiguration(e){switch(this.resetDetails(),e.virtual?e.dispositions[0].type:e.type){case W.LOKATA_ZALOZENIE:this.setDetailsVisible(ed);break;case W.LOKATA_ZERWANIE:this.setDetailsVisible(td);break;case W.LOKATA_MODYFIKACJA:this.setDetailsVisible(nd);break;case W.ZLECENIE_STALE_ZALOZENIE:this.setDetailsVisible(od),this.intervalWithUnit=_r.getPeriodDescription(_r.calculateAmountOfDays(e.interval,e.intervalUnit));break;case W.DOLADOWANIE_GSM:this.setDetailsVisible(id);let n=e.title.split(":");this.phoneNumber=n[1].slice(0,-2),this.operator=n[2].slice(0,-2),this.referenceNumber=n[3];break;case W.PRZELEW_VAT:this.setDetailsVisible(ad);break;case W.PRZELEW_ZWYKLY:this.setDetailsVisible(rd);break;case W.PRZELEW_US:this.setDetailsVisible(sd);break;case W.PRZELEW_ZAGRANICZNY:this.setDetailsVisible(ld);break;case yn.TRANSFER:this.setDetailsVisible(cd);break}e.state===pe.REJECTED&&(this.isRejectionDescription=!0)}resetDetails(){this.isAccountNumber=!1,this.isDateOfExecution=!1,this.isCreatedBy=!1,this.isCreatedAt=!1,this.isModifiedBy=!1,this.isModifiedAt=!1,this.isDoEvery=!1,this.isContent=!1,this.isAutomaticRenewal=!1,this.isCapitalizationOfInterest=!1,this.isInterestRate=!1,this.isMaturityDate=!1,this.isOperator=!1,this.isReferenceNumber=!1,this.isDocumentNumber=!1,this.isRejectionDescription=!1,this.isWhiteList=!1}setDetailsVisible(e){e.forEach(i=>{this[i]=!0})}fetchSingleSelectedDetails(e,i){let n=[];if(this.isAccountNumber&&n.push(new Fe().leftCell({name:"Rachunek \u017Ar\xF3d\u0142owy",value:i},J)),this.isDateOfExecution&&n.push(new Fe().leftCell({name:"Data wykonania",value:e.dateOfExecution},ae,[H])),this.isCreatedBy&&this.isCreatedAt&&n.push(new Fe().leftCell({name:"Utworzony przez",value:e.createdBy}).rightCell({name:"Data utworzenia",value:e.createdAt},ae,[Qa])),this.isModifiedBy&&this.isModifiedAt&&n.push(new Fe().leftCell({name:"Zmodyfikowany przez",value:e.modifiedBy}).rightCell({name:"Data modyfikacji",value:e.modifiedAt},ae,[Qa])),this.isWhiteList&&n.push(this.getWhiteListState(e)),this.isDoEvery&&n.push(new Fe().leftCell({name:"Wykonaj co",value:this.intervalWithUnit})),this.isContent){let l=M.isVirtualBundle(e)?e.dispositions[0].title:e.title;n.push(new Fe().leftCell({name:"Tre\u015B\u0107",value:l}))}if(this.isAutomaticRenewal&&n.push(new Fe().leftCell({name:"Automatyczne odnawianie",value:e.automaticRenewal},fr)),this.isCapitalizationOfInterest&&n.push(new Fe().leftCell({name:"Kapitalizacja odsetek",value:e.capitalizationOfInterest},fr)),this.isInterestRate&&n.push(new Fe().leftCell({name:"Oprocentowanie",value:e.depositPattern.percentage},$,["%"])),this.isMaturityDate&&n.push(new Fe().leftCell({name:"Data zapadalno\u015Bci",value:e.maturityDate})),this.isOperator&&n.push(new Fe().leftCell({name:"Operator",value:this.operator}).rightCell({name:"Telefon",value:this.phoneNumber})),this.isReferenceNumber&&n.push(new Fe().leftCell({name:"Numer referencyjny",value:this.referenceNumber})),e.settlementDate&&n.push(new Fe().leftCell({name:"Zaksi\u0119gowana",value:e.settlementDate})),this.isDocumentNumber){let l=M.isVirtualBundle(e)?e.dispositions[0]?.documentNumber:e.documentNumber;n.push(new Fe().leftCell({name:"Nr dokumentu",value:l}))}return this.isRejectionDescription&&n.push(new Fe().leftCell({name:"Pow\xF3d odrzucenia",value:e.description})),n}getWhiteListState(e){let i=M.isVirtualBundle(e)?e?.dispositions[0].whiteListVerificationState:e?.whiteListVerificationState;return new Fe().leftCell({name:"Status weryfikacji VAT",value:i},cl)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var md=["chosenElementsTreeTable"],Zl=(()=>{class t{constructor(e,i,n,l,h,D,R,se){this.dialogRef=e,this.data=i,this.executionsService=n,this.notificationService=l,this.dialog=h,this.errorProviderService=D,this.executionDetail
3sService=R,this.spinnerService=se,this.selectedExecutions=[],this.details=new xi,this.loading=!1,this.isPrintButtonDisabled=!0,this.EXECUTE_DATE="dateOfExecution",this.ERROR_MESSAGE="Nie mo\u017Cna wykona\u0107 ponownie wybranej dyspozycji / paczki",this.SUCCESS_MESSAGE="Operacja zako\u0144czona pomy\u015Blnie",this.chosenElementsTableProperties={columnSettings:[{column:"type",caption:"Typ",stylePipeToken:yi,stylePipeArgs:[],styleProp:"whiteListVerificationState",styleClass:"bold red",pipeToken:kt,alternativeDataSource:{whenShouldUseAlternativeValue:le=>M.isBundle(le),getAlternativeValue(le){return le.name}},headerClass:"x-center at-cell-margin-right",cellClass:"x-start at-cell-margin-right"},{column:"targetAccount",caption:"Rachunek beneficjenta",pipeToken:J,styleProperties:[{attribute:"min-width",value:"13rem"},{attribute:"max-width",value:"13rem"}],cellClass:"x-start "},{column:"amount",caption:"Kwota / Suma",pipeToken:$,pipeArgs:["row.currency"],cellClass:"x-end",styleProperties:[{attribute:"min-width",value:"9rem"},{attribute:"max-width",value:"9rem"}]},{column:"name",caption:"Nazwa",styleProperties:[{attribute:"min-width",value:"17rem"},{attribute:"max-width",value:"17rem"}],alternativeDataSource:{whenShouldUseAlternativeValue:le=>M.isBundle(le),getAlternativeValue:()=>"-"},cellClass:"x-start"},{column:"state",caption:"Stan",pipeToken:Jo,pipeArgs:[!0,"row.virtual","row.dispositions"]},{column:this.EXECUTE_DATE,caption:"Data wykonania",pipeToken:ae,pipeArgs:[H],styleProperties:[{attribute:"min-width",value:"6rem"},{attribute:"max-width",value:"6rem"}]}],arrayHoldingProp:"dispositions",arrayHoldingPropCount:"dispositionsAmount",matSortActive:this.EXECUTE_DATE,matSortDirection:"asc",matSortDisableClear:!0,sortParentId:"id",sortParents:!0,sortChildren:!0,tableClasses:"mat-elevation-z0",collapseBy:"id"},this.displayedColumns=["executionType","targetAccount","amount","name","status",this.EXECUTE_DATE]}ngOnInit(){let e=M.mapBundlesToIdList(this.data.details);this.loadBundlesWithDispositions(e)}receiveRowClickEvent(){this.selectedExecutions=this.chosenElementsTreeTable.selection.selected,this.isPrintButtonDisabled=!0,this.selectedExecutions.length===1?(this.resolveSingleSelection(this.selectedExecutions[0]),this.checkPrintButtonDisabled(this.selectedExecutions[0])):this.selectedExecutions.length>1?this.resolveMultiSelection(this.selectedExecutions):(this.chosenElementsTreeTable.selection.clear(),this.chosenElementsTreeTable.collapseRows())}printExecution(){let e=this.selectedExecutions[0];this.isBundle(e)?this.executionsService.openExecutionForBundle(e.id):this.executionsService.openExecutionForDisposition(e.id)}checkExecution(){let e=this.selectedExecutions.some(l=>l.hasOwnProperty("bundleId")&&!l.virtual),i=this.selectedExecutions.some(l=>l.virtual===!0),n=this.selectedExecutions.some(l=>!l.hasOwnProperty("bundleId"));(n||i)&&e?this.notificationService.error("Wybierz jeden typ element\xF3w do wykonania ponownie"):this.askAboutConfirmationDialog().pipe(y(l=>l?(this.showSpinner(!0),this.reExecute(e,i,n)):z(!1))).subscribe()}isDisabled(){return this.selectedExecutions?.length===0}resolveSingleSelection(e){this.isBundle(e)?this.fetchBundleDetailsForSelected(e.id):this.fetchDispositionDetailsForSelected(e)}isBundle(e){return!e.hasOwnProperty("bundleId")}fetchBundleDetailsForSelected(e){this.executionsService.getDetailsForBundle(e).pipe(S(i=>{this.setDispositionNameData(i),this.details.rows=this.executionDetail
3sService.prepareBundleExecuteDetails(i,this.chosenElementsTreeTable.selection.selected[0].sourceAccount)})).subscribe()}setDispositionNameData(e){e.dispositions.forEach(i=>{i.sourceAccount=e.sourceAccount,i.name=i.name1+" "+i.name2})}fetchDispositionDetailsForSelected(e){this.executionsService.getDetailsForDisposition(e.id).pipe(S(i=>{this.details.rows=this.executionDetailsService.prepareBundleExecuteDetails(i,this.chosenElementsTreeTable.selection.selected[0].sourceAccount)})).subscribe()}resolveMultiSelection(e){let i=[],n=[];e.forEach(h=>h.hasOwnProperty("bundleId")&&!h.virtual?n.push(h.id):i.push(h.id));let l={tableConfig:this.chosenElementsTableProperties,tableService:this.chosenElementsTreeTable.treeTableService};this.details.rows=Pt.prepareBundleSummary(ta.calculate(e,l),e.length)}reExecute(e,i,n){return this.executionsService.executeAgain(this.selectedExecutions,e,i,n).pipe(S(()=>{this.notificationService.success(this.SUCCESS_MESSAGE)}),this.errorProviderService.processError(this.ERROR_MESSAGE,z(!1)),ee(()=>{this.showSpinner(!1)}))}askAboutConfirmationDialog(){let e=new X;return e.data={title:"Potwierd\u017A operacj\u0119",message:"Czy na pewno chcesz ponownie wykona\u0107 zaznaczone elementy?"},this.dialog.open(Ee,e).afterClosed().pipe(L(i=>i.state))}loadBundlesWithDispositions(e){this.executionsService.getBundlesDetails(e).pipe(S(i=>{i||this.notificationService.default(E.NO_DETAILS_FOR_SELECTED_EXECUTION),this.setDefaultDispositionsStateIfNull(i),this.chosenElementsTreeTable.setDataSourceData(M.mapVirtualBundles(i,!0)),this.chosenElementsTreeTable.collapseRows()}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([]))).subscribe()}setDefaultDispositionsStateIfNull(e){e.forEach(i=>i.dispositions.forEach(n=>n.state=n.state||pl.NEW))}checkPrintButtonDisabled(e){let i=e.type;this.isPrintButtonDisabled=!([W.PRZELEW_ZAGRANICZNY,W.PRZELEW_ZWYKLY,W.PRZELEW_VAT,W.PRZELEW_US,W.DOLADOWANIE_GSM,yn.TRANSFER].includes(i)&&e.virtual!==void 0&&e.state!=pe.AWAITS),e.type===W.LOKATA_ZALOZENIE&&e.state===pe.COMPLETED&&(this.isPrintButtonDisabled=!1)}showSpinner(e){this.loading=e,e?this.spinnerService.showSpinner():this.spinnerService.hide
3Spinner()}static{this.\u0275fac=function(i){return new(i||t)(_(ye),_(Ae),_(ia),_(K),_(fe),_(Y),_(ql),_(nt))}}static{this.\u0275cmp=x({type:t,selectors:[["app-execution-details-dialog"]],viewQuery:function(i,n){if(i&1&&et(md,5),i&2){let l;me(l=ue())&&(n.chosenElementsTreeTable=l.first)}},standalone:!1,features:[Ut([J])],decls:19,vars:6,consts:[["chosenElementsTreeTable",""],[3,"clickAction","disabled","loading"],["mainButtonName","Wydruk","icon","print",3,"disabled"],["icon","open_in_browser",3,"clickAction"],[3,"rowClickEventIndicator","tableProperties"],["appDialogDetails","","expanded","true",1,"mat-elevation-z3","flex-col"],[1,"subheader"],[3,"details","areDetailsVisible"]],template:function(i,n){i&1&&(a(0,"app-dialog-container"),C(1,"app-close-icon-button"),a(2,"app-dialog-header"),c(3,"Szczeg\xF3\u0142y wybranych paczek / dyspozycji"),o(),a(4,"app-dialog-content")(5,"app-dialog-btn-panel")(6,"app-button",1),m("clickAction",function(){return n.checkExecution()}),c(7," Wykonaj ponownie "),o(),a(8,"app-button-menu",2)(9,"app-menu-item-button",3),m("clickAction",function(){return n.printExecution()}),c(10," Otw\xF3rz "),o()()(),a(11,"sn-mat-tree-table",4,0),m("rowClickEventIndicator",function(){return n.receiveRowClickEvent()}),o(),a(13,"mat-expansion-panel",5)(14,"mat-expansion-panel-header")(15,"mat-panel-title")(16,"h3",6),c(17,"Szczeg\xF3\u0142y"),o()()(),C(18,"app-details",7),o()()()),i&2&&(s(6),p("disabled",n.isDisabled())("loading",n.loading),s(2),p("disabled",n.isPrintButtonDisabled),s(3),p("tableProperties",n.chosenElementsTableProperties),s(7),p("details",n.details)("areDetailsVisible",n.selectedExecutions.length>0))},dependencies:[yt,At,wt,Ke,Ye,Xe,Os,ks,Ot,je,ei,Yt,ul,Di],styles:[".flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}"]})}}return t})();var Ql=(()=>{class t{constructor(e,i,n,l){this.errorProviderService=e,this.gsmService=i,this.dialogRef=n,this.data=l,this.ButtonLabels=Qe,this.selectedId=this.data.details}discard(){this.dialogRef.close()}confirm(){this.gsmService.delete(this.selectedId).pipe(S(()=>this.dialogRef.close()),this.errorProviderService.processError(Ge.DIALOG_ERROR)).subscribe()}static{this.\u0275fac=function(i){return new(i||t)(_(Y),_(Ai),_(ye),_(Ae))}}static{this.\u0275cmp=x({type:t,selectors:[["app-gsm-boost-dialog"]],standalone:!1,decls:6,vars:6,consts:[[3,"cancelAction","confirmAction","withResetButton","focusConfirmInitially","buttonLabelCancel","buttonLabelConfirm"]],template:function(i,n){i&1&&(a(0,"app-dialog-container")(1,"app-dialog-header"),c(2),o(),a(3,"app-dialog-content"),c(4),o(),a(5,"app-action-buttons-panel",0),m("cancelAction",function(){return n.discard()})("confirmAction",function(){return n.confirm()}),o()()),i&2&&(s(2),g(n.data.title),s(2),g(n.data.message),s(),p("withResetButton",!1)("focusConfirmInitially",!0)("buttonLabelCancel",n.ButtonLabels.NO)("buttonLabelConfirm",n.ButtonLabels.YES))},dependencies:[Ke,Ye,Xe,mt],encapsulation:2})}}return t})();function ud(t,r){if(t&1&&(a(0,"mat-option",4),c(1),o()),t&2){let e=r.$implicit;p("value",e),s(),g(e.name)}}function fd(t,r){t&1&&(a(0,"span"),c(1,"Prosz\u0119 wybra\u0107 jeden z element\xF3w listy"),o())}function hd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["operator.empty"])}}function _d(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["operator.unknown"])}}function gd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["error.field.operator.not_found"])}}function vd(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function Cd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["telefon.format"])}}function bd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["telefon.format"])}}function Sd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["telefon.unknown"])}}function Ed(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["telefon.empty"])}}function xd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["telefon.inactive"])}}function Dd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["error.field.phone_number.wrong_format"])}}function Td(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["error.field.phone_number.inactive"])}}function yd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.ERRORS["error.field.phone_number.unknown"])}}function Ad(t,r){if(t&1&&(a(0,"p"),c(1),o()),t&2){let e=d(2);s(),te("Prosz\u0119 wprowadzi\u0107 kwot\u0119 bez groszy z zakresu od ",e.operatorsFC.value.minVal," do ",e.operatorsFC.value.maxVal)}}function wd(t,r){if(t&1&&(a(0,"div"),u(1,Ad,2,2,"p"),o()),t&2){let e=d();s(),f(e.operatorsFC.value.constVal?-1:1)}}function Id(t,r){if(t&1&&C(0,"app-amount-input",10),t&2){let e=d();p("amountFC",e.amountFC)}}function Md(t,r){if(t&1&&(a(0,"mat-option",4),c(1),T(2,"currencyFormatPipe"),o()),t&2){let e=r.$implicit;p("value",e),s(),U("",B(2,2,e)," ")}}function Pd(t,r){if(t&1&&(a(0,"mat-form-field",2)(1,"mat-label"),c(2,"Kwota"),o(),a(3,"mat-select",16)(4,"mat-option"),c(5,"--"),o(),ne(6,Md,3,4,"mat-option",4,jt),o(),a(8,"mat-error"),C(9,"app-amount-error",17),o()()),t&2){let e=d();s(3),p("formControl",e.amountFC),s(3),oe(e.constTopUpValue),s(3),p("amountFC",e.amountFC)}}function Od(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}var Kl=(()=>{class t{constructor(e,i,n,l,h,D){this._formBuilder=e,this.gsmBoostsService=i,this.accountService=n,this.dialogRef=l,this.errorProviderService=D,this.gsmOperators=[],this.constTopUpValue=[],this.chargeableAccounts=[],this.ButtonLabels=Qe,this.ERRORS=Gn,this.isConstValue=!1,this.operatorsFC=new A("",[xe.required]),this.phoneFC=new A("",[xe.required,zi.phoneValidator]),this.amountFC=new A("",[xe.required]),this.dateFC=new A({value:Nt(new Date,H),disabled:!0}),this.accountFC=new A("",[xe.required]),this.formFG=this._formBuilder.group({operators:this.operatorsFC,phone:this.phoneFC,amount:this.amountFC,date:this.dateFC,account:this.accountFC}),this.gsmData=h}ngOnInit(){this.operatorsSelectChanges$=this.manageOperatorsSelectChanges(),this.getOperator()}ngOnDestroy(){this.operatorsSelectChanges$.unsubscribe()}insertData(e){if(e){let i=this.chargeableAccounts.find(l=>l.accountNumber===e.sourceAccount),n=this.gsmOperators.find(l=>
3l.name.toLowerCase()===e.operatorName.toLowerCase());this.phoneFC.patchValue(this.gsmBoostsService.getPhoneNumber(e)),this.amountFC.patchValue(e.amount),this.accountFC.patchValue(i?.accountId||""),this.operatorsFC.patchValue(n)}else this.formFG.reset(),this.dateFC.reset(Nt(new Date,H));this.formFG.markAsTouched()}confirm(){this.formFG.markAllAsTouched();let e=this.gsmData?ys:Ts;this.gsmBoostsService.save(this.createTopUpRequest(),e).pipe(this.errorProviderService.processErrorWithLocalFormError(this),S(()=>this.close(!0))).subscribe()}cancel(){this.close(!1)}reset(){this.insertData(this.gsmData)}getFormGroup(){return this.formFG}getControlByProperty(e){switch(e){case"telefon":return this.phoneFC;case"kwota":return this.amountFC;case"operator":return this.operatorsFC;default:return null}}updateFormConfigByOperatorData(){this.amountFC.clearValidators(),this.amountFC.setValidators(xe.required),this.operatorsFC.value?.constVal===!0?this.constTopUpValue=this.operatorsFC.value?.constValList||[]:this.operatorsFC.value&&this.amountFC.setValidators([zi.min(this.amountFC,this.operatorsFC.value.minVal),zi.max(this.amountFC,this.operatorsFC.value.maxVal)])}manageOperatorsSelectChanges(){return this.operatorsFC.valueChanges.pipe(S(()=>{this.updateFormConfigByOperatorData(),this.updateConstVal()})).subscribe()}getOperator(){this.getOperators().pipe(y(()=>this.getChargeableAccounts()),ce(()=>!!this.gsmData),S(()=>this.insertData(this.gsmData))).subscribe()}close(e){this.dialogRef.close(e)}updateConstVal(){this.isConstValue=this.operatorsFC.value.constVal}getOperators(){return this.gsmBoostsService.getOperators().pipe(S(e=>this.gsmOperators=e))}getChargeableAccounts(){return this.accountService.getChargeableAccounts().pipe(S(e=>this.chargeableAccounts=e))}createTopUpRequest(){return{chargedAccountId:this.accountFC.value,operator:this.operatorsFC.value.name,date:this.dateFC.value,amount:this.amountFC.value,phoneNum:"48"+this.phoneFC.value,dispositionId:this.gsmData?.dispositions[0]?.id||void 0}}static{this.\u0275fac=function(i){return new(i||t)(_(Gt),_(Ai),_(Jt),_(ye),_(Ae),_(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-gsm-boosts-modal-window"]],standalone:!1,decls:51,vars:27,consts:[["picker",""],["mat-dialog-content","",1,"gap-10",3,"formGroup"],["appearance","outline",1,"flex-col"],["required","",3,"formControl"],[3,"value"],["appearance","outline","floatLabel","always",1,"flex-col"],["matPrefix","",2,"padding-left","5px"],["autocomplete","off","maxlength","9","type","tel","matInput","","required","","appOnlyNumbers","",3,"formControl"],[1,"flex-row","justify-between","items-end"],[1,"flex-60"],[1,"flex-col",3,"amountFC"],["appearance","outline"],["autocomplete","off","matInput","","readonly","",3,"formControl","matDatepicker"],["matSuffix","",3,"for"],[1,"flex-col",3,"sourceAccountFC","accountList"],[3,"cancelAction","resetAction","confirmAction","confirmDisabled","buttonLabelConfirm"],["required","",2,"text-align","right",3,"formControl"],[3,"amountFC"]],template:function(i,n){if(i&1&&(a(0,"app-dialog-container")(1,"app-dialog-header"),c(2,"Do\u0142adowanie GSM"),o(),a(3,"app-dialog-content")(4,"form",1)(5,"mat-form-field",2)(6,"mat-label"),c(7,"Operator"),o(),a(8,"mat-select",3)(9,"mat-option"),c(10,"--"),o(),ne(11,ud,2,2,"mat-option",4,jt),o(),a(13,"mat-error"),u(14,fd,2,0,"span"),u(15,hd,2,1,"span"),u(16,_d,2,1,"span"),u(17,gd,2,1,"span"),o()(),a(18,"mat-form-field",5)(19,"mat-label"),c(20,"Numer telefonu"),o(),a(21,"span",6),c(22,"+48"),o(),C(23,"input",7),a(24,"mat-error"),u(25,vd,2,0,"span"),u(26,Cd,2,1,"span"),u(27,bd,2,1,"span"),u(28,Sd,2,1,"span"),u(29,Ed,2,1,"span"),u(30,xd,2,1,"span"),u(31,Dd,2,1,"span"),u(32,Td,2,1,"span"),u(33,yd,2,1,"span"),o()(),a(34,"div",8)(35,"div",9),u(36,wd,2,1,"div"),u(37,Id,1,1,"app-amount-input",10),u(38,Pd,10,2,"mat-form-field",2),o(),a(39,"div")(40,"mat-form-field",11)(41,"mat-label"),c(42,"Data"),o(),C(43,"input",12)(44,"mat-datepicker-toggle",13)(45,"mat-datepicker",null,0),a(47,"mat-error"),u(48,Od,2,0,"span"),o()()()(),C(49,"app-source-account-input",14),o()(),a(50,"app-action-buttons-panel",15),m("cancelAction",function(){return n.cancel()})("resetAction",function(){return n.reset()})("confirmAction",function(){return n.confirm()}),o()()),i&2){let l=re(46);s(4),p("formGroup",n.formFG),s(4),p("formControl",n.operatorsFC),s(3),oe(n.gsmOperators),s(3),f(n.operatorsFC.hasError("required")?14:-1),s(),f(n.operatorsFC.hasError("operator.empty")?15:-1),s(),f(n.operatorsFC.hasError("operator.unknown")?16:-1),s(),f(n.operatorsFC.hasError("error.field.operator.not_found")?17:-1),s(6),p("formControl",n.phoneFC),s(2),f(n.phoneFC.hasError("required")?25:-1),s(),f(n.phoneFC.hasError("phoneFormat")?26:-1),s(),f(n.phoneFC.hasError("telefon.format")?27:-1),s(),f(n.phoneFC.hasError("telefon.unknown")?28:-1),s(),f(n.phoneFC.hasError("telefon.empty")?29:-1),s(),f(n.phoneFC.hasError("telefon.inactive")?30:-1),s(),f(n.phoneFC.hasError("error.field.phone_number.wrong_format")?31:-1),s(),f(n.phoneFC.hasError("error.field.phone_number.inactive")?32:-1),s(),f(n.phoneFC.hasError("error.field.phone_number.unknown")?33:-1),s(3),f(n.operatorsFC.value&&n.operatorsFC.value!==null?36:-1),s(),f(n.isConstValue?-1:37),s(),f(n.isConstValue?38:-1),s(5),p("formControl",n.dateFC)("matDatepicker",l),s(),p("for",l),s(4),f(n.dateFC.hasError("required")?48:-1),s(),p("sourceAccountFC",n.accountFC)("accountList",n.chargeableAccounts),s(),p("confirmDisabled",n.formFG.invali
3d)("buttonLabelConfirm",n.ButtonLabels.SAVE)}},dependencies:[be,Ie,$t,zo,St,nn,xt,Dt,Tt,Ji,Se,on,_t,ve,De,tt,Zi,Qi,Ve,gt,Ke,Ye,Xe,We,nl,mt,il,ol,$],styles:[".flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}",".flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}",".justify-between[_ngcontent-%COMP%]{justify-content:space-between}",".items-end[_ngcontent-%COMP%]{align-items:flex-end}",".gap-10[_ngcontent-%COMP%]{gap:10px}",".flex-60[_ngcontent-%COMP%]{flex:1 1 60%;max-width:60%;box-sizing:border-box}"]})}}return t})();var Xl=(()=>{class t{constructor(){this.termsAcceptance=v(Es)}canActivateChild(e){return this.termsAcceptance.isAllTermsAccepted(this.urlToTermsEnum(e.url[0].path),Ss.TRANSACTION)}urlToTermsEnum(e){switch(e){case Lo:return Un.DEPOSITS;case Vo:return Un.TOP_UPS;case jo:return Un.TRANSFERS;default:return Un.NONE}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Jl=()=>{if(localStorage.getItem(cn)!=="true")return!0;let r=v(Fi);return v(Li).get(Ze.APPROVALS_ENABLED).pipe(L(Boolean),L(i=>i?r.createUrlTree(["/",Ni,ln]):!0))},ec=()=>{let t=v(Fi);return v(Li).get(Ze.APPROVALS_ENABLED).pipe(L(Boolean),L(e=>e?!0:t.createUrlTree(["/",Ni,sn])))};function tc(t,r,e=0){if(r===null)return t;let i=[...t];for(;e+i.reduce((n,l)=>n+kd(l),0)>r;){let n=i.findIndex(l=>l.secondary);if(n<0)break;i.splice(n,1)}return i}function kd(t){return t.width?parseFloat(t.width)||0:240}var ic=(()=>{class t{constructor(){this.icon=I("inbox"),this.message=I.required()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-empty-state"]],inputs:{icon:[1,"icon"],message:[1,"message"]},decls:4,vars:2,consts:[["aria-hidden","true",1,"lv-empty-state__icon"],[1,"lv-empty-state__text"]],template:function(i,n){i&1&&(a(0,"mat-icon",0),c(1),o(),a(2,"div",1),c(3),o()),i&2&&(s(),g(n.icon()),s(2),g(n.message()))},dependencies:[ie,q],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:8px;padding:48px var(--lv-gutter, 24px);text-align:center;color:var(--lv-on-surface-variant, #44474e)}.lv-empty-state__icon[_ngcontent-%COMP%]{width:48px;height:48px;font-size:48px;opacity:.5}.lv-empty-state__text[_ngcontent-%COMP%]{font-size:14px;line-height:20px}"],changeDetection:0})}}return t})();var to=(()=>{class t{constructor(){this.appListCell=I.required(),this.template=v(zr)}static ngTemplateContextGuard(e,i){return!0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=fo({type:t,selectors:[["ng-template","appListCell",""]],inputs:{appListCell:[1,"appListCell"]}})}}return t})();var Fd=t=>({$implicit:t}),Rd=(t,r)=>({row:t,actions:r}),ac=(t,r)=>r.id;function Nd(t,r){t&1&&(a(0,"div",1),C(1,"mat-spinner",4),o())}function Bd(t,r){t&1&&(a(0,"div",2),c(1),o()),t&2&&(s(),g(r))}function zd(t,r){if(t&1&&C(0,"app-empty-state",3),t&2){let e=d();p("icon",e.emptyIcon())("message",e.emptyMessage())}}function Ld(t,r){if(t&1){let e=F();a(0,"mat-header-cell",14)(1,"mat-checkbox",15),m("change",function(){P(e);let n=d(2);return O(n.toggleAll())}),o()()}if(t&2){let e=d(2);s(),p("checked",e.allSelected())("indeterminate",e.someSelected())}}function Vd(t,r){if(t&1){let e=F();a(0,"mat-cell",16),m("click",function(n){return n.stopPropagation()}),a(1,"mat-checkbox",17),m("change",function(){let n=P(e).$implicit,l=d(2);return O(l.toggle(n))}),o()()}if(t&2){let e=r.$implicit,i=d(2);s(),p("checked",i.isSelected(e))}}function jd(t,r){if(t&1&&(a(0,"mat-header-cell")(1,"span",20),c(2),o()()),t&2){let e=d().$implicit,i=d(2);Oi(i.cellClass(e)),jn("flex",i.cellFlex(e)),s(2),g(e.header)}}function Ud(t,r){t&1&&Vr(0)}function Gd(t,r){if(t&1&&Z(0,Ud,1,0,"ng-container",21),t&2){let e=d().$implicit;p("ngTemplateOutlet",r)("ngTemplateOutletContext",So(2,Fd,e))}}function Wd(t,r){if(t&1&&c(0),t&2){let e=d().$implicit,i=d().$implicit,n=d(2);U(" ",n.cellValue(i,e)," ")}}function Hd(t,r){if(t&1&&(a(0,"mat-cell")(1,"span",20),u(2,Gd,1,4,"ng-container")(3,Wd,1,1),o()()),t&2){let e,i=d().$implicit,n=d(2);Oi(n.cellClass(i)),jn("flex",n.cellFlex(i)),s(2),f((e=n.cellTemplate(i.id))?2:3,e)}}function $d(t,r){if(t&1&&(he(0,6),Z(1,jd,3,5,"mat-header-cell",18)(2,Hd,4,5,"mat-cell",19),_e()),t&2){let e=r.$implicit;p("matColumnDef",e.id)}}function qd(t,r){t&1&&C(0,"mat-header-cell",22)}function Zd(t,r){if(t&1&&(a(0,"button",24)(1,"mat-icon"),c(2,"more_vert"),o()()),t&2){let e=d(),i=d().$implicit;d();let n=re(12);p("matMenuTriggerFor",n)("matMenuTriggerData",Eo(2,Rd,i,e))}}function Qd(t,r){t&1&&u(0,Zd,3,5,"button",24),t&2&&f(r.length>0?0:-1)}function Kd(t,r){if(t&1&&(a(0,"mat-cell",23),m("click",function(i){return i.stopPropagation()}),u(1,Qd,1,1),o()),t&2){let e,i=r.$implicit,n=d(2);s(),f((e=n.rowActionsFor(i))?1:-1,e)}}function Yd(t,r){t&1&&C(0,"mat-header-row",25)}function Xd(t,r){if(t&1){let e=F();a(0,"mat-row",26),m("click",function(n){let l=P(e).$implicit,h=d(2);return O(h.onRowClick(l,n))})("keydown.enter",function(){let n=P(e).$implicit,l=d(2);return O(l.rowClick.emit(n))})("keydown.space",function(n){let l=P(e).$implicit,h=d(2);return O(h.onSpace(l,n))}),o()}if(t&2){let e=r.$implicit,i=d(2);ge("lv-row--selected",i.isSelected(e))("lv-row--open",i.isActive(e)),hi("aria-selected",i.selectable()?i.isSelected(e):null)("aria-current",i.isActive(e)?"true":null)}}function Jd(t,r){if(t&1&&(a(0,"mat-icon"),c(1),o()),t&2){let e=d().$implicit;s(),g(e.icon)}}function em(t,r){if(t&1){let e=F();a(0,"button",28),m("click",function(){let n=P(e).$implicit,l=d().row;return O(n.run([l]))}),u(1,Jd,2,1,"mat-icon"),a(2,"span"),c(3),o()()}if(t&2){let e=r.$implicit;ge("lv-menu-item--danger",e.kind==="danger"),s(),f(e.icon?1:-1),s(2),g(e.label)}}function tm(t,r){if(t&1&&ne(0,em,4,4,"button",27,ac),t&2){let e=r.actions;oe(e)}}function im(t,r){if(t&1&&(a(0,"mat-table",5),he(1,6),Z(2,Ld,2,2,"mat-header-cell",7)(3,Vd,2,1,"mat-cell",8),_e(),ne(4,$d,3,1,"ng-container",6,ac),he(6,6),Z(7,qd,1,0,"mat-header-cell",9)(8,Kd,2,1,"mat-cell",10),_e(),Z(9,Yd,1,0,"mat-header-row",11)(10,Xd,1,6,"mat-row",12),o(),a(11,"mat-menu",null,0),Z(13,tm,2,0,"ng-template",13),o()),t&2){let e=d();ge("lv-table--two-line",e.twoLine()),p("dataSource",e.rows())("trackBy",e.trackById),s(),p("matColumnDef",e.SELECT_COLUMN),s(3),oe(e.columns()),s(2),p("matColumnDef",e.MENU_COLUMN),s(3),p("matHeaderRowDef",e.displayedColumns())("matHeaderRowDefSticky",!0),s(),p("matRowDefColumns",e.displayedColumns())}}var nc="__select",oc="__menu",rc=(()=>{class t{constructor(){this.rows=I.required(),this.columns=I.required(),this.rowId=I.required(),this.selectable=I(!1),this.selected=To([]),this.activeId=I(null),this.rowActions=I([]),this.twoLine=I(!1),this.loading=I(!1),this.error=I(null),this.emptyMessage=I("Brak element\xF3w do wy\u015Bwietlenia"),this.emptyIcon=I("inbox"),this.rowClick=Rt(),this.SELECT_COLUMN=nc,this.MENU_COLUMN=oc,this.cellTemplates=Hr(to),this.lastClickedIndex=-1,this.hostWidth=j(null),this.visibleColumns=b(()=>tc(this.columns(),this.hostWidth(),(this.selectable()?64:0)+(this.rowActions().length>0?56:0))),this.displayedColumns=b(()=>[...this.selectable()?[nc]:[],...this.visibleColumns().map(n=>n.id),...this.rowActions().length>0?[oc]:[]]),this.selectedIds=b(()=>new Set(this.selected().map(n=>this.rowId()(n)))),this.allSelected=b(()=>{let n=this.rows();return n.length>0&&n.every(l=>this.selectedIds().has(this.rowId()(l)))}),this.someSelected=b(()=>!this.allSelected()&&this.rows().some(n=>this.selectedIds().has(this.rowId()(n)))),this.trackById=(n,l)=>this.rowId()(l);let e=v(mo).nativeElement,i=v(ze);qi(()=>
3{if(typeof ResizeObserver>"u")return;let n=new ResizeObserver(l=>this.hostWidth.set(l[0].contentRect.width));n.observe(e),i.onDestroy(()=>n.disconnect())})}isSelected(e){return this.selectedIds().has(this.rowId()(e))}isActive(e){return this.activeId()!==null&&this.activeId()===this.rowId()(e)}cellTemplate(e){return this.cellTemplates().find(i=>i.appListCell()===e)?.template??null}cellValue(e,i){return e.value?.(i)??""}cellFlex(e){return e.width?`0 0 ${e.width}`:"1 1 var(--lv-col-name-min-w, 300px)"}cellClass(e){let i=["lv-col"];return e.align&&i.push(`lv-col--${e.align}`),e.numeric&&i.push("lv-col--numeric"),e.secondary&&i.push("lv-col--secondary"),e.compact&&i.push("lv-col--compact"),i.join(" ")}rowActionsFor(e){return this.rowActions().filter(i=>i.canApply([e]))}toggle(e){let i=this.rowId()(e);this.selected.set(this.isSelected(e)?this.selected().filter(n=>this.rowId()(n)!==i):[...this.selected(),e]),this.lastClickedIndex=this.rows().indexOf(e)}toggleAll(){this.selected.set(this.allSelected()?[]:[...this.rows()])}onRowClick(e,i){if(!this.selectable()||!(i.ctrlKey||i.metaKey||i.shiftKey)){this.rowClick.emit(e);return}let n=this.rows(),l=n.indexOf(e);if(i.shiftKey&&this.lastClickedIndex>=0){let h=Math.min(this.lastClickedIndex,l),D=Math.max(this.lastClickedIndex,l),R=n.slice(h,D+1),se=new Set(R.map(de=>this.rowId()(de))),le=i.ctrlKey||i.metaKey?this.selected().filter(de=>!se.has(this.rowId()(de))):[];this.selected.set([...le,...R])}else this.toggle(e)}onSpace(e,i){this.selectable()&&(i.preventDefault(),this.toggle(e))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-data-table"]],contentQueries:function(i,n,l){i&1&&_o(l,n.cellTemplates,to,4),i&2&&Pi()},inputs:{rows:[1,"rows"],columns:[1,"columns"],rowId:[1,"rowId"],selectable:[1,"selectable"],selected:[1,"selected"],activeId:[1,"activeId"],rowActions:[1,"rowActions"],twoLine:[1,"twoLine"],loading:[1,"loading"],error:[1,"error"],emptyMessage:[1,"emptyMessage"],emptyIcon:[1,"emptyIcon"]},outputs:{selected:"selectedChange",rowClick:"rowClick"},decls:4,vars:1,consts:[["rowMenu","matMenu"],["role","status",1,"lv-table__status"],["role","alert",1,"lv-table__status","lv-table__status--error"],[3,"icon","message"],["diameter","40"],[1,"lv-table",3,"dataSource","trackBy"],[3,"matColumnDef"],["class","lv-col lv-col--select",4,"matHeaderCellDef"],["class","lv-col lv-col--select",3,"click",4,"matCellDef"],["class","lv-col lv-col--menu",4,"matHeaderCellDef"],["class","lv-col lv-col--menu",3,"click",4,"matCellDef"],["class","lv-header-row",4,"matHeaderRowDef","matHeaderRowDefSticky"],["matRipple","","class","lv-row","tabindex","0",3,"lv-row--selected","lv-row--open","click","keydown.enter","keydown.space",4,"matRowDef","matRowDefColumns"],["matMenuContent",""],[1,"lv-col","lv-col--select"],["color","warn","aria-label","Zaznacz wszystkie",3,"change","checked","indeterminate"],[1,"lv-col","lv-col--select",3,"click"],["color","warn","aria-label","Zaznacz pozycj\u0119",3,"change","checked"],[3,"class","flex",4,"matHeaderCellDef"],[3,"class","flex",4,"matCellDef"],[1,"lv-cell__content"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"lv-col","lv-col--menu"],[1,"lv-col","lv-col--menu",3,"click"],["mat-icon-button","","aria-label","Akcje pozycji",1,"lv-row__menu",3,"matMenuTriggerFor","matMenuTriggerData"],[1,"lv-header-row"],["matRipple","","tabindex","0",1,"lv-row",3,"click","keydown.enter","keydown.space"],["mat-menu-item","",3,"lv-menu-item--danger"],["mat-menu-item","",3,"click"]],template:function(i,n){if(i&1&&u(0,Nd,2,0,"div",1)(1,Bd,2,1,"div",2)(2,zd,1,2,"app-empty-state",3)(3,im,14,9),i&2){let l;f(n.loading()?0:(l=n.error())?1:n.rows().length===0?2:3,l)}},dependencies:[qr,Ws,un,hn,Cn,_n,fn,bn,gn,vn,Sn,En,_s,rn,ie,q,we,vt,Ls,Bs,Rs,Ns,zs,bt,it,ps,cs,ic],styles:["[_nghost-%COMP%]{display:block;overflow:auto;max-height:var(--lv-table-max-h, none)}.lv-table[_ngcontent-%COMP%]{--mat-table-background-color: transparent;--mat-table-header-container-height: var(--lv-header-h, 56px);--mat-table-row-item-container-height: var(--lv-row-h, 52px);--mat-table-row-item-outline-color: var(--lv-outline-variant, #c8c8c8);display:block;font-variant-numeric:tabular-nums}.lv-table--two-line[_ngcontent-%COMP%]{--mat-table-row-item-container-height: var(--lv-row-h-2, 64px)}.lv-header-row[_ngcontent-%COMP%]{background:var(--lv-surface, #fff)}.lv-col[_ngcontent-%COMP%]{padding:0 var(--lv-cell-pad-x, 16px);min-height:inherit}.lv-col[_ngcontent-%COMP%]:first-child{padding-left:var(--lv-gutter, 24px)}.lv-cell__content[_ngcontent-%COMP%]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lv-header-row[_ngcontent-%COMP%] .lv-col[_ngcontent-%COMP%]{font-size:12px;line-height:16px;font-weight:500;letter-spacing:.5px;color:var(--lv-on-surface-variant, #5f5f5f)}.lv-row[_ngcontent-%COMP%] .lv-col[_ngcontent-%COMP%]{font-size:14px;line-height:20px;letter-spacing:.25px;color:var(--lv-on-surface, #1c1c1c)}.lv-col--select[_ngcontent-%COMP%], .lv-col--menu[_ngcontent-%COMP%], .lv-col--compact[_ngcontent-%COMP%]{justify-content:center;padding:0}.lv-col--select[_ngcontent-%COMP%], .lv-col--menu[_ngcontent-%COMP%], .lv-col--compact[_ngcontent-%COMP%] .lv-cell__content[_ngcontent-%COMP%]{overflow:visible}.lv-col--select[_ngcontent-%COMP%]{flex:0 0 var(--lv-col-select-w, 64px)}.lv-col--menu[_ngcontent-%COMP%]{flex:0 0 var(--lv-col-menu-w, 56px)}.lv-col--end[_ngcontent-%COMP%]{justify-content:flex-end;text-align:right}.lv-col--center[_ngcontent-%COMP%]{justify-content:center;text-align:center}.lv-col--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.lv-row[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.lv-row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.lv-row--selected[_ngcontent-%COMP%]{background:var(--lv-selected-bg, #dcdcdc)}.lv-row--open[_ngcontent-%COMP%]{background:var(--lv-open-bg, #ececec);box-shadow:inset 3px 0 0 var(--lv-accent-bar, currentColor)}.lv-row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.lv-table__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:48px var(--lv-gutter, 24px);font-size:14px;color:var(--lv-on-surface-variant, #5f5f5f)}.lv-table__status--error[_ngcontent-%COMP%], .lv-menu-item--danger[_ngcontent-%COMP%]{color:var(--color-warn, #d32f2f)}"],changeDetection:0})}}return t})();var nm=["body"],om=["*",[["","appDetailPanelActions",""]]],am=["*","[appDetailPanelActions]"];function rm(t,r){if(t&1){let e=F();a(0,"button",7),m("click",function(){P(e);let n=d();return O(n.back.emit())}),a(1,"mat-icon"),c(2,"arrow_back"),o()()}}function sm(t,r){t&1&&(a(0,"footer",6),Ft(1,1),o())}var fa=(()=>{class t{constructor(){this.appDetailPanelActions=I(!0,{transform:$r})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=fo({type:t,selectors:[["","appDetailPanelActions",""]],inputs:{appDetailPanelActions:[1,"appDetailPanelActions"]}})}}return t})(),ha=(()=>{class t{constructor(){this.title=I.required(),this.showBack=I(!1),this.back=Rt(),this.closed=Rt(),this.actions=Wr(fa),this.show
3Footer=b(()=>this.actions()?.appDetailPanelActions()??!1),this.host=v(mo),this.body=Do.required("body"),qi(()=>this.host.nativeElement.focus({preventScroll:!0}))}get bodyScrollTop(){return this.body().nativeElement.scrollTop}scrollBodyTo(e){this.body().nativeElement.scrollTop=e}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-detail-panel"]],contentQueries:function(i,n,l){i&1&&_o(l,n.actions,fa,5),i&2&&Pi()},viewQuery:function(i,n){i&1&&go(n.body,nm,5),i&2&&Pi()},hostAttrs:["tabindex","-1","role","complementary"],hostVars:1,hostBindings:function(i,n){i&2&&hi("aria-label",n.title())},inputs:{title:[1,"title"],showBack:[1,"showBack"]},outputs:{back:"back",closed:"closed"},ngContentSelectors:am,decls:11,vars:3,consts:[["body",""],[1,"lv-panel__header"],["mat-icon-button","","type","button","aria-label","Wstecz",1,"lv-panel__back"],[1,"lv-panel__title"],["mat-icon-button","","type","button","aria-label","Zamknij szczeg\xF3\u0142y",1,"lv-panel__close",3,"click"],[1,"lv-panel__body"],[1,"lv-panel__footer"],["mat-icon-button","","type","button","aria-label","Wstecz",1,"lv-panel__back",3,"click"]],template:function(i,n){i&1&&(_i(om),a(0,"header",1),u(1,rm,3,0,"button",2),a(2,"h2",3),c(3),o(),a(4,"button",4),m("click",function(){return n.closed.emit()}),a(5,"mat-icon"),c(6,"close"),o()()(),a(7,"div",5,0),Ft(9),o(),u(10,sm,2,0,"footer",6)),i&2&&(s(),f(n.showBack()?1:-1),s(2),g(n.title()),s(7),f(n.showFooter()?10:-1))},dependencies:[ie,q,we,vt],styles:["[_nghost-%COMP%]{display:grid;grid-template-rows:auto minmax(0,1fr) auto;height:100%;min-height:0;background:var(--lv-surface, #fff);color:var(--lv-on-surface, #1a1c1e);outline:none}.lv-panel__header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;height:var(--lv-panel-header-h, 64px);padding:0 8px 0 16px;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.lv-panel__back[_ngcontent-%COMP%] + .lv-panel__title[_ngcontent-%COMP%]{margin-left:0}.lv-panel__title[_ngcontent-%COMP%]{flex:1;margin:0;font-size:16px;line-height:24px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lv-panel__body[_ngcontent-%COMP%]{overflow:auto;padding:16px var(--lv-gutter, 24px)}.lv-panel__footer[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:8px;padding:16px var(--lv-gutter, 24px);border-top:1px solid var(--lv-outline-variant, #c4c6cf)}"],changeDetection:0})}}return t})();var lm=(t,r)=>r.id,cm=(t,r)=>r.value;function pm(t,r){if(t&1){let e=F();a(0,"mat-form-field",0)(1,"mat-label"),c(2),o(),a(3,"mat-icon",2),c(4,"search"),o(),a(5,"input",3),m("input",function(n){P(e);let l=d().$implicit,h=d();return O(h.set(l.id,n.target.value))}),o()()}if(t&2){let e=d().$implicit,i=d();s(2),g(e.label),s(3),p("value",i.valueOf(e.id)),hi("placeholder",e.placeholder??null)}}function dm(t,r){if(t&1&&(a(0,"mat-option",7),c(1),o()),t&2){let e=r.$implicit;p("value",e.value),s(),g(e.label)}}function mm(t,r){if(t&1){let e=F();a(0,"mat-form-field",4)(1,"mat-label"),c(2),o(),a(3,"mat-select",5),m("selectionChange",function(n){P(e);let l=d().$implicit,h=d();return O(h.set(l.id,n.value))}),a(4,"mat-option",6),c(5),o(),ne(6,dm,2,2,"mat-option",7,cm),o()()}if(t&2){let e=d().$implicit,i=d();jn("flex-basis",e.width??null),s(2),g(e.label),s(),p("value",i.valueOf(e.id)),s(2),g(e.allLabel??"Wszystkie"),s(),oe(e.options)}}function um(t,r){if(t&1&&u(0,pm,6,3,"mat-form-field",0)(1,mm,8,5,"mat-form-field",1),t&2){let e=r.$implicit;f(e.kind==="search"?0:1)}}var sc=(()=>{class t{constructor(){this.filters=I.required(),this.values=To({})}valueOf(e){return this.values()[e]??""}set(e,i){this.values.set(Mr(Ir({},this.values()),{[e]:i??""}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-filter-bar"]],inputs:{filters:[1,"filters"],values:[1,"values"]},outputs:{values:"valuesChange"},decls:2,vars:0,consts:[["appearance","outline","subscriptSizing","dynamic",1,"lv-filter","lv-filter--search"],["appearance","outline","subscriptSizing","dynamic",1,"lv-filter","lv-filter--select",3,"flex-basis"],["matIconPrefix",""],["matInput","","type","search",3,"input","value"],["appearance","outline","subscriptSizing","dynamic",1,"lv-filter","lv-filter--select"],[3,"selectionChange","value"],["value",""],[3,"value"]],template:function(i,n){i&1&&ne(0,um,2,1,null,null,lm),i&2&&oe(n.filters())},dependencies:[en,be,Ie,zo,tn,Se,hs,on,nn,ie,q],styles:["[_nghost-%COMP%]{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.lv-filter--search[_ngcontent-%COMP%]{flex:1 1 260px;
3min-width:200px;max-width:400px}.lv-filter--select[_ngcontent-%COMP%]{flex:0 0 200px}.lv-filter[_ngcontent-%COMP%] mat-icon[matIconPrefix][_ngcontent-%COMP%]{color:var(--lv-on-surface-variant, #5f5f5f)}"],changeDetection:0})}}return t})();var fm=[[["","appListViewHeader",""]],"*",[["","appListViewPanel",""]]],hm=["[appListViewHeader]","*","[appListViewPanel]"];function _m(t,r){if(t&1){let e=F();Ln(0,"div",4),jr("click",function(){P(e);let n=d();return O(n.panelClose.emit())}),Vn()}}var lc=(()=>{class t{constructor(){this.panelOpen=I(!1),this.panelClose=Rt()}onEscape(){this.panelOpen()&&this.panelClose.emit()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-list-view-shell"]],hostVars:2,hostBindings:function(i,n){i&1&&m("keydown.escape",function(){return n.onEscape()}),i&2&&ge("lv-shell--open",n.panelOpen())},inputs:{panelOpen:[1,"panelOpen"]},outputs:{panelClose:"panelClose"},ngContentSelectors:hm,decls:7,vars:2,consts:[[1,"lv-shell__header"],[1,"lv-shell__main"],["aria-hidden","true",1,"lv-shell__backdrop"],[1,"lv-shell__panel"],["aria-hidden","true",1,"lv-shell__backdrop",3,"click"]],template:function(i,n){i&1&&(_i(fm),Ln(0,"div",0),Ft(1),Vn(),Ln(2,"div",1),Ft(3,1),Vn(),u(4,_m,1,0,"div",2),Ln(5,"aside",3),Ft(6,2),Vn()),i&2&&(s(4),f(n.panelOpen()?4:-1),s(),hi("aria-hidden",!n.panelOpen()))},styles:["[_nghost-%COMP%]{--lv-primary: var(--color-primary);--lv-on-surface: #1c1c1c;--lv-on-surface-variant: #5f5f5f;--lv-outline: #757575;--lv-outline-variant: #c8c8c8;--lv-surface: color-mix(in srgb, var(--color-primary) 3.5%, #fff);--lv-surface-1: color-mix(in srgb, var(--color-primary) 6%, #fff);--lv-surface-2: color-mix(in srgb, var(--color-primary) 8%, #fff);--lv-surface-3: color-mix(in srgb, var(--color-primary) 11%, #fff);--lv-selected-bg: color-mix(in srgb, var(--color-primary) 10%, #fff);--lv-open-bg: color-mix(in srgb, var(--color-primary) 22%, #fff);--lv-hover-bg: color-mix(in srgb, #000 5%, transparent);--lv-selection-bar-bg: color-mix(in srgb, var(--color-primary) 14%, #fff);--lv-accent-bar: var(--color-warn);--lv-chip-neutral-bg: var(--lv-surface-3);--lv-chip-neutral-fg: var(--lv-on-surface-variant);--lv-chip-info-bg: var(--lv-open-bg);--lv-chip-info-fg: var(--lv-on-surface);--lv-chip-progress-bg: #e8def8;--lv-chip-progress-fg: #4a4458;--lv-chip-success-bg: #cdebd2;--lv-chip-success-fg: #0b3d18;--lv-chip-warn-bg: #ffe0a8;--lv-chip-warn-fg: #3e2c00;--lv-chip-danger-bg: #f9dedc;--lv-chip-danger-fg: #410e0b;--lv-gutter: 24px;--lv-cell-pad-x: 16px;--lv-header-h: 56px;--lv-row-h: 52px;--lv-row-h-2: 64px;--lv-col-select-w: 64px;--lv-col-menu-w: 56px;--lv-col-name-min-w: 300px;--lv-panel-w: 480px;--lv-panel-w-narrow: 400px;--lv-panel-header-h: 64px;--lv-control-h: 40px;--lv-chip-h: 24px;--lv-transition: .2s;--lv-sticky-top: 4rem;display:grid;grid-template-columns:minmax(0,1fr) 0;grid-template-rows:auto minmax(0,1fr);background:var(--lv-surface);color:var(--lv-on-surface);transition:grid-template-columns var(--lv-transition)}.lv-shell--open[_nghost-%COMP%]{grid-template-columns:minmax(0,1fr) var(--lv-panel-w)}.lv-shell__header[_ngcontent-%COMP%]{grid-column:1/-1;min-width:0}.lv-shell__main[_ngcontent-%COMP%]{grid-row:2;grid-column:1;min-width:0;min-height:0}.lv-shell__panel[_ngcontent-%COMP%]{grid-row:2;grid-column:2;position:sticky;top:var(--lv-sticky-top);max-height:calc(100dvh - var(--lv-sticky-top));min-width:0;min-height:0;overflow:hidden;visibility:hidden;background:var(--lv-surface)}.lv-shell--open[_nghost-%COMP%] .lv-shell__panel[_ngcontent-%COMP%]{visibility:visible;border-left:1px solid var(--lv-outline-variant)}.lv-shell__backdrop[_ngcontent-%COMP%]{display:none}@media(max-width:1400px){.lv-shell--open[_nghost-%COMP%]{grid-template-columns:minmax(0,1fr) var(--lv-panel-w-narrow)}}@media(max-width:1100px){.lv-shell--open[_nghost-%COMP%]{grid-template-columns:minmax(0,1fr)}.lv-shell--open[_nghost-%COMP%] .lv-shell__panel[_ngcontent-%COMP%]{position:fixed;top:var(--lv-sticky-top);right:0;bottom:0;z-index:30;width:var(--lv-panel-w);height:auto;box-shadow:0 8px 12px 6px #00000026,0 4px 4px #0000004d}.lv-shell__backdrop[_ngcontent-%COMP%]{display:block;position:fixed;inset:var(--lv-sticky-top) 0 0 0;z-index:29;background:#00000052}}"],changeDetection:0})}}return t})();var gm=["*"],vm=(t,r)=>r.id;function Cm(t,r){if(t&1&&(a(0,"span",2),c(1),o()),t&2){let e=r.$implicit;s(),g(e)}}function bm(t,r){if(t&1&&(a(0,"mat-icon"),c(1),o()),t&2){let e=d(2).$implicit;s(),g(e.icon)}}function Sm(t,r){if(t&1){let e=F();a(0,"button",6),m("click",function(){P(e);let n=d().$implicit,l=d(2);return O(n.run(l.selected()))}),u(1,bm,2,1,"mat-icon"),c(2),o()}if(t&2){let e=d().$implicit;s(),f(e.icon?1:-1),s(),U(" ",e.label," ")}}function Em(t,r){if(t&1&&(a(0,"mat-icon"),c(1),o()),t&2){let e=d(2).$implicit;s(),g(e.icon)}}function xm(t,r){if(t&1){let e=F();a(0,"button",7),m("click",function(){P(e);let n=d().$implicit,l=d(2);return O(n.run(l.selected()))}),u(1,Em,2,1,"mat-icon"),c(2),o()}if(t&2){let e=d().$implicit;ge("lv-selbar__action--danger",e.kind==="danger"),s(),f(e.icon?1:-1),s(),U(" ",e.label," ")}}function Dm(t,r){if(t&1&&u(0,Sm,3,2,"button",4)(1,xm,3,4,"button",5),t&2){let e=r.$implicit;f(e.kind==="primary"?0:1)}}function Tm(t,r){t&1&&(a(0,"span",3),c(1,"Zaznaczone pozycje nie maj\u0105 wsp\xF3lnej akcji"),o())}function ym(t,r){if(t&1){let e=F();a(0,"button",0),m("click",function(){P(e);let n=d();return O(n.clear.emit())}),a(1,"mat-icon"),c(2,"close"),o()(),a(3,"span",1),c(4),o(),ne(5,Cm,2,1,"span",2,jt),ne(7,Dm,2,1,null,null,vm),u(9,Tm,2,0,"span",3)}if(t&2){let e=d();s(4),U("Wybrano ",e.count()),s(),oe(e.totalsText()),s(2),oe(e.applicable()),s(2),f(e.applicable().length===0?9:-1)}}function Am(t,r){t&1&&Ft(0)}var cc=(()=>{class t{constructor(){this.selected=I.required(),this.actions=I([]),this.totals=I(null),this.clear=Rt(),this.count=b(()=>this.selected().length),this.totalsText=b(()=>this.totals()?.(this.selected())??[]),this.applicable=b(()=>{let e=this.selected();return e.length===0?[]:this.actions().filter(i=>i.canApply(e))})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-selection-bar"]],hostVars:2,hostBindings:function(i,n){i&2&&ge("lv-selbar--active",n.count()>0)},inputs:{selected:[1,"selected"],actions:[1,"actions"],totals:[1,"totals"]},outputs:{clear:"clear"},ngContentSelectors:gm,decls:2,vars:1,consts:[["mat-icon-button","","type","button","aria-label","Wyczy\u015B\u0107 zaznaczenie",1,"lv-selbar__clear",3,"click"],[1,"lv-selbar__count"],[1,"lv-selbar__total"],[1,"lv-selbar__hint"],["mat-flat-button","","color","warn","type","button",1,"lv-selbar__action"],["mat-stroked-button","","type","button",1,"lv-selbar__action",3,"lv-selbar__action--danger"],["mat-flat-button","","color","warn","type","button",1,"lv-selbar__action",3,"click"],["mat-stroked-button","","type","button",1,"lv-selbar__action",3,"click"]],template:function(i,n){i&1&&(_i(),u(0,ym,10,2)(1,Am,1,0
3)),i&2&&f(n.count()>0?0:1)},dependencies:[we,Ct,vt,ie,q],styles:['[_nghost-%COMP%]{display:flex;align-items:center;flex-wrap:wrap;gap:12px;box-sizing:border-box;min-height:72px;min-width:0;padding:16px var(--lv-gutter, 24px);color:var(--lv-on-surface, #1c1c1c)}.lv-selbar__action[_ngcontent-%COMP%]{flex:none}.lv-selbar--active[_nghost-%COMP%]{gap:8px;padding-left:12px;background:var(--lv-selection-bar-bg, #e8e8e8)}.lv-selbar__count[_ngcontent-%COMP%]{font-size:16px;line-height:24px;font-weight:500;font-variant-numeric:tabular-nums}.lv-selbar__total[_ngcontent-%COMP%]{font-size:14px;line-height:20px;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #5f5f5f)}.lv-selbar__total[_ngcontent-%COMP%]:before{content:"\\b7";margin-right:8px}.lv-selbar__total[_ngcontent-%COMP%]:last-of-type{margin-right:8px}.lv-selbar__action.mdc-button[_ngcontent-%COMP%]{height:40px}.lv-selbar__action--danger[_ngcontent-%COMP%]{color:var(--color-warn, #d32f2f)}.lv-selbar__hint[_ngcontent-%COMP%]{font-size:14px;color:var(--lv-on-surface-variant, #5f5f5f)}'],changeDetection:0})}}return t})();var wm=["*"],_a=(()=>{class t{constructor(){this.tone=I("neutral")}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-state-chip"]],hostVars:2,hostBindings:function(i,n){i&2&&Oi("lv-state-chip lv-state-chip--"+n.tone())},inputs:{tone:[1,"tone"]},ngContentSelectors:wm,decls:1,vars:0,template:function(i,n){i&1&&(_i(),Ft(0))},styles:["[_nghost-%COMP%]{display:inline-flex;align-items:center;height:var(--lv-chip-h, 24px);padding:0 10px;border-radius:8px;font-size:12px;line-height:16px;font-weight:500;letter-spacing:.5px;white-space:nowrap;background:var(--lv-chip-neutral-bg, #e6eaf2);color:var(--lv-chip-neutral-fg, #44474e)}.lv-state-chip--info[_nghost-%COMP%]{background:var(--lv-chip-info-bg, #dce3ec);color:var(--lv-chip-info-fg, #1b2a3b)}.lv-state-chip--progress[_nghost-%COMP%]{background:var(--lv-chip-progress-bg, #e8def8);color:var(--lv-chip-progress-fg, #4a4458)}.lv-state-chip--success[_nghost-%COMP%]{background:var(--lv-chip-success-bg, #cdebd2);color:var(--lv-chip-success-fg, #0b3d18)}.lv-state-chip--warn[_nghost-%COMP%]{background:var(--lv-chip-warn-bg, #ffe0a8);color:var(--lv-chip-warn-fg, #3e2c00)}.lv-state-chip--danger[_nghost-%COMP%]{background:var(--lv-chip-danger-bg, #f9dedc);color:var(--lv-chip-danger-fg, #410e0b)}"],changeDetection:0})}}return t})();var Je=(()=>{class t{constructor(){this.approvalsApiService=v(Wt),this._approvableItems=j([]),this.approvableItems=this._approvableItems.asReadonly(),this._loading=j(!1),this.loading=this._loading.asReadonly(),this._error=j(!1),this.error=this._error.asReadonly(),this.toApproveItems=b(()=>this._approvableItems().filter(e=>e.state===gi.TO_APPROVE)),this.approvedItems=b(()=>this._approvableItems().filter(e=>e.state===gi.APPROVED)),this._selectedItems=j([]),this.selectedItems=this._selectedItems.asReadonly(),this._activeItem=j(null),this.activeItem=this._activeItem.asReadonly(),this._activeTabIndex=j(0),this.activeTabIndex=this._activeTabIndex.asReadonly(),this._filterValues=j({}),this.filterValues=this._filterValues.asReadonly()}showDetails(e){this._activeItem.set(e)}closeDetails(){this._activeItem.set(null)}setActiveTabIndex(e){this._activeTabIndex.set(e)}setFilterValues(e){this._filterValues.set(e)}loadApprovableItems(){this._approvableItems.set([]),this._selectedItems.set([]),this._loading.set(!0),this._error.set(!1),this.approvalsApiService.getApprovableItems().pipe(ee(()=>this._loading.set(!1))).subscribe({next:e=>this._approvableItems.set(e.items),error:()=>this._error.set(!0)})}setSelectedItems(e){this._selectedItems.set(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var Im={UNAUTHENTICATED:"Sesja wygas\u0142a. Zaloguj si\u0119 ponownie.",ID_DOCUMENT_EXPIRED:"Tw\xF3j dokument to\u017Csamo\u015Bci straci\u0142 wa\u017Cno\u015B\u0107. Skontaktuj si\u0119 z bankiem.",ID_DOCUMENT_NOT_VERIFIED:"Tw\xF3j dokument to\u017Csamo\u015Bci nie zosta\u0142 zweryfikowany. Skontaktuj si\u0119 z bankiem.",ACCOUNT_ACCESS_DENIED:"Brak dost\u0119pu do rachunku przypisanego do pozycji.",VALIDATION_ERROR:"Niepoprawne dane wej\u015Bciowe.",ITEM_NOT_FOUND:"Pozycja nie istnieje.",NOT_ELIGIBLE:"Pozycja nie spe\u0142nia warunk\xF3w realizacji.",BUNDLE_EXPIRED:"Data realizacji min\u0119\u0142a. Podaj now\u0105 dat\u0119.",BUNDLE_TERMINAL_STATE:"Pozycja nie jest ju\u017C dost\u0119pna do realizacji.",DISPOSITIONS_INVALID_FOR_EXECUTION:"Niekt\xF3re dyspozycje nie przesz\u0142y walidacji."};function pc(t,r){return t&&Im[t]||r}function io(t){return pc(t,"Nie uda\u0142o si\u0119 przekaza\u0107 pozycji do realizacji.")}function dc(t){switch(t){case"AMOUNT_BELOW_MIN":return"Kwota poni\u017Cej dozwolonego minimum.";case"DEPOSIT_PRODUCT_INACTIVE":return"Produkt depozytowy jest nieaktywny.";case"UNKNOWN_DISPOSITION_TYPE":return"Nieznany typ dyspozycji.";default:return"Inny b\u0142\u0105d dyspozycji."}}
3var lt=(()=>{class t{transform(e){switch(e){case Te.BUNDLE:return"Paczka";case Te.SALARY_BUNDLE:return"Paczka p\u0142acowa";case Te.TRANSFER_COMMON:return"Przelew zwyk\u0142y";case Te.TRANSFER_US:return"Przelew US/C\u0141O";case Te.TRANSFER_ZUS:return"Przelew ZUS";case Te.TRANSFER_INTERNATIONAL:return"Przelew zagraniczny";case Te.TRANSFER_INSTANT:return"Przelew ekspresowy";case Te.TRANSFER_DEALING_BPS:return"Przelew dealing BPS";case Te.TRANSFER_VAT:return"Faktura VAT";case Te.TRANSFER_VAT_TOP_UP:return"Przelew VAT - zasilenie";case Te.DEPOSIT_OPENING:return"Za\u0142o\u017Cenie lokaty";case Te.DEPOSIT_MODIFICATION:return"Modyfikacja lokaty";case Te.DEPOSIT_CLOSING:return"Zerwanie lokaty";case Te.STANDING_ORDER_OPENING:return"Utworzenie zlecenia sta\u0142ego";case Te.STANDING_ORDER_MODIFICATION:return"Modyfikacja zlecenia sta\u0142ego";case Te.STANDING_ORDER_CLOSING:return"Zerwanie zlecenia sta\u0142ego";case Te.GSM_TOP_UP:return"Do\u0142adowanie GSM";default:return""}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=ho({name:"approvableItemTypeView",type:t,pure:!0})}}return t})();function ga(t){return es.includes(t.type)}function Lt(t){return ts.includes(t.type)}function di(t){return is.includes(t.type)}function mi(t){return ns.includes(t.type)}function Ii(t){return os.includes(t.type)}var Mm=new lt;function On(t){return Lt(t)?t.data.name:Ii(t)||mi(t)||di(t)?Mm.transform(t.type):t.data.recipientName??t.data.name}function mc(t){if(t===1)return"1 pozycja";let r=t%100,e=t%10;return e>=2&&e<=4&&(r<12||r>14)?`${t} pozycje`:`${t} pozycji`}var Pm=new $;function va(t){let r=new Map;return t.forEach(e=>r.set(e.data.currency,(r.get(e.data.currency)??0)+e.data.amount)),[...r.entries()].sort(([e],[i])=>e.localeCompare(i)).map(([e,i])=>`${Pm.transform(i)} ${e}`)}var Om=(t,r)=>r.id;function km(t,r){if(t&1&&(a(0,"mat-icon",8),c(1),o()),t&2){let e=r;Oi("approval-summary__"+e.kind),p("matTooltip",e.tooltip),s(),U(" ",e.kind==="ok"?"check_circle":"warning"," ")}}function Fm(t,r){if(t&1&&(a(0,"span",6),u(1,km,2,4,"mat-icon",7),o()),t&2){let e,i=d().$implicit,n=d();s(),f((e=n.statusOf(i))?1:-1,e)}}function Rm(t,r){if(t&1&&(a(0,"span",3),c(1),o(),a(2,"span",4),c(3),T(4,"date"),o(),a(5,"span",5),c(6),o(),u(7,Fm,2,1,"span",6)),t&2){let e=r.$implicit,i=d();s(),g(i.title(e)),s(2),g(V(4,4,e.data.executionDate,i.DEFAULT_DATE_FORMAT)),s(3),g(i.formatAmou
3nt(e.data.amount,e.data.currency)),s(),f(i.hasStatuses()?7:-1)}}function Nm(t,r){if(t&1&&(a(0,"span",5),c(1),o()),t&2){let e=r.$implicit;s(),g(e)}}function Bm(t,r){if(t&1&&(a(0,"div",2)(1,"span",9),c(2),o(),ne(3,Nm,2,1,"span",5,jt),o()),t&2){let e=d();s(2),g(e.countLabel()),s(),oe(e.totals())}}var Mi=(()=>{class t{constructor(){this.items=I.required(),this.statuses=I(null),this.hasStatuses=b(()=>this.statuses()!==null),this.DEFAULT_DATE_FORMAT=H,this.countLabel=b(()=>mc(this.items().length)),this.totals=b(()=>va(this.items())),this.currencyPipe=new $,this.title=On}statusOf(e){return this.statuses()?.get(e.id)}formatAmount(e,i){return`${this.currencyPipe.transform(e)} ${i}`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-approval-summary"]],inputs:{items:[1,"items"],statuses:[1,"statuses"]},decls:5,vars:3,consts:[[1,"approval-summary"],[1,"approval-summary__rows"],[1,"approval-summary__total"],[1,"approval-summary__name"],[1,"approval-summary__date"],[1,"approval-summary__amount"],[1,"approval-summary__status"],[3,"class","matTooltip"],[3,"matTooltip"],[1,"approval-summary__count"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"div",1),ne(2,Rm,8,7,null,
3null,Om),o(),u(4,Bm,5,1,"div",2),o()),i&2&&(s(),ge("approval-summary__rows--with-status",n.hasStatuses()),s(),oe(n.items()),s(2),f(n.items().length>1?4:-1))},dependencies:[ie,q,Qt,qt,ae],styles:['.approval-summary[_ngcontent-%COMP%]{margin-bottom:var(--spacing-md)}.approval-summary__rows[_ngcontent-%COMP%]{display:grid;grid-template-columns:minmax(0,1fr) max-content max-content;max-height:15rem;overflow-y:auto}.approval-summary__rows--with-status[_ngcontent-%COMP%]{grid-template-columns:minmax(0,1fr) max-content max-content max-content}.approval-summary__rows[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding-block:var(--spacing-xs);border-bottom:1px solid rgba(0,0,0,.1)}.approval-summary__rows[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:nth-last-child(-n+3), .approval-summary__rows--with-status[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:nth-last-child(-n+4){border-bottom:none}.approval-summary__status[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;min-width:1.25rem;padding-left:var(--spacing-s)}.approval-summary__status[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{flex:none;width:1.25rem;height:1.25rem;font-size:1.25rem;line-height:1.25rem}.approval-summary__ok[_ngcontent-%COMP%]{color:var(--color-success, #2e7d32)}.approval-summary__warn[_ngcontent-%COMP%]{color:var(--color-warning, #ed6c02)}.approval-summary__name[_ngcontent-%COMP%], .approval-summary__amount[_ngcontent-%COMP%], .approval-summary__total[_ngcontent-%COMP%]{color:#000000de}.approval-summary__name[_ngcontent-%COMP%]{overflow-wrap:anywhere;padding-right:var(--spacing-md)}.approval-summary__date[_ngcontent-%COMP%], .approval-summary__count[_ngcontent-%COMP%]{color:#0009}.approval-summary__date[_ngcontent-%COMP%]{white-space:nowrap;padding-right:var(--spacing-md)}.approval-summary__amount[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums;white-space:nowrap;text-align:right}.approval-summary__total[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:baseline;margin-top:var(--spacing-s);padding-top:var(--spacing-s);border-top:1px solid currentColor;font-weight:500}.approval-summary__count[_ngcontent-%COMP%]{margin-right:auto;padding-right:var(--spacing-md)}.approval-summary__amount[_ngcontent-%COMP%] + .approval-summary__amount[_ngcontent-%COMP%]:before{content:"";display:inline-block;width:1px;height:1em;margin:0 var(--spacing-s);vertical-align:-.15em;background:currentColor}'],changeDetection:0})}}return t})();function zm(t,r){t&1&&(a(0,"p"),c(1,"Czy na pewno chcesz przekaza\u0107 poni\u017Csze pozycje do realizacji?"),o())}function Lm(t,r){if(t&1&&(a(0,"p"),c(1),o()),t&2){let e=d();s(),g(e.summary())}}function Vm(t,r){if(t&1&&(a(0,"div",6)(1,"mat-icon",7),c(2,"error_outline"),o(),a(3,"span"),c(4),o()()),t&2){let e=d();s(4),g(e.message)}}function jm(t,r){t&1&&u(0,Vm,5,1,"div",6),t&2&&f(r.status==="refused"?0:-1)}function Um(t,r){if(t&1&&(a(0,"div",3)(1,"p",8),c(2," Cz\u0119\u015B\u0107 pozycji ma dat\u0119 realizacji z przesz\u0142o\u015Bci. Podana data zostanie ustawiona "),a(3,"strong"),c(4,"dla wszystkich zaznaczonych pozycji"),o(),c(5,". "),o(),a(6,"mat-form-field",9)(7,"mat-label"),c(8,"Nowa data realizacji"),o(),C(9,"input",10)(10,"mat-datepicker-toggle",11)(11,"mat-datepicker",null,0),o()()),t&2){let e=re(12),i=d();s(9),p("matDatepicker",e)("min",i.today)("formControl",i.executionDate),s(),p("for",e)}}function Gm(t,r){if(t&1){let e=F();a(0,"button",12),m("click",function(){P(e);let n=d();return O(n.close())}),c(1,"Zamknij"),o()}}function Wm(t,r){t&1&&C(0,"mat-spinner",15)}function Hm(t,r){t&1&&c(0," Realizuj ")}function $m(t,r){if(t&1){let e=F();a(0,"button",13),m("click",function(){P(e);let n=d();return O(n.close())}),c(1,"Anuluj"),o(),a(2,"button",14),m("click",function(){P(e);let n=d();return O(n.submit())}),u(3,Wm,1,0,"mat-spinner",15)(4,Hm,1,0),o()}if(t&2){let e=d();s(2),p("disabled",e.submitDisabled()),s(),f(e.state().status==="submitting"?3:4)}}var uc=(()=>{class t{constructor(){this.data=v(Ae),this.dialogRef=v(ye),this.executeApi=v(ko),this.executionDate=new Mo(null),this.today=Me.getTodayStartOfDay(),this.state=j({status:"confirm"}),this.results=j(null),this.pastDated=b(()=>this.data.items.filter(e=>Me.isBeforeToday(e.data.executionDate))),this.needsNewDate=b(()=>this.state().status!=="done"&&this.pastDated().length>0),this.statuses=b(()=>{let e=this.results();return e?new Map([...e].map(([i,n])=>[i,n.status===Oo.EXECUTED?{kind:"ok",tooltip:"Przekazano do realizacji"}:{kind:"warn",tooltip:io(n.errorCode??"")}])):this.pastDated().length===0?null:new Map(this.pastDated().map(i=>[i.id,{kind:"warn",tooltip:"Data realizacji jest z przesz\u0142o\u015Bci"}]))}),this.summary=b(()=>{let e=[...this.results()??new Map].filter(([,i])=>i.status===Oo.EXECUTED).length;return e===this.data.items.length?"Wszystkie pozycje przekazane do realizacji.":`Przekazano ${e} z ${this.data.items.length} pozycji.`})}submitDisabled(){return this.state().status==="submitting"||this.needsNewDate()&&!this.executionDate.value}submit(){let e=this.executionDate.value,i=this.needsNewDate()&&e?Me.formatDate(e,H):void 0;this.state.set({status:"submitting"}),this.executeApi.executeItems(this.data.items.map(n=>n.id),i).subscribe({next:n=>{this.results.set(new Map(n.results.map(l=>[l.itemId,l]))),this.state.set({status:"done"})},error:n=>this.refuse(n)})}close(){let e=[...this.results()??new Map].filter(([,i])=>i.status===Oo.EXECUTED).length;this.dialogRef.close({executedCount:e})}refuse(e){let i=e instanceof wo?e.error:null,n=i&&typeof i=="object"&&"code"in i?i.code:Po.INTERNAL_ERROR;this.state.set({status:"refused",message:io(n)})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-execute-batch-confirm-dialog"]],decls:11,vars:6,consts:[["picker",""],["mat-dialog-title",""],[3,"items","statuses"],[1,"execute-batch__date-row"],["align","end"],["mat-flat-button","","type","button"],[1,"execute-batch__refused"],["color","warn"],[1,"execute-batch__hint"],["appearance","outline","subscriptSizing","dynamic",1,"execute-batch__date-field"],["matInput","",3,"matDatepicker","min","formControl"],["matSuffix","",3,"for"],["mat-flat-button","","type","button",3,"click"],["mat-button","","type","button",3,"click"],["mat-flat-button","","color","warn","type","button",3,"click","disabled"],["diameter","18"]],template:function(i,n){if(i&1&&(a(0,"h2",1),c(1,"Realizacja pozycji"),o(),a(2,"mat-dialog-content"),u(3,zm,2,0,"p")(4,Lm,2,1,"p"),u(5,jm,1,1),C(6,"app-approval-summary",2),u(7,Um,13,4,"div",3),o(),a(8,"mat-dialog-actions",4),u(9,Gm,2,0,"button",5)(10,$m,5,2),o()),i&2){let l;s(3),f(n.state().status==="confirm"?3:n.state().status==="done"?4:-1),s(2),f((l=n.state())?5:-1,l),s(),p("items",n.data.items)("statuses",n.statuses()),s(),f(n.needsNewDate()?7:-1),s(2),f(n.state().status==="done"?9:10)}},dependencies:[Ki,ve,De,Ve,we,Ct,No,Fo,Ro,Ji,ie,q,Qt,en,be,Ie,St,tn,Se,Ho,xt,Dt,Tt,bt,it,Mi],styles:["[_nghost-%COMP%]{--mat-dialog-supporting-text-color: rgba(0, 0, 0, .87)}.execute-batch__refused[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);margin-bottom:var(--spacing-md)}.execute-batch__date-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-md);margin-top:var(--spacing-md)}.execute-batch__hint[_ngcontent-%COMP%]{flex:1;margin:0;color:#0009}.execute-batch__date-field[_ngcontent-%COMP%]{flex:none;width:11rem}"],changeDetection:0})}}return t})();
3var Ca=(()=>{class t{constructor(){this.dialog=v(fe),this.approvalsState=v(Je),this.destroyRef=v(ze)}execute(e=this.approvalsState.selectedItems()){e.length!==0&&this.dialog.open(uc,{data:{items:e},panelClass:"dialog",width:"40rem"}).afterClosed().pipe(Ue(this.destroyRef)).subscribe(i=>{i&&i.executedCount>0&&this.approvalsState.loadApprovableItems()})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var no=(()=>{class t{constructor(){this.stateService=v(Je),this.authFlow=v(an),this.approveApi=v(Ci),this.revokeApi=v(bi),this.convertToDraftApi=v(Si),this.notifications=v(K),this.batchExecution=v(Ca),this.destroyRef=v(ze),this.actions=[{id:"approve",label:"Podpisz",icon:"edit",kind:"primary",canApply:e=>e.every(i=>i.actions.canApprove),run:e=>this.approve(e)},{id:"withdrawForEdit",label:"Wycofaj do edycji",icon:"undo",canApply:e=>e.every(i=>i.actions.canWithdrawForEdit),run:e=>this.withdrawForEdit(e)},{id:"execute",label:"Realizuj",icon:"send",kind:"primary",canApply:e=>e.every(i=>i.actions.canExecute),run:e=>this.execute(e)},{id:"revokeApproval",label:"Cofnij podpis",icon:"undo",canApply:e=>e.every(i=>i.actions.canRevokeApproval),run:e=>this.revokeApproval(e)}]}refresh(){this.stateService.loadApprovableItems()}approve(e=this.stateService.selectedItems()){this.runAuthFlow(this.approveApi,e,"Autoryzacja podpisu",e.length===1?"Podpisano pozycj\u0119.":"Podpisano zaznaczone pozycje.")}revokeApproval(e=this.stateService.selectedItems()){this.runAuthFlow(this.revokeApi,e,"Autoryzacja wycofania podpis\xF3w",e.length===1?"Wycofano podpisy z pozycji.":"Wycofano podpisy z zaznaczonych pozycji.")}withdrawForEdit(e=this.stateService.selectedItems()){this.runAuthFlow(this.convertToDraftApi,e,"Autoryzacja wycofania do edycji",e.length===1?"Wycofano pozycj\u0119 do edycji.":"Wycofano zaznaczone pozycje do edycji.")}execute(e=this.stateService.selectedItems()){this.batchExecution.execute(e)}showDetails(e){this.stateService.showDetails(e)}runAuthFlow(e,i,n,l){i.length!==0&&this.authFlow.run(e,i.map(h=>h.id),{title:n,summary:{component:Mi,inputs:{items:i}}}).pipe(Ue(this.destroyRef)).subscribe({next:()=>{this.notifications.success(l),this.stateService.loadApprovableItems()},error:()=>{}})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var ba=(()=>{class t{transform(e,i=!1){switch(e){case gi.TO_APPROVE:return i?"Do podpisu":"W trakcie podpisywania";case gi.APPROVED:return"Podpisana";default:return"Status nieznany"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=ho({name:"approvableItemStateView",type:t,pure:!0})}}return t})();function Sa(t){return t.state===gi.APPROVED?"success":t.actions.canApprove?"warn":"neutral"}function qm(t,r){t&1&&(a(0,"span",8),c(1),o()),t&2&&(s(),g(r))}function Zm(t,r){if(t&1&&(a(0,"div",6)(1,"span",7),c(2),o(),u(3,qm,2,1,"span",8),o()),t&2){let e,i=r.$implicit,n=d().itemInfo(i);s(2),g(n.line1),s(),f((e=n.line2)?3:-1,e)}}function Qm(t,r){t&1&&(a(0,"mat-icon",9),c(1,"warning"),o())}function Km(t,r){if(t&1&&u(0,Qm,2,0,"mat-icon",9),t&2){let e=r.$implicit,i=d();f(i.whiteListEnabled()&&e.data.invalidVatVerificationStatus?0:-1)}}function Ym(t,r){if(t&1&&(c(0),T(1,"currencyFormatPipe")),t&2){let e=r.$implicit;te("",B(1,2,e.data.amount)," ",e.data.currency)}}function Xm(t,r){if(t&1&&(c(0),T(1,"date")),t&2){let e=r.$implicit,i=d();g(V(1,1,e.data.executionDate,i.DEFAULT_DATE_FORMAT))}}function Jm(t,r){if(t&1&&(a(0,"app-state-chip",10),c(1),T(2,"approvableItemStateView"),o()),t&2){let e=r.$implicit,i=d();p("tone",i.stateTone(e)),s(),g(V(2,2,e.state,e.actions.canApprove))}}var eu=new lt,hc=(()=>{class t{constructor(){this.items=I.required(),this.emptyMessage=I("Brak element\xF3w do wy\u015Bwietlenia"),this.stateService=v(Je),this.actionService=v(no),this.whiteListEnabled=v(Xi).whiteListEnabled,this.DEFAULT_DATE_FORMAT=H,this.rowId=e=>e.id,this.columns=b(()=>[{id:"info",header:"Nazwa / Odbiorca / Tytu\u0142"},{id:"vatWarning",header:"",width:this.whiteListEnabled()?"40px":"0",compact:!0},{id:"amount",header:"Kwota",width:"160px",align:"end",numeric:!0},{id:"sourceAccount",header:"Z rachunku",width:"280px",secondary:!0,numeric:!0,value:e=>si.ibanFormat(e.data.sourceAccount??"")},{id:"recipientAccount",header:"Na rachunek",width:"280px",secondary:!0,numeric:!0,value:e=>si.ibanFormat(e.data.recipientAccount??"")},{id:"executionDate",header:"Data",width:"115px",secondary:!0,numeric:!0},{id:"state",header:"Stan",width:"190px"}]),this.stateTone=Sa}itemInfo(e){let i=On(e),{data:n}=e;return Lt(e)?{line1:i,line2:fc(e,n.itemCount!=null?`Element\xF3w: ${n.itemCount}`:"")}:Ii(e)?{line1:i,line2:n.name}:mi(e)?{line1:i,line2:tu(n)}:di(e)?{line1:i,line2:n.name}:{line1:i,line2:fc(e,n.recipientName?n.name:"")}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-approvable-item-table"]],inputs:{items:[1,"items"],emptyMessage:[1,"emptyMessage"]},decls:6,vars:10,consts:[[3,"selectedChange","rowClick","rows","columns","rowId","selectable","selected","activeId","twoLine","loading","error","emptyMessage"],["appListCell","info"],["appListCell","vatWarning"],["appListCell","amount"],["appListCell","executionDate"],["appListCell","state"],[1,"info-cell"],[1,"info-cell__title"],[1,"info-cell__subtitle"],["matTooltip","Negatywna weryfikacja VAT",1,"vat-warning-icon"],[3,"tone"]],template:function(i,n){if(i&1&&(a(0,"app-data-table",0),m("selectedChange",function(h){return n.stateService.setSelectedItems(h)}
3)("rowClick",function(h){return n.actionService.showDetails(h)}),Z(1,Zm,4,2,"ng-template",1)(2,Km,1,1,"ng-template",2)(3,Ym,2,4,"ng-template",3)(4,Xm,2,4,"ng-template",4)(5,Jm,3,5,"ng-template",5),o()),i&2){let l;p("rows",n.items())("columns",n.columns())("rowId",n.rowId)("selectable",!0)("selected",n.stateService.selectedItems())("activeId",((l=n.stateService.activeItem())==null?null:l.id)??null)("twoLine",!0)("loading",n.stateService.loading())("error",n.stateService.error()?"Wyst\u0105pi\u0142 b\u0142\u0105d podczas pobierania danych":null)("emptyMessage",n.emptyMessage())}},dependencies:[ie,q,Qt,qt,rc,to,_a,He,ae,$,ba],styles:["app-data-table[_ngcontent-%COMP%]{flex:1;min-height:0}.info-cell[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.info-cell__title[_ngcontent-%COMP%], .info-cell__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.info-cell__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.vat-warning-icon[_ngcontent-%COMP%]{width:24px;height:24px;font-size:24px;vertical-align:middle;color:#e65100}"],changeDetection:0})}}return t})();function fc(t,r){return[eu.transform(t.type),r].filter(e=>e!=="").join(" \xB7 ")}function tu(t){let r=[];return t.interest!=null&&r.push(`${t.interest}%`),t.period!=null&&r.push(`${t.period} dni`),r.length>0?r.join(" / "):null}var iu="yyyy-MM-dd_HH-mm-ss",xr=(()=>{class t{constructor(){this.approvalsApi=v(Wt),this.fileService=v(bs),this.destroyRef=v(ze),this._downloading=j(!1),this.downloading=this._downloading.asReadonly()}download(e){this._downloading()||(this._downloading.set(!0),this.approvalsApi.getItemFile(e.id).pipe(this.fileService.save(this.fileName(e),Cs.PDF),ee(()=>this._downloading.set(!1)),Ue(this.destroyRef)).subscribe())}fileName(e){return`Wydruk_${Lt(e)?"paczki":"dyspozycji"}_${Me.getTodayWithTime(iu)}.pdf`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var Vt=(()=>{class t{constructor(){this.approvalsApi=v(Wt),this.destroyRef=v(ze),this._state=j({status:"idle"}),this._child=j({status:"idle"}),this._closeRequested=j(!1),this.currentItemId=null,this.loading=b(()=>this._state().status==="loading"),this.error=b(()=>this._state().status==="error"),this.data=b(()=>{let e=this._state();return e.status==="loaded"?e.data:null}),this.closeRequested=this._closeRequested.asReadonly(),this.childOpen=b(()=>this._child().status!=="idle"),this.childLoading=b(()=>this._child().status==="loading"),this.childError=b(()=>this._child().status==="error"),this.child=b(()=>{let e=this._child();return e.status==="loaded"?e.data:null})}load(e){this.currentItemId=e,this._child.set({status:"idle"}),this.fetch()}refresh(){this.currentItemId&&this.fetch()}requestClose(){this._closeRequested.set(!0)}openChild(e){let i=this.currentItemId;i&&(this._child.set({status:"loading"}),this.approvalsApi.getChildNodeDetails(i,e.id).pipe(Ue(this.destroyRef)).subscribe({next:n=>this._child.set({status:"loaded",data:n}),error:()=>this._child.set({status:"error"})}))}closeChild(){this._child.set({status:"idle"})}fetch(){let e=this.currentItemId;e&&(this._state.set({status:"loading"}),this.approvalsApi.getItemDetails(e).pipe(Ue(this.destroyRef)).subscribe({next:i=>this._state.set({status:"loaded",data:i}),error:()=>this._state.set({status:"error"})}))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var Dr=(()=>{class t{constructor(){this.convertToDraftApi=v(Si),this.authFlow=v(an),this.notifications=v(K),this.detailsState=v(Vt),this.approvalsState=v(Je),this.destroyRef=v(ze)}withdrawForEdit(e){this.authFlow.run(this.convertToDraftApi,[e],{title:"Autoryzacja wycofania do edycji",summary:this.buildSummary(e)}).pipe(Ue(this.destroyRef)).subscribe({next:()=>{this.notifications.success("Pozycja zosta\u0142a wycofana do edycji."),this.approvalsState.loadApprovableItems(),this.detailsState.requestClose()},error:()=>{}})}buildSummary(e){let i=this.approvalsState.activeItem();
3return i?{component:Mi,inputs:{items:[i]}}:`Element ${e}`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();function nu(t,r){if(t&1&&(a(0,"app-state-chip",5),c(1),T(2,"approvableItemStateView"),o()),t&2){let e=r,i=d();ge("content-banner__badge--approved",e==="APPROVED"),p("tone",i.tone()),s(),U(" ",V(2,4,e,i.canApprove())," ")}}var ni=(()=>{class t{constructor(){this.title=I.required(),this.subtitle=I.required(),this.amount=I.required(),this.currency=I.required(),this.state=I(null),this.actions=I(null),this.canApprove=b(()=>this.actions()?.canApprove??!1),this.tone=b(()=>{let e=this.state();return e?Sa({state:e,actions:{canApprove:this.canApprove()}}):"neutral"})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-approval-details-head"]],inputs:{title:[1,"title"],subtitle:[1,"subtitle"],amount:[1,"amount"],currency:[1,"currency"],state:[1,"state"],actions:[1,"actions"]},decls:9,vars:7,consts:[[1,"content-banner"],[1,"content-banner__subtitle"],[1,"content-banner__title"],[1,"content-banner__amount"],[1,"content-banner__badge",3,"content-banner__badge--approved","tone"],[1,"content-banner__badge",3,"tone"]],template:function(i,n){if(i&1&&(a(0,"div",0)(1,"span",1),c(2),o(),a(3,"h2",2),c(4),o(),a(5,"span",3),c(6),T(7,"currencyFormatPipe"),o(),u(8,nu,3,7,"app-state-chip",4),o()),i&2){let l;s(2),g(n.subtitle()),s(2),g(n.title()),s(2),te("",B(7,5,n.amount())," ",n.currency()),s(2),f((l=n.state())?8:-1,l)}},dependencies:[He,_a,$,ba],styles:[".content-banner[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:4px}.content-banner__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.5px;text-transform:uppercase;color:var(--lv-on-surface-variant, #44474e)}.content-banner__title[_ngcontent-%COMP%]{margin:0;font-size:22px;line-height:28px;font-weight:400;overflow-wrap:anywhere}.content-banner__amount[_ngcontent-%COMP%]{margin:16px 0 8px;font-size:32px;line-height:40px;font-variant-numeric:tabular-nums}"],changeDetection:0})}}return t})();var Tr=Xc(Jc());function ou(t,r){t&1&&(a(0,"strong"),c(1,"Nowa data realizacji"),o())}function au(t,r){t&1&&c(0," Data realizacji ")}var _c=(()=>{class t{constructor(){this.dialogRef=v(ye),this.data=v(Ae),this.formattedAmount=this.formatAmou
3nt()}formatAmount(){let e=(0,Tr.default)(this.data.amount,{precision:2}).format();return(0,Tr.default)(e,{symbol:this.data.currency,separator:" ",pattern:"# !",negativePattern:"- # !"}).format().trim()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-execute-confirm-dialog"]],decls:24,vars:4,consts:[["mat-dialog-title",""],[1,"execute-confirm__list"],["align","end"],["mat-button","","type","button",3,"click"],["mat-flat-button","","color","warn","type","button",3,"click"]],template:function(i,n){i&1&&(a(0,"h2",0),c(1,"Realizacja pozycji"),o(),a(2,"mat-dialog-content")(3,"p"),c(4,"Czy na pewno chcesz przekaza\u0107 poni\u017Csz\u0105 pozycj\u0119 do realizacji?"),o(),a(5,"dl",1)(6,"dt"),c(7,"Pozycja"),o(),a(8,"dd"),c(9),o(),a(10,"dt"),c(11,"Kwota"),o(),a(12,"dd"),c(13),o(),a(14,"dt"),u(15,ou,2,0,"strong")(16,au,1,0),o(),a(17,"dd"),c(18),o()()(),a(19,"mat-dialog-actions",2)(20,"button",3),m("click",function(){return n.dialogRef.close(!1)}),c(21,"Anuluj"),o(),a(22,"button",4),m("click",function(){return n.dialogRef.close(!0)}),c(23,"Realizuj"),o()()),i&2&&(s(9),g(n.data.name),s(4),g(n.formattedAmount),s(2),f(n.data.executionDateOverridden?15:16),s(3),g(n.data.executionDate))},dependencies:[we,Ct,No,Fo,Ro,Ji],styles:[".execute-confirm__list[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.25rem 1rem;margin:0}.execute-confirm__list[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:#0009}.execute-confirm__list[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0}"],changeDetection:0})}}return t})();var yr=(()=>{class t{constructor(){this.executeApi=v(ko),this.dialog=v(fe),this.notifications=v(K),this.detailsState=v(Vt),this.approvalsState=v(Je),this.destroyRef=v(ze),this._state=j({status:"idle"}),this.isSubmitting=b(()=>this._state().status==="submitting"),this.errorCode=b(()=>{let e=this._state();return e.status==="error"?e.code:null}),this.errorMessage=b(()=>{let e=this._state();return e.status==="error"?e.message:null}),this.dispositionErrors=b(()=>{let e=this._state();return e.status==="error"?e.dispositionErrors??null:null})}execute(e,i){let n=this.buildDialogData(i);n&&this.dialog.open(_c,{data:n}).afterClosed().pipe(ce(l=>l===!0),y(()=>(this._state.set({status:"submitting"}),this.executeApi.executeItem(e,i?{executionDate:i}:void 0))),Ue(this.destroyRef)).subscribe({next:()=>this.handleSuccess(),error:l=>this.handleError(l)})}buildDialogData(e){let i=this.approvalsState.activeItem();if(!i)return null;let n=i.data.executionDate??"";return{name:i.data.name,amount:i.data.amount,currency:i.data.currency,executionDate:e??n,executionDateOverridden:!!e}}handleSuccess(){this._state.set({status:"idle"}),this.notifications.success("Pozycja przekazana do realizacji."),this.approvalsState.loadApprovableItems(),this.detailsState.requestClose()}handleError(e){let i=e instanceof wo?this.parseErrorBody(e.error):null,n=i?.code??Po.INTERNAL_ERROR;this._state.set({status:"error",code:n,message:io(n),dispositionErrors:i?.errors})}parseErrorBody(e){return e&&typeof e=="object"&&"code"in e?e:null}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var ru=(t,r)=>r.dispositionId;function su(t,r){if(t&1&&(a(0,"span",9),c(1,"Data realizacji jest z przesz\u0142o\u015Bci \u2014 podaj now\u0105 dat\u0119:"),o(),a(2,"mat-form-field",10)(3,"mat-label"),c(4,"Nowa data"),o(),C(5,"input",11)(6,"mat-datepicker-toggle",12)(7,"mat-datepicker",null,0),o()),t&2){let e=re(8),i=d(2);s(5),p("matDatepicker",e)("min",i.today),s(),p("for",e)}}function lu(t,r){t&1&&C(0,"mat-spinner",7)}function cu(t,r){if(t&1&&(a(0,"li")(1,"span",17),c(2),o(),c(3),o()),t&2){let e=r.$implicit,i=d(4);s(2),g(e.dispositionType),s(),U(": ",i.dispositionErrorMessage(e.code)," ")}}function pu(t,r){if(t&1&&(a(0,"ul",16),ne(1,cu,4,2,"li",null,ru),o()),t&2){d();let e=bo(6);s(),oe(e)}}function du(t,r){if(t&1&&(a(0,"div",8)(1,"mat-icon",13),c(2,"error_outline"),o(),a(3,"div",14)(4,"p",15),c(5),o(),vo(6),u(7,pu,3,0,"ul",16),o()()),t&2){s(5),g(r),s();let e=Co(d(2).dispositionErrors());s(),f(e&&e.length>0?7:-1)}}function mu(t,r){if(t&1){let e=F();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"span",4),c(4,"Data realizacji"),o(),a(5,"span",5),c(6),T(7,"date"),o()(),u(8,su,9,3),a(9,"button",6),m("click",function(){P(e);let n=d();return O(n.execute())}),u(10,lu,1,0,"mat-spinner",7),c(11," Realizuj "),o()(),u(12,du,8,3,"div",8),o()}if(t&2){let e,i=d();s(),p("formGroup",i.form),s(5),g(V(7,6,i.response().details.executionDate,i.DEFAULT_DATE_FORMAT)),s(2),f(i.isPastExecutionDate()?8:-1),s(),p("disabled",i.executeDisabled()),s(),f(i.isSubmitting()?10:-1),s(2),f((e=i.errorMessage())?12:-1,e)}}var oi=(()=>{class t{constructor(){this.response=I.required(),this.form=new Zr({executionDate:new Mo(null,[xe.required])}),this.isPastExecutionDate=b(()=>gc(this.response().details.executionDate).getTime()<this.today.getTime()),this.DEFAULT_DATE_FORMAT=H,this.dispositionErrorMessage=dc,this.userFacade=v(Pe),this.canView=this.userFacade.hasAuthorities([Q.FUNC_EXECUTE]),this.actionState=v(yr),this.isSubmitting=this.actionState.isSubmitting,this.errorMessage=this.actionState.errorMessage,this.dispositionErrors=this.actionState.dispositionErrors}get today(){return gc(new Date)}executeDisabled(){return this.isSubmitting()||this.isPastExecutionDate()&&!this.form.controls.executionDate.value}execute(){let e=this.form.controls.executionDate.value,i=this.isPastExecutionDate()&&e?uu(e):void 0;this.actionState.execute(this.response().id,i)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-approval-execution"]],inputs:{response:[1,"response"]},features:[Ut([yr])],decls:1,vars:1,consts:[["picker",""],[1,"detail-card","execute-card"],[1,"execute-card__row",3,"formGroup"],[1,"execute-card__field"],[1,"execute-card__label"],[1,"execute-card__value"],["mat-flat-button","","color","warn","type","button",1,"execute-card__button",3,"click","disabled"],["diameter","16",1,"execute-card__spinner"],[1,"execute-card__error"],[1,"execute-card__hint"],["appearance","outline","subscriptSizing","dynamic",1,"execute-card__date-field"],["matInput","","formControlName","executionDate",3,"matDatepicker","min"],["matSuffix","",3,"for"],[1,"execute-card__error-icon"],[1,"execute-card__error-body"],[1,"execute-card__error-message"],[1,"execute-card__error-list"],[1,"execute-card__error-type"]],template:function(i,n){i&1&&u(0,mu,13,9,"div",1),i&2&&f(n.canView&&n.response().actions.canExecute?0:-1)},dependencies:[Le,Ki,ve,De,tt,gt,Kr,we,Ct,ie,q,bt,it,en,be,Ie,St,tn,Se,Ho,xt,Dt,Tt,ae],styles:[".details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:2rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.detail-card[_ngcontent-%COMP%]{padding:var(--spacing-l) 0 0;margin-bottom:var(--spacing-l)}.detail-card__section-title[_ngcontent-%COMP%]{margin:0 0 var(--spacing-s);font-size:14px;line-height:20px;font-weight:500;color:var(--lv-on-surface-variant, #44474e)}.detail-card__audit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin-top:var(--spacing-md);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;min-height:56px;padding:var(--spacing-s) 0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.4px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid__value[_ngcontent-%COMP%]{font-size:16px;line-height:24px;letter-spacing:.5px;overflow-wrap:anywhere}.flat-grid__value--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.flat-grid__value--warning[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--spacing-xs);color:#e65100}.flat-grid__warning-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.disposition-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.disposition-list__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);width:100%;min-height:56px;padding:var(--spacing-s) 0;border:0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf);background:none;font:inherit;text-align:left;color:inherit;cursor:pointer}.disposition-list__row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.disposition-list__row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.disposition-list__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.disposition-list__title[_ngcontent-%COMP%], .disposition-list__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disposition-list__title[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.disposition-list__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}
3.disposition-list__amount[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.disposition-list__warning[_ngcontent-%COMP%]{flex-shrink:0;width:20px;height:20px;font-size:20px;color:#e65100}.disposition-list__chevron[_ngcontent-%COMP%]{flex-shrink:0;color:var(--lv-on-surface-variant, #44474e)}.child-nodes-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--spacing-s);padding:var(--spacing-s) 0}.child-nodes-pagination__label[_ngcontent-%COMP%]{font-size:13px;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #44474e)}",".execute-card[_ngcontent-%COMP%]{padding:var(--spacing-md) var(--spacing-l);border:1px solid var(--lv-outline-variant, #c4c6cf);border-radius:12px;background:var(--lv-surface-1, #f5f5f5)}.execute-card__row[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--spacing-md)}.execute-card__field[_ngcontent-%COMP%]{display:flex;flex-direction:column}.execute-card__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.execute-card__value[_ngcontent-%COMP%]{font-size:14px;line-height:20px;font-weight:500;font-variant-numeric:tabular-nums}.execute-card__date-field[_ngcontent-%COMP%]{width:100%;margin-bottom:0}.execute-card__hint[_ngcontent-%COMP%]{font-size:13px;line-height:18px;color:#b71c1c}.execute-card__button[_ngcontent-%COMP%]{align-self:flex-end}.execute-card__spinner[_ngcontent-%COMP%]{display:inline-block;margin-right:.5rem}.execute-card__error[_ngcontent-%COMP%]{display:flex;align-items:flex-start;gap:.75rem;margin-top:var(--spacing-md);padding:.75rem 1rem;border-radius:8px;background:#fdecea;border:1px solid #f5c6cb;color:#b71c1c}.execute-card__error-icon[_ngcontent-%COMP%]{flex-shrink:0;font-size:22px;width:22px;height:22px;line-height:22px}.execute-card__error-message[_ngcontent-%COMP%]{margin:0;font-size:14px;font-weight:500;line-height:22px}.execute-card__error-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.execute-card__error-list[_ngcontent-%COMP%]{margin:.25rem 0 0;padding-left:1.25rem;font-size:13px}.execute-card__error-type[_ngcontent-%COMP%]{font-weight:600}"],changeDetection:0})}}return t})();function gc(t){let r=t instanceof Date?t:new Date(t);return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function uu(t){let r=t.getFullYear(),e=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${r}-${e}-${i}`}var oo=(()=>{class t{constructor(){this.approvalsApi=v(Wt),this.approvalsAuthApi=v(Ci),this.approvalsRevokeAuthApi=v(bi),this.authFlow=v(an),this.detailsState=v(Vt),this.approvalsState=v(Je),this.destroyRef=v(ze),this._state=j({status:"idle"}),this.currentItemId=null,this.isLoading=b(()=>this._state().status==="loading"),this.isError=b(()=>this._state().status==="error"),this.signatures=b(()=>{let e=this._state();return e.status==="loaded"?e.signatures:null})}load(e){this.currentItemId=e,this._state.set({status:"loading"}),this.approvalsApi.getApprovals(e).pipe(Ue(this.destroyRef)).subscribe({next:i=>this._state.set({status:"loaded",signatures:i.approvals}),error:()=>this._state.set({status:"error"})})}sign(){this.runAuthFlow(this.approvalsAuthApi,"Autoryzacja podpisu")}revokeAll(){this.runAuthFlow(this.approvalsRevokeAuthApi,"Autoryzacja wycofania podpis\xF3w")}runAuthFlow(e,i){let n=this.currentItemId;n&&this.authFlow.run(e,[n],{title:i,summary:this.buildSummary(n)}).pipe(Ue(this.destroyRef)).subscribe({next:()=>{this.load(n),this.detailsState.refresh(),this.approvalsState.loadApprovableItems()},error:()=>{}})}buildSummary(e){let i=this.approvalsState.activeItem();return i?{component:Mi,inputs:{items:[i]}}:`Element ${e}`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();function vc(t){if(t===0)return"Brak podpis\xF3w";if(t===1)return"1 podpis";let r=t%100,e=t%10;return e>=2&&e<=4&&(r<12||r>14)?`${t} podpisy`:`${t} podpis\xF3w`}function fu(t,r){if(t&1&&(a(0,"mat-icon",7),c(1,"chevron_right"),o()),t&2){let e=d(2);ge("signatures__chevron--open",e.expanded())}}function hu(t,r){t&1&&(C(0,"mat-spinner",8),a(1,"span",5),c(2,"\u0141adowanie podpis\xF3w\u2026"),o())}function _u(t,r){t&1&&(a(0,"span",4),c(1,"Nie uda\u0142o si\u0119 pobra\u0107 podpis\xF3w"),o())}function gu(t,r){if(t&1&&(a(0,"span",5),c(1),o()),t&2){let e=d(2);s(),g(e.countLabel())}}function vu(t,r){if(t&1&&(a(0,"li",9)(1,"span",10),c(2),o(),a(3,"span",11),c(4),T(5,"date"),o()()),t&2){let e=r.$implicit,i=d(3);s(2),g(e.approvedBy),s(2),g(V(5,2,e.approvedAt,i.DEFAULT_DATE_TIME_PIPE_FORMAT))}}function Cu(t,r){if(t&1&&(a(0,"ul",6),ne(1,vu,6,5,"li",9,Lr),o()),t&2){d();let e=bo(0);s(),oe(e)}}function bu(t,r){if(t&1){let e=F();vo(0),a(1,"div",0)(2,"div",1),m("click",function(){P(e);let n=d();return O(n.toggle())}),a(3,"div",2),u(4,fu,2,2,"mat-icon",3),u(5,hu,3,0)(6,_u,2,0,"span",4)(7,gu,2,1,"span",5),o()(),u(8,Cu,3,0,"ul",6),o()}if(t&2){let e=d(),i=Co(e.signatures());
3s(2),ge("signatures__header--clickable",e.canToggle()),s(2),f(e.canToggle()?4:-1),s(),f(e.isLoading()?5:e.isError()?6:7),s(3),f(e.expanded()&&i&&i.length>0?8:-1)}}var ai=(()=>{class t{constructor(){this.service=v(oo),this.userFacade=v(Pe),this.canView=this.userFacade.hasAuthorities([Q.FUNC_SIGN]),this.signatures=this.service.signatures,this.isLoading=this.service.isLoading,this.isError=this.service.isError,this.count=b(()=>this.signatures()?.length??0),this.countLabel=b(()=>vc(this.count())),this.canToggle=b(()=>!this.isLoading()&&!this.isError()&&this.count()>0),this.expanded=j(!1),this.DEFAULT_DATE_TIME_PIPE_FORMAT=Et}toggle(){this.canToggle()&&this.expanded.update(e=>!e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-approval-signatures"]],decls:1,vars:1,consts:[[1,"detail-card","signatures"],[1,"signatures__header",3,"click"],[1,"signatures__summary"],[1,"signatures__chevron",3,"signatures__chevron--open"],[1,"signatures__label","signatures__label--error"],[1,"signatures__label"],[1,"signatures__list"],[1,"signatures__chevron"],["diameter","16"],[1,"signatures__item"],[1,"signatures__name"],[1,"signatures__date"]],template:function(i,n){i&1&&u(0,bu,9,6,"div",0),i&2&&f(n.canView?0:-1)},dependencies:[Le,ie,q,bt,it,ae],styles:[".details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:2rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.detail-card[_ngcontent-%COMP%]{padding:var(--spacing-l) 0 0;margin-bottom:var(--spacing-l)}.detail-card__section-title[_ngcontent-%COMP%]{margin:0 0 var(--spacing-s);font-size:14px;line-height:20px;font-weight:500;color:var(--lv-on-surface-variant, #44474e)}.detail-card__audit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin-top:var(--spacing-md);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;min-height:56px;padding:var(--spacing-s) 0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.4px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid__value[_ngcontent-%COMP%]{font-size:16px;line-height:24px;letter-spacing:.5px;overflow-wrap:anywhere}.flat-grid__value--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.flat-grid__value--warning[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--spacing-xs);color:#e65100}.flat-grid__warning-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.disposition-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.disposition-list__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);width:100%;min-height:56px;padding:var(--spacing-s) 0;border:0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf);background:none;font:inherit;text-align:left;color:inherit;cursor:pointer}.disposition-list__row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.disposition-list__row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.disposition-list__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.disposition-list__title[_ngcontent-%COMP%], .disposition-list__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disposition-list__title[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.disposition-list__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.disposition-list__amount[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.disposition-list__warning[_ngcontent-%COMP%]{flex-shrink:0;width:20px;height:20px;font-size:20px;color:#e65100}.disposition-list__chevron[_ngcontent-%COMP%]{flex-shrink:0;color:var(--lv-on-surface-variant, #44474e)}.child-nodes-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--spacing-s);padding:var(--spacing-s) 0}.child-nodes-pagination__label[_ngcontent-%COMP%]{font-size:13px;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #44474e)}",".signatures__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem}.signatures__header--clickable[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none}.signatures__summary[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;min-width:0}.signatures__chevron[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;color:#757575;transition:transform .15s ease-in-out}.signatures__chevron--open[_ngcontent-%COMP%]{transform:rotate(90deg)}.signatures__label[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#37474f}.signatures__label--error[_ngcontent-%COMP%]{color:#d32f2f}.signatures__actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;flex-shrink:0}.signatures__list[_ngcontent-%COMP%]{list-style:none;margin:.75rem 0 0;padding:.75rem 0 0;border-top:1px solid #eeeeee;display:flex;flex-direction:column;gap:.25rem}.signatures__item[_ngcontent-%COMP%]{display:flex;align-items:baseline;gap:1rem;padding:.375rem 0}.signatures__item[_ngcontent-%COMP%] + .signatures__item[_ngcontent-%COMP%]{border-top:1px dashed #f0f0f0}.signatures__name[_ngcontent-%COMP%]{font-size:14px;color:#212121}.signatures__date[_ngcontent-%COMP%]{font-size:12px;color:#757575;white-space:nowrap}"],changeDetection:0})}}return t})();var Su=(t,r)=>r.id;function Eu(t,r){if(t&1&&(a(0,"div",4)(1,"span",5),c(2,"Kwota VAT"),o(),a(3,"span",6),c(4),T(5,"currencyFormatPipe"),o()()),t&2){let e=d();
3s(4),te("",B(5,2,e.details().vatAmount)," ",e.details().currency)}}function xu(t,r){t&1&&(a(0,"mat-icon",10),c(1,"warning"),o())}function Du(t,r){t&1&&c(0," Pozytywna ")}function Tu(t,r){t&1&&c(0," Negatywna ")}function yu(t,r){t&1&&c(0," Brak weryfikacji ")}function Au(t,r){if(t&1&&(a(0,"div",4)(1,"span",5),c(2,"Weryfikacja VAT paczki"),o(),a(3,"span",9),u(4,xu,2,0,"mat-icon",10),u(5,Du,1,0)(6,Tu,1,0)(7,yu,1,0),o()()),t&2){let e,i=d();s(3),ge("flat-grid__value--warning",i.isBundleVatVerificationWarning()),s(),f(i.isBundleVatVerificationWarning()?4:-1),s(),f((e=i.details().bundleVatVerificationStatus)===i.BundleVatVerificationStatus.POSITIVE?5:e===i.BundleVatVerificationStatus.NEGATIVE?6:7)}}function wu(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),te("Ostatnia modyfikacja ",V(2,2,e.details().auditData.modifiedAt,e.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",e.details().auditData.modifiedBy)}}function Iu(t,r){t&1&&(a(0,"div",12),C(1,"mat-spinner",13),o())}function Mu(t,r){t&1&&(a(0,"div",12)(1,"span",14),c(2,"Nie uda\u0142o si\u0119 pobra\u0107 dyspozycji"),o()())}function Pu(t,r){t&1&&(a(0,"div",12)(1,"span"),c(2,"Brak dyspozycji"),o()())}function Ou(t,r){t&1&&(a(0,"mat-icon",20),c(1,"warning"),o())}function ku(t,r){if(t&1){let e=F();a(0,"li")(1,"button",16),m("click",function(){let n=P(e).$implicit,l=d(3);return O(l.openChild(n))}),a(2,"span",17)(3,"span",18),c(4),o(),a(5,"span",19),c(6),o()(),u(7,Ou,2,0,"mat-icon",20),a(8,"span",21),c(9),T(10,"currencyFormatPipe"),o(),a(11,"mat-icon",22),c(12,"chevron_right"),o()()()}if(t&2){let e=r.$implicit,i=d(3);s(4),g(e.recipientName),s(2),g(e.title),s(),f(i.whiteListEnabled()&&e.invalidVatVerificationStatus?7:-1),s(2),te("",B(10,5,e.amount)," ",e.currency)}}function Fu(t,r){if(t&1){let e=F();a(0,"div",23)(1,"button",24),m("click",function(){P(e);let n=d(),l=d(3);return O(l.loadPage(+n.previousPage))}),a(2,"mat-icon"),c(3,"chevron_left"),o()(),a(4,"span",25),c(5),o(),a(6,"button",26),m("click",function(){P(e);let n=d(),l=d(3);return O(l.loadPage(+n.nextPage))}),a(7,"mat-icon"),c(8,"chevron_right"),o()()()}if(t&2){let e=d(),i=d(3);s(),p("disabled",!e.previousPage||i.childNodesLoading()),s(4),te("",i.currentPage()+1," / ",e.maxPageNumber+1),s(),p("disabled",!e.nextPage||i.childNodesLoading())}}function Ru(t,r){t&1&&u(0,Fu,9,4,"div",23),t&2&&f(r.maxPageNumber>0?0:-1)}function Nu(t,r){if(t&1&&(a(0,"ul",15),ne(1,ku,13,7,"li",null,Su),o(),u(3,Ru,1,1)),t&2){let e,i=d(2);s(),oe(i.childNodes()),s(2),f((e=i.pageInfo())?3:-1,e)}}function Bu(t,r){if(t&1&&(a(0,"div",8)(1,"h4",11),c(2,"Dyspozycje"),o(),u(3,Iu,2,0,"div",12)(4,Mu,3,0,"div",12)(5,Pu,3,0,"div",12)(6,Nu,4,1),o()),t&2){let e=d();s(3),f(e.childNodesLoading()&&e.childNodes().length===0?3:e.childNodesError()?4:e.childNodes().length===0?5:6)}}var Cc=(()=>{class t{constructor(){this.response=I.required(),this.details=b(()=>this.response().details),this.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=Et,this.ChildNodesType=Wa,this.BundleVatVerificationStatus=Ha,this.whiteListEnabled=v(Xi).whiteListEnabled,this.isBundleVatVerificationWarning=b(()=>this.details().bundleVatVerificationStatus!==Ha.POSITIVE),this.childNodes=j([]),this.pageInfo=j(null),this.currentPage=j(0),this.childNodesLoading=j(!1),this.childNodesError=j(!1),this.approvalsApiService=v(Wt),this.detailsState=v(Vt)}ngOnInit(){this.response().childNodesType===Wa.DISPOSITION&&this.loadPage(0)}loadPage(e){this.childNodesLoading.set(!0),this.childNodesError.set(!1),this.approvalsApiService.getChildNodes(this.response().id,e).pipe(ee(()=>this.childNodesLoading.set(!1))).subscribe({next:i=>{this.childNodes.set(i.childNodes),this.pageInfo.set(i.pageInfo),this.currentPage.set(e)},error:()=>this.childNodesError.set(!0)})}openChild(e){this.detailsState.openChild(e)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-bundle-details"]],inputs:{response:[1,"response"]},decls:26,vars:25,consts:[[3,"title","subtitle","amount","currency","state","actions"],[3,"response"],[1,"detail-card"],[1,"flat-grid"],[1,"flat-grid__field"],[1,"flat-grid__label"],[1,"flat-grid__value","flat-grid__value--numeric"],[1,"detail-card__audit"],[1,"detail-card","detail-card--dispositions"],[1,"flat-grid__value"],[1,"flat-grid__warning-icon"],[1,"detail-card__section-title"],[1,"details-view__status"],["diameter","24"],[1,"details-view__error"],[1,"disposition-list"],["type","button",1,"disposition-list__row",3,"click"],[1,"disposition-list__text"],[1,"disposition-list__title"],[1,"disposition-list__subtitle"],["matTooltip","Negatywna weryfikacja VAT",1,"disposition-list__warning"],[1,"disposition-list__amount"],[1,"disposition-list__chevron"],[1,"child-nodes-pagination"],["mat-icon-button","","aria-label","Poprzednia strona",3,"click","disabled"],[1,"child-nodes-pagination__label"],["mat-icon-button","","aria-label","Nast\u0119pna strona",3,"click","disabled"]],template:function(i,n){i&1&&(C(0,"app-approval-details-head",0),T(1,"approvableItemTypeView"),C(2,"app-approval-signatures")(3,"app-approval-execution",1),a(4,"div",2)(5,"div",3)(6,"div",4)(7,"span",5),c(8,"Rachunek \u017Ar\xF3d\u0142owy"),o(),a(9,"span",6),c(10),T(11,"ibanFormatPipe"),o()(),u(12,Eu,6,4,"div",4),a(13,"div",4)(14,"span",5),c(15,"Data wykonania"),o(),a(16,"span",6),c(17),T(18,"date"),o()(),u(19,Au,8,4,"div",4),o(),a(20,"div",7)(21,"span"),c(22),T(23,"date"),o(),u(24,wu,3,5,"span"),o()(),u(25,Bu,7,1,"div",8)),i&2&&(p("title",n.details().title)("subtitle",B(1,15,n.response().type))("amount",n.details().amount)("currency",n.details().currency)("state",n.response().state)("actions",n.response().actions),s(3),p("response",n.response()),s(7),g(B(11,17,n.details().sourceAccount)),s(2),f(n.details().vatAmou
3nt?12:-1),s(5),g(V(18,19,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.whiteListEnabled()?19:-1),s(3),te("Utworzono ",V(23,22,n.details().auditData.createdAt,n.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",n.details().auditData.createdBy),s(2),f(n.details().auditData.modifiedBy&&n.details().auditData.modifiedAt?24:-1),s(),f(n.response().childNodesType===n.ChildNodesType.DISPOSITION?25:-1))},dependencies:[Le,He,vt,q,it,qt,ie,we,bt,Qt,ni,ai,oi,ae,J,$,lt],styles:[".details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:2rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.detail-card[_ngcontent-%COMP%]{padding:var(--spacing-l) 0 0;margin-bottom:var(--spacing-l)}.detail-card__section-title[_ngcontent-%COMP%]{margin:0 0 var(--spacing-s);font-size:14px;line-height:20px;font-weight:500;color:var(--lv-on-surface-variant, #44474e)}.detail-card__audit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin-top:var(--spacing-md);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;min-height:56px;padding:var(--spacing-s) 0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.4px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid__value[_ngcontent-%COMP%]{font-size:16px;line-height:24px;letter-spacing:.5px;overflow-wrap:anywhere}.flat-grid__value--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.flat-grid__value--warning[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--spacing-xs);color:#e65100}.flat-grid__warning-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.disposition-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.disposition-list__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);width:100%;min-height:56px;padding:var(--spacing-s) 0;border:0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf);background:none;font:inherit;text-align:left;color:inherit;cursor:pointer}.disposition-list__row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.disposition-list__row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.disposition-list__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.disposition-list__title[_ngcontent-%COMP%], .disposition-list__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disposition-list__title[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.disposition-list__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.disposition-list__amount[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.disposition-list__warning[_ngcontent-%COMP%]{flex-shrink:0;width:20px;height:20px;font-size:20px;color:#e65100}.disposition-list__chevron[_ngcontent-%COMP%]{flex-shrink:0;color:var(--lv-on-surface-variant, #44474e)}.child-nodes-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--spacing-s);padding:var(--spacing-s) 0}.child-nodes-pagination__label[_ngcontent-%COMP%]{font-size:13px;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #44474e)}"],changeDetection:0})}}return t})();function zu(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function Lu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Oprocentowanie"),o(),a(3,"span",8),c(4),o()()),t&2){let e=d(2);s(4),U("",e.details().depositData.interest,"%")}}function Vu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Okres"),o(),a(3,"span",8),c(4),o()()),t&2){let e=d(2);
3s(4),te("",e.details().depositData.period," ",e.formatPeriodUnit(e.details().depositData.periodUnit))}}function ju(t,r){if(t&1&&(u(0,Lu,5,1,"div",3),u(1,Vu,5,2,"div",3)),t&2){let e=d();f(e.details().depositData.interest!==null?0:-1),s(),f(e.details().depositData.period!==null?1:-1)}}function Uu(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),te("Ostatnia modyfikacja ",V(2,2,e.details().auditData.modifiedAt,e.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",e.details().auditData.modifiedBy)}}var bc=(()=>{class t{constructor(){this.response=I.required(),this.details=b(()=>this.response().details),this.approvableItem=b(()=>{let e=this.response();return"actions"in e?e:null}),this.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=Et}formatPeriodUnit(e){switch(e){case vi.DAY:return"dni";case vi.MONTH:return"mies.";case vi.YEAR:return"lat";default:return""}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-deposit-details"]],inputs:{response:[1,"response"]},decls:23,vars:22,consts:[["subtitle","Lokata",3,"title","amount","currency","state","actions"],[1,"detail-card"],[1,"flat-grid"],[1,"flat-grid__field"],[1,"flat-grid__label"],[1,"flat-grid__value","flat-grid__value--numeric"],[1,"detail-card__audit"],[3,"response"],[1,"flat-grid__value"]],template:function(i,n){if(i&1&&(C(0,"app-approval-details-head",0),T(1,"approvableItemTypeView"),u(2,zu,2,1),a(3,"div",1)(4,"div",2)(5,"div",3)(6,"span",4),c(7,"Rachunek \u017Ar\xF3d\u0142owy"),o(),a(8,"span",5),c(9),T(10,"ibanFormatPipe"),o()(),a(11,"div",3)(12,"span",4),c(13,"Data wykonania"),o(),a(14,"span",5),c(15),T(16,"date"),o()(),u(17,ju,2,2),o(),a(18,"div",6)(19,"span"),c(20),T(21,"date"),o(),u(22,Uu,3,5,"span"),o()()),i&2){let l,h,D;p("title",B(1,12,n.response().type))("amount",n.details().amount)("currency",n.details().currency)("state",((l=n.approvableItem())==null?null:l.state)??null)("actions",((h=n.approvableItem())==null?null:h.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),g(B(10,14,n.details().sourceAccount)),s(6),g(V(16,16,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.details().depositData?17:-1),s(3),te("Utworzono ",V(21,19,n.details().auditData.createdAt,n.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",n.details().auditData.createdBy),s(2),f(n.details().auditData.modifiedBy&&n.details().auditData.modifiedAt?22:-1)}},dependencies:[Le,He,ni,ai,oi,ae,J,lt],styles:[".details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:2rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.detail-card[_ngcontent-%COMP%]{padding:var(--spacing-l) 0 0;margin-bottom:var(--spacing-l)}.detail-card__section-title[_ngcontent-%COMP%]{margin:0 0 var(--spacing-s);font-size:14px;line-height:20px;font-weight:500;color:var(--lv-on-surface-variant, #44474e)}.detail-card__audit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin-top:var(--spacing-md);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;min-height:56px;padding:var(--spacing-s) 0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.4px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid__value[_ngcontent-%COMP%]{font-size:16px;line-height:24px;letter-spacing:.5px;overflow-wrap:anywhere}.flat-grid__value--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.flat-grid__value--warning[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--spacing-xs);color:#e65100}.flat-grid__warning-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.disposition-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.disposition-list__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);width:100%;min-height:56px;padding:var(--spacing-s) 0;border:0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf);background:none;font:inherit;text-align:left;color:inherit;cursor:pointer}.disposition-list__row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.disposition-list__row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.disposition-list__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.disposition-list__title[_ngcontent-%COMP%], .disposition-list__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disposition-list__title[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.disposition-list__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}
3.disposition-list__amount[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.disposition-list__warning[_ngcontent-%COMP%]{flex-shrink:0;width:20px;height:20px;font-size:20px;color:#e65100}.disposition-list__chevron[_ngcontent-%COMP%]{flex-shrink:0;color:var(--lv-on-surface-variant, #44474e)}.child-nodes-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--spacing-s);padding:var(--spacing-s) 0}.child-nodes-pagination__label[_ngcontent-%COMP%]{font-size:13px;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #44474e)}"],changeDetection:0})}}return t})();function Gu(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function Wu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Numer telefonu"),o(),a(3,"span",5),c(4),o()()),t&2){let e=d();s(4),g(e.details().phoneNumber)}}function Hu(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),te("Ostatnia modyfikacja ",V(2,2,e.details().auditData.modifiedAt,e.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",e.details().auditData.modifiedBy)}}var Sc=(()=>{class t{constructor(){this.response=I.required(),this.details=b(()=>this.response().details),this.approvableItem=b(()=>{let e=this.response();return"actions"in e?e:null}),this.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=Et}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-gsm-top-up-details"]],inputs:{response:[1,"response"]},decls:23,vars:22,consts:[["subtitle","Do\u0142adowanie",3,"title","amount","currency","state","actions"],[1,"detail-card"],[1,"flat-grid"],[1,"flat-grid__field"],[1,"flat-grid__label"],[1,"flat-grid__value","flat-grid__value--numeric"],[1,"detail-card__audit"],[3,"response"]],template:function(i,n){if(i&1&&(C(0,"app-approval-details-head",0),T(1,"approvableItemTypeView"),u(2,Gu,2,1),a(3,"div",1)(4,"div",2)(5,"div",3)(6,"span",4),c(7,"Rachunek \u017Ar\xF3d\u0142owy"),o(),a(8,"span",5),c(9),T(10,"ibanFormatPipe"),o()(),a(11,"div",3)(12,"span",4),c(13,"Data wykonania"),o(),a(14,"span",5),c(15),T(16,"date"),o()(),u(17,Wu,5,1,"div",3),o(),a(18,"div",6)(19,"span"),c(20),T(21,"date"),o(),u(22,Hu,3,5,"span"),o()()),i&2){let l,h,D;p("title",B(1,12,n.response().type))("amount",n.details().amount)("currency",n.details().currency)("state",((l=n.approvableItem())==null?null:l.state)??null)("actions",((h=n.approvableItem())==null?null:h.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),g(B(10,14,n.details().sourceAccount)),s(6),g(V(16,16,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.details().phoneNumber?17:-1),s(3),te("Utworzono ",V(21,19,n.details().auditData.createdAt,n.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",n.details().auditData.createdBy),s(2),f(n.details().auditData.modifiedBy&&n.details().auditData.modifiedAt?22:-1)}},dependencies:[Le,He,ni,ai,oi,ae,J,lt],styles:[".details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:2rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.detail-card[_ngcontent-%COMP%]{padding:var(--spacing-l) 0 0;margin-bottom:var(--spacing-l)}.detail-card__section-title[_ngcontent-%COMP%]{margin:0 0 var(--spacing-s);font-size:14px;line-height:20px;font-weight:500;color:var(--lv-on-surface-variant, #44474e)}.detail-card__audit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin-top:var(--spacing-md);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;min-height:56px;padding:var(--spacing-s) 0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.4px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid__value[_ngcontent-%COMP%]{font-size:16px;line-height:24px;letter-spacing:.5px;overflow-wrap:anywhere}.flat-grid__value--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.flat-grid__value--warning[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--spacing-xs);color:#e65100}.flat-grid__warning-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.disposition-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.disposition-list__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);width:100%;min-height:56px;padding:var(--spacing-s) 0;border:0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf);background:none;font:inherit;text-align:left;color:inherit;cursor:pointer}.disposition-list__row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.disposition-list__row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.disposition-list__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.disposition-list__title[_ngcontent-%COMP%], .disposition-list__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disposition-list__title[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.disposition-list__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}
3.disposition-list__amount[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.disposition-list__warning[_ngcontent-%COMP%]{flex-shrink:0;width:20px;height:20px;font-size:20px;color:#e65100}.disposition-list__chevron[_ngcontent-%COMP%]{flex-shrink:0;color:var(--lv-on-surface-variant, #44474e)}.child-nodes-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--spacing-s);padding:var(--spacing-s) 0}.child-nodes-pagination__label[_ngcontent-%COMP%]{font-size:13px;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #44474e)}"],changeDetection:0})}}return t})();function $u(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function qu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Rachunek odbiorcy"),o(),a(3,"span",5),c(4),T(5,"ibanFormatPipe"),o()()),t&2){let e=d();s(4),g(B(5,1,e.details().recipientAccount))}}function Zu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Nazwa odbiorcy"),o(),a(3,"span",8),c(4),o()()),t&2){let e=d();s(4),g(e.details().recipientName)}}function Qu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Tytu\u0142"),o(),a(3,"span",8),c(4),o()()),t&2){let e=d();s(4),g(e.details().title)}}function Ku(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Kwota VAT"),o(),a(3,"span",5),c(4),T(5,"currencyFormatPipe"),o()()),t&2){let e=d();s(4),te("",B(5,2,e.details().vatAmount)," ",e.details().currency)}}function Yu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Data zako\u0144czenia"),o(),a(3,"span",5),c(4),T(5,"date"),o()()),t&2){let e=d(2);s(4),g(V(5,1,e.details().standingOrderData.endDate,e.DEFAULT_DATE_FORMAT))}}function Xu(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Cz\u0119stotliwo\u015B\u0107"),o(),a(3,"span",8),c(4),o()(),a(5,"div",3)(6,"span",4),c(7,"Data rozpocz\u0119cia"),o(),a(8,"span",5),c(9),T(10,"date"),o()(),u(11,Yu,6,4,"div",3)),t&2){let e=d();s(4),te("Co ",e.details().standingOrderData.period," ",e.formatStandingOrderUnit(e.details().standingOrderData.unit)),s(5),g(V(10,4,e.details().standingOrderData.startDate,e.DEFAULT_DATE_FORMAT)),s(2),f(e.details().standingOrderData.endDate?11:-1)}}function Ju(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),te("Ostatnia modyfikacja ",V(2,2,e.details().auditData.modifiedAt,e.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",e.details().auditData.modifiedBy)}}var Ec=(()=>{class t{constructor(){this.response=I.required(),this.details=b(()=>this.response().details),this.approvableItem=b(()=>{let e=this.response();return"actions"in e?e:null}),this.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=Et}formatStandingOrderUnit(e){switch(e){case vi.DAY:return"dzie\u0144";case vi.MONTH:return"miesi\u0105c";case vi.YEAR:return"rok";default:return""}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-standing-order-details"]],inputs:{response:[1,"response"]},decls:27,vars:26,consts:[["subtitle","Zlecenie sta\u0142e",3,"title","amount","currency","state","actions"],[1,"detail-card"],[1,"flat-grid"],[1,"flat-grid__field"],[1,"flat-grid__label"],[1,"flat-grid__value","flat-grid__value--numeric"],[1,"detail-card__audit"],[3,"response"],[1,"flat-grid__value"]],template:function(i,n){if(i&1&&(C(0,"app-approval-details-head",0),T(1,"approvableItemTypeView"),u(2,$u,2,1),a(3,"div",1)(4,"div",2)(5,"div",3)(6,"span",4),c(7,"Rachunek \u017Ar\xF3d\u0142owy"),o(),a(8,"span",5),c(9),T(10,"ibanFormatPipe"),o()(),u(11,qu,6,3,"div",3),u(12,Zu,5,1,"div",3),u(13,Qu,5,1,"div",3),u(14,Ku,6,4,"div",3),a(15,"div",3)(16,"span",4),c(17,"Data wykonania"),o(),a(18,"span",5),c(19),T(20,"date"),o()(),u(21,Xu,12,7),o(),a(22,"div",6)(23,"span"),c(24),T(25,"date"),o(),u(26,Ju,3,5,"span"),o()()),i&2){let l,h,D;p("title",B(1,16,n.response().type))("amount",n.details().amount)("currency",n.details().currency)("state",((l=n.approvableItem())==null?null:l.state)??null)("actions",((h=n.approvableItem())==null?null:h.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),g(B(10,18,n.details().sourceAccount)),s(2),f(n.details().recipientAccount?11:-1),s(),f(n.details().recipientName?12:-1),s(),f(n.details().title?13:-1),s(),f(n.details().vatAmou
3nt!==null?14:-1),s(5),g(V(20,20,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.details().standingOrderData?21:-1),s(3),te("Utworzono ",V(25,23,n.details().auditData.createdAt,n.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",n.details().auditData.createdBy),s(2),f(n.details().auditData.modifiedBy&&n.details().auditData.modifiedAt?26:-1)}},dependencies:[Le,He,ni,ai,oi,ae,J,$,lt],styles:[".details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:2rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.detail-card[_ngcontent-%COMP%]{padding:var(--spacing-l) 0 0;margin-bottom:var(--spacing-l)}.detail-card__section-title[_ngcontent-%COMP%]{margin:0 0 var(--spacing-s);font-size:14px;line-height:20px;font-weight:500;color:var(--lv-on-surface-variant, #44474e)}.detail-card__audit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin-top:var(--spacing-md);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;min-height:56px;padding:var(--spacing-s) 0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.4px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid__value[_ngcontent-%COMP%]{font-size:16px;line-height:24px;letter-spacing:.5px;overflow-wrap:anywhere}.flat-grid__value--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.flat-grid__value--warning[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--spacing-xs);color:#e65100}.flat-grid__warning-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.disposition-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.disposition-list__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);width:100%;min-height:56px;padding:var(--spacing-s) 0;border:0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf);background:none;font:inherit;text-align:left;color:inherit;cursor:pointer}.disposition-list__row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.disposition-list__row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.disposition-list__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.disposition-list__title[_ngcontent-%COMP%], .disposition-list__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disposition-list__title[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.disposition-list__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.disposition-list__amount[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.disposition-list__warning[_ngcontent-%COMP%]{flex-shrink:0;width:20px;height:20px;font-size:20px;color:#e65100}.disposition-list__chevron[_ngcontent-%COMP%]{flex-shrink:0;color:var(--lv-on-surface-variant, #44474e)}.child-nodes-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--spacing-s);padding:var(--spacing-s) 0}.child-nodes-pagination__label[_ngcontent-%COMP%]{font-size:13px;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #44474e)}"],changeDetection:0})}}return t})();function ef(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function tf(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Rachunek odbiorcy"),o(),a(3,"span",5),c(4),T(5,"ibanFormatPipe"),o()()),t&2){let e=d();s(4),g(B(5,1,e.details().recipientAccount))}}function nf(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Nazwa odbiorcy"),o(),a(3,"span",8),c(4),o()()),t&2){let e=d();s(4),g(e.details().recipientName)}}function of(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Tytu\u0142"),o(),a(3,"span",8),c(4),o()()),t&2){let e=d();s(4),g(e.details().title)}}function af(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Kwota VAT"),o(),a(3,"span",5),c(4),T(5,"currencyFormatPipe"),o()()),t&2){let e=d();
3s(4),te("",B(5,2,e.details().vatAmount)," ",e.details().currency)}}function rf(t,r){t&1&&(a(0,"mat-icon",9),c(1,"warning"),o())}function sf(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Weryfikacja VAT"),o(),a(3,"span",8),u(4,rf,2,0,"mat-icon",9),c(5),o()()),t&2){let e=d();s(3),ge("flat-grid__value--warning",e.isVatVerificationWarning()),s(),f(e.isVatVerificationWarning()?4:-1),s(),U(" ",e.formatVatVerificationStatus(e.details().vatVerificationStatus)," ")}}function lf(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"SORBNET"),o(),a(3,"span",8),c(4),o()()),t&2){let e=d();s(4),g(e.details().isSorbnet?"Tak":"Nie")}}function cf(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),te("Ostatnia modyfikacja ",V(2,2,e.details().auditData.modifiedAt,e.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",e.details().auditData.modifiedBy)}}var xc=(()=>{class t{constructor(){this.response=I.required(),this.details=b(()=>this.response().details),this.approvableItem=b(()=>{let e=this.response();return"actions"in e?e:null}),this.isVatVerificationWarning=b(()=>this.details().vatVerificationStatus!==Ri.REGISTERED),this.whiteListEnabled=v(Xi).whiteListEnabled,this.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=Et}formatVatVerificationStatus(e){switch(e){case Ri.REGISTERED:return"Zarejestrowany";case Ri.NOT_REGISTERED:return"Niezarejestrowany";case Ri.CHECK_UNSUCCESSFUL:return"Weryfikacja nieudana";case Ri.ERROR:return"B\u0142\u0105d weryfikacji";case Ri.INVALID_NIP:return"Nieprawid\u0142owy NIP";default:return"Brak weryfikacji"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-transfer-details"]],inputs:{response:[1,"response"]},decls:28,vars:28,consts:[[3,"title","subtitle","amount","currency","state","actions"],[1,"detail-card"],[1,"flat-grid"],[1,"flat-grid__field"],[1,"flat-grid__label"],[1,"flat-grid__value","flat-grid__value--numeric"],[1,"detail-card__audit"],[3,"response"],[1,"flat-grid__value"],[1,"flat-grid__warning-icon"]],template:function(i,n){if(i&1&&(C(0,"app-approval-details-head",0),T(1,"approvableItemTypeView"),u(2,ef,2,1),a(3,"div",1)(4,"div",2)(5,"div",3)(6,"span",4),c(7,"Rachunek \u017Ar\xF3d\u0142owy"),o(),a(8,"span",5),c(9),T(10,"ibanFormatPipe"),o()(),u(11,tf,6,3,"div",3),u(12,nf,5,1,"div",3),u(13,of,5,1,"div",3),u(14,af,6,4,"div",3),a(15,"div",3)(16,"span",4),c(17,"Data wykonania"),o(),a(18,"span",5),c(19),T(20,"date"),o()(),u(21,sf,6,4,"div",3),u(22,lf,5,1,"div",3),o(),a(23,"div",6)(24,"span"),c(25),T(26,"date"),o(),u(27,cf,3,5,"span"),o()()),i&2){let l,h,D;p("title",n.details().recipientName)("subtitle",B(1,18,n.response().type))("amount",n.details().amount)("currency",n.details().currency)("state",((l=n.approvableItem())==null?null:l.state)??null)("actions",((h=n.approvableItem())==null?null:h.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),g(B(10,20,n.details().sourceAccount)),s(2),f(n.details().recipientAccount?11:-1),s(),f(n.details().recipientName?12:-1),s(),f(n.details().title?13:-1),s(),f(n.details().vatAmount!==null?14:-1),s(5),g(V(20,22,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.whiteListEnabled()?21:-1),s(),f(n.details().isSorbnet!==null?22:-1),s(3),te("Utworzono ",V(26,25,n.details().auditData.createdAt,n.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",n.details().auditData.createdBy),s(2),f(n.details().auditData.modifiedBy&&n.details().auditData.modifiedAt?27:-1)}},dependencies:[Le,He,q,ie,ni,ai,oi,ae,J,$,lt],styles:[".details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:2rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.detail-card[_ngcontent-%COMP%]{padding:var(--spacing-l) 0 0;margin-bottom:var(--spacing-l)}.detail-card__section-title[_ngcontent-%COMP%]{margin:0 0 var(--spacing-s);font-size:14px;line-height:20px;font-weight:500;color:var(--lv-on-surface-variant, #44474e)}.detail-card__audit[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2px;margin-top:var(--spacing-md);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid[_ngcontent-%COMP%]{display:flex;flex-direction:column;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__field[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;min-height:56px;padding:var(--spacing-s) 0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf)}.flat-grid__label[_ngcontent-%COMP%]{font-size:12px;line-height:16px;letter-spacing:.4px;color:var(--lv-on-surface-variant, #44474e)}.flat-grid__value[_ngcontent-%COMP%]{font-size:16px;line-height:24px;letter-spacing:.5px;overflow-wrap:anywhere}.flat-grid__value--numeric[_ngcontent-%COMP%]{font-variant-numeric:tabular-nums}.flat-grid__value--warning[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:var(--spacing-xs);color:#e65100}.flat-grid__warning-icon[_ngcontent-%COMP%]{width:18px;height:18px;font-size:18px}.disposition-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;border-top:1px solid var(--lv-outline-variant, #c4c6cf)}.disposition-list__row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-s);width:100%;min-height:56px;padding:var(--spacing-s) 0;border:0;border-bottom:1px solid var(--lv-outline-variant, #c4c6cf);background:none;font:inherit;text-align:left;color:inherit;cursor:pointer}.disposition-list__row[_ngcontent-%COMP%]:hover{background:var(--lv-hover-bg, rgba(0, 0, 0, .05))}.disposition-list__row[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--lv-primary, currentColor);outline-offset:-2px}.disposition-list__text[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.disposition-list__title[_ngcontent-%COMP%], .disposition-list__subtitle[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disposition-list__title[_ngcontent-%COMP%]{font-size:14px;line-height:20px}.disposition-list__subtitle[_ngcontent-%COMP%]{font-size:12px;line-height:16px;color:var(--lv-on-surface-variant, #44474e)}
3.disposition-list__amount[_ngcontent-%COMP%]{flex-shrink:0;font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap}.disposition-list__warning[_ngcontent-%COMP%]{flex-shrink:0;width:20px;height:20px;font-size:20px;color:#e65100}.disposition-list__chevron[_ngcontent-%COMP%]{flex-shrink:0;color:var(--lv-on-surface-variant, #44474e)}.child-nodes-pagination[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:var(--spacing-s);padding:var(--spacing-s) 0}.child-nodes-pagination__label[_ngcontent-%COMP%]{font-size:13px;font-variant-numeric:tabular-nums;color:var(--lv-on-surface-variant, #44474e)}"],changeDetection:0})}}return t})();function pf(t,r){t&1&&(a(0,"div",2),C(1,"mat-spinner",4),o())}function df(t,r){t&1&&(a(0,"div",2)(1,"span",5),c(2,"Nie uda\u0142o si\u0119 pobra\u0107 szczeg\xF3\u0142\xF3w dyspozycji"),o()())}function mf(t,r){if(t&1&&C(0,"app-transfer-details",6),t&2){let e=d();p("response",e)}}function uf(t,r){if(t&1&&u(0,mf,1,1,"app-transfer-details",6),t&2){let e=d(2);f(e.isTransferType(r)?0:-1)}}function ff(t,r){if(t&1&&u(0,pf,2,0,"div",2)(1,df,3,0,"div",2)(2,uf,1,1),t&2){let e,i=d();f(i.detailsState.childLoading()?0:i.detailsState.childError()?1:(e=i.detailsState.child())?2:-1,e)}}function hf(t,r){t&1&&(a(0,"div",2),C(1,"mat-spinner",4),o())}function _f(t,r){t&1&&(a(0,"div",2)(1,"span",5),c(2,"Nie uda\u0142o si\u0119 pobra\u0107 szczeg\xF3\u0142\xF3w"),o()())}function gf(t,r){if(t&1&&C(0,"app-transfer-details",6),t&2){let e=d();p("response",e)}}function vf(t,r){if(t&1&&C(0,"app-bundle-details",6),t&2){let e=d();p("response",e)}}function Cf(t,r){if(t&1&&C(0,"app-standing-order-details",6),t&2){let e=d();p("response",e)}}function bf(t,r){if(t&1&&C(0,"app-deposit-details",6),t&2){let e=d();p("response",e)}}function Sf(t,r){if(t&1&&C(0,"app-gsm-top-up-details",6),t&2){let e=d();p("response",e)}}function Ef(t,r){if(t&1&&u(0,gf,1,1,"app-transfer-details",6)(1,vf,1,1,"app-bundle-details",6)(2,Cf,1,1,"app-standing-order-details",6)(3,bf,1,1,"app-deposit-details",6)(4,Sf,1,1,"app-gsm-top-up-details",6),t&2){let e=r,i=d();f(i.isTransferType(e)?0:i.isBundleType(e)?1:i.isStandingOrderType(e)?2:i.isDepositType(e)?3:i.isGsmType(e)?4:-1)}}function xf(t,r){if(t&1){let e=F();a(0,"button",11),m("click",function(){P(e);let n=d(2);return O(n.signaturesService.sign())}),a(1,"mat-icon"),c(2,"edit"),o(),c(3," Podpisz "),o()}}function Df(t,r){if(t&1){let e=F();a(0,"button",12),m("click",function(){P(e);let n=d(2);return O(n.signaturesService.revokeAll())}),a(1,"mat-icon"),c(2,"undo"),o(),c(3," Wycofaj podpisy "),o()}}function Tf(t,r){if(t&1){let e=F();a(0,"button",13),m("click",function(){P(e);let n=d(),l=d();return O(l.withdrawForEditService.withdrawForEdit(n.id))}),a(1,"mat-icon"),c(2,"undo"),o(),c(3," Wycofaj do edycji "),o()}}function yf(t,r){if(t&1){let e=F();a(0,"button",14),m("click",function(){P(e);let n=d(),l=d();return O(l.printoutService.download(n))}),a(1,"mat-icon"),c(2,"print"),o()()}if(t&2){let e=d(2);p("disabled",e.printoutService.downloading())}}function Af(t,r){if(t&1&&(u(0,xf,4,0,"button",7),u(1,Df,4,0,"button",8),u(2,Tf,4,0,"button",9),u(3,yf,3,1,"button",10)),t&2){let e=r,i=d();f(i.canSign&&e.actions.canApprove?0:-1),s(),f(i.canSign&&e.actions.canRevokeApproval?1:-1),s(),f(e.actions.canWithdrawForEdit?2:-1),s(),f(i.canPrint()?3:-1)}}var Dc=(()=>{class t{constructor(){this.itemId=I.required(),this.back=Rt(),this.detailsState=v(Vt),this.signaturesService=v(oo),this.withdrawForEditService=v(Dr),this.printoutService=v(xr),this.userFacadeService=v(Pe),this.injector=v(Nr),this.isTransferType=ga,this.isBundleType=Lt,this.isStandingOrderType=di,this.isDepositType=mi,this.isGsmType=Ii,this.loading=this.detailsState.loading,this.error=this.detailsState.error,this.data=this.detailsState.data,this.childOpen=this.detailsState.childOpen,this.canSign=this.userFacadeService.hasAuthorities([Q.FUNC_SIGN]),this.canPrint=b(()=>{let e=this.data();return e!==null&&!mi(e)&&!di(e)}),this.hasFooterActions=b(()=>{let e=this.data();return e?this.canSign&&(e.actions.canApprove||e.actions.canRevokeApproval)||e.actions.canWithdrawForEdit||this.canPrint():!1}),this.panelTitle=b(()=>{if(this.childOpen())return"Dyspozycja z paczki";let e=this.data();return e&&Lt(e)?"Szczeg\xF3\u0142y paczki":"Szczeg\xF3\u0142y dyspozycji"}),this.panel=Do.required(ha),this.itemScrollTop=0,$i(()=>{let e=this.itemId();this.detailsState.load(e),this.canSign&&this.signaturesService.load(e)}),$i(()=>{let e=this.childOpen();xo(()=>{e?(this.itemScrollTop=this.panel().bodyScrollTop,this.panel().scrollBodyTo(0)):qi(()=>this.panel().scrollBodyTo(this.itemScrollTop),{injector:this.injector})})}),$i(()=>{this.detailsState.closeRequested()&&this.back.emit()})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-approval-details-view"]],viewQuery:function(i,n){i&1&&go(n.panel,ha,5),i&2&&Pi()},inputs:{itemId:[1,"itemId"]},outputs:{back:"back"},features:[Ut([Vt,oo,Dr,xr,Ci,bi,Si])],decls:8,vars:7,consts:[[3,"back","closed","title","showBack"],[1,"details-view__item",3,"hidden"],[1,"details-view__status"],[1,"details-view__actions",3,"appDetailPanelActions"],["diameter","40"],[1,"details-view__error"],[3,"response"],["mat-flat-button","","color","warn",1,"approve-btn"],["mat-stroked-button","",1,"revoke-btn"],["mat-stroked-button","",1,"withdraw-for-edit-btn"],["mat-icon-button","","matTooltip","Pobierz wydruk","aria-label","Pobierz wydruk",1,"printout-btn",3,"disabled"],["mat-flat-button","","color","warn",1,"approve-btn",3,"click"],["mat-stroked-button","",1,"revoke-btn",3,"click"],["mat-stroked-button","",1,"withdraw-for-edit-btn",3,"click"],["mat-icon-button","","matTooltip","Pobierz wydruk","aria-label","Pobierz wydruk",1,"printout-btn",3,"click","disabled"]],template:function(i,n){if(i&1&&(a(0,"app-detail-panel",0),m("back",function(){return n.detailsState.closeChild()})("closed",function(){return n.back.emit()}),u(1,ff,3,1),a(2,"div",1),u(3,hf,2,0,"div",2)(4,_f,3,0,"div",2)(5,Ef,5,1),o(),a(6,"div",3),u(7,Af,4,4),o()()),i&2){let l,h;p("title",n.panelTitle())("showBack",n.childOpen()),s(),f(n.childOpen()?1:-1),s(),p("hidden",n.childOpen()),s(),f(n.loading()?3:n.error()?4:(l=n.data())?5:-1,l),s(3),p("appDetailPanelActions",n.hasFooterActions()&&!n.childOpen()),s(),f((h=n.data())?7:-1,h)}},dependencies:[ie,q,we,Ct,vt,bt,it,Qt,qt,ha,fa,xc,Cc,Ec,bc,Sc],styles:["[_nghost-%COMP%]{display:block;height:100%}.details-view__status[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:3rem 0}.details-view__error[_ngcontent-%COMP%]{font-size:14px;color:var(--color-warn, #d32f2f)}.details-view__actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--spacing-md);width:100%}.details-view__actions[_ngcontent-%COMP%] .mdc-button[_ngcontent-%COMP%]{height:40px}.details-view__actions[_ngcontent-%COMP%] .printout-btn[_ngcontent-%COMP%]{--mdc-icon-button-state-layer-size: 40px;margin-left:auto}"],changeDetection:0})}}return t})();function yc(t){return[{id:"q",kind:"search",label:"Szukaj",placeholder:"Nazwa, odbiorca, tytu\u0142, rachunek"},{id:"account",kind:"select",label:"Rachunek",allLabel:"Wszystkie rachunki",options:t,width:"320px"},{id:"type",kind:"select",label:"Typ",allLabel:"Wszystkie typy",options:[{value:"transfer",label:"Przelewy"},{value:"bundle",label:"Paczki"},{value:"deposit",label:"Lokaty"},{value:"standingOrder",label:"Zlecenia sta\u0142e"},{value:"gsm",label:"Do\u0142adowania GSM"}]},{id:"date",kind:"select",label:"Data wykonania",allLabel:"Dowolna data",options:[{value:"today",label:"Dzi\u015B"},{value:"7d",label:"\xB17 dni"},{value:"30d",label:"\xB130 dni"}]}]}function Ac(t){return[...new Set(t.map(e=>ao(e.data.sourceAccount)).filter(e=>e!==""))].sort().map(e=>({value:e,label:si.ibanFormat(e)}))}function ao(t){return(t??"").replace(/\s+/g,"").toUpperCase()}var wf=864e5,If={transfer:ga,bundle:Lt,deposit:mi,standingOrder:di,gsm:Ii};function wc(t){return Object.values(t).some(r=>r!=="")}function Ic(t,r,e=new Date){let i=(r.q??"").trim().toLowerCase(),n=ao(i),l=ao(r.account),h=If[r.type??""],D=r.date??"";return t.filter(R=>l!==""&&ao(R.data.sourceAccount)!==l||h&&!h(R)||!Mf(R.data.executionDate,D,e)?!1:i===""?!0:[On(R),R.data.name,R.data.recipientName??""].some(se=>se.toLowerCase().includes(i))||[R.data.sourceAccount,R.data.recipientAccount].some(se=>ao(se).includes(n)))}function Mf(t,r,e){if(r===""||!t)return!0;let i=Math.round((Tc(new Date(t)).getTime()-Tc(e).getTime())/wf);return r==="today"?i===0:r==="7d"?Math.abs(i)<=7:r==="30d"?Math.abs(i)<=30:!0}function Tc(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}var Pf=(t,r)=>r.index;function Of(t,r){if(t&1){let e=F();a(0,"a",15),m("click",function(){let n=P(e).$implicit,l=d();return O(l.onTabChange(n.index))}),c(1),a(2,"span",16),c(3),o()()}if(t&2){let e=r.$implicit,i=d();p("active",i.stateService.activeTabIndex()===e.index),s(),U(" ",e.label," "),s(2),g(e.items().length)}}function kf(t,r){if(t&1){let e=F();a(0,"app-approval-details-view",17),m("back",function(){P(e);let n=d();return O(n.stateService.closeDetails())}),o()}t&2&&p("itemId",r.id)}var Mc=["to-approve","approved"],Pc=["q","account","type","date"],Ea=(()=>{class t{constructor(){this.stateService=v(Je),this.actionService=v(no),this.router=v(Fi),this.route=v(Xr),this.tabs=[{index:0,label:"Do podpisu",items:this.stateService.toApproveItems},{index:1,label:"Gotowe do realizacji",items:this.stateService.approvedItems}],this.filters=b(()=>
3yc(Ac(this.stateService.approvableItems()))),this.itemTotals=va,this.activeItems=b(()=>this.tabs[this.stateService.activeTabIndex()]?.items()??[]),this.visibleItems=b(()=>Ic(this.activeItems(),this.stateService.filterValues())),this.emptyMessage=b(()=>wc(this.stateService.filterValues())?"Brak pozycji spe\u0142niaj\u0105cych filtry":"Brak element\xF3w do wy\u015Bwietlenia"),this.readQueryParams(),$i(()=>{let e=this.toQueryParams(this.stateService.activeTabIndex(),this.stateService.filterValues());xo(()=>this.router.navigate([],{relativeTo:this.route,queryParams:e,replaceUrl:!0}))})}ngOnInit(){this.stateService.loadApprovableItems()}switchToSignatures(){localStorage.removeItem(cn),this.router.navigate(["/",Ni,sn])}onTabChange(e){this.stateService.setActiveTabIndex(e),this.stateService.setSelectedItems([]),this.stateService.closeDetails()}readQueryParams(){let e=this.route.snapshot.queryParamMap,i=Mc.indexOf(e.get("tab"));i>0&&this.stateService.setActiveTabIndex(i);let n={};Pc.forEach(l=>{let h=e.get(l);h&&(n[l]=h)}),Object.keys(n).length>0&&this.stateService.setFilterValues(n)}toQueryParams(e,i){let n={tab:e>0?Mc[e]:null};return Pc.forEach(l=>n[l]=i[l]||null),n}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-approvals"]],features:[Ut([Je,no,Ca,Ci,bi,Si])],decls:22,vars:10,consts:[["tabPanel",""],[3,"panelClose","panelOpen"],["appListViewHeader","",1,"approvals__header"],[1,"approvals__header-left"],[1,"approvals__title"],["mat-stroked-button","",3,"click"],["mat-stroked-button","",1,"approvals__refresh",3,"click"],["appListViewHeader","","mat-tab-nav-bar","","mat-stretch-tabs","false","mat-align-tabs","start",1,"approvals__tabs",3,"tabPanel"],["mat-tab-link","",3,"active"],[1,"approvals"],[3,"clear","selected","actions","totals"],[3,"valuesChange","filters","values"],[1,"approvals__hint"],[3,"items","emptyMessage"],["appListViewPanel","",3,"itemId"],["mat-tab-link","",3,"click","active"],[1,"approvals__tab-count"],["appListViewPanel","",3,"back","itemId"]],template:function(i,n){if(i&1&&(a(0,"app-list-view-shell",1),m("panelClose",function(){return n.stateService.closeDetails()}),a(1,"div",2)(2,"div",3)(3,"h1",4),c(4,"Podpisy"),o(),a(5,"button",5),m("click",function(){return n.switchToSignatures()}),c(6,"Wr\xF3\u0107 do starego interfejsu"),o()(),a(7,"button",6),m("click",function(){return n.actionService.refresh()}),a(8,"mat-icon"),c(9,"refresh"),o(),c(10," Od\u015Bwie\u017C "),o()(),a(11,"nav",7),ne(12,Of,4,3,"a",8,Pf),o(),a(14,"mat-tab-nav-panel",9,0)(16,"app-selection-bar",10),m("clear",function(){return n.stateService.setSelectedItems([])}),a(17,"app-filter-bar",11),m("valuesChange",function(h){return n.stateService.setFilterValues(h)}),o()(),a(18,"p",12),c(19,"Ctrl + klik, aby zaznaczy\u0107 wiele element\xF3w | Shift + klik, aby zaznaczy\u0107 zakres"),o(),C(20,"app-approvable-item-table",13),o(),u(21,kf,1,1,"app-approval-details-view",14),o()),i&2){let l,h=re(15);p("panelOpen",n.stateService.activeItem()!==null),s(11),p("tabPanel",h),s(),oe(n.tabs),s(4),p("selected",n.stateService.selectedItems())("actions",n.actionService.actions)("totals",n.itemTotals),s(),p("filters",n.filters())("values",n.stateService.filterValues()),s(3),p("items",n.visibleItems())("emptyMessage",n.emptyMessage()),s(),f((l=n.stateService.activeItem())?21:-1,l)}},dependencies:[we,Ct,ie,q,Zs,Hs,qs,$s,lc,cc,sc,hc,Dc],styles:["[_nghost-%COMP%]{display:block;height:100%}app-list-view-shell[_ngcontent-%COMP%]{height:100%}.approvals__header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:var(--spacing-l);min-height:64px;padding:var(--spacing-s) var(--spacing-l) var(--spacing-s) var(--spacing-xl)}.approvals__header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:var(--spacing-l)}.approvals__title[_ngcontent-%COMP%]{margin:0;font-size:22px;line-height:28px;font-weight:400}.approvals__tabs[_ngcontent-%COMP%]{--mat-tab-active-indicator-color: var(--color-warn);--mat-tab-active-hover-indicator-color: var(--color-warn);--mat-tab-active-focus-indicator-color: var(--color-warn);--mat-tab-active-focus-label-text-color: var(--lv-on-surface);--mat-tab-active-hover-label-text-color: var(--lv-on-surface);--mat-tab-active-label-text-color: var(--lv-on-surface);--mat-tab-inactive-focus-label-text-color: var(--lv-on-surface-variant);--mat-tab-inactive-hover-label-text-color: var(--lv-on-surface-variant);--mat-tab-inactive-label-text-color: var(--lv-on-surface-variant);--mat-tab-divider-height: 0;padding:0 var(--spacing-xl);border-bottom:1px solid var(--lv-outline-variant)}.approvals__tab-count[_ngcontent-%COMP%]{display:inline-block;min-width:16px;margin-left:var(--spacing-s);padding:0 6px;border-radius:8px;font-size:12px;line-height:16px;text-align:center;font-variant-numeric:tabular-nums;background:var(--lv-surface-3);color:var(--lv-on-surface-variant)}.mdc-tab--active[_ngcontent-%COMP%] .approvals__tab-count[_ngcontent-%COMP%]{background:var(--lv-selected-bg);color:var(--lv-on-surface)}.approvals[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%;min-height:0;min-width:0}
3app-selection-bar[_ngcontent-%COMP%]{flex:none}.approvals__hint[_ngcontent-%COMP%]{flex:none;margin:0;padding:0 var(--spacing-xl) var(--spacing-s);font-size:12px;line-height:16px;color:var(--lv-on-surface-variant)}app-approvable-item-table[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0}"],changeDetection:0})}}return t})();var Oc=(()=>{class t{openBlank(){let e=window.open("","_blank");if(!e)return{windowRef:null,blocked:!0};try{return e.document.title="Loading...",e.document.documentElement.lang="pl",{windowRef:e,blocked:!1}}catch(i){return{windowRef:null,blocked:!0}}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var kc=(()=>{class t{constructor(e){this.http=e}getBasementData(){return this.http.get(Ms)}static{this.\u0275fac=function(i){return new(i||t)(G(Io))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ar=(()=>{class t{constructor(e,i,n){this.popupService=e,this.parameterService=i,this.basementService=n,this.state=j({status:"idle"}),this.loading=b(()=>this.state().status==="loading"),this.success=b(()=>this.state().status==="success"),this.popupBlocked=b(()=>this.state().status==="popup-blocked"),this.error=b(()=>this.state().status==="error"),this.errorMessage=b(()=>{let l=this.state();return l.status==="error"?l.message:""})}redirect(){let e=this.popupService.openBlank();if(e.blocked){this.state.set({status:"popup-blocked"});return}this.state.set({status:"loading"}),lo([this.parameterService.getParameterAsString(Ze.BASEMENT_EXCHANGE_URL).pipe(co(1)),this.basementService.getBasementData()]).subscribe({next:([i,n])=>{this.submitFormInPopup(e.windowRef,i,n),this.state.set({status:"success"})},error:i=>{e.windowRef?.close();let n=ls.isTypeOf(i)&&i.messageToShow?i.messageToShow:"Wyst\u0105pi\u0142 b\u0142\u0105d podczas przekierowywania do kantoru walutowego";this.state.set({status:"error",message:n})}})}submitFormInPopup(e,i,n){let l='<!DOCTYPE html><html lang="pl"><body><form id="f" action="'+i+'" method="POST"><input type="hidden" name="userId" value="'+n.userId+'"><input type="hidden" name="tokenSSO" value="'+n.tokenSSO+'"></form><script>document.getElementById("f").submit();<\/script></body></html>',h=new Blob([l],{type:"text/html"});e.location.href=URL.createObjectURL(h)}static{this.\u0275fac=function(i){return new(i||t)(G(Oc),G(Ei),G(kc))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();function Bf(t,r){t&1&&(a(0,"div",0),C(1,"mat-spinner",4),a(2,"p"),c(3,"Trwa przekierowywanie do kantoru walutowego..."),o()())}function zf(t,r){t&1&&(a(0,"div",1)(1,"div",5)(2,"mat-icon"),c(3,"check_circle"),o()(),a(4,"h3"),c(5,"Zostaniesz przeniesiony na stron\u0119 kantoru"),o(),a(6,"p"),c(7,"Kantor walutowy zosta\u0142 otwarty w nowym oknie przegl\u0105darki."),o()())}function Lf(t,r){if(t&1){let e=F();a(0,"div",2)(1,"div",6)(2,"mat-icon"),c(3,"error"),o()(),a(4,"h3"),c(5,"Wyst\u0105pi\u0142 b\u0142\u0105d"),o(),a(6,"p",7),c(7),o(),a(8,"div",8)(9,"app-button",9),m("clickAction",function(){P(e);let n=d();return O(n.retryRedirect())}),c(10," Spr\xF3buj ponownie "),o()()()}if(t&2){let e=d();s(7),g(e.errorMessage()),s(2),p("loading",e.loading())}}function Vf(t,r){if(t&1){let e=F();a(0,"div",3)(1,"div",10)(2,"mat-icon"),c(3,"block"),o()(),a(4,"h3"),c(5,"Nie uda\u0142o si\u0119 otworzy\u0107 kantoru walutowego"),o(),a(6,"p",11),c(7," Twoja przegl\u0105darka zablokowa\u0142a otwarcie nowego okna. Aby korzysta\u0107 z kantoru walutowego, zezw\xF3l na wyskakuj\u0105ce okna dla tej strony. "),o(),a(8,"div",12)(9,"h4"),c(10,"Jak to zrobi\u0107?"),o(),a(11,"ol")(12,"li"),c(13,"Poszukaj w pasku adresu przegl\u0105darki ikony zablokowanego okna lub powiadomienia o zablokowanym wyskakuj\u0105cym oknie."),o(),a(14,"li"),c(15,"Kliknij t\u0119 ikon\u0119 i wybierz opcj\u0119 zezwalaj\u0105c\u0105 na wyskakuj\u0105ce okna dla tej strony."),o(),a(16,"li"),c(17,"Po zmianie ustawie\u0144 kliknij przycisk poni\u017Cej, aby spr\xF3bowa\u0107 ponownie."),o()()(),a(18,"div",13)(19,"app-button",9),m("clickAction",function(){P(e);let n=d();return O(n.retryRedirect())}),c(20," Otw\xF3rz kantor walutowy "),o()(),a(21,"p",14),c(22,"Je\u015Bli problem nadal wyst\u0119puje, prosimy o kontakt z bankiem."),o()()}if(t&2){let e=d();s(19),p("loading",e.loading())}}var Fc=(()=>{class t{constructor(){this.currencyExchangeService=v(Ar),this.loading=this.currencyExchangeService.loading,this.success=this.currencyExchangeService.success,this.popupBlocked=this.currencyExchangeService.popupBlocked,this.error=this.currencyExchangeService.error,this.errorMessage=this.currencyExchangeService.errorMessage}ngOnInit(){this.currencyExchangeService.redirect()}retryRedirect(){this.currencyExchangeService.redirect()}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-currency-exchange"]],standalone:!1,features:[Ut([Ar])],decls:8,vars:1,consts:[[1,"currency-exchange__loading"],[1,"currency-exchange__success"],[1,"currency-exchange__error"],[1,"currency-exchange__blocked"],["diameter","48"],[1,"currency-exchange__success-icon"],[1,"currency-exchange__error-icon"],[1,"currency-exchange__error-message"],[1,"currency-exchange__error-action"],["icon","refresh",3,"clickAction","loading"],[1,"currency-exchange__blocked-icon"],[1,"currency-exchange__blocked-intro"],[1,"currency-exchange__instructions"],[1,"currency-exchange__blocked-action"],[1,"currency-exchange__blocked-footer"]],template:function(i,n){i&1&&(a(0,"app-page-container")(1,"app-page-header"),c(2,"Kantor walutowy"),o(),a(3,"a
3pp-page-content"),u(4,Bf,4,0,"div",0)(5,zf,8,0,"div",1)(6,Lf,11,2,"div",2)(7,Vf,23,1,"div",3),o()()),i&2&&(s(4),f(n.loading()?4:n.success()?5:n.error()?6:n.popupBlocked()?7:-1))},dependencies:[q,it,ot,at,rt,je],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem}.currency-exchange__loading[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:48px 24px;gap:16px}.currency-exchange__loading[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:14px;color:#616161}.currency-exchange__success[_ngcontent-%COMP%]{max-width:720px;margin:24px auto;padding:32px;background:#fff;border:1px solid #e0e0e0;border-radius:8px;text-align:center}.currency-exchange__success[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 8px;font-size:18px;font-weight:500;color:#2e7d32}.currency-exchange__success[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:13px;color:#616161;margin:0}.currency-exchange__success-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:16px}.currency-exchange__success-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;color:#2e7d32}.currency-exchange__error[_ngcontent-%COMP%]{max-width:720px;margin:24px auto;padding:32px;background:#fff;border:1px solid #e0e0e0;border-radius:8px;text-align:center}.currency-exchange__error[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 8px;font-size:18px;font-weight:500;color:#c62828}.currency-exchange__error-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:16px}.currency-exchange__error-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;color:#c62828}.currency-exchange__error-message[_ngcontent-%COMP%]{font-size:13px;color:#616161;margin:0 0 24px}.currency-exchange__error-action[_ngcontent-%COMP%]{display:flex;justify-content:center}.currency-exchange__blocked[_ngcontent-%COMP%]{max-width:720px;margin:24px auto;padding:32px;background:#fff;border:1px solid #e0e0e0;border-radius:8px}.currency-exchange__blocked[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin:0 0 8px;font-size:18px;font-weight:500;color:#424242;text-align:center}.currency-exchange__blocked-icon[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:16px}.currency-exchange__blocked-icon[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:48px;width:48px;height:48px;color:#f57c00}.currency-exchange__blocked-intro[_ngcontent-%COMP%]{font-size:13px;color:#616161;text-align:center;line-height:1.6;margin-bottom:24px}.currency-exchange__instructions[_ngcontent-%COMP%]{padding:16px;background:#fafafa;border:1px solid #eeeeee;border-radius:6px;margin-bottom:24px}.currency-exchange__instructions[_ngcontent-%COMP%] h4[_ngcontent-%COMP%]{margin:0 0 8px;font-size:14px;font-weight:500;color:#212121}.currency-exchange__instructions[_ngcontent-%COMP%] ol[_ngcontent-%COMP%]{margin:0;padding-left:20px}.currency-exchange__instructions[_ngcontent-%COMP%] ol[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{font-size:13px;color:#424242;line-height:1.6;margin-bottom:4px}.currency-exchange__blocked-action[_ngcontent-%COMP%]{display:flex;justify-content:center;margin-bottom:16px}.currency-exchange__blocked-footer[_ngcontent-%COMP%]{font-size:12px;color:#9e9e9e;text-align:center;margin:0}"]})}}return t})();var Rc=(()=>{class t{constructor(){this.quickRealizationService=v(Il)}prepare(e){return this.quickRealizationService.prepare(e,As)}perform(e){return this.quickRealizationService.perform(e,ws)}cancel(){return this.quickRealizationService.cancel(Is)}authorize(e){let i=e.map(n=>String(n.id));return this.quickRealizationService.authorize(this,i,wl([],Al.QUICK_REALIZATION))}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Uf=["depositTreeTable"],Gf=["filterExpansionPanel"],Wf="type",Nc=(()=>{class t{constructor(e,i,n,l,h,D,R,se){this.dialog=e,this.notificationService=i,this.depositService=n,this.depositQuickRealizationAdapterService=l,this.userFacadeService=h,this.storage=D,this.spinnerService=R,this.errorProviderService=se,this.details=new xi,this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.isDisabledEditionButton=!0,this.isDisabledDeleteButton=!0,this.isDisabledSigningButton=!0,this.isDisabledQuickRealizationButton=!0,this.isDisabledPrintButton=!0,this.filteringCheckboxes=[],this.chargedAccounts=[Ht],this.depositDialogEnum=Kn,this.createDepositPermission=!1,this.acceptPermission=!1,this.isRealizationAuthoritiesEnable=!1,this.destroy$=new pt,this.createDepositPermission=this.userFacadeService.hasAuthorities([Q.FUNC_DEPOSIT_CREATE]),this.acceptPermission=this.userFacadeService.hasAuthorities([Q.FUNC_ACCEPT]),this.isRealizationAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_EXECUTE]),this.modificationDepositFC=new A,this.breakingDepositFC=new A,this.openingDepositFC=new A,this.selectedAccountFC=new A(this.chargedAccounts[0].accountId),this.depositSearchFG=new ki({modificationDepositFC:this.modificationDepositFC,breakingDepositFC:this.breakingDepositFC,openingDepositFC:this.openingDepositFC,selectedAccountFC:this.selectedAccountFC}),this.setDefaultSearchingParameters();let le="asc",de=Wf;Promise.all([this.storage.getItem(sr),this.storage.getItem(lr)]).then(([Re,Ne])=>{Re&&Ne&&(de=Re,le=Ne)}).finally(()=>{this.tableProperties=this.depositService.tableProperties,this.tableProperties.matSortActive=de,this.tableProperties.matSortDirection=le}),this.prepareFilteringCheckboxes()}ngAfterViewInit(){this.loadAccountList(),this.initFiltersAndData()}onSearch(){this.loadDataSource().subscribe(),this.filterExpansionPanel.close()}receiveRowClickEvent(){this.toggleButtonsOn(),this.getDetails(),this.depositTreeTable.selection.selected.filter(e=>e.depositType===!0).length>0&&(this.isDisabledSigningButton=!0,this.isDisabledQuickRealizationButton=!0)}setDefaultSearchingParameters(){this.depositSearchFG.patchValue({selectedAccountFC:this.chargedAccounts[0].accountId,modificationDepositFC:!0,breakingDepositFC:!0,openingDepositFC:!0})}openAddDialog(e){this.dialog.open(gr,this.addConfig(e)).afterClosed().pipe(ce(n=>n),y(()=>this.loadDataSource())).subscribe()}openEditDialog(e){if(this.depositTreeTable.selection.selected[0].type===W.LOKATA_ZERWANIE){let i=new X;i.panelClass=Ce.SMALL,i.data={indexOfRow:this.indexOfRow,deposit:this.depositTreeTable.selection.selected[0]},this.dialog.open(vr,i).afterClosed().pipe(y(()=>this.loadDataSource())).subscribe()}else this.dialog.open(gr,this.addConfig(e)).afterClosed().pipe(ce(n=>n),y(()=>this.loadDataSource())).subscribe()}openDeleteDialog(){let e=this.depositTreeTable.selection.selected[0],i=new X;i.panelClass=Ce.SMALL,e.depositType?(i.data={indexOfRow:this.indexOfRow,deposit:this.depositTreeTable.selection.selected[0]},this.dialog.open(vr,i).afterClosed().pipe(ce(n=>n),y(()=>this.loadDataSource())).subscribe()):(i.data={title:"Usuwanie dyspozycji",message:"Czy na pewno chcesz usun\u0105\u0107 dyspozycj\u0119 ?"},this.dialog.open(Ee,i).afterClosed().pipe(y(n=>n.state?this.depositService.deleteDisposition(this.depositTreeTable.selection.selected[0].id):z(null)),y(()=>this.loadDataSource())).subscribe())}openSigningDialog(){let e=new X;e.panelClass=Ce.SMALL,e.data={title:"Potwierd\u017A przekazanie",message:"Czy na pewno chcesz przekaza\u0107 do podpisu?",details:this.depositTreeTable.selection.selected},this.dialog.open(Ee,e).afterClosed().pipe(y(i=>i.state?this.depositService.signingDisposition(this.depositTreeTable.selection.selected.map(n=>n.id)):z(null)),y(()=>this.loadDataSource())).subscribe()}openQuickRealizationDialog(){this.depositQuickRealizationAdapterService.authorize(this.depositTreeTable.selection.selected).pipe(y(()=>this.loadDataSource()),this.errorProviderService.processError(E.AUTHORIZATION_ERROR)).subscribe()}openFile(){let e=this.depositTreeTable.selection.selected;e.length===1?(this.notificationService.default("Otwieranie dokumentu w toku ..."),this.depositService.openConfirmationReport(e[0].id)):this.notificationService.warning("Wydruk dost\u0119pny jest tylko dla pojedynczego elementu.")}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}addConfig(e){let i=this.getDialogTitle(e),n=new X;return n.panelClass=Ce.MEDIUM,n.data={indexOfRow:this.indexOfRow,deposit:this.depositTreeTable.selection.selected[0],dialogTitle:i},n}getDialogTitle(e){return e===Kn.CREATE_DEPOSIT?Kn.CREATE_DEPOSIT:Kn.EDIT_DEPOSIT}checkPermission(e){let i=[],n=[];return e.forEach(l=>{l.depositType?n.push(l.id):i.push(l.id)}),this.depositService.checkPermission(i,n)}getDetails(){let e=this.depositTreeTable.selection.selected[0];e&&!e.depositType?this.depositService.getDispositionDetail(e.id).pipe(S(i=>this.details.rows=Pt.prepareDeposits(e,i))).subscribe():this.details.rows=Pt.prepareDeposits(e)}prepareFilteringCheckboxes(){this.filteringCheckboxes=[{name:"Modyfikacja",control:this.modificationDepositFC},{name:"Zerwanie",control:this.breakingDepositFC},{name:"Za\u0142o\u017Cenie",control:this.openingDepositFC}]}refreshSort(){this.depositTreeTable.showSortChange({active:this.depositTreeTable.matSortActive,direction:this.depositTreeTable.matSortDirection})}initFiltersAndData(){ht(ft(window,"beforeunload"),this.destroy$).subscribe(()=>{this.storage.setItem(sr,this.depositTreeTable.matSortActive),this.storage.setItem(lr,this.depositTreeTable.matSortDirection)}),this.storage.getItem(rr).then(e=>{e&&this.depositSearchFG.patchValue(e)}).finally(()=>this.loadDataSource().subscribe())}loadAccountList(){this.depositService.getAccounts().pipe(S(e=>{this.chargedAccounts=e?[...this.chargedAccounts,...e]:[]}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR)).subscribe()}loadDataSource(){return this.storage.setItem(rr,this.depositSearchFG.value),this.spinnerService.showSpinner(),this.depositService.getDepositData(this.selectedAccountFC.value,this.constructDepositTypes()).pipe(L(e=>this.depositService.prepareDeposits([...e])),S(e=>{this.depositTreeTable.setResultsLength(e.length),this.depositTreeTable.setDataSourceData(e),this.refreshSort(),this.spinnerService.hide
3Spinner(),this.toggleButtonsOff()}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([])))}toggleButtonsOn(){let e=this.depositTreeTable.selection.selected;this.isDisabledPrintButton=!(e.length===1&&e[0].type===fl.DEPOSIT),this.checkPermission(e).pipe(S(i=>{this.isDisabledDeleteButton=!i.deletePer,this.isDisabledEditionButton=!i.editPer,this.acceptPermission&&(this.isDisabledQuickRealizationButton=!i.quickRealizationPer||!this.isRealizationAuthoritiesEnable,this.isDisabledSigningButton=!i.signingPer),e.length>1&&(this.isDisabledEditionButton=!0,this.isDisabledDeleteButton=!0)})).subscribe()}constructDepositTypes(){let e=[];return this.modificationDepositFC.value&&e.push(W.LOKATA_MODYFIKACJA),this.breakingDepositFC.value&&e.push(W.LOKATA_ZERWANIE),this.openingDepositFC.value&&e.push(W.LOKATA_ZALOZENIE),e}toggleButtonsOff(){this.depositTreeTable.clearSelection(),this.isDisabledSigningButton=!0,this.isDisabledDeleteButton=!0,this.isDisabledEditionButton=!0,this.isDisabledQuickRealizationButton=!0}static{this.\u0275fac=function(i){return new(i||t)(_(fe),_(K),_(Tl),_(Rc),_(Pe),_(It),_(nt),_(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-deposits"]],viewQuery:function(i,n){if(i&1&&et(Uf,5)(Gf,5)(dn,5)(mn,5),i&2){let l;me(l=ue())&&(n.depositTreeTable=l.first),me(l=ue())&&(n.filterExpansionPanel=l.first),me(l=ue())&&(n.paginator=l.first),me(l=ue())&&(n.sort=l.first)}},standalone:!1,decls:38,vars:15,consts:[["filterExpansionPanel",""],["depositTreeTable",""],["appPageFilter",""],[3,"formGroup"],["labelName","Typ",3,"checkboxes"],[3,"accountList","sourceAccountFC","fieldLabel","hasNullOption"],[3,"clickAction"],[1,"gap-02rem"],["icon","add",1,"simple-button",3,"clickAction","disabled"],["icon","edit",1,"simple-button",3,"clickAction","disabled"],["icon","delete",1,"simple-button",3,"clickAction","disabled"],["icon","note_add",1,"simple-button",3,"clickAction","disabled"],["icon","settings",1,"simple-button",3,"clickAction","disabled"],["icon","print",1,"simple-button",3,"clickAction","disabled"],[3,"rowClickEventIndicator","tableProperties"],["appPageDetails","","expanded","true",1,"mat-elevation-z3","flex-col"],[1,"subheader"],[3,"details","areDetailsVisible"]],template:function(i,n){if(i&1&&(a(0,"app-page-container")(1,"app-page-header"),c(2,"Lokaty"),o(),a(3,"app-page-content")(4,"mat-expansion-panel",2,0)(6,"mat-expansion-panel-header")(7,"mat-panel-title"),c(8," Filtry "),o()(),a(9,"form",3),C(10,"app-filtering-checkboxes",4)(11,"app-source-account-input",5),a(12,"mat-card-actions")(13,"app-button",6),m("clickAction",function(){return n.onSearch()}),c(14,"Szukaj"),o(),a(15,"app-button",6),m("clickAction",function(){return n.setDefaultSearchingParameters()}),c(16,"Wyczy\u015B\u0107"),o()()()(),a(17,"app-page-btn-panel",7)(18,"app-button",8),m("clickAction",function(){return n.openAddDialog(n.depositDialogEnum.CREATE_DEPOSIT)}),c(19," Dodaj "),o(),a(20,"app-button",9),m("clickAction",function(){return n.openEditDialog(n.depositDialogEnum.EDIT_DEPOSIT)}),c(21," Edytuj "),o(),a(22,"app-button",10),m("clickAction",function(){return n.openDeleteDialog()}),c(23," Usu\u0144 "),o(),a(24,"app-button",11),m("clickAction",function(){return n.openSigningDialog()}),c(25," Do podpisu "),o(),a(26,"app-button",12),m("clickAction",function(){return n.openQuickRealizationDialog()}),c(27," Sz. realizacja "),o(),a(28,"app-button",13),m("clickAction",function(){return n.openFile()}),c(29," Wydruk "),o()(),a(30,"sn-mat-tree-table",14,1),m("rowClickEventIndicator",function(){return n.receiveRowClickEvent()}),o()(),a(32,"mat-expansion-panel",15)(33,"mat-expansion-panel-header")(34,"mat-panel-title")(35,"h3",16),c(36,"Szczeg\xF3\u0142y"),o()()(),C(37,"app-details",17),o()()),i&2){let l=re(31);s(9),p("formGroup",n.depositSearchFG),s(),p("checkboxes",n.filteringCheckboxes),s(),p("accountList",n.chargedAccounts)("sourceAccountFC",n.selectedAccountFC)("fieldLabel",n.sourceAccountLabel)("hasNullOption",!1),s(7),p("disabled",!n.createDepositPermission),s(2),p("disabled",n.isDisabledEditionButton),s(2),p("disabled",n.isDisabledDeleteButton),s(2),p("disabled",n.isDisabledSigningButton),s(2),p("disabled",n.isDisabledQuickRealizationButton),s(2),p("disabled",n.isDisabledPrintButton),s(2),p("tableProperties",n.tableProperties),s(7),p("details",n.details)("areDetailsVisible",l.selection.selected.length===1)}},dependencies:[Zt,yt,At,wt,_t,tt,gt,ot,at,rt,xn,Mt,Xt,Ot,We,je,Di,ti],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem}.flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.gap-02rem[_ngcontent-%COMP%]{gap:.2rem}"]})}}return t})();var Fn=(function(t){return t.DETAILS="Poka\u017C szczeg\xF3\u0142y",t.SIGNATURES="Poka\u017C podpisy",t.WITHDRAWAL_CONFIRMATION="Potwierd\u017A wycofanie",t})(Fn||{});var wr=(function(t){return t.ACCOUNTING="Ksi\u0119gowana",t.AWAITS="Oczekuj\u0105ca (m\u0142ynek)",t.COMPLETED="Zrealizowana",t.IN_PROGRESS="W trakcie realizacji",t.PARTLY_COMPLETED="Cz. zrealizowana",t.REJECTED="Odrzucona",t.SUSPENDED="W trakcie realizacji (zawieszona)",t})(wr||{});var Ta=(()=>{class t{constructor(e,i){this.signatureSignService=e,this.userFacadeService=i,this.isExecuteAuthoritiesEnable=!1,this.isSignAuthoritiesEnable=!1,this.isExecuteAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_EXECUTE]),this.isSignAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_SIGN])}isSignAndExecuteEnabled(e){let i=M.mapBundlesToIdList(e);return this.signatureSignService.checkEnabled(i).pipe(fi(()=>z(!1)),L(n=>({signEnabled:n&&this.isSignAuthoritiesEnable,signAndExecuteEnabled:n&&this.isSignAuthoritiesEnable&&this.isExecuteAuthoritiesEnable})))}isExecuteEnabled(e){let i=this.userFacadeService.hasAuthMethod();return e.every(n=>i&&this.isExecuteAuthoritiesEnable&&n.state===pe.SIGNED)}isWithdrawSignEnabled(e){return e.every(i=>i.signState===Xo.I_SIGNED)}isWithdrawForEditEnabled(e){return e.every(i=>i.signState===Xo.CAN_SIGN?i.state!==pe.SIGNED:i.signState===Xo.CAN_NOT_SIGN?i.state!==pe.IN_SIGNING&&i.state!==pe.SIGNED:!0)}isPrintEnabled(e){return e.length==1&&!this.isSelectedDepositOrStandingOrder(e[0].type)}isSelectedDepositOrStandingOrder(e){return e===W.LOKATA_ZALOZENIE||e===W.LOKATA_MODYFIKACJA||e===W.LOKATA_ZERWANIE||e===W.ZLECENIE_STALE_ZALOZENIE||e===W.ZLECENIE_STALE_MODYFIKACJA||e===W.ZLECENIE_STALE_ZERWANIE}static{this.\u0275fac=function(i){return new(i||t)(G(Pl),G(Pe))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var $f=["executionTreeTable"],qf=["filterExpansionPanel"];function Zf(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.isRequiredText)}}function Qf(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),g(e.isRequiredText)}}var zc="dateOfExecution",Lc=(()=>{class t{constructor(e,i,n,l,h,D,R,se,le,de){this.formBuilder=e,this.executionsService=i,this.notificationService=n,this.signatureService=l,this.dialog=h,this.storage=D,this.buttonDisabledService=R,this.spinnerService=se,this.userFacadeService=le,this.errorProviderService=de,this.sourceAccounts=[Ht],this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.validatorUtils=tl,this.isRequiredText=el,this.executionDialogEnum=Fn,this.isWithdrawBtnEnabled=!1,this.isPrintBtnDisabled=!0,this.isShowSigBtnDisabled=!0,this.isDetail
3sBtnDisabled=!0,this.filteringCheckboxes=[],this.executionTypeEnum=wr,this.rowDetails=[],this.destroy$=new pt,this.completedFC=new A,this.rejectedFC=new A,this.partlyCompletedFC=new A,this.accountingFC=new A,this.inProgressFC=new A,this.suspendedFC=new A,this.awaitsFC=new A,this.dateFromFC=new A,this.dateToFC=new A,this.sourceAccountFC=new A(this.sourceAccounts[0].accountId),this.executionFilterFG=this.formBuilder.group({completedFC:this.completedFC,rejectedFC:this.rejectedFC,partlyCompletedFC:this.partlyCompletedFC,accountingFC:this.accountingFC,inProgressFC:this.inProgressFC,suspendedFC:this.suspendedFC,awaitsFC:this.awaitsFC,dateFrom:this.dateFromFC,dateTo:this.dateToFC,sourceAccountFC:this.sourceAccountFC});let Re="asc",Ne=zc;this.storage.getItem(tr).then(qe=>{qe&&(Ne=qe),this.storage.getItem(ir).then(Hi=>{Hi&&(Re=Hi)})}).finally(()=>{this.tableProperties={columnSettings:[{column:"type",caption:"Typ",stylePipeToken:yi,stylePipeArgs:[],styleProp:"whiteListVerificationState",styleClass:"bold red",alternativeDataSource:{whenShouldUseAlternativeValue:qe=>M.isBundle(qe),getAlternativeValue(qe){return qe.name}},pipeToken:kt,pipeArgs:["row.sorbnet"],headerClass:"fill-arrow-space",cellClass:"x-start"},{column:"targetAccount",caption:"Rachunek beneficjenta",pipeToken:J,cellClass:"x-start "},{column:"amount",caption:"Kwota / Suma",pipeToken:$,pipeArgs:["row.currency"],cellClass:"x-end"},{column:"name",caption:"Nazwa",alternativeDataSource:{whenShouldUseAlternativeValue:qe=>M.isBundle(qe),getAlternativeValue:()=>"-"},headerClass:"x-start",cellClass:"x-start"},{column:"state",caption:"Stan",pipeToken:Jo,pipeArgs:[!0,"row.virtual","row.dispositions"]},{column:zc,caption:"Data wykonania",pipeToken:Cl}],arrayHoldingProp:"dispositions",arrayHoldingPropCount:"dispositionsAmount",collapseBy:"id",matSortActive:Ne,matSortDirection:Re,matSortDisableClear:!0,bundleArrowIndicator:!1,sortParentId:"id",sortParents:!0,sortChildren:!1,expandable:!1}}),this.prepareFilteringCheckboxes()}ngOnInit(){this.getChargeableAccounts(),this.setDefaultValues(),this.initFiltersAndData()}updateExecutionsWithSubscribe(){this.updateExecutions().subscribe()}search(){this.storage.setItem(er,this.executionFilterFG.value),this.updateExecutions().subscribe(),this.filterExpansionPanel.close()}resetValues(){this.executionFilterFG.reset(),this.setDefaultValues()}openDialog(e){let i=new X;switch(e){case Fn.DETAILS:i.autoFocus=!1,i.panelClass=Ce.LARGE,i.data={details:this.rowDetails},this.dialog.open(Zl,i);break;case Fn.SIGNATURES:let n=this.rowDetails[0]?.bundleId||this.rowDetails[0].id;this.signatureService.findSigningsForId(n).pipe(S(l=>{i.panelClass=l.signs?.length?Ce.MEDIUM:Ce.SMALL,i.data={title:Ml.COMPLETED_SIGNATURES,details:l},this.dialog.open(yl,i)}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([]))).subscribe();break;case Fn.WITHDRAWAL_CONFIRMATION:i.data={title:"Potwierd\u017A wycofanie podpisu",message:"Czy na pewno chcesz wycofa\u0107 wybran\u0105 operacj\u0119 do podpisu?",details:this.rowDetails},this.dialog.open(Ee,i).afterClosed().pipe(ce(l=>!!l.state),S(()=>this.spinnerService.showSpinner()),y(()=>this.signatureService.moveToSigning(this.rowDetails)),y(()=>this.updateExecutions()),S(()=>this.notificationService.success(E.SIGNING_SUCCESS)),this.errorProviderService.processError(E.WRONG_BUNDLE),ee(()=>
3this.spinnerService.hideSpinner())).subscribe();break;default:break}}receiveRowClickEvent(){this.rowDetails=this.executionTreeTable.selection.selected,this.resetStateButton(),this.isWithdrawBtnEnabled=this.isWithdrawAllowed(this.rowDetails),this.rowDetails.length!==0&&(this.isDetailsBtnDisabled=!1,this.rowDetails.length===1&&(this.isPrintBtnDisabled=this.buttonDisabledService.isSelectedDepositOrStandingOrder(this.rowDetails[0].type)||this.rowDetails[0].state===pe.AWAITS,this.rowDetails[0].type===W.LOKATA_ZALOZENIE&&this.rowDetails[0].state===pe.COMPLETED&&(this.isPrintBtnDisabled=!1),this.isShowSigBtnDisabled=!this.userFacadeService.hasAuthorities([Q.FUNC_SIGN])))}print(){this.executionsService.print(this.rowDetails[0])}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}updateExecutions(){return this.spinnerService.showSpinner(),this.getData().pipe(S(e=>{this.spinnerService.hideSpinner(),this.executionTreeTable.setDataSourceData(M.mapVirtualBundles(e.data,!0)),this.executionTreeTable.setResultsLength(e.totalElements),this.refreshSort()}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z(this.getEmptyExecutionResponse())))}getChargeableAccounts(){this.executionsService.getChargeableAccounts().pipe(S(e=>{this.sourceAccounts=e?[...this.sourceAccounts,...e]:[]})).subscribe()}initFiltersAndData(){ht(ft(window,"beforeunload"),this.destroy$).subscribe(()=>{this.storage.setItem(tr,this.executionTreeTable.matSortActive),this.storage.setItem(ir,this.executionTreeTable.matSortDirection)}),this.storage.getItem(er).then(e=>{e&&this.executionFilterFG.patchValue(e)}).finally(()=>this.search())}constructBundleStates(){let e=[];return this.completedFC.value&&e.push(pe.COMPLETED),this.rejectedFC.value&&e.push(pe.REJECTED),this.partlyCompletedFC.value&&e.push(pe.PARTLY_COMPLETED),this.accountingFC.value&&e.push(pe.ACCOUNTING),this.inProgressFC.value&&e.push(pe.IN_PROGRESS),this.suspendedFC.value&&e.push(pe.SUSPENDED),this.awaitsFC.value&&e.push(pe.AWAITS),e}resetStateButton(){this.isWithdrawBtnEnabled=!1,this.isPrintBtnDisabled=!0,this.isShowSigBtnDisabled=!0,this.isDetailsBtnDisabled=!0}setDefaultValues(){this.executionFilterFG.patchValue({completedFC:!0,rejectedFC:!0,partlyCompletedFC:!0,accountingFC:!0,inProgressFC:!0,suspendedFC:!0,awaitsFC:!0,dateFrom:Nt($a(new Date,1),H),dateTo:Nt(as($a(new Date,1),1),H)})}getData(){return this.executionsService.getExecutions(this.getExecutionsFilter())}getExecutionsFilter(){let e=this.constructBundleStates();return{startDate:Me.formatDateNoError(this.dateFromFC.value),endDate:Me.formatDateNoError(this.dateToFC.value),sourceAccountId:this.sourceAccountFC.value,bundleStates:e}}getEmptyExecutionResponse(){return{totalElements:0,data:[]}}prepareFilteringCheckboxes(){this.filteringCheckboxes=[{name:this.executionTypeEnum.COMPLETED,control:this.completedFC},{name:this.executionTypeEnum.REJECTED,control:this.rejectedFC},{name:this.executionTypeEnum.PARTLY_COMPLETED,control:this.partlyCompletedFC},{name:this.executionTypeEnum.ACCOUNTING,control:this.accountingFC},{name:this.executionTypeEnum.IN_PROGRESS,control:this.inProgressFC},{name:this.executionTypeEnum.SUSPENDED,control:this.suspendedFC},{name:this.executionTypeEnum.AWAITS,control:this.awaitsFC}]}isWithdrawAllowed(e){return e.every(i=>i.state===pe.IN_PROGRESS||i.state===pe.NEW)}refreshSort(){this.executionTreeTable.showSortChange({active:this.executionTreeTable.matSortActive,direction:this.executionTreeTable.matSortDirection})}static{this.\u0275fac=function(i){return new(i||t)(_(Gt),_(ia),_(K),_(na),_(fe),_(It),_(Ta),_(nt),_(Pe),_(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-execution"]],viewQuery:function(i,n){if(i&1&&et($f,5)(qf,5),i&2){let l;me(l=ue())&&(n.executionTreeTable=l.first),me(l=ue())&&(n.filterExpansionPanel=l.first)}},standalone:!1,decls:50,vars:19,consts:[["filterExpansionPanel",""],["dateFrom",""],["dateTo",""],["executionTreeTable",""],["appPageFilter",""],[1,"flex-col",3,"formGroup"],["labelName","Stan",3,"checkboxes"],[3,"sourceAccountFC","accountList","fieldLabel","hasNullOption"],[1,"date-section","flex-row","justify-start","items-center"],["autocomplete","off","matInput","",3,"formControl","matDatepicker"],["matSuffix","",3,"for"],[3,"clickAction"],[1,"gap-02rem"],[3,"clickAction","disabled"],["mainButtonName","Wydruk","icon","print",3,"disabled"],["icon","open_in_browser",3,"clickAction"],[3,"rowClickEventIndicator","tableProperties"]
3],template:function(i,n){if(i&1&&(a(0,"app-page-container")(1,"app-page-header"),c(2,"Stan realizacji przelew\xF3w"),o(),a(3,"mat-expansion-panel",4,0)(5,"mat-expansion-panel-header")(6,"mat-panel-title"),c(7," Filtry "),o()(),a(8,"form",5),C(9,"app-filtering-checkboxes",6)(10,"app-source-account-input",7),a(11,"section",8)(12,"label"),c(13,"Zakres dat"),o(),a(14,"mat-form-field"),C(15,"input",9)(16,"mat-datepicker-toggle",10)(17,"mat-datepicker",null,1),a(19,"mat-error"),u(20,Zf,2,1,"span"),o()(),a(21,"span"),c(22," - "),o(),a(23,"mat-form-field"),C(24,"input",9)(25,"mat-datepicker-toggle",10)(26,"mat-datepicker",null,2),a(28,"mat-error"),u(29,Qf,2,1,"span"),o()()(),a(30,"mat-card-actions")(31,"app-button",11),m("clickAction",function(){return n.search()}),c(32,"Szukaj"),o(),a(33,"app-button",11),m("clickAction",function(){return n.resetValues()}),c(34,"Wyczy\u015B\u0107"),o()()()(),a(35,"app-page-content")(36,"app-page-btn-panel",12)(37,"app-button",11),m("clickAction",function(){return n.updateExecutionsWithSubscribe()}),c(38,"Od\u015Bwie\u017C"),o(),a(39,"app-button",13),m("clickAction",function(){return n.openDialog(n.executionDialogEnum.DETAILS)}),c(40," Poka\u017C szczeg\xF3\u0142y "),o(),a(41,"app-button",13),m("clickAction",function(){return n.openDialog(n.executionDialogEnum.WITHDRAWAL_CONFIRMATION)}),c(42," Wycofaj do podpisu "),o(),a(43,"app-button",13),m("clickAction",function(){return n.openDialog(n.executionDialogEnum.SIGNATURES)}),c(44," Poka\u017C podpisy "),o(),a(45,"app-button-menu",14)(46,"app-menu-item-button",15),m("clickAction",function(){return n.print()}),c(47," Otw\xF3rz "),o()()(),a(48,"sn-mat-tree-table",16,3),m("rowClickEventIndicator",function(){return n.receiveRowClickEvent()}),o()()()),i&2){let l=re(18),h=re(27);s(8),p("formGroup",n.executionFilterFG),s(),p("checkboxes",n.filteringCheckboxes),s(),p("sourceAccountFC",n.sourceAccountFC)("accountList",n.sourceAccounts)("fieldLabel",n.sourceAccountLabel)("hasNullOption",!1),s(5),p("formControl",n.dateFromFC)("matDatepicker",l),s(),p("for",l),s(4),f(n.validatorUtils.isRequired(n.dateFromFC)?20:-1),s(4),p("formControl",n.dateToFC)("matDatepicker",h),s(),p("for",h),s(4),f(n.validatorUtils.isRequired(n.dateFromFC)?29:-1),s(10),p("disabled",n.isDetailsBtnDisabled),s(2),p("disabled",!n.isWithdrawBtnEnabled),s(2),p("disabled",n.isShowSigBtnDisabled),s(2),p("disabled",n.isPrintBtnDisabled),s(3),p("tableProperties",n.tableProperties)}},dependencies:[be,$t,St,Zt,xt,Dt,Tt,yt,At,wt,Se,_t,ve,De,tt,Ve,gt,ot,at,rt,Mt,Xt,Ot,We,je,ei,Yt,ti],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem}.title-style[_ngcontent-%COMP%]{font-size:17px;height:20px;background-color:#d3d3d3;color:#b71619;border-radius:2rem;padding:.2rem .5rem;margin-bottom:10px}mat-checkbox[_ngcontent-%COMP%]{margin:12px}mat-card-actions[_ngcontent-%COMP%]{margin:0}.date-section[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin:5px}mat-form-field.filter-accounts[_ngcontent-%COMP%]{width:100%}mat-form-field.filter-accounts[_ngcontent-%COMP%] .mat-form-field-wrapper{padding-bottom:0}.signature-action-bar[_ngcontent-%COMP%]{position:sticky;position:-webkit-sticky;top:-16px;margin-top:20px}.signature-action-bar[_ngcontent-%COMP%] .action-card[_ngcontent-%COMP%]{margin-bottom:1rem;background:#fffffff2}.signature-action-bar[_ngcontent-%COMP%] .action-button-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-bottom:.3rem}.signature-action-bar[_ngcontent-%COMP%] .action-button-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(:last-of-type){margin-right:.3rem}.round-borders[_ngcontent-%COMP%]{border-radius:2rem;padding:.45rem .7rem;border:1px solid #d3d3d3;outline:unset}.execution-list[_ngcontent-%COMP%]{position:relative;margin:0 5rem;display:flex;box-shadow:0 5px 17px #0000004d;border-radius:1.5rem}.execution-list[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-weight:700}.mat-mdc-row.highlighted[_ngcontent-%COMP%]{background:#ffafae}.flex-row[_ngcontent-%COMP%]{display:flex;flex-direction:row}.flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.justify-start[_ngcontent-%COMP%]{justify-content:flex-start}.items-center[_ngcontent-%COMP%]{align-items:center}.gap-02rem[_ngcontent-%COMP%]{gap:.2rem}"]})}}return t})();var ya=(()=>{class t{constructor(e){this.gsmBoostsService=e}confirm(e){return this.gsmBoostsService.toSign(e)}static{this.\u0275fac=function(i){return new(i||t)(G(Ai))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var Yf=t=>({"plain-table-row-highlight":t});function Xf(t,r){t&1&&(a(0,"mat-header-cell"),c(1,"Data"),o())}function Jf(t,r){if(t&1&&(a(0,"mat-cell"),c(1),o()),t&2){let e=r.$implicit;s(),U(" ",e.dateOfExecution," ")}}
3function e0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Nr telefonu"),o())}function t0(t,r){if(t&1&&(a(0,"mat-cell"),c(1),T(2,"phoneFormatPipe"),o()),t&2){let e=r.$implicit;s(),U(" ",B(2,1,e.phoneNumber)," ")}}function i0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Kwota"),o())}function n0(t,r){if(t&1&&(a(0,"mat-cell"),c(1),T(2,"currencyFormatPipe"),o()),t&2){let e=r.$implicit;s(),U(" ",B(2,1,e.amount)," ")}}function o0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Rachunek obci\u0105\u017Cany"),o())}function a0(t,r){if(t&1&&(a(0,"mat-cell"),c(1),T(2,"ibanFormatPipe"),o()),t&2){let e=r.$implicit;s(),U(" ",B(2,1,e.sourceAccount)," ")}}function r0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Stan"),o())}function s0(t,r){if(t&1&&(a(0,"mat-cell"),c(1),T(2,"bundleStateView"),o()),t&2){let e=r.$implicit;s(),U(" ",V(2,1,e.state,!0)," ")}}function l0(t,r){t&1&&C(0,"mat-header-row")}function c0(t,r){if(t&1){let e=F();a(0,"mat-row",18),m("click",function(n){let l=P(e).$implicit,h=d();return O(h.rowClickHandler(l,n))}),o()}if(t&2){let e=r.$implicit,i=d();p("ngClass",So(1,Yf,i.selection.selected.includes(e)))}}var p0="data",Vc=(()=>{class t{constructor(e,i,n,l,h,D){this.gsmService=e,this.quickRealizationService=i,this.dialog=n,this.storage=l,this.spinnerService=h,this.errorProviderService=D,this.displayedColumns=["dateOfExecution","phoneNumber","amount","sourceAccount","state"],this.selection=new fs(!0,[]),this.resultsLength=0,this.pageSizeOptions=Xs,this.pageSize=Js,this.matSortDirection="asc",this.matSortActive=p0,this.loading=!1,this.selectedItems=[],this.destroy$=new pt,this.dataSource=new Zn,this.enablers={addEnabled:!1,deleteEnabled:!1,editEnabled:!1,quickExecutionEnabled:!1,toSignEnabled:!1},Promise.all([this.storage.getItem(mr),this.storage.getItem(ur)]).then(([R,se])=>{R&&se&&(this.matSortActive=R,this.matSortDirection=se)})}handleKeyboardEvent(e){if(e.ctrlKey&&e.key==="a"){this.dataSource.data.forEach(n=>this.selection.select(n));let i=this.selectedItems.map(n=>n.id);this.getEnablerConfig(i).subscribe(),e.preventDefault()}}ngOnInit(){this.initFiltersAndData()}ngAfterViewInit(){this.dataSource.sort=this.sort,this.dataSource.paginator=this.paginator,this.sort.sortChange.subscribe(()=>this.paginator.pageIndex=0)}showSortChange(e){this.matSortDirection=e.direction,this.matSortActive=e.active}openModalDialog(e){this.checkForRemoteErrors().pipe(y(()=>{let i=e?this.selectedItems[0]:void 0;return this.dialog.open(Kl,{autoFocus:!0,panelClass:Ce.MEDIUM,data:i}).afterClosed()}),ce(i=>i),y(()=>(this.getEnablerConfig(),this.refreshData())),fi(()=>{let i=new X;return i.panelClass=Ce.SMALL,i.data={title:E.ERROR,message:`${E.MAJOR_ERROR_OCCURED} ${E.CANNOT_PERFORM_OPERATION}`},this.dialog.open(dl,i),Be})).subscribe()}rowClickHandler(e,i){i?.ctrlKey?(this.selection.toggle(e),this.selectedItems=this.selection.selected):this.singleSelection(e);let n=this.selectedItems.map(l=>l.id);this.getEnablerConfig(n).subscribe()}authorizeQuickRealization(){this.quickRealizationService.authorize(this.selectedItems).pipe(y(()=>this.refreshData()),this.errorProviderService.processError(E.AUTHORIZATION_ERROR)).subscribe()}openToSign(){let e=new X;e.data={title:Ge.TO_SIGN_TOP_UP_TITLE,message:Ge.TO_SIGN_TOP_UP_MESSAGE,details:this.selectedItems,confirmation:new ya(this.gsmService)},this.dialog.open(Ee,e).afterClosed().pipe(y(()=>this.refreshData())).subscribe()}openDeleteDialog(){if(this.selectedItems.length===1){let e=new X;e.data={title:Ge.DELETE_TOP_UP_TITLE,message:Ge.DELETE_TOP_UP_MESSAGE,details:this.selectedItems[0].id},this.dialog.open(Ql,e).afterClosed().pipe(y(()=>this.refreshData())).subscribe()}}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}getEnablerConfig(e=[]){return this.loading=!0,this.enablers={addEnabled:!1,deleteEnabled:!1,editEnabled:!1,quickExecutionEnabled:!1,toSignEnabled:!1},this.gsmService.getEnablerConfig(e).pipe(S(i=>this.enablers=i),ee(()=>this.loading=!1))}initFiltersAndData(){ht(ft(window,"beforeunload"),this.destroy$).subscribe(()=>{this.storage.setItem(mr,this.matSortActive),this.storage.setItem(ur,this.matSortDirection)}),this.refreshData().subscribe()}checkForRemoteErrors(){return this.gsmService.getOperators()}refreshData(){return this.spinnerService.showSpinner(),this.gsmService.getGsmBoosts().pipe(L(e=>(e.forEach(i=>
3{i.phoneNumber=this.gsmService.getPhoneNumber(i),i.operatorName=this.gsmService.getOperator(i)}),e)),S(e=>{this.spinnerService.hideSpinner(),this.dataSource.data=e,this.selectedItems=[],this.selection.clear()}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([])))}singleSelection(e){this.selection.clear(),this.selectedItems&&this.selectedItems.toString()===[e].toString()?this.selectedItems=[]:(this.selection.select(e),this.selectedItems=this.selection.selected)}static{this.\u0275fac=function(i){return new(i||t)(_(Ai),_(Ol),_(fe),_(It),_(nt),_(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-gsm-boosts"]],viewQuery:function(i,n){if(i&1&&et(dn,5)(mn,7),i&2){let l;me(l=ue())&&(n.paginator=l.first),me(l=ue())&&(n.sort=l.first)}},hostBindings:function(i,n){i&1&&m("keydown",function(h){return n.handleKeyboardEvent(h)},Br)},standalone:!1,decls:34,vars:18,consts:[[1,"flex-col","justify-center","flex-100"],[1,"flex-col"],[1,"gap-02rem"],[3,"clickAction"],[3,"clickAction","disabled","loading"],["matSort","","matSortDisableClear","",1,"mat-elevation-z8",3,"matSortChange","dataSource","matSortActive","matSortDirection"],["matColumnDef","dateOfExecution"],[4,"matHeaderCellDef"],[4,"matCellDef"],["matColumnDef","phoneNumber"],["mat-sort-header","",4,"matHeaderCellDef"],["matColumnDef","amount"],["matColumnDef","sourceAccount"],["matColumnDef","state"],[4,"matHeaderRowDef","matHeaderRowDefSticky"],["ngDefaultControl","",3,"ngClass","click",4,"matRowDef","matRowDefColumns"],[3,"length","pageSizeOptions","pageSize","showFirstLastButtons"],["mat-sort-header",""],["ngDefaultControl","",3,"click","ngClass"]],template:function(i,n){i&1&&(a(0,"app-page-container",0)(1,"app-page-header"),c(2,"Do\u0142adowania GSM"),o(),a(3,"app-page-content",1)(4,"app-page-btn-panel",2)(5,"app-button",3),m("clickAction",function(){return n.openModalDialog(!1)}),c(6,"Nowe do\u0142adowanie"),o(),a(7,"app-button",4),m("clickAction",function(){return n.openDeleteDialog()}),c(8,"Usu\u0144"),o(),a(9,"app-button",4),m("clickAction",function(){return n.openModalDialog(!0)}),c(10,"Edytuj "),o(),a(11,"app-button",4),m("clickAction",function(){return n.openToSign()}),c(12," Do podpisu "),o(),a(13,"app-button",4),m("clickAction",function(){return n.authorizeQuickRealization()}),c(14," Sz. realizacja "),o()(),a(15,"mat-table",5),m("matSortChange",function(h){return n.showSortChange(h)}),he(16,6),Z(17,Xf,2,0,"mat-header-cell",7)(18,Jf,2,1,"mat-cell",8),_e(),he(19,9),Z(20,e0,2,0,"mat-header-cell",10)(21,t0,3,3,"mat-cell",8),_e(),he(22,11),Z(23,i0,2,0,"mat-header-cell",10)(24,n0,3,3,"mat-cell",8),_e(),he(25,12),Z(26,o0,2,0,"mat-header-cell",10)(27,a0,3,3,"mat-cell",8),_e(),he(28,13),Z(29,r0,2,0,"mat-header-cell",10)(30,s0,3,4,"mat-cell",8),_e(),Z(31,l0,1,0,"mat-header-row",14)(32,c0,1,3,"mat-row",15),o(),C(33,"mat-paginator",16),o()()),i&2&&(s(7),p("disabled",!n.enablers.deleteEnabled)("loading",n.loading),s(2),p("disabled",!n.enablers.editEnabled)("loading",n.loading),s(2),p("disabled",!n.enablers.toSignEnabled)("loading",n.loading),s(2),p("disabled",!n.enablers.quickExecutionEnabled)("loading",n.loading),s(2),p("dataSource",n.dataSource)("matSortActive",n.matSortActive)("matSortDirection",n.matSortDirection),s(16),p("matHeaderRowDef",n.displayedColumns)("matHeaderRowDefSticky",!0),s(),p("matRowDefColumns",n.displayedColumns),s(),p("length",n.resultsLength)("pageSizeOptions",n.pageSizeOptions)("pageSize",n.pageSize)("showFirstLastButtons",!0))},dependencies:[yo,dn,mn,Gs,un,hn,Cn,_n,fn,bn,gn,vn,Sn,En,ve,ot,at,rt,Mt,je,J,$,Ko,vl],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem}.plain-table-row-highlight[_ngcontent-%COMP%]{border:.5px solid #e7a236}.flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.justify-center[_ngcontent-%COMP%]{justify-content:center}.gap-02rem[_ngcontent-%COMP%]{gap:.2rem}.flex-100[_ngcontent-%COMP%]{flex:1 1 100%;max-width:100%;box-sizing:border-box}"]})}}return t})();var u0=["signatureTreeTable"],f0=["filterExpansionPanel"];function h0(t,r){if(t&1){let e=F();a(0,"div",2)(1,"mat-icon",19),c(2,"auto_awesome"),o(),a(3,"div",20)(4,"span",21),c(5,"Nowy interfejs podpisywania jest ju\u017C dost\u0119pny!"),o(),a(6,"span",22),c(7,"Wypr\xF3buj usprawniony widok z szybsz\u0105 nawigacj\u0105 i wygodniejsz\u0105 obs\u0142ug\u0105."),o()(),a(8,"app-button",8),m("clickAction",function(){P(e);let n=d();return O(n.switchToApprovals())}),c(9,"Wypr\xF3buj teraz"),o()()}}var jc="dateOfExecution",Gc=(()=>{class t{constructor(e,i,n,l,h,D,R,se,le,de,Re,Ne,qe,Hi,Na,Ba){this.signatureService=e,this.signatureApiService=i,this.accountService=n,this.formBuilder=l,this.notificationService=h,this.signatureDialog=D,this.storage=R,this.signatureButtonDisabledService=se,this.spinnerService=le,this.errorProviderService=de,this.parameterService=Re,this.userFacadeService=Ne,this.dispositionApiService=qe,this.sorbnetValidationService=Hi,this.router=Na,this.perLoginParameterService=Ba,this.sourceAccounts=[Ht],this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.isSigBtnEnabled=j(!1),this.isSigExecBtnEnabled=j(!1),this.isExecBtnEnabled=!1,this.isWithdrawSignBtnEnabled=!1,this.isWithdrawForEditBtnEnabled=!1,this.isPrintBtnEnabled=!1,this.typeFilteringCheckboxes=[],this.stateFilteringCheckboxes=[],this.loading=!1,this.destroy$=new pt,this.approvalsEnabled$=this.perLoginParameterService.get(Ze.APPROVALS_ENABLED).pipe(L(Boolean)),this.gmsBoostChkFC=new A,this.transferChkFC=new A,this.depositChkFC=new A,this.orderChkFC=new A,this.noSigChkFC=new A,this.duringSigChkFC=new A,this.sigByAllChkFC=new A,this.sourceAccountFC=new A(this.sourceAccounts[0].accountId),this.signatureFG=this.formBuilder.group({gmsBoostChkFC:this.gmsBoostChkFC,transferChkFC:this.transferChkFC,depositChkFC:this.depositChkFC,orderChkFC:this.orderChkFC,noSigChkFC:this.noSigChkFC,duringSigChkFC:this.duringSigChkFC,sigByAllChkFC:this.sigByAllChkFC,sourceAccountFC:this.sourceAccountFC}),this.setDefaultSearchingParameters();let Nn="asc",Bn=jc;this.storage.getItem(or).then(ke=>{ke&&(Bn=ke),this.storage.getItem(ar).then(zn=>{zn&&(Nn=zn)})}).finally(()=>{this.tableProperties={columnSettings:[{column:"type",caption:"Typ",stylePipeToken:yi,stylePipeArgs:[],styleProp:"whiteListVerificationState",styleClass:"bold red",alternativeDataSource:{whenShouldUseAlternativeValue:ke=>M.isBundle(ke),getAlternativeValue(ke){return ke.name}},pipeToken:kt,pipeArgs:["row.sorbnet"],headerClass:"fill-arrow-space",cellClass:"x-start",styleProperties:[{attribute:"min-width",value:"200px"}]},{column:"targetAccount",caption:"Rachunek beneficjenta",pipeToken:J,cellClass:"x-start",styleProperties:[{attribute:"min-width",value:"15.5rem"}]},{column:"amount",caption:"Kwota / Suma",pipeToken:$,pipeArgs:["row.currency"],cellClass:"x-end",styleProperties:[{attribute:"min-width",value:"100px"}]}
3,{column:"vatAmount",caption:"W tym VAT",pipeToken:$,pipeArgs:["row.currency"],styleProperties:[{attribute:"min-width",value:"100px"}]},{column:"name",caption:"Nazwa",alternativeDataSource:{whenShouldUseAlternativeValue:ke=>M.isBundle(ke),getAlternativeValue:ke=>`Rachunek obci\u0105\u017Cany: ${ke.sourceAccount}`},cellClass:"x-start",styleProperties:[{attribute:"min-width",value:"200px"}]},{column:"state",caption:"Stan",pipeToken:hl,pipeArgs:["row.signState","row.bundleState"],styleProperties:[{attribute:"min-width",value:"200px"}]},{column:jc,caption:"Data wykonania",pipeToken:ae,pipeArgs:[H],styleProperties:[{attribute:"min-width",value:"125px"}]}],arrayHoldingProp:"dispositions",arrayHoldingPropCount:"dispositionsAmount",collapseBy:"id",bundleArrowIndicator:!1,matSortActive:Bn,matSortDirection:Nn,matSortDisableClear:!0,sortParentId:"id",sortParents:!0,sortChildren:!1,expandable:!1}}),this.prepareFilteringCheckboxes()}ngOnInit(){this.setSorbnetDeadline(),this.checkPermissionForTopUpGSM(),this.getChargeableAccounts(),this.initFiltersAndData()}switchToApprovals(){localStorage.setItem(cn,"true"),this.router.navigate(["/",Ni,ln])}setDefaultSearchingParameters(){this.signatureFG.patchValue({gmsBoostChkFC:!0,transferChkFC:!0,depositChkFC:!0,orderChkFC:!0,noSigChkFC:!0,duringSigChkFC:!0,sigByAllChkFC:!0,sourceAccountFC:this.sourceAccounts[0].accountId})}showDetailsAction(){this.signatureTreeTable.setTableInactive(),this.signatureDialog.showDetailsAction(this.signatureTreeTable.selection.selected).pipe(S(()=>this.signatureTreeTable.setTableActive())).subscribe()}signAction(){if(!this.isSigBtnEnabled()){this.notificationService.error(E.UNAVAILABLE_ACTION);return}this.lockViewBeforeAction(),this.signatureDialog.signAction(this.signatureTreeTable.selection.selected).pipe(y(()=>this.loadSignedBundles()),this.errorProviderService.processError(E.AUTHORIZATION_ERROR,z([])),ee(()=>this.unlockViewAfterAction())).subscribe()}withdrawAction(){if(!this.isWithdrawSignBtnEnabled){this.notificationService.error(E.UNAVAILABLE_ACTION);return}this.lockViewBeforeAction(),this.signatureDialog.withdrawAction(this.signatureTreeTable.selection.selected).pipe(y(()=>this.loadSignedBundles()),this.errorProviderService.processError(E.AUTHORIZATION_ERROR),ee(()=>this.unlockViewAfterAction())).subscribe()}withdrawForEditAction(){if(!this.isWithdrawForEditBtnEnabled){this.notificationService.error(E.UNAVAILABLE_ACTION);return}this.lockViewBeforeAction(),this.signatureDialog.withdrawForEditAction(this.signatureTreeTable.selection.selected).pipe(y(()=>this.loadSignedBundles()),this.errorProviderService.processError(E.AUTHORIZATION_ERROR),ee(()=>this.unlockViewAfterAction())).subscribe()}print(){this.signatureService.printAction(this.signatureTreeTable.selection.selected[0])}receiveRowClickEvent(){this.disableMenuButtons();let e=this.signatureTreeTable.selection.selected;e.length>=1&&(this.loading=!0,this.updateMenuButtons(e))}updateMenuButtons(e){this.isExecBtnEnabled=this.signatureButtonDisabledService.isExecuteEnabled(e),this.isWithdrawSignBtnEnabled=this.signatureButtonDisabledService.isWithdrawSignEnabled(e),this.isWithdrawForEditBtnEnabled=this.signatureButtonDisabledService.isWithdrawForEditEnabled(e),this.isPrintBtnEnabled=this.signatureButtonDisabledService.isPrintEnabled(e),this.signatureButtonDisabledService.isSignAndExecuteEnabled(e).subscribe(({signEnabled:i,signAndExecuteEnabled:n})=>{this.isSigBtnEnabled.set(i),this.isSigExecBtnEnabled.set(n),this.loading=!1})}showSignings(){let e=this.signatureTreeTable.selection.selected[0]?.bundleId||this.signatureTreeTable.selection.selected[0].id;this.signatureService.findSigningsForId(e).pipe(S(i=>{this.signatureDialog.openSignaturesDialog(i)}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([]))).subscribe()}refreshData(){this.storage.setItem(nr,this.signatureFG.value),this.loadSignedBundles().subscribe()}onSearch(){this.refreshData(),this.filterExpansionPanel.close()}
3signAndExecuteAction(){this.lockViewBeforeAction(),this.getSorbnetDispositions().pipe(dt(e=>this.signAndExecuteSorbnetOrDomestic(e))).subscribe()}executeAction(){if(!this.isExecBtnEnabled){this.notificationService.error(E.UNAVAILABLE_ACTION);return}this.lockViewBeforeAction(),this.getSorbnetDispositions().pipe(dt(e=>this.executeSorbnetOrDomestic(e))).subscribe()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}signAndExecuteSorbnetOrDomestic(e){let n={bundleIds:M.mapBundlesToIdList(this.signatureTreeTable.selection.selected),bundleSignatureState:Ga.MOGE_PODPISAC};return this.signatureApiService.validate(n).pipe(dt(l=>this.handleSignAndExecuteBundleValidationResponse(l,e)))}handleSignAndExecuteBundleValidationResponse(e,i){return this.unlockViewAfterAction(),this.sorbnetValidationService.isImpossible(e)?this.handleSignAndExecuteSorbnetAsDomestic(i):this.signAndExecute()}handleSignAndExecuteSorbnetAsDomestic(e){return this.signatureDialog.openAcceptSorbnetAsNormal(this.sorbnetDate,e).pipe(ce(i=>i),dt(()=>this.dispositionApiService.updateDispositions(e.map(i=>i.id))),dt(()=>this.signAndExecute()),this.errorProviderService.processError(E.REALIZATION_ERROR))}executeSorbnetOrDomestic(e){let n={bundleIds:M.mapBundlesToIdList(this.signatureTreeTable.selection.selected),bundleSignatureState:Ga.PODPISALEM};return this.signatureApiService.validate(n).pipe(dt(l=>this.handleExecuteBundleValidationResponse(l,e)))}handleExecuteBundleValidationResponse(e,i){return this.unlockViewAfterAction(),this.sorbnetValidationService.isImpossible(e)?this.handleExecuteSorbnetAsDomestic(i):this.execute()}handleExecuteSorbnetAsDomestic(e){return this.signatureDialog.openAcceptSorbnetAsNormal(this.sorbnetDate,e).pipe(ce(i=>i),dt(()=>this.dispositionApiService.updateDispositions(e.map(i=>i.id))),dt(()=>this.execute()),this.errorProviderService.processError(E.REALIZATION_ERROR))}signAndExecute(){return this.isSigExecBtnEnabled()?this.signatureDialog.signAndExecuteAction(this.signatureTreeTable.selection.selected).pipe(S(e=>this.signatureDialog.summaryNotification(e.totalProcessed,e.successfulProcessed)),y(()=>this.loadSignedBundles()),this.errorProviderService.processError(E.REALIZATION_ERROR),ee(()=>this.unlockViewAfterAction())):(this.unlockViewAfterAction(),this.notificationService.error(E.UNAVAILABLE_ACTION),z(null))}setSorbnetDeadline(){so([this.parameterService.getParameterAsString(Ze.TRANSFER_SORBNET_DEADLINE)]).subscribe(([e])=>{this.sorbnetDate=new Date(e)})}execute(){return this.signatureDialog.executeAction(this.signatureTreeTable.selection.selected).pipe(S(e=>this.signatureDialog.summaryNotification(e?.totalProcessed,e?.successfulProcessed)),y(()=>this.loadSignedBundles()),this.errorProviderService.processError(E.REALIZATION_ERROR),ee(()=>this.unlockViewAfterAction()))}getSorbnetDispositions(){return this.signatureService.getBundleListForDetails(M.mapBundlesToIdList(this.signatureTreeTable.selection.selected)).pipe(L(e=>{let i=[];return e.forEach(n=>n.dispositions.filter(l=>l.sorbnet).forEach(l=>i.push(l))),i}))}refreshSort(){this.signatureTreeTable.showSortChange({active:this.signatureTreeTable.matSortActive,direction:this.signatureTreeTable.matSortDirection})}initFiltersAndData(){ht(ft(window,"beforeunload"),this.destroy$).subscribe(()=>{this.storage.setItem(or,this.signatureTreeTable.matSortActive),this.storage.setItem(ar,this.signatureTreeTable.matSortDirection)}),this.storage.getItem(nr).then(e=>{e&&this.signatureFG.patchValue(e)}).finally(()=>this.refreshData())}getChargeableAccounts(){this.accountService.getChargeableAccounts().pipe(S(e=>{this.sourceAccounts=e?[...this.sourceAccounts,...e]:[]})).subscribe()}loadSignedBundles(){return this.disableMenuButtons(),this.spinnerService.showSpinner(),this.signatureService.findAll(this.getSignatureSearchParams()).pipe(S(e=>{this.signatureTreeTable.setDataSourceData(M.mapVirtualBundles(e,!0)),this.refreshSort()}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([])),ee(()=>
3{this.loading=!1,this.spinnerService.hideSpinner()}))}disableMenuButtons(){this.isSigBtnEnabled.set(!1),this.isSigExecBtnEnabled.set(!1),this.isExecBtnEnabled=!1,this.isWithdrawSignBtnEnabled=!1,this.isWithdrawForEditBtnEnabled=!1,this.isPrintBtnEnabled=!1}getSignatureSearchParams(){return{deposit:this.depositChkFC.value,duringSig:this.duringSigChkFC.value,gmsBoost:this.gmsBoostChkFC.value,noSig:this.noSigChkFC.value,order:this.orderChkFC.value,sigByAll:this.sigByAllChkFC.value,sourceAccount:this.sourceAccountFC.value,transfer:this.transferChkFC.value}}prepareFilteringCheckboxes(){this.typeFilteringCheckboxes=[{name:"Do\u0142adowania GSM",control:this.gmsBoostChkFC},{name:"Przelewy",control:this.transferChkFC},{name:"Lokaty",control:this.depositChkFC},{name:"Zlecenia",control:this.orderChkFC}],this.stateFilteringCheckboxes=[{name:"Bez podpis\xF3w",control:this.noSigChkFC},{name:"W trakcie podpisywania",control:this.duringSigChkFC},{name:"Podpisana przez wszystkich",control:this.sigByAllChkFC}]}lockViewBeforeAction(){this.loading=!0,this.signatureTreeTable.setTableInactive(),this.spinnerService.showSpinner()}unlockViewAfterAction(){this.loading=!1,this.signatureTreeTable.setTableActive(),this.spinnerService.hide
3Spinner()}checkPermissionForTopUpGSM(){this.parameterService.getParameterAsBoolean(Ze.TOPUP_GSM_VISIBLE).pipe(S(e=>{e&&this.userFacadeService.hasAuthorities([Q.FUNC_TOPUP])||this.disabledTopUpCheckbox()})).subscribe()}disabledTopUpCheckbox(){this.gmsBoostChkFC.setValue(!1),this.gmsBoostChkFC.disable()}static{this.\u0275fac=function(i){return new(i||t)(_(na),_(Jr),_(Jt),_(Gt),_(K),_(An),_(It),_(Ta),_(nt),_(Y),_(Ei),_(Pe),_(Yi),_(Zo),_(Fi),_(Li))}}static{this.\u0275cmp=x({type:t,selectors:[["app-signature"]],viewQuery:function(i,n){if(i&1&&et(u0,5)(f0,5),i&2){let l;me(l=ue())&&(n.signatureTreeTable=l.first),me(l=ue())&&(n.filterExpansionPanel=l.first)}},standalone:!1,decls:42,vars:26,consts:[["filterExpansionPanel",""],["signatureTreeTable",""],[1,"new-interface-banner"],["appPageFilter",""],[1,"flex-col",3,"formGroup"],["labelName","Typ",3,"checkboxes"],["labelName","Stan",3,"checkboxes"],[3,"sourceAccountFC","accountList","fieldLabel","hasNullOption"],[3,"clickAction"],[1,"gap-02rem"],["icon","refresh",3,"clickAction"],["icon","details",3,"clickAction","disabled"],["icon","edit",3,"clickAction","disabled","loading"],["icon","check",3,"clickAction","disabled","loading"],["icon","undo",3,"clickAction","disabled","loading"],["icon","view_list",3,"clickAction","disabled","loading"],["mainButtonName","Wydruk","icon","print",3,"disabled","loading"],["icon","open_in_browser",3,"clickAction"],[3,"rowClickEventIndicator","tableProperties"],[1,"banner-icon"],[1,"banner-content"],[1,"banner-title"],[1,"banner-description"]],template:function(i,n){if(i&1&&(u(0,h0,10,0,"div",2),T(1,"async"),a(2,"app-page-container")(3,"app-page-header"),c(4,"Podpisy"),o(),a(5,"app-page-content")(6,"mat-expansion-panel",3,0)(8,"mat-expansion-panel-header")(9,"mat-panel-title"),c(10," Filtry"),o()(),a(11,"form",4),C(12,"app-filtering-checkboxes",5)(13,"app-filtering-checkboxes",6)(14,"app-source-account-input",7),a(15,"mat-card-actions")(16,"app-button",8),m("clickAction",function(){return n.onSearch()}),c(17,"Szukaj"),o(),a(18,"app-button",8),m("clickAction",function(){return n.setDefaultSearchingParameters()}),c(19,"Wyczy\u015B\u0107"),o()()()(),a(20,"app-page-btn-panel",9)(21,"app-button",10),m("clickAction",function(){return n.refreshData()}),c(22," Od\u015Bwie\u017C"),o(),a(23,"app-button",11),m("clickAction",function(){return n.showDetailsAction()}),c(24," Poka\u017C szczeg\xF3\u0142y "),o(),a(25,"app-button",12),m("clickAction",function(){return n.signAction()}),c(26," Podpisz "),o(),a(27,"app-button",12),m("clickAction",function(){return n.signAndExecuteAction()}),c(28," Podpisz i realizuj "),o(),a(29,"app-button",13),m("clickAction",function(){return n.executeAction()}),c(30," Realizuj "),o(),a(31,"app-button",14),m("clickAction",function(){return n.withdrawAction()}),c(32," Wycofaj podpis "),o(),a(33,"app-button",14),m("clickAction",function(){return n.withdrawForEditAction()}),c(34," Wycofaj do edycji "),o(),a(35,"app-button",15),m("clickAction",function(){return n.showSignings()}),c(36," Poka\u017C podpisy "),o(),a(37,"app-button-menu",16)(38,"app-menu-item-button",17),m("clickAction",function(){return n.print()}),c(39," Otw\xF3rz"),o()()(),a(40,"sn-mat-tree-table",18,1),m("rowClickEventIndicator",function(){return n.receiveRowClickEvent()}),o()()()),i&2){let l=re(41);f(B(1,24,n.approvalsEnabled$)?0:-1),s(11),p("formGroup",n.signatureFG),s(),p("checkboxes",n.typeFilteringCheckboxes),s(),p("checkboxes",n.stateFilteringCheckboxes),s(),p("sourceAccountFC",n.sourceAccountFC)("accountList",n.sourceAccounts)("fieldLabel",n.sourceAccountLabel)("hasNullOption",!1),s(9),p("disabled",l.selection.selected.length===0),s(2),p("disabled",!n.isSigBtnEnabled())("loading",n.loading),s(2),p("disabled",!n.isSigExecBtnEnabled())("loading",n.loading),s(2),p("disabled",!n.isExecBtnEnabled)("loading",n.loading),s(2),p("disabled",!n.isWithdrawSignBtnEnabled)("loading",n.loading),s(2),p("disabled",!n.isWithdrawForEditBtnEnabled)("loading",n.loading),s(2),p("disabled",l.selection.selected.length!==1)("loading",n.loading),s(2),p("disabled",!n.isPrintBtnEnabled)("loading",n.loading),s(3),p("tableProperties",n.tableProperties)}},dependencies:[Zt,yt,At,wt,q,_t,tt,gt,ot,at,rt,Mt,Xt,Ot,We,je,ei,Yt,ti,Ao],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem}.new-interface-banner[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:.875rem 1.25rem;margin-bottom:.75rem;border-radius:8px;background:linear-gradient(135deg,#e3f2fd,#f3e5f5);border:1px solid #bbdefb}.new-interface-banner[_ngcontent-%COMP%] .banner-icon[_ngcontent-%COMP%]{font-size:2rem;width:2rem;height:2rem;color:#1565c0;flex-shrink:0}.new-interface-banner[_ngcontent-%COMP%] .banner-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;flex:1;min-width:0}.new-interface-banner[_ngcontent-%COMP%] .banner-title[_ngcontent-%COMP%]{font-weight:600;font-size:.95rem;
3color:#1a237e}.new-interface-banner[_ngcontent-%COMP%] .banner-description[_ngcontent-%COMP%]{font-size:.825rem;color:#455a64;margin-top:.125rem}.signature-action-bar[_ngcontent-%COMP%]{margin-bottom:1rem}.signature-action-bar[_ngcontent-%COMP%]{position:sticky;position:-webkit-sticky;top:-16px;z-index:100}.signature-action-bar[_ngcontent-%COMP%] .action-card[_ngcontent-%COMP%]{margin-bottom:1rem;background:#fffffff2}.signature-action-bar[_ngcontent-%COMP%] .action-button-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-bottom:.3rem}.signature-action-bar[_ngcontent-%COMP%] .action-button-wrapper[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:not(:last-of-type){margin-right:.3rem}.subheader[_ngcontent-%COMP%]{font-weight:700}mat-card-actions[_ngcontent-%COMP%]{margin:0}.button-group[_ngcontent-%COMP%]:not(:last-of-type){margin-right:.3rem}button[_ngcontent-%COMP%]:not(:last-of-type){margin-right:.3rem;margin-bottom:.3rem}mat-checkbox[_ngcontent-%COMP%]{margin:12px}.signature-list-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:nth-of-type(1), .signature-list-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:nth-of-type(1){max-width:2rem}.signature-list-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-header-cell[_ngcontent-%COMP%]:not(:first-of-type):not(:last-of-type), .signature-list-wrapper[_ngcontent-%COMP%] mat-table[_ngcontent-%COMP%] mat-cell[_ngcontent-%COMP%]:not(:first-of-type):not(:last-of-type){padding:0 .25rem}.flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.gap-02rem[_ngcontent-%COMP%]{gap:.2rem}"]})}}return t})();var Aa=class{constructor(r){this.apiService=r}confirm(r){let e=r.map(i=>i.id);return this.apiService.toSigning(e)}};var Wc=(()=>{class t{constructor(e,i){this.dialog=e,this.standingOrderApiService=i,this.tableProperties={columnSettings:[{column:"type",caption:"Typ",pipeToken:kt,pipeArgs:["row.sorbnet"],cellClass:"x-start"},{column:"sourceAccount",caption:"Rachunek \u017Ar\xF3d\u0142owy",pipeToken:J,pipeArgs:[Hn],cellClass:"x-start"},{column:"name",caption:"Kontrahent",cellClass:"x-start"},{column:"targetAccount",caption:"Rachunek docelowy",pipeToken:J,cellClass:"x-start "},{column:"amount",caption:"Kwota",pipeToken:$,pipeArgs:["row.currency"],headerClass:"x-end",cellClass:"x-end"},{column:"state",caption:"Stan",pipeToken:Ko,pipeArgs:[!0]}],tableClasses:"mat-elevation-z2",arrayHoldingProp:"dispositions",collapseBy:"id",matSortDisableClear:!0,sortParentId:"id",sortParents:!0,sortChildren:!0}}openOrderDialog(e,i,n){let l=new X;return l.panelClass=Ce.LARGE,l.data={dialogVariant:n,details:i,isEdit:e},this.dialog.open(hr,l).afterClosed()}openDeleteOrderDialog(e){let i=new X;return i.panelClass=Ce.LARGE,i.data={dialogVariant:e[0].standingOrderType,details:e,isEdit:!0,isDelete:!0},this.dialog.open(hr,i).afterClosed()}openDeleteDispositionDialog(e){let i=new X;return i.data={title:"Potwierdzenie usuni\u0119cia",message:"Czy na pewno chcesz usun\u0105\u0107 wybrane rekordy?",details:e},this.dialog.open(Ee,i).afterClosed().pipe(L(n=>n.state))}openToSignDialog(e){let i=new X;return i.data={title:"Potwierd\u017A przekazanie do podpisu",message:"Czy na pewno chcesz przekaza\u0107 do podpisu?",details:e,confirmation:new Aa(this.standingOrderApiService)},this.dialog.open(Ee,i).afterClosed().pipe(L(n=>n.state))}openQuickRealizationDialog(e){let i=new X;return i.data={title:"Potwierd\u017A szybk\u0105 realizacj\u0119",message:"Czy na pewno chcesz wykona\u0107 szybk\u0105 realizacj\u0119?",details:e},this.dialog.open(Ee,i).afterClosed().pipe(L(n=>n.state))}determineIfParent(e){return!!e.dispositions}checkForExpiredStartDate(e){return e.some(i=>Me.isBeforeToday(i.startDate))}checkForExpiredExecutionDate(e){return e.some(i=>Me.isBeforeToday(i.executionDate))}isBundle(e){return!!e?.dispositions}isNew(e){return e.state===pe.NEW}hasSourceAccount(e){return!!e?.sourceAccount}isBundleNewAndActive(e){return e.state&&e.dispositions.length===0}performDeleteOperation(e){return M.isBundle(e)?this.standingOrderApiService.addDeleteDisposition(e):this.standingOrderApiService.deleteDisposition(e)}static{this.\u0275fac=function(i){return new(i||t)(G(fe),G(Qn))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var g0=["standingOrderTreeTable"],v0=["filterExpansionPanel"];function C0(t,r){t&1&&C(0,"span")}var Hc=(()=>{class t{constructor(e,i,n,l,h,D,R,se,le){this.standingOrderApiService=e,this.accountService=i,this.formBuilder=n,this.notificationService=l,this.standingOrderService=h,this.quickRealizationService=D,this.storage=R,this.spinnerService=se,this.errorProviderService=le,this.sourceAccounts=[Ht],this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.dialogTypeEnum=Wn,this.areDetailsVisible=!1,this.filteringCheckboxes=[],this.loading=!1,this.actionEnablers={addEnabled:!1,deleteEnabled:!1,editEnabled:!1,quickExecutionEnabled:!1,toSignEnabled:!1},this.rowDetails=[],this.defaultEnabler=this.actionEnablers,this.destroy$=new pt,this.modificationFC=new A,this.deletionFC=new A,this.setFC=new A,this.sourceAccountFC=new A(this.sourceAccounts[0].accountId),this.receiverNameFC=new A,this.destinationAccountFC=new A,this.standingOrderFG=this.formBuilder.group({modificationFC:this.modificationFC,deletionFC:this.deletionFC,setFC:this.setFC,sourceAccountFC:this.sourceAccountFC,receiverNameFC:this.receiverNameFC,destinationAccountFC:this.destinationAccountFC}),this.details=new xi;let de="asc",Re="type";Promise.all([this.storage.getItem(pr),this.storage.getItem(dr)]).then(([Ne,qe])=>{Ne&&qe&&(Re=Ne,de=qe)}).finally(()=>{this.tableProperties=this.standingOrderService.tableProperties,this.tableProperties.matSortActive=Re,this.tableProperties.matSortDirection=de}),this.prepareFilteringCheckboxes()}ngOnInit(){this.getChargeableAccounts(),this.initFiltersAndData(),this.getDefaultEnablers().subscribe()}onSearch(){this.refreshData().subscribe(),this.filterExpansionPanel.close()}openOrderDialog(e,i=this.rowDetails[0]?.standingOrderType||""){this.standingOrderService.openOrderDialog(e,this.rowDetails,i).pipe(ce(n=>n),y(()=>this.refreshData())).subscribe()}resetValues(){this.modificationFC.setValue(!0),this.deletionFC.setValue(!0),this.setFC.setValue(!0),this.sourceAccountFC.reset(this.sourceAccounts[0].accountId),this.receiverNameFC.reset(""),this.destinationAccountFC.reset("")}receiveRowClickEvent(){this.resolveActionButtonDisablance(),this.updateRowDetail
3s(),this.updateDetails()}openDeleteDialog(){"dispositions"in this.rowDetails[0]?this.standingOrderService.openDeleteOrderDialog(this.rowDetails).pipe(this.errorProviderService.processError(E.DELETE_ERROR,z([])),y(()=>this.refreshData())).subscribe():this.standingOrderService.openDeleteDispositionDialog(this.rowDetails).pipe(ce(i=>i),y(()=>La(this.rowDetails).pipe(kr(i=>this.standingOrderApiService.deleteDisposition(i)),Or(),this.errorProviderService.processError(E.DELETE_ERROR))),y(()=>this.refreshData())).subscribe()}authorizeQuickRealization(){this.standingOrderService.checkForExpiredExecutionDate(this.rowDetails)?this.notificationService.error(E.STANDING_ORDERS_WRONG_DATE_ERROR,Qe.OK):this.quickRealizationService.authorize(this.rowDetails).pipe(y(()=>this.refreshData()),this.errorProviderService.processError(E.AUTHORIZATION_ERROR)).subscribe()}openToSignDialog(){this.standingOrderService.checkForExpiredExecutionDate(this.rowDetails)?this.notificationService.error(E.STANDING_ORDERS_WRONG_DATE_ERROR,Qe.OK):this.standingOrderService.openToSignDialog(this.rowDetails).pipe(ce(e=>e),y(()=>this.refreshData())).subscribe()}applyIbanFormatInAccount(){let e=si.ibanFormat(this.destinationAccountFC.value);this.destinationAccountFC.setValue(e)}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}refreshSort(){this.standingOrderTreeTable.showSortChange({active:this.standingOrderTreeTable.matSortActive,direction:this.standingOrderTreeTable.matSortDirection})}setDefaultEnabler(){this.actionEnablers=this.defaultEnabler}getDefaultEnablers(){return this.standingOrderApiService.checkAllEnablers().pipe(S(e=>{this.defaultEnabler=e,this.setDefaultEnabler()}))}initFiltersAndData(){ht(ft(window,"beforeunload"),this.destroy$).subscribe(()=>{this.storage.setItem(pr,this.standingOrderTreeTable.matSortActive),this.storage.setItem(dr,this.standingOrderTreeTable.matSortDirection)}),La(this.storage.getItem(cr)).pipe(S(e=>{e?this.standingOrderFG.patchValue(e):this.resetValues()}),y(()=>this.refreshData())).subscribe()}refreshData(){return this.storage.setItem(cr,this.standingOrderFG.value),this.setDefaultEnabler(),this.setTableData(this.getTableData())}resolveActionButtonDisablance(){let e=this.standingOrderTreeTable.selection.selected;e.length===0?this.setDefaultEnabler():this.checkEditionPermission(e)}getAuditData(e){return e.length===1?this.standingOrderService.determineIfParent(e[0])?this.standingOrderApiService.getStandingOrderAudit(e[0].id):this.standingOrderApiService.getDispositionAudit(e[0].id):Be}updateRowDetails(){this.rowDetails=this.standingOrderTreeTable.selection.selected}updateDetails(){this.rowDetails.length===1?(this.areDetailsVisible=!0,this.getAuditData(this.standingOrderTreeTable.selection.selected).pipe(S(e=>{let i=this.rowDetails[0];i.createdAt=e.createdAt,i.createdBy=e.createdBy,i.modifiedAt=e.modifiedAt,i.modifiedBy=e.modifiedBy,this.details.rows=Pt.prepareStandingOrderDetails(i)}),fi(e=>{throw this.clearAuditSection(),e}),this.errorProviderService.processError(E.ERROR_OCCURED)).subscribe()):this.areDetailsVisible=!1}clearAuditSection(){let e={createdAt:"",createdBy:"",modifiedAt:"",modifiedBy:""};this.details.rows=Pt.prepareStandingOrderDetails(e)}getTableData(){let e=this.fetchStandingOrders().pipe(Va(),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([]))),i=this.fetchStandingOrderBundles().pipe(Va(),L(n=>M.extractDispositionsFromStandingOrderBundles(n)),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([])));return lo([e,i]).pipe(L(([n,l])=>[...n,...l]))}setTableData(e){return this.spinnerService.showSpinner(),e.pipe(S(i=>{this.standingOrderTreeTable.setDataSourceData(i),this.refreshSort(),this.spinnerService.hide
3Spinner()}))}fetchStandingOrders(){return this.standingOrderApiService.getStandingOrders(this.createStandingOrderRequest())}getChargeableAccounts(){this.accountService.getChargeableAccounts().pipe(S(e=>{e?this.sourceAccounts=[...this.sourceAccounts,...e]:this.sourceAccounts=[]})).subscribe()}fetchStandingOrderBundles(){return this.standingOrderApiService.getStandingOrderBundles(this.sourceAccountFC.value,this.constructDispositionTypes())}createStandingOrderRequest(){return{accountId:this.sourceAccountFC.value,recipientName:this.receiverNameFC.value,targetIban:this.destinationAccountFC.value,dispositionTypes:this.constructDispositionTypes()}}constructDispositionTypes(){let e=[];return this.setFC.value&&e.push(Wn.STANDING_ORDER_OPENING),this.modificationFC.value&&e.push(Wn.STANDING_ORDER_MODIFICATION),this.deletionFC.value&&e.push(Wn.STANDING_ORDER_BREACH),e}checkEditionPermission(e){let i=[],n=[];e.forEach(l=>{M.isBundle(l)?n.push(l.id):i.push(l.id)}),this.loading=!0,this.standingOrderApiService.checkAllEnablers(i,n).pipe(S(l=>this.actionEnablers=l),ee(()=>this.loading=!1)).subscribe()}prepareFilteringCheckboxes(){this.filteringCheckboxes=[{name:"Modyfikacja",control:this.modificationFC},{name:"Usuni\u0119cie",control:this.deletionFC},{name:"Za\u0142o\u017Cenie",control:this.setFC}]}static{this.\u0275fac=function(i){return new(i||t)(_(Qn),_(Jt),_(Gt),_(K),_(Wc),_(kl),_(It),_(nt),_(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-standing-order"]],viewQuery:function(i,n){if(i&1&&et(g0,5)(v0,5),i&2){let l;me(l=ue())&&(n.standingOrderTreeTable=l.first),me(l=ue())&&(n.filterExpansionPanel=l.first)}},standalone:!1,decls:49,vars:20,consts:[["filterExpansionPanel",""],["standingOrderTreeTable",""],["emptySpan",""],[1,"flex-col","justify-center","flex-100"],[1,"flex-col"],["appPageFilter",""],[1,"flex-col",3,"formGroup"],["labelName","Typ",3,"checkboxes"],[3,"accountList","sourceAccountFC","fieldLabel","hasNullOption"],["appearance","outline"],["autocomplete","off","matInput","","name","receiverNameFC",3,"formControl"],["autocomplete","off","matInput","","name","destinationAccountFC","type","text",3,"keyup","formControl"],[3,"clickAction"],[1,"gap-02rem"],["mainButtonName","Dodaj","icon","add",3,"disabled"],["icon","edit",3,"clickAction","disabled","loading"],["icon","delete",3,"clickAction","disabled","loading"],[3,"clickAction","disabled","loading"],["icon","settings",3,"clickAction","disabled","loading"],[3,"rowClickEventIndicator","tableProperties"],["appPageDetails","","expanded","true",1,"mat-elevation-z3","flex-col"],[1,"subheader"],[3,"details","areDetailsVisible"]],template:function(i,n){i&1&&(a(0,"app-page-container",3)(1,"app-page-header"),c(2,"Zlecenia sta\u0142e"),o(),a(3,"app-page-content",4)(4,"mat-expansion-panel",5,0)(6,"mat-expansion-panel-header")(7,"mat-panel-title"),c(8," Filtry "),o()(),a(9,"form",6),C(10,"app-filtering-checkboxes",7)(11,"app-source-account-input",8),a(12,"mat-form-field",9)(13,"mat-label"),c(14,"Nazwa odbiorcy"),o(),C(15,"input",10),o(),a(16,"mat-form-field",9)(17,"mat-label"),c(18,"Rachunek docelowy"),o(),a(19,"input",11),m("keyup",function(){return n.applyIbanFormatInAccount()}),o()(),a(20,"mat-card-actions")(21,"app-button",12),m("clickAction",function(){return n.onSearch()}),c(22,"Szukaj"),o(),a(23,"app-button",12),m("clickAction",function(){return n.resetValues()}),c(24,"Wyczy\u015B\u0107"),o()()()(),a(25,"app-page-btn-panel",13)(26,"app-button-menu",14)(27,"app-menu-item-button",12),m("clickAction",function(){return n.openOrderDialog(!1,n.dialogTypeEnum.TRANSFER_COMMON)}),c(28," Zlecenie przelew zwyk\u0142y "),o(),a(29,"app-menu-item-button",12),m("clickAction",function(){return n.openOrderDialog(!1,n.dialogTypeEnum.TRANSFER_VAT)}),c(30," Zlecenie faktura VAT "),o()(),a(31,"app-button",15),m("clickAction",function(){return n.openOrderDialog(!0)}),c(32," Edytuj "),o(),a(33,"app-button",16),m("clickAction",function(){return n.openDeleteDialog()}),c(34," Usu\u0144 "),o(),a(35,"app-button",17),m("clickAction",function(){return n.openToSignDialog()}),c(36," Do podpisu "),o(),a(37,"app-button",18),m("clickAction",function(){return n.authorizeQuickRealization()}),c(38," Sz. realizacja "),o()(),a(39,"sn-mat-tree-table",19,1),m("rowClickEventIndicator",function(){return n.receiveRowClickEvent()}),o()(),a(41,"mat-expansion-panel",20)(42,"mat-expansion-panel-header")(43,"mat-panel-title")(44,"h3",21),c(45,"Szczeg\xF3\u0142y"),o()()(),C(46,"app-details",22),o()(),Z(47,C0,1,0,"ng-template",null,2,Gr)),i&2&&(s(9),p("formGroup",n.standingOrderFG),s(),p("checkboxes",n.filteringCheckboxes),s(),p("accountList",n.sourceAccounts)("sourceAccountFC",n.sourceAccountFC)("fieldLabel",n.sourceAccountLabel)("hasNullOption",!1),s(4),p("formControl",n.receiverNameFC),s(4),p("formControl",n.destinationAccountFC),s(7),p("disabled",!n.actionEnablers.addEnabled),s(5),p("disabled",!n.actionEnablers.editEnabled)("loading",n.loading),s(2),p("disabled",!n.actionEnablers.deleteEnabled)("loading",n.loading),s(2),p("disabled",!n.actionEnablers.toSignEnabled)("loading",n.loading),s(2),p("disabled",!n.actionEnablers.quickExecutionEnabled)("loading",n.loading),s(2),p("tableProperties",n.tableProperties),s(7),p("details",n.details)("areDetailsVisible",n.areDetailsVisible))},dependencies:[be,Ie,Zt,yt,At,wt,Se,_t,ve,De,tt,Ve,gt,ot,at,rt,xn,Mt,Xt,Ot,We,je,ei,Yt,Di,ti],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem}",".flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}",".justify-center[_ngcontent-%COMP%]{justify-content:center}",".gap-02rem[_ngcontent-%COMP%]{gap:.2rem}",".flex-100[_ngcontent-%COMP%]{flex:1 1 100%;max-width:100%;box-sizing:border-box}"]})}}return t})();var wa=(function(t){return t.US_CLO="Przelew US/C\u0141O",t.INTERNATIONAL="Zagraniczny",t.INSTANT="Natychmiastowy",t.VAT_INVOICE="Faktura VAT",t.COMMON="Zwyk\u0142y",t.PERSONAL="W\u0142asny",t.SORBNET="Natychmiastowy",t.VAT_TRANSFERENCE="Przekazanie VAT",t})(wa||{});var Ia=class{constructor(r,e){this.packageService=r,this.dispositionApiService=e}confirm(r){let e=[],i=[];return r.forEach(n=>
3{n.bundleId===void 0?e.push(n.id):n.virtual?e.push(n.bundleId):i.push(n.id)}),e.length!==0&&i.length!==0?this.packageService.delete(e).pipe(y(()=>this.dispositionApiService.deleteDisposition(i))):e.length!==0?this.packageService.delete(e):i.length!==0?this.dispositionApiService.deleteDisposition(i):z([])}};var Ma=class{constructor(r){this.acceptTransferService=r}confirm(r){let e=M.mapBundlesToIdList(r);return this.acceptTransferService.toSign(e)}};var Pa=(()=>{class t{constructor(e,i,n,l,h,D,R){this.dialog=e,this.packagesService=i,this.dispositionApiService=n,this.transferDialogService=l,this.acceptTransferService=h,this.errorProcessingService=D,this.notificationService=R}openDialog(e,i,n){let l;return i&&(l=n.filter(h=>h.accountNumber===i?.sourceAccount)[0]?.accountId||void 0),this.transferDialogService.openDialog(e,qo.newWithBundleId(i,l),qn.NEW).afterClosed().pipe(L(h=>!!h))}openPackageDialog(){let e=new X;return e.panelClass=Ce.LARGE,e.data={title:Ge.CREATE_BUNDLE_TITLE},this.dialog.open(Cr,e).afterClosed().pipe(L(i=>!!i))}openEditionDialog(e){if("virtual"in e&&e.virtual!==void 0&&e.type===yn.TRANSFER){let i=new X;return i.data={title:Ge.EDIT_BUNDLE_TITLE,bundle:e},this.dialog.open(Cr,i).afterClosed().pipe(this.mapToBoolean())}return this.acceptTransferService.getTransferData(e.id.toString()).pipe(y(i=>this.transferDialogService.openDialog(Dn.parse(e.type),i,qn.EDIT).afterClosed().pipe(this.mapToBoolean())))}openImportDialog(e,i,n){let l={transferFileType:e,bundles:i,selectedBundle:n};return this.dialog.open(Hl,{minWidth:"40%",data:l,disableClose:!0}).afterClosed().pipe(this.mapToBoolean())}openImportSalaryDialog(e){let i={transferFileType:e};return this.dialog.open($l,{panelClass:Ce.SMALL,data:i,disableClose:!0}).afterClosed().pipe(this.mapToBoolean())}openDeleteDialog(e){let i=new X;return i.data={title:Ge.ACCEPT_TRANSFER_DELETE_TITLE,message:Ge.ACCEPT_TRANSFER_DELETE_MESSAGE,details:e,confirmation:new Ia(this.packagesService,this.dispositionApiService)},this.dialog.open(Ee,i).afterClosed().pipe(L(n=>n.state))}openSignDialog(e,i){let n=new X;return n.data={title:Ge.ACCEPT_TRANSFER_TO_SIGN_TITLE,message:Ge.ACCEPT_TRANSFER_TO_SIGN_MESSAGE,details:e,confirmation:new Ma(this.acceptTransferService),errorMessage:i},this.dialog.open(Ee,n).afterClosed().pipe(S(l=>{if(!l.state&&l.error){let h=l.error.msgInfo.map(D=>ms.removeTrashBracketDataFromError(D.messageKey));this.showNotification(e.length-l.error.msgInfo.length,l.error.msgInfo.length,h)}}),this.errorProcessingService.processError(E.ERROR_OCCURED,z(!1),!1),this.mapToBoolean())}mapToBoolean(){return L(e=>!!e)}showNotification(e,i,n){let l={title:"Podsumowanie",component:new Bo(Sl,{successCount:e,invalidCount:i,errorMessages:n})};this.notificationService.warningWithHTML(l)}static{this.\u0275fac=function(i){return new(i||t)(G(fe),G(aa),G(Yi),G(Yo),G(Tn),G(Y),G(K))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ct=(function(t){return t.ABOVE="drop-above",t.CENTER="drop-center",t.BELOW="drop-below",t.EMPTY="",t})(ct||{});var Oe=class{static targetRowIsDispositionInBundle(r){return"bundleId"in r&&!M.isVirtual(r)}static atLeastTwoRowsAreSelected(r){return r?.length>1}static getSelectedWithoutTargetRow(r,e){return[...r].filter(i=>i!==e&&this.dropIntoDifferBundle(i,e))}static draggedRowIsNotTargetRow(r,e){return r!==e}static theyHaveDifferentSourceAccounts(r,e){return!!r.find(i=>i.sourceAccount!==e.sourceAccount)}static shouldBlockExternalTransferToForeignSourceAccount(r,e,i){return!e||!this.isForeignCurrency(e.currency)?!1:r.some(n=>this.isStandardExternalTransfer(n,i))}static isForeignCurrency(r){return!!r&&r!=="PLN"}static isStandardExternalTransfer(r,e){return"dispositions"in r?!1:r.type===W.PRZELEW_ZWYKLY&&!r.sorbnet&&!si.isOwnBankAccount(r.targetAccount,e)}static dropIntoDifferBundle(r,e){return!(this.dispositionsAreInTheSameBundle(r,e)||this.dispositionIsInBundle(r,e))}static ifTryToMoveVirtualToVirtual(r,e,i){let n=M.isBundle(i)||this.targetRowIsDispositionInBundle(i),l=r.selected.length>2,h=r.selected.every(R=>M.isVirtual(R)),D=M.isVirtual(e);return!1}static shouldShowSameTargetAndSourceAccountWarning(r,e,i){let n=!!r.sourceAccount&&(e.selected.map(l=>l.targetAccount).includes(r.sourceAccount)||r.sourceAccount===i.targetAccount);return!!r.sourceAccount&&n&&!M.isVirtual(r)}static dispositionsAreInTheSameBundle(r,e){return"bundleId"in r&&!!e&&"bundleId"in e&&r.bundleId===e.bundleId}static dispositionIsInBundle(r,e){return"bundleId"in r&&!!e&&e.id===r.bundleId}};var Oa=class{static getParentFromTargetRow(r,e){if("bundleId"in e)return r.find(i=>i.id===e.bundleId);throw new vs}};var ka=class{constructor({target:r,allRows:e,hoverRow:i,hoverArea:n}){this.target=r,this.allRows=e,this.hoverRow=i,this.hoverArea=n}get(){return!this.hoverRow||this.hoverArea===(ct.CENTER||ct.EMPTY)?this.prepareForCenterArea():this.hoverArea===ct.ABOVE?this.prepareForAboveArea():this.prepareForBelowArea()}prepareForCenterArea(){return M.isBundle(this.target)?this.target:Oe.targetRowIsDispositionInBundle(this.target)?Oa.getParentFromTargetRow(this.allRows,this.target):null}prepareForAboveArea(){return this.shouldMoveOutsidePackageWhenDropAbove()?null:this.prepareForCenterArea()}prepareForBelowArea(){return this.shouldMoveOutsidePackageWhenDropBelow()?null:this.prepareForCenterArea()}shouldMoveOutsidePackageWhenDropAbove(){if(M.isBundle(this.target))return!0;let r=this.getRowIndex(this.target);if(r<1)return!0;let i=this.getRowByIndex(r-1),n=!M.isBundle(i)&&!Oe.dispositionsAreInTheSameBundle(this.target,i
3),l=M.isBundle(i)&&!Oe.dispositionIsInBundle(this.target,i);return n||l}shouldMoveOutsidePackageWhenDropBelow(){let r=this.getRowIndex(this.target);if(r===this.allRows.length-1)return!0;let i=this.getRowByIndex(r+1);if(M.isBundle(i))return!0;let n=!M.isBundle(this.target)&&!Oe.dispositionsAreInTheSameBundle(this.target,i),l=M.isBundle(this.target)&&!Oe.dispositionIsInBundle(i,this.target);return n||l}getRowIndex(r){return this.allRows.indexOf(r)}getRowByIndex(r){return this.allRows[r]}};var qc="MAT-ROW",E0="BODY",Wi=class t{static findMatRowElement(r){for(;r!==null&&r.tagName!==(qc||E0);)r=r.parentElement;if(r?.tagName===qc)return r;throw new gs}static removeOldClassName(r){r&&[ct.ABOVE,ct.BELOW,ct.CENTER].forEach(i=>r.classList.remove(i))}static getDragOverArea(r){let e=this.getClientHeight(r.target),i=r.offsetY/e;return i<.1?ct.ABOVE:i>.8?ct.BELOW:ct.CENTER}static toggleHoverElementsClasses(r,e,i){t.removeOldClassName(r),e.classList.add(i)}static getClientHeight(r){return r=this.findMatRowElement(r),r.clientHeight}};var x0=`Przeniesienie wybranych przelew\xF3w powoduje zmian\u0119 rachunku \u017Ar\xF3d\u0142owego niekt\xF3rych z nich. 4 Czy na pewno chcesz to zrobi\u0107?`,Fa=(()=>{class t{constructor(e,i){this.acceptTransferService=e,this.dialog=i}move({rowsToMove:e,target:i}){return i===null?this.moveRowsOutside(e):Oe.theyHaveDifferentSourceAccounts(e,i)?this.showWarningDialog().pipe(ce(n=>n),y(()=>this.moveRowsToTarget(e,i))):this.moveRowsToTarget(e,i)}moveRowsToTarget(e,i){return this.acceptTransferService.pasteTransferToBundle({isCopy:!1,destinationBundleId:i.id,selectedDispositions:e.map(n=>n.id)})}moveRowsOutside(e){return this.acceptTransferService.pasteTransferToBundle({isCopy:!1,destinationBundleId:null,selectedDispositions:e.map(i=>i.id)})}showWarningDialog(){let e=new X;return e.data={title:Ge.CONFIRM_OPERATION,message:x0},this.dialog.open(Ee,e).afterClosed().pipe(L(i=>i.state))}static{this.\u0275fac=function(i){return new(i||t)(G(Tn),G(fe))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Rn=(()=>{class t{constructor(){this.draggedRow=new za(null),this.draggedOverElement=new za(null)}setDraggedRow(e){this.draggedRow.next(e)}getDraggedRowValue(){return this.draggedRow.getValue()}clearDraggedRow(){this.setDraggedRow(null)}setDraggedOverElement(e){this.draggedOverElement.next(e)}getDraggedOverElementValue(){return this.draggedOverElement.getValue()}clearDraggedOverElement(){this.setDraggedRow(null)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Ra=(()=>{class t{constructor(e,i,n,l){this.moveItemService=e,this.notification=i,this.store=n,this.errorProviderService=l,this.areaOfHoverElement=ct.EMPTY,this.parameterService=v(Ei),this.bankIds=ds(this.parameterService.getParameterAsStringArray(Ze.BANK_IDS),{initialValue:[]})}handleDragOver({event:e,row:i}){this.handleDragOverRow=i,this.areaOfHoverElement=Wi.getDragOverArea(e);let n=this.actualHoverElement;this.actualHoverElement=Wi.findMatRowElement(e.target),Wi.toggleHoverElementsClasses(n,this.actualHoverElement,this.areaOfHoverElement)}handleDrop({selection:e,dataSource:i,targetRow:n}){let l=this.store.getDraggedRowValue();if(Wi.removeOldClassName(this.actualHoverElement),Oe.ifTryToMoveVirtualToVirtual(e,l,n))return Be;if(Oe.shouldShowSameTargetAndSourceAccountWarning(n,e,l))return this.notification.error(E.TARGET_ACCOUNT_SAME_AS_BUNDLE_SOURCE_ACCOUNT_WARNING),Be;let h={target:n,allRows:i.data,hoverRow:this.handleDragOverRow,hoverArea:this.areaOfHoverElement},D=new ka(h).get(),R=this.getDraggedRowDiffersThanTargetRow(l,e.selected,D);return R.length?Oe.shouldBlockExternalTransferToForeignSourceAccount(R,D,this.bankIds())?(this.notification.error(E.EXTERNAL_TRANSFER_FOREIGN_SOURCE_ACCOUNT_WARNING),Be):this.moveItemService.move({rowsToMove:R,target:D}).pipe(this.errorProviderService.processError(E.ERROR_OCCURED)):Be}getDraggedRowDiffersThanTargetRow(e,i,n){return Oe.atLeastTwoRowsAreSelected(i)?Oe.getSelectedWithoutTargetRow(i,n):Oe.draggedRowIsNotTargetRow(e,n)&&Oe.dropIntoDifferBundle(e,n)?[e]:[]}static{this.\u0275fac=function(i){return new(i||t)(G(Fa),G(K),G(Rn),G(Y))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var y0=["acceptTransferTreeTable"],A0=["filterExpansionPanel"];function w0(t,r){if(t&1){let e=F();a(0,"app-menu-item-button",9),m("clickAction",function(){P(e);let n=d();return O(n.openDialog(n.transferTypeEnum.SORBNET))}),c(1," Zwyk\u0142y + sorbnet "),o()}}var Qc="dateOfExecution",Kc=(()=>{class t{constructor(e,i,n,l,h,D,R,se,le,de,Re,Ne,qe,Hi,Na,Ba){this.formBuilder=e,this.transfersService=i,this.transferImportService=n,this.dialogService=l,this.quickRealizationAdapterService=h,this.userFacadeService=D,this.storage=R,this.dragAndDropService=se,this.dragAndDropStore=le,this.spinnerService=de,this.whiteListService=Re,this.errorProviderService=Ne,this.notificationService=qe,this.signatureDialog=Hi,this.dispositionApiService=Na,this.sorbnetValidationService=Ba,this.details=new xi,this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.accountTypes=[Ht],this.transferTypeEnum=ri,this.TransferFileType=Ks,this.ButtonThemeType=al,this.quickRealizationBtnEnabled=!1,this.signingBtnEnabled=!1,this.isEditAuthoritiesEnable=!1,this.isForeignAuthoritiesEnable=!1,this.isImportAuthoritiesEnable=!1,this.isImportSwiftAuthoritiesEnable=!1,this.isImportSalaryMenuEnable=!1,this.editBtnEnabled=!1,this.deleteBtnEnabled=!1,this.isVatEnabled=!1,this.isVatTransmissionEnabled=!1,this.isImportPackage=!1,this.whiteListEnabled=!1,this.isTransferSorbnetEnabled=!1,this.filteringCheckboxes=[],this.quickRealizationLoading=!1,this.whiteListLoading=!1,this.transferTypeNameEnum=wa,this.PAST_DATE_ERROR_MESSAGE="Lista zawiera paczki z niepoprawn\u0105 dat\u0105 wykonania i/lub ostatecznej realizacji - zmieniam na dat\u0119 dzisiejsz\u0105",this.isAcceptAuthoritiesEnable=!1,this.isRealizationAuthoritiesEnable=!1,this.isWhiteListPermissionEnabled=!1,this.destroy$=new pt,this.searchSubject=ne
4w pt,this.parameterService=v(Ei),this.perLoginParameterService=v(Li),this.foreignTransferLabel=this.perLoginParameterService.get(Ze.TRANSFER_FOREIGN_CURRENCY_TRANSFER_ENABLED).pipe(L(Boolean),L(ke=>ke?"Walutowy":"Zagraniczny")),this.isEditAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_TRANSFER_EDIT]),this.isForeignAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_TRANSFER_FOREIGN_EDIT]),this.isImportAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_TRANSFER_IMPORT]),this.isImportSwiftAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_TRANSFER_FOREIGN_IMPORT]),this.isImportSalaryMenuEnable=this.userFacadeService.hasAuthorities([Q.FUNC_TRANSFER_WAGES]),this.isAcceptAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_ACCEPT]),this.isRealizationAuthoritiesEnable=this.userFacadeService.hasAuthorities([Q.FUNC_EXECUTE]),this.usCloTypeFC=new A(!0),this.internationalFC=new A(!0),this.instantFC=new A(!0),this.vatInvoiceFC=new A(!0),this.commonFC=new A(!0),this.sourceAccountFC=new A(this.accountTypes[0].accountId),this.recipientNameFC=new A,this.targetAccountFC=new A,this.acceptFilterFG=this.formBuilder.group({usCloTypeFC:this.usCloTypeFC,internationalFC:this.internationalFC,instantFC:this.instantFC,vatInvoiceFC:this.vatInvoiceFC,commonFC:this.commonFC,sourceAccountFC:this.sourceAccountFC,recipientNameFC:this.recipientNameFC,targetAccountFC:this.targetAccountFC});let Nn="asc",Bn=Qc;this.sorbnetDispositions=[],this.storage.getItem(Xa).then(ke=>{ke&&(Bn=ke),this.storage.getItem(Ja).then(zn=>{zn&&(Nn=zn)})}).finally(()=>{this.tableProperties={columnSettings:[{column:"name",caption:"Nazwa",stylePipeToken:yi,stylePipeArgs:[],styleProp:"whiteListVerificationState",styleClass:"bold red",headerClass:"fill-arrow-space at-cell-margin-right",cellClass:"x-start at-cell-margin-right",styleProperties:[{attribute:"min-width",value:"150px"}]},{column:"targetAccount",caption:"Rachunek beneficjenta",pipeToken:J,cellClass:"x-start ",styleProperties:[{attribute:"min-width",value:"15.5rem"},{attribute:"max-width",value:"16.0rem"}]},{column:"amount",caption:"Kwota",pipeToken:$,pipeArgs:["row.currency"],cellClass:"x-end",styleProperties:[{attribute:"min-width",value:"8rem"},{attribute:"max-width",value:"9rem"}]},{column:"vatAmount",caption:"W tym VAT",pipeToken:$,pipeArgs:["row.currency"],styleProperties:[{attribute:"min-width",value:"8rem"},{attribute:"max-width",value:"9rem"}]},{column:"title",caption:"Tytu\u0142em",cellClass:"x-start ",styleProperties:[{attribute:"min-width",value:"200px"}],alternativeDataSource:{whenShouldUseAlternativeValue:ke=>M.isBundle(ke),getAlternativeValue:()=>"-"}},{column:Qc,caption:"Data wykonania",styleProperties:[{attribute:"min-width",value:"5.5rem"},{attribute:"max-width",value:"5.5rem"}]},{column:"sourceAccount",caption:"Rachunek \u017Ar\xF3d\u0142owy",pipeToken:J,pipeArgs:[Hn],cellClass:"x-start ",styleProperties:[{attribute:"min-width",value:"15.5rem"},{attribute:"max-width",value:"16.0rem"}]},{column:"type",caption:"Typ",pipeToken:kt,pipeArgs:["row.sorbnet"],styleProperties:[{attribute:"min-width",value:"9rem"},{attribute:"max-width",value:"11rem"}]}],arrayHoldingProp:"dispositions",arrayHoldingPropCount:"dispositionsAmount",collapseBy:"id",matSortActive:Bn,matSortDirection:Nn,matSortDisableClear:!0,sortParentId:"id",sortParents:!0,sortChildren:!0,tableClasses:"mat-elevation-z3",draggable:{enable:!0,excludeRowsBy:"bundleId"}}}),this.transferTypeNameEnum=wa,this.prepareFilteringCheckboxes()}ngOnInit(){this.transfersService.refreshEventObservable.pipe(y(()=>this.getDataAndCheckAuthorities())).subscribe(),this.checkSalaryImportPermission(),this.getChargeableAccounts().subscribe(),this.initFiltersAndData(),this.checkVatPermission(),this.checkVatTransmissionPermission(),this.getWhiteListPermission(),this.setSorbnetEnabledParameter(),this.setSorbnetDeadline(),this.setThrottleOnQuickRealizationButtonEnabler()}onSearch(){this.storage.setItem(Ya,this.acceptFilterFG.value),this.getDataAndCheckAuthorities().subscribe(),this.filterExpansionPanel.close()}resetValues(){this.acceptFilterFG.reset(),this.acceptFilterFG.patchValue({usCloTypeFC:!0,internationalFC:!0,instantFC:!0,vatInvoiceFC:!0,commonFC:!0,sourceAccountFC:this.accountTypes[0].accountId,recipientNameFC:"",targetAccountFC:""})}receiveRowClickEvent(){let e=this.acceptTransferTreeTable.selection.selected;this.whiteListEnabled=this.isWhiteListAuthorities(),this.editBtnEnabled=this.isEditAuthorities(),this.deleteBtnEnabled=this.isEditAuthorities(),this.isImportPackage=this.isImportPackageSelected(e),e.length===1?this.resolveSingleSelection(e):e.length>1&&this.resolveMultiSelection(e),this.updateSorbnetDispositions(),this.checkAcceptAuthorities()}performQuickRealization(){let e=this.acceptTransferTreeTable.selection.selected,i=this.getErrMsgForSelected(e);this.acceptTransferTreeTable.setTableInactive(),this.whiteListService.checkBundleList(e).pi
4pe(y(n=>n?this.executeSorbnetOrDomestic(e,i):this.whiteListService.openConfirmationDialogForWhiteList().pipe(y(l=>l?this.executeSorbnetOrDomestic(e,i):Be)))).subscribe()}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete(),this.searchSubscription?.unsubscribe()}doPrintAction(){let e=this.prepareBundleList();this.transfersService.printAction(e[0])}doSavePdfAction(){let e=this.prepareBundleList();this.transfersService.savePdfAction(e[0])}openDialog(e){let i=this.acceptTransferTreeTable.selection.selected[0];this.refreshDataAndPreventCollapse(this.dialogService.openDialog(e,i,this.accountTypes),i)}openEditionDialog(){let e=this.acceptTransferTreeTable.selection.selected[0];this.refreshDataAndPreventCollapse(this.dialogService.openEditionDialog(e),e)}openPackageDialog(){this.refreshDataAfterDialogClose(this.dialogService.openPackageDialog())}openImportDialog(e){this.refreshDataAfterDialogClose(this.dialogService.openImportDialog(e,this.bundles,this.acceptTransferTreeTable.selection.selected[0]))}openImportSalaryDialog(e){this.refreshDataAfterDialogClose(this.dialogService.openImportSalaryDialog(e))}openDeleteDialog(){this.refreshDataAfterDialogClose(this.dialogService.openDeleteDialog(this.acceptTransferTreeTable.selection.selected))}openSignDialog(){let e=this.getErrMsgForSelected(this.acceptTransferTreeTable.selection.selected);this.refreshDataAfterDialogClose(this.dialogService.openSignDialog(this.acceptTransferTreeTable.selection.selected,e))}handleDragStart(e){this.dragAndDropStore.setDraggedRow(e)}handleDragEnd(){this.dragAndDropStore.clearDraggedRow(),this.dragAndDropStore.clearDraggedOverElement()}handleDragOver(e){this.dragAndDropService.handleDragOver(e)}handleDrop(e){let i=this.acceptTransferTreeTable.selection.selected;this.dragAndDropService.handleDrop({selection:this.acceptTransferTreeTable.selection,dataSource:this.acceptTransferTreeTable.dataSource,targetRow:e}).pipe(S(()=>this.handleDragEnd()),y(()=>this.getDataAndSort(!0)),S(()=>{this.acceptTransferTreeTable.selection.select(...i),this.checkAcceptAuthorities()})).subscribe()}updateWhiteList(){this.whiteListLoading=!0,this.whiteListService.checkBundleList(this.acceptTransferTreeTable.selection.selected).pipe(S(e=>{e?this.notificationService.success(E.REFRESH_WHITE_LIST_SUCCESS):this.notificationService.warning(E.REFRESH_WHITE_LIST_SUCCESS)}),this.errorProviderService.processError(E.REFRESH_WHITE_LIST_ERROR),y(()=>this.getDataAndCheckAuthorities()),ee(()=>this.whiteListLoading=!1)).subscribe()}getChargeableAccounts(){return this.transfersService.getChargeableAccounts().pipe(S(e=>{this.accountTypes=e?[...this.accountTypes,...e]:[]}))}constructTransferTypes(){let e=[];return this.usCloTypeFC.value&&e.push(ri.US_CLO),this.internationalFC.value&&e.push(ri.INTERNATIONAL),this.instantFC.value&&e.push(ri.INSTANT),this.vatInvoiceFC.value&&e.push(ri.VAT_INVOICE),this.commonFC.value&&e.push(ri.COMMON),e}refreshDataAfterDialogClose(e){e.pipe(y(i=>i?this.getDataAndCheckAuthorities():z())).subscribe()}refreshDataAndPreventCollapse(e,i){e.pipe(y(n=>n?this.getDataAndSort(!0):z(void 0)),S(n=>{this.acceptTransferTreeTable.selection.clear();let l=n?this.acceptTransferTreeTable.dataSource.data.find(h=>h.id===i.id):i;l&&this.acceptTransferTreeTable.selection.select(l),this.checkAcceptAuthorities()})).subscribe()}getTransferFilters(){let e=this.constructTransferTypes();return{recipientName:this.recipientNameFC.value,sourceAccountId:this.sourceAccountFC.value,targetAccount:this.targetAccountFC.value,transferType:e}}resolveSingleSelection(e){e[0].dispositions?this.fetchBundleDetailsForSelected(e):this.fetchDispositionDetailsForSelected(e)}resolveMultiSelection(e){let i={tableConfig:this.tableProperties,tableService:this.acceptTransferTreeTable.treeTableService};this.details.rows=Pt.prepareBundleSummary(ta.calculate(e,i),e.length)}fetchBundleDetailsForSelected(e){let i=e[0];this.transfersService.getBundleDetails(i.id).pipe(S(n=>{this.details.rows=Pt.prepareTransferDetails(i,n,this.editBtnEnabled)}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR)).subscribe()}
4fetchDispositionDetailsForSelected(e){let i=e[0];this.transfersService.getDispositionDetails(i.id).pipe(S(n=>{this.details.rows=Pt.prepareTransferDetails(i,n,this.editBtnEnabled)})).subscribe()}getDataAndSort(e=!1){return this.getData().pipe(S(i=>{this.acceptTransferTreeTable.setDataSourceData(i,e),this.refreshSort()}))}getDataAndCheckAuthorities(){return this.getDataAndSort().pipe(S(()=>this.checkAcceptAuthorities()))}getData(){return this.spinnerService.showSpinner(),this.transfersService.getTransfers(this.getTransferFilters()).pipe(S(e=>this.acceptTransferTreeTable.setResultsLength(e.length)),S(e=>{this.spinnerService.hideSpinner(),this.bundles=e}),L(e=>M.mapVirtualBundles(e,!0)),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([])))}checkVatPermission(){this.transfersService.checkVatPermission().pipe(S(e=>this.isVatEnabled=e)).subscribe()}checkVatTransmissionPermission(){this.transfersService.checkVatTransmissionPermission().pipe(S(e=>this.isVatTransmissionEnabled=e)).subscribe()}isImportPackageSelected(e){return e.some(i=>"imported"in i&&i?.imported)}checkSalaryImportPermission(){this.transferImportService.salaryImportEnable().subscribe(e=>this.isImportSalaryMenuEnable=e)}prepareFilteringCheckboxes(){this.filteringCheckboxes=[{name:this.transferTypeNameEnum.US_CLO,control:this.usCloTypeFC},{name:this.transferTypeNameEnum.INTERNATIONAL,control:this.internationalFC},{name:this.transferTypeNameEnum.INSTANT,control:this.instantFC},{name:this.transferTypeNameEnum.VAT_INVOICE,control:this.vatInvoiceFC},{name:this.transferTypeNameEnum.COMMON,control:this.commonFC}]}getWhiteListPermission(){this.whiteListService.isWhiteListEnabled().pipe(S(e=>this.isWhiteListPermissionEnabled=e)).subscribe()}isWhiteListAuthorities(){let e=this.acceptTransferTreeTable.selection.selected;return this.isWhiteListPermissionEnabled&&e.length===1&&!!e[0]?.whiteListVerificationState&&e[0]?.whiteListVerificationState!==ll.NO_CHECK&&e[0]?.whiteListVerificationState!==sl.NO_CHECK}updateSorbnetDispositions(){this.sorbnetDispositions=[],this.acceptTransferTreeTable.selection.selected.forEach(e=>{e.sorbnet===!0&&this.sorbnetDispositions.push(e),e.dispositions!==void 0&&e.dispositions.forEach(i=>{i.sorbnet===!0&&this.sorbnetDispositions.push(i)})})}setSorbnetEnabledParameter(){this.parameterService.getParameterAsBoolean(Ze.TRANSFER_SORBNET_ENABLED).pipe(S(e=>this.isTransferSorbnetEnabled=e)).subscribe()}setThrottleOnQuickRealizationButtonEnabler(){this.searchSubscription=this.searchSubject.pipe(Fr(900),Rr(()=>{let e=this.acceptTransferTreeTable.selection.selected;return this.quickRealizationAdapterService.checkEnabled(M.mapBundlesToIdList(e)).pipe(fi(()=>z(!1)),ee(()=>{let i=this.acceptTransferTreeTable.selection.selected;i.length!==0&&e!==i&&this.searchSubject.next(i)}),ce(()=>e===this.acceptTransferTreeTable.selection.selected))})).subscribe(e=>{this.quickRealizationBtnEnabled=e,this.quickRealizationLoading=!1})}initFiltersAndData(){ht(ft(window,"beforeunload"),this.destroy$).subscribe(()=>{this.storage.setItem(Xa,this.acceptTransferTreeTable.matSortActive),this.storage.setItem(Ja,this.acceptTransferTreeTable.matSortDirection)}),this.storage.getItem(Ya).then(e=>{e&&this.acceptFilterFG.patchValue(e)}).finally(()=>this.getDataAndCheckAuthorities().subscribe())}setSorbnetDeadline(){so([this.parameterService.getParameterAsString(Ze.TRANSFER_SORBNET_DEADLINE)]).subscribe(([e])=>{this.sorbnetDate=new Date(e)})}checkIfSelectionIsEnabledForQuickRealization(e){this.quickRealizationLoading=!0;let i=e.filter(l=>!!l.bundleId&&!l.virtual);if(e.length===0||i.length>0){this.quickRealizationBtnEnabled=!1,this.quickRealizationLoading=!1;return}let n=M.mapBundlesToIdList(e);this.isRealizationAuthoritiesEnable&&this.isAcceptAuthoritiesEnable?this.searchSubject.next(n):this.quickRealizationLoading=!1}executeSorbnetOrDomestic(e,i){return this.quickRealizationAdapterService.validate(M.mapBundlesToIdList(e)).pipe(dt(n=>this.handleBundleValidationResponse(n,e,i)))}handleBundleValidationResponse(e,i,n){return this.sorbnetValidationService.isImpossible(e)?this.handleSorbnetAsDomestic(i,n):this.authorizeQuickRealization(i,n)}handleSorbnetAsDomestic(e,i){return this.signatureDialog.openAcceptSorbnetAsNormal(this.sorbnetDate,this.sorbnetDispositions).pipe(ce(n=>n),dt(()=>this.dispositionApiService.updateDispositions(this.sorbnetDispositions.map(n=>n.id))),dt(()=>this.authorizeQuickRealization(e,i)),this.errorProviderService.processError(E.REALIZATION_ERROR))}authorizeQuickRealization(e,i){return this.quickRealizationAdapterService.authorize(e,i).pipe(y(()=>this.getDataAndCheckAuthorities()),this.errorProviderService.processError(E.AUTHORIZATION_ERROR,Be,!1),ee(()=>this.acceptTransferTreeTable.setTableActive()))}prepareBundleList(){return this.bundles.filter(e=>this.acceptTransferTreeTable.selection.selected.filter(n=>n.virtual===!1?e.id===n.id:!!e.dispositions&&n.id===e.dispositions[0]?.id).length>0)}getErrMsgForSelected(e){return e.some(i=>i.dateOfExecution&&Me.isBeforeToday(i.dateOfExecution)||i.finalExecuteDate&&Me.isBeforeToday(i.finalExecuteDate))?this.PAST_DATE_ERROR_MESSAGE:""}refreshSort(){this.acceptTransferTreeTable.showSortChange({active:this.acceptTransferTreeTable.matSortActive,direction:this.acceptTransferTreeTable.matSortDirection})}isEditAuthorities(){return this?.acceptTransferTreeTable?.selection?.selected[0]?.type===W.PRZELEW_ZAGRANICZNY?this.isForeignAuthoritiesEnable:this.isEditAuthoritiesEnable}checkAcceptAuthorities(){let e=this.acceptTransferTreeTable.selection.selected;this.isAcceptAuthoritiesEnable&&e.length>0?(this.checkIfSelectionIsEnabledForQuickRealization(e),this.signingBtnEnabled=M.everyHasSourceAccount(this.prepareBundleList())&&M.everyAreBundlesOrVirtualDis
4positions(e)):(this.quickRealizationBtnEnabled=!1,this.quickRealizationLoading=!1,this.signingBtnEnabled=!1)}static{this.\u0275fac=function(i){return new(i||t)(_(Gt),_(Tn),_(Ti),_(Pa),_(Fl),_(Pe),_(It),_(Ra),_(Rn),_(nt),_(ea),_(Y),_(K),_(An),_(Yi),_(Zo))}}static{this.\u0275cmp=x({type:t,selectors:[["app-accept-transfer"]],viewQuery:function(i,n){if(i&1&&et(y0,5)(A0,5),i&2){let l;me(l=ue())&&(n.acceptTransferTreeTable=l.first),me(l=ue())&&(n.filterExpansionPanel=l.first)}},standalone:!1,decls:86,vars:33,consts:[["filterExpansionPanel",""],["acceptTransferTreeTable",""],["appPageFilter",""],[1,"flex-col"],["labelName","Typ",3,"checkboxes"],[3,"accountList","sourceAccountFC","fieldLabel","hasNullOption"],["appearance","outline"],["autocomplete","off","matInput","","name","recipientNameFC","type","text",3,"formControl"],["autocomplete","off","matInput","","name","targetAccountFC","type","text",3,"formControl"],[3,"clickAction"],[1,"gap-02rem"],["icon","refresh",3,"clickAction"],["mainButtonName","Dodaj przelew",3,"disabled"],["hint","w tym ZUS",3,"clickAction"],[3,"clickAction","disabled"],[3,"clickAction","disabled","loading"],["icon","print",3,"clickAction","disabled"],["icon","file_download",3,"clickAction","disabled"],["mainButtonName","Import"],["mainButtonName","Import p\u0142acowy",3,"disabled"],[3,"handleDragEndEvent","handleDragStartEvent","handleDropEvent","handleDragOverEvent","rowClickEventIndicator","tableProperties"],["appPageDetails","","expanded","true",1,"mat-elevation-z5","flex-col"],[1,"subheader"],[3,"details","areDetailsVisible"]],template:function(i,n){if(i&1&&(a(0,"app-page-container")(1,"app-page-header"),c(2,"Lista przelew\xF3w do akceptacji"),o(),a(3,"app-page-content")(4,"mat-expansion-panel",2,0)(6,"mat-expansion-panel-header")(7,"mat-panel-title"),c(8," Filtry "),o()(),a(9,"form",3),C(10,"app-filtering-checkboxes",4)(11,"app-source-account-input",5),a(12,"mat-form-field",6)(13,"mat-label"),c(14,"Nazwa odbiorcy"),o(),C(15,"input",7),o(),a(16,"mat-form-field",6)(17,"mat-label"),c(18,"Rachunek docelowy"),o(),C(19,"input",8),o(),a(20,"mat-card-actions")(21,"app-button",9),m("clickAction",function(){return n.onSearch()}),a(22,"span"),c(23,"Szukaj"),o()(),a(24,"app-button",9),m("clickAction",function(){return n.resetValues()}),a(25,"span"),c(26,"Wyczy\u015B\u0107"),o()()()()(),a(27,"app-page-btn-panel",10)(28,"app-button",11),m("clickAction",function(){return n.onSearch()}),a(29,"span"),c(30,"Od\u015Bwie\u017C"),o()(),a(31,"app-button-menu",12)(32,"app-menu-item-button",13),m("clickAction",function(){return n.openDialog(n.transferTypeEnum.COMMON)}),c(33," Zwyk\u0142y "),o(),a(34,"app-menu-item-button",9),m("clickAction",function(){return n.openDialog(n.transferTypeEnum.US_CLO)}),c(35," US / C\u0141O "),o(),a(36,"app-menu-item-button",14),m("clickAction",function(){return n.openDialog(n.transferTypeEnum.INTERNATIONAL)}),c(37),T(38,"async"),o(),a(39,"app-menu-item-button",9),m("clickAction",function(){return n.openDialog(n.transferTypeEnum.PERSONAL)}),c(40," W\u0142asny "),o(),u(41,w0,2,0,"app-menu-item-button"),a(42,"app-menu-item-button",14),m("clickAction",function(){return n.openDialog(n.transferTypeEnum.VAT_INVOICE)}),c(43," Faktura VAT "),o(),a(44,"app-menu-item-button",14),m("clickAction",function(){return n.openDialog(n.transferTypeEnum.VAT_TRANSFERENCE)}),c(45," Przekazanie VAT "),o()(),a(46,"app-button",14),m("clickAction",function(){return n.openPackageDialog()}),c(47," Dodaj paczk\u0119 "),o(),a(48,"app-button",14),m("clickAction",function(){return n.openDeleteDialog()}),c(49," Usu\u0144 "),o(),a(50,"app-button",14),m("clickAction",function(){return n.openEditionDialog()}),c(51," Edytuj "),o(),a(52,"app-button",14),m("clickAction",function(){return n.openSignDialog()}),c(53," Do podpisu "),o(),a(54,"app-button",15),m("clickAction",function(){return n.performQuickRealization()}),c(55," Sz. realizacja "),o(),a(56,"app-button",16),m("clickAction",function(){return n.doPrintAction()}),c(57," Drukuj "),o(),a(58,"app-button",17),m("clickAction",function(){return n.doSavePdfAction()}),c(59," Zapisz "),o(),a(60,"app-button-menu",18)(61,"app-menu-item-button",14),m("clickAction",function(){return n.openImportDialog(n.TransferFileType.ELIXIR)}),c(62," Z pliku Elixir "),o(),a(63,"app-menu-item-button",14),m("clickAction",function(){return n.openImportDialog(n.TransferFileType.VIDEO_TEL)}),c(64," Z pliku Videotel "),o(),a(65,"app-menu-item-button",14),m("clickAction",function(){return n.openImportDialog(n.TransferFileType.INTERNATIONAL)}),c(66," Z pliku - przelew zagraniczny "),o(),a(67,"app-menu-item-button",14),m("clickAction",function(){return n.openImportDialog(n.TransferFileType.DBF)}),c(68," Z pliku DBF "),o()(),a(69,"app-button-menu",19)(70,"app-menu-item-button",9),m("clickAction",function(){return n.openImportSalaryDialog(n.TransferFileType.ELIXIR)}),c(71," Z pliku Elixir "),o(),a(72,"app-menu-item-button",9),m("clickAction",function(){return n.openImportSalaryDialog(n.TransferFileType.VIDEO_TEL)}),c(73," Z pliku Videotel "),o(),a(74,"app-menu-item-button",9),m("clickAction",function(){return n.openImportSalaryDialog(n.TransferFileType.DBF)}),c(75," Z pliku DBF "),o()(),a(76,"app-button",15),m("clickAction",function(){return n.updateWhiteList(
4)}),c(77," Weryfikacja VAT "),o()(),a(78,"sn-mat-tree-table",20,1),m("handleDragEndEvent",function(){return n.handleDragEnd()})("handleDragStartEvent",function(h){return n.handleDragStart(h)})("handleDropEvent",function(h){return n.handleDrop(h)})("handleDragOverEvent",function(h){return n.handleDragOver(h)})("rowClickEventIndicator",function(){return n.receiveRowClickEvent()}),o()(),a(80,"mat-expansion-panel",21)(81,"mat-expansion-panel-header")(82,"mat-panel-title")(83,"h3",22),c(84,"Szczeg\xF3\u0142y"),o()()(),C(85,"app-details",23),o()()),i&2){let l=re(79);s(10),p("checkboxes",n.filteringCheckboxes),s(),p("accountList",n.accountTypes)("sourceAccountFC",n.sourceAccountFC)("fieldLabel",n.sourceAccountLabel)("hasNullOption",!1),s(4),p("formControl",n.recipientNameFC),s(4),p("formControl",n.targetAccountFC),s(12),p("disabled",!n.isEditAuthoritiesEnable||n.isImportPackage),s(5),p("disabled",!n.isForeignAuthoritiesEnable),s(),U(" ",B(38,31,n.foreignTransferLabel)," "),s(4),f(n.isTransferSorbnetEnabled?41:-1),s(),p("disabled",!n.isVatEnabled),s(2),p("disabled",!n.isVatTransmissionEnabled),s(2),p("disabled",!n.isEditAuthoritiesEnable),s(2),p("disabled",l.selection.isEmpty()||!n.deleteBtnEnabled),s(2),p("disabled",l.selection.selected.length!==1||!n.editBtnEnabled),s(2),p("disabled",l.selection.isEmpty()||!n.signingBtnEnabled),s(2),p("disabled",!n.quickRealizationBtnEnabled)("loading",n.quickRealizationLoading),s(2),p("disabled",l.selection.selected.length!==1),s(2),p("disabled",l.selection.selected.length!==1),s(3),p("disabled",!n.isImportAuthoritiesEnable),s(2),p("disabled",!n.isImportAuthoritiesEnable),s(2),p("disabled",!n.isImportSwiftAuthoritiesEnable),s(2),p("disabled",!n.isImportAuthoritiesEnable),s(2),p("disabled",!n.isImportSalaryMenuEnable),s(7),p("disabled",!n.whiteListEnabled)("loading",n.whiteListLoading),s(2),p("tableProperties",n.tableProperties),s(7),p("details",n.details)("areDetailsVisible",l.selection.selected.length>0)}},dependencies:[be,Ie,Zt,yt,At,wt,Se,_t,ve,De,tt,Qr,Ve,ot,at,rt,xn,Mt,Xt,Ot,We,je,ei,Yt,Di,ti,Ao],styles:["[_nghost-%COMP%]{display:block;padding:1.5rem}.flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.gap-02rem[_ngcontent-%COMP%]{gap:.2rem}"]})}}return t})();var I0=[{path:"",component:El,canActivateChild:[Dl,Xl],data:{authorities:[Q.FUNC_EXECUTE],authorityCheckType:Ps.ANY},children:[{path:"",redirectTo:Ka},{path:Ka,component:Hc},{path:Lo,component:Nc},{path:Vo,component:Vc},{path:jo,component:Kc},{path:xs,component:Lc},{path:Ds,component:Fc},{path:sn,component:Gc,canActivate:[Jl]},{path:ln,component:Ea,canActivate:[ec]}]}],Yc=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=uo({type:t})}static{this.\u0275inj=po({imports:[Ua.forChild(I0),Ua]})}}return t})();var s2=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=uo({type:t})}static{this.\u0275inj=po({providers:[ya,An,ca,In,Pa,Rn,Ra,Fa],imports:[Le,Qs,Yr,Yc,Us,Ki,He,xl,Ea]})}}return t})();export{s2 as OperationsModule};
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.