dealposbooks 5.43.0 → 5.43.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/{chunk-Q6NOUY4Z.js → chunk-5QKCUI7M.js} +1 -1
  2. package/{chunk-O5EVYQVN.js → chunk-5TF7YHMI.js} +1 -1
  3. package/{chunk-DG63C6O3.js → chunk-5VXLWX4K.js} +1 -1
  4. package/{chunk-7PDMDNJK.js → chunk-62K4JEOY.js} +1 -1
  5. package/{chunk-X4KTMWVO.js → chunk-6O5EWYT7.js} +1 -1
  6. package/{chunk-4FPYSVLT.js → chunk-6XT4TD5A.js} +1 -1
  7. package/{chunk-MDMGBODU.js → chunk-6YJVOMOB.js} +1 -1
  8. package/{chunk-WLKS6LBU.js → chunk-7COI2POD.js} +1 -1
  9. package/{chunk-VTMQTY2F.js → chunk-7EIBD6QJ.js} +1 -1
  10. package/{chunk-MJJXITD5.js → chunk-7GIBHGH4.js} +1 -1
  11. package/chunk-AF357XP4.js +1 -0
  12. package/{chunk-CX3TZ3F3.js → chunk-BUYRVZ5Z.js} +1 -1
  13. package/{chunk-2DSX3KAL.js → chunk-BWJHODYX.js} +2 -2
  14. package/chunk-CIVJWHAU.js +202 -0
  15. package/{chunk-UYGD5VP2.js → chunk-DQQKEX6Z.js} +1 -1
  16. package/{chunk-AUWCRG4B.js → chunk-DXRSED76.js} +1 -1
  17. package/{chunk-3MDAGJGX.js → chunk-EQ7DUTAS.js} +1 -1
  18. package/{chunk-KBXNDYNF.js → chunk-ESHOCSRS.js} +1 -1
  19. package/chunk-FDBRUAV5.js +1 -0
  20. package/chunk-FEV4P4DL.js +7 -0
  21. package/{chunk-ROJ6NA2I.js → chunk-GQI7GXAK.js} +1 -1
  22. package/{chunk-Q2RQ5PCS.js → chunk-GZRKRXV7.js} +1 -1
  23. package/chunk-HW2B6ZTB.js +129 -0
  24. package/{chunk-3XWJYJ4W.js → chunk-I7G575WF.js} +1 -1
  25. package/{chunk-HEX727RH.js → chunk-IYO6P6XI.js} +1 -1
  26. package/{chunk-EOT2WEXN.js → chunk-JUCJGYST.js} +1 -1
  27. package/{chunk-PNDE7M5T.js → chunk-LCZ3RU6J.js} +1 -1
  28. package/{chunk-MWKQV6FL.js → chunk-MERIFED5.js} +1 -1
  29. package/{chunk-FFBH7KYD.js → chunk-N3CCHUQK.js} +1 -1
  30. package/{chunk-4TSB6554.js → chunk-N72GOCDS.js} +2 -2
  31. package/{chunk-JRH7ZWIT.js → chunk-OB7IGUCM.js} +1 -1
  32. package/{chunk-O6C3N77O.js → chunk-ONN4TIOR.js} +1 -1
  33. package/{chunk-MGTSVSFN.js → chunk-OZ4T5P3A.js} +1 -1
  34. package/{chunk-4JVYK7DR.js → chunk-P2BR2DYT.js} +1 -1
  35. package/{chunk-6MOKBNZ6.js → chunk-PBMTWCM7.js} +1 -1
  36. package/{chunk-BJ4RON42.js → chunk-PPKCZMH4.js} +1 -1
  37. package/{chunk-6EDSP2AA.js → chunk-PZAVQQFP.js} +12 -12
  38. package/{chunk-J2LCCQ6P.js → chunk-RIAHEVKE.js} +1 -1
  39. package/{chunk-B4JW5G5L.js → chunk-RJSTA3LD.js} +1 -1
  40. package/{chunk-J7XLDEPN.js → chunk-RZVVQ2WV.js} +1 -1
  41. package/{chunk-VNUZJSHB.js → chunk-SJCXXNYW.js} +1 -1
  42. package/{chunk-WPQGYVNT.js → chunk-SVHOGUGR.js} +1 -1
  43. package/{chunk-X6D7ZE6G.js → chunk-TLGBF4OA.js} +1 -1
  44. package/chunk-TNMWSTYV.js +1 -0
  45. package/chunk-TRUGVHVM.js +1 -0
  46. package/chunk-TUX7WEBX.js +2 -0
  47. package/{chunk-6WBZACEK.js → chunk-VF3ARYUC.js} +1 -1
  48. package/{chunk-7R6GFW7F.js → chunk-VHKLRJNY.js} +1 -1
  49. package/{chunk-KLKIEREL.js → chunk-VPQDUC77.js} +1 -1
  50. package/{chunk-HVXMIONQ.js → chunk-WAIG32DS.js} +1 -1
  51. package/{chunk-5CI4POVW.js → chunk-XA75ROED.js} +1 -1
  52. package/{chunk-SUKZ6XS4.js → chunk-XFMPZEYT.js} +1 -1
  53. package/{chunk-XYU7C523.js → chunk-XIKOS3R2.js} +1 -1
  54. package/chunk-XIUI7VXN.js +160 -0
  55. package/{chunk-M3WCSF6D.js → chunk-XMHQMMFC.js} +1 -1
  56. package/{chunk-NDWYDOFG.js → chunk-YQGBYYHV.js} +1 -1
  57. package/{chunk-EM4HKTKQ.js → chunk-ZE2UEAPO.js} +1 -1
  58. package/{chunk-LT3ZB5UZ.js → chunk-ZJ2QSE55.js} +1 -1
  59. package/index.html +2 -2
  60. package/{main-2JJLKGIJ.js → main-3LQSSUNF.js} +1 -1
  61. package/package.json +1 -1
  62. package/chunk-23R63A5E.js +0 -1
  63. package/chunk-3TIJYNSV.js +0 -2
  64. package/chunk-6JKCYLO5.js +0 -202
  65. package/chunk-GKFRKDT6.js +0 -7
  66. package/chunk-IY4CV424.js +0 -1
  67. package/chunk-ORLKNWW4.js +0 -1
  68. package/chunk-SVFKNAYN.js +0 -160
  69. package/chunk-UCCAYD3A.js +0 -129
  70. package/chunk-ZIEHNLX3.js +0 -1
package/chunk-6JKCYLO5.js DELETED
@@ -1,202 +0,0 @@
1
- import{a as ee,b as yt}from"./chunk-FFBH7KYD.js";import{a as xt}from"./chunk-G4XX7EU2.js";import{f as Ct}from"./chunk-OB46Z7ZH.js";import"./chunk-E3ZGQRZ3.js";import{a as bt}from"./chunk-XKI7WLHE.js";import{a as ot}from"./chunk-ORLKNWW4.js";import"./chunk-WLKS6LBU.js";import{a as X,b as Y}from"./chunk-NHZLS6JU.js";import{d as ft,i as ht,j as gt,k as wt}from"./chunk-KLKIEREL.js";import"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import{a as ue}from"./chunk-KXE3J4PK.js";import"./chunk-EOT2WEXN.js";import{a as ut,b as _t}from"./chunk-X4KTMWVO.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import"./chunk-SPKOXGSS.js";import"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import{h as dt}from"./chunk-O5EVYQVN.js";import{a as Je}from"./chunk-L3PZS6EL.js";import{a as nt,b as rt}from"./chunk-5JV52UYK.js";import{a as D,b as at,c as st,d as lt,e as pt,f as ct,g as mt}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{a as Ke,f as L,k as Xe,m as Ye,o as et,s as tt,w as J,x as it}from"./chunk-7FFMPB6T.js";import"./chunk-UKBDY33R.js";import{A as qe,C as Ge,K as je,La as Ze,Ma as K,Ua as We,c as W,e as Ae,f as Be,l as He,ma as $e,o as Ne,u as Qe,x as ze,z as de}from"./chunk-72LNXEXV.js";import{b as Re,d as Le,e as Me}from"./chunk-EFDD6Q3K.js";import"./chunk-M3WCSF6D.js";import"./chunk-ZDTMCWOO.js";import{c as Oe,d as se,f as le,h as pe,i as ce,k as me}from"./chunk-F2X3VGZZ.js";import{h as j,k as $,m as Pe,s as Z}from"./chunk-SB5MSLCX.js";import{$b as T,$c as Fe,Aa as A,Bb as H,Cc as G,Db as _,Ec as V,Fc as Ee,Ha as R,Jc as Ue,Kb as E,Lb as s,Ob as xe,Pb as ne,Qb as Ce,Rb as N,Rc as x,Tb as Q,Ub as z,Vb as l,Wb as p,Xb as y,Y as O,Yb as ye,Zb as ve,_ as te,_b as U,_c as I,bd as P,c as M,ca as ge,cd as Ve,da as we,ec as b,fc as c,gc as ke,hb as a,hc as Te,ia as C,kc as F,lc as q,mc as v,nc as k,qa as d,qc as Se,ra as u,rc as g,sc as S,tc as Ie,ua as ie,vc as De,wc as re,xb as B,xc as oe,yb as be,yc as ae}from"./chunk-6K5LNQ4J.js";import{a as f,b as h}from"./chunk-YQFG5XE2.js";var Tt={data:[],count:0,filter:{pagination:1,pageSize:10,groupID:null,text:""},meta:{filter:{pagination:1,pageSize:10,groupID:null,text:""},options:{groups:[]}},metaForm:{form:{id:"",groupID:"",accessTypeID:1},options:{users:[],groups:[],accessTypes:[]}}},_e=at(mt("UserStore"),ct(Tt),st(t=>({first:P(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:P(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:P(()=>t.data().some(o=>o.checked)),checkedData:P(()=>t.data().filter(o=>o.checked).map(o=>o.userID)),selectedID:P(()=>t.data().find(o=>o.checked)?.userID||null)})),pt(t=>{let o=C(ee);return{setFilter(n){D(t,i=>h(f({},i),{filter:n}))},onRowSelect(n){D(t,i=>{let r=i.data.map(m=>m.userID===n.userID?h(f({},m),{checked:!0}):m);return h(f({},i),{data:r})})},onRowUnselect(n){D(t,i=>{let r=i.data.map(m=>m.userID===n.userID?h(f({},m),{checked:!1}):m);return h(f({},i),{data:r})})},onHeaderCheckboxToggle(n){let i=localStorage.getItem("AUTH_USERNAME");D(t,r=>{let m=r.data.map(w=>w.userName!==i?h(f({},w),{checked:n}):h(f({},w),{checked:!1}));return h(f({},r),{data:m})})},getUserLoader:X(M(O(()=>o.getUserLoaderList().pipe(Y({next:n=>{D(t,i=>h(f({},i),{meta:n}))},error:n=>{console.error("Failed to fetch user loader list:",n)}}))))),getUserFormMeta:X(M(O(n=>o.getUserFormMeta(n).pipe(Y({next:i=>{D(t,r=>h(f({},r),{metaForm:i}))},error:i=>{console.error("Failed to fetch user form meta:",i)}}))))),getUsers:X(M(O(n=>o.getUsers(n).pipe(Y({next:i=>{D(t,r=>h(f({},r),{data:i.data.map(m=>h(f({},m),{checked:!1})),count:i.count}))},error:i=>{console.error("Failed to fetch users:",i)}})))))}}),lt({onInit:t=>{t.getUserLoader(),t.getUsers(t.filter)}}));var Dt=["header"],Et=["footer"],Ut=["content"],Ft=["closeicon"],Vt=["headless"],Pt=["maskRef"],Rt=["container"],Lt=["closeButton"],Mt=["*"],Ot=(t,o,e,n,i,r)=>({"p-drawer":!0,"p-drawer-active":t,"p-drawer-left":o,"p-drawer-right":e,"p-drawer-top":n,"p-drawer-bottom":i,"p-drawer-full":r}),At=(t,o)=>({transform:t,transition:o}),Bt=t=>({value:"visible",params:t});function Ht(t,o){t&1&&U(0)}function Nt(t,o){if(t&1&&_(0,Ht,1,0,"ng-container",4),t&2){let e=c(2);s("ngTemplateOutlet",e.headlessTemplate||e._headlessTemplate)}}function Qt(t,o){t&1&&U(0)}function zt(t,o){if(t&1&&(l(0,"div"),g(1),p()),t&2){let e=c(3);ne(e.cx("title")),a(),S(e.header)}}function qt(t,o){t&1&&y(0,"TimesIcon"),t&2&&E("data-pc-section","closeicon")}function Gt(t,o){}function jt(t,o){t&1&&_(0,Gt,0,0,"ng-template")}function $t(t,o){if(t&1&&_(0,qt,1,1,"TimesIcon",8)(1,jt,1,0,null,4),t&2){let e=c(4);s("ngIf",!e.closeIconTemplate&&!e._closeIconTemplate),a(),s("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate)}}function Zt(t,o){if(t&1){let e=T();l(0,"p-button",9),b("onClick",function(i){d(e);let r=c(3);return u(r.close(i))})("keydown.enter",function(i){d(e);let r=c(3);return u(r.close(i))}),_(1,$t,2,2,"ng-template",null,1,x),p()}if(t&2){let e=c(3);s("ngClass",e.cx("closeButton"))("buttonProps",e.closeButtonProps)("ariaLabel",e.ariaCloseLabel),E("data-pc-section","closebutton")("data-pc-group-section","iconcontainer")}}function Wt(t,o){t&1&&U(0)}function Kt(t,o){t&1&&U(0)}function Jt(t,o){if(t&1&&(ye(0),l(1,"div",5),_(2,Kt,1,0,"ng-container",4),p(),ve()),t&2){let e=c(3);a(),s("ngClass",e.cx("footer")),E("data-pc-section","footer"),a(),s("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function Xt(t,o){if(t&1&&(l(0,"div",5),_(1,Qt,1,0,"ng-container",4)(2,zt,2,3,"div",6)(3,Zt,3,5,"p-button",7),p(),l(4,"div",5),Te(5),_(6,Wt,1,0,"ng-container",4),p(),_(7,Jt,3,3,"ng-container",8)),t&2){let e=c(2);s("ngClass",e.cx("header")),E("data-pc-section","header"),a(),s("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),a(),s("ngIf",e.header),a(),s("ngIf",e.showCloseIcon&&e.closable),a(),s("ngClass",e.cx("content")),E("data-pc-section","content"),a(2),s("ngTemplateOutlet",e.contentTemplate||e._contentTemplate),a(),s("ngIf",e.footerTemplate||e._footerTemplate)}}function Yt(t,o){if(t&1){let e=T();l(0,"div",3,0),b("@panelState.start",function(i){d(e);let r=c();return u(r.onAnimationStart(i))})("@panelState.done",function(i){d(e);let r=c();return u(r.onAnimationEnd(i))})("keydown",function(i){d(e);let r=c();return u(r.onKeyDown(i))}),_(2,Nt,1,1,"ng-container")(3,Xt,8,9),p()}if(t&2){let e=c();xe(e.style),ne(e.styleClass),s("ngClass",Ue(9,Ot,e.visible,e.position==="left"&&!e.fullScreen,e.position==="right"&&!e.fullScreen,e.position==="top"&&!e.fullScreen,e.position==="bottom"&&!e.fullScreen,e.fullScreen||e.position==="full"))("@panelState",V(19,Bt,Ee(16,At,e.transformOptions,e.transitionOptions))),E("data-pc-name","sidebar")("data-pc-section","root"),a(2),Ce(e.headlessTemplate||e._headlessTemplate?2:3)}}var ei=({dt:t})=>`
2
- .p-drawer {
3
- display: flex;
4
- flex-direction: column;
5
- pointer-events: auto;
6
- transform: translate3d(0px, 0px, 0px);
7
- position: fixed;
8
- transition: transform 0.3s;
9
- background: ${t("drawer.background")};
10
- color: ${t("drawer.color")};
11
- border: 1px solid ${t("drawer.border.color")};
12
- box-shadow: ${t("drawer.shadow")};
13
- }
14
-
15
- .p-drawer-content {
16
- overflow-y: auto;
17
- flex-grow: 1;
18
- padding: ${t("drawer.content.padding")};
19
- }
20
-
21
- .p-drawer-header {
22
- display: flex;
23
- align-items: center;
24
- justify-content: space-between;
25
- flex-shrink: 0;
26
- padding: ${t("drawer.header.padding")};
27
- }
28
-
29
- .p-drawer-footer {
30
- padding: ${t("drawer.header.padding")};
31
- }
32
-
33
- .p-drawer-title {
34
- font-weight: ${t("drawer.title.font.weight")};
35
- font-size: ${t("drawer.title.font.size")};
36
- }
37
-
38
- .p-drawer-full .p-drawer {
39
- transition: none;
40
- transform: none;
41
- width: 100vw !important;
42
- height: 100vh !important;
43
- max-height: 100%;
44
- top: 0px !important;
45
- left: 0px !important;
46
- border-width: 1px;
47
- }
48
-
49
- .p-drawer-left .p-drawer {
50
- align-self: start;
51
- width: 20rem;
52
- height: 100%;
53
- border-right-width: 1px;
54
- }
55
-
56
- .p-drawer-right .p-drawer {
57
- align-self: end;
58
- width: 20rem;
59
- height: 100%;
60
- border-left-width: 1px;
61
- }
62
-
63
- .p-drawer-top .p-drawer {
64
- height: 10rem;
65
- width: 100%;
66
- border-bottom-width: 1px;
67
- }
68
-
69
- .p-drawer-bottom .p-drawer {
70
- height: 10rem;
71
- width: 100%;
72
- border-top-width: 1px;
73
- }
74
-
75
- .p-drawer-left .p-drawer-content,
76
- .p-drawer-right .p-drawer-content,
77
- .p-drawer-top .p-drawer-content,
78
- .p-drawer-bottom .p-drawer-content {
79
- width: 100%;
80
- height: 100%;
81
- }
82
-
83
- .p-drawer-open {
84
- display: flex;
85
- }
86
-
87
- .p-drawer-top {
88
- justify-content: flex-start;
89
- }
90
-
91
- .p-drawer-bottom {
92
- justify-content: flex-end;
93
- }
94
-
95
- .p-drawer {
96
- position: fixed;
97
- transition: transform 0.3s;
98
- display: flex;
99
- flex-direction: column;
100
- }
101
-
102
- .p-drawer-content {
103
- position: relative;
104
- overflow-y: auto;
105
- flex-grow: 1;
106
- }
107
-
108
- .p-drawer-header {
109
- display: flex;
110
- align-items: center;
111
- }
112
-
113
- .p-drawer-footer {
114
- margin-top: auto;
115
- }
116
-
117
- .p-drawer-icon {
118
- display: flex;
119
- align-items: center;
120
- justify-content: center;
121
- margin-left: auto;
122
- }
123
-
124
- .p-drawer-left {
125
- top: 0;
126
- left: 0;
127
- width: 20rem;
128
- height: 100%;
129
- }
130
-
131
- .p-drawer-right {
132
- top: 0;
133
- right: 0;
134
- width: 20rem;
135
- height: 100%;
136
- }
137
-
138
- .p-drawer-top {
139
- top: 0;
140
- left: 0;
141
- width: 100%;
142
- height: 10rem;
143
- }
144
-
145
- .p-drawer-bottom {
146
- bottom: 0;
147
- left: 0;
148
- width: 100%;
149
- height: 10rem;
150
- }
151
-
152
- .p-drawer-full {
153
- width: 100%;
154
- height: 100%;
155
- top: 0;
156
- left: 0;
157
- -webkit-transition: none;
158
- transition: none;
159
- }
160
-
161
- .p-drawer-mask {
162
- background-color: rgba(0, 0, 0, 0.4);
163
- transition-duration: 0.2s;
164
- }
165
-
166
- .p-overlay-mask {
167
- position: fixed;
168
- top: 0;
169
- left: 0;
170
- width: 100%;
171
- height: 100%;
172
- }
173
-
174
- .p-overlay-mask:dir(rtl) {
175
- flex-direction: row-reverse;
176
- }
177
-
178
- .p-overlay-mask-enter {
179
- animation: p-overlay-mask-enter-animation 150ms forwards;
180
- }
181
-
182
- .p-overlay-mask-leave {
183
- animation: p-overlay-mask-leave-animation 150ms forwards;
184
- }
185
-
186
- @keyframes p-overlay-mask-enter-animation {
187
- from {
188
- background-color: transparent;
189
- }
190
- to {
191
- background-color: rgba(0, 0, 0, 0.4);
192
- }
193
- }
194
- @keyframes p-overlay-mask-leave-animation {
195
- from {
196
- background-color: rgba(0, 0, 0, 0.4);
197
- }
198
- to {
199
- background-color: transparent;
200
- }
201
- }
202
- `,ti={mask:({instance:t})=>({position:"fixed",height:"100%",width:"100%",left:0,top:0,display:"flex",flexDirection:"column",alignItems:t.position==="top"?"flex-start":t.position==="bottom"?"flex-end":"center"})},ii={mask:({instance:t})=>({"p-drawer-mask":!0,"p-overlay-mask p-overlay-mask-enter":t.modal,"p-drawer-open":t.containerVisible,"p-drawer-full":t.fullScreen,[`p-drawer-${t.position}`]:!!t.position}),root:({instance:t})=>({"p-drawer p-component":!0,"p-drawer-full":t.fullScreen}),header:"p-drawer-header",title:"p-drawer-title",pcCloseButton:"p-drawer-close-button",content:"p-drawer-content",footer:"p-drawer-footer"},vt=(()=>{class t extends We{name="drawer";theme=ei;classes=ii;inlineStyles=ti;static \u0275fac=(()=>{let e;return function(i){return(e||(e=ie(t)))(i||t)}})();static \u0275prov=ge({token:t,factory:t.\u0275fac})}return t})();var ni=ce([le({transform:"{{transform}}",opacity:0}),se("{{transition}}")]),ri=ce([se("{{transition}}",le({transform:"{{transform}}",opacity:0}))]),fe=(()=>{class t extends Ke{appendTo="body";blockScroll=!1;style;styleClass;ariaCloseLabel;autoZIndex=!0;baseZIndex=0;modal=!0;closeButtonProps={severity:"secondary",text:!0,rounded:!0};dismissible=!0;showCloseIcon=!0;closeOnEscape=!0;transitionOptions="150ms cubic-bezier(0, 0, 0.2, 1)";get visible(){return this._visible}set visible(e){this._visible=e}get position(){return this._position}set position(e){if(this._position=e,e==="full"){this.transformOptions="none";return}switch(e){case"left":this.transformOptions="translate3d(-100%, 0px, 0px)";break;case"right":this.transformOptions="translate3d(100%, 0px, 0px)";break;case"bottom":this.transformOptions="translate3d(0px, 100%, 0px)";break;case"top":this.transformOptions="translate3d(0px, -100%, 0px)";break}}get fullScreen(){return this._fullScreen}set fullScreen(e){this._fullScreen=e,e&&(this.transformOptions="none")}header;maskStyle;closable=!0;onShow=new A;onHide=new A;visibleChange=new A;maskRef;containerViewChild;closeButtonViewChild;initialized;_visible;_position="left";_fullScreen=!1;container;transformOptions="translate3d(-100%, 0px, 0px)";mask;maskClickListener;documentEscapeListener;animationEndListener;_componentStyle=C(vt);ngAfterViewInit(){super.ngAfterViewInit(),this.initialized=!0}headerTemplate;footerTemplate;contentTemplate;closeIconTemplate;headlessTemplate;_headerTemplate;_footerTemplate;_contentTemplate;_closeIconTemplate;_headlessTemplate;templates;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"content":this._contentTemplate=e.template;break;case"header":this._headerTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;case"closeicon":this._closeIconTemplate=e.template;break;case"headless":this._headlessTemplate=e.template;break;default:this._contentTemplate=e.template;break}})}onKeyDown(e){e.code==="Escape"&&this.hide(!1)}show(){this.container.setAttribute(this.attrSelector,""),this.autoZIndex&&L.set("modal",this.container,this.baseZIndex||this.config.zIndex.modal),this.modal&&this.enableModality(),this.onShow.emit({}),this.visibleChange.emit(!0)}hide(e=!0){e&&this.onHide.emit({}),this.modal&&this.disableModality()}close(e){this.hide(),this.visibleChange.emit(!1),e.preventDefault()}enableModality(){let e=this.document.querySelectorAll(".p-drawer-active"),n=e.length,i=n==1?String(parseInt(this.container.style.zIndex)-1):String(parseInt(e[n-1].style.zIndex)-1);this.mask||(this.mask=this.renderer.createElement("div"),this.renderer.setStyle(this.mask,"zIndex",i),$e(this.mask,"style",this.maskStyle),de(this.mask,"p-overlay-mask p-drawer-mask p-overlay-mask-enter"),this.dismissible&&(this.maskClickListener=this.renderer.listen(this.mask,"click",r=>{this.dismissible&&this.close(r)})),this.renderer.appendChild(this.document.body,this.mask),this.blockScroll&&qe())}disableModality(){this.mask&&(de(this.mask,"p-overlay-mask-leave"),this.animationEndListener=this.renderer.listen(this.mask,"animationend",this.destroyModal.bind(this)))}destroyModal(){this.unbindMaskClickListener(),this.mask&&this.renderer.removeChild(this.document.body,this.mask),this.blockScroll&&Ge(),this.unbindAnimationEndListener(),this.mask=null}onAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.appendContainer(),this.show(),this.closeOnEscape&&this.bindDocumentEscapeListener();break}}onAnimationEnd(e){switch(e.toState){case"void":this.hide(!1),L.clear(this.container),this.unbindGlobalListeners();break}}appendContainer(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.container):je(this.appendTo,this.container))}bindDocumentEscapeListener(){let e=this.el?this.el.nativeElement.ownerDocument:this.document;this.documentEscapeListener=this.renderer.listen(e,"keydown",n=>{n.which==27&&parseInt(this.container.style.zIndex)===L.get(this.container)&&this.close(n)})}unbindDocumentEscapeListener(){this.documentEscapeListener&&(this.documentEscapeListener(),this.documentEscapeListener=null)}unbindMaskClickListener(){this.maskClickListener&&(this.maskClickListener(),this.maskClickListener=null)}unbindGlobalListeners(){this.unbindMaskClickListener(),this.unbindDocumentEscapeListener()}unbindAnimationEndListener(){this.animationEndListener&&this.mask&&(this.animationEndListener(),this.animationEndListener=null)}ngOnDestroy(){this.initialized=!1,this.visible&&this.modal&&this.destroyModal(),this.appendTo&&this.container&&this.renderer.appendChild(this.el.nativeElement,this.container),this.container&&this.autoZIndex&&L.clear(this.container),this.container=null,this.unbindGlobalListeners(),this.unbindAnimationEndListener()}static \u0275fac=(()=>{let e;return function(i){return(e||(e=ie(t)))(i||t)}})();static \u0275cmp=B({type:t,selectors:[["p-drawer"]],contentQueries:function(n,i,r){if(n&1&&(F(r,Dt,4),F(r,Et,4),F(r,Ut,4),F(r,Ft,4),F(r,Vt,4),F(r,Ze,4)),n&2){let m;v(m=k())&&(i.headerTemplate=m.first),v(m=k())&&(i.footerTemplate=m.first),v(m=k())&&(i.contentTemplate=m.first),v(m=k())&&(i.closeIconTemplate=m.first),v(m=k())&&(i.headlessTemplate=m.first),v(m=k())&&(i.templates=m)}},viewQuery:function(n,i){if(n&1&&(q(Pt,5),q(Rt,5),q(Lt,5)),n&2){let r;v(r=k())&&(i.maskRef=r.first),v(r=k())&&(i.containerViewChild=r.first),v(r=k())&&(i.closeButtonViewChild=r.first)}},inputs:{appendTo:"appendTo",blockScroll:[2,"blockScroll","blockScroll",I],style:"style",styleClass:"styleClass",ariaCloseLabel:"ariaCloseLabel",autoZIndex:[2,"autoZIndex","autoZIndex",I],baseZIndex:[2,"baseZIndex","baseZIndex",Fe],modal:[2,"modal","modal",I],closeButtonProps:"closeButtonProps",dismissible:[2,"dismissible","dismissible",I],showCloseIcon:[2,"showCloseIcon","showCloseIcon",I],closeOnEscape:[2,"closeOnEscape","closeOnEscape",I],transitionOptions:"transitionOptions",visible:"visible",position:"position",fullScreen:"fullScreen",header:"header",maskStyle:"maskStyle",closable:[2,"closable","closable",I]},outputs:{onShow:"onShow",onHide:"onHide",visibleChange:"visibleChange"},features:[G([vt]),H],ngContentSelectors:Mt,decls:1,vars:1,consts:[["container",""],["icon",""],["role","complementary",3,"ngClass","style","class","keydown",4,"ngIf"],["role","complementary",3,"keydown","ngClass"],[4,"ngTemplateOutlet"],[3,"ngClass"],[3,"class",4,"ngIf"],[3,"ngClass","buttonProps","ariaLabel","onClick","keydown.enter",4,"ngIf"],[4,"ngIf"],[3,"onClick","keydown.enter","ngClass","buttonProps","ariaLabel"]],template:function(n,i){n&1&&(ke(),_(0,Yt,4,21,"div",2)),n&2&&s("ngIf",i.visible)},dependencies:[Z,j,$,Pe,J,Je,K],encapsulation:2,data:{animation:[Oe("panelState",[pe("void => visible",[me(ni)]),pe("visible => void",[me(ri)])])]},changeDetection:0})}return t})(),kt=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275mod=be({type:t});static \u0275inj=we({imports:[fe,K,K]})}return t})();var ai=["class","page"],he=t=>({"ng-invalid ng-dirty":t}),si=t=>({groupID:t});function li(t,o){if(t&1){let e=T();l(0,"p-button",22),b("onClick",function(){d(e);let i=c(2);return u(i.onDeleteUser())}),p()}}function pi(t,o){if(t&1){let e=T();l(0,"p-button",23),b("onClick",function(){d(e);let i=c(2);return u(i.onHandleDrawer())}),p()}}function ci(t,o){if(t&1&&(l(0,"div",19),_(1,li,1,0,"p-button",20)(2,pi,1,0,"p-button",21),p()),t&2){let e=c();a(),s("ngIf",e.store.hasCheckedRows()),a(),s("ngIf",e.roleService.user.create)}}function mi(t,o){t&1&&(l(0,"th",27),y(1,"p-tableHeaderCheckbox"),p())}function di(t,o){if(t&1&&(l(0,"tr"),_(1,mi,2,0,"th",26),l(2,"th"),g(3,"LoginID"),p(),l(4,"th"),g(5,"Group"),p()()),t&2){let e=c(2);a(),s("ngIf",e.roleService.user.delete)}}function ui(t,o){t&1&&U(0)}function _i(t,o){if(t&1&&y(0,"p-tableCheckbox",33),t&2){let e=c(3).$implicit;s("value",e)}}function fi(t,o){if(t&1&&_(0,_i,1,1,"p-tableCheckbox",32),t&2){let e=c(4);s("ngIf",e.roleService.user.delete)}}function hi(t,o){if(t&1&&(l(0,"td"),_(1,ui,1,0,"ng-container",31)(2,fi,1,1,"ng-template",null,7,x),p()),t&2){let e=Se(3),n=c().$implicit,i=c(2);a(),s("ngIf",i.roleService.user.delete&&n.userName===i.currentUser())("ngIfElse",e)}}function gi(t,o){if(t&1){let e=T();l(0,"tr"),_(1,hi,4,2,"td",28),l(2,"td")(3,"button",29),b("click",function(){let i=d(e).$implicit,r=c(2);return u(r.onEditUser(i))}),g(4),p()(),l(5,"td")(6,"a",30),g(7),p()()()}if(t&2){let e=o.$implicit,n=c(2);a(),s("ngIf",n.roleService.user.delete),a(2),s("disabled",!n.roleService.user.edit),a(),Ie(" ",e.userName||e.userID," "),a(2),s("queryParams",V(5,si,e.groupID)),a(),S(e.groupName)}}function wi(t,o){if(t&1&&g(0),t&2){let e=c(2);De(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.count()," entries ")}}function bi(t,o){t&1&&(l(0,"tr")(1,"td",34)(2,"span"),g(3,"No users found. Try adjusting your filters or add a new user."),p()()())}function xi(t,o){if(t&1){let e=T();l(0,"p-panel")(1,"div",24),y(2,"app-user-tabs"),l(3,"p-table",25),b("onPage",function(i){d(e);let r=c();return u(r.onPageChange(i))})("onRowSelect",function(i){d(e);let r=c();return u(r.onRowSelect(i))})("onRowUnselect",function(i){d(e);let r=c();return u(r.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){d(e);let r=c();return u(r.onHeaderCheckboxToggle(i))}),_(4,di,6,1,"ng-template",null,3,x)(6,gi,8,7,"ng-template",null,4,x)(8,wi,1,3,"ng-template",null,5,x)(10,bi,4,0,"ng-template",null,6,x),p()()()}if(t&2){let e=c();a(3),s("value",e.store.data())("lazy",!0)("paginator",!0)("rows",e.store.filter().pageSize)("totalRecords",e.store.count())}}function Ci(t,o){if(t&1&&(l(0,"div",35)(1,"div",17)(2,"div",36)(3,"label",37),g(4,"Group"),p(),y(5,"p-select",38),p()()()),t&2){let e=c();s("formGroup",e.forms.filterForm),a(5),s("showClear",!0)("options",e.store.meta().options.groups)}}function yi(t,o){if(t&1&&(l(0,"span",39),g(1),p()),t&2){let e=c();a(),S(e.store.hasCheckedRows()?"Edit User":"Invite User")}}function vi(t,o){if(t&1&&(l(0,"small",14),g(1),p()),t&2){let e=o.$implicit;a(),S(e)}}function ki(t,o){if(t&1&&(l(0,"small",14),g(1),p()),t&2){let e=o.$implicit;a(),S(e)}}function Ti(t,o){if(t&1&&(l(0,"small",14),g(1),p()),t&2){let e=o.$implicit;a(),S(e)}}var Vn=(()=>{class t extends bt{ngOnInit(){this.generateForm()}constructor(){Ve(()=>{this.store.metaForm()&&this.generateForm()}),super(),this.store=C(_e),this.fb=C(Qe),this.userService=C(ee),this.isLoading=R(!1),this.form=null,this.isDrawerOpen=R(!1),this.router=C(Le),this.route=C(Re),this.isDialogFilterVisible=R(!1),this.roleService=C(ot),this.currentUser=R(null),this.tabs=[{route:"/pages/users/users",label:"Users"},{route:"/pages/users/groups",label:"Groups"}]}ngAfterViewInit(){this.currentUser.set(localStorage.getItem("AUTH_USERNAME")||null)}onPageChange(e){this.store.setFilter(h(f({},this.store.filter()),{pagination:e.first/e.rows+1}))}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){if(Array.isArray(e.data)){e.data.forEach(n=>{this.store.onRowUnselect(n)});return}else this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}generateForm(){this.forms={filterForm:this.fb.group({pagination:this.fb.control(1),pageSize:this.fb.control(10),groupID:this.fb.control(null)}),userForm:this.fb.group({id:this.fb.control({value:this.store.metaForm().form.id,disabled:this.store.metaForm().form.id!==xt},[W.required]),groupID:this.fb.control(this.store.metaForm().form.groupID,[W.required]),accessTypeID:this.fb.control(this.store.metaForm().form.accessTypeID,[W.required])})}}onHandleDrawer(){this.isDrawerOpen.update(e=>!e),this.store.getUserFormMeta(this.route.snapshot.params.id||null)}onInviteUser(){let{userForm:e}=this.forms;if(e.invalid){e.markAllAsTouched();return}let n=e.getRawValue(),i;if(this.store.hasCheckedRows()){let[r]=this.store.checkedData();i={id:r,groupID:n.groupID,accessTypeID:n.accessTypeID}}else i=n;this.userService.inviteUser(i).pipe(ue("User invited successfully"),te(()=>{this.onHandleDrawer(),this.store.setFilter(f({},this.store.filter())),e.reset()})).subscribe()}onSearch(e){this.store.setFilter(h(f({},this.store.filter()),{text:e,pagination:1}))}onOKFilter(){if(this.forms.filterForm.invalid){this.forms.filterForm.markAllAsTouched();return}let{groupID:e}=this.forms.filterForm.value;this.store.setFilter(h(f({},this.store.filter()),{groupID:e})),this.isDialogFilterVisible.update(n=>!n)}onEditUser(e){this.store.onRowSelect(e),this.store.getUserFormMeta(this.store.selectedID()),this.isDrawerOpen.update(n=>!n)}onHideDrawer(){this.store.onHeaderCheckboxToggle(!1)}onDeleteUser(){let e=this.store.checkedData();this.userService.deleteUser(e).pipe(ue("User(s) deleted successfully"),te(()=>{this.store.setFilter(f({},this.store.filter()))})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=B({type:t,selectors:[["app-user",8,"page"]],features:[G([_e]),H],attrs:ai,decls:34,vars:19,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["showCheckbox",""],["pageTitle","User List",3,"search","isDialogFilterVisibleChange","filterConfirmed","isSearchableInput","isFilterable","isDialogFilterVisible","scrollable"],["position","right",3,"visibleChange","onHide","visible"],[1,"row","py-3","row-gap-3",3,"formGroup"],[1,"col-12"],["for","",1,"m-0"],["fluid","","filter","","filterBy","name","formControlName","id","optionLabel","loginID","optionValue","id","placeholder","Select a User",3,"disabled","options","ngClass"],[1,"text-danger"],["filter","","filterBy","name","formControlName","groupID","optionLabel","name","optionValue","id","placeholder","Select a Group","fluid","",3,"options","ngClass"],["filter","","filterBy","name","formControlName","accessTypeID","optionLabel","value","optionValue","key","placeholder","Select Access Type","fluid","",3,"options","ngClass"],[1,"col"],["label","Submit",3,"onClick"],[1,"d-flex","gap-2","flex-wrap"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["label","Invite",3,"onClick",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash",3,"onClick"],["label","Invite",3,"onClick"],[1,"d-flex","flex-column","gap-3","py-2"],["dataKey","userID",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","lazy","paginator","rows","totalRecords"],["style","width: 4rem",4,"ngIf"],[2,"width","4rem"],[4,"ngIf"],[1,"btn","btn-link","fw-light","text-primary","p-0",2,"text-decoration","none",3,"click","disabled"],["routerLink","/pages/users/groups/forms",1,"link","link-primary",3,"queryParams"],[4,"ngIf","ngIfElse"],[3,"value",4,"ngIf"],[3,"value"],["colspan","3"],[1,"row",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["appendTo","body","formControlName","groupID","optionValue","id","optionLabel","name","placeholder","Select a Group",3,"showClear","options"],[1,"fs-5"]],template:function(n,i){if(n&1){let r=T();l(0,"app-main-panel",8),b("search",function(w){return d(r),u(i.onSearch(w))}),ae("isDialogFilterVisibleChange",function(w){return d(r),oe(i.isDialogFilterVisible,w)||(i.isDialogFilterVisible=w),u(w)}),b("filterConfirmed",function(){return d(r),u(i.onOKFilter())}),_(1,ci,3,2,"ng-template",null,0,x)(3,xi,12,5,"ng-template",null,1,x)(5,Ci,6,3,"ng-template",null,2,x),p(),l(7,"p-drawer",9),ae("visibleChange",function(w){return d(r),oe(i.isDrawerOpen,w)||(i.isDrawerOpen=w),u(w)}),b("onHide",function(){return d(r),u(i.onHideDrawer())}),_(8,yi,2,1,"ng-template",null,3,x),l(10,"div",10)(11,"div",11)(12,"div")(13,"label",12),g(14,"Users"),p(),y(15,"p-select",13),Q(16,vi,2,1,"small",14,N),p()(),l(18,"div",11)(19,"div")(20,"label",12),g(21,"Groups"),p(),y(22,"p-select",15),Q(23,ki,2,1,"small",14,N),p()(),l(25,"div",11)(26,"div")(27,"label",12),g(28,"Access Type"),p(),y(29,"p-select",16),Q(30,Ti,2,1,"small",14,N),p()(),l(32,"div",17)(33,"p-button",18),b("onClick",function(){return d(r),u(i.onInviteUser())}),p()()()()}n&2&&(s("isSearchableInput",!0)("isFilterable",!0),re("isDialogFilterVisible",i.isDialogFilterVisible),s("scrollable",!0),a(7),re("visible",i.isDrawerOpen),a(3),s("formGroup",i.forms.userForm),a(5),s("disabled",i.store.hasCheckedRows())("options",i.store.metaForm().options.users)("ngClass",V(13,he,i.isInvalid("id","userForm"))),a(),z(i.getErrors("id","userForm")),a(6),s("options",i.store.metaForm().options.groups)("ngClass",V(15,he,i.isInvalid("groupID","userForm"))),a(),z(i.getErrors("id","userForm")),a(6),s("options",i.store.metaForm().options.accessTypes)("ngClass",V(17,he,i.isInvalid("accessTypeID","userForm"))),a(),z(i.getErrors("accessTypeID","userForm")))},dependencies:[dt,Z,j,$,wt,ft,ht,gt,it,J,kt,fe,ze,Ae,Be,He,Ne,et,Xe,Ye,tt,_t,ut,Ct,rt,nt,yt,Me],styles:['[_nghost-%COMP%]{display:block} .p-tabs .p-tab{padding:"1rem 1.125rem"!important} .p-panel .p-panel-header{display:none!important}'],changeDetection:0})}}return t})();export{Vn as UserPageComponent};
package/chunk-GKFRKDT6.js DELETED
@@ -1,7 +0,0 @@
1
- import{a as st}from"./chunk-SMZ363LC.js";import{a as we,b as De}from"./chunk-CX3TZ3F3.js";import{a as Se}from"./chunk-EM4HKTKQ.js";import{a as Ht,b as me}from"./chunk-JRH7ZWIT.js";import{b as Ut,c as pt,d as mt}from"./chunk-HEX727RH.js";import{a as se,b as ce}from"./chunk-BJ4RON42.js";import"./chunk-CNXEJBY5.js";import{b as at}from"./chunk-MPHY6FVN.js";import"./chunk-NMSYINDE.js";import{a as ie}from"./chunk-ORLKNWW4.js";import"./chunk-WLKS6LBU.js";import{a as Ee,b as Ie}from"./chunk-NHZLS6JU.js";import{a as ot,b as rt,d as ae,k as pe}from"./chunk-KLKIEREL.js";import{a as re,b as le}from"./chunk-76LPTGLX.js";import"./chunk-CWHL7PNC.js";import"./chunk-VRKBMD72.js";import{a as lt}from"./chunk-Q6NOUY4Z.js";import{a as ke}from"./chunk-KXE3J4PK.js";import{b as ye}from"./chunk-E3QNEH3B.js";import"./chunk-EOT2WEXN.js";import{a as qt,b as Te}from"./chunk-X4KTMWVO.js";import"./chunk-I7ILLTFH.js";import"./chunk-2LQVI4EI.js";import"./chunk-AJZ7YLT4.js";import"./chunk-ATJ55H5D.js";import"./chunk-SPKOXGSS.js";import{d as $e}from"./chunk-3KYU6FI2.js";import"./chunk-IJTQE2H4.js";import{b as oe}from"./chunk-WXT6EZ2V.js";import{e as it,f as nt,h as ne}from"./chunk-O5EVYQVN.js";import{b as jt,c as zt}from"./chunk-L3PZS6EL.js";import{a as Xe,b as te}from"./chunk-5JV52UYK.js";import{a as O,b as Je,c as Qe,d as Ze,e as et,f as tt}from"./chunk-ACTRMWEI.js";import"./chunk-ARXP327B.js";import{n as Ke,o as Ye,w as Z,x as ee}from"./chunk-7FFMPB6T.js";import{b as ve}from"./chunk-UKBDY33R.js";import{b as We,c as Pt,e as K,f as Y,g as Ot,i as dt,k as $,l as X,o as J,u as Ce,x as Q}from"./chunk-72LNXEXV.js";import{b as He,e as U,l as W}from"./chunk-EFDD6Q3K.js";import{a as Gt,b as be}from"./chunk-M3WCSF6D.js";import{a as Ue}from"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import{h as ze,k as z,p as qe,q,s as H,y as Bt,z as At}from"./chunk-SB5MSLCX.js";import{$b as D,Ac as ct,Bc as de,Cc as Oe,D as Be,Db as x,Dc as F,Ec as V,Fc as Nt,Gc as je,Ha as E,Lb as s,Nc as C,Ob as Ae,Oc as y,Pc as Me,Qb as M,Rb as Re,Rc as _,Tb as Fe,Ub as Ve,Vb as o,W as Ft,Wb as r,X as Vt,Xb as T,Y as xe,Yb as Ge,Zb as Pe,_ as L,bd as R,c as ge,ca as Lt,cb as j,cd as ue,db as he,ec as I,fc as c,hb as p,ia as S,ic as Mt,qa as h,ra as b,rc as l,s as Ne,sc as f,tc as w,uc as Le,wc as A,xb as N,xc as B,yc as P,zc as kt}from"./chunk-6K5LNQ4J.js";import{a as g,b as v,c as fe,e as Rt}from"./chunk-YQFG5XE2.js";var G=(()=>{class t{constructor(){this.httpService=S(Gt),this.authService=S(Se)}fetchGeneralLedgerLoader(e="single",n={}){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`,{params:n})}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetSingleCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetSingle":"Get"}`,e)}exportGeneralLedger(e,n={}){let i=g({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new At({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),a=new Bt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),u=g({params:i,headers:a},n);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Lt({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var ri=()=>({width:"30vw"}),li=()=>({"1199px":"75vw","575px":"90vw"}),ai=t=>({"ng-dirty ng-invalid":t}),pi=t=>["/pages/journal/journal-entry/",t],mi=t=>({"text-success":t}),si=t=>({"text-danger":t});function ci(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function di(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",34)(8,"span",36),l(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function ui(t,m){t&1&&(o(0,"div",37),l(1," Account is required. "),r())}function _i(t,m){if(t&1&&(o(0,"div",38)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function fi(t,m){if(t&1&&(o(0,"div",26)(1,"div",27),T(2,"p-radiobutton",39),o(3,"label",40),l(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),s("for",e.key),p(),f(e.value)}}function gi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let a=c(3);return b(a.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function xi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),l(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){h(e);let a=c(3);return b(a.searchSupplier(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.supplierSuggestions())}}function hi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),l(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let a=c(3);return b(a.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function bi(t,m){if(t&1&&(o(0,"form",15)(1,"div",16)(2,"label",17),l(3,"Accounts"),r(),o(4,"p-select",18),x(5,ci,10,2,"ng-template",null,5,_)(7,di,10,2,"ng-template",null,6,_),r(),x(9,ui,2,0,"div",19),r(),o(10,"div",16)(11,"label",17),l(12,"From"),r(),o(13,"div",20),T(14,"p-datepicker",21)(15,"p-datepicker",22),r()(),o(16,"div",16)(17,"label",17),l(18,"Outlets"),r(),o(19,"p-multiselect",23),x(20,_i,3,1,"ng-template",null,6,_),r()(),o(22,"div",16)(23,"label",24),l(24,"Contact Type"),r(),o(25,"div",25),Fe(26,fi,5,4,"div",26,Re),r()(),x(28,gi,4,1,"div",16)(29,xi,4,1,"div",16)(30,hi,4,1,"div",16),o(31,"div",16)(32,"label",24),l(33,"Sort order"),r(),o(34,"div",25)(35,"div",26)(36,"div",27),T(37,"p-radiobutton",28),o(38,"label",29),l(39,"Asc"),r()()(),o(40,"div",30)(41,"div",27),T(42,"p-radiobutton",31),o(43,"label",32),l(44,"Desc"),r()()()()()()),t&2){let e,n,i,a=c(2);s("formGroup",a.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",a.loaderMetadata().options.accounts)("ngClass",V(14,ai,((e=a.form.get("accountID"))==null?null:e.invalid)&&(((e=a.form.get("accountID"))==null?null:e.touched)||((e=a.form.get("accountID"))==null?null:e.dirty)))),p(5),s("ngIf",((n=a.form.get("accountID"))==null?null:n.invalid)&&(((n=a.form.get("accountID"))==null?null:n.touched)||((n=a.form.get("accountID"))==null?null:n.dirty))),p(5),s("showIcon",!0),p(),s("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",a.loaderMetadata().options.outlets),p(7),Ve(a.loaderMetadata().options.contactTypeOptions),p(2),M((i=a.form.controls.contactType.value)===1?28:i===2?29:30),p(9),s("value",!0),p(5),s("value",!1)}}function Si(t,m){if(t&1&&x(0,bi,45,16,"form",14),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Ci(t,m){if(t&1){let e=D();o(0,"p-button",45),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function vi(t,m){if(t&1&&(o(0,"div",33)(1,"a",43),l(2,"Return to Accounts"),r(),x(3,Ci,1,0,"p-button",44),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global.export)}}function yi(t,m){t&1&&T(0,"div",52)}function Ei(t,m){t&1&&(o(0,"tr")(1,"th",53),l(2,"Outlet"),r(),o(3,"th",53),l(4,"No."),r(),o(5,"th",53),l(6,"Date"),r(),o(7,"th"),l(8,"Contact / Note"),r(),o(9,"th",54),l(10,"Debit"),r(),o(11,"th",54),l(12,"Credit"),r(),o(13,"th",55),l(14,"Balance"),r()())}function Ii(t,m){if(t&1&&(o(0,"div",16)(1,"a",59),l(2),r(),T(3,"div",63),o(4,"span",64),l(5),r()()),t&2){let e=c().$implicit,n=c(3);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function Ti(t,m){if(t&1&&(o(0,"div",16),T(1,"span",63)(2,"div",63),o(3,"span",65),l(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function wi(t,m){if(t&1&&(Ge(0),l(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.debitAmount)," ")}}function Di(t,m){if(t&1&&(Ge(0),l(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.creditAmount)," ")}}function Ri(t,m){if(t&1&&(Ge(0),l(1),C(2,"number"),Pe()),t&2){let e=c().$implicit;p(),w(" ",y(2,1,e.balance)," ")}}function Fi(t,m){if(t&1&&(o(0,"tr")(1,"td",56),l(2),r(),o(3,"td",56)(4,"a",57),l(5),r()(),o(6,"td",56)(7,"span",58),C(8,"date"),l(9),C(10,"date"),r()(),o(11,"td",56)(12,"div",16)(13,"a",59),l(14),r(),x(15,Ii,6,4,"div",16)(16,Ti,5,3,"div",16),r()(),o(17,"td",60),x(18,wi,3,3,"ng-container",61),r(),o(19,"td",60),x(20,Di,3,3,"ng-container",61),r(),o(21,"td",62),x(22,Ri,3,3,"ng-container",61),r()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.outletName),p(2),s("routerLink",V(19,pi,e.id)),p(),f(e.number),p(2),s("pTooltip",Me(8,13,e.date,"dd MMM y")),p(2),w(" ",Me(10,16,e.date,"dd MMM y")," "),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),M(n.buildReferenceUrl(e)?15:16),p(2),s("ngClass",V(21,mi,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",V(23,si,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Vi(t,m){if(t&1&&(o(0,"tr"),T(1,"td",66),o(2,"td",67),l(3,"Total"),r(),o(4,"td",68),l(5),C(6,"number"),r(),o(7,"td",69),l(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c(3);p(5),w(" ",y(6,2,e.debitSubTotal())," "),p(3),w(" ",y(9,4,e.creditSubTotal())," ")}}function Li(t,m){t&1&&(o(0,"tr")(1,"td",70)(2,"span"),l(3,"No records found."),r()()())}function Mi(t,m){if(t&1){let e=D();o(0,"button",71),I("click",function(){h(e);let i=c(3);return b(i.getGLCount())})("keyup.enter",function(){h(e);let i=c(3);return b(i.getGLCount())}),r()}}function ki(t,m){if(t&1&&l(0),t&2){let e=c(3);w(" ",e.count()," ")}}function Ni(t,m){if(t&1){let e=D();o(0,"p-button",72),I("onClick",function(){h(e);let i=c(3);return b(i.onNextPage())}),r()}}function Bi(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),x(2,yi,1,0,"ng-template",null,7,_)(4,Ei,15,0,"ng-template",null,8,_)(6,Fi,23,25,"ng-template",null,9,_)(8,Vi,11,6,"ng-template",null,4,_)(10,Li,4,0,"ng-template",null,10,_),r(),o(12,"div",49)(13,"div"),l(14),x(15,Mi,1,0,"button",50)(16,ki,1,1),l(17," entries "),r(),o(18,"div",33),x(19,Ni,1,0,"p-button",51),r()()()),t&2){let e=c(2);p(),s("value",e.items().data.data),p(13),Le(" Showing ",e.pagination().first," to ",e.pagination().end," of "),p(),M(e.totalRecords()===-1?15:16),p(4),M(e.pagination().hasNext?19:-1)}}function Ai(t,m){if(t&1&&x(0,Bi,20,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Gi(t,m){if(t&1&&(o(0,"div",73)(1,"div",74)(2,"div",75)(3,"div",25)(4,"div",76)(5,"label",24),l(6,"Page"),r()(),o(7,"div",76),T(8,"input",77),r()()()(),o(9,"div",78)(10,"div",27),T(11,"i",79),o(12,"span",80),l(13),C(14,"number"),C(15,"number"),r()()()()),t&2){let e=c();p(),s("formGroup",e.form),p(12),Le("Exporting data from ",y(14,3,e.filter().exportPageNumber)," - ",y(15,5,e.filter().exportPageSize),"")}}function Pi(t,m){if(t&1){let e=D();o(0,"p-button",81),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Oi(t,m){if(t&1){let e=D();o(0,"p-button",82),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",83),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var Kt=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(L(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=S(G),this.route=S(He),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(lt),this.toastr=S(Ue),this.dayjsService=S(me),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,a=i==n||this.lastGetDataLength()<e.pageSize;return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:!a}}),this.queryFilter=ve(this.route.queryParamMap.pipe(Ne(e=>{let n=e.get("from")?this.dayjsService.format(new Date(e.get("from"))):null,i=e.get("to")?this.dayjsService.format(new Date(e.get("to"))):null,a={},u=e.get("id");return be.IsNotEmpty(u)&&(a=v(g({},a),{accountID:u})),be.IsNotEmpty(n)&&be.IsNotEmpty(i)&&(a=v(g({},a),{from:n,to:i})),a})),{initialValue:null}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?g(g({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),ue(()=>{let e=this.filter();e&&(be.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),ue(()=>{let e=this.filter(),n=this.form.value.accountID;!e||be.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(a=>e.pageNumber===1?i:v(g({},i),{data:v(g({},i.data),{data:[...a?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return st(e)}ngOnInit(){this.route.queryParamMap.pipe(Be(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[Pt.required]),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let a=this.findNodeByKey(i.children,n);if(a)return a}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,a])=>{switch(i){case"from":n[i]=a&&(typeof a=="string"||typeof a=="number"||a instanceof Date)?this.dayjsService.from(a)?.toDate():null;break;case"to":n[i]=a&&(typeof a=="string"||typeof a=="number"||a instanceof Date)?this.dayjsService.from(a)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(a)?n[i]=a.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(a)?a:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=a!=null?Number(a):0;break;case"sortAscending":case"export":n[i]=!!a;break;case"contactType":n[i]=a!=null?Number(a):null;break;default:n[i]=a}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(L(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(L(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(L(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let a=this.form.getRawValue(),{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(L(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),a="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(a=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;mt(u,a,u.type)}buildExportBody(){let a=this.form.value,{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(a=>v(g({},a),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["caption",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"d-flex","gap-2"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next"],[1,"d-flex","gap-1"],[2,"width","120px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","140px"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["tooltipPosition","top",3,"pTooltip"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[4,"ngIf"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],[2,"white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],[1,"text-end","fw-semibold","text-success"],[1,"text-end","fw-semibold","text-danger"],["colspan","8"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"col"],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let a=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(a),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(a),b(i.onFilterOKEvent())}),x(1,Si,1,1,"ng-template",null,0,_)(3,vi,4,1,"ng-template",null,1,_)(5,Ai,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(a),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),x(8,Gi,16,7,"div",13)(9,Pi,1,2,"ng-template",null,3,_)(11,Oi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Ae(F(11,ri)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(12,li)),p(),s("ngIf",i.form&&i.filter()))},dependencies:[ne,H,ze,z,q,qe,oe,pe,ae,nt,it,ee,Z,Te,qt,le,re,De,we,Q,$,We,K,Y,X,J,ce,se,ye,$e,pt,at,te,W,U,rt,ot,zt,jt,Ye,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var ji={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},St=Je(tt(ji),Qe(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),et(t=>{let m=S(G),e=S(me),n={updateFilter(i){O(t,a=>v(g({},a),{filter:g(g({},a.filter),i)}))},getLoader:Ee(ge(xe(()=>m.getIncomeStatementLoader().pipe(Ie({next:i=>{O(t,a=>v(g({},a),{loader:i,filter:v(g({},a.filter),{from:e.from(i.filter.from).format(),to:e.from(i.filter.to).format()})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ee(ge(xe(i=>m.getIncomeStatement(i).pipe(Vt(()=>O(t,a=>v(g({},a),{isLoading:!0}))),Ie({next:a=>{O(t,u=>v(g({},u),{data:a,isLoading:!1}))},error:a=>{console.error(a)}})))))};return n}),Ze({onInit:t=>{t.getLoader()}}));var Ct=()=>({}),vt=t=>["/pages/chart-of-account/account/",t],yt=()=>["/pages/report/general-ledger"],Et=(t,m,e)=>({id:t,from:m,to:e});function qi(t,m){if(t&1){let e=D();o(0,"p-button",10),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function Hi(t,m){if(t&1&&(o(0,"div",8),x(1,qi,1,0,"p-button",9),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global.export)}}function Ui(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function Wi(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Ki(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Revenue :"),r(),o(5,"span",22),l(6),C(7,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,1,e.store.totalRevenue()))}}function Yi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No revenue records available"),r()()())}function $i(t,m){if(t&1&&(o(0,"h6",12),l(1,"Revenue"),r(),o(2,"p-table",13),x(3,Ui,7,0,"ng-template",null,3,_)(5,Wi,10,15,"ng-template",null,4,_)(7,Ki,8,3,"ng-template",null,5,_)(9,Yi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function Xi(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",24),l(6,"Total"),r()())}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function Qi(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total COGS :"),r(),o(5,"span",22),l(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Gross Profit :"),r(),o(13,"span",22),l(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalCOGS())),p(8),f(y(15,4,e.store.grossProfit()))}}function Zi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No COGS records available"),r()()())}function en(t,m){if(t&1&&(o(0,"h4",12),l(1,"COGS"),r(),o(2,"p-table",13),x(3,Xi,7,0,"ng-template",null,3,_)(5,Ji,10,15,"ng-template",null,4,_)(7,Qi,16,6,"ng-template",null,5,_)(9,Zi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function tn(t,m){t&1&&(o(0,"tr")(1,"th",14),l(2,"Code"),r(),o(3,"th",15),l(4,"Name"),r(),o(5,"th",16),l(6,"Total"),r()())}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",17),l(5),r()(),o(6,"td",16)(7,"a",18),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=de(0),i=de(1);p(2),f(e.code),p(2),s("routerLink",V(8,vt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,yt))("queryParams",je(11,Et,e.accountID,n,i)),p(),f(y(9,6,e.amount))}}function on(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),l(4,"Total Expense :"),r(),o(5,"span",22),l(6),C(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),l(12,"Profit / Loss :"),r(),o(13,"span",22),l(14),C(15,"number"),r()()()()),t&2){let e=c(3);p(6),f(y(7,2,e.store.totalExpense())),p(8),f(y(15,4,e.store.profitOrLoss()))}}function rn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No expense records available"),r()()())}function ln(t,m){if(t&1&&(o(0,"h4",12),l(1,"Expense"),r(),o(2,"p-table",13),x(3,tn,7,0,"ng-template",null,3,_)(5,nn,10,15,"ng-template",null,4,_)(7,on,16,6,"ng-template",null,5,_)(9,rn,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function an(t,m){if(t&1&&(kt(0)(1),o(2,"p-panel")(3,"div",11),x(4,$i,11,1)(5,en,11,1)(6,ln,11,1),r()()),t&2){let e,n,i,a,u,d=c();ct((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),p(),ct((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),p(3),M(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:F(5,Ct)).length>0?4:-1),p(),M(d.Object.keys((a=(a=d.store.data().data)==null?null:a.cogs)!==null&&a!==void 0?a:F(6,Ct)).length>0?5:-1),p(),M(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:F(7,Ct)).length>0?6:-1)}}function pn(t,m){if(t&1){let e=D();o(0,"form",25)(1,"div",26)(2,"label",27),l(3,"Outlet"),r(),T(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),l(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){h(e);let a=c();return b(a.onCashierSearch(i))})("onSelect",function(i){h(e);let a=c();return b(a.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),l(11,"From - To"),r(),o(12,"div",31),T(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),p(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0)}}var Yt=(()=>{class t{constructor(){this.dayjsService=S(me),this.store=S(St),this.fb=S(Ce),this.reportService=S(G),this.roleService=S(ie),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,ue(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(v(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(ke("Cashier Suggestions"),L(n=>this.cashierSuggestions.set(n))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),n=Object.entries(e).reduce((i,[a,u])=>(a==="from"||a==="to"?u instanceof Date&&(i[a]=this.dayjsService.from(u).format()):i[a]=u||null,i),{});this.store.updateFilter(g(g({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(ke("Export Profit & Loss"),L(n=>{let i=n.type,a=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(a,{type:i}));let d=`profit-and-loss.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-income-statement"]],features:[Oe([St])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let a=D();o(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(d){return h(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(a),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(a),b(i.onFilterOK())}),x(1,Hi,2,1,"ng-template",null,0,_)(3,an,7,8,"ng-template",null,1,_)(5,pn,15,12,"ng-template",null,2,_),r()}n&2&&(s("isFilterable",!0)("pageTitle",i.store.data().pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,Te,le,re,Q,$,K,Y,X,J,ce,se,oe,pe,ae,te,Xe,W,U,De,we,ee,Z],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var It=Rt(Ht());var mn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,It.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Tt=Je(tt(mn),Qe(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),et(t=>{let m=S(G),e={updateFilter:n=>{O(t,i=>v(g({},i),{filter:n}))},fetchBalanceSheet:Ee(ge(Be(()=>{let n=t.filter();return Object.entries(n).every(([i,a])=>a!=null&&a!=="")}),xe(n=>m.getBalanceSheet(n).pipe(Ie({next:i=>{O(t,a=>v(g({},a),{data:i}))},error:i=>{console.error(i)}}))),Ft(1))),fetchLoader:Ee(ge(xe(()=>m.getBalanceSheetLoader().pipe(Ie({next:n=>{O(t,i=>v(g({},i),{metadata:n,filter:{date:(0,It.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Ze(t=>({onInit:()=>{t.fetchLoader()}})));var $t=Rt(Ht());var wt=t=>["/pages/chart-of-account/account/",t],Dt=()=>["/pages/report/general-ledger"],sn=(t,m)=>({id:t,to:m}),Xt=t=>({id:t});function cn(t,m){if(t&1){let e=D();o(0,"p-button",11),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function dn(t,m){if(t&1&&(o(0,"div",9),x(1,cn,1,0,"p-button",10),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global.export)}}function un(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Asset"),r(),o(5,"th",17),l(6,"Total"),r()())}function _n(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",Nt(11,sn,e.accountID,n.store.filter().date)),p(),f(y(9,6,e.amount))}}function fn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Asset"),r(),o(3,"td",22),l(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalAsset())," ")}}function gn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No asset records found."),r()()())}function xn(t,m){if(t&1&&(o(0,"h4",14),l(1,"Asset"),r(),o(2,"p-table",15),x(3,un,7,0,"ng-template",null,3,_)(5,_n,10,14,"ng-template",null,4,_)(7,fn,6,3,"ng-template",null,5,_)(9,gn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().asset)}}function hn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Liability"),r(),o(5,"th",17),l(6,"Total"),r()())}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",25),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function Sn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2," Total Liability "),r(),o(3,"td",22),l(4),C(5,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,1,e.store.totalLiability())," ")}}function Cn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No liability records found."),r()()())}function vn(t,m){if(t&1&&(o(0,"h4",24),l(1,"Liability"),r(),o(2,"p-table",15),x(3,hn,7,0,"ng-template",null,3,_)(5,bn,10,13,"ng-template",null,4,_)(7,Sn,6,3,"ng-template",null,5,_)(9,Cn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().liability)}}function yn(t,m){t&1&&(o(0,"tr")(1,"th",16),l(2,"Code"),r(),o(3,"th"),l(4,"Equity"),r(),o(5,"th",17),l(6,"Total"),r()())}function En(t,m){if(t&1&&(o(0,"tr")(1,"td"),l(2),r(),o(3,"td")(4,"a",18),l(5),r()(),o(6,"td",19)(7,"a",20),l(8),C(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),f(e.code),p(2),s("routerLink",V(8,wt,e.accountID)),p(),f(e.name),p(2),s("routerLink",F(10,Dt))("queryParams",V(11,Xt,e.accountID)),p(),f(y(9,6,e.counterAmount))}}function In(t,m){if(t&1&&(o(0,"tr")(1,"td",21),l(2,"Total Equity"),r(),o(3,"td",22),l(4),C(5,"number"),r()(),o(6,"tr")(7,"td",21),l(8," Total Liability + Equity "),r(),o(9,"td",22),l(10),C(11,"number"),r()()),t&2){let e=c(3);p(4),w(" ",y(5,2,e.store.totalEquity())," "),p(6),w(" ",y(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Tn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),l(3,"No equity records found."),r()()())}function wn(t,m){if(t&1&&(o(0,"h4",24),l(1,"Equity"),r(),o(2,"p-table",15),x(3,yn,7,0,"ng-template",null,3,_)(5,En,10,13,"ng-template",null,4,_),l(7," <"),x(8,In,12,6,"ng-template",null,5,_)(10,Tn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().equity)}}function Dn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),x(2,xn,11,1)(3,vn,11,1)(4,wn,12,1),r()()),t&2){let e=c();s("showHeader",!1),p(2),M(e.Object.keys(e.store.data().asset).length>0?2:-1),p(),M(e.Object.keys(e.store.data().liability).length>0?3:-1),p(),M(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Rn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function Fn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),l(3,"Outlet"),r(),o(4,"p-multiselect",29),x(5,Rn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),l(9,"From"),r(),T(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),p(6),s("iconDisplay","input")("showIcon",!0)}}var Jt=(()=>{class t{constructor(){this.store=S(Tt),this.ReportServiceStore=S(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=S(ie),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Ot({date:new dt(new Date),outletID:new dt([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,$t.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(ke("Export Balance Sheet"),L(n=>{let i=n.type,a=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(a,{type:i}));let d=`balance-sheet.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-balance-sheet"]],features:[Oe([Tt])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","5%"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let a=D();o(0,"app-main-panel",8),P("isDialogFilterVisibleChange",function(d){return h(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(a),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(a),b(i.onFilterOKEvent())}),x(1,dn,2,1,"ng-template",null,0,_)(3,Dn,5,4,"ng-template",null,1,_)(5,Fn,11,7,"ng-template",null,2,_),r()}n&2&&(s("pageTitle",i.store.data().pageTitle)("isFilterable",!0),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[ne,H,z,q,pe,ae,oe,ee,Z,Q,$,K,Y,X,J,ce,se,le,re,ye,te,Xe,W,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),l(1,"report-comparative-balance works!"),r(),l(2,`
2
- ,
3
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),l(1,"report-cash-flow works!"),r(),l(2,`
4
- ,
5
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ei=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-trial-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),l(1,"report-trial-balance works!"),r(),l(2,`
6
- ,
7
- `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Vn=()=>({width:"30vw"}),Ln=()=>({"1199px":"75vw","575px":"90vw"}),Mn=t=>["/pages/journal/journal-entry/",t],kn=t=>({"ng-dirty ng-invalid":t}),Nn=()=>({scrollHeight:"250px"});function Bn(t,m){if(t&1){let e=D();o(0,"p-button",27),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function An(t,m){if(t&1&&(o(0,"div",24)(1,"a",25),l(2,"Return to Accounts"),r(),x(3,Bn,1,0,"p-button",26),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global.export)}}function Gn(t,m){if(t&1&&(o(0,"div",24)(1,"span",31)(2,"h2",32),l(3),r()(),o(4,"span",31)(5,"h2",32),l(6),r()()()),t&2){let e=c().$implicit;p(3),f(e.name),p(3),w(" (",e.chartOfAccountCode,") ")}}function Pn(t,m){t&1&&(o(0,"tr")(1,"th",33),l(2,"Outlet"),r(),o(3,"th",33),l(4,"No."),r(),o(5,"th",33),l(6,"Date"),r(),o(7,"th"),l(8,"Contact / Note"),r(),o(9,"th",34),l(10,"Debit"),r(),o(11,"th",35),l(12,"Credit"),r(),o(13,"th",35),l(14,"Balance"),r()())}function On(t,m){if(t&1&&(o(0,"div",38)(1,"a",39),l(2),r(),T(3,"div",41),o(4,"span",42),l(5),r()()),t&2){let e=c().$implicit,n=c(4);p(),s("href",n.authService.getTenantExternalURL()+n.buildReferenceUrl(e),he),p(),f(e.referenceText),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function jn(t,m){if(t&1&&(o(0,"div",38),T(1,"span",41)(2,"div",41),o(3,"span",42),l(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),w("",e.note," ")}}function zn(t,m){if(t&1&&(o(0,"tr")(1,"td",36),l(2),r(),o(3,"td",36)(4,"a",37),l(5),r()(),o(6,"td",36),l(7),C(8,"date"),r(),o(9,"td",36)(10,"div",38)(11,"a",39),l(12),r(),x(13,On,6,4,"div",38)(14,jn,5,3,"div",38),r()(),o(15,"td",40),l(16),C(17,"number"),r(),o(18,"td",40),l(19),C(20,"number"),r(),o(21,"td",40),l(22),C(23,"number"),r()()),t&2){let e=m.$implicit,n=c(4);p(2),f(e.outletName),p(2),s("routerLink",V(19,Mn,e.id)),p(),f(e.number),p(2),f(Me(8,10,e.date,"dd MMM yyyy")),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,he),p(),f(e.contactName),p(),M(n.buildReferenceUrl(e)?13:14),p(3),w(" ",y(17,13,e.debitAmount)," "),p(3),w(" ",y(20,15,e.creditAmount)," "),p(3),f(y(23,17,e.balance))}}function qn(t,m){if(t&1&&(o(0,"tr"),T(1,"td",43),o(2,"td",44),l(3,"Total"),r(),o(4,"td",44),l(5),C(6,"number"),r(),o(7,"td",44),l(8),C(9,"number"),r(),T(10,"td"),r()),t&2){let e=c().$index,n=c(3);p(5),w(" ",y(6,2,n.items().data[e].debitTotal)," "),p(3),w(" ",y(9,4,n.items().data[e].creditTotal)," ")}}function Hn(t,m){t&1&&(o(0,"tr")(1,"td",45)(2,"span"),l(3,"No records found."),r()()())}function Un(t,m){if(t&1&&(o(0,"p-table",30),x(1,Gn,7,2,"ng-template",null,5,_)(3,Pn,15,0,"ng-template",null,6,_)(5,zn,24,21,"ng-template",null,7,_)(7,qn,11,6,"ng-template",null,4,_)(9,Hn,4,0,"ng-template",null,8,_),r()),t&2){let e=m.$implicit;s("value",e.data)}}function Wn(t,m){if(t&1&&(o(0,"div",29),Fe(1,Un,11,1,"p-table",30,Re),r()),t&2){let e=c(2);p(),Ve(e.items().data)}}function Kn(t,m){if(t&1&&x(0,Wn,3,0,"div",28),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Yn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",31)(8,"span",62),l(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function $n(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",61),l(3),r()(),o(4,"div")(5,"span"),l(6,"-"),r()(),o(7,"div",31)(8,"span",62),l(9),r()()()),t&2){let e=m.$implicit;p(3),w("(",e.code,")"),p(6),f(e.name)}}function Xn(t,m){t&1&&(o(0,"div",63),l(1," Account is required. "),r())}function Jn(t,m){if(t&1&&(o(0,"div",64)(1,"div"),l(2),r()()),t&2){let e=m.$implicit;p(2),f(e.value)}}function Qn(t,m){if(t&1&&(o(0,"div",55)(1,"div",21),T(2,"p-radiobutton",65),o(3,"label",66),l(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),Mt("for",e.key),p(),f(e.value)}}function Zn(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",47),l(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(i){h(e);let a=c(2);return b(a.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function eo(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",47),l(2,"Supplier"),r(),o(3,"p-autocomplete",68),I("completeMethod",function(i){h(e);let a=c(2);return b(a.searchSupplier(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.supplierSuggestions())}}function to(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",47),l(2,"Customer"),r(),o(3,"p-autocomplete",67),I("completeMethod",function(i){h(e);let a=c(2);return b(a.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function io(t,m){if(t&1){let e=D();o(0,"form",46)(1,"div",38)(2,"label",47),l(3,"Accounts"),r(),o(4,"p-multiselect",48),I("onChange",function(i){h(e);let a=c();return b(a.onAccountChange(i))}),x(5,Yn,10,2,"ng-template",null,9,_)(7,$n,10,2,"ng-template",null,10,_),r(),x(9,Xn,2,0,"div",49),r(),o(10,"div",38)(11,"label",47),l(12,"From"),r(),o(13,"div",50),T(14,"p-datepicker",51)(15,"p-datepicker",52),r()(),o(16,"div",38)(17,"label",47),l(18,"Outlets"),r(),o(19,"p-multiselect",53),x(20,Jn,3,1,"ng-template",null,10,_),r()(),o(22,"div",38)(23,"label",47),l(24,"Category"),r(),o(25,"p-treeselect",54),I("onFocus",function(){h(e);let i=c();return b(i.onCategoryFocus())}),r()(),o(26,"div",38)(27,"label",18),l(28,"Contact Type"),r(),o(29,"div",16),Fe(30,Qn,5,4,"div",55,Re),r()(),o(32,"div",38)(33,"label",18),l(34,"Sort order"),r(),o(35,"div",16)(36,"div",55)(37,"div",21),T(38,"p-radiobutton",56),o(39,"label",57),l(40,"Asc"),r()()(),o(41,"div",58)(42,"div",21),T(43,"p-radiobutton",59),o(44,"label",60),l(45,"Desc"),r()()()()(),x(46,Zn,4,1,"div",38)(47,eo,4,1,"div",38)(48,to,4,1,"div",38),r()}if(t&2){let e,n,i,a,u,d,k=c();s("formGroup",k.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(e=k.loaderMetadata())==null||e.options==null?null:e.options.accounts)("selectionLimit",5)("ngClass",V(22,kn,((n=k.form.get("listAccountID"))==null?null:n.invalid)&&(((n=k.form.get("listAccountID"))==null?null:n.touched)||((n=k.form.get("listAccountID"))==null?null:n.dirty)))),p(5),s("ngIf",((i=k.form.get("listAccountID"))==null?null:i.invalid)&&(((i=k.form.get("listAccountID"))==null?null:i.touched)||((i=k.form.get("listAccountID"))==null?null:i.dirty))),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(a=k.loaderMetadata())==null||a.options==null?null:a.options.outlets),p(6),s("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",F(24,Nn))("options",k.categoriesOptions()),p(5),Ve((u=k.loaderMetadata())==null||u.options==null?null:u.options.contactTypeOptions),p(8),s("value",!0),p(5),s("value",!1),p(3),M((d=k.form.controls.contactType.value)===1?46:d===2?47:48)}}function no(t,m){if(t&1){let e=D();o(0,"p-button",69),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function oo(t,m){if(t&1){let e=D();o(0,"p-button",70),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",71),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var ti=(()=>{class t{buildReferenceUrl(e){return st(e)}getGLCount(){this.reportService.getGLCount(this.filter()).pipe(L(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=S(G),this.route=S(He),this.roleService=S(ie),this.authService=S(Se),this.fb=S(Ce),this.coaService=S(lt),this.toastr=S(Ue),this.dayjsService=S(me),this.infinity=1/0,this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=Math.min(e.pageNumber*e.pageSize,isFinite(n)?n:e.pageNumber*e.pageSize);return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:isFinite(n)?e.pageNumber*e.pageSize<n:!0}}),this.loaderMetadata=ve(this.reportService.fetchGeneralLedgerLoader("multiple"),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.queryFilter=ve(this.route.queryParamMap.pipe(Ne(e=>({accountID:e.get("id"),to:e.get("to")}))),{initialValue:null}),this.filter=R(()=>{let e=this.baseFilter(),n=this.queryFilter(),i=this.localFilter();return e?g(g(g({},e),n??{}),i):null}),this.creditSubTotal=R(()=>0),this.debitSubTotal=R(()=>0),this.initializeForm(),ue(()=>{let e=this.filter();e&&(e.listAccountID.length>0||e.listCategoryID.length>0)&&(this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1}),this.reportService.fetchGeneralLedgerReport(e,"multiple").pipe().subscribe(n=>{this.items.set(n)}))})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null),from:this.fb.control(null),to:this.fb.control(null),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listCategoryID:this.fb.control([]),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let a=this.findNodeByKey(i.children,n);if(a)return a}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,a])=>{switch(i){case"from":break;case"to":n[i]=a&&(typeof a=="string"||typeof a=="number"||a instanceof Date)?this.dayjsService.from(a)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(a)?n[i]=a.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(a)?a:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=a!=null?Number(a):0;break;case"sortAscending":case"export":n[i]=!!a;break;case"contactType":n[i]=a!=null?Number(a):null;break;default:n[i]=a}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}onFormValueChange(){let e=this.form.controls.listAccountID.value,n=this.form.controls.listCategoryID.value;e.length<=0&&n.length<=0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1})):e.length>0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.disable({emitEvent:!1})):n.length>0&&(this.form.controls.listAccountID.disable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1}))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(L(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(L(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(L(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at most 5 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e)}buildFilterBody(){let a=this.form.value,{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(L(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),a="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(a=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;mt(u,a,u.type)}buildExportBody(){let a=this.form.value,{from:e,to:n}=a,i=fe(a,["from","to"]);return v(g({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:n+1})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(g({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(g({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(a=>v(g({},a),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-multiple-ledger"]],decls:28,vars:19,consts:[["actionButton",""],["content",""],["filters",""],["closeIconTemplate",""],["footer",""],["caption",""],["header",""],["body",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"row"],[1,"col"],["for",""],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],[1,"d-flex","gap-2"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","options","selectionLimit","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","key","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"col-4"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let a=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(a),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(a),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(a),b(i.onFilterOKEvent())}),x(1,An,4,1,"ng-template",null,0,_)(3,Kn,1,1,"ng-template",null,1,_)(5,io,49,25,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(a),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),o(8,"div",13)(9,"div",14)(10,"div",15)(11,"div",16)(12,"div",17)(13,"label",18),l(14,"Page"),r()(),o(15,"div",17),T(16,"input",19),r()()()(),o(17,"div",20)(18,"div",21),T(19,"i",22),o(20,"span",23),l(21),C(22,"number"),C(23,"number"),r()()()(),x(24,no,1,2,"ng-template",null,3,_)(26,oo,2,0,"ng-template",null,4,_),r()}if(n&2){let a;s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Ae(F(17,Vn)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",F(18,Ln)),p(2),s("formGroup",i.form),p(12),Le("Exporting data from ",y(22,13,(a=i.filter())==null?null:a.exportPageNumber)," - ",y(23,15,(a=i.filter())==null?null:a.exportPageSize),"")}},dependencies:[ne,H,ze,z,q,qe,oe,pe,ae,nt,it,ee,Z,Te,le,re,De,we,Q,$,We,K,Y,X,J,ce,se,ye,$e,pt,Ut,at,te,W,U,rt,ot,Ye,Ke],styles:["[_nghost-%COMP%]{display:block} .p-datatable .p-datatable-header{padding-left:0!important}"],changeDetection:0})}}return t})();var $l=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Kt},{path:"multiple-general-ledger",component:ti},{path:"profit-loss",component:Yt},{path:"balance-sheet",component:Jt},{path:"comparative-balance",component:Qt},{path:"trial-balance",component:ei},{path:"cash-flow",component:Zt}]}];export{$l as REPORTS_ROUTES};
package/chunk-IY4CV424.js DELETED
@@ -1 +0,0 @@
1
- import{a}from"./chunk-ROJ6NA2I.js";import"./chunk-EM4HKTKQ.js";import"./chunk-WLKS6LBU.js";import"./chunk-EFDD6Q3K.js";import"./chunk-M3WCSF6D.js";import"./chunk-ZDTMCWOO.js";import"./chunk-F2X3VGZZ.js";import"./chunk-SB5MSLCX.js";import"./chunk-6K5LNQ4J.js";import"./chunk-YQFG5XE2.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-3TIJYNSV.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};
package/chunk-ORLKNWW4.js DELETED
@@ -1 +0,0 @@
1
- import{a as h,b as l}from"./chunk-WLKS6LBU.js";import{Ha as i,ca as o,cd as a,ia as r}from"./chunk-6K5LNQ4J.js";var d=(()=>{class s{constructor(){this._userRoles=i([]),this.tokenService=r(l),a(()=>{let e=this.tokenService.tokenSignal();e&&this.loadRolesFromToken(e)})}loadRolesFromToken(e){if(e){let t=h(e);t&&t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"]&&Array.isArray(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"])&&this._userRoles.set(t["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"])}}hasAnyRole(e){return e.some(t=>this._userRoles().includes(t))}refreshRoles(e){localStorage.setItem("AUTH_ROLES",JSON.stringify(e)),this._userRoles.set(e)}hasRole(e){return this._userRoles().includes(e)}get coa(){return{view:this.hasRole("Coa"),create:this.hasRole("CoaC"),edit:this.hasRole("CoaE"),delete:this.hasRole("CoaD")}}get journal(){return{view:this.hasRole("Journal"),create:this.hasRole("JournalC"),edit:this.hasRole("JournalE"),delete:this.hasRole("JournalD")}}get report(){return{ledger:this.hasRole("ReportL"),finance:this.hasRole("ReportF")}}get setup(){return{view:this.hasRole("Setup"),migrate:this.hasRole("Migrate"),tools:this.hasRole("Tools"),recurring:this.hasRole("Recurring")}}get global(){return{export:this.hasRole("Export"),date:this.hasRole("Date"),number:this.hasRole("Number")}}get user(){return{view:this.hasRole("User"),edit:this.hasRole("UserE"),delete:this.hasRole("UserD"),create:this.hasRole("UserC")}}static{this.\u0275fac=function(t){return new(t||s)}}static{this.\u0275prov=o({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();export{d as a};