1import{a as Al,b as ta,c as ia,d as na,e as wi,f as oa,g as wl,h as Il,i as Ml,j as Pl,k as Ol,l as kl,p as wn,q as Fl,r as Rl}from"./chunk-5I2H2VKI.js";import{a as Yn,b as yl,c as vr,d as Cr}from"./chunk-4DO6KHXG.js";import{b as Dl}from"./chunk-XKIYSJOC.js";import"./chunk-WBG33IXQ.js";import"./chunk-NM53COXH.js";import{a as Tl}from"./chunk-JPXBLFOP.js";import{h as xl}from"./chunk-LGWCY2T2.js";import{$b as Fi,$c as Ht,$e as cn,$k as kt,$l as El,A as Rr,Aa as C,Ab as Ao,Ad as ps,Ae as gs,Aj as zi,Ak as ll,Al as _r,B as po,Ba as Vn,Bb as Zr,Bd as vt,Be as vs,Bj as Ge,Bk as cl,C as ja,Ca as jn,Cb as wo,Cd as ds,Ce as Cs,Ch as Os,Ck as pl,D as Nr,Dd as Ct,Dh as Oe,Dj as xe,Dk as dl,E as ee,Ea as _e,Eb as re,Ed as Ie,Ei as Qt,Ek as M,Fa as ge,Fb as Le,Fd as bt,Fh as Xa,Fk as Ot,Fl as Jo,G as y,Ga as jr,Gd as zo,Gh as Ja,Gj as Xs,Gl as _l,Ha as F,He as H,Hh as er,I as S,Ia as m,Id as q,Ie as xt,Ih as tr,Ii as At,Ij as Js,Ik as ml,Ja as Ur,Jd as ne,Je as Ka,Jh as ir,Ji as wt,Jk as Li,Jl as gl,K as k,Ka as d,Kd as it,Ke as Pe,Kh as nr,Ki as It,Kj as Zn,Kk as Tn,L as mo,La as gi,Lb as Ua,Ld as St,Le as bs,Lh as or,Lk as yn,Ll as gr,M as G,Ma as Rt,Md as je,Me as Ss,Mh as ar,Mj as li,Mk as ei,N as h,Na as et,Nb as Io,Nc as ye,Nd as K,Ne as Es,Nh as rr,Nj as Zo,Nl as Ft,O as P,Oa as ue,Oc as ts,Od as nt,Oe as xs,Oh as sr,Ok as Ko,Ol as vl,P as O,Pa as fe,Pc as is,Pd as Ue,Ph as lr,Pj as el,Pk as We,Q as Br,Qa as go,Qb as Mo,Qc as ns,Qh as cr,Qi as Ns,Qj as Xt,Qk as de,Ql as ea,Ra as vo,Rc as os,Rd as ms,Rh as pr,Ri as Bs,Rk as Yo,S as te,Sa as Oi,Sc as as,Sd as xi,Sh as dr,Si as zs,Sj as J,Ta as se,Tc as vi,Td as Wn,Th as mr,Ti as Ls,Tj as $,Ua as Un,Uc as Ha,Uh as ur,Ui as Vs,Uk as ul,V as j,Va as ve,Vc as $a,Vd as Hn,Ve as Bi,Vh as fr,Vi as Kt,Vj as Qo,W as qi,Wa as ki,Wb as Ce,Wc as Ci,Wd as W,We as Ya,Wi as mn,Wl as Cl,Xa as c,Xb as De,Xc as Ni,Xd as ep,Xe as Vo,Xi as js,Xj as Qn,Y as uo,Ya as v,Yb as Te,Yc as Oo,Yd as $n,Ye as jo,Yi as Us,Yl as bl,Za as U,Zb as tt,Zc as ko,Zd as $t,Ze as Uo,Zi as Gs,Zj as tl,Zl as Ai,_a as ie,_b as Qr,_c as Ze,_d as us,_e as ln,_j as il,_l as Sl,a as Mr,ab as Co,ac as Kr,ad as bi,af as Ds,al as ti,b as Pr,ba as zr,bb as bo,bc as Po,bd as Si,bf as Ts,bi as pn,bj as un,bk as Mt,bl as fl,bm as He,ca as s,cb as So,cc as A,cd as Ei,ce as Za,cj as Ws,da as Zi,dc as _t,dd as Fo,dk as nl,dl as ii,e as Jc,ea as Lr,ei as Qe,ej as fn,ek as ol,fb as Gt,fj as hn,fk as al,g as Or,gb as Eo,gc as Ve,ge as si,gi as Ke,gj as _n,h as pt,ha as g,hb as xo,hc as Yr,he as Qa,hi as Ye,hj as gn,hk as ot,i as La,ia as x,ib as T,ic as gt,id as Ji,ie as fs,ij as vn,ik as at,il as Ti,j as ze,ja as fo,jb as B,jc as Qi,jd as X,je as Y,jg as Go,ji as Xe,jj as Cn,ka as ho,kb as V,kc as Ki,kd as Ae,ke as be,ki as dn,kj as bn,kk as rt,l as Va,la as _o,lb as Gr,lc as Wt,ld as we,le as Me,lh as ws,li as Wo,lj as Sn,lk as Dn,m as z,mb as Wr,mc as Xr,md as he,me as qt,mh as Is,mi as ks,mj as En,mk as Jt,na as Z,nb as Do,nc as Yi,nd as Ro,ne as Lo,nh as Ms,ni as Fs,nj as xn,ob as b,oc as Jr,od as en,oe as Et,og as ys,oi as Rs,oj as Hs,ok as Pt,p as L,pb as Nt,pd as No,pe as Se,pg as As,pi as Ho,pj as $s,q as lo,qa as _i,qb as I,qc as Ri,qd as Bo,qe as tn,qj as qs,r as dt,ra as u,rb as To,rd as E,re as Ee,ri as mt,rj as Zs,rk as rl,rl as yi,s as co,sa as f,sb as Hr,sd as rs,se as nn,sj as Qs,sk as Di,t as ft,ta as Vr,tb as $r,tc as Ga,td as ss,te as hs,ti as Zt,tk as Re,tl as Vi,ua as Ut,ub as yo,ud as Bt,ue as on,ui as Dt,uk as hr,ul as Xo,v as ht,va as oe,vc as Wa,vd as ls,ve as an,vi as Tt,vj as Ks,w as pe,wa as ae,wc as Q,wd as qa,we as _s,wh as Ps,wi as yt,wj as Ys,x as hi,xa as p,xb as qr,xc as Gn,xi as $o,xj as qo,xl as An,y as kr,ya as a,yc as Xi,ye as rn,yj as qn,yl as hl,z as Fr,za as o,zc as es,zd as cs,ze as sn,zj as Yt,zk as sl,zl as Kn}from"./chunk-YMFY75IU.js";var aa=class{constructor(r){this.errorName=r}isErrorState(r,e){return r?.parent?.invalid&&r.parent.hasError(this.errorName)||r?.invalid||!!e?.errors}};var ra=(()=>{class t{constructor(e,i){this.http=e,this.notificationService=i}create(e){return this.http.post(Go,e).pipe(L(()=>(this.notificationService.success(E.REALIZATION_SUCCESS),{message:"ok",successful:!0})))}delete(e){let i=new Ua().set("bundleIds",e.toString());return this.http.delete(Go,{params:i})}update(e,i){let n=new Ua().set("id",i.toString());return this.http.put(Go,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(Mo),G(K))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();function np(t,r){t&1&&(a(0,"span"),c(1,"Nazwa jest wymagana"),o())}function op(t,r){t&1&&(a(0,"span"),c(1,"Nazwa jest nieprawid\u0142owa"),o())}function ap(t,r){t&1&&(a(0,"span"),c(1,"Nazwa jest za d\u0142uga"),o())}function rp(t,r){t&1&&(a(0,"span"),c(1,"Data nie mo\u017Ce by\u0107 wcze\u015Bniejsza"),o())}function sp(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 lp(t,r){t&1&&(a(0,"span"),c(1,"Data nie mo\u017Ce by\u0107 wcze\u015Bniejsza"),o())}function cp(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,lp,2,0,"span"),o()()),t&2){let e=se(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 br=(()=>{class t{constructor(e,i,n,l,_,D){this.dialogRef=e,this.userFacadeService=i,this.accountService=n,this.data=l,this.packagesService=_,this.errorProviderService=D,this.ButtonLabels=Qe,this.FunctionalAuthority=Q,this.isEdit=!1,this.minExectionDate=Bt(new Date,H),this.errorMatcher=new aa("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("",De.required),this.lastDateOfExecutionFC=new A(""),this.dateOfExecutionFC=new A(Bt(new Date,H),Li.isBeforeToday),this.chargeFC=new A(""),this.salaryFC=new A({value:!1,disabled:!R}),this.packageFG=new Fi({packageNameFC:this.packageNameFC,dateOfExecutionFC:this.dateOfExecutionFC,lastDateOfExecutionFC:this.lastDateOfExecutionFC,chargeFC:this.chargeFC},{validators:Li.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(){ls(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?Bt(new Date(this.lastDateOfExecutionFC.value),H):"";return{name:this.packageNameFC.value,executionDate:Bt(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)(g(Ae),g(Oe),g(ei),g(we),g(ra),g(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,np,2,0,"span"),u(11,op,2,0,"span"),u(12,ap,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,rp,2,0,"span"),u(23,sp,2,0,"span"),o()(),Z(24,cp,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=se(20);s(2),v(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:[Se,Me,qt,Et,sn,Dt,Tt,yt,Ee,Ce,Te,Qi,Ki,Ve,Ko,Ke,Ye,Xe,dn,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 la=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 Sr="property=",zl="messageKey=",pp="vals=",ca=class{static parse(r){let e=[],i=r.indexOf("["),n=r.length,l=Sr.length,_=zl.length;for(;i<n;){let D=r.indexOf(Sr,i);if(D===-1)break;let R=r.indexOf(Za,D);if(R===-1)break;let le=r.slice(D+l,R),ce=r.indexOf(zl,R);if(ce===-1)break;let me=r.indexOf(Za,ce);if(me===-1)break;let Ne=r.slice(ce+_,me);i=me;let Be=this.extractVals(r,me,r.indexOf(Sr,me));e=[new la(le,Ne,Be),...e]}return e}static extractVals(r,e,i){let n=r.indexOf(pp,e);if(n===-1)return;let l=r.indexOf("[",n);if(l===-1||i!==-1&&l>i)return;let _=0;for(let D=l;D<r.length;D++)if(r[D]==="[")_++;else if(r[D]==="]"&&(_--,_===0))return r.slice(l+1,D)||void 0}};var dp={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/)"},mp={"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"},up=new Set(["vatNr.invalidSubstrings","text.invalidSubstrings","chars.illegal"]);function fp(t){return t?`zawiera niedozwolone znaki: ${t}`:"zawiera niedozwolone znaki lub ci\u0105gi znak\xF3w"}function Ll(t,r,e){let i=dp[t];if(!i)return null;if(up.has(r))return`${i} ${fp(e)}`;let n=mp[r];return n?`${i} ${n}`:null}var pa=(()=>{class t{constructor(e){this.transferDialogService=e}openEditTransferDialog(e){return this.transferDialogService.openDialog(Tn.parse(e.disposition.type),Zo.getFromImport(e.disposition,e.lineNumber),Zn.IMPORT)}static{this.\u0275fac=function(i){return new(i||t)(G(Xo))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var _p=(t,r)=>({invalid:t,failed:r});function gp(t,r){t&1&&(a(0,"mat-header-cell"),c(1,"Lp"),o())}function vp(t,r){if(t&1&&(a(0,"mat-cell")(1,"span"),c(2),o()()),t&2){let e=r.$implicit;s(2),v(e.lineNumber)}}function Cp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Nazwa beneficjenta"),o())}function bp(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),v(Gr(3,1,e.disposition==null?null:e.disposition.name,e.disposition==null?null:e.disposition.address1,e.disposition==null?null:e.disposition.address2))}}function Sp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Rachunek beneficjenta"),o())}function Ep(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),v(B(3,1,e.disposition==null?null:e.disposition.targetAccount))}}function xp(t,r){t&1&&(a(0,"mat-header-cell",25),c(1," Tytu\u0142 "),o())}function Dp(t,r){if(t&1&&(a(0,"mat-cell",25)(1,"span"),c(2),o()()),t&2){let e=r.$implicit;s(2),v(e.disposition==null?null:e.disposition.title)}}function Tp(t,r){t&1&&(a(0,"mat-header-cell",25),c(1," Kwota "),o())}function yp(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),v(B(3,1,e.disposition==null?null:e.disposition.amount))}}function Ap(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Typ"),o())}function wp(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),v(V(3,1,e.disposition==null?null:e.disposition.type,!!(e.disposition!=null&&e.disposition.sorbnet)))}}function Ip(t,r){t&1&&(a(0,"mat-header-cell"),c(1," Waluta"),o())}function Mp(t,r){if(t&1&&(a(0,"mat-cell")(1,"span"),c(2),o()()),t&2){let e=r.$implicit;
1s(2),v(e.disposition==null?null:e.disposition.currency)}}function Pp(t,r){t&1&&(a(0,"mat-header-cell"),c(1," B\u0142\u0105d"),o())}function Op(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),v(i.invalidReasons.get(e))}}function kp(t,r){t&1&&C(0,"mat-header-cell")}function Fp(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 Rp(t,r){t&1&&C(0,"mat-header-row",29)}function Np(t,r){if(t&1&&C(0,"mat-row",30),t&2){let e=r.$implicit,i=d();p("ngClass",xo(1,_p,e.state===i.STATE.INVALID,e.state===i.STATE.FAILED))}}var Bp="Nie uda\u0142o si\u0119 wczyta\u0107 rekordu \u2013 nieprawid\u0142owe dane w pliku.",zp="Popraw dyspozycj\u0119",Lp="Tego rekordu nie mo\u017Cna edytowa\u0107 \u2013 nie uda\u0142o si\u0119 go wczyta\u0107 (nieprawid\u0142owe dane).",jl=(()=>{class t{constructor(){this.dialogRef=h(Ae),this.data=h(we),this.notificationService=h(K),this.invalidEditDialogService=h(pa),this.errorProviderService=h(Y),this.sorbnetRequiredService=h(fs),this.STATE=zi,this.ButtonLabels=Qe,this.title=this.data.title,this.dataSource=new Qn,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=Wn[Qa]}ngOnInit(){this.dataSource.data=this.invalidDispositions,this.recomputeReasons(),this.sorbnetRequiredService.getRequiredMessage().pipe(po(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===zi.INVALID}editTooltip(e){return this.canEdit(e)?zp:Lp}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_ERROR);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===zi.FAILED)return Bp;if(e.state!==zi.INVALID||!e.message)return"";let i=!!e.disposition&&Tn.parse(e.disposition.type)===li.VAT_INVOICE,n=ca.parse(e.message).map(l=>this.resolveViolation(l.property,l.messageKey,l.vals,i)).filter((l,_,D)=>!!l&&D.indexOf(l)===_);return n.length?n.join(" \u2022 "):e.message}resolveViolation(e,i,n,l){if(i===Qa)return this.sorbnetRequiredMessage;if(l){let _=Ll(e,i,n);if(_)return _}return Wn[i]??i}recountSummary(){this.summary.failedCount=this.getDispositionsByState(zi.FAILED),this.summary.invalidCount=this.getDispositionsByState(zi.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,"a
1pp-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),_e(25,7),Z(26,gp,2,0,"mat-header-cell",8)(27,vp,3,1,"mat-cell",9),ge(),_e(28,10),Z(29,Cp,2,0,"mat-header-cell",8)(30,bp,4,5,"mat-cell",9),ge(),_e(31,11),Z(32,Sp,2,0,"mat-header-cell",8)(33,Ep,4,3,"mat-cell",9),ge(),_e(34,12),Z(35,xp,2,0,"mat-header-cell",13)(36,Dp,3,1,"mat-cell",14),ge(),_e(37,15),Z(38,Tp,2,0,"mat-header-cell",13)(39,yp,4,3,"mat-cell",14),ge(),_e(40,16),Z(41,Ap,2,0,"mat-header-cell",8)(42,wp,4,4,"mat-cell",9),ge(),_e(43,17),Z(44,Ip,2,0,"mat-header-cell",8)(45,Mp,3,1,"mat-cell",9),ge(),_e(46,18),Z(47,Pp,2,0,"mat-header-cell",8)(48,Op,3,1,"mat-cell",9),ge(),_e(49,19),Z(50,kp,1,0,"mat-header-cell",8)(51,Fp,4,2,"mat-cell",20),ge(),Z(52,Rp,1,0,"mat-header-row",21)(53,Np,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),v(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:[Ao,vt,q,fn,_n,bn,gn,hn,Sn,vn,Cn,En,xn,Zt,Ke,Ye,Xe,Rs,mt,J,$,Ft,gl],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 Vp=5,ma={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=>jp(t)>Vp?"Mog\u0142o zosta\u0107 wybrane nieprawid\u0142owe kodowanie pliku - zmie\u0144 je i spr\xF3buj ponownie.":""};function jp(t){return t.replace(/\s/g,"").length}var Mn=(()=>{class t{constructor(){this.dialog=h(he),this.transferImportService=h(yi)}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 _=new X;return _.data={title:ma.replaceCharsDialogTitle,message:ma.invalidChars(n.invalidChars),hint:ma.encodingHint(n.invalidChars)},_.disableClose=!0,this.dialog.open(xe,_).afterClosed().pipe(y(D=>D.state?this.transferImportService.uploadFile(e,i,!0,l):ze))}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 Wp(t,r){if(t&1&&(a(0,"mat-option",4),c(1),o()),t&2){let e=r.$implicit;p("value",e.viewValue),s(),v(e.viewValue)}}function Hp(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function $p(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 qp(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 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){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function Yp(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,Kp,2,0,"span"),o()()()),t&2){let e=se(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 Xp(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 Jp(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}var $l=(()=>{class t{constructor(e,i,n,l,_,D,R,le,ce,me,Ne,Be){this.dialogRef=e,this.notificationService=i,this.accountService=n,this.transferImportService=l,this.transferUploadConfirmationService=_,this.errorProviderService=D,this.data=R,this.dialog=le,this.actionButtonsPanelService=ce,this.whiteListFacadeService=me,this.whiteListService=Ne,this.progressBarService=Be,this.CharsetType=qn,this.ImportMode=Yt,this.FunctionalAuthority=Q,this.chargeableAccounts=[],this.bundles=[],this.isSpinnerActive=!1,this.ButtonLabels=Qe,this.whiteListCheckBoxDisabled=!0,this.importModeSubscription=new Or,this.transferSummary={},this.importedQuantity=0,this.MAX_FILE_SIZE_IN_MB=5,this.charsetFC=new A("",[De.required]),this.importModeFC=new A("",[De.required]),this.newBundleNameFC=new A("",[De.required]),this.executionDateFC=new A("",[De.required]),this.lastExecutionDateFC=new A(""),this.sourceAccountFC=new A(""),this.existingBundleNameFC=new A("",[De.required]),this.whiteListCheckBoxCheckedFC=new A(!1),this.newBundleFG=new Fi({newBundleName:this.newBundleNameFC,executionDate:this.executionDateFC,lastExecutionDate:this.lastExecutionDateFC,sourceAccountId:this.sourceAccountFC}),this.transferImportFG=new Fi({charset:this.charsetFC,whiteListCheckBoxChecked:this.whiteListCheckBoxCheckedFC,newBundle:this.newBundleFG,existingBundleName:this.existingBundleNameFC}),this.minDate=ss(new Date),this.acceptedFileExtensions=qo(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 _=l.name;this.transferUploadConfirmationService.uploadWithConfirmations(l,this.charsetFC.value,this.data.transferFileType).pipe(S(()=>this.progressBarService.showProgressBar(E.DEFAULT_REQUEST_PROCESSING)),y(()=>this.importBundleMode(_)),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 Yt.NEW_BUNDLE:{this.newBundleFG.enable(),this.existingBundleNameFC.disable();break}case Yt.EXISTING_BUNDLE:{this.existingBundleNameFC.enable(),this.newBundleFG.disable();break}case Yt.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 Yt.NEW_BUNDLE:return i.bundleData=this.transferImportService.prepareBundleCreateRequest(!1,Pe.formatDate(this.executionDateFC.value),this.lastExecutionDateFC.value?Pe.formatDate(this.lastExecutionDateFC.value):"",this.sourceAccountFC.value,this.newBundleNameFC.value),this.transferImportService.importNewBundle(i);case Yt.EXISTING_BUNDLE:return this.transferImportService.importToBundle(this.existingBundleNameFC.value,i);case Yt.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=be.LARGE,this.dialog.open(jl,i).afterClosed().pipe(y(l=>{if(l.isConfirm){let _=this.transferSummary;return this.importedQuantity=l.isValidOnly?_.totalCount-(_.failedCount+_.invalidCount):_.totalCount,this.transferImportService.saveImportTransfers(l.isValidOnly,this.whiteListCheckBoxCheckedFC.value)}else return ze}))}markAllAsTouched(){this.newBundleFG.markAllAsTouched(),this.transferImportFG.markAllAsTouched()}patchInitialValues(){this.charsetFC.patchValue(qn.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(Yt.EXISTING_BUNDLE)):this.importModeFC.patchValue(Yt.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)(g(Ae),g(K),g(ei),g(yi),g(Mn),g(Y),g(we),g(he),g(Ho),g(sl),g(ta),g(ul))}}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),oe(11,Wp,2,2,"mat-option",4,Ut),T(13,"enumToArray"),o(),a(14,"mat-error"),u(15,Hp,2,0,"span"),o()(),u(16,$p,2,2,"mat-checkbox",5),u(17,qp,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,Zp,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,Qp,2,0,"span"),o()(),Z(41,Yp,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),oe(50,Xp,2,2,"mat-option",4,Ut),o(),a(52,"mat-error"),u(53,Jp,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(_){return n.importFile(_)}),o()()),i&2){let l=se(38);s(10),p("formControl",n.charsetFC),s(),ae(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(),v(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(),v(n.ImportMode.EXISTING_BUNDLE),s(4),p("formControl",n.existingBundleNameFC),s(),ae(n.bundles),s(3),f(n.existingBundleNameFC.hasError("required")?53:-1),s(),p("value",n.ImportMode.WITHOUT_BUNDLE),s(),v(n.ImportMode.WITHOUT_BUNDLE),s(),p("loading",n.isSpinnerActive)("confirmDisabled",n.transferImportFG.invali
3d)("withImportAction",!0)("buttonLabelConfirm",n.ButtonLabels.IMPORT)("acceptedFileExtensions",n.acceptedFileExtensions)}},dependencies:[Se,Me,qt,Et,on,sn,Dt,Tt,yt,Ee,js,Us,an,Ce,Te,Ve,Ko,Ke,Ye,Xe,dn,Wo,We,mt,vl],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 ed(t,r){t&1&&(a(0,"span"),c(1,"Nazwa paczki jest wymagana"),o())}var ql=(()=>{class t{constructor(e,i,n,l,_,D,R){this.dialogRef=e,this.notificationService=i,this.transferImportService=n,this.transferUploadConfirmationService=l,this.data=_,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=qn.WINDOWS_1250,this.importSummary={totalCount:0,invalidCount:0,failedCount:0,hasWrongLengthAppeared:!1},this.bundleNameFC=new A("",[De.required,De.maxLength(this.NAME_MAX_LENGTH)]),this.acceptedFileExtensions=qo(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 _=l.name;this.transferUploadConfirmationService.uploadWithConfirmations(l,this.defaultEconding,this.data.transferFileType).pipe(y(()=>this.importBundleMode(_)),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 zo(Sl,{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)(g(Ae),g(K),g(yi),g(Mn),g(we),g(Ho),g(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,ed,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(_){return n.importFile(_)}),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:[Se,Me,qt,Ee,Ce,Te,Qi,Ki,Ve,el,Ke,Ye,Xe,dn,Wo,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 td=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isAutomaticRenewal","isCapitalizationOfInterest","isInterestRate","isDocumentNumber"],id=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isInterestRate","isDocumentNumber"],nd=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isOperator","isTelephoneNumber","isReferenceNumber"],od=["isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isAutomaticRenewal","isCapitalizationOfInterest","isInterestRate","isMaturityDate"],ad=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isDoEvery","isContent"],rd=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent","isDocumentNumber","isWhiteList"],sd=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent","isDocumentNumber","isWhiteList"],ld=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent","isDocumentNumber"],cd=["isAccountNumber","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isContent"],pd=["isDateOfExecution","isCreatedBy","isCreatedAt","isModifiedBy","isModifiedAt","isWhiteList"],Zl=(()=>{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(td);break;case W.LOKATA_ZERWANIE:this.setDetailsVisible(id);break;case W.LOKATA_MODYFIKACJA:this.setDetailsVisible(od);break;case W.ZLECENIE_STALE_ZALOZENIE:this.setDetailsVisible(ad),this.intervalWithUnit=gr.getPeriodDescription(gr.calculateAmountOfDays(e.interval,e.intervalUnit));break;case W.DOLADOWANIE_GSM:this.setDetailsVisible(nd);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(rd);break;case W.PRZELEW_ZWYKLY:this.setDetailsVisible(sd);break;case W.PRZELEW_US:this.setDetailsVisible(ld);break;case W.PRZELEW_ZAGRANICZNY:this.setDetailsVisible(cd);break;case An.TRANSFER:this.setDetailsVisible(pd);break}e.state===de.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 Re().leftCell({name:"Rachunek \u017Ar\xF3d\u0142owy",value:i},J)),this.isDateOfExecution&&n.push(new Re().leftCell({name:"Data wykonania",value:e.dateOfExecution},re,[H])),this.isCreatedBy&&this.isCreatedAt&&n.push(new Re().leftCell({name:"Utworzony przez",value:e.createdBy}).rightCell({name:"Data utworzenia",value:e.createdAt},re,[Ka])),this.isModifiedBy&&this.isModifiedAt&&n.push(new Re().leftCell({name:"Zmodyfikowany przez",value:e.modifiedBy}).rightCell({name:"Data modyfikacji",value:e.modifiedAt},re,[Ka])),this.isWhiteList&&n.push(this.getWhiteListState(e)),this.isDoEvery&&n.push(new Re().leftCell({name:"Wykonaj co",value:this.intervalWithUnit})),this.isContent){let l=M.isVirtualBundle(e)?e.dispositions[0].title:e.title;n.push(new Re().leftCell({name:"Tre\u015B\u0107",value:l}))}if(this.isAutomaticRenewal&&n.push(new Re().leftCell({name:"Automatyczne odnawianie",value:e.automaticRenewal},hr)),this.isCapitalizationOfInterest&&n.push(new Re().leftCell({name:"Kapitalizacja odsetek",value:e.capitalizationOfInterest},hr)),this.isInterestRate&&n.push(new Re().leftCell({name:"Oprocentowanie",value:e.depositPattern.percentage},$,["%"])),this.isMaturityDate&&n.push(new Re().leftCell({name:"Data zapadalno\u015Bci",value:e.maturityDate})),this.isOperator&&n.push(new Re().leftCell({name:"Operator",value:this.operator}).rightCell({name:"Telefon",value:this.phoneNumber})),this.isReferenceNumber&&n.push(new Re().leftCell({name:"Numer referencyjny",value:this.referenceNumber})),e.settlementDate&&n.push(new Re().leftCell({name:"Zaksi\u0119gowana",value:e.settlementDate})),this.isDocumentNumber){let l=M.isVirtualBundle(e)?e.dispositions[0]?.documentNumber:e.documentNumber;n.push(new Re().leftCell({name:"Nr dokumentu",value:l}))}return this.isRejectionDescription&&n.push(new Re().leftCell({name:"Pow\xF3d odrzucenia",value:e.description})),n}getWhiteListState(e){let i=M.isVirtualBundle(e)?e?.dispositions[0].whiteListVerificationState:e?.whiteListVerificationState;return new Re().leftCell({name:"Status weryfikacji VAT",value:i},pl)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();
3var ud=["chosenElementsTreeTable"],Ql=(()=>{class t{constructor(e,i,n,l,_,D,R,le){this.dialogRef=e,this.data=i,this.executionsService=n,this.notificationService=l,this.dialog=_,this.errorProviderService=D,this.executionDetailsService=R,this.spinnerService=le,this.selectedExecutions=[],this.details=new Di,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:Ai,stylePipeArgs:[],styleProp:"whiteListVerificationState",styleClass:"bold red",pipeToken:Ft,alternativeDataSource:{whenShouldUseAlternativeValue:ce=>M.isBundle(ce),getAlternativeValue(ce){return ce.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:ce=>M.isBundle(ce),getAlternativeValue:()=>"-"},cellClass:"x-start"},{column:"state",caption:"Stan",pipeToken:ea,pipeArgs:[!0,"row.virtual","row.dispositions"]},{column:this.EXECUTE_DATE,caption:"Data wykonania",pipeToken:re,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(_=>_.hasOwnProperty("bundleId")&&!_.virtual?n.push(_.id):i.push(_.id));let l={tableConfig:this.chosenElementsTableProperties,tableService:this.chosenElementsTreeTable.treeTableService};this.details.rows=Ot.prepareBundleSummary(ia.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(xe,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||dl.NEW))}checkPrintButtonDisabled(e){let i=e.type;this.isPrintButtonDisabled=!([W.PRZELEW_ZAGRANICZNY,W.PRZELEW_ZWYKLY,W.PRZELEW_VAT,W.PRZELEW_US,W.DOLADOWANIE_GSM,An.TRANSFER].includes(i)&&e.virtual!==void 0&&e.state!=de.AWAITS),e.type===W.LOKATA_ZALOZENIE&&e.state===de.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)(g(Ae),g(we),g(na),g(K),g(he),g(Y),g(Zl),g(nt))}}static{this.\u0275cmp=x({type:t,selectors:[["app-execution-details-dialog"]],viewQuery:function(i,n){if(i&1&&et(ud,5),i&2){let l;ue(l=fe())&&(n.chosenElementsTreeTable=l.first)}},standalone:!1,features:[Gt([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:[At,wt,It,Ke,Ye,Xe,ks,Fs,kt,je,ti,Xt,fl,Ti],styles:[".flex-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}"]})}}return t})();var Kl=(()=>{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)(g(Y),g(wi),g(Ae),g(we))}}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),v(n.data.title),s(2),v(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 fd(t,r){if(t&1&&(a(0,"mat-option",4),c(1),o()),t&2){let e=r.$implicit;p("value",e),s(),v(e.name)}}function hd(t,r){t&1&&(a(0,"span"),c(1,"Prosz\u0119 wybra\u0107 jeden z element\xF3w listy"),o())}function _d(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["operator.empty"])}}function gd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["operator.unknown"])}}function vd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["error.field.operator.not_found"])}}function Cd(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}function bd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["telefon.format"])}}function Sd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["telefon.format"])}}function Ed(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["telefon.unknown"])}}function xd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["telefon.empty"])}}function Dd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["telefon.inactive"])}}function Td(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["error.field.phone_number.wrong_format"])}}function yd(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["error.field.phone_number.inactive"])}}function Ad(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.ERRORS["error.field.phone_number.unknown"])}}function wd(t,r){if(t&1&&(a(0,"p"),c(1),o()),t&2){let e=d(2);s(),ie("Prosz\u0119 wprowadzi\u0107 kwot\u0119 bez groszy z zakresu od ",e.operatorsFC.value.minVal," do ",e.operatorsFC.value.maxVal)}}function Id(t,r){if(t&1&&(a(0,"div"),u(1,wd,2,2,"p"),o()),t&2){let e=d();s(),f(e.operatorsFC.value.constVal?-1:1)}}function Md(t,r){if(t&1&&C(0,"app-amount-input",10),t&2){let e=d();p("amountFC",e.amountFC)}}function Pd(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 Od(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(),oe(6,Pd,3,4,"mat-option",4,Ut),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),ae(e.constTopUpValue),s(3),p("amountFC",e.amountFC)}}function kd(t,r){t&1&&(a(0,"span"),c(1,"Pole nie mo\u017Ce by\u0107 puste"),o())}var Yl=(()=>{class t{constructor(e,i,n,l,_,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=Wn,this.isConstValue=!1,this.operatorsFC=new A("",[De.required]),this.phoneFC=new A("",[De.required,Li.phoneValidator]),this.amountFC=new A("",[De.required]),this.dateFC=new A({value:
3Bt(new Date,H),disabled:!0}),this.accountFC=new A("",[De.required]),this.formFG=this._formBuilder.group({operators:this.operatorsFC,phone:this.phoneFC,amount:this.amountFC,date:this.dateFC,account:this.accountFC}),this.gsmData=_}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=>l.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(Bt(new Date,H));this.formFG.markAsTouched()}confirm(){this.formFG.markAllAsTouched();let e=this.gsmData?As:ys;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(De.required),this.operatorsFC.value?.constVal===!0?this.constTopUpValue=this.operatorsFC.value?.constValList||[]:this.operatorsFC.value&&this.amountFC.setValidators([Li.min(this.amountFC,this.operatorsFC.value.minVal),Li.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()),pe(()=>!!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)(g(Wt),g(wi),g(ei),g(Ae),g(we),g(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(),oe(11,fd,2,2,"mat-option",4,Ut),o(),a(13,"mat-error"),u(14,hd,2,0,"span"),u(15,_d,2,1,"span"),u(16,gd,2,1,"span"),u(17,vd,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,Cd,2,0,"span"),u(26,bd,2,1,"span"),u(27,Sd,2,1,"span"),u(28,Ed,2,1,"span"),u(29,xd,2,1,"span"),u(30,Dd,2,1,"span"),u(31,Td,2,1,"span"),u(32,yd,2,1,"span"),u(33,Ad,2,1,"span"),o()(),a(34,"div",8)(35,"div",9),u(36,Id,2,1,"div"),u(37,Md,1,1,"app-amount-input",10),u(38,Od,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,kd,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=se(46);s(4),p("formGroup",n.formFG),s(4),p("formControl",n.operatorsFC),s(3),ae(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:[Se,Me,qt,Lo,Et,on,Dt,Tt,yt,en,Ee,an,_t,Ce,Te,tt,Qi,Ki,Ve,gt,Ke,Ye,Xe,We,ol,mt,nl,al,$],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 Jl=(()=>{class t{constructor(){this.termsAcceptance=h(xs)}canActivateChild(e){return this.termsAcceptance.isAllTermsAccepted(this.urlToTermsEnum(e.url[0].path),Es.TRANSACTION)}urlToTermsEnum(e){switch(e){case Vo:return Gn.DEPOSITS;case jo:return Gn.TOP_UPS;case Uo:return Gn.TRANSFERS;default:return Gn.NONE}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ec=()=>{if(localStorage.getItem(pn)!=="true")return!0;let r=h(Ri);return h(Vi).get(Ze.APPROVALS_ENABLED).pipe(L(Boolean),L(i=>i?r.createUrlTree(["/",Bi,cn]):!0))},tc=()=>{let t=h(Ri);return h(Vi).get(Ze.APPROVALS_ENABLED).pipe(L(Boolean),L(e=>e?!0:t.createUrlTree(["/",Bi,ln])))};function ic(t,r,e=0){if(r===null)return t;let i=[...t];for(;e+i.reduce((n,l)=>n+Fd(l),0)>r;){let n=i.findIndex(l=>l.secondary);if(n<0)break;i.splice(n,1)}return i}function Fd(t){return t.width?parseFloat(t.width)||0:240}var nc=(()=>{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(),v(n.icon()),s(2),v(n.message()))},dependencies:[ne,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 io=(()=>{class t{constructor(){this.appListCell=I.required(),this.template=h(Lr)}static ngTemplateContextGuard(e,i){return!0}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=ho({type:t,selectors:[["ng-template","appListCell",""]],inputs:{appListCell:[1,"appListCell"]}})}}return t})();var Rd=t=>({$implicit:t}),Nd=(t,r)=>({row:t,actions:r}),rc=(t,r)=>r.id;function Bd(t,r){t&1&&(a(0,"div",1),C(1,"mat-spinner",4),o())}function zd(t,r){t&1&&(a(0,"div",2),c(1),o()),t&2&&(s(),v(r))}function Ld(t,r){if(t&1&&C(0,"app-empty-state",3),t&2){let e=d();p("icon",e.emptyIcon())("message",e.emptyMessage())}}function Vd(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 jd(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 Ud(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);ki(i.cellClass(e)),Un("flex",i.cellFlex(e)),s(2),v(e.header)}}function Gd(t,r){t&1&&jr(0)}function Wd(t,r){if(t&1&&Z(0,Gd,1,0,"ng-container",21),t&2){let e=d().$implicit;p("ngTemplateOutlet",r)("ngTemplateOutletContext",Eo(2,Rd,e))}}function Hd(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 $d(t,r){if(t&1&&(a(0,"mat-cell")(1,"span",20),u(2,Wd,1,4,"ng-container")(3,Hd,1,1),o()()),t&2){let e,i=d().$implicit,n=d(2);ki(n.cellClass(i)),Un("flex",n.cellFlex(i)),s(2),f((e=n.cellTemplate(i.id))?2:3,e)}}function qd(t,r){if(t&1&&(_e(0,6),Z(1,Ud,3,5,"mat-header-cell",18)(2,$d,4,5,"mat-cell",19),ge()),t&2){let e=r.$implicit;p("matColumnDef",e.id)}}function Zd(t,r){t&1&&C(0,"mat-header-cell",22)}function Qd(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=se(12);p("matMenuTriggerFor",n)("matMenuTriggerData",xo(2,Nd,i,e))}}function Kd(t,r){t&1&&u(0,Qd,3,5,"button",24),t&2&&f(r.length>0?0:-1)}function Yd(t,r){if(t&1&&(a(0,"mat-cell",23),m("click",function(i){return i.stopPropagation()}),u(1,Kd,1,1),o()),t&2){let e,i=r.$implicit,n=d(2);s(),f((e=n.rowActionsFor(i))?1:-1,e)}}function Xd(t,r){t&1&&C(0,"mat-header-row",25)}function Jd(t,r){if(t&1){let e=F();a(0,"mat-row",26),m("click",function(n){let l=P(e).$implicit,_=d(2);return O(_.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,_=d(2);return O(_.onSpace(l,n))}),o()}if(t&2){let e=r.$implicit,i=d(2);ve("lv-row--selected",i.isSelected(e))("lv-row--open",i.isActive(e)),_i("aria-selected",i.selectable()?i.isSelected(e):null)("aria-current",i.isActive(e)?"true":null)}}function em(t,r){if(t&1&&(a(0,"mat-icon"),c(1),o()),t&2){let e=d().$implicit;s(),v(e.icon)}}function tm(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,em,2,1,"mat-icon"),a(2,"span"),c(3),o()()}if(t&2){let e=r.$implicit;ve("lv-menu-item--danger",e.kind==="danger"),s(),f(e.icon?1:-1),s(2),v(e.label)}}function im(t,r){if(t&1&&oe(0,tm,4,4,"button",27,rc),t&2){let e=r.actions;ae(e)}}function nm(t,r){if(t&1&&(a(0,"mat-table",5),_e(1,6),Z(2,Vd,2,2,"mat-header-cell",7)(3,jd,2,1,"mat-cell",8),ge(),oe(4,qd,3,1,"ng-container",6,rc),_e(6,6),Z(7,Zd,1,0,"mat-header-cell",9)(8,Yd,2,1,"mat-cell",10),ge(),Z(9,Xd,1,0,"mat-header-row",11)(10,Jd,1,6,"mat-row",12),o(),a(11,"mat-menu",null,0),Z(13,im,2,0,"ng-template",13),o()),t&2){let e=d();ve("lv-table--two-line",e.twoLine()),p("dataSource",e.rows())("trackBy",e.trackById),s(),p("matColumnDef",e.SELECT_COLUMN),s(3),ae(e.columns()),s(2),p("matColumnDef",e.MENU_COLUMN),s(3),p("matHeaderRowDef",e.displayedColumns())("matHeaderRowDefSticky",!0),s(),p("matRowDefColumns",e.displayedColumns())}}var oc="__select",ac="__menu",sc=(()=>{class t{constructor(){this.rows=I.required(),this.columns=I.required(),this.rowId=I.required(),this.selectable=I(!1),this.selected=yo([]),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=Nt(),this.SELECT_COLUMN=oc,this.MENU_COLUMN=ac,this.cellTemplates=$r(io),this.lastClickedIndex=-1,this.hostWidth=j(null),this.visibleColumns=b(()=>ic(this.columns(),this.hostWidth(),(this.selectable()?64:0)+(this.rowActions().length>0?56:0))),this.displayedColumns=b(()=>[...this.selectable()?[oc]:[],...this.visibleColumns().map(n=>n.id),...this.rowActions().length>0?[ac]:[]]),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=h(uo).nativeElement,i=h(te);Zi(()=>
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 _=Math.min(this.lastClickedIndex,l),D=Math.max(this.lastClickedIndex,l),R=n.slice(_,D+1),le=new Set(R.map(me=>this.rowId()(me))),ce=i.ctrlKey||i.metaKey?this.selected().filter(me=>!le.has(this.rowId()(me))):[];this.selected.set([...ce,...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&&go(l,n.cellTemplates,io,4),i&2&&Oi()},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,Bd,2,0,"div",1)(1,zd,2,1,"div",2)(2,Ld,1,2,"app-empty-state",3)(3,nm,14,9),i&2){let l;f(n.loading()?0:(l=n.error())?1:n.rows().length===0?2:3,l)}},dependencies:[Zr,Hs,fn,_n,bn,gn,hn,Sn,vn,Cn,En,xn,gs,sn,ne,q,Ie,vt,Vs,zs,Ns,Bs,Ls,St,it,ds,ps,nc],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 om=["body"],am=["*",[["","appDetailPanelActions",""]]],rm=["*","[appDetailPanelActions]"];function sm(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 lm(t,r){t&1&&(a(0,"footer",6),Rt(1,1),o())}var ha=(()=>{class t{constructor(){this.appDetailPanelActions=I(!0,{transform:qr})}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275dir=ho({type:t,selectors:[["","appDetailPanelActions",""]],inputs:{appDetailPanelActions:[1,"appDetailPanelActions"]}})}}return t})(),_a=(()=>{class t{constructor(){this.title=I.required(),this.showBack=I(!1),this.back=Nt(),this.closed=Nt(),this.actions=Hr(ha),this.show
3Footer=b(()=>this.actions()?.appDetailPanelActions()??!1),this.host=h(uo),this.body=To.required("body"),Zi(()=>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&&go(l,n.actions,ha,5),i&2&&Oi()},viewQuery:function(i,n){i&1&&vo(n.body,om,5),i&2&&Oi()},hostAttrs:["tabindex","-1","role","complementary"],hostVars:1,hostBindings:function(i,n){i&2&&_i("aria-label",n.title())},inputs:{title:[1,"title"],showBack:[1,"showBack"]},outputs:{back:"back",closed:"closed"},ngContentSelectors:rm,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&&(gi(am),a(0,"header",1),u(1,sm,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),Rt(9),o(),u(10,lm,2,0,"footer",6)),i&2&&(s(),f(n.showBack()?1:-1),s(2),v(n.title()),s(7),f(n.showFooter()?10:-1))},dependencies:[ne,q,Ie,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 cm=(t,r)=>r.id,pm=(t,r)=>r.value;function dm(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,_=d();return O(_.set(l.id,n.target.value))}),o()()}if(t&2){let e=d().$implicit,i=d();s(2),v(e.label),s(3),p("value",i.valueOf(e.id)),_i("placeholder",e.placeholder??null)}}function mm(t,r){if(t&1&&(a(0,"mat-option",7),c(1),o()),t&2){let e=r.$implicit;p("value",e.value),s(),v(e.label)}}function um(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,_=d();return O(_.set(l.id,n.value))}),a(4,"mat-option",6),c(5),o(),oe(6,mm,2,2,"mat-option",7,pm),o()()}if(t&2){let e=d().$implicit,i=d();Un("flex-basis",e.width??null),s(2),v(e.label),s(),p("value",i.valueOf(e.id)),s(2),v(e.allLabel??"Wszystkie"),s(),ae(e.options)}}function fm(t,r){if(t&1&&u(0,dm,6,3,"mat-form-field",0)(1,um,8,5,"mat-form-field",1),t&2){let e=r.$implicit;f(e.kind==="search"?0:1)}}var lc=(()=>{class t{constructor(){this.filters=I.required(),this.values=yo({})}valueOf(e){return this.values()[e]??""}set(e,i){this.values.set(Pr(Mr({},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&&oe(0,fm,2,1,null,null,cm),i&2&&ae(n.filters())},dependencies:[tn,Se,Me,Lo,nn,Ee,_s,an,on,ne,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 hm=[[["","appListViewHeader",""]],"*",[["","appListViewPanel",""]]],_m=["[appListViewHeader]","*","[appListViewPanel]"];function gm(t,r){if(t&1){let e=F();Vn(0,"div",4),Ur("click",function(){P(e);let n=d();return O(n.panelClose.emit())}),jn()}}var cc=(()=>{class t{constructor(){this.panelOpen=I(!1),this.panelClose=Nt()}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&&ve("lv-shell--open",n.panelOpen())},inputs:{panelOpen:[1,"panelOpen"]},outputs:{panelClose:"panelClose"},ngContentSelectors:_m,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&&(gi(hm),Vn(0,"div",0),Rt(1),jn(),Vn(2,"div",1),Rt(3,1),jn(),u(4,gm,1,0,"div",2),Vn(5,"aside",3),Rt(6,2),jn()),i&2&&(s(4),f(n.panelOpen()?4:-1),s(),_i("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 vm=["*"],Cm=(t,r)=>r.id;function bm(t,r){if(t&1&&(a(0,"span",2),c(1),o()),t&2){let e=r.$implicit;s(),v(e)}}function Sm(t,r){if(t&1&&(a(0,"mat-icon"),c(1),o()),t&2){let e=d(2).$implicit;s(),v(e.icon)}}function Em(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,Sm,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 xm(t,r){if(t&1&&(a(0,"mat-icon"),c(1),o()),t&2){let e=d(2).$implicit;s(),v(e.icon)}}function Dm(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,xm,2,1,"mat-icon"),c(2),o()}if(t&2){let e=d().$implicit;ve("lv-selbar__action--danger",e.kind==="danger"),s(),f(e.icon?1:-1),s(),U(" ",e.label," ")}}function Tm(t,r){if(t&1&&u(0,Em,3,2,"button",4)(1,Dm,3,4,"button",5),t&2){let e=r.$implicit;f(e.kind==="primary"?0:1)}}function ym(t,r){t&1&&(a(0,"span",3),c(1,"Zaznaczone pozycje nie maj\u0105 wsp\xF3lnej akcji"),o())}function Am(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(),oe(5,bm,2,1,"span",2,Ut),oe(7,Tm,2,1,null,null,Cm),u(9,ym,2,0,"span",3)}if(t&2){let e=d();s(4),U("Wybrano ",e.count()),s(),ae(e.totalsText()),s(2),ae(e.applicable()),s(2),f(e.applicable().length===0?9:-1)}}function wm(t,r){t&1&&Rt(0)}var pc=(()=>{class t{constructor(){this.selected=I.required(),this.actions=I([]),this.totals=I(null),this.clear=Nt(),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&&ve("lv-selbar--active",n.count()>0)},inputs:{selected:[1,"selected"],actions:[1,"actions"],totals:[1,"totals"]},outputs:{clear:"clear"},ngContentSelectors:vm,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&&(gi(),u(0,Am,10,2)(1,wm,1,0)),i&2&&f(n.count()>0?0:1)},dependencies:[Ie,Ct,vt,ne,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 Im=["*"],ga=(()=>{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&&ki("lv-state-chip lv-state-chip--"+n.tone())},inputs:{tone:[1,"tone"]},ngContentSelectors:Im,decls:1,vars:0,template:function(i,n){i&1&&(gi(),Rt(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=h(Ht),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===vi.TO_APPROVE)),this.approvedItems=b(()=>this._approvableItems().filter(e=>e.state===vi.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()}
3showDetails(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 Mm={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 dc(t,r){return t&&Mm[t]||r}function no(t){return dc(t,"Nie uda\u0142o si\u0119 przekaza\u0107 pozycji do realizacji.")}function mc(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."}}var lt=(()=>{class t{transform(e){switch(e){case ye.BUNDLE:return"Paczka";case ye.SALARY_BUNDLE:return"Paczka p\u0142acowa";case ye.TRANSFER_COMMON:return"Przelew zwyk\u0142y";case ye.TRANSFER_US:return"Przelew US/C\u0141O";case ye.TRANSFER_ZUS:return"Przelew ZUS";case ye.TRANSFER_INTERNATIONAL:return"Przelew zagraniczny";case ye.TRANSFER_INSTANT:return"Przelew ekspresowy";case ye.TRANSFER_DEALING_BPS:return"Przelew dealing BPS";case ye.TRANSFER_VAT:return"Faktura VAT";case ye.TRANSFER_VAT_TOP_UP:return"Przelew VAT - zasilenie";case ye.DEPOSIT_OPENING:return"Za\u0142o\u017Cenie lokaty";case ye.DEPOSIT_MODIFICATION:return"Modyfikacja lokaty";case ye.DEPOSIT_CLOSING:return"Zerwanie lokaty";case ye.STANDING_ORDER_OPENING:return"Utworzenie zlecenia sta\u0142ego";case ye.STANDING_ORDER_MODIFICATION:return"Modyfikacja zlecenia sta\u0142ego";case ye.STANDING_ORDER_CLOSING:return"Zerwanie zlecenia sta\u0142ego";case ye.GSM_TOP_UP:return"Do\u0142adowanie GSM";default:return""}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=_o({name:"approvableItemTypeView",type:t,pure:!0})}}return t})();function va(t){return ts.includes(t.type)}function Vt(t){return is.includes(t.type)}function mi(t){return ns.includes(t.type)}function ui(t){return os.includes(t.type)}function Mi(t){return as.includes(t.type)}var Pm=new lt;function kn(t){return Vt(t)?t.data.name:Mi(t)||ui(t)||mi(t)?Pm.transform(t.type):t.data.recipientName??t.data.name}function uc(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 Om=new $;function Ca(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])=>`${Om.transform(i)} ${e}`)}var km=(t,r)=>r.id;function Fm(t,r){if(t&1&&(a(0,"mat-icon",8),c(1),o()),t&2){let e=r;ki("approval-summary__"+e.kind),p("matTooltip",e.tooltip),s(),U(" ",e.kind==="ok"?"check_circle":"warning"," ")}}function Rm(t,r){if(t&1&&(a(0,"span",6),u(1,Fm,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 Nm(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,Rm,2,1,"span",6)
3),t&2){let e=r.$implicit,i=d();s(),v(i.title(e)),s(2),v(V(4,4,e.data.executionDate,i.DEFAULT_DATE_FORMAT)),s(3),v(i.formatAmount(e.data.amount,e.data.currency)),s(),f(i.hasStatuses()?7:-1)}}function Bm(t,r){if(t&1&&(a(0,"span",5),c(1),o()),t&2){let e=r.$implicit;s(),v(e)}}function zm(t,r){if(t&1&&(a(0,"div",2)(1,"span",9),c(2),o(),oe(3,Bm,2,1,"span",5,Ut),o()),t&2){let e=d();s(2),v(e.countLabel()),s(),ae(e.totals())}}var Pi=(()=>{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(()=>uc(this.items().length)),this.totals=b(()=>Ca(this.items())),this.currencyPipe=new $,this.title=kn}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),oe(2,Nm,8,7,null,null,km),o(),u(4,zm,5,1,"div",2),o()),i&2&&(s(),ve("approval-summary__rows--with-status",n.hasStatuses()),s(),ae(n.items()),s(2),f(n.items().length>1?4:-1))},dependencies:[ne,q,Kt,Zt,re],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 Lm(t,r){t&1&&(a(0,"p"),c(1,"Czy na pewno chcesz przekaza\u0107 poni\u017Csze pozycje do realizacji?"),o())}function Vm(t,r){if(t&1&&(a(0,"p"),c(1),o()),t&2){let e=d();s(),v(e.summary())}}function jm(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),v(e.message)}}function Um(t,r){t&1&&u(0,jm,5,1,"div",6),t&2&&f(r.status==="refused"?0:-1)}function Gm(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=se(12),i=d();s(9),p("matDatepicker",e)("min",i.today)("formControl",i.executionDate),s(),p("for",e)}}function Wm(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 Hm(t,r){t&1&&C(0,"mat-spinner",15)}function $m(t,r){t&1&&c(0," Realizuj ")}function qm(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,Hm,1,0,"mat-spinner",15)(4,$m,1,0),o()}if(t&2){let e=d();s(2),p("disabled",e.submitDisabled()),s(),f(e.state().status==="submitting"?3:4)}}var fc=(()=>{class t{constructor(){this.data=h(we),this.dialogRef=h(Ae),this.executeApi=h(Fo),this.executionDate=new Po(null),this.today=Pe.getTodayStartOfDay(),this.state=j({status:"confirm"}),this.results=j(null),this.pastDated=b(()=>this.data.items.filter(e=>Pe.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===ko.EXECUTED?{kind:"ok",tooltip:"Przekazano do realizacji"}:{kind:"warn",tooltip:no(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===ko.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?Pe.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===ko.EXECUTED).length;this.dialogRef.close({executedCount:e})}refuse(e){let i=e instanceof Io?e.error:null,n=i&&typeof i=="object"&&"code"in i?i.code:Oo.INTERNAL_ERROR;this.state.set({status:"refused",message:no(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,Lm,2,0,"p")(4,Vm,2,1,"p"),u(5,Um,1,1),C(6,"app-approval-summary",2),u(7,Gm,13,4,"div",3),o(),a(8,"mat-dialog-actions",4),u(9,Wm,2,0,"button",5)(10,qm,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:[Yi,Ce,Te,Ve,Ie,Ct,Bo,Ro,No,en,ne,q,Kt,tn,Se,Me,Et,nn,Ee,$o,Dt,Tt,yt,St,it,Pi],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})();var ba=(()=>{class t{constructor(){this.dialog=h(he),this.approvalsState=h(Je),this.destroyRef=h(te)}execute(e=this.approvalsState.selectedItems()){e.length!==0&&this.dialog.open(fc,{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 oo=(()=>{class t{constructor(){this.stateService=h(Je),this.authFlow=h(rn),this.approveApi=h(bi),this.revokeApi=h(Si),this.convertToDraftApi=h(Ei),this.notifications=h(K),this.batchExecution=h(ba),this.destroyRef=h(te),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)}
3showDetails(e){this.stateService.showDetails(e)}runAuthFlow(e,i,n,l){i.length!==0&&this.authFlow.run(e,i.map(_=>_.id),{title:n,summary:{component:Pi,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 Sa=(()=>{class t{transform(e,i=!1){switch(e){case vi.TO_APPROVE:return i?"Do podpisu":"W trakcie podpisywania";case vi.APPROVED:return"Podpisana";default:return"Status nieznany"}}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275pipe=_o({name:"approvableItemStateView",type:t,pure:!0})}}return t})();function Ea(t){return t.state===vi.APPROVED?"success":t.actions.canApprove?"warn":"neutral"}function Zm(t,r){t&1&&(a(0,"span",8),c(1),o()),t&2&&(s(),v(r))}function Qm(t,r){if(t&1&&(a(0,"div",6)(1,"span",7),c(2),o(),u(3,Zm,2,1,"span",8),o()),t&2){let e,i=r.$implicit,n=d().itemInfo(i);s(2),v(n.line1),s(),f((e=n.line2)?3:-1,e)}}function Km(t,r){t&1&&(a(0,"mat-icon",9),c(1,"warning"),o())}function Ym(t,r){if(t&1&&u(0,Km,2,0,"mat-icon",9),t&2){let e=r.$implicit,i=d();f(i.whiteListEnabled()&&e.data.invalidVatVerificationStatus?0:-1)}}function Xm(t,r){if(t&1&&(c(0),T(1,"currencyFormatPipe")),t&2){let e=r.$implicit;ie("",B(1,2,e.data.amount)," ",e.data.currency)}}function Jm(t,r){if(t&1&&(c(0),T(1,"date")),t&2){let e=r.$implicit,i=d();v(V(1,1,e.data.executionDate,i.DEFAULT_DATE_FORMAT))}}function eu(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(),v(V(2,2,e.state,e.actions.canApprove))}}var tu=new lt,_c=(()=>{class t{constructor(){this.items=I.required(),this.emptyMessage=I("Brak element\xF3w do wy\u015Bwietlenia"),this.stateService=h(Je),this.actionService=h(oo),this.whiteListEnabled=h(Ji).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=Ea}itemInfo(e){let i=kn(e),{data:n}=e;return Vt(e)?{line1:i,line2:hc(e,n.itemCount!=null?`Element\xF3w: ${n.itemCount}`:"")}:Mi(e)?{line1:i,line2:n.name}:ui(e)?{line1:i,line2:iu(n)}:mi(e)?{line1:i,line2:n.name}:{line1:i,line2:hc(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(_){return n.stateService.setSelectedItems(_)})("rowClick",function(_){return n.actionService.showDetails(_)}),Z(1,Qm,4,2,"ng-template",1)(2,Ym,1,1,"ng-template",2)(3,Xm,2,4,"ng-template",3)(4,Jm,2,4,"ng-template",4)(5,eu,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:[ne,q,Kt,Zt,sc,io,ga,He,re,$,Sa],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 hc(t,r){return[tu.transform(t.type),r].filter(e=>e!=="").join(" \xB7 ")}function iu(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 nu="yyyy-MM-dd_HH-mm-ss",Dr=(()=>{class t{constructor(){this.approvalsApi=h(Ht),this.fileService=h(Ss),this.destroyRef=h(te),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),bs.PDF),ee(()=>this._downloading.set(!1)),Ue(this.destroyRef)).subscribe())}fileName(e){return`Wydruk_${Vt(e)?"paczki":"dyspozycji"}_${Pe.getTodayWithTime(nu)}.pdf`}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var jt=(()=>{class t{constructor(){this.approvalsApi=h(Ht),this.destroyRef=h(te),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 Tr=(()=>{class t{constructor(){this.convertToDraftApi=h(Ei),this.authFlow=h(rn),this.notifications=h(K),this.detailsState=h(jt),this.approvalsState=h(Je),this.destroyRef=h(te)}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:Pi,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 ou(t,r){if(t&1&&(a(0,"app-state-chip",5),c(1),T(2,"approvableItemStateView"),o()),t&2){let e=r,i=d();ve("content-banner__badge--approved",e==="APPROVED"),p("tone",i.tone()),s(),U(" ",V(2,4,e,i.canApprove())," ")}}var oi=(()=>{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?Ea({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,ou,3,7,"app-state-chip",4),o()),i&2){let l;s(2),v(n.subtitle()),s(2),v(n.title()),s(2),ie("",B(7,5,n.amount())," ",n.currency()),s(2),f((l=n.state())?8:-1,l)}},dependencies:[He,ga,$,Sa],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 yr=Jc(ep());function au(t,r){t&1&&(a(0,"strong"),c(1,"Nowa data realizacji"),o())}function ru(t,r){t&1&&c(0," Data realizacji ")}var gc=(()=>{class t{constructor(){this.dialogRef=h(Ae),this.data=h(we),this.formattedAmount=this.formatAmou
3nt()}formatAmount(){let e=(0,yr.default)(this.data.amount,{precision:2}).format();return(0,yr.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,au,2,0,"strong")(16,ru,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),v(n.data.name),s(4),v(n.formattedAmount),s(2),f(n.data.executionDateOverridden?15:16),s(3),v(n.data.executionDate))},dependencies:[Ie,Ct,Bo,Ro,No,en],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 Ar=(()=>{class t{constructor(){this.executeApi=h(Fo),this.dialog=h(he),this.notifications=h(K),this.detailsState=h(jt),this.approvalsState=h(Je),this.destroyRef=h(te),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(gc,{data:n}).afterClosed().pipe(pe(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 Io?this.parseErrorBody(e.error):null,n=i?.code??Oo.INTERNAL_ERROR;this._state.set({status:"error",code:n,message:no(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 su=(t,r)=>r.dispositionId;function lu(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=se(8),i=d(2);s(5),p("matDatepicker",e)("min",i.today),s(),p("for",e)}}function cu(t,r){t&1&&C(0,"mat-spinner",7)}function pu(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),v(e.dispositionType),s(),U(": ",i.dispositionErrorMessage(e.code)," ")}}function du(t,r){if(t&1&&(a(0,"ul",16),oe(1,pu,4,2,"li",null,su),o()),t&2){d();let e=So(6);s(),ae(e)}}function mu(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(),Co(6),u(7,du,3,0,"ul",16),o()()),t&2){s(5),v(r),s();let e=bo(d(2).dispositionErrors());s(),f(e&&e.length>0?7:-1)}}function uu(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,lu,9,3),a(9,"button",6),m("click",function(){P(e);let n=d();return O(n.execute())}),u(10,cu,1,0,"mat-spinner",7),c(11," Realizuj "),o()(),u(12,mu,8,3,"div",8),o()}if(t&2){let e,i=d();s(),p("formGroup",i.form),s(5),v(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 ai=(()=>{class t{constructor(){this.response=I.required(),this.form=new Qr({executionDate:new Po(null,[De.required])}),this.isPastExecutionDate=b(()=>vc(this.response().details.executionDate).getTime()<this.today.getTime()),this.DEFAULT_DATE_FORMAT=H,this.dispositionErrorMessage=mc,this.userFacade=h(Oe),this.canView=this.userFacade.hasAuthorities([Q.FUNC_EXECUTE]),this.actionState=h(Ar),this.isSubmitting=this.actionState.isSubmitting,this.errorMessage=this.actionState.errorMessage,this.dispositionErrors=this.actionState.dispositionErrors}
3get today(){return vc(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?fu(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:[Gt([Ar])],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,uu,13,9,"div",1),i&2&&f(n.canView&&n.response().actions.canExecute?0:-1)},dependencies:[Le,Yi,Ce,Te,tt,gt,Yr,Ie,Ct,ne,q,St,it,tn,Se,Me,Et,nn,Ee,$o,Dt,Tt,yt,re],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)}",".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 vc(t){let r=t instanceof Date?t:new Date(t);return new Date(r.getFullYear(),r.getMonth(),r.getDate())}function fu(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 ao=(()=>{class t{constructor(){this.approvalsApi=h(Ht),this.approvalsAuthApi=h(bi),this.approvalsRevokeAuthApi=h(Si),this.authFlow=h(rn),this.detailsState=h(jt),this.approvalsState=h(Je),this.destroyRef=h(te),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();
3return i?{component:Pi,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 Cc(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 hu(t,r){if(t&1&&(a(0,"mat-icon",7),c(1,"chevron_right"),o()),t&2){let e=d(2);ve("signatures__chevron--open",e.expanded())}}function _u(t,r){t&1&&(C(0,"mat-spinner",8),a(1,"span",5),c(2,"\u0141adowanie podpis\xF3w\u2026"),o())}function gu(t,r){t&1&&(a(0,"span",4),c(1,"Nie uda\u0142o si\u0119 pobra\u0107 podpis\xF3w"),o())}function vu(t,r){if(t&1&&(a(0,"span",5),c(1),o()),t&2){let e=d(2);s(),v(e.countLabel())}}function Cu(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),v(e.approvedBy),s(2),v(V(5,2,e.approvedAt,i.DEFAULT_DATE_TIME_PIPE_FORMAT))}}function bu(t,r){if(t&1&&(a(0,"ul",6),oe(1,Cu,6,5,"li",9,Vr),o()),t&2){d();let e=So(0);s(),ae(e)}}function Su(t,r){if(t&1){let e=F();Co(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,hu,2,2,"mat-icon",3),u(5,_u,3,0)(6,gu,2,0,"span",4)(7,vu,2,1,"span",5),o()(),u(8,bu,3,0,"ul",6),o()}if(t&2){let e=d(),i=bo(e.signatures());s(2),ve("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 ri=(()=>{class t{constructor(){this.service=h(ao),this.userFacade=h(Oe),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(()=>Cc(this.count())),this.canToggle=b(()=>!this.isLoading()&&!this.isError()&&this.count()>0),this.expanded=j(!1),this.DEFAULT_DATE_TIME_PIPE_FORMAT=xt}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,Su,9,6,"div",0),i&2&&f(n.canView?0:-1)},dependencies:[Le,ne,q,St,it,re],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)}",".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 Eu=(t,r)=>r.id;function xu(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();s(4),ie("",B(5,2,e.details().vatAmount)," ",e.details().currency)}}function Du(t,r){t&1&&(a(0,"mat-icon",10),c(1,"warning"),o())}function Tu(t,r){t&1&&c(0," Pozytywna ")}function yu(t,r){t&1&&c(0," Negatywna ")}function Au(t,r){t&1&&c(0," Brak weryfikacji ")}function wu(t,r){if(t&1&&(a(0,"div",4)(1,"span",5),c(2,"Weryfikacja VAT paczki"),o(),a(3,"span",9),u(4,Du,2,0,"mat-icon",10),u(5,Tu,1,0)(6,yu,1,0)(7,Au,1,0),o()()),t&2){let e,i=d();s(3),ve("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 Iu(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),ie("Ostatnia modyfikacja ",V(2,2,e.details().auditData.modifiedAt,e.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",e.details().auditData.modifiedBy)}}function Mu(t,r){t&1&&(a(0,"div",12),C(1,"mat-spinner",13),o())}function Pu(t,r){t&1&&(a(0,"div",12)(1,"span",14),c(2,"Nie uda\u0142o si\u0119 pobra\u0107 dyspozycji"),o()())}function Ou(t,r){t&1&&(a(0,"div",12)(1,"span"),c(2,"Brak dyspozycji"),o()())}function ku(t,r){t&1&&(a(0,"mat-icon",20),c(1,"warning"),o())}function Fu(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,ku,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),v(e.recipientName),s(2),v(e.title),s(),f(i.whiteListEnabled()&&e.invalidVatVerificationStatus?7:-1),s(2),ie("",B(10,5,e.amount)," ",e.currency)}}function Ru(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),ie("",i.currentPage()+1," / ",e.maxPageNumber+1),s(),p("disabled",!e.nextPage||i.childNodesLoading())}}function Nu(t,r){t&1&&u(0,Ru,9,4,"div",23),t&2&&f(r.maxPageNumber>0?0:-1)}function Bu(t,r){if(t&1&&(a(0,"ul",15),oe(1,Fu,13,7,"li",null,Eu),o(),u(3,Nu,1,1
3)),t&2){let e,i=d(2);s(),ae(i.childNodes()),s(2),f((e=i.pageInfo())?3:-1,e)}}function zu(t,r){if(t&1&&(a(0,"div",8)(1,"h4",11),c(2,"Dyspozycje"),o(),u(3,Mu,2,0,"div",12)(4,Pu,3,0,"div",12)(5,Ou,3,0,"div",12)(6,Bu,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 bc=(()=>{class t{constructor(){this.response=I.required(),this.details=b(()=>this.response().details),this.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=xt,this.ChildNodesType=Ha,this.BundleVatVerificationStatus=$a,this.whiteListEnabled=h(Ji).whiteListEnabled,this.isBundleVatVerificationWarning=b(()=>this.details().bundleVatVerificationStatus!==$a.POSITIVE),this.childNodes=j([]),this.pageInfo=j(null),this.currentPage=j(0),this.childNodesLoading=j(!1),this.childNodesError=j(!1),this.approvalsApiService=h(Ht),this.detailsState=h(jt)}ngOnInit(){this.response().childNodesType===Ha.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,xu,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,wu,8,4,"div",4),o(),a(20,"div",7)(21,"span"),c(22),T(23,"date"),o(),u(24,Iu,3,5,"span"),o()(),u(25,zu,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),v(B(11,17,n.details().sourceAccount)),s(2),f(n.details().vatAmount?12:-1),s(5),v(V(18,19,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.whiteListEnabled()?19:-1),s(3),ie("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,Zt,ne,Ie,St,Kt,oi,ri,ai,re,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 Lu(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function Vu(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 ju(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);s(4),ie("",e.details().depositData.period," ",e.formatPeriodUnit(e.details().depositData.periodUnit))}}function Uu(t,r){if(t&1&&(u(0,Vu,5,1,"div",3),u(1,ju,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 Gu(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),ie("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=xt}formatPeriodUnit(e){switch(e){case Ci.DAY:return"dni";case Ci.MONTH:return"mies.";case Ci.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,Lu,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,Uu,2,2),o(),a(18,"div",6)(19,"span"),c(20),T(21,"date"),o(),u(22,Gu,3,5,"span"),o()()),i&2){let l,_,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",((_=n.approvableItem())==null?null:_.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),v(B(10,14,n.details().sourceAccount)),s(6),v(V(16,16,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.details().depositData?17:-1),s(3),ie("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,oi,ri,ai,re,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 Wu(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function Hu(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),v(e.details().phoneNumber)}}function $u(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),ie("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=xt}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,Wu,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,Hu,5,1,"div",3),o(),a(18,"div",6)(19,"span"),c(20),T(21,"date"),o(),u(22,$u,3,5,"span"),o()()),i&2){let l,_,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",((_=n.approvableItem())==null?null:_.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),v(B(10,14,n.details().sourceAccount)),s(6),v(V(16,16,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.details().phoneNumber?17:-1),s(3),ie("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,oi,ri,ai,re,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 qu(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function Zu(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),v(B(5,1,e.details().recipientAccount))}}function Qu(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),v(e.details().recipientName)}}function Ku(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),v(e.details().title)}}function Yu(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),ie("",B(5,2,e.details().vatAmount)," ",e.details().currency)}}function Xu(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),v(V(5,1,e.details().standingOrderData.endDate,e.DEFAULT_DATE_FORMAT))}}function Ju(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,Xu,6,4,"div",3)),t&2){let e=d();s(4),ie("Co ",e.details().standingOrderData.period," ",e.formatStandingOrderUnit(e.details().standingOrderData.unit)),s(5),v(V(10,4,e.details().standingOrderData.startDate,e.DEFAULT_DATE_FORMAT)),s(2),f(e.details().standingOrderData.endDate?11:-1)}}function ef(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),ie("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.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=xt}formatStandingOrderUnit(e){switch(e){case Ci.DAY:return"dzie\u0144";case Ci.MONTH:return"miesi\u0105c";case Ci.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,qu,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,Zu,6,3,"div",3),u(12,Qu,5,1,"div",3),u(13,Ku,5,1,"div",3),u(14,Yu,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,Ju,12,7),o(),a(22,"div",6)(23,"span"),c(24),T(25,"date"),o(),u(26,ef,3,5,"span"),o()()),i&2){let l,_,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",((_=n.approvableItem())==null?null:_.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),v(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),v(V(20,20,n.details().executionDate,n.DEFAULT_DATE_FORMAT)),s(2),f(n.details().standingOrderData?21:-1),s(3),ie("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,oi,ri,ai,re,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 tf(t,r){t&1&&C(0,"app-approval-signatures")(1,"app-approval-execution",7),t&2&&(s(),p("response",r))}function nf(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),v(B(5,1,e.details().recipientAccount))}}function of(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),v(e.details().recipientName)}}function af(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),v(e.details().title)}}function rf(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),ie("",B(5,2,e.details().vatAmount)," ",e.details().currency)}}function sf(t,r){t&1&&(a(0,"mat-icon",9),c(1,"warning"),o())}function lf(t,r){if(t&1&&(a(0,"div",3)(1,"span",4),c(2,"Weryfikacja VAT"),o(),a(3,"span",8),u(4,sf,2,0,"mat-icon",9),c(5),o()()),t&2){let e=d();s(3),ve("flat-grid__value--warning",e.isVatVerificationWarning()),s(),f(e.isVatVerificationWarning()?4:-1),s(),U(" ",e.formatVatVerificationStatus(e.details().vatVerificationStatus)," ")}}function cf(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),v(e.details().isSorbnet?"Tak":"Nie")}}function pf(t,r){if(t&1&&(a(0,"span"),c(1),T(2,"date"),o()),t&2){let e=d();s(),ie("Ostatnia modyfikacja ",V(2,2,e.details().auditData.modifiedAt,e.DEFAULT_DATE_TIME_PIPE_FORMAT)," przez ",e.details().auditData.modifiedBy)}}var Dc=(()=>{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!==Ni.REGISTERED),this.whiteListEnabled=h(Ji).whiteListEnabled,this.DEFAULT_DATE_FORMAT=H,this.DEFAULT_DATE_TIME_PIPE_FORMAT=xt}formatVatVerificationStatus(e){switch(e){case Ni.REGISTERED:return"Zarejestrowany";case Ni.NOT_REGISTERED:return"Niezarejestrowany";case Ni.CHECK_UNSUCCESSFUL:return"Weryfikacja nieudana";case Ni.ERROR:return"B\u0142\u0105d weryfikacji";case Ni.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,tf,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,nf,6,3,"div",3),u(12,of,5,1,"div",3),u(13,af,5,1,"div",3),u(14,rf,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,lf,6,4,"div",3),u(22,cf,5,1,"div",3),o(),a(23,"div",6)(24,"span"),c(25),T(26,"date"),o(),u(27,pf,3,5,"span"),o()()),i&2){let l,_,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",((_=n.approvableItem())==null?null:_.actions)??null),s(2),f((D=n.approvableItem())?2:-1,D),s(7),v(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),v(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),ie("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,ne,oi,ri,ai,re,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 df(t,r){t&1&&(a(0,"div",2),C(1,"mat-spinner",4),o())}function mf(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 uf(t,r){if(t&1&&C(0,"app-transfer-details",6),t&2){let e=d();p("response",e)}}function ff(t,r){if(t&1&&u(0,uf,1,1,"app-transfer-details",6),t&2){let e=d(2);f(e.isTransferType(r)?0:-1)}}function hf(t,r){if(t&1&&u(0,df,2,0,"div",2)(1,mf,3,0,"div",2)(2,ff,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 _f(t,r){t&1&&(a(0,"div",2),C(1,"mat-spinner",4),o())}function gf(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 vf(t,r){if(t&1&&C(0,"app-transfer-details",6),t&2){let e=d();p("response",e)}}function Cf(t,r){if(t&1&&C(0,"app-bundle-details",6),t&2){let e=d();p("response",e)}}function bf(t,r){if(t&1&&C(0,"app-standing-order-details",6),t&2){let e=d();p("response",e)}}function Sf(t,r){if(t&1&&C(0,"app-deposit-details",6),t&2){let e=d();p("response",e)}}function Ef(t,r){if(t&1&&C(0,"app-gsm-top-up-details",6),t&2){let e=d();p("response",e)}}function xf(t,r){if(t&1&&u(0,vf,1,1,"app-transfer-details",6)(1,Cf,1,1,"app-bundle-details",6)(2,bf,1,1,"app-standing-order-details",6)(3,Sf,1,1,"app-deposit-details",6)(4,Ef,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 Df(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 Tf(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 yf(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 Af(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 wf(t,r){if(t&1&&(u(0,Df,4,0,"button",7),u(1,Tf,4,0,"button",8),u(2,yf,4,0,"button",9),u(3,Af,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 Tc=(()=>{class t{constructor(){this.itemId=I.required(),this.back=Nt(),this.detailsState=h(jt),this.signaturesService=h(ao),this.withdrawForEditService=h(Tr),this.printoutService=h(Dr),this.userFacadeService=h(Oe),this.injector=h(Br),this.isTransferType=va,this.isBundleType=Vt,this.isStandingOrderType=mi,this.isDepositType=ui,this.isGsmType=Mi,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&&!ui(e)&&!mi(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&&Vt(e)?"Szczeg\xF3\u0142y paczki":"Szczeg\xF3\u0142y dyspozycji"}),this.panel=To.required(_a),this.itemScrollTop=0,qi(()=>{let e=this.itemId();this.detailsState.load(e),this.canSign&&this.signaturesService.load(e)}),qi(()=>{let e=this.childOpen();Do(()=>{e?(this.itemScrollTop=this.panel().bodyScrollTop,this.panel().scrollBodyTo(0)):Zi(()=>this.panel().scrollBodyTo(this.itemScrollTop),{injector:this.injector})})}),qi(()=>{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&&vo(n.panel,_a,5),i&2&&Oi()},inputs:{itemId:[1,"itemId"]},outputs:{back:"back"},features:[Gt([jt,ao,Tr,Dr,bi,Si,Ei])],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,hf,3,1),a(2,"div",1),u(3,_f,2,0,"div",2)(4,gf,3,0,"div",2)(5,xf,5,
31),o(),a(6,"div",3),u(7,wf,4,4),o()()),i&2){let l,_;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((_=n.data())?7:-1,_)}},dependencies:[ne,q,Ie,Ct,vt,St,it,Kt,Zt,_a,ha,Dc,bc,xc,Sc,Ec],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 Ac(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 wc(t){return[...new Set(t.map(e=>ro(e.data.sourceAccount)).filter(e=>e!==""))].sort().map(e=>({value:e,label:si.ibanFormat(e)}))}function ro(t){return(t??"").replace(/\s+/g,"").toUpperCase()}var If=864e5,Mf={transfer:va,bundle:Vt,deposit:ui,standingOrder:mi,gsm:Mi};function Ic(t){return Object.values(t).some(r=>r!=="")}function Mc(t,r,e=new Date){let i=(r.q??"").trim().toLowerCase(),n=ro(i),l=ro(r.account),_=Mf[r.type??""],D=r.date??"";return t.filter(R=>l!==""&&ro(R.data.sourceAccount)!==l||_&&!_(R)||!Pf(R.data.executionDate,D,e)?!1:i===""?!0:[kn(R),R.data.name,R.data.recipientName??""].some(le=>le.toLowerCase().includes(i))||[R.data.sourceAccount,R.data.recipientAccount].some(le=>ro(le).includes(n)))}function Pf(t,r,e){if(r===""||!t)return!0;let i=Math.round((yc(new Date(t)).getTime()-yc(e).getTime())/If);return r==="today"?i===0:r==="7d"?Math.abs(i)<=7:r==="30d"?Math.abs(i)<=30:!0}function yc(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}var Of=(t,r)=>r.index;function kf(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),v(e.items().length)}}function Ff(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 Pc=["to-approve","approved"],Oc=["q","account","type","date"],xa=(()=>{class t{constructor(){this.stateService=h(Je),this.actionService=h(oo),this.router=h(Ri),this.route=h(Jr),this.tabs=[{index:0,label:"Do podpisu",items:this.stateService.toApproveItems},{index:1,label:"Gotowe do realizacji",items:this.stateService.approvedItems}],this.filters=b(()=>Ac(wc(this.stateService.approvableItems()))),this.itemTotals=Ca,this.activeItems=b(()=>this.tabs[this.stateService.activeTabIndex()]?.items()??[]),this.visibleItems=b(()=>Mc(this.activeItems(),this.stateService.filterValues())),this.emptyMessage=b(()=>Ic(this.stateService.filterValues())?"Brak pozycji spe\u0142niaj\u0105cych filtry":"Brak element\xF3w do wy\u015Bwietlenia"),this.readQueryParams(),qi(()=>{let e=this.toQueryParams(this.stateService.activeTabIndex(),this.stateService.filterValues());Do(()=>this.router.navigate([],{relativeTo:this.route,queryParams:e,replaceUrl:!0}))})}ngOnInit(){this.stateService.loadApprovableItems()}switchToSignatures(){localStorage.removeItem(pn),this.router.navigate(["/",Bi,ln])}onTabChange(e){this.stateService.setActiveTabIndex(e),this.stateService.setSelectedItems([]),this.stateService.closeDetails()}
3readQueryParams(){let e=this.route.snapshot.queryParamMap,i=Pc.indexOf(e.get("tab"));i>0&&this.stateService.setActiveTabIndex(i);let n={};Oc.forEach(l=>{let _=e.get(l);_&&(n[l]=_)}),Object.keys(n).length>0&&this.stateService.setFilterValues(n)}toQueryParams(e,i){let n={tab:e>0?Pc[e]:null};return Oc.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:[Gt([Je,oo,ba,bi,Si,Ei])],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),oe(12,kf,4,3,"a",8,Of),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(_){return n.stateService.setFilterValues(_)}),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,Ff,1,1,"app-approval-details-view",14),o()),i&2){let l,_=se(15);p("panelOpen",n.stateService.activeItem()!==null),s(11),p("tabPanel",_),s(),ae(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:[Ie,Ct,ne,q,Qs,$s,Zs,qs,cc,pc,lc,_c,Tc],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 kc=(()=>{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 Fc=(()=>{class t{constructor(e){this.http=e}getBasementData(){return this.http.get(Ps)}static{this.\u0275fac=function(i){return new(i||t)(G(Mo))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var wr=(()=>{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"}),co([this.parameterService.getParameterAsString(Ze.BASEMENT_EXCHANGE_URL).pipe(po(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=cs.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>',_=new Blob([l],{type:"text/html"});e.location.href=URL.createObjectURL(_)}static{this.\u0275fac=function(i){return new(i||t)(G(kc),G(xi),G(Fc))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();function zf(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 Lf(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 Vf(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),v(e.errorMessage()),s(2),p("loading",e.loading())}}function jf(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 Rc=(()=>{class t{constructor(){this.currencyExchangeService=h(wr),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:[Gt([wr])],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,zf,4,0,"div",0)(5,Lf,8,0,"div",1)(6,Vf,11,2,"div",2)(7,jf,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 Nc=(()=>{class t{constructor(){this.quickRealizationService=h(Ml)}prepare(e){return this.quickRealizationService.prepare(e,ws)}perform(e){return this.quickRealizationService.perform(e,Is)}cancel(){return this.quickRealizationService.cancel(Ms)}authorize(e){let i=e.map(n=>String(n.id));return this.quickRealizationService.authorize(this,i,Il([],wl.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 Gf=["depositTreeTable"],Wf=["filterExpansionPanel"],Hf="type",Bc=(()=>{class t{constructor(e,i,n,l,_,D,R,le){this.dialog=e,this.notificationService=i,this.depositService=n,this.depositQuickRealizationAdapterService=l,this.userFacadeService=_,this.storage=D,this.spinnerService=R,this.errorProviderService=le,this.details=new Di,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=[$t],this.depositDialogEnum=Yn,this.createDepositPermission=!1,this.acceptPermission=!1,this.isRealizationAuthoritiesEnable=!1,this.destroy$=new pt,this.bundleErrors=h(bt),this.destroyRef=h(te),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 Fi({modificationDepositFC:this.modificationDepositFC,breakingDepositFC:this.breakingDepositFC,openingDepositFC:this.openingDepositFC,selectedAccountFC:this.selectedAccountFC}),this.setDefaultSearchingParameters();let ce="asc",me=Hf;Promise.all([this.storage.getItem(lr),this.storage.getItem(cr)]).then(([Ne,Be])=>{Ne&&Be&&(me=Ne,ce=Be)}
3).finally(()=>{this.tableProperties=this.depositService.tableProperties,this.tableProperties.matSortActive=me,this.tableProperties.matSortDirection=ce}),this.prepareFilteringCheckboxes()}ngAfterViewInit(){this.bundleErrors.registerListRefresh(()=>this.loadDataSource().subscribe(),this.destroyRef),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(vr,this.addConfig(e)).afterClosed().pipe(pe(n=>n),y(()=>this.loadDataSource())).subscribe()}openEditDialog(e){if(this.depositTreeTable.selection.selected[0].type===W.LOKATA_ZERWANIE){let i=new X;i.panelClass=be.SMALL,i.data={indexOfRow:this.indexOfRow,deposit:this.depositTreeTable.selection.selected[0]},this.dialog.open(Cr,i).afterClosed().pipe(y(()=>this.loadDataSource())).subscribe()}else this.dialog.open(vr,this.addConfig(e)).afterClosed().pipe(pe(n=>n),y(()=>this.loadDataSource())).subscribe()}openDeleteDialog(){let e=this.depositTreeTable.selection.selected[0],i=new X;i.panelClass=be.SMALL,e.depositType?(i.data={indexOfRow:this.indexOfRow,deposit:this.depositTreeTable.selection.selected[0]},this.dialog.open(Cr,i).afterClosed().pipe(pe(n=>n),y(()=>this.loadDataSource())).subscribe()):(i.data={title:"Usuwanie dyspozycji",message:"Czy na pewno chcesz usun\u0105\u0107 dyspozycj\u0119 ?"},this.dialog.open(xe,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=be.SMALL,e.data={title:"Potwierd\u017A przekazanie",message:"Czy na pewno chcesz przekaza\u0107 do podpisu?",details:this.depositTreeTable.selection.selected},this.dialog.open(xe,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=be.MEDIUM,n.data={indexOfRow:this.indexOfRow,deposit:this.depositTreeTable.selection.selected[0],dialogTitle:i},n}getDialogTitle(e){return e===Yn.CREATE_DEPOSIT?Yn.CREATE_DEPOSIT:Yn.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=Ot.prepareDeposits(e,i))).subscribe():this.details.rows=Ot.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(lr,this.depositTreeTable.matSortActive),this.storage.setItem(cr,this.depositTreeTable.matSortDirection)}),this.storage.getItem(sr).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(sr,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===hl.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)(g(he),g(K),g(yl),g(Nc),g(Oe),g(Mt),g(nt),g(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-deposits"]],viewQuery:function(i,n){if(i&1&&et(Gf,5)(Wf,5)(mn,5)(un,5),i&2){let l;ue(l=fe())&&(n.depositTreeTable=l.first),ue(l=fe())&&(n.filterExpansionPanel=l.first),ue(l=fe())&&(n.paginator=l.first),ue(l=fe())&&(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=se(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:[Qt,At,wt,It,_t,tt,gt,ot,at,rt,Dn,Pt,Jt,kt,We,je,Ti,ii],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 Rn=(function(t){return t.DETAILS="Poka\u017C szczeg\xF3\u0142y",t.SIGNATURES="Poka\u017C podpisy",t.WITHDRAWAL_CONFIRMATION="Potwierd\u017A wycofanie",t})(Rn||{});var Ir=(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})(Ir||{});var ya=(()=>{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(hi(()=>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===de.SIGNED)}isWithdrawSignEnabled(e){return e.every(i=>i.signState===Jo.I_SIGNED)}isWithdrawForEditEnabled(e){return e.every(i=>i.signState===Jo.CAN_SIGN?i.state!==de.SIGNED:i.signState===Jo.CAN_NOT_SIGN?i.state!==de.IN_SIGNING&&i.state!==de.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(Ol),G(Oe))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var qf=["executionTreeTable"],Zf=["filterExpansionPanel"];function Qf(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.isRequiredText)}}function Kf(t,r){if(t&1&&(a(0,"span"),c(1),o()),t&2){let e=d();s(),v(e.isRequiredText)}}var Lc="dateOfExecution",Vc=(()=>{class t{constructor(e,i,n,l,_,D,R,le,ce,me){this.formBuilder=e,this.executionsService=i,this.notificationService=n,this.signatureService=l,this.dialog=_,this.storage=D,this.buttonDisabledService=R,this.spinnerService=le,this.userFacadeService=ce,this.errorProviderService=me,this.sourceAccounts=[$t],this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.validatorUtils=Js,this.isRequiredText=Xs,this.executionDialogEnum=Rn,this.isWithdrawBtnEnabled=!1,this.isPrintBtnDisabled=!0,this.isShowSigBtnDisabled=!0,this.isDetail
3sBtnDisabled=!0,this.filteringCheckboxes=[],this.executionTypeEnum=Ir,this.rowDetails=[],this.destroy$=new pt,this.bundleErrors=h(bt),this.destroyRef=h(te),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 Ne="asc",Be=Lc;this.storage.getItem(ir).then(qe=>{qe&&(Be=qe),this.storage.getItem(nr).then($i=>{$i&&(Ne=$i)})}).finally(()=>{this.tableProperties={columnSettings:[{column:"type",caption:"Typ",stylePipeToken:Ai,stylePipeArgs:[],styleProp:"whiteListVerificationState",styleClass:"bold red",alternativeDataSource:{whenShouldUseAlternativeValue:qe=>M.isBundle(qe),getAlternativeValue(qe){return qe.name}},pipeToken:Ft,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:ea,pipeArgs:[!0,"row.virtual","row.dispositions"]},{column:Lc,caption:"Data wykonania",pipeToken:bl}],arrayHoldingProp:"dispositions",arrayHoldingPropCount:"dispositionsAmount",collapseBy:"id",matSortActive:Be,matSortDirection:Ne,matSortDisableClear:!0,bundleArrowIndicator:!1,sortParentId:"id",sortParents:!0,sortChildren:!1,expandable:!1}}),this.prepareFilteringCheckboxes()}ngOnInit(){this.bundleErrors.registerListRefresh(()=>this.updateExecutionsWithSubscribe(),this.destroyRef),this.getChargeableAccounts(),this.setDefaultValues(),this.initFiltersAndData()}updateExecutionsWithSubscribe(){this.updateExecutions().subscribe()}search(){this.storage.setItem(tr,this.executionFilterFG.value),this.updateExecutions().subscribe(),this.filterExpansionPanel.close()}resetValues(){this.executionFilterFG.reset(),this.setDefaultValues()}openDialog(e){let i=new X;switch(e){case Rn.DETAILS:i.autoFocus=!1,i.panelClass=be.LARGE,i.data={details:this.rowDetails},this.dialog.open(Ql,i);break;case Rn.SIGNATURES:let n=this.rowDetails[0]?.bundleId||this.rowDetails[0].id;this.signatureService.findSigningsForId(n).pipe(S(l=>{i.panelClass=l.signs?.length?be.MEDIUM:be.SMALL,i.data={title:Pl.COMPLETED_SIGNATURES,details:l},this.dialog.open(Al,i)}),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([]))).subscribe();break;case Rn.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(xe,i).afterClosed().pipe(pe(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===de.AWAITS,this.rowDetails[0].type===W.LOKATA_ZALOZENIE&&this.rowDetails[0].state===de.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(ir,this.executionTreeTable.matSortActive),this.storage.setItem(nr,this.executionTreeTable.matSortDirection)}),this.storage.getItem(tr).then(e=>{e&&this.executionFilterFG.patchValue(e)}).finally(()=>this.search())}constructBundleStates(){let e=[];return this.completedFC.value&&e.push(de.COMPLETED),this.rejectedFC.value&&e.push(de.REJECTED),this.partlyCompletedFC.value&&e.push(de.PARTLY_COMPLETED),this.accountingFC.value&&e.push(de.ACCOUNTING),this.inProgressFC.value&&e.push(de.IN_PROGRESS),this.suspendedFC.value&&e.push(de.SUSPENDED),this.awaitsFC.value&&e.push(de.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:Bt(qa(new Date,1),H),dateTo:Bt(rs(qa(new Date,1),1),H)})}getData(){return this.executionsService.getExecutions(this.getExecutionsFilter())}getExecutionsFilter(){let e=this.constructBundleStates();return{startDate:Pe.formatDateNoError(this.dateFromFC.value),endDate:Pe.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===de.IN_PROGRESS||i.state===de.NEW)}refreshSort(){this.executionTreeTable.showSortChange({active:this.executionTreeTable.matSortActive,direction:this.executionTreeTable.matSortDirection})}static{this.\u0275fac=function(i){return new(i||t)(g(Wt),g(na),g(K),g(oa),g(he),g(Mt),g(ya),g(nt),g(Oe),g(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-execution"]],viewQuery:function(i,n){if(i&1&&et(qf,5)(Zf,5),i&2){let l;ue(l=fe())&&(n.executionTreeTable=l.first),ue(l=fe())&&(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,Qf,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,Kf,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=se(18),_=se(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",_),s(),p("for",_),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:[Se,qt,Et,Qt,Dt,Tt,yt,At,wt,It,Ee,_t,Ce,Te,tt,Ve,gt,ot,at,rt,Pt,Jt,kt,We,je,ti,Xt,ii],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 Aa=(()=>{class t{constructor(e){this.gsmBoostsService=e}confirm(e){return this.gsmBoostsService.toSign(e)}static{this.\u0275fac=function(i){return new(i||t)(G(wi))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac})}}return t})();var Xf=t=>({"plain-table-row-highlight":t});function Jf(t,r){t&1&&(a(0,"mat-header-cell"),c(1,"Data"),o())}function e0(t,r){if(t&1&&(a(0,"mat-cell"),c(1),o()),t&2){let e=r.$implicit;s(),U(" ",e.dateOfExecution," ")}}
3function t0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Nr telefonu"),o())}function i0(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 n0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Kwota"),o())}function o0(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 a0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Rachunek obci\u0105\u017Cany"),o())}function r0(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 s0(t,r){t&1&&(a(0,"mat-header-cell",17),c(1,"Stan"),o())}function l0(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 c0(t,r){t&1&&C(0,"mat-header-row")}function p0(t,r){if(t&1){let e=F();a(0,"mat-row",18),m("click",function(n){let l=P(e).$implicit,_=d();return O(_.rowClickHandler(l,n))}),o()}if(t&2){let e=r.$implicit,i=d();p("ngClass",Eo(1,Xf,i.selection.selected.includes(e)))}}var d0="data",jc=(()=>{class t{constructor(e,i,n,l,_,D){this.gsmService=e,this.quickRealizationService=i,this.dialog=n,this.storage=l,this.spinnerService=_,this.errorProviderService=D,this.displayedColumns=["dateOfExecution","phoneNumber","amount","sourceAccount","state"],this.selection=new hs(!0,[]),this.resultsLength=0,this.pageSizeOptions=tl,this.pageSize=il,this.matSortDirection="asc",this.matSortActive=d0,this.loading=!1,this.selectedItems=[],this.destroy$=new pt,this.bundleErrors=h(bt),this.destroyRef=h(te),this.dataSource=new Qn,this.enablers={addEnabled:!1,deleteEnabled:!1,editEnabled:!1,quickExecutionEnabled:!1,toSignEnabled:!1},Promise.all([this.storage.getItem(ur),this.storage.getItem(fr)]).then(([R,le])=>{R&&le&&(this.matSortActive=R,this.matSortDirection=le)})}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.bundleErrors.registerListRefresh(()=>this.refreshData().subscribe(),this.destroyRef),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(Yl,{autoFocus:!0,panelClass:be.MEDIUM,data:i}).afterClosed()}),pe(i=>i),y(()=>(this.getEnablerConfig(),this.refreshData())),hi(()=>{let i=new X;return i.panelClass=be.SMALL,i.data={title:E.ERROR,message:`${E.MAJOR_ERROR_OCCURED} ${E.CANNOT_PERFORM_OPERATION}`},this.dialog.open(ml,i),ze})).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 Aa(this.gsmService)},this.dialog.open(xe,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(Kl,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(ur,this.matSortActive),this.storage.setItem(fr,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)(g(wi),g(kl),g(he),g(Mt),g(nt),g(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-gsm-boosts"]],viewQuery:function(i,n){if(i&1&&et(mn,5)(un,7),i&2){let l;ue(l=fe())&&(n.paginator=l.first),ue(l=fe())&&(n.sort=l.first)}},hostBindings:function(i,n){i&1&&m("keydown",function(_){return n.handleKeyboardEvent(_)},zr)},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(_){return n.showSortChange(_)}),_e(16,6),Z(17,Jf,2,0,"mat-header-cell",7)(18,e0,2,1,"mat-cell",8),ge(),_e(19,9),Z(20,t0,2,0,"mat-header-cell",10)(21,i0,3,3,"mat-cell",8),ge(),_e(22,11),Z(23,n0,2,0,"mat-header-cell",10)(24,o0,3,3,"mat-cell",8),ge(),_e(25,12),Z(26,a0,2,0,"mat-header-cell",10)(27,r0,3,3,"mat-cell",8),ge(),_e(28,13),Z(29,s0,2,0,"mat-header-cell",10)(30,l0,3,4,"mat-cell",8),ge(),Z(31,c0,1,0,"mat-header-row",14)(32,p0,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:[Ao,mn,un,Ws,fn,_n,bn,gn,hn,Sn,vn,Cn,En,xn,Ce,ot,at,rt,Pt,je,J,$,Yo,Cl],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 f0=["signatureTreeTable"],h0=["filterExpansionPanel"];function _0(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 Uc="dateOfExecution",Wc=(()=>{class t{constructor(e,i,n,l,_,D,R,le,ce,me,Ne,Be,qe,$i,Ba,za){this.signatureService=e,this.signatureApiService=i,this.accountService=n,this.formBuilder=l,this.notificationService=_,this.signatureDialog=D,this.storage=R,this.signatureButtonDisabledService=le,this.spinnerService=ce,this.errorProviderService=me,this.parameterService=Ne,this.userFacadeService=Be,this.dispositionApiService=qe,this.sorbnetValidationService=$i,this.router=Ba,this.perLoginParameterService=za,this.sourceAccounts=[$t],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.bundleErrors=h(bt),this.destroyRef=h(te),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 Bn="asc",zn=Uc;this.storage.getItem(ar).then(Fe=>{Fe&&(zn=Fe),this.storage.getItem(rr).then(Ln=>{Ln&&(Bn=Ln)})}).finally(()=>{this.tableProperties={columnSettings:[{column:"type",caption:"Typ",stylePipeToken:Ai,stylePipeArgs:[],styleProp:"whiteListVerificationState",styleClass:"bold red",alternativeDataSource:{whenShouldUseAlternativeValue:Fe=>M.isBundle(Fe),getAlternativeValue(Fe){return Fe.name}},pipeToken:Ft,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:Fe=>M.isBundle(Fe),getAlternativeValue:Fe=>`Rachunek obci\u0105\u017Cany: ${Fe.sourceAccount}`},cellClass:"x-start",styleProperties:[{attribute:"min-width",value:"200px"}]},{column:"state",caption:"Stan",pipeToken:_l,pipeArgs:["row.signState","row.bundleState"],styleProperties:[{attribute:"min-width",value:"200px"}]},{column:Uc,caption:"Data wykonania",pipeToken:re,pipeArgs:[H],styleProperties:[{attribute:"min-width",value:"125px"}]}],arrayHoldingProp:"dispositions",arrayHoldingPropCount:"dispositionsAmount",collapseBy:"id",bundleArrowIndicator:!1,matSortActive:zn,matSortDirection:Bn,matSortDisableClear:!0,sortParentId:"id",sortParents:!0,sortChildren:!1,expandable:!1}}),this.prepareFilteringCheckboxes()}ngOnInit(){this.bundleErrors.registerListRefresh(()=>this.refreshData(),this.destroyRef),this.setSorbnetDeadline(),this.checkPermissionForTopUpGSM(),this.getChargeableAccounts(),this.initFiltersAndData()}switchToApprovals(){localStorage.setItem(pn,"true"),this.router.navigate(["/",Bi,cn])}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(or,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:Wa.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(pe(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:Wa.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(pe(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(){lo([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(ar,this.signatureTreeTable.matSortActive),this.storage.setItem(rr,this.signatureTreeTable.matSortDirection)}),this.storage.getItem(or).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)(g(oa),g(es),g(ei),g(Wt),g(K),g(wn),g(Mt),g(ya),g(nt),g(Y),g(xi),g(Oe),g(Xi),g(Qo),g(Ri),g(Vi))}}static{this.\u0275cmp=x({type:t,selectors:[["app-signature"]],viewQuery:function(i,n){if(i&1&&et(f0,5)(h0,5),i&2){let l;ue(l=fe())&&(n.signatureTreeTable=l.first),ue(l=fe())&&(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,_0,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=se(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:[Qt,At,wt,It,q,_t,tt,gt,ot,at,rt,Pt,Jt,kt,We,je,ti,Xt,ii,wo],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 wa=class{constructor(r){this.apiService=r}confirm(r){let e=r.map(i=>i.id);return this.apiService.toSigning(e)}};var Hc=(()=>{class t{constructor(e,i){this.dialog=e,this.standingOrderApiService=i,this.tableProperties={columnSettings:[{column:"type",caption:"Typ",pipeToken:Ft,pipeArgs:["row.sorbnet"],cellClass:"x-start"},{column:"sourceAccount",caption:"Rachunek \u017Ar\xF3d\u0142owy",pipeToken:J,pipeArgs:[$n],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:Yo,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=be.LARGE,l.data={dialogVariant:n,details:i,isEdit:e},this.dialog.open(_r,l).afterClosed()}openDeleteOrderDialog(e){let i=new X;return i.panelClass=be.LARGE,i.data={dialogVariant:e[0].standingOrderType,details:e,isEdit:!0,isDelete:!0},this.dialog.open(_r,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(xe,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 wa(this.standingOrderApiService)},this.dialog.open(xe,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(xe,i).afterClosed().pipe(L(n=>n.state))}determineIfParent(e){return!!e.dispositions}checkForExpiredStartDate(e){return e.some(i=>Pe.isBeforeToday(i.startDate))}checkForExpiredExecutionDate(e){return e.some(i=>Pe.isBeforeToday(i.executionDate))}isBundle(e){return!!e?.dispositions}isNew(e){return e.state===de.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(he),G(Kn))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var v0=["standingOrderTreeTable"],C0=["filterExpansionPanel"];function b0(t,r){t&1&&C(0,"span")}var $c=(()=>{class t{constructor(e,i,n,l,_,D,R,le,ce){this.standingOrderApiService=e,this.accountService=i,this.formBuilder=n,this.notificationService=l,this.standingOrderService=_,this.quickRealizationService=D,this.storage=R,this.spinnerService=le,this.errorProviderService=ce,this.sourceAccounts=[$t],this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.dialogTypeEnum=Hn,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.bundleErrors=h(bt),this.destroyRef=h(te),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 Di;let me="asc",Ne="type";Promise.all([this.storage.getItem(dr),this.storage.getItem(mr)]).then(([Be,qe])=>{Be&&qe&&(Ne=Be,me=qe)}).finally(()=>{this.tableProperties=this.standingOrderService.tableProperties,this.tableProperties.matSortActive=Ne,this.tableProperties.matSortDirection=me}),this.prepareFilteringCheckboxes()}ngOnInit(){this.bundleErrors.registerListRefresh(()=>this.refreshData().subscribe(),this.destroyRef),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(pe(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(pe(i=>i),y(()=>Va(this.rowDetails).pipe(Fr(i=>this.standingOrderApiService.deleteDisposition(i)),kr(),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(pe(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(dr,this.standingOrderTreeTable.matSortActive),this.storage.setItem(mr,this.standingOrderTreeTable.matSortDirection)}),Va(this.storage.getItem(pr)).pipe(S(e=>{e?this.standingOrderFG.patchValue(e):this.resetValues()}),y(()=>this.refreshData())).subscribe()}refreshData(){return this.storage.setItem(pr,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):ze}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=Ot.prepareStandingOrderDetails(i)}),hi(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=Ot.prepareStandingOrderDetails(e)}getTableData(){let e=this.fetchStandingOrders().pipe(ja(),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([]))),i=this.fetchStandingOrderBundles().pipe(ja(),L(n=>M.extractDispositionsFromStandingOrderBundles(n)),this.errorProviderService.processError(E.FETCHING_DATA_ERROR,z([])));return co([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(Hn.STANDING_ORDER_OPENING),this.modificationFC.value&&e.push(Hn.STANDING_ORDER_MODIFICATION),this.deletionFC.value&&e.push(Hn.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)(g(Kn),g(ei),g(Wt),g(K),g(Hc),g(Fl),g(Mt),g(nt),g(Y))}}static{this.\u0275cmp=x({type:t,selectors:[["app-standing-order"]],viewQuery:function(i,n){if(i&1&&et(v0,5)(C0,5),i&2){let l;ue(l=fe())&&(n.standingOrderTreeTable=l.first),ue(l=fe())&&(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,b0,1,0,"ng-template",null,2,Wr)),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:[Se,Me,Qt,At,wt,It,Ee,_t,Ce,Te,tt,Ve,gt,ot,at,rt,Dn,Pt,Jt,kt,We,je,ti,Xt,Ti,ii],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 Ia=(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})(Ia||{});var Ma=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 Pa=class{constructor(r){this.acceptTransferService=r}confirm(r){let e=M.mapBundlesToIdList(r);return this.acceptTransferService.toSign(e)}};var Oa=(()=>{class t{constructor(e,i,n,l,_,D,R){this.dialog=e,this.packagesService=i,this.dispositionApiService=n,this.transferDialogService=l,this.acceptTransferService=_,this.errorProcessingService=D,this.notificationService=R}openDialog(e,i,n){let l;return i&&(l=n.filter(_=>_.accountNumber===i?.sourceAccount)[0]?.accountId||void 0),this.transferDialogService.openDialog(e,Zo.newWithBundleId(i,l),Zn.NEW).afterClosed().pipe(L(_=>!!_))}openPackageDialog(){let e=new X;return e.panelClass=be.LARGE,e.data={title:Ge.CREATE_BUNDLE_TITLE},this.dialog.open(br,e).afterClosed().pipe(L(i=>!!i))}openEditionDialog(e){if("virtual"in e&&e.virtual!==void 0&&e.type===An.TRANSFER){let i=new X;return i.data={title:Ge.EDIT_BUNDLE_TITLE,bundle:e},this.dialog.open(br,i).afterClosed().pipe(this.mapToBoolean())}return this.acceptTransferService.getTransferData(e.id.toString()).pipe(y(i=>this.transferDialogService.openDialog(Tn.parse(e.type),i,Zn.EDIT).afterClosed().pipe(this.mapToBoolean())))}openImportDialog(e,i,n){let l={transferFileType:e,bundles:i,selectedBundle:n};return this.dialog.open($l,{minWidth:"40%",data:l,disableClose:!0}).afterClosed().pipe(this.mapToBoolean())}openImportSalaryDialog(e){let i={transferFileType:e};return this.dialog.open(ql,{panelClass:be.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 Ma(this.packagesService,this.dispositionApiService)},this.dialog.open(xe,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 Pa(this.acceptTransferService),errorMessage:i},this.dialog.open(xe,n).afterClosed().pipe(S(l=>{if(!l.state&&l.error){let _=l.error.msgInfo.map(D=>us.removeTrashBracketDataFromError(D.messageKey));this.showNotification(e.length-l.error.msgInfo.length,l.error.msgInfo.length,_)}}),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 zo(El,{successCount:e,invalidCount:i,errorMessages:n})};this.notificationService.warningWithHTML(l)}static{this.\u0275fac=function(i){return new(i||t)(G(he),G(ra),G(Xi),G(Xo),G(yn),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 ke=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,_=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 ka=class{static getParentFromTargetRow(r,e){if("bundleId"in e)return r.find(i=>i.id===e.bundleId);throw new Cs}};var Fa=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:ke.targetRowIsDispositionInBundle(this.target)?ka.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)&&!ke.dispositionsAreInTheSameBundle(this.target,i
3),l=M.isBundle(i)&&!ke.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)&&!ke.dispositionsAreInTheSameBundle(this.target,i),l=M.isBundle(this.target)&&!ke.dispositionIsInBundle(i,this.target);return n||l}getRowIndex(r){return this.allRows.indexOf(r)}getRowByIndex(r){return this.allRows[r]}};var Zc="MAT-ROW",x0="BODY",Hi=class t{static findMatRowElement(r){for(;r!==null&&r.tagName!==(Zc||x0);)r=r.parentElement;if(r?.tagName===Zc)return r;throw new vs}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 D0=`Przeniesienie wybranych przelew\xF3w powoduje zmian\u0119 rachunku \u017Ar\xF3d\u0142owego niekt\xF3rych z nich. 4 Czy na pewno chcesz to zrobi\u0107?`,Ra=(()=>{class t{constructor(e,i){this.acceptTransferService=e,this.dialog=i}move({rowsToMove:e,target:i}){return i===null?this.moveRowsOutside(e):ke.theyHaveDifferentSourceAccounts(e,i)?this.showWarningDialog().pipe(pe(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:D0},this.dialog.open(xe,e).afterClosed().pipe(L(i=>i.state))}static{this.\u0275fac=function(i){return new(i||t)(G(yn),G(he))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Nn=(()=>{class t{constructor(){this.draggedRow=new La(null),this.draggedOverElement=new La(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 Na=(()=>{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=h(xi),this.bankIds=ms(this.parameterService.getParameterAsStringArray(Ze.BANK_IDS),{initialValue:[]})}handleDragOver({event:e,row:i}){this.handleDragOverRow=i,this.areaOfHoverElement=Hi.getDragOverArea(e);let n=this.actualHoverElement;this.actualHoverElement=Hi.findMatRowElement(e.target),Hi.toggleHoverElementsClasses(n,this.actualHoverElement,this.areaOfHoverElement)}handleDrop({selection:e,dataSource:i,targetRow:n}){let l=this.store.getDraggedRowValue();if(Hi.removeOldClassName(this.actualHoverElement),ke.ifTryToMoveVirtualToVirtual(e,l,n))return ze;if(ke.shouldShowSameTargetAndSourceAccountWarning(n,e,l))return this.notification.error(E.TARGET_ACCOUNT_SAME_AS_BUNDLE_SOURCE_ACCOUNT_WARNING),ze;let _={target:n,allRows:i.data,hoverRow:this.handleDragOverRow,hoverArea:this.areaOfHoverElement},D=new Fa(_).get(),R=this.getDraggedRowDiffersThanTargetRow(l,e.selected,D);return R.length?ke.shouldBlockExternalTransferToForeignSourceAccount(R,D,this.bankIds())?(this.notification.error(E.EXTERNAL_TRANSFER_FOREIGN_SOURCE_ACCOUNT_WARNING),ze):this.moveItemService.move({rowsToMove:R,target:D}).pipe(this.errorProviderService.processError(E.ERROR_OCCURED)):ze}getDraggedRowDiffersThanTargetRow(e,i,n){return ke.atLeastTwoRowsAreSelected(i)?ke.getSelectedWithoutTargetRow(i,n):ke.draggedRowIsNotTargetRow(e,n)&&ke.dropIntoDifferBundle(e,n)?[e]:[]}static{this.\u0275fac=function(i){return new(i||t)(G(Ra),G(K),G(Nn),G(Y))}}static{this.\u0275prov=k({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var A0=["acceptTransferTreeTable"],w0=["filterExpansionPanel"];function I0(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 Kc="dateOfExecution",Yc=(()=>{class t{constructor(e,i,n,l,_,D,R,le,ce,me,Ne,Be,qe,$i,Ba,za){this.formBuilder=e,this.transfersService=i,this.transferImportService=n,this.dialogService=l,this.quickRealizationAdapterService=_,this.userFacadeService=D,this.storage=R,this.dragAndDropService=le,this.dragAndDropStore=ce,this.spinnerService=me,this.whiteListService=Ne,this.errorProviderService=Be,this.notificationService=qe,this.signatureDialog=$i,this.dispositionApiService=Ba,this.sorbnetValidationService=za,this.details=new Di,this.sourceAccountLabel="Rachunek \u017Ar\xF3d\u0142owy",this.accountTypes=[$t],this.transferTypeEnum=li,this.TransferFileType=Ys,this.ButtonThemeType=rl,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=Ia,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.bundleErrors=h(bt),this.destroyRef=h(te),this.searchSubject=ne
4w pt,this.parameterService=h(xi),this.perLoginParameterService=h(Vi),this.foreignTransferLabel=this.perLoginParameterService.get(Ze.TRANSFER_FOREIGN_CURRENCY_TRANSFER_ENABLED).pipe(L(Boolean),L(Fe=>Fe?"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 Bn="asc",zn=Kc;this.sorbnetDispositions=[],this.storage.getItem(Ja).then(Fe=>{Fe&&(zn=Fe),this.storage.getItem(er).then(Ln=>{Ln&&(Bn=Ln)})}).finally(()=>{this.tableProperties={columnSettings:[{column:"name",caption:"Nazwa",stylePipeToken:Ai,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:Fe=>M.isBundle(Fe),getAlternativeValue:()=>"-"}},{column:Kc,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:[$n],cellClass:"x-start ",styleProperties:[{attribute:"min-width",value:"15.5rem"},{attribute:"max-width",value:"16.0rem"}]},{column:"type",caption:"Typ",pipeToken:Ft,pipeArgs:["row.sorbnet"],styleProperties:[{attribute:"min-width",value:"9rem"},{attribute:"max-width",value:"11rem"}]}],arrayHoldingProp:"dispositions",arrayHoldingPropCount:"dispositionsAmount",collapseBy:"id",matSortActive:zn,matSortDirection:Bn,matSortDisableClear:!0,sortParentId:"id",sortParents:!0,sortChildren:!0,tableClasses:"mat-elevation-z3",draggable:{enable:!0,excludeRowsBy:"bundleId"}}}),this.transferTypeNameEnum=Ia,this.prepareFilteringCheckboxes()}ngOnInit(){this.bundleErrors.registerListRefresh(()=>this.getDataAndCheckAuthorities().subscribe(),this.destroyRef),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(Xa,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):ze)))).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(li.US_CLO),this.internationalFC.value&&e.push(li.INTERNATIONAL),this.instantFC.value&&e.push(li.INSTANT),this.vatInvoiceFC.value&&e.push(li.VAT_INVOICE),this.commonFC.value&&e.push(li.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(_=>_.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=Ot.prepareBundleSummary(ia.calculate(e,i),e.length)}fetchBundleDetailsForSelected(e){let i=e[0];this.transfersService.getBundleDetails(i.id).pipe(S(n=>{this.details.rows=Ot.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=Ot.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!==cl.NO_CHECK&&e[0]?.whiteListVerificationState!==ll.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(Rr(900),Nr(()=>{let e=this.acceptTransferTreeTable.selection.selected;return this.quickRealizationAdapterService.checkEnabled(M.mapBundlesToIdList(e)).pipe(hi(()=>z(!1)),ee(()=>{let i=this.acceptTransferTreeTable.selection.selected;i.length!==0&&e!==i&&this.searchSubject.next(i)}),pe(()=>e===this.acceptTransferTreeTable.selection.selected))})).subscribe(e=>{this.quickRealizationBtnEnabled=e,this.quickRealizationLoading=!1})}initFiltersAndData(){ht(ft(window,"beforeunload"),this.destroy$).subscribe(()=>{this.storage.setItem(Ja,this.acceptTransferTreeTable.matSortActive),this.storage.setItem(er,this.acceptTransferTreeTable.matSortDirection)}),this.storage.getItem(Xa).then(e=>{e&&this.acceptFilterFG.patchValue(e)}).finally(()=>this.getDataAndCheckAuthorities().subscribe())}setSorbnetDeadline(){lo([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(pe(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,ze,!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&&Pe.isBeforeToday(i.dateOfExecution)||i.finalExecuteDate&&Pe.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)(g(Wt),g(yn),g(yi),g(Oa),g(Rl),g(Oe),g(Mt),g(Na),g(Nn),g(nt),g(ta),g(Y),g(K),g(wn),g(Xi),g(Qo))}}static{this.\u0275cmp=x({type:t,selectors:[["app-accept-transfer"]],viewQuery:function(i,n){if(i&1&&et(A0,5)(w0,5),i&2){let l;ue(l=fe())&&(n.acceptTransferTreeTable=l.first),ue(l=fe())&&(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,I0,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(_){return n.handleDragStart(_)})("handleDropEvent",function(_){return n.handleDrop(_)})("handleDragOverEvent",function(_){return n.handleDragOver(_)})("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=se(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:[Se,Me,Qt,At,wt,It,Ee,_t,Ce,Te,tt,Kr,Ve,ot,at,rt,Dn,Pt,Jt,kt,We,je,ti,Xt,Ti,ii,wo],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 M0=[{path:"",component:xl,canActivateChild:[Tl,Jl],data:{authorities:[Q.FUNC_EXECUTE],authorityCheckType:Os.ANY},children:[{path:"",redirectTo:Ya},{path:Ya,component:$c},{path:Vo,component:Bc},{path:jo,component:jc},{path:Uo,component:Yc},{path:Ds,component:Vc},{path:Ts,component:Rc},{path:ln,component:Wc,canActivate:[ec]},{path:cn,component:xa,canActivate:[tc]}]}],Xc=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fo({type:t})}static{this.\u0275inj=mo({imports:[Ga.forChild(M0),Ga]})}}return t})();var A2=(()=>{class t{static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275mod=fo({type:t})}static{this.\u0275inj=mo({providers:[Aa,wn,pa,Mn,Oa,Nn,Na,Ra],imports:[Le,Ks,Xr,Xc,Gs,Yi,He,Dl,xa]})}}return t})();export{A2 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.