dealposbooks 1.9.2 → 1.9.3

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 (122) hide show
  1. package/3rdpartylicenses.txt +769 -68
  2. package/assets/scss/components/_scafholdings.scss +21 -17
  3. package/assets/scss/layouts/_sidebar.scss +1 -1
  4. package/assets/scss/style.scss +51 -11
  5. package/assets/scss/variables/_variables.scss +3 -3
  6. package/{chunk-4OXMK44M.js → chunk-2US5D2LY.js} +1 -1
  7. package/{chunk-HKFTHGN6.js → chunk-33XUIS57.js} +1 -1
  8. package/{chunk-DCES5UJV.js → chunk-353U23ZQ.js} +1 -1
  9. package/chunk-3B65XZ6E.js +1 -0
  10. package/{chunk-5M3BH2HK.js → chunk-3CEJ67I5.js} +1 -1
  11. package/chunk-3E2EKFPH.js +1 -0
  12. package/{chunk-XFW6LFAM.js → chunk-3ENMEUVK.js} +1 -1
  13. package/chunk-3H5KBX4R.js +1 -0
  14. package/chunk-3XLREP6U.js +297 -0
  15. package/{chunk-63XPN7AG.js → chunk-4CUA33JH.js} +1 -1
  16. package/chunk-4NSHHAXV.js +1 -0
  17. package/{chunk-OVUTH3B6.js → chunk-5AITWOQZ.js} +1 -1
  18. package/{chunk-VET2QT6C.js → chunk-5QVQY32E.js} +1 -1
  19. package/chunk-6DPW74DP.js +1 -0
  20. package/{chunk-FOSJHYSQ.js → chunk-6NCHCAKY.js} +3 -3
  21. package/{chunk-HBVENULS.js → chunk-7DRL5PZZ.js} +1 -1
  22. package/chunk-7G6KXHQB.js +1 -0
  23. package/{chunk-W5VZK5LZ.js → chunk-7KQDKLO4.js} +1 -1
  24. package/{chunk-VHNXAKFS.js → chunk-7U2775BI.js} +1 -1
  25. package/{chunk-OPNWLQQY.js → chunk-7U2I35GP.js} +1 -1
  26. package/{chunk-5MHVGNVO.js → chunk-A47VRZZB.js} +1 -1
  27. package/{chunk-JWPV2SP2.js → chunk-ACQX2T2H.js} +1 -1
  28. package/chunk-AG7353CN.js +1 -0
  29. package/chunk-AI6YS6T2.js +1 -0
  30. package/{chunk-S6JRFIGG.js → chunk-ANMXAMBL.js} +1 -1
  31. package/{chunk-K5GIEJY3.js → chunk-ARSLNNKY.js} +4 -4
  32. package/chunk-AT7II4DO.js +7 -0
  33. package/{chunk-OUJ6CGAI.js → chunk-BCXNVGDH.js} +1 -1
  34. package/chunk-BJNN42CI.js +1 -0
  35. package/chunk-CSQ4MHL2.js +246 -0
  36. package/chunk-DG6ETDOW.js +1 -0
  37. package/{chunk-ELUESCCC.js → chunk-DIX7J6JH.js} +1 -1
  38. package/chunk-DMVAXVYQ.js +1 -0
  39. package/{chunk-4FHVIHSY.js → chunk-DNSQSWOS.js} +1 -1
  40. package/chunk-F3PEWQT7.js +1 -0
  41. package/{chunk-PCZW753D.js → chunk-FTVGAWDW.js} +1 -1
  42. package/{chunk-M66SFDOI.js → chunk-FUCSF42O.js} +1 -1
  43. package/chunk-FXUC6M2U.js +1 -0
  44. package/{chunk-UHDEQNDX.js → chunk-GCGWIESO.js} +1 -1
  45. package/{chunk-DERWDCI5.js → chunk-GY53MWXH.js} +5 -5
  46. package/{chunk-FJ7IM55X.js → chunk-H4V6YZX2.js} +1 -1
  47. package/chunk-IHJLTHHQ.js +1 -0
  48. package/{chunk-KOC7QQ5A.js → chunk-J6H3BBKP.js} +1 -1
  49. package/{chunk-5CZUTVXD.js → chunk-JG5HGOEX.js} +1 -1
  50. package/{chunk-OBBJFGOA.js → chunk-LFDCJISD.js} +1 -1
  51. package/chunk-LFGL4ACG.css +1 -0
  52. package/{chunk-JDKSRPMM.js → chunk-LNRTAR2V.js} +1 -1
  53. package/chunk-LWKS2JEV.js +1 -0
  54. package/chunk-N2XLL6HJ.js +33 -0
  55. package/chunk-NM37SDQJ.js +1 -0
  56. package/chunk-NN6GSTBJ.js +1 -0
  57. package/chunk-NRULEUE7.js +1 -0
  58. package/{chunk-4EDEITTK.js → chunk-O2GA6PH7.js} +1 -1
  59. package/{chunk-PAQGWJ3J.js → chunk-OAD4GTH6.js} +1 -1
  60. package/chunk-OCIKQOWD.js +328 -0
  61. package/{chunk-JBLYOAVS.js → chunk-PJKHUCJX.js} +1 -1
  62. package/chunk-PRRU3DEZ.js +503 -0
  63. package/{chunk-TO47DVWB.js → chunk-PZBZVQUY.js} +1 -1
  64. package/chunk-Q2IWISMY.js +1 -0
  65. package/{chunk-V4MEQMDJ.js → chunk-Q5BXN24W.js} +3 -3
  66. package/{chunk-EDPSZYHH.js → chunk-QIXIZZPY.js} +1 -1
  67. package/{chunk-Q3HG4BLC.js → chunk-RANHETC3.js} +2 -2
  68. package/{chunk-HGUXJRBI.js → chunk-RQEEJGOE.js} +1 -1
  69. package/{chunk-GO3ETPB7.js → chunk-SGXU6X3O.js} +1 -1
  70. package/chunk-TDDTBHQE.js +1 -0
  71. package/{chunk-W56XJVPD.js → chunk-TNWHAKS6.js} +1 -1
  72. package/{chunk-ZZNYX7MX.js → chunk-TPGKCMVN.js} +1 -1
  73. package/{chunk-CP57YBBI.js → chunk-TYETQJ2X.js} +2 -2
  74. package/{chunk-FNWWNWQP.js → chunk-U5LD55IP.js} +1 -1
  75. package/chunk-U6SRN7P3.js +1 -0
  76. package/{chunk-CCE4VMYO.js → chunk-V3B32QFK.js} +1 -1
  77. package/chunk-VBCJCAMN.js +1 -0
  78. package/chunk-W76GKZZU.js +1 -0
  79. package/{chunk-Z5SFK23M.js → chunk-WAJWW3TC.js} +1 -1
  80. package/{chunk-WLFERE5C.js → chunk-WM3NKRKN.js} +1 -1
  81. package/{chunk-GYOO2JKC.js → chunk-X4EHZEMZ.js} +1 -1
  82. package/chunk-X5SV4H5B.js +1 -0
  83. package/chunk-YQFG5XE2.js +1 -0
  84. package/chunk-YWYF6P7O.js +1 -0
  85. package/chunk-YYUWLV5N.js +1 -0
  86. package/{chunk-OWUXXKGD.js → chunk-ZB6TB7JI.js} +3 -3
  87. package/{chunk-PZRWSIXN.js → chunk-ZPTNYW2S.js} +1 -1
  88. package/{chunk-7CAU344O.js → chunk-ZUALJ33O.js} +1 -1
  89. package/index.html +2 -2
  90. package/main-L6WVDQUB.js +1 -0
  91. package/main-YYIZ54AR.css +1 -0
  92. package/package.json +1 -1
  93. package/styles-7FHABE27.css +1 -0
  94. package/chunk-2GAPYNNZ.js +0 -1
  95. package/chunk-2HYLQR56.js +0 -1
  96. package/chunk-2VTAWSHV.js +0 -1
  97. package/chunk-3R4UQAEP.js +0 -1
  98. package/chunk-3SPHZLLV.js +0 -301
  99. package/chunk-4OHRBQE4.js +0 -1
  100. package/chunk-4TTJBC5I.js +0 -1
  101. package/chunk-74EMBNLM.js +0 -1
  102. package/chunk-75NY4EHJ.js +0 -7
  103. package/chunk-BS6MB7HD.js +0 -1
  104. package/chunk-C54Z7Z3J.js +0 -246
  105. package/chunk-EQDQRRRY.js +0 -1
  106. package/chunk-GH3BVHFE.js +0 -1
  107. package/chunk-GYI6FJNZ.js +0 -1
  108. package/chunk-HF7H6NPN.js +0 -1
  109. package/chunk-MOGY4H6O.js +0 -1
  110. package/chunk-PMQ7L7VQ.js +0 -1
  111. package/chunk-PRVKVHZC.js +0 -1
  112. package/chunk-QEQCMTMU.js +0 -1
  113. package/chunk-QMXENXYW.js +0 -1
  114. package/chunk-R4CV5F66.js +0 -1
  115. package/chunk-RJZW77TO.js +0 -1
  116. package/chunk-W37QK7Z5.js +0 -520
  117. package/chunk-WF2ZEF5P.js +0 -1
  118. package/chunk-WZ5MSCDB.js +0 -1
  119. package/chunk-YAEJRHVD.js +0 -1
  120. package/chunk-ZQKGNYP5.js +0 -297
  121. package/main-G22CDQKS.js +0 -1
  122. package/styles-ETBLCGC3.css +0 -1
@@ -0,0 +1,7 @@
1
+ import{a as St}from"./chunk-NRULEUE7.js";import{a as Se,b as Ce,d as ht,e as xt}from"./chunk-J6H3BBKP.js";import{a as Te,b as Le}from"./chunk-3XLREP6U.js";import{a as Ct,b as ye}from"./chunk-TDDTBHQE.js";import"./chunk-ZUALJ33O.js";import"./chunk-5QVQY32E.js";import{b as yt}from"./chunk-4CUA33JH.js";import{c as Fe,d as Re}from"./chunk-PZBZVQUY.js";import{a as Ie}from"./chunk-QIXIZZPY.js";import{a as W,b as Y}from"./chunk-ZPTNYW2S.js";import{b as fe,c as ge,f as _t,g as ft,h as he,l as xe}from"./chunk-GY53MWXH.js";import{g as we}from"./chunk-6NCHCAKY.js";import"./chunk-5AITWOQZ.js";import{e as st}from"./chunk-ACQX2T2H.js";import{a as gt}from"./chunk-A47VRZZB.js";import{a as A}from"./chunk-W76GKZZU.js";import{c as ae,d as le}from"./chunk-JG5HGOEX.js";import{b as _e}from"./chunk-7U2I35GP.js";import{f as ut,g as ue}from"./chunk-ZB6TB7JI.js";import"./chunk-7KQDKLO4.js";import{a as L,b as pe,c as me,d as ce,e as se,f as de,g as dt}from"./chunk-H4V6YZX2.js";import{C as oe,D as re}from"./chunk-WAJWW3TC.js";import{c as pt,e as X,f as Z,g as mt,i as G,k as ee,m as te,p as ie,u as ct,w as De,z as ne}from"./chunk-U6SRN7P3.js";import"./chunk-TPGKCMVN.js";import"./chunk-BCXNVGDH.js";import{a as at,d as lt}from"./chunk-U5LD55IP.js";import"./chunk-F2X3VGZZ.js";import{d as ot,n as rt,q as J,x as Q}from"./chunk-TYETQJ2X.js";import{j as it,m as Ee,r as nt,s as K,t as $}from"./chunk-353U23ZQ.js";import{$b as w,Ac as I,Bb as S,D as be,Ga as R,Ib as $e,Jb as Je,Jc as x,Kc as C,Lb as c,Lc as et,Mc as s,Ob as N,Qb as O,Rb as Qe,Tb as Xe,Ub as Ze,V as ze,Vb as i,W as Ue,Wb as n,X as j,Xb as E,Yc as T,Z as k,Zc as tt,ba as He,c as P,cb as Ke,ec as F,fc as d,gb as l,ha as h,pa as v,qa as b,qc as o,rc as u,s as Ye,sc as M,vb as V,vc as z,wc as q,xc as U,yc as H,zc as D}from"./chunk-ARSLNNKY.js";import{a as g,b as y,c as Ve,e as We}from"./chunk-YQFG5XE2.js";var B=(()=>{class t{constructor(){this.httpService=h(lt),this.authService=h(Ie)}fetchGeneralLedgerLoader(e={}){return this.httpService.post(void 0,"api/GeneralLedgerLoader/GetFilter",e)}fetchGeneralLedgerReport(e){return this.httpService.post(void 0,"api/GeneralLedger/Get",e)}exportGeneralLedger(e){let a={responseType:"blob"};return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,a)}getCustomerSuggestions(e){let a={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:a})}getSupplierSuggestions(e){let a={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:a})}getCashierSuggestions(e){let a={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:a})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,a={}){let r=new ot({fromObject:Object.fromEntries(Object.entries(e).map(([_,f])=>[_,String(f)]))}),m=g({params:r},a);return this.httpService.get(void 0,"/api/BalanceSheet",m)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,a={}){return this.httpService.post(void 0,"api/IncomeStatement/List",g({},e),a)}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275prov=He({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var At={metadata:{filter:{categoryID:"",from:new Date().toISOString(),to:new Date().toISOString(),iDs:[],outletIDs:[]},options:{accounts:[],outlets:[]},roles:{isInEmptyOutletRole:!1}},items:{data:[],pageTitle:""},filter:{listAccountID:[],categoryID:null,OutletID:[],ContactID:null,from:null,to:null}},Me=pe(de(At),dt("General Ledger Store"),me(t=>({hasData:T(()=>Array.isArray(t.items().data)&&t.items().data.length>0)})),se(t=>{let p=h(B),e={updateFilter:a=>{L(t,r=>y(g({},r),{filter:a}))},loadList:W(P(be(a=>Array.isArray(a.listAccountID)&&a.listAccountID.length>0),j(a=>p.fetchGeneralLedgerReport(a).pipe(Y({next:r=>{L(t,m=>y(g({},m),{items:r}))},error:r=>{console.error(r)}}))))),loadLoader:W(P(j(a=>p.fetchGeneralLedgerLoader(a).pipe(Y({next:r=>{L(t,m=>y(g({},m),{metadata:r,filter:y(g({},m.filter),{categoryID:r.filter.categoryID})})),e.loadList(t.filter)},error:r=>{console.error(r)}}))),A("res")))};return e}),ce({onInit:t=>{t.loadLoader({})}}));var Nt=()=>({height:"calc(100vh - 70px)"}),qt=()=>({height:"calc(100vh - 100px)"}),Wt=t=>["/journal/journal-entry/",t],Yt=t=>({"ng-invalid ng-dirty":t}),zt=()=>({scrollHeight:"250px"});function Ut(t,p){if(t&1){let e=w();i(0,"div",11)(1,"a",12),o(2,"Return to Accounts"),n(),i(3,"p-button",13),F("onClick",function(){v(e);let r=d();return b(r.onExport())}),n()()}}function Ht(t,p){if(t&1&&(i(0,"div",11)(1,"span",16)(2,"h3",17),o(3),n()(),i(4,"span",16)(5,"h3",17),o(6),n()()()),t&2){let e=d().$implicit;l(3),u(e.name),l(3),M(" (",e.chartOfAccountCode,") ")}}function Kt(t,p){t&1&&(i(0,"tr")(1,"th"),o(2,"Outlet"),n(),i(3,"th"),o(4,"No."),n(),i(5,"th"),o(6,"Date"),n(),i(7,"th"),o(8,"Name"),n(),i(9,"th"),o(10,"Description"),n(),i(11,"th"),o(12,"Debit"),n(),i(13,"th"),o(14,"Credit"),n(),i(15,"th"),o(16,"Balance"),n()())}function $t(t,p){t&1&&o(0," Starting Balance ")}function Jt(t,p){t&1&&o(0," \xA0 ")}function Qt(t,p){if(t&1&&(i(0,"tr")(1,"td",18),S(2,$t,1,0)(3,Jt,1,0),n(),i(4,"td",19),o(5),x(6,"number"),n()(),i(7,"tr")(8,"td"),o(9),n(),i(10,"td")(11,"a",20),o(12),n()(),i(13,"td"),o(14),x(15,"date"),n(),i(16,"td")(17,"a",21),o(18),n()(),E(19,"td"),i(20,"td",19),o(21),x(22,"number"),n(),i(23,"td",19),o(24),x(25,"number"),n(),i(26,"td",19),o(27),x(28,"number"),n()()),t&2){let e=p.$implicit,a=p.rowIndex,r=d().$implicit,m=d(3);l(2),O(a===0?2:3),l(3),M(" ",C(6,11,r.startBalance)," "),l(4),u(e.outletName),l(2),c("routerLink",I(22,Wt,e.id)),l(),u(e.number),l(2),u(et(15,13,e.date,"dd MMM yyyy")),l(3),c("href",m.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Ke),l(),u(e.contactName),l(3),u(C(22,16,e.debitAmount)),l(3),u(C(25,18,e.creditAmount)),l(3),u(C(28,20,e.balance))}}function Xt(t,p){if(t&1&&(i(0,"tr"),E(1,"td",22),i(2,"td",23),o(3,"Total"),n(),i(4,"td",23),o(5),x(6,"number"),n(),i(7,"td",23),o(8),x(9,"number"),n(),E(10,"td"),n()),t&2){let e=d(4);l(5),M(" ",C(6,2,e.store.items().data[0].debitTotal)," "),l(3),M(" ",C(9,4,e.store.items().data[0].creditTotal)," ")}}function Zt(t,p){t&1&&(i(0,"tr")(1,"td",24)(2,"span"),o(3,"No records found."),n()()())}function ei(t,p){if(t&1&&(i(0,"p-table",15),S(1,Ht,7,2,"ng-template",null,3,s)(3,Kt,17,0,"ng-template",null,4,s)(5,Qt,29,24,"ng-template",null,5,s)(7,Xt,11,6,"ng-template",null,6,s)(9,Zt,4,0,"ng-template",null,7,s),n()),t&2){let e=p.$implicit;c("value",e.data)("scrollable",!0)}}function ti(t,p){if(t&1&&(i(0,"p-panel")(1,"p-scroll-panel"),Xe(2,ei,11,2,"p-table",15,Qe),n()()),t&2){let e=d(2);N(D(4,Nt)),l(),N(D(5,qt)),l(),Ze(e.store.items().data)}}function ii(t,p){if(t&1&&S(0,ti,4,6,"p-panel",14),t&2){let e=d();c("ngIf",e.store.items()&&e.store.items().data.length)}}function ni(t,p){if(t&1&&(i(0,"div",11)(1,"div",16)(2,"span",40),o(3),n()(),i(4,"div")(5,"span"),o(6,"-"),n()(),i(7,"div",16)(8,"span",41),o(9),n()()()),t&2){let e=p.$implicit;l(3),M("(",e.code,")"),l(6),u(e.name)}}function oi(t,p){if(t&1&&(i(0,"div",11)(1,"div",16)(2,"span",40),o(3),n()(),i(4,"div")(5,"span"),o(6,"-"),n()(),i(7,"div",16)(8,"span",41),o(9),n()()()),t&2){let e=p.$implicit;l(3),M("(",e.code,")"),l(6),u(e.name)}}function ri(t,p){if(t&1&&(i(0,"div",42)(1,"div"),o(2),n()()),t&2){let e=p.$implicit;l(2),u(e.value)}}function ai(t,p){if(t&1){let e=w();i(0,"div",26)(1,"label",27),o(2,"Customer"),n(),i(3,"p-autocomplete",43),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchCustomer(r))}),n()()}if(t&2){let e=d(2);l(3),c("suggestions",e.customerSuggestions())}}function li(t,p){if(t&1){let e=w();i(0,"div",26)(1,"label",27),o(2,"Supplier"),n(),i(3,"p-autocomplete",43),F("completeMethod",function(r){v(e);let m=d(2);return b(m.searchSupplier(r))}),n()()}if(t&2){let e=d(2);l(3),c("suggestions",e.supplierSuggestions())}}function pi(t,p){if(t&1){let e=w();i(0,"form",25)(1,"div",26)(2,"label",27),o(3,"Accounts"),n(),i(4,"p-multiselect",28),F("onChange",function(r){v(e);let m=d();return b(m.onAccountChange(r))}),S(5,ni,10,2,"ng-template",null,8,s)(7,oi,10,2,"ng-template",null,9,s),n()(),i(9,"div",26)(10,"label",27),o(11,"From"),n(),E(12,"p-datepicker",29),n(),i(13,"div",26)(14,"label",27),o(15,"To"),n(),E(16,"p-datepicker",30),n(),i(17,"div",26)(18,"label",27),o(19,"Outlets"),n(),i(20,"p-multiselect",31),S(21,ri,3,1,"ng-template",null,9,s),n()(),i(23,"div",26)(24,"label",27),o(25,"Category"),n(),i(26,"p-treeselect",32),F("onFocus",function(){v(e);let r=d();return b(r.onCategoryFocus())}),n()(),i(27,"div",26)(28,"label",33),o(29,"Contact Type"),n(),i(30,"div",34)(31,"div",35),E(32,"p-radiobutton",36),i(33,"label",37),o(34,"Customer"),n()(),i(35,"div",35),E(36,"p-radiobutton",38),i(37,"label",39),o(38,"Supplier"),n()()()(),S(39,ai,4,1,"div",26)(40,li,4,1,"div",26),n()}if(t&2){let e=d();c("formGroup",e.generalLedgerFilterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("maxlength",5)("options",e.store.metadata().options.accounts)("ngClass",I(20,Yt,e.generalLedgerFilterForm.get("listAccountID").invalid&&e.generalLedgerFilterForm.get("listAccountID").touched||e.generalLedgerFilterForm.get("listAccountID").dirty)),l(8),c("iconDisplay","input")("showIcon",!0),l(4),c("iconDisplay","input")("showIcon",!0),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets),l(6),c("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",D(22,zt))("options",e.categoriesOptions()),l(6),c("value",0),l(4),c("value",1),l(3),O(e.generalLedgerFilterForm.get("contactType").value?40:39)}}var Tt=function(t){return t[t.Customer=0]="Customer",t[t.Supplier=1]="Supplier",t}(Tt||{}),Lt=(()=>{class t{constructor(){this.dialogFilterVisible=R(!1),this.reportService=h(B),this.coaService=h(gt),this.authService=h(Ie),this.store=h(Me),this.categoriesOptions=R([]),this.customerSuggestions=R([]),this.supplierSuggestions=R([]),this.route=h(rt),this.dayjsService=h(ye),this.initDialogVisible=R(!0),this.fb=h(De),this.toastr=h(at)}ngOnInit(){this.generateFilterForm(),this.route.queryParamMap.pipe(Ye(e=>e.get("id")),k(e=>{e&&(this.initDialogVisible.update(a=>!a),this.generalLedgerFilterForm.patchValue({listAccountID:[e]}),this.store.updateFilter(y(g({},this.store.filter()),{listAccountID:[e]})))})).subscribe(),this.clearContactValueOnContactTypeChange()}clearContactValueOnContactTypeChange(){this.generalLedgerFilterForm.get("contactType")?.valueChanges.subscribe(()=>this.generalLedgerFilterForm.get("ContactID")?.setValue(""))}onAccountChange(e){console.log("Account Change Event:",e),Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at least 5 accounts for the general ledger report.","Warning")}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(A("getCachedCategoriesOptions"),k(e=>this.categoriesOptions.set(e))).subscribe()}generateFilterForm(){this.generalLedgerFilterForm=this.fb.group({listAccountID:new G([],[pt.required]),categoryID:new G(null),OutletID:new G([]),ContactID:new G(""),from:new G(null),to:new G(null),contactType:[Tt.Customer]})}onFilterEvent(e){console.log(e),this.dialogFilterVisible.update(a=>!a)}onFilterOKEvent(){let _=this.generalLedgerFilterForm.value,{from:e,to:a}=_,r=Ve(_,["from","to"]);if(this.generalLedgerFilterForm.invalid){this.generalLedgerFilterForm.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let m={categoryID:r.categoryID?.key??null,ContactID:r.ContactID.length?r.ContactID:null,OutletID:r.OutletID.length?r.OutletID:null,listAccountID:r.listAccountID,from:this.dayjsService.from(e)?this.dayjsService.from(e).format():null,to:this.dayjsService.from(a)?this.dayjsService.from(a).format():null};this.dialogFilterVisible.update(f=>!f),this.store.updateFilter(m),this.dialogFilterVisible.set(!1)}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(k(a=>this.customerSuggestions.set(a))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(k(a=>this.supplierSuggestions.set(a))).subscribe()}onExport(){let _=this.generalLedgerFilterForm.value,{from:e,to:a}=_,r=Ve(_,["from","to"]),m={categoryID:r.categoryID?.key??null,ContactID:r.ContactID.length?r.ContactID:null,OutletID:r.OutletID.length?r.OutletID:null,listAccountID:r.listAccountID,from:this.dayjsService.from(e)?this.dayjsService.from(e).format():null,to:this.dayjsService.from(a)?this.dayjsService.from(a).format():null};this.reportService.exportGeneralLedger(m).pipe(A("exportGeneralLedger"),k(f=>{St(f,`general-ledger-${this.dayjsService.now.format("D-MM-YYYY")}.${f.type.split("/")[1]}`,f.type)})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=V({type:t,selectors:[["app-report-general-ledger"]],features:[H([Me])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["caption",""],["header",""],["body",""],["footer",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["routerLink","/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"style",4,"ngIf"],["scrollHeight","calc(100vh - 150px)",3,"value","scrollable"],[1,""],[1,"fs-5","fw-semibold"],["colspan","7",1,"text-end"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"href"],["colspan","4"],[1,"text-end","fw-semibold"],["colspan","8"],[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","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","maxlength","options","ngClass"],["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","OutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","filter","","filterBy","label","formControlName","categoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","id","placeholder","Select Category",3,"onFocus","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],["for",""],[1,"d-flex","gap-3"],[1,"d-flex","align-items-center","gap-2"],["name","contactType","formControlName","contactType","inputId","customer",3,"value"],["for","customer",1,"m-0"],["name","contactType","formControlName","contactType","inputId","supplier",3,"value"],["for","supplier",1,"m-0"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"flex","items-center","gap-2"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"]],template:function(a,r){if(a&1){let m=w();i(0,"app-main-panel",10),U("isDialogFilterVisibleChange",function(f){return v(m),q(r.dialogFilterVisible,f)||(r.dialogFilterVisible=f),b(f)})("isInitDialogFilterVisibleChange",function(f){return v(m),q(r.initDialogVisible,f)||(r.initDialogVisible=f),b(f)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),S(1,Ut,4,0,"ng-template",null,0,s)(3,ii,1,1,"ng-template",null,1,s)(5,pi,41,23,"ng-template",null,2,s),n()}a&2&&(c("pageTitle",r.store.items().pageTitle.length?r.store.items().pageTitle:"General Ledger"),z("isDialogFilterVisible",r.dialogFilterVisible),c("isFilterable",!0),z("isInitDialogFilterVisible",r.initDialogVisible))},dependencies:[ue,$,it,Ee,K,nt,_e,xe,he,ut,re,oe,we,ge,fe,Le,Te,ne,ee,X,Z,ct,te,ie,Ce,Se,Re,Fe,st,xt,ht,yt,le,ae,Q,J,ft,_t],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var mi={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},Be=pe(de(mi),me(t=>{let p={totalCOGS:T(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((a,r)=>a+(r?.amount??0),0):0}),totalRevenue:T(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((a,r)=>a+(r?.amount??0),0):0}),totalExpense:T(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((a,r)=>a+(r?.amount??0),0):0}),grossProfit:T(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?p.totalRevenue()-p.totalCOGS():0),profitOrLoss:T(()=>p.totalRevenue()-p.totalCOGS()-p.totalExpense()),isDataEmpty:T(()=>Object.keys(t.data()?.data??{}).length===0)};return p}),se(t=>{let p=h(B),e=h(ye),a={updateFilter(r){L(t,m=>y(g({},m),{filter:g(g({},m.filter),r)}))},getLoader:W(P(j(()=>p.getIncomeStatementLoader().pipe(Y({next:r=>{L(t,m=>y(g({},m),{loader:r,filter:y(g({},m.filter),{from:e.from(r.filter.from).format(),to:e.from(r.filter.to).format()})})),a.getIncomeStatement(t.filter)},error:r=>{console.error(r)}}))))),getIncomeStatement:W(P(j(r=>p.getIncomeStatement(r).pipe(Ue(()=>L(t,m=>y(g({},m),{isLoading:!0}))),Y({next:m=>{L(t,_=>y(g({},_),{data:m,isLoading:!1}))},error:m=>{console.error(m)}})))))};return a}),ce({onInit:t=>{t.getLoader()}}));var ci=()=>[Ee,K,he,ae,import("./chunk-6DPW74DP.js").then(t=>t.ScrollPanel),J],si=()=>({height:"calc(100vh - 70px)"}),di=()=>({height:"calc(100vh - 150px)"}),ke=t=>["/chart-of-account/account/",t],Oe=()=>["/report/general-ledger"],Ge=t=>({id:t});function ui(t,p){if(t&1){let e=w();i(0,"div",8)(1,"p-button",9),F("onClick",function(){v(e);let r=d();return b(r.onExport())}),n()()}}function _i(t,p){t&1&&(i(0,"tr")(1,"th",14),o(2,"Code"),n(),i(3,"th",15),o(4,"Name"),n(),i(5,"th",16),o(6,"Total"),n()())}function fi(t,p){if(t&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td")(4,"a",17),o(5),n()(),i(6,"td",16)(7,"a",18),o(8),x(9,"number"),n()()()),t&2){let e=p.$implicit;l(2),u(e.code),l(2),c("routerLink",I(8,ke,e.accountID)),l(),u(e.name),l(2),c("routerLink",D(10,Oe))("queryParams",I(11,Ge,e.accountID)),l(),u(C(9,6,e.amount))}}function gi(t,p){if(t&1&&(i(0,"tr"),E(1,"td",19),i(2,"td",20)(3,"div",21)(4,"span",22),o(5,"Total Revenue :"),n(),i(6,"span",23),o(7),x(8,"number"),n()()()()),t&2){let e=d(5);l(7),u(C(8,1,e.store.totalRevenue()))}}function hi(t,p){t&1&&(i(0,"tr")(1,"td",24)(2,"span"),o(3,"No revenue records available"),n()()())}function xi(t,p){if(t&1&&(i(0,"h6",12),o(1,"Revenue"),n(),i(2,"p-table",13),S(3,_i,7,0,"ng-template",null,3,s)(5,fi,10,13,"ng-template",null,4,s)(7,gi,9,3,"ng-template",null,5,s)(9,hi,4,0,"ng-template",null,6,s),n()),t&2){let e,a=d(4);l(2),c("value",(e=a.store.data())==null||e.data==null?null:e.data.revenue)}}function Si(t,p){t&1&&(i(0,"tr")(1,"th",14),o(2,"Code"),n(),i(3,"th",15),o(4,"Name"),n(),i(5,"th",25),o(6,"Total"),n()())}function Ci(t,p){if(t&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td")(4,"a",17),o(5),n()(),i(6,"td",16)(7,"a",18),o(8),x(9,"number"),n()()()),t&2){let e=p.$implicit;l(2),u(e.code),l(2),c("routerLink",I(8,ke,e.accountID)),l(),u(e.name),l(2),c("routerLink",D(10,Oe))("queryParams",I(11,Ge,e.AccountID)),l(),u(C(9,6,e.amount))}}function yi(t,p){if(t&1&&(i(0,"tr"),E(1,"td",26),i(2,"td",20)(3,"div",21)(4,"span",22),o(5,"Total COGS :"),n(),i(6,"span",23),o(7),x(8,"number"),n()()()(),i(9,"tr"),E(10,"td",26),i(11,"td",20)(12,"div",21)(13,"span",22),o(14,"Gross Profit :"),n(),i(15,"span",23),o(16),x(17,"number"),n()()()()),t&2){let e=d(5);l(7),u(C(8,2,e.store.totalCOGS())),l(9),u(C(17,4,e.store.grossProfit()))}}function vi(t,p){t&1&&(i(0,"tr")(1,"td",24)(2,"span"),o(3,"No COGS records available"),n()()())}function bi(t,p){if(t&1&&(i(0,"h4",12),o(1,"COGS"),n(),i(2,"p-table",13),S(3,Si,7,0,"ng-template",null,3,s)(5,Ci,10,13,"ng-template",null,4,s)(7,yi,18,6,"ng-template",null,5,s)(9,vi,4,0,"ng-template",null,6,s),n()),t&2){let e,a=d(4);l(2),c("value",(e=a.store.data())==null||e.data==null?null:e.data.cogs)}}function Ei(t,p){t&1&&(i(0,"tr")(1,"th",14),o(2,"Code"),n(),i(3,"th",15),o(4,"Name"),n(),i(5,"th",16),o(6,"Total"),n()())}function Ii(t,p){if(t&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td")(4,"a",17),o(5),n()(),i(6,"td",16)(7,"a",18),o(8),x(9,"number"),n()()()),t&2){let e=p.$implicit;l(2),u(e.code),l(2),c("routerLink",I(8,ke,e.accountID)),l(),u(e.name),l(2),c("routerLink",D(10,Oe))("queryParams",I(11,Ge,e.AccountID)),l(),u(C(9,6,e.amount))}}function Di(t,p){if(t&1&&(i(0,"tr"),E(1,"td",26),i(2,"td",20)(3,"div",21)(4,"span",22),o(5,"Total Expense :"),n(),i(6,"span",23),o(7),x(8,"number"),n()()()(),i(9,"tr"),E(10,"td",26),i(11,"td",20)(12,"div",21)(13,"span",22),o(14,"Profit / Loss :"),n(),i(15,"span",23),o(16),x(17,"number"),n()()()()),t&2){let e=d(5);l(7),u(C(8,2,e.store.totalExpense())),l(9),u(C(17,4,e.store.profitOrLoss()))}}function Fi(t,p){t&1&&(i(0,"tr")(1,"td",24)(2,"span"),o(3,"No expense records available"),n()()())}function Ri(t,p){if(t&1&&(i(0,"h4",12),o(1,"Expense"),n(),i(2,"p-table",13),S(3,Ei,7,0,"ng-template",null,3,s)(5,Ii,10,13,"ng-template",null,4,s)(7,Di,18,6,"ng-template",null,5,s)(9,Fi,4,0,"ng-template",null,6,s),n()),t&2){let e,a=d(4);l(2),c("value",(e=a.store.data())==null||e.data==null?null:e.data.expense)}}function wi(t,p){if(t&1&&(i(0,"p-scroll-panel")(1,"div",11),S(2,xi,11,1)(3,bi,11,1)(4,Ri,11,1),n()()),t&2){let e=d(3);N(D(5,di)),l(2),O(e.Object.keys(e.store.data().data).length>0?2:-1),l(),O(e.Object.keys(e.store.data().data.cogs).length>0?3:-1),l(),O(e.Object.keys(e.store.data().data.expense).length>0?4:-1)}}function Ti(t,p){if(t&1&&(i(0,"p-panel"),S(1,wi,5,6,"p-scroll-panel",10),n()),t&2){let e=d(2);N(D(3,si)),l(),c("ngIf",e.store.data())}}function Li(t,p){if(t&1&&(S(0,Ti,2,4),$e(1,0,ci)),t&2){let e=d();l(),Je(!e.store.isDataEmpty())}}function Vi(t,p){if(t&1){let e=w();i(0,"form",27)(1,"div",28)(2,"label",29),o(3,"Outlet"),n(),E(4,"p-multiselect",30),n(),i(5,"div",28)(6,"label",29),o(7,"Cashier"),n(),i(8,"p-autocomplete",31),F("completeMethod",function(r){v(e);let m=d();return b(m.onCashierSearch(r))}),n()(),i(9,"div",28)(10,"label",29),o(11,"From"),n(),E(12,"p-datepicker",32),n(),i(13,"div",28)(14,"label",29),o(15,"To"),n(),E(16,"p-datepicker",33),n()()}if(t&2){let e=d();c("formGroup",e.formFilter),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),l(4),c("showClear",!0)("suggestions",e.cashierSuggestions())}}var Vt=(()=>{class t{constructor(){this.dayjsService=h(ye),this.store=h(Be),this.fb=h(De),this.reportService=h(B),this.isInitDialogFilterVisible=R(!1),this.dialogFilterVisible=R(!1),this.cashierSuggestions=R([]),this.Object=Object,tt(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm()}onSearch(e){this.store.updateFilter(y(g({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(A("Cashier Suggestions"),k(a=>this.cashierSuggestions.set(a))).subscribe()}initForm(){let e=this.store.filter();this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(e.CashierID??null),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(),a=Object.entries(e).reduce((r,[m,_])=>(m==="from"||m==="to"?_ instanceof Date&&(r[m]=this.dayjsService.from(_).format()):m==="CashierID"?r[m]=Object.prototype.hasOwnProperty.call("Key",_)?_.Key:null:r[m]=_||null,r),{});this.store.updateFilter(g(g({},this.store.filter()),a)),this.dialogFilterVisible.update(r=>!r),console.log("body",e)}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(A("Export Profit & Loss"),k(a=>{let r=a.type,m=[a],_=document.createElement("a");_.href=window.URL.createObjectURL(new Blob(m,{type:r}));let f=`profit-and-loss.${r.split("/")[1]}`;_.setAttribute("download",f),document.body.appendChild(_),_.click(),document.body.removeChild(_)})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=V({type:t,selectors:[["app-report-income-statement"]],features:[H([Be])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"style",4,"ngIf"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-bolder"],[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","2 ",1,"fw-semibold","text-end",2,"width","50%"],[1,"text-end","fw-semibold"],[1,"row"],[1,"col-9"],[1,"col"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],["colspan","2",1,"fw-semibold"],[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","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","showClear","suggestions"],["formControlName","from","styleClass","w-100","appendTo","body"],["formControlName","to","styleClass","w-100","appendTo","body"]],template:function(a,r){if(a&1){let m=w();i(0,"app-main-panel",7),U("isDialogFilterVisibleChange",function(f){return v(m),q(r.dialogFilterVisible,f)||(r.dialogFilterVisible=f),b(f)})("isInitDialogFilterVisibleChange",function(f){return v(m),q(r.isInitDialogFilterVisible,f)||(r.isInitDialogFilterVisible=f),b(f)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOK())}),S(1,ui,2,0,"ng-template",null,0,s)(3,Li,3,1,"ng-template",null,1,s)(5,Vi,17,7,"ng-template",null,2,s),n()}a&2&&(c("isFilterable",!0)("pageTitle",r.store.data().pageTitle),z("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[ue,$,we,ge,fe,ne,ee,X,Z,te,ie,Ce,Se,_e,xe,le,Q,Le,Te,re,oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ae=We(Ct());var Mi={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,Ae.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Pe=pe(de(Mi),me(t=>({totalAsset:T(()=>t.data().asset.reduce((p,e)=>p+ +e.amount,0)),totalLiability:T(()=>t.data().liability.reduce((p,e)=>p+ +e.amount,0)),totalEquity:T(()=>t.data().equity.reduce((p,e)=>p+ +e.counterAmount,0))})),se(t=>{let p=h(B),e={updateFilter:a=>{L(t,r=>y(g({},r),{filter:a}))},fetchBalanceSheet:W(P(be(()=>{let a=t.filter();return Object.entries(a).every(([r,m])=>m!=null&&m!=="")}),j(a=>p.getBalanceSheet(a).pipe(Y({next:r=>{L(t,m=>y(g({},m),{data:r}))},error:r=>{console.error(r)}}))),ze(1))),fetchLoader:W(P(j(()=>p.getBalanceSheetLoader().pipe(Y({next:a=>{L(t,r=>y(g({},r),{metadata:a,filter:{date:(0,Ae.default)(a.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:a=>{console.error(a)}})))))};return e}),ce(t=>({onInit:()=>{t.fetchLoader()}})));var Mt=We(Ct());var Bi=()=>({height:"calc(100vh - 70px)"}),ki=()=>({height:"calc(100vh - 100px)"}),je=t=>["/chart-of-account/account/",t],Ne=()=>["/report/general-ledger"],qe=t=>({id:t});function Oi(t,p){if(t&1){let e=w();i(0,"div",9)(1,"p-button",10),F("onClick",function(){v(e);let r=d();return b(r.onExport())}),n()()}}function Gi(t,p){t&1&&(i(0,"tr")(1,"th",15),o(2,"Code"),n(),i(3,"th"),o(4,"Asset"),n(),i(5,"th",16),o(6,"Total"),n()())}function Ai(t,p){if(t&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td")(4,"a",17),o(5),n()(),i(6,"td",18)(7,"a",19),o(8),x(9,"number"),n()()()),t&2){let e=p.$implicit;l(2),u(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),u(e.name),l(2),c("routerLink",D(10,Ne))("queryParams",I(11,qe,e.accountID)),l(),u(C(9,6,e.amount))}}function Pi(t,p){if(t&1&&(i(0,"tr")(1,"td",20),o(2,"Total Asset"),n(),i(3,"td",21),o(4),x(5,"number"),n()()),t&2){let e=d(3);l(4),M(" ",C(5,1,e.store.totalAsset())," ")}}function ji(t,p){t&1&&(i(0,"tr")(1,"td",22)(2,"span"),o(3,"No asset records found."),n()()())}function Ni(t,p){if(t&1&&(i(0,"h4",13),o(1,"Asset"),n(),i(2,"p-table",14),S(3,Gi,7,0,"ng-template",null,3,s)(5,Ai,10,13,"ng-template",null,4,s)(7,Pi,6,3,"ng-template",null,5,s)(9,ji,4,0,"ng-template",null,6,s),n()),t&2){let e=d(2);l(2),c("value",e.store.data().asset)}}function qi(t,p){t&1&&(i(0,"tr")(1,"th",15),o(2,"Code"),n(),i(3,"th"),o(4,"Liability"),n(),i(5,"th",16),o(6,"Total"),n()())}function Wi(t,p){if(t&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td")(4,"a",24),o(5),n()(),i(6,"td",18)(7,"a",19),o(8),x(9,"number"),n()()()),t&2){let e=p.$implicit;l(2),u(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),u(e.name),l(2),c("routerLink",D(10,Ne))("queryParams",I(11,qe,e.accountID)),l(),u(C(9,6,e.amount))}}function Yi(t,p){if(t&1&&(i(0,"tr")(1,"td",20),o(2," Total Liability "),n(),i(3,"td",21),o(4),x(5,"number"),n()()),t&2){let e=d(3);l(4),M(" ",C(5,1,e.store.totalLiability())," ")}}function zi(t,p){t&1&&(i(0,"tr")(1,"td",22)(2,"span"),o(3,"No liability records found."),n()()())}function Ui(t,p){if(t&1&&(i(0,"h4",23),o(1,"Liability"),n(),i(2,"p-table",14),S(3,qi,7,0,"ng-template",null,3,s)(5,Wi,10,13,"ng-template",null,4,s)(7,Yi,6,3,"ng-template",null,5,s)(9,zi,4,0,"ng-template",null,6,s),n()),t&2){let e=d(2);l(2),c("value",e.store.data().liability)}}function Hi(t,p){t&1&&(i(0,"tr")(1,"th",15),o(2,"Code"),n(),i(3,"th"),o(4,"Equity"),n(),i(5,"th",16),o(6,"Total"),n()())}function Ki(t,p){if(t&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td")(4,"a",17),o(5),n()(),i(6,"td",18)(7,"a",19),o(8),x(9,"number"),n()()()),t&2){let e=p.$implicit;l(2),u(e.code),l(2),c("routerLink",I(8,je,e.accountID)),l(),u(e.name),l(2),c("routerLink",D(10,Ne))("queryParams",I(11,qe,e.accountID)),l(),u(C(9,6,e.counterAmount))}}function $i(t,p){if(t&1&&(i(0,"tr")(1,"td",20),o(2,"Total Equity"),n(),i(3,"td",21),o(4),x(5,"number"),n()(),i(6,"tr")(7,"td",20),o(8," Total Liability + Equity "),n(),i(9,"td",21),o(10),x(11,"number"),n()()),t&2){let e=d(3);l(4),M(" ",C(5,2,e.store.totalEquity())," "),l(6),M(" ",C(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function Ji(t,p){t&1&&(i(0,"tr")(1,"td",22)(2,"span"),o(3,"No equity records found."),n()()())}function Qi(t,p){if(t&1&&(i(0,"h4",25),o(1,"Equity"),n(),i(2,"p-table",14),S(3,Hi,7,0,"ng-template",null,3,s)(5,Ki,10,13,"ng-template",null,4,s),o(7," <"),S(8,$i,12,6,"ng-template",null,5,s)(10,Ji,4,0,"ng-template",null,6,s),n()),t&2){let e=d(2);l(2),c("value",e.store.data().equity)}}function Xi(t,p){if(t&1&&(i(0,"p-panel",11)(1,"p-scroll-panel")(2,"div",12),S(3,Ni,11,1)(4,Ui,11,1)(5,Qi,12,1),n()()()),t&2){let e=d();N(D(8,Bi)),c("showHeader",!1),l(),N(D(9,ki)),l(2),O(e.Object.keys(e.store.data().asset).length>0?3:-1),l(),O(e.Object.keys(e.store.data().liability).length>0?4:-1),l(),O(e.Object.keys(e.store.data().equity).length>0?5:-1)}}function Zi(t,p){if(t&1&&(i(0,"div",31)(1,"div"),o(2),n()()),t&2){let e=p.$implicit;l(2),u(e.value)}}function en(t,p){if(t&1&&(i(0,"form",26)(1,"div",27)(2,"label",28),o(3,"Outlet"),n(),i(4,"p-multiselect",29),S(5,Zi,3,1,"ng-template",null,7,s),n()(),i(7,"div",27)(8,"label",28),o(9,"From"),n(),E(10,"p-datepicker",30),n()()),t&2){let e=d();c("formGroup",e.filterForm),l(4),c("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),l(6),c("iconDisplay","input")("showIcon",!0)}}var Bt=(()=>{class t{constructor(){this.store=h(Pe),this.ReportServiceStore=h(B),this.dialogFilterVisible=R(!1),this.isInitDialogFilterVisible=R(!1),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new mt({date:new G(new Date),outletID:new G([])})}onFilterOKEvent(){let{date:e,outletID:a}=this.filterForm.value;this.store.updateFilter({date:(0,Mt.default)(e).format("YYYY-MM-DD"),listOutletParam:a}),this.dialogFilterVisible.update(r=>!r)}onExport(){let e=y(g({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportRowCount:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(A("Export Balance Sheet"),k(a=>{let r=a.type,m=[a],_=document.createElement("a");_.href=window.URL.createObjectURL(new Blob(m,{type:r}));let f=`balance-sheet.${r.split("/")[1]}`;_.setAttribute("download",f),document.body.appendChild(_),_.click(),document.body.removeChild(_)})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=V({type:t,selectors:[["app-report-balance-sheet"]],features:[H([Pe])],decls:7,vars:4,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-download","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-bolder","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-bolder"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"fs-5","fw-semibold"],[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(a,r){if(a&1){let m=w();i(0,"app-main-panel",8),U("isDialogFilterVisibleChange",function(f){return v(m),q(r.dialogFilterVisible,f)||(r.dialogFilterVisible=f),b(f)})("isInitDialogFilterVisibleChange",function(f){return v(m),q(r.isInitDialogFilterVisible,f)||(r.isInitDialogFilterVisible=f),b(f)}),F("filterConfirmed",function(){return v(m),b(r.onFilterOKEvent())}),S(1,Oi,2,0,"ng-template",null,0,s)(3,Xi,6,10,"ng-template",null,1,s)(5,en,11,7,"ng-template",null,2,s),n()}a&2&&(c("pageTitle",r.store.data().pageTitle)("isFilterable",!0),z("isDialogFilterVisible",r.dialogFilterVisible)("isInitDialogFilterVisible",r.isInitDialogFilterVisible))},dependencies:[ue,$,K,xe,he,_e,re,oe,ne,ee,X,Z,te,ie,Ce,Se,ge,fe,Re,Fe,le,ae,Q,J],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt=(()=>{class t{static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=V({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(a,r){a&1&&(i(0,"p"),o(1,"report-comparative-balance works!"),n(),o(2,`
2
+ ,
3
+ `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ot=(()=>{class t{static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=V({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(a,r){a&1&&(i(0,"p"),o(1,"report-cash-flow works!"),n(),o(2,`
4
+ ,
5
+ `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Gt=(()=>{class t{static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=V({type:t,selectors:[["app-report-trial-balance"]],decls:3,vars:0,template:function(a,r){a&1&&(i(0,"p"),o(1,"report-trial-balance works!"),n(),o(2,`
6
+ ,
7
+ `))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var _r=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Lt},{path:"profit-loss",component:Vt},{path:"balance-sheet",component:Bt},{path:"comparative-balance",component:kt},{path:"trial-balance",component:Gt},{path:"cash-flow",component:Ot}]}];export{_r as REPORTS_ROUTES};
@@ -1,4 +1,4 @@
1
- import{a as lt,t as Gt}from"./chunk-DCES5UJV.js";import{Eb as Bt,Fa as k,Ja as kt,Wc as Vt,Yc as Et,ba as O,ca as Pt,ea as Dt,fc as yt,g as D,gc as St,ha as x,hb as Ht,ia as Mt,lb as $t,sa as Ft,ub as gt,vb as Wt,wb as Ut}from"./chunk-K5GIEJY3.js";import{a as I}from"./chunk-EQDQRRRY.js";function Ne(t,i){return t?t.classList?t.classList.contains(i):new RegExp("(^| )"+i+"( |$)","gi").test(t.className):!1}function Ie(t,i){if(t&&i){let e=n=>{Ne(t,n)||(t.classList?t.classList.add(n):t.className+=" "+n)};[i].flat().filter(Boolean).forEach(n=>n.split(" ").forEach(e))}}function xe(){return window.innerWidth-document.documentElement.offsetWidth}function $(t){for(let i of document?.styleSheets)try{for(let e of i?.cssRules)for(let n of e?.style)if(t.test(n))return{name:n,value:e.style.getPropertyValue(n).trim()}}catch{}return null}function ci(t="p-overflow-hidden"){let i=$(/-scrollbar-width$/);i?.name&&document.body.style.setProperty(i.name,xe()+"px"),Ie(document.body,t)}function Pe(t,i){if(t&&i){let e=n=>{t.classList?t.classList.remove(n):t.className=t.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")};[i].flat().filter(Boolean).forEach(n=>n.split(" ").forEach(e))}}function li(t="p-overflow-hidden"){let i=$(/-scrollbar-width$/);i?.name&&document.body.style.removeProperty(i.name),Pe(document.body,t)}function Kt(t){let i={width:0,height:0};return t&&(t.style.visibility="hidden",t.style.display="block",i.width=t.offsetWidth,i.height=t.offsetHeight,t.style.display="none",t.style.visibility="visible"),i}function jt(){let t=window,i=document,e=i.documentElement,n=i.getElementsByTagName("body")[0],r=t.innerWidth||e.clientWidth||n.clientWidth,s=t.innerHeight||e.clientHeight||n.clientHeight;return{width:r,height:s}}function De(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}function Me(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}function pi(t,i,e=!0){var n,r,s,o;if(t){let c=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:Kt(t),l=c.height,a=c.width,p=i.offsetHeight,d=i.offsetWidth,u=i.getBoundingClientRect(),f=Me(),m=De(),y=jt(),E,T,v="top";u.top+p+l>y.height?(E=u.top+f-l,v="bottom",E<0&&(E=f)):E=p+u.top+f,u.left+a>y.width?T=Math.max(0,u.left+m+d-a):T=u.left+m,t.style.top=E+"px",t.style.left=T+"px",t.style.transformOrigin=v,e&&(t.style.marginTop=v==="bottom"?`calc(${(r=(n=$(/-anchor-gutter$/))==null?void 0:n.value)!=null?r:"2px"} * -1)`:(o=(s=$(/-anchor-gutter$/))==null?void 0:s.value)!=null?o:"")}}function Fe(t,i){t&&(typeof i=="string"?t.style.cssText=i:Object.entries(i||{}).forEach(([e,n])=>t.style[e]=n))}function ui(t,i){if(t instanceof HTMLElement){let e=t.offsetWidth;if(i){let n=getComputedStyle(t);e+=parseFloat(n.marginLeft)+parseFloat(n.marginRight)}return e}return 0}function di(t,i,e=!0){var n,r,s,o;if(t){let c=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:Kt(t),l=i.offsetHeight,a=i.getBoundingClientRect(),p=jt(),d,u,f="top";a.top+l+c.height>p.height?(d=-1*c.height,f="bottom",a.top+d<0&&(d=-1*a.top)):d=l,c.width>p.width?u=a.left*-1:a.left+c.width>p.width?u=(a.left+c.width-p.width)*-1:u=0,t.style.top=d+"px",t.style.left=u+"px",t.style.transformOrigin=f,e&&(t.style.marginTop=f==="bottom"?`calc(${(r=(n=$(/-anchor-gutter$/))==null?void 0:n.value)!=null?r:"2px"} * -1)`:(o=(s=$(/-anchor-gutter$/))==null?void 0:s.value)!=null?o:"")}}function W(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}function bt(t){let i=t;return t&&typeof t=="object"&&(t.hasOwnProperty("current")?i=t.current:t.hasOwnProperty("el")&&(t.el.hasOwnProperty("nativeElement")?i=t.el.nativeElement:i=t.el)),W(i)?i:void 0}function fi(t,i){let e=bt(t);if(e)e.appendChild(i);else throw new Error("Cannot append "+i+" to "+t)}var _t=void 0;function hi(t){if(t){let i=getComputedStyle(t);return t.offsetWidth-t.clientWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.borderRightWidth)}else{if(_t!=null)return _t;let i=document.createElement("div");Fe(i,{width:"100px",height:"100px",overflow:"scroll",position:"absolute",top:"-9999px"}),document.body.appendChild(i);let e=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),_t=e,e}}function pt(t,i={}){if(W(t)){let e=(n,r)=>{var s,o;let c=(s=t?.$attrs)!=null&&s[n]?[(o=t?.$attrs)==null?void 0:o[n]]:[];return[r].flat().reduce((l,a)=>{if(a!=null){let p=typeof a;if(p==="string"||p==="number")l.push(a);else if(p==="object"){let d=Array.isArray(a)?e(n,a):Object.entries(a).map(([u,f])=>n==="style"&&(f||f===0)?`${u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${f}`:f?u:void 0);l=d.length?l.concat(d.filter(u=>!!u)):l}}return l},c)};Object.entries(i).forEach(([n,r])=>{if(r!=null){let s=n.match(/^on(.+)/);s?t.addEventListener(s[1].toLowerCase(),r):n==="p-bind"||n==="pBind"?pt(t,r):(r=n==="class"?[...new Set(e("class",r))].join(" ").trim():n==="style"?e("style",r).join(";").trim():r,(t.$attrs=t.$attrs||{})&&(t.$attrs[n]=r),t.setAttribute(n,r))}})}}function mi(t,i={},...e){if(t){let n=document.createElement(t);return pt(n,i),n.append(...e),n}}function gi(t,i){if(t){t.style.opacity="0";let e=+new Date,n="0",r=function(){n=`${+t.style.opacity+(new Date().getTime()-e)/i}`,t.style.opacity=n,e=+new Date,+n<1&&(window.requestAnimationFrame&&requestAnimationFrame(r)||setTimeout(r,16))};r()}}function ke(t,i){return W(t)?Array.from(t.querySelectorAll(i)):[]}function yi(t,i){return W(t)?t.matches(i)?t:t.querySelector(i):null}function Si(t,i){t&&document.activeElement!==t&&t.focus(i)}function Ei(t,i){if(W(t)){let e=t.getAttribute(i);return isNaN(e)?e==="true"||e==="false"?e==="true":e:+e}}function Yt(t,i=""){let e=ke(t,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i},
1
+ import{a as lt,t as Gt}from"./chunk-353U23ZQ.js";import{Fb as Bt,Ga as k,Ka as kt,Xc as Vt,Zc as Et,ba as O,ca as Pt,ea as Dt,g as D,gc as yt,ha as x,hc as St,ia as Mt,ib as Ht,mb as $t,ta as Ft,vb as gt,wb as Wt,xb as Ut}from"./chunk-ARSLNNKY.js";import{a as I}from"./chunk-YQFG5XE2.js";function Ne(t,i){return t?t.classList?t.classList.contains(i):new RegExp("(^| )"+i+"( |$)","gi").test(t.className):!1}function Ie(t,i){if(t&&i){let e=n=>{Ne(t,n)||(t.classList?t.classList.add(n):t.className+=" "+n)};[i].flat().filter(Boolean).forEach(n=>n.split(" ").forEach(e))}}function xe(){return window.innerWidth-document.documentElement.offsetWidth}function $(t){for(let i of document?.styleSheets)try{for(let e of i?.cssRules)for(let n of e?.style)if(t.test(n))return{name:n,value:e.style.getPropertyValue(n).trim()}}catch{}return null}function ci(t="p-overflow-hidden"){let i=$(/-scrollbar-width$/);i?.name&&document.body.style.setProperty(i.name,xe()+"px"),Ie(document.body,t)}function Pe(t,i){if(t&&i){let e=n=>{t.classList?t.classList.remove(n):t.className=t.className.replace(new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi")," ")};[i].flat().filter(Boolean).forEach(n=>n.split(" ").forEach(e))}}function li(t="p-overflow-hidden"){let i=$(/-scrollbar-width$/);i?.name&&document.body.style.removeProperty(i.name),Pe(document.body,t)}function Kt(t){let i={width:0,height:0};return t&&(t.style.visibility="hidden",t.style.display="block",i.width=t.offsetWidth,i.height=t.offsetHeight,t.style.display="none",t.style.visibility="visible"),i}function jt(){let t=window,i=document,e=i.documentElement,n=i.getElementsByTagName("body")[0],r=t.innerWidth||e.clientWidth||n.clientWidth,s=t.innerHeight||e.clientHeight||n.clientHeight;return{width:r,height:s}}function De(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}function Me(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)}function pi(t,i,e=!0){var n,r,s,o;if(t){let c=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:Kt(t),l=c.height,a=c.width,p=i.offsetHeight,d=i.offsetWidth,u=i.getBoundingClientRect(),f=Me(),m=De(),y=jt(),E,T,v="top";u.top+p+l>y.height?(E=u.top+f-l,v="bottom",E<0&&(E=f)):E=p+u.top+f,u.left+a>y.width?T=Math.max(0,u.left+m+d-a):T=u.left+m,t.style.top=E+"px",t.style.left=T+"px",t.style.transformOrigin=v,e&&(t.style.marginTop=v==="bottom"?`calc(${(r=(n=$(/-anchor-gutter$/))==null?void 0:n.value)!=null?r:"2px"} * -1)`:(o=(s=$(/-anchor-gutter$/))==null?void 0:s.value)!=null?o:"")}}function Fe(t,i){t&&(typeof i=="string"?t.style.cssText=i:Object.entries(i||{}).forEach(([e,n])=>t.style[e]=n))}function ui(t,i){if(t instanceof HTMLElement){let e=t.offsetWidth;if(i){let n=getComputedStyle(t);e+=parseFloat(n.marginLeft)+parseFloat(n.marginRight)}return e}return 0}function di(t,i,e=!0){var n,r,s,o;if(t){let c=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:Kt(t),l=i.offsetHeight,a=i.getBoundingClientRect(),p=jt(),d,u,f="top";a.top+l+c.height>p.height?(d=-1*c.height,f="bottom",a.top+d<0&&(d=-1*a.top)):d=l,c.width>p.width?u=a.left*-1:a.left+c.width>p.width?u=(a.left+c.width-p.width)*-1:u=0,t.style.top=d+"px",t.style.left=u+"px",t.style.transformOrigin=f,e&&(t.style.marginTop=f==="bottom"?`calc(${(r=(n=$(/-anchor-gutter$/))==null?void 0:n.value)!=null?r:"2px"} * -1)`:(o=(s=$(/-anchor-gutter$/))==null?void 0:s.value)!=null?o:"")}}function W(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"}function bt(t){let i=t;return t&&typeof t=="object"&&(t.hasOwnProperty("current")?i=t.current:t.hasOwnProperty("el")&&(t.el.hasOwnProperty("nativeElement")?i=t.el.nativeElement:i=t.el)),W(i)?i:void 0}function fi(t,i){let e=bt(t);if(e)e.appendChild(i);else throw new Error("Cannot append "+i+" to "+t)}var _t=void 0;function hi(t){if(t){let i=getComputedStyle(t);return t.offsetWidth-t.clientWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.borderRightWidth)}else{if(_t!=null)return _t;let i=document.createElement("div");Fe(i,{width:"100px",height:"100px",overflow:"scroll",position:"absolute",top:"-9999px"}),document.body.appendChild(i);let e=i.offsetWidth-i.clientWidth;return document.body.removeChild(i),_t=e,e}}function pt(t,i={}){if(W(t)){let e=(n,r)=>{var s,o;let c=(s=t?.$attrs)!=null&&s[n]?[(o=t?.$attrs)==null?void 0:o[n]]:[];return[r].flat().reduce((l,a)=>{if(a!=null){let p=typeof a;if(p==="string"||p==="number")l.push(a);else if(p==="object"){let d=Array.isArray(a)?e(n,a):Object.entries(a).map(([u,f])=>n==="style"&&(f||f===0)?`${u.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}:${f}`:f?u:void 0);l=d.length?l.concat(d.filter(u=>!!u)):l}}return l},c)};Object.entries(i).forEach(([n,r])=>{if(r!=null){let s=n.match(/^on(.+)/);s?t.addEventListener(s[1].toLowerCase(),r):n==="p-bind"||n==="pBind"?pt(t,r):(r=n==="class"?[...new Set(e("class",r))].join(" ").trim():n==="style"?e("style",r).join(";").trim():r,(t.$attrs=t.$attrs||{})&&(t.$attrs[n]=r),t.setAttribute(n,r))}})}}function mi(t,i={},...e){if(t){let n=document.createElement(t);return pt(n,i),n.append(...e),n}}function gi(t,i){if(t){t.style.opacity="0";let e=+new Date,n="0",r=function(){n=`${+t.style.opacity+(new Date().getTime()-e)/i}`,t.style.opacity=n,e=+new Date,+n<1&&(window.requestAnimationFrame&&requestAnimationFrame(r)||setTimeout(r,16))};r()}}function ke(t,i){return W(t)?Array.from(t.querySelectorAll(i)):[]}function yi(t,i){return W(t)?t.matches(i)?t:t.querySelector(i):null}function Si(t,i){t&&document.activeElement!==t&&t.focus(i)}function Ei(t,i){if(W(t)){let e=t.getAttribute(i);return isNaN(e)?e==="true"||e==="false"?e==="true":e:+e}}function Yt(t,i=""){let e=ke(t,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i},
2
2
  [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i},
3
3
  input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i},
4
4
  select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${i},
@@ -0,0 +1 @@
1
+ import{a as p}from"./chunk-2US5D2LY.js";import{g as b}from"./chunk-ZB6TB7JI.js";import"./chunk-7KQDKLO4.js";import"./chunk-H4V6YZX2.js";import{D as h}from"./chunk-WAJWW3TC.js";import"./chunk-U6SRN7P3.js";import"./chunk-TPGKCMVN.js";import"./chunk-BCXNVGDH.js";import{a as v}from"./chunk-U5LD55IP.js";import"./chunk-F2X3VGZZ.js";import"./chunk-TYETQJ2X.js";import{t as x}from"./chunk-353U23ZQ.js";import{$b as _,Bb as C,Mc as f,Vb as i,Wb as o,ec as l,fc as u,ha as c,pa as s,qa as m,qc as a,vb as g,yc as d}from"./chunk-ARSLNNKY.js";import"./chunk-YQFG5XE2.js";function S(t,M){if(t&1){let e=_();i(0,"div",3)(1,"button",4),l("click",function(){s(e);let r=u();return m(r.onFormatCOAConfig())}),a(2," Format "),o(),i(3,"button",5),l("click",function(){s(e);let r=u();return m(r.onMigrateCoaConfig())}),a(4," Migrate "),o()()}}function T(t,M){t&1&&(i(0,"div",6),a(1," reserved for future User Interface (UI) enhancements "),o())}var j=(()=>{class t{constructor(){this.migrateService=c(p),this.toastr=c(v)}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){this.migrateService.formatManualCOAConfig().subscribe(e=>{this.toastr.success(e.message,"Format Successful")})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=g({type:t,selectors:[["app-coa-configuration"]],features:[d([p])],decls:5,vars:0,consts:[["actionButton",""],["content",""],["pageTitle","Chart Of Accounts Configuration"],[1,"d-flex","gap-2"],[1,"btn","btn-danger",3,"click"],[1,"btn","btn-success",3,"click"],[1,"container","d-flex","justify-content-center","align-items-center",2,"height","100vh"]],template:function(n,r){n&1&&(i(0,"app-main-panel",2),C(1,S,5,0,"ng-template",null,0,f)(3,T,2,0,"ng-template",null,1,f),o())},dependencies:[b,x,h],encapsulation:2})}}return t})();export{j as CoaConfigurationComponent};
@@ -0,0 +1,246 @@
1
+ import{a as st}from"./chunk-V3B32QFK.js";import{a as kn,b as On}from"./chunk-WM3NKRKN.js";import{a as Pn}from"./chunk-NRULEUE7.js";import{a as An,b as En,c as Mn,d as we,e as Te}from"./chunk-J6H3BBKP.js";import"./chunk-ZUALJ33O.js";import"./chunk-5QVQY32E.js";import{d as fn}from"./chunk-PZBZVQUY.js";import{a as ot,b as rt}from"./chunk-ZPTNYW2S.js";import{a as un,h as vn,j as Sn,k as wn,l as Tn}from"./chunk-GY53MWXH.js";import{f as In,g as at}from"./chunk-6NCHCAKY.js";import"./chunk-5AITWOQZ.js";import"./chunk-ACQX2T2H.js";import{a as G}from"./chunk-A47VRZZB.js";import{a as A}from"./chunk-W76GKZZU.js";import{c as re,d as ae}from"./chunk-JG5HGOEX.js";import{a as it,b as B}from"./chunk-7U2I35GP.js";import{f as yn,g as R}from"./chunk-ZB6TB7JI.js";import{b as nt,c as he}from"./chunk-7KQDKLO4.js";import{a as U,b as hn,c as gn,e as xn,f as Cn,g as bn}from"./chunk-H4V6YZX2.js";import{A as Ct,C as ie,D as oe,c as Qe,d as Xt,f as Yt,m as xt,t as et,u as tt,v as dn,z as _n}from"./chunk-WAJWW3TC.js";import{b as J,c as ee,e as te,f as Ce,g as Zt,i as V,j as Qt,k as Wt,m as be,p as ye,w as Ie,y as ve,z as Se}from"./chunk-U6SRN7P3.js";import{a as Le}from"./chunk-TPGKCMVN.js";import{B as on,G as rn,J as an,N as sn,Q as _t,T as ne,X as ht,Y as gt,aa as ln,ca as cn,f as dt,ha as mn,k as Jt,ka as Ye,la as Ne,m as en,n as tn,na as pn,r as We,s as Xe,ta as Je,x as nn,y as ft}from"./chunk-BCXNVGDH.js";import{d as Ut}from"./chunk-U5LD55IP.js";import{c as pt,d as ut,f as Fe,h as Ve}from"./chunk-F2X3VGZZ.js";import{n as X,p as Y,q as D,x as F}from"./chunk-TYETQJ2X.js";import{j as _e,l as Gt,m as L,n as mt,o as Ht,s as jt,t as M,w as Oe}from"./chunk-353U23ZQ.js";import{$b as w,Ac as T,Bb as f,Bc as $t,D as Ke,Ga as I,J as qe,Jc as Kt,Kb as P,Kc as qt,L as Ft,Lb as c,Mc as b,O as Vt,Ob as me,Pb as Pe,Vb as a,Vc as fe,Wb as r,Wc as xe,X as N,Xb as x,Yb as pe,Yc as j,Z as S,Zb as ue,Zc as zt,aa as Nt,ba as ge,bb as Ee,c as $e,ca as ze,cb as Lt,ec as v,fc as l,gb as m,gc as Dt,ha as g,hc as Rt,jc as He,kc as de,lc as q,mb as ct,mc as z,pa as _,pc as Q,qa as h,qc as p,rc as k,s as K,sc as ke,t as Ot,ta as Ae,uc as Bt,vb as E,vc as je,wb as Ge,wc as Ue,xc as Ze,yc as W,za as Z,zb as Me,zc as O}from"./chunk-ARSLNNKY.js";import{a as C,b as y}from"./chunk-YQFG5XE2.js";var Hn=["class","page"],jn=n=>({id:n});function Un(n,s){if(n&1){let e=w();a(0,"div",3)(1,"a",4),p(2,"Cancel"),r(),a(3,"a",5),x(4,"i",6),p(5," Edit"),r(),a(6,"p-button",7),v("onClick",function(){_(e);let i=l();return h(i.onDelete())}),r(),a(7,"a",8),p(8,"Ledger"),r()()}if(n&2){let e,t=l();m(7),c("queryParams",T(1,jn,(e=t.COAInfo())==null?null:e.id))}}function Zn(n,s){if(n&1&&(a(0,"div",10)(1,"div",11)(2,"p-card")(3,"div",12)(4,"div",13)(5,"div",14),p(6,"Name"),r(),a(7,"div",15),p(8),r()(),a(9,"div",13)(10,"div",14),p(11,"Code"),r(),a(12,"div",15),p(13),r()(),a(14,"div",13)(15,"div",14),p(16,"Category"),r(),a(17,"div",15),p(18),r()(),a(19,"div",13)(20,"div",14),p(21,"Note"),r(),a(22,"div",15),p(23),r()(),a(24,"div",13)(25,"div",14),p(26,"Outlet"),r(),a(27,"div",15),p(28),r()()()()()()),n&2){let e,t,i,o,u,d=l(2);m(8),k((e=d.COAInfo().name)!==null&&e!==void 0?e:"-"),m(5),k((t=d.COAInfo().code)!==null&&t!==void 0?t:"-"),m(5),k((i=d.COAInfo().category)!==null&&i!==void 0?i:"-"),m(5),k((o=d.COAInfo().note)!==null&&o!==void 0?o:"-"),m(5),k((u=d.COAInfo().outletName)!==null&&u!==void 0?u:"-")}}function Qn(n,s){if(n&1&&f(0,Zn,29,5,"div",9),n&2){let e=l();c("ngIf",e.COAInfo())}}var Fn=(()=>{class n{constructor(){this.#e=g(G),this.#t=g(X),this.router=g(Y),this.COAInfo=I(null)}#e;#t;ngOnInit(){this.#t.paramMap.pipe(A("params"),N(e=>this.#e.getChartAccountById(e.get("id"))),S(e=>this.COAInfo.set(e)),A("response")).subscribe()}onDelete(){if(!confirm("Are you sure you want to delete this Chart of Accounts?"))return;let t=[this.#t.snapshot.paramMap.get("id")];this.#e.deleteChartAccount(t).pipe(S(()=>{this.router.navigate(["/chart-of-account/account"])})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=E({type:n,selectors:[["app-coa-account-info",8,"page"]],attrs:Hn,decls:5,vars:0,consts:[["actionButton",""],["content",""],["pageTitle","Chart of Account Details"],[1,"d-flex","gap-2"],["routerLink","/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined"],["routerLink","edit",1,"p-button","p-button-secondary","p-button-outlined"],[1,"fa-solid","fa-pen-to-square"],["label","Delete","icon","fa-solid fa-trash","severity","secondary","variant","outlined",3,"onClick"],["routerLink","/report/general-ledger",1,"p-button",3,"queryParams"],["class","row justify-content-center mt-3",4,"ngIf"],[1,"row","justify-content-center","mt-3"],[1,"col","col-lg-8"],[1,"d-flex","flex-column","row-gap-4"],[1,"row"],[1,"col","col-lg-3"],[1,"col"]],template:function(t,i){t&1&&(a(0,"app-main-panel",2),f(1,Un,9,3,"ng-template",null,0,b)(3,Qn,1,1,"ng-template",null,1,b),r())},dependencies:[M,L,ve,Qe,F,D,R,B,it,oe,ie],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var le=(()=>{class n{constructor(){this.httpService=g(Ut)}fetchCOACategories(){return this.httpService.get("","api/ChartOfAccount/Category")}getCOACategoryByID(e){let t={params:e};return this.httpService.get("","api/ChartOfAccount/CategoryInfo",t)}renameCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/RenameCategory/${e}`,t)}updateParentCategory(e,t){return this.httpService.put("",`api/ChartOfAccount/UpdateParentCategory/${e}`,t).pipe()}deleteCategory(e){return this.httpService.delete("",`api/ChartOfAccount/Category/${e}`)}submitCategory(e,t={}){return this.httpService.post("","api/ChartOfAccount/SubmitCategory",e,t)}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=ge({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var yt=n=>n?n.reduce((s,e)=>(s.push({label:e.label,data:e.data,key:e.key}),e.children&&e.children.length?s.push(...yt(e.children)):s.push({label:`${e.label} (no children)`,data:e.data,key:`${e.key}-no-children`}),s),[]):[];var It=(n,s,e)=>{let t=Math.ceil(e/s),i=(n-1)*s+1,o=Math.min(n*s,e);return{start:i,end:o,totalRecords:e,totalPages:t}};var Wn={filter:{RowCount:20,PageNumber:1,CategoryID:"",Text:"",listOutletID:[]},options:{entities:[],categories:[]},data:[],count:0,perPages:[{key:20,value:"20 per page"},{key:40,value:"40 per page"},{key:60,value:"60 per page"},{key:80,value:"80 per page"},{key:100,value:"100 per page"}]},vt=hn(Cn(Wn),bn("ChartOfAccount"),gn(n=>({isAllChecked:j(()=>n.data().every(s=>s.checked)),checkedItems:j(()=>n.data().filter(s=>s.checked)),IDsChecked:j(()=>n.data().filter(s=>s.checked).map(s=>s.id)),categories:j(()=>yt(n.options.categories())),first:j(()=>{let{start:s}=It(n.filter().PageNumber,n.filter().RowCount,n.count());return s}),last:j(()=>{let{end:s}=It(n.filter().PageNumber,n.filter().RowCount,n.count());return s})})),xn(n=>{let s=g(G),e=g(le),t={updateFilter(i){U(n,{filter:C({},i)})},checkedItem(i){if(Array.isArray(i))i.forEach(o=>{let u=n.data().map(d=>d.id===o.id?y(C({},d),{checked:!o.checked}):d);U(n,{data:u})});else{let o=i,u=n.data().map(d=>d.id===o.id?y(C({},d),{checked:!o.checked}):d);U(n,{data:u})}},checkAllCheckbox(){let i=n.data().map(o=>y(C({},o),{checked:!o.checked}));U(n,{data:i})},fetchChartOfAccount:ot($e(Ke(()=>!!n.filter()),Ft(300),Vt(),N(i=>s.getPaginatedChartAccounts(i).pipe(K(o=>y(C({},o),{data:o.data.map(u=>y(C({},u),{checked:!1}))})),rt({next:o=>U(n,{data:o.data,count:o.count}),error:o=>{U(n,{data:[],count:0}),console.error(o)}}))))),fetchLoader:ot($e(N(()=>s.getChartOfAccountLoader().pipe(rt({next:i=>{U(n,{filter:y(C({},n.filter()),{RowCount:i.filter.rowCount,PageNumber:1,CategoryID:i.filter.categoryID||null,Text:"",listOutletID:[]}),options:i.options}),t.fetchChartOfAccount(n.filter)},error:i=>{console.error(i)}}))))),getCategories:ot($e(qe(()=>e.fetchCOACategories().pipe(rt({next:i=>{U(n,{options:{entities:n.options.entities(),categories:i}})},error:i=>{console.error(i)}})))))};return t}));var Xn=["*"],Yn=({dt:n})=>`
2
+ .p-buttongroup .p-button {
3
+ margin: 0;
4
+ }
5
+
6
+ .p-buttongroup .p-button:not(:last-child),
7
+ .p-buttongroup .p-button:not(:last-child):hover {
8
+ border-right: 0 none;
9
+ }
10
+
11
+ .p-buttongroup .p-button:not(:first-of-type):not(:last-of-type) {
12
+ border-radius: 0;
13
+ }
14
+
15
+ .p-buttongroup .p-button:first-of-type:not(:only-of-type) {
16
+ border-start-end-radius: 0;
17
+ border-end-end-radius: 0;
18
+ }
19
+
20
+ .p-buttongroup .p-button:last-of-type:not(:only-of-type) {
21
+ border-start-start-radius: 0;
22
+ border-end-start-radius: 0;
23
+ }
24
+
25
+ .p-buttongroup .p-button:focus {
26
+ position: relative;
27
+ z-index: 1;
28
+ }
29
+
30
+ .p-buttongroup {
31
+ display:flex;
32
+ }
33
+
34
+ .p-buttongroup > .p-button {
35
+ flex: 1;
36
+ }
37
+
38
+ /* For PrimeNG */
39
+
40
+ .p-buttongroup .p-button:focus,
41
+ .p-buttongroup p-button:focus .p-button,
42
+ .p-buttonset .p-button:focus,
43
+ .p-buttonset .p-button:focus,
44
+ .p-buttonset p-button:focus .p-button,
45
+ .p-buttonset .p-button:focus {
46
+ position: relative;
47
+ z-index: 1;
48
+ }
49
+
50
+ .p-buttongroup .p-button:not(:last-child),
51
+ .p-buttongroup .p-button:not(:last-child):hover,
52
+ .p-buttongroup p-button:not(:last-child) .p-button,
53
+ .p-buttongroup p-button:not(:last-child) .p-button:hover,
54
+ .p-buttonset .p-button:not(:last-child),
55
+ .p-buttonset .p-button:not(:last-child):hover,
56
+ .p-buttonset p-button:not(:last-child) .p-button,
57
+ .p-buttonset p-button:not(:last-child) .p-button:hover {
58
+ border-right: 0 none;
59
+ }
60
+
61
+ .p-buttongroup .p-button:not(:first-of-type):not(:last-of-type),
62
+ .p-buttongroup p-button:not(:first-of-type):not(:last-of-type) .p-button,
63
+ .p-buttonset .p-button:not(:first-of-type):not(:last-of-type),
64
+ .p-buttonset p-button:not(:first-of-type):not(:last-of-type) .p-button {
65
+ border-radius: 0;
66
+ }
67
+
68
+ .p-buttongroup .p-button:first-of-type:not(:only-of-type),
69
+ .p-buttongroup p-button:first-of-type:not(:only-of-type) .p-button,
70
+ .p-buttonset .p-button:first-of-type:not(:only-of-type),
71
+ .p-buttonset p-button:first-of-type:not(:only-of-type) .p-button {
72
+ border-start-end-radius: 0;
73
+ border-end-end-radius: 0;
74
+ }
75
+
76
+ .p-buttongroup .p-button:last-of-type:not(:only-of-type),
77
+ .p-buttongroup p-button:last-of-type:not(:only-of-type) .p-button,
78
+ .p-buttonset .p-button:last-of-type:not(:only-of-type),
79
+ .p-buttonset p-button:last-of-type:not(:only-of-type) .p-button {
80
+ border-start-start-radius: 0;
81
+ border-end-start-radius: 0;
82
+ }
83
+
84
+ p-button[iconpos='right'] spinnericon {
85
+ order: 1;
86
+ }
87
+ `,Jn={root:"p-buttongroup p-component"},Vn=(()=>{class n extends Je{name="buttongroup";theme=Yn;classes=Jn;static \u0275fac=(()=>{let e;return function(i){return(e||(e=Ae(n)))(i||n)}})();static \u0275prov=ge({token:n,factory:n.\u0275fac})}return n})();var ei=(()=>{class n extends Le{_componentStyle=g(Vn);static \u0275fac=(()=>{let e;return function(i){return(e||(e=Ae(n)))(i||n)}})();static \u0275cmp=E({type:n,selectors:[["p-buttonGroup"],["p-buttongroup"],["p-button-group"]],features:[W([Vn]),Me],ngContentSelectors:Xn,decls:2,vars:0,consts:[["role","group",1,"p-buttongroup","p-component"]],template:function(t,i){t&1&&(Dt(),a(0,"span",0),Rt(1),r())},dependencies:[M],encapsulation:2,changeDetection:0})}return n})(),Nn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ge({type:n});static \u0275inj=ze({imports:[ei]})}return n})();var ni=["class","page"],ii=()=>["import"],oi=()=>({height:"calc(100vh - 70px)"}),ri=n=>["../account/",n],ai=()=>["/report/general-ledger"],si=n=>({id:n}),li=()=>({width:"100%"}),ci=()=>({scrollHeight:"200px"});function mi(n,s){if(n&1){let e=w();a(0,"p-button",16),v("onClick",function(){_(e);let i=l(2);return h(i.deleteCOA())}),r()}}function pi(n,s){if(n&1){let e=w();a(0,"div",8),f(1,mi,1,0,"p-button",9),a(2,"a",10),x(3,"i",11),a(4,"span",12),p(5,"Import"),r()(),a(6,"p-button",13),v("onClick",function(){_(e);let i=l();return h(i.onExport())}),r(),a(7,"a",14),x(8,"i",15),p(9," Add"),r()()}if(n&2){let e=l();m(),c("ngIf",e.store.checkedItems().length),m(),c("routerLink",O(2,ii))}}function ui(n,s){n&1&&(a(0,"tr")(1,"th",18),x(2,"p-tableHeaderCheckbox"),r(),a(3,"th"),p(4,"Code"),r(),a(5,"th"),p(6,"Name"),r(),a(7,"th"),p(8,"Category"),r(),a(9,"th"),p(10,"Outlet"),r(),a(11,"th",19),p(12,"Balance"),r()())}function di(n,s){if(n&1&&(a(0,"tr")(1,"td"),x(2,"p-tableCheckbox",20),r(),a(3,"td"),p(4),r(),a(5,"td")(6,"a",21),p(7),r()(),a(8,"td"),p(9),r(),a(10,"td"),p(11),r(),a(12,"td",19)(13,"a",22),p(14),Kt(15,"number"),r()()()),n&2){let e,t=s.$implicit;m(2),c("value",t),m(2),k(t.code),m(2),c("routerLink",T(11,ri,t.id)),m(),k(t.name),m(2),k(t.category),m(2),k(t.outletName),m(2),c("routerLink",O(13,ai))("queryParams",T(14,si,t.id)),m(),k(qt(15,9,(e=t.balance)!==null&&e!==void 0?e:0))}}function fi(n,s){if(n&1&&p(0),n&2){let e=l(2);Bt(" Showing ",e.store.first()," to ",e.store.last()," of ",e.store.count()," entries ")}}function _i(n,s){n&1&&(a(0,"tr")(1,"td",23)(2,"span"),p(3,"No records found."),r()()())}function hi(n,s){if(n&1){let e=w();a(0,"p-panel")(1,"p-table",17),v("onLazyLoad",function(i){_(e);let o=l();return h(o.loadData(i))})("onRowSelect",function(i){_(e);let o=l();return h(o.onRowSelect(i))})("onRowUnselect",function(i){_(e);let o=l();return h(o.onRowUnselect(i))})("onHeaderCheckboxToggle",function(i){_(e);let o=l();return h(o.onSelectAll(i))})("onPage",function(i){_(e);let o=l();return h(o.onPageChange(i))}),f(2,ui,13,0,"ng-template",null,3,b)(4,di,16,16,"ng-template",null,4,b)(6,fi,1,3,"ng-template",null,5,b)(8,_i,4,0,"ng-template",null,6,b),r()()}if(n&2){let e=l();me(O(9,oi)),m(),c("lazy",!0)("value",e.store.data())("paginator",!0)("rows",e.store.filter().RowCount)("totalRecords",e.store.count())("scrollable",!0)("scrollHeight","calc(100vh - 142px)")}}function gi(n,s){if(n&1){let e=w();a(0,"form",25)(1,"div",26)(2,"label",27),p(3,"Outlet"),r(),x(4,"p-multiselect",28),r(),a(5,"div",26)(6,"label",27),p(7,"Category"),r(),a(8,"p-treeselect",29),v("onFocus",function(){_(e);let i=l(2);return h(i.onCategoryFocus())}),r()(),a(9,"div",30)(10,"label",27),p(11,"Page Size"),r(),x(12,"input",31),r()()}if(n&2){let e=l(2);c("formGroup",e.formFilter),m(4),c("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.options().entities),m(4),me(O(12,li)),c("showClear",!0)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",O(13,ci))("options",e.categoryNodes())}}function xi(n,s){if(n&1&&f(0,gi,13,14,"form",24),n&2){let e=l();c("ngIf",e.formFilter)}}var Dn=(()=>{class n{ngOnInit(){this.store.fetchLoader(),console.log(this.store.filter().RowCount),this.generateFilterForm()}#e;constructor(){this.routeInfo=Rn,this.store=g(vt),this.#e=g(G),this.modalService=g(Xt),this.dialogVisible=I(!1),this.categoryNodes=I([]),this.fb=g(Ie),this.isDialogFilterVisible=I(!1),this.generateFilterForm()}generateFilterForm(){this.formFilter=this.fb.group({outletID:this.fb.control([]),categoryID:this.fb.control(null),pageSize:this.fb.control(this.store.filter().RowCount)})}onPageChange(e){console.log("Page changed to: ",e),this.store.updateFilter(y(C({},this.store.filter()),{PageNumber:e.first/e.rows+1}))}onCategoryFocus(){this.#e.getCachedCategoriesOptions().pipe(S(e=>this.categoryNodes.set(e))).subscribe()}onRowSelect(e){console.log("Row select event: ",e),this.store.checkedItem(e.data)}onRowUnselect(e){console.log("Row unselect event: ",e),this.store.checkedItem(e.data)}onSelectAll(e){console.log("Select all event: ",e),this.store.checkAllCheckbox()}loadData(e){console.log("Lazy load event: ",e)}onSearch(e){console.log("Search text: ",e),this.store.updateFilter(y(C({},this.store.filter()),{Text:e}))}updateFilter(e,t){this.store.updateFilter(y(C({},this.store.filter()),{[e]:t}))}checkAllCheckBox(){this.store.checkAllCheckbox()}checkedItem(e){this.store.checkedItem(e)}deleteCOA(){confirm("Are you sure you want to delete selected Chart of Accounts?")&&this.#e.deleteChartAccount(this.store.IDsChecked()).pipe(A("response"),S(e=>{console.log("Delete COA Response: ",e),this.store.updateFilter(C({},this.store.filter()))})).subscribe()}onSearchEvent(e){this.store.updateFilter(y(C({},this.store.filter()),{Text:e.trim()}))}onFilterEvent(){this.dialogVisible.update(e=>!e)}onFilterOKEvent(){let{categoryID:e,pageSize:t,outletID:i}=this.formFilter.value;this.store.updateFilter(y(C({},this.store.filter()),{listOutletID:i,CategoryID:e?e.key:"",RowCount:+t})),this.isDialogFilterVisible.update(o=>!o)}onExport(){let e=y(C({},this.store.filter()),{ExportPageNumber:1,ExportRowCount:1e4});this.#e.exportChartOfAccounts(e).pipe(A("Export COA Response"),S(t=>{t&&Pn(t,`ChartOfAccount_${new Date().toISOString()}.xlsx`,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=E({type:n,selectors:[["app-cash-of-account",8,"page"]],features:[W([vt])],attrs:ni,decls:7,vars:3,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Chart of Account",3,"search","isDialogFilterVisibleChange","filterEmitted","filterConfirmed","isSearchableInput","isDialogFilterVisible","isFilterable"],[1,"d-flex","gap-2"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick",4,"ngIf"],[1,"p-button","p-button-outlined","p-button-secondary",3,"routerLink"],[1,"fa-solid","fa-upload"],[1,"fw-semibold","fs-3"],["severity","secondary","label","Export","icon","fa-solid fa-download","variant","outlined",3,"onClick"],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],["icon","fa-solid fa-trash","label","Delete","severity","danger",3,"onClick"],["dataKey","id","styleClass","d-flex flex-column justify-content-between h-100",1,"",3,"onLazyLoad","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","onPage","lazy","value","paginator","rows","totalRecords","scrollable","scrollHeight"],[2,"width","4rem"],[1,"text-end"],[3,"value"],[1,"link-primary",3,"routerLink"],[1,"link","link-primary",3,"routerLink","queryParams"],["colspan","6"],["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","position-relative"],["for",""],["appendTo","body","formControlName","outletID","optionLabel","name","optionValue","id","placeholder","Select an Outlet",3,"showClear","virtualScroll","virtualScrollItemSize","options"],["containerStyleClass","w-100","filter","","filterBy","label","appendTo","body","formControlName","categoryID","optionLabel","label","optionValue","key","placeholder","Select a Category",1,"w-100",3,"onFocus","showClear","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"d-flex","flex-column"],["formControlName","pageSize","type","text","pInputText",""]],template:function(t,i){if(t&1){let o=w();a(0,"app-main-panel",7),v("search",function(d){return _(o),h(i.onSearchEvent(d))}),Ze("isDialogFilterVisibleChange",function(d){return _(o),Ue(i.isDialogFilterVisible,d)||(i.isDialogFilterVisible=d),h(d)}),v("filterEmitted",function(){return _(o),h(i.onFilterEvent())})("filterConfirmed",function(){return _(o),h(i.onFilterOKEvent())}),f(1,pi,10,3,"ng-template",null,0,b)(3,hi,10,10,"ng-template",null,1,b)(5,xi,1,1,"ng-template",null,2,b),r()}t&2&&(c("isSearchableInput",!0),je("isDialogFilterVisible",i.isDialogFilterVisible),c("isFilterable",!0))},dependencies:[M,L,jt,R,Yt,Nn,st,ve,Wt,J,te,Ce,F,D,Se,be,ye,Qe,Tn,vn,Sn,wn,B,yn,oe,ie,at,tt,et,he,En,An,Te,we,ae,re],styles:[".p-card{height:100%} .p-card .p-card-body{height:inherit} .p-card .p-card-body .p-card-content{height:inherit}"],changeDetection:0})}}return n})();var bi=["class","page"],yi=()=>["../../"],Tt=n=>({"ng-invalid ng-dirty":n}),Ii=n=>({"ng-dirty ng-invalid":n});function vi(n,s){if(n&1){let e=w();a(0,"div",5)(1,"a",6),p(2,"Cancel"),r(),a(3,"p-button",7),v("onClick",function(){_(e);let i=l();return h(i.onSubmit())}),r()()}n&2&&(m(),c("routerLink",O(1,yi)))}function Si(n,s){n&1&&(a(0,"div",25),p(1," Name is required "),r())}function wi(n,s){if(n&1&&(a(0,"div"),f(1,Si,2,0,"div",24),r()),n&2){let e=l(2);m(),c("ngIf",e.form.controls.Name.errors.required)}}function Ti(n,s){n&1&&(a(0,"div",26)(1,"p"),p(2," If you assign an outlet for this product, it is only visible for users who has access to that outlet. "),r()())}function Ai(n,s){if(n&1&&(a(0,"span",27),p(1),r()),n&2){let e=s.$implicit;c("pTooltip",e.name),m(),ke(" ",e.name," ")}}function Ei(n,s){n&1&&(a(0,"div",25),p(1," Code is required "),r())}function Mi(n,s){if(n&1&&(a(0,"div"),f(1,Ei,2,0,"div",24),r()),n&2){let e=l(2);m(),c("ngIf",e.form.controls.Code.errors.required)}}function Pi(n,s){n&1&&(a(0,"div",25),p(1," Category is required "),r())}function ki(n,s){if(n&1&&(a(0,"div"),f(1,Pi,2,0,"div",24),r()),n&2){let e=l(2);m(),c("ngIf",e.form.controls.Category.errors.required)}}function Oi(n,s){n&1&&(a(0,"div",25),p(1," Note is required "),r())}function Fi(n,s){if(n&1&&(a(0,"div"),f(1,Oi,2,0,"div",24),r()),n&2){let e=l(2);m(),c("ngIf",e.form.controls.Note.errors.required)}}function Vi(n,s){if(n&1&&(a(0,"p-panel",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12)(5,"div",13)(6,"label",14),p(7,"Name"),r(),x(8,"input",15),f(9,wi,2,1,"div",16),r()(),a(10,"div",12)(11,"div",13)(12,"div")(13,"label",14),p(14,"Outlet"),r(),x(15,"p-button",17),f(16,Ti,3,0,"ng-template",null,2,b),r(),a(18,"p-select",18),f(19,Ai,2,2,"ng-template",null,3,b),r()()(),a(21,"div",12)(22,"div",13)(23,"label",14),p(24,"Code"),r(),x(25,"input",19),f(26,Mi,2,1,"div",16),r()(),a(27,"div",20)(28,"div",21)(29,"label",14),p(30,"Category"),r(),x(31,"p-treeselect",22),f(32,ki,2,1,"div",16),r()(),a(33,"div",12)(34,"div",13)(35,"label",14),p(36,"Note"),r(),x(37,"textarea",23),f(38,Fi,2,1,"div",16),r()()()()()()),n&2){let e=Q(17),t=l();m(),c("formGroup",t.form),m(7),c("ngClass",T(14,Tt,t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched))),m(),c("ngIf",t.form.controls.Name.invalid&&(t.form.controls.Name.dirty||t.form.controls.Name.touched)),m(6),c("pTooltip",e)("rounded",!0)("text",!0),m(3),c("options",t.outlets()),m(7),c("ngClass",T(16,Tt,t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched))),m(),c("ngIf",t.form.controls.Code.invalid&&(t.form.controls.Code.dirty||t.form.controls.Code.touched)),m(5),c("options",t.categoryOptions())("ngClass",T(18,Ii,t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched))),m(),c("ngIf",t.form.controls.Category.invalid&&(t.form.controls.Category.dirty||t.form.controls.Category.touched)),m(5),c("ngClass",T(20,Tt,t.form.controls.Note.invalid&&(t.form.controls.Note.dirty||t.form.controls.Note.touched))),m(),c("ngIf",t.form.controls.Note.errors)}}var At=(()=>{class n{constructor(){this.route=g(X),this.coa_service=g(G),this.coa_info=I(null),this.fb=g(Ie),this.isEdit=I(!1),this.categoryOptions=I([]),this.router=g(Y),this.outlets=j(()=>this.coa_info()?this.coa_info().options.entities:[])}findParenChilds(e,t){function i(o,u=null){for(let d of o){if(d.key===t)return{parent:u,child:d};if(d.children){let $=i(d.children,d);if($)return $}}return null}return i(e)}generateForm(e){this.form=this.fb.group({ID:new V(e.id||""),Name:new V(e.name||"",[ee.required]),Code:new V(e.code||"",[ee.required]),Note:new V(e.note||"",[]),Balance:new V(e.balance||0),Outlet:new V(e.outletID||""),AccessType:new V(e.accessTypeID||0),Category:new V(null,[ee.required])})}ngOnInit(){this.generateForm({id:"",name:"",code:"",note:"",balance:0,outletID:"",accessTypeID:0,categoryID:null}),this.fetchLoader(),this.fetchCategoryOptions()}fetchLoader(){this.route.paramMap.pipe(qe(e=>{if(e.has("id")){this.isEdit.set(!0);let t=e.get("id");return this.coa_service.getChartAccountFormById(t)}else return this.coa_service.getChartAccountForm()}),A("response"),K(e=>y(C({},e),{form:y(C({},e.form),{categoryID:e.form.categoryID==="00000000-0000-0000-0000-000000000000"?"":e.form.categoryID})})),S(e=>{this.coa_info.set(e),this.generateForm(e.form)})).subscribe()}onSubmit(){if(this.form.invalid){this.form.markAllAsTouched();return}let{AccessType:e,Balance:t,Category:i,Code:o,Name:u,Note:d,Outlet:$}=this.form.value,H={id:this.coa_info().form.id,categoryID:i.key,name:u,code:o,note:d,outletID:$||null,balance:t,accessTypeID:e};this.coa_service.submitChartAccount(H).pipe(S(()=>{this.form.reset(),this.router.navigate(["/chart-of-account/account"])}),A("response")).subscribe()}fetchCategoryOptions(){this.coa_service.getCachedCategoriesOptions().pipe(A("response"),S(e=>{this.categoryOptions.set(e);let t=this.findParenChilds(this.categoryOptions(),this.coa_info()?.form?.categoryID);this.form.controls.Category.setValue(t?.child)})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=E({type:n,selectors:[["app-coa-account-form",8,"page"]],attrs:bi,decls:5,vars:1,consts:[["actionButton",""],["content",""],["tooltipContent",""],["item",""],["pageTitle","Chart Of Account Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["type","button",1,"p-button","p-button-secondary","p-button-outlined",3,"routerLink"],["label","Submit",3,"onClick"],["styleClass","rounded-2"],[1,"row","justify-content-center",3,"formGroup"],[1,"col"],[1,"row","row-gap-2"],[1,"col","col-lg-6"],[1,"d-flex","flex-column"],["for",""],["size","small","formControlName","Name","type","text","pInputText","",3,"ngClass"],[4,"ngIf"],["icon","fa-solid fa-circle-info",3,"pTooltip","rounded","text"],["appendTo","body","formControlName","Outlet","optionLabel","name","optionValue","id","placeholder","Select Outlet",3,"options"],["size","small","formControlName","Code","type","text","pInputText","",3,"ngClass"],[1,"co","col-lg-6"],[1,"form-group","d-flex","flex-column"],["formControlName","Category","containerStyleClass","w-full","placeholder","Select a Category",1,"w-full",3,"options","ngClass"],["pSize","small","rows","5","cols","30","pTextarea","","formControlName","Note",3,"ngClass"],["class","invalid-feedback text-danger d-block",4,"ngIf"],[1,"invalid-feedback","text-danger","d-block"],[1,"flex","items-center"],[1,"d-inline-block","text-truncate",2,"max-width","200px",3,"pTooltip"]],template:function(t,i){t&1&&(a(0,"app-main-panel",4),f(1,vi,4,2,"ng-template",null,0,b)(3,Vi,39,22,"ng-template",null,1,b),r()),t&2&&c("hasMainWrapperPadding",!0)},dependencies:[R,Se,J,te,Ce,be,ye,st,M,_e,L,F,D,Te,we,B,tt,et,On,kn,at,In,he,nt,oe,ie,ae,re],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .p-treeselect{width:100%!important}"],changeDetection:0})}}return n})();var Li=["sublist"],Di=(n,s)=>({"p-contextmenu-submenu":n,"p-contextmenu-root-list":s}),Ri=()=>({"p-contextmenu-item-link":!0}),$n=()=>({class:"p-contextmenu-submenu-icon"}),Bi=()=>({exact:!1}),$i=n=>({"p-contextmenu-item-link":!0,"p-disabled":n}),Ki=n=>({$implicit:n});function qi(n,s){if(n&1&&x(0,"li",8),n&2){let e=l().$implicit,t=l(2);me(t.getItemProp(e,"style")),c("ngClass",t.getSeparatorItemClass(e)),P("id",t.getItemId(e))("data-pc-section","separator")}}function zi(n,s){if(n&1&&x(0,"span",19),n&2){let e=l(4).$implicit,t=l(2);c("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Gi(n,s){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=l(4).$implicit,t=l(2);P("data-pc-section","label"),m(),ke(" ",t.getItemLabel(e)," ")}}function Hi(n,s){if(n&1&&x(0,"span",21),n&2){let e=l(4).$implicit,t=l(2);c("innerHTML",t.getItemLabel(e),Ee),P("data-pc-section","label")}}function ji(n,s){if(n&1&&x(0,"p-badge",22),n&2){let e=l(4).$implicit,t=l(2);c("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function Ui(n,s){n&1&&x(0,"AngleRightIcon"),n&2&&(Pe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function Zi(n,s){}function Qi(n,s){n&1&&f(0,Zi,0,0,"ng-template",25),n&2&&c("data-pc-section","submenuicon")("aria-hidden",!0)}function Wi(n,s){if(n&1&&(pe(0),f(1,Ui,1,4,"AngleRightIcon",23)(2,Qi,1,2,null,24),ue()),n&2){let e=l(6);m(),c("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),c("ngTemplateOutlet",e.contextMenu.submenuIconTemplate||e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",O(3,$n))}}function Xi(n,s){if(n&1&&(a(0,"a",15),f(1,zi,1,5,"span",16)(2,Gi,2,2,"span",17)(3,Hi,1,2,"ng-template",null,2,b)(5,ji,1,2,"p-badge",18)(6,Wi,3,4,"ng-container",11),r()),n&2){let e=Q(4),t=l(3).$implicit,i=l(2);c("target",i.getItemProp(t,"target"))("ngClass",O(12,Ri)),P("href",i.getItemProp(t,"url"),Lt)("aria-hidden",!0)("data-automationid",i.getItemProp(t,"automationId"))("data-pc-section","action")("tabindex",-1),m(),c("ngIf",i.getItemProp(t,"icon")),m(),c("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),c("ngIf",i.getItemProp(t,"badge")),m(),c("ngIf",i.isItemGroup(t))}}function Yi(n,s){if(n&1&&x(0,"span",19),n&2){let e=l(4).$implicit,t=l(2);c("ngClass",t.getItemProp(e,"icon"))("ngStyle",t.getItemProp(e,"iconStyle")),P("data-pc-section","icon")("aria-hidden",!0)("tabindex",-1)}}function Ji(n,s){if(n&1&&(a(0,"span",20),p(1),r()),n&2){let e=l(4).$implicit,t=l(2);P("data-pc-section","label"),m(),ke(" ",t.getItemLabel(e)," ")}}function eo(n,s){if(n&1&&x(0,"span",21),n&2){let e=l(4).$implicit,t=l(2);c("innerHTML",t.getItemLabel(e),Ee),P("data-pc-section","label")}}function to(n,s){if(n&1&&x(0,"p-badge",22),n&2){let e=l(4).$implicit,t=l(2);c("styleClass",t.getItemProp(e,"badgeStyleClass"))("value",t.getItemProp(e,"badge"))}}function no(n,s){n&1&&x(0,"AngleRightIcon"),n&2&&(Pe("p-contextmenu-submenu-icon"),P("data-pc-section","submenuicon")("aria-hidden",!0))}function io(n,s){}function oo(n,s){n&1&&f(0,io,0,0,"ng-template",25),n&2&&c("data-pc-section","submenuicon")("aria-hidden",!0)}function ro(n,s){if(n&1&&(pe(0),f(1,no,1,4,"AngleRightIcon",23)(2,oo,1,2,null,24),ue()),n&2){let e=l(6);m(),c("ngIf",!e.contextMenu.submenuIconTemplate&&!e.contextMenu._submenuIconTemplate),m(),c("ngTemplateOutlet",!e.contextMenu.submenuIconTemplate||!e.contextMenu._submenuIconTemplate)("ngTemplateOutletContext",O(3,$n))}}function ao(n,s){if(n&1&&(a(0,"a",26),f(1,Yi,1,5,"span",16)(2,Ji,2,2,"span",17)(3,eo,1,2,"ng-template",null,2,b)(5,to,1,2,"p-badge",18)(6,ro,3,4,"ng-container",11),r()),n&2){let e=Q(4),t=l(3).$implicit,i=l(2);c("routerLink",i.getItemProp(t,"routerLink"))("queryParams",i.getItemProp(t,"queryParams"))("routerLinkActiveOptions",i.getItemProp(t,"routerLinkActiveOptions")||O(20,Bi))("target",i.getItemProp(t,"target"))("ngClass",T(21,$i,i.getItemProp(t,"disabled")))("fragment",i.getItemProp(t,"fragment"))("queryParamsHandling",i.getItemProp(t,"queryParamsHandling"))("preserveFragment",i.getItemProp(t,"preserveFragment"))("skipLocationChange",i.getItemProp(t,"skipLocationChange"))("replaceUrl",i.getItemProp(t,"replaceUrl"))("state",i.getItemProp(t,"state")),P("data-automationid",i.getItemProp(t,"automationId"))("tabindex",-1)("aria-hidden",!0)("data-pc-section","action"),m(),c("ngIf",i.getItemProp(t,"icon")),m(),c("ngIf",i.getItemProp(t,"escape"))("ngIfElse",e),m(3),c("ngIf",i.getItemProp(t,"badge")),m(),c("ngIf",i.isItemGroup(t))}}function so(n,s){if(n&1&&(pe(0),f(1,Xi,7,13,"a",13)(2,ao,7,23,"a",14),ue()),n&2){let e=l(2).$implicit,t=l(2);m(),c("ngIf",!t.getItemProp(e,"routerLink")),m(),c("ngIf",t.getItemProp(e,"routerLink"))}}function lo(n,s){}function co(n,s){n&1&&f(0,lo,0,0,"ng-template")}function mo(n,s){if(n&1&&(pe(0),f(1,co,1,0,null,24),ue()),n&2){let e=l(2).$implicit,t=l(2);m(),c("ngTemplateOutlet",t.itemTemplate)("ngTemplateOutletContext",T(2,Ki,e.item))}}function po(n,s){if(n&1){let e=w();a(0,"p-contextmenu-sub",27),v("itemClick",function(i){_(e);let o=l(4);return h(o.itemClick.emit(i))})("itemMouseEnter",function(i){_(e);let o=l(4);return h(o.onItemMouseEnter(i))}),r()}if(n&2){let e=l(2).$implicit,t=l(2);c("items",e.items)("itemTemplate",t.itemTemplate)("menuId",t.menuId)("visible",t.isItemActive(e)&&t.isItemGroup(e))("activeItemPath",t.activeItemPath)("focusedItemId",t.focusedItemId)("level",t.level+1)}}function uo(n,s){if(n&1){let e=w();a(0,"li",9,1)(2,"div",10),v("click",function(i){_(e);let o=l().$implicit,u=l(2);return h(u.onItemClick(i,o))})("mouseenter",function(i){_(e);let o=l().$implicit,u=l(2);return h(u.onItemMouseEnter({$event:i,processedItem:o}))}),f(3,so,3,2,"ng-container",11)(4,mo,2,4,"ng-container",11),r(),f(5,po,1,7,"p-contextmenu-sub",12),r()}if(n&2){let e=l(),t=e.$implicit,i=e.index,o=l(2);Pe(o.getItemProp(t,"styleClass")),c("ngStyle",o.getItemProp(t,"style"))("ngClass",o.getItemClass(t))("tooltipOptions",o.getItemProp(t,"tooltipOptions")),P("id",o.getItemId(t))("data-pc-section","menuitem")("data-p-highlight",o.isItemActive(t))("data-p-focused",o.isItemFocused(t))("data-p-disabled",o.isItemDisabled(t))("aria-label",o.getItemLabel(t))("aria-disabled",o.isItemDisabled(t)||void 0)("aria-haspopup",o.isItemGroup(t)&&!o.getItemProp(t,"to")?"menu":void 0)("aria-expanded",o.isItemGroup(t)?o.isItemActive(t):void 0)("aria-level",o.level+1)("aria-setsize",o.getAriaSetSize())("aria-posinset",o.getAriaPosInset(i)),m(2),P("data-pc-section","content"),m(),c("ngIf",!o.itemTemplate),m(),c("ngIf",o.itemTemplate),m(),c("ngIf",o.isItemVisible(t)&&o.isItemGroup(t))}}function fo(n,s){if(n&1&&f(0,qi,1,5,"li",6)(1,uo,6,21,"li",7),n&2){let e=s.$implicit,t=l(2);c("ngIf",t.isItemVisible(e)&&t.getItemProp(e,"separator")),m(),c("ngIf",t.isItemVisible(e)&&!t.getItemProp(e,"separator"))}}function _o(n,s){if(n&1){let e=w();a(0,"ul",4,0),v("@overlayAnimation.start",function(i){_(e);let o=Q(1),u=l();return h(u.onEnter(i,o))})("keydown",function(i){_(e);let o=l();return h(o.menuKeydown.emit(i))})("focus",function(i){_(e);let o=l();return h(o.menuFocus.emit(i))})("blur",function(i){_(e);let o=l();return h(o.menuBlur.emit(i))}),f(2,fo,2,2,"ng-template",5),r()}if(n&2){let e=l();c("ngClass",$t(10,Di,!e.root,e.root))("@overlayAnimation",e.visible)("tabindex",e.tabindex),P("id",e.menuId+"_list")("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-activedescendant",e.focusedItemId)("aria-orientation","vertical")("data-pc-section","menu"),m(2),c("ngForOf",e.items)}}var ho=["item"],go=["submenuicon"],xo=["rootmenu"],Co=["container"],bo=n=>({"p-contextmenu p-component":!0,"p-contextmenu-mobile":n}),yo=()=>({value:"visible"});function Io(n,s){if(n&1){let e=w();a(0,"div",3,0),v("@overlayAnimation.start",function(i){_(e);let o=l();return h(o.onOverlayAnimationStart(i))})("@overlayAnimation.done",function(i){_(e);let o=l();return h(o.onOverlayAnimationEnd(i))}),a(2,"p-contextmenu-sub",4,1),v("itemClick",function(i){_(e);let o=l();return h(o.onItemClick(i))})("menuFocus",function(i){_(e);let o=l();return h(o.onMenuFocus(i))})("menuBlur",function(i){_(e);let o=l();return h(o.onMenuBlur(i))})("menuKeydown",function(i){_(e);let o=l();return h(o.onKeyDown(i))})("itemMouseEnter",function(i){_(e);let o=l();return h(o.onItemMouseEnter(i))}),r()()}if(n&2){let e=l();Pe(e.styleClass),c("ngClass",T(20,bo,e.queryMatches))("ngStyle",e.style)("@overlayAnimation",O(22,yo)),P("data-pc-section","root")("data-pc-name","contextmenu")("id",e.id),m(2),c("root",!0)("items",e.processedItems)("itemTemplate",e.itemTemplate||e._itemTemplate)("menuId",e.id)("tabindex",e.disabled?-1:e.tabindex)("ariaLabel",e.ariaLabel)("ariaLabelledBy",e.ariaLabelledBy)("baseZIndex",e.baseZIndex)("autoZIndex",e.autoZIndex)("visible",e.submenuVisible())("focusedItemId",e.focused?e.focusedItemId:void 0)("activeItemPath",e.activeItemPath())}}var vo=({dt:n})=>`
88
+ .p-contextmenu {
89
+ position: absolute;
90
+ background: ${n("contextmenu.background")};
91
+ color: ${n("contextmenu.color")};
92
+ border: 1px solid ${n("contextmenu.border.color")};
93
+ border-radius: ${n("contextmenu.border.radius")};
94
+ box-shadow: ${n("contextmenu.shadow")};
95
+ min-width: 12.5rem;
96
+ }
97
+
98
+ .p-contextmenu-root-list,
99
+ .p-contextmenu-submenu {
100
+ margin: 0;
101
+ padding: ${n("contextmenu.list.padding")};
102
+ list-style: none;
103
+ outline: 0 none;
104
+ display: flex;
105
+ flex-direction: column;
106
+ gap: ${n("contextmenu.list.gap")};
107
+ }
108
+
109
+ .p-contextmenu-submenu {
110
+ position: absolute;
111
+ display: flex;
112
+ flex-direction: column;
113
+ min-width: 100%;
114
+ z-index: 1;
115
+ background: ${n("contextmenu.background")};
116
+ color: ${n("contextmenu.color")};
117
+ border: 1px solid ${n("contextmenu.border.color")};
118
+ border-radius: ${n("contextmenu.border.radius")};
119
+ box-shadow: ${n("contextmenu.shadow")};
120
+ }
121
+
122
+ .p-contextmenu-item {
123
+ position: relative;
124
+ }
125
+
126
+ .p-contextmenu-item-content {
127
+ transition: background ${n("contextmenu.transition.duration")}, color ${n("contextmenu.transition.duration")};
128
+ border-radius: ${n("contextmenu.item.border.radius")};
129
+ color: ${n("contextmenu.item.color")};
130
+ }
131
+
132
+ .p-contextmenu-item-link {
133
+ cursor: pointer;
134
+ display: flex;
135
+ align-items: center;
136
+ text-decoration: none;
137
+ overflow: hidden;
138
+ position: relative;
139
+ color: inherit;
140
+ padding: ${n("contextmenu.item.padding")};
141
+ gap: ${n("contextmenu.item.gap")};
142
+ user-select: none;
143
+ }
144
+
145
+ .p-contextmenu-item-label {
146
+ line-height: 1;
147
+ }
148
+
149
+ .p-contextmenu-item-icon {
150
+ color: ${n("contextmenu.item.icon.color")};
151
+ }
152
+
153
+ .p-contextmenu-submenu-icon {
154
+ color: ${n("contextmenu.submenu.icon.color")};
155
+ margin-left: auto;
156
+ font-size: ${n("contextmenu.submenu.icon.size")};
157
+ width: ${n("contextmenu.submenu.icon.size")};
158
+ height: ${n("contextmenu.submenu.icon.size")};
159
+ }
160
+
161
+ .p-contextmenu-submenu-icon:dir(rtl) {
162
+ margin-left: 0;
163
+ margin-right: auto;
164
+ }
165
+
166
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content {
167
+ color: ${n("contextmenu.item.focus.color")};
168
+ background: ${n("contextmenu.item.focus.background")};
169
+ }
170
+
171
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-item-icon {
172
+ color: ${n("contextmenu.item.icon.focus.color")};
173
+ }
174
+
175
+ .p-contextmenu-item.p-focus > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
176
+ color: ${n("contextmenu.submenu.icon.focus.color")};
177
+ }
178
+
179
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover {
180
+ color: ${n("contextmenu.item.focus.color")};
181
+ background: ${n("contextmenu.item.focus.background")};
182
+ }
183
+
184
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-item-icon {
185
+ color: ${n("contextmenu.item.icon.focus.color")};
186
+ }
187
+
188
+ .p-contextmenu-item:not(.p-disabled) > .p-contextmenu-item-content:hover .p-contextmenu-submenu-icon {
189
+ color: ${n("contextmenu.submenu.icon.focus.color")};
190
+ }
191
+
192
+ .p-contextmenu-item-active > .p-contextmenu-item-content {
193
+ color: ${n("contextmenu.item.active.color")};
194
+ background: ${n("contextmenu.item.active.background")};
195
+ }
196
+
197
+ .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-item-icon {
198
+ color: ${n("contextmenu.item.icon.active.color")};
199
+ }
200
+
201
+ .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
202
+ color: ${n("contextmenu.submenu.icon.active.color")};
203
+ }
204
+
205
+ .p-contextmenu-separator {
206
+ border-top: 1px solid ${n("contextmenu.separator.border.color")};
207
+ }
208
+
209
+ .p-contextmenu-enter-from,
210
+ .p-contextmenu-leave-active {
211
+ opacity: 0;
212
+ }
213
+
214
+ .p-contextmenu-enter-active {
215
+ transition: opacity 250ms;
216
+ }
217
+
218
+ .p-contextmenu-mobile .p-contextmenu-submenu {
219
+ position: static;
220
+ box-shadow: none;
221
+ border: 0 none;
222
+ padding-left: ${n("tieredmenu.submenu.mobile.indent")};
223
+ padding-right: 0;
224
+ }
225
+
226
+ .p-contextmenu-mobile .p-contextmenu-submenu-icon {
227
+ transition: transform 0.2s;
228
+ transform: rotate(90deg);
229
+ }
230
+
231
+ .p-contextmenu-mobile .p-contextmenu-item-active > .p-contextmenu-item-content .p-contextmenu-submenu-icon {
232
+ transform: rotate(-90deg);
233
+ }
234
+
235
+ /* For PrimeNG */
236
+ .p-contextmenu-submenu-icon.p-iconwrapper {
237
+ margin-left: auto;
238
+ }
239
+
240
+ .p-contextmenu-submenu-icon.p-iconwrapper:dir(rtl) {
241
+ margin-left: 0;
242
+ margin-right: auto;
243
+ }
244
+ `,So={root:"p-contextmenu p-component",rootList:"p-contextmenu-root-list",item:({instance:n,processedItem:s})=>["p-contextmenu-item",{"p-contextmenu-item-active":n.isItemActive(s),"p-focus":n.isItemFocused(s),"p-disabled":n.isItemDisabled(s)}],itemContent:"p-contextmenu-item-content",itemLink:"p-contextmenu-item-link",itemIcon:"p-contextmenu-item-icon",itemLabel:"p-contextmenu-item-label",submenuIcon:"p-contextmenu-submenu-icon",submenu:"p-contextmenu-submenu",separator:"p-contextmenu-separator"},Bn=(()=>{class n extends Je{name="contextmenu";theme=vo;classes=So;static \u0275fac=(()=>{let e;return function(i){return(e||(e=Ae(n)))(i||n)}})();static \u0275prov=ge({token:n,factory:n.\u0275fac})}return n})();var wo=(()=>{class n extends Le{contextMenu;visible=!1;items;itemTemplate;root=!1;autoZIndex=!0;baseZIndex=0;popup;menuId;ariaLabel;ariaLabelledBy;level=0;focusedItemId;activeItemPath;tabindex=0;itemClick=new Z;itemMouseEnter=new Z;menuFocus=new Z;menuBlur=new Z;menuKeydown=new Z;sublistViewChild;constructor(e){super(),this.contextMenu=e}getItemProp(e,t,i=null){return e&&e.item?gt(e.item[t],i):void 0}getItemId(e){return e.item&&e.item?.id?e.item.id:`${this.menuId}_${e.key}`}getItemKey(e){return this.getItemId(e)}getItemClass(e){return y(C({},this.getItemProp(e,"class")),{"p-contextmenu-item":!0,"p-contextmenu-item-active":this.isItemActive(e),"p-focus":this.isItemFocused(e),"p-disabled":this.isItemDisabled(e)})}getItemLabel(e){return this.getItemProp(e,"label")}getSeparatorItemClass(e){return y(C({},this.getItemProp(e,"class")),{"p-contextmenu-separator":!0})}getAriaSetSize(){return this.items.filter(e=>this.isItemVisible(e)&&!this.getItemProp(e,"separator")).length}getAriaPosInset(e){return e-this.items.slice(0,e).filter(t=>this.isItemVisible(t)&&this.getItemProp(t,"separator")).length+1}isItemVisible(e){return this.getItemProp(e,"visible")!==!1}isItemActive(e){if(this.activeItemPath)return this.activeItemPath.some(t=>t.key===e.key)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemFocused(e){return this.focusedItemId===this.getItemId(e)}isItemGroup(e){return ne(e.items)}onItemMouseEnter(e){let{event:t,processedItem:i}=e;this.itemMouseEnter.emit({originalEvent:t,processedItem:i})}onItemClick(e,t){this.getItemProp(t,"command",{originalEvent:e,item:t.item}),this.itemClick.emit({originalEvent:e,processedItem:t,isFocus:!0})}onEnter(e,t){if(e.fromState==="void"&&e.toState){let i=e.element;this.position(i)}}position(e){let t=e.parentElement.parentElement,i=on(e.parentElement.parentElement),o=dt(),u=e.offsetParent?e.offsetWidth:ft(e),d=Jt(t.children[0]);e.style.top="0px",parseInt(i.left,10)+d+u>o.width-tn()?e.style.left=-1*u+"px":e.style.left=d+"px"}static \u0275fac=function(t){return new(t||n)(ct(Nt(()=>lt)))};static \u0275cmp=E({type:n,selectors:[["p-contextMenuSub"],["p-contextmenu-sub"]],viewQuery:function(t,i){if(t&1&&de(Li,5),t&2){let o;q(o=z())&&(i.sublistViewChild=o.first)}},inputs:{visible:[2,"visible","visible",fe],items:"items",itemTemplate:"itemTemplate",root:[2,"root","root",fe],autoZIndex:[2,"autoZIndex","autoZIndex",fe],baseZIndex:[2,"baseZIndex","baseZIndex",xe],popup:[2,"popup","popup",fe],menuId:"menuId",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",level:[2,"level","level",xe],focusedItemId:"focusedItemId",activeItemPath:"activeItemPath",tabindex:[2,"tabindex","tabindex",xe]},outputs:{itemClick:"itemClick",itemMouseEnter:"itemMouseEnter",menuFocus:"menuFocus",menuBlur:"menuBlur",menuKeydown:"menuKeydown"},features:[Me],decls:1,vars:1,consts:[["sublist",""],["listItem",""],["htmlLabel",""],["role","menu",3,"ngClass","tabindex","keydown","focus","blur",4,"ngIf"],["role","menu",3,"keydown","focus","blur","ngClass","tabindex"],["ngFor","",3,"ngForOf"],["role","separator",3,"style","ngClass",4,"ngIf"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","class","tooltipOptions",4,"ngIf"],["role","separator",3,"ngClass"],["role","menuitem","pTooltip","",3,"ngStyle","ngClass","tooltipOptions"],[1,"p-contextmenu-item-content",3,"click","mouseenter"],[4,"ngIf"],[3,"items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level","itemClick","itemMouseEnter",4,"ngIf"],["pRipple","",3,"target","ngClass",4,"ngIf"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state",4,"ngIf"],["pRipple","",3,"target","ngClass"],["class","p-contextmenu-item-icon",3,"ngClass","ngStyle",4,"ngIf"],["class","p-contextmenu-item-label",4,"ngIf","ngIfElse"],[3,"styleClass","value",4,"ngIf"],[1,"p-contextmenu-item-icon",3,"ngClass","ngStyle"],[1,"p-contextmenu-item-label"],[1,"p-contextmenu-item-label",3,"innerHTML"],[3,"styleClass","value"],[3,"class",4,"ngIf"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"data-pc-section","aria-hidden"],["pRipple","",3,"routerLink","queryParams","routerLinkActiveOptions","target","ngClass","fragment","queryParamsHandling","preserveFragment","skipLocationChange","replaceUrl","state"],[3,"itemClick","itemMouseEnter","items","itemTemplate","menuId","visible","activeItemPath","focusedItemId","level"]],template:function(t,i){t&1&&f(0,_o,3,13,"ul",3),t&2&&c("ngIf",i.root?!0:i.visible)},dependencies:[n,M,_e,Gt,L,Ht,mt,F,D,dn,he,nt,un,Ct,_n,Ne],encapsulation:2,data:{animation:[pt("overlayAnimation",[Ve(":enter",[Fe({opacity:0})]),Ve(":leave",[Fe({opacity:0})])])]}})}return n})(),lt=(()=>{class n extends Le{overlayService;set model(e){this._model=e,this._processedItems=this.createProcessedItems(this._model||[])}get model(){return this._model}triggerEvent="contextmenu";target;global;style;styleClass;appendTo;autoZIndex=!0;baseZIndex=0;id;breakpoint="960px";ariaLabel;ariaLabelledBy;pressDelay=500;onShow=new Z;onHide=new Z;rootmenu;containerViewChild;container;outsideClickListener;resizeListener;triggerEventListener;documentClickListener;documentTriggerListener;touchEndListener;pageX;pageY;visible=I(!1);relativeAlign;window;focused=!1;activeItemPath=I([]);focusedItemInfo=I({index:-1,level:0,parentKey:"",item:null});submenuVisible=I(!1);searchValue="";searchTimeout;_processedItems;_model;pressTimer;matchMediaListener;query;queryMatches;_componentStyle=g(Bn);get visibleItems(){let e=this.activeItemPath().find(t=>t.key===this.focusedItemInfo().parentKey);return e?e.items:this.processedItems}get processedItems(){return(!this._processedItems||!this._processedItems.length)&&(this._processedItems=this.createProcessedItems(this.model||[])),this._processedItems}get focusedItemId(){let e=this.focusedItemInfo();return e.item&&e.item?.id?e.item.id:e.index!==-1?`${this.id}${ne(e.parentKey)?"_"+e.parentKey:""}_${e.index}`:null}constructor(e){super(),this.overlayService=e,zt(()=>{let t=this.activeItemPath();ne(t)?this.bindGlobalListeners():this.visible()||this.unbindGlobalListeners()})}ngOnInit(){super.ngOnInit(),this.id=this.id||cn("pn_id_"),this.bindMatchMediaListener(),this.bindTriggerEventListener()}isMobile(){return an()||rn()}bindTriggerEventListener(){Oe(this.platformId)&&(this.triggerEventListener||(this.isMobile()?this.global?(this.triggerEventListener=this.renderer.listen(this.document,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.document,"touchend",this.onTouchEnd.bind(this))):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,"touchstart",this.onTouchStart.bind(this)),this.touchEndListener=this.renderer.listen(this.target,"touchend",this.onTouchEnd.bind(this))):this.global?this.triggerEventListener=this.renderer.listen(this.document,this.triggerEvent,e=>{this.show(e)}):this.target&&(this.triggerEventListener=this.renderer.listen(this.target,this.triggerEvent,e=>{this.show(e)}))))}bindGlobalListeners(){if(Oe(this.platformId)){if(!this.documentClickListener){let e=this.el?this.el.nativeElement.ownerDocument:"document";this.documentClickListener=this.renderer.listen(e,"click",t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&!t.ctrlKey&&t.button!==2&&this.triggerEvent!=="click"&&this.hide()}),this.documentTriggerListener=this.renderer.listen(e,this.triggerEvent,t=>{this.containerViewChild.nativeElement.offsetParent&&this.isOutsideClicked(t)&&this.hide()})}this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()}))}}itemTemplate;submenuIconTemplate;templates;_submenuIconTemplate;_itemTemplate;ngAfterContentInit(){this.templates?.forEach(e=>{switch(e.getType()){case"submenuicon":this._submenuIconTemplate=e.template;break;case"item":this._itemTemplate=e.template;break;default:this._itemTemplate=e.template;break}})}createProcessedItems(e,t=0,i={},o=""){let u=[];return e&&e.forEach((d,$)=>{let H=(o!==""?o+"_":"")+$,ce={item:d,index:$,level:t,key:H,parent:i,parentKey:o};ce.items=this.createProcessedItems(d.items,t+1,ce,H),u.push(ce)}),u}bindMatchMediaListener(){if(Oe(this.platformId)&&!this.matchMediaListener){let e=window.matchMedia(`(max-width: ${this.breakpoint})`);this.query=e,this.queryMatches=e.matches,this.matchMediaListener=()=>{this.queryMatches=e.matches},e.addEventListener("change",this.matchMediaListener)}}unbindMatchMediaListener(){this.matchMediaListener&&(this.query.removeEventListener("change",this.matchMediaListener),this.matchMediaListener=null)}getItemProp(e,t){return e?gt(e[t]):void 0}getProccessedItemLabel(e){return e?this.getItemLabel(e.item):void 0}getItemLabel(e){return this.getItemProp(e,"label")}isProcessedItemGroup(e){return e&&ne(e.items)}isSelected(e){return this.activeItemPath().some(t=>t.key===e.key)}isValidSelectedItem(e){return this.isValidItem(e)&&this.isSelected(e)}isValidItem(e){return!!e&&!this.isItemDisabled(e.item)&&!this.isItemSeparator(e.item)}isItemDisabled(e){return this.getItemProp(e,"disabled")}isItemSeparator(e){return this.getItemProp(e,"separator")}isItemMatched(e){return this.isValidItem(e)&&this.getProccessedItemLabel(e).toLocaleLowerCase().startsWith(this.searchValue.toLocaleLowerCase())}isProccessedItemGroup(e){return e&&ne(e.items)}onItemClick(e){let{processedItem:t}=e,i=this.isProcessedItemGroup(t);if(this.isSelected(t)){let{index:u,key:d,level:$,parentKey:H,item:ce}=t;this.activeItemPath.set(this.activeItemPath().filter(Be=>d!==Be.key&&d.startsWith(Be.key))),this.focusedItemInfo.set({index:u,level:$,parentKey:H,item:ce}),Xe(this.rootmenu.sublistViewChild.nativeElement)}else i?this.onItemChange(e):this.hide()}onItemMouseEnter(e){this.onItemChange(e,"hover")}onKeyDown(e){let t=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"ArrowLeft":this.onArrowLeftKey(e);break;case"ArrowRight":this.onArrowRightKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"Space":this.onSpaceKey(e);break;case"Enter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"PageDown":case"PageUp":case"Backspace":case"ShiftLeft":case"ShiftRight":break;default:!t&&ln(e.key)&&this.searchItems(e,e.key);break}}onArrowDownKey(e){let t=this.focusedItemInfo().index!==-1?this.findNextItemIndex(this.focusedItemInfo().index):this.findFirstFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}onArrowRightKey(e){let t=this.visibleItems[this.focusedItemInfo().index];this.isProccessedItemGroup(t)&&(this.onItemChange({originalEvent:e,processedItem:t}),this.focusedItemInfo.set({index:-1,parentKey:t.key,item:t.item}),this.searchValue="",this.onArrowDownKey(e)),e.preventDefault()}onArrowUpKey(e){if(e.altKey){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide(),e.preventDefault()}else{let t=this.focusedItemInfo().index!==-1?this.findPrevItemIndex(this.focusedItemInfo().index):this.findLastFocusedItemIndex();this.changeFocusedItemIndex(e,t),e.preventDefault()}}onArrowLeftKey(e){let t=this.visibleItems[this.focusedItemInfo().index],i=this.activeItemPath().find(d=>d.key===t.parentKey);_t(t.parent)||(this.focusedItemInfo.set({index:-1,parentKey:i?i.parentKey:"",item:t.item}),this.searchValue="",this.onArrowDownKey(e));let u=this.activeItemPath().filter(d=>d.parentKey!==this.focusedItemInfo().parentKey);this.activeItemPath.set(u),e.preventDefault()}onHomeKey(e){this.changeFocusedItemIndex(e,this.findFirstItemIndex()),e.preventDefault()}onEndKey(e){this.changeFocusedItemIndex(e,this.findLastItemIndex()),e.preventDefault()}onSpaceKey(e){this.onEnterKey(e)}onEscapeKey(e){this.hide();let t=this.findVisibleItem(this.findFirstFocusedItemIndex()),i=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},i),{index:this.findFirstFocusedItemIndex(),item:t.item})),e.preventDefault()}onTabKey(e){if(this.focusedItemInfo().index!==-1){let t=this.visibleItems[this.focusedItemInfo().index];!this.isProccessedItemGroup(t)&&this.onItemChange({originalEvent:e,processedItem:t})}this.hide()}onEnterKey(e){if(this.focusedItemInfo().index!==-1){let t=We(this.rootmenu.el.nativeElement,`li[id="${`${this.focusedItemId}`}"]`),i=t&&We(t,'a[data-pc-section="action"]');i?i.click():t&&t.click();let o=this.visibleItems[this.focusedItemInfo().index];if(!this.isProccessedItemGroup(o)){let d=this.focusedItemInfo();this.focusedItemInfo.set(y(C({},d),{index:this.findFirstFocusedItemIndex()}))}}e.preventDefault()}onItemChange(e,t){let{processedItem:i,isFocus:o}=e;if(_t(i))return;let{index:u,key:d,level:$,parentKey:H,items:ce}=i,Be=ne(ce),Pt=this.activeItemPath().filter(kt=>kt.parentKey!==H&&kt.parentKey!==d);Be&&(Pt.push(i),this.submenuVisible.set(!0)),this.focusedItemInfo.set({index:u,level:$,parentKey:H,item:i.item}),o&&Xe(this.rootmenu.sublistViewChild.nativeElement),!(t==="hover"&&this.queryMatches)&&this.activeItemPath.set(Pt)}onMenuFocus(e){this.focused=!0;let t=this.focusedItemInfo().index!==-1?this.focusedItemInfo():{index:-1,level:0,parentKey:"",item:null};this.focusedItemInfo.set(t)}onMenuBlur(e){this.focused=!1,this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.searchValue=""}onOverlayAnimationStart(e){switch(e.toState){case"visible":this.container=e.element,this.position(),this.moveOnTop(),this.appendOverlay(),this.bindGlobalListeners(),Xe(this.rootmenu.sublistViewChild.nativeElement);break}}onOverlayAnimationEnd(e){switch(e.toState){case"void":this.onOverlayHide();break}}appendOverlay(){this.appendTo&&(this.appendTo==="body"?this.renderer.appendChild(this.document.body,this.containerViewChild.nativeElement):en(this.appendTo,this.containerViewChild.nativeElement))}moveOnTop(){this.autoZIndex&&this.containerViewChild&&xt.set("menu",this.containerViewChild.nativeElement,this.baseZIndex+this.config.zIndex.menu)}onOverlayHide(){this.unbindGlobalListeners(),this.cd.destroyed||(this.target=null),this.container&&this.autoZIndex&&xt.clear(this.container),this.container=null}onTouchStart(e){this.pressTimer=setTimeout(()=>{this.show(e)},this.pressDelay)}onTouchEnd(){clearTimeout(this.pressTimer)}hide(){this.visible.set(!1),this.onHide.emit(),this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null})}toggle(e){this.visible()?this.hide():this.show(e)}show(e){this.activeItemPath.set([]),this.focusedItemInfo.set({index:-1,level:0,parentKey:"",item:null}),this.pageX=e.pageX,this.pageY=e.pageY,this.onShow.emit(),this.visible()?this.position():this.visible.set(!0),e.stopPropagation(),e.preventDefault()}position(){let e=this.pageX+1,t=this.pageY+1,i=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetWidth:ft(this.containerViewChild.nativeElement),o=this.containerViewChild.nativeElement.offsetParent?this.containerViewChild.nativeElement.offsetHeight:nn(this.containerViewChild.nativeElement),u=dt();e+i-this.document.scrollingElement.scrollLeft>u.width&&(e-=i),t+o-this.document.scrollingElement.scrollTop>u.height&&(t-=o),e<this.document.scrollingElement.scrollLeft&&(e=this.document.scrollingElement.scrollLeft),t<this.document.scrollingElement.scrollTop&&(t=this.document.scrollingElement.scrollTop),this.containerViewChild.nativeElement.style.left=e+"px",this.containerViewChild.nativeElement.style.top=t+"px"}searchItems(e,t){this.searchValue=(this.searchValue||"")+t;let i=-1,o=!1;return this.focusedItemInfo().index!==-1?(i=this.visibleItems.slice(this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)),i=i===-1?this.visibleItems.slice(0,this.focusedItemInfo().index).findIndex(u=>this.isItemMatched(u)):i+this.focusedItemInfo().index):i=this.visibleItems.findIndex(u=>this.isItemMatched(u)),i!==-1&&(o=!0),i===-1&&this.focusedItemInfo().index===-1&&(i=this.findFirstFocusedItemIndex()),i!==-1&&this.changeFocusedItemIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),o}findVisibleItem(e){return ne(this.visibleItems)?this.visibleItems[e]:null}findLastFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findLastItemIndex():e}findLastItemIndex(){return ht(this.visibleItems,e=>this.isValidItem(e))}findPrevItemIndex(e){let t=e>0?ht(this.visibleItems.slice(0,e),i=>this.isValidItem(i)):-1;return t>-1?t:e}findNextItemIndex(e){let t=e<this.visibleItems.length-1?this.visibleItems.slice(e+1).findIndex(i=>this.isValidItem(i)):-1;return t>-1?t+e+1:e}findFirstFocusedItemIndex(){let e=this.findSelectedItemIndex();return e<0?this.findFirstItemIndex():e}findFirstItemIndex(){return this.visibleItems.findIndex(e=>this.isValidItem(e))}findSelectedItemIndex(){return this.visibleItems.findIndex(e=>this.isValidSelectedItem(e))}changeFocusedItemIndex(e,t){let i=this.findVisibleItem(t),o=this.focusedItemInfo();o.index!==t&&(this.focusedItemInfo.set(y(C({},o),{index:t,item:i.item})),this.scrollInView())}scrollInView(e=-1){let t=e!==-1?`${this.id}_${e}`:this.focusedItemId,i=We(this.rootmenu.el.nativeElement,`li[id="${t}"]`);i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}bindResizeListener(){Oe(this.platformId)&&(this.resizeListener||(this.resizeListener=this.renderer.listen(this.document.defaultView,"resize",e=>{this.hide()})))}isOutsideClicked(e){return!(this.containerViewChild.nativeElement.isSameNode(e.target)||this.containerViewChild.nativeElement.contains(e.target))}unbindResizeListener(){this.resizeListener&&(this.resizeListener(),this.resizeListener=null)}unbindGlobalListeners(){this.documentClickListener&&(this.documentClickListener(),this.documentClickListener=null),this.documentTriggerListener&&(this.documentTriggerListener(),this.documentTriggerListener=null),this.resizeListener&&(this.resizeListener(),this.resizeListener=null),this.touchEndListener&&(this.touchEndListener(),this.touchEndListener=null)}unbindTriggerEventListener(){this.triggerEventListener&&(this.triggerEventListener(),this.triggerEventListener=null)}removeAppendedElements(){this.appendTo&&this.containerViewChild&&(this.appendTo==="body"?this.renderer.removeChild(this.document.body,this.containerViewChild.nativeElement):sn(this.containerViewChild.nativeElement,this.appendTo))}ngOnDestroy(){this.unbindGlobalListeners(),this.unbindTriggerEventListener(),this.unbindMatchMediaListener(),this.removeAppendedElements(),super.ngOnDestroy()}static \u0275fac=function(t){return new(t||n)(ct(mn))};static \u0275cmp=E({type:n,selectors:[["p-contextMenu"],["p-contextmenu"],["p-context-menu"]],contentQueries:function(t,i,o){if(t&1&&(He(o,ho,4),He(o,go,4),He(o,Ye,4)),t&2){let u;q(u=z())&&(i.itemTemplate=u.first),q(u=z())&&(i.submenuIconTemplate=u.first),q(u=z())&&(i.templates=u)}},viewQuery:function(t,i){if(t&1&&(de(xo,5),de(Co,5)),t&2){let o;q(o=z())&&(i.rootmenu=o.first),q(o=z())&&(i.containerViewChild=o.first)}},inputs:{model:"model",triggerEvent:"triggerEvent",target:"target",global:[2,"global","global",fe],style:"style",styleClass:"styleClass",appendTo:"appendTo",autoZIndex:[2,"autoZIndex","autoZIndex",fe],baseZIndex:[2,"baseZIndex","baseZIndex",xe],id:"id",breakpoint:"breakpoint",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",pressDelay:[2,"pressDelay","pressDelay",xe]},outputs:{onShow:"onShow",onHide:"onHide"},features:[W([Bn]),Me],decls:1,vars:1,consts:[["container",""],["rootmenu",""],[3,"ngClass","class","ngStyle",4,"ngIf"],[3,"ngClass","ngStyle"],[3,"itemClick","menuFocus","menuBlur","menuKeydown","itemMouseEnter","root","items","itemTemplate","menuId","tabindex","ariaLabel","ariaLabelledBy","baseZIndex","autoZIndex","visible","focusedItemId","activeItemPath"]],template:function(t,i){t&1&&f(0,Io,4,23,"div",2),t&2&&c("ngIf",i.visible())},dependencies:[M,_e,L,mt,wo,F,he,Ct,Ne],encapsulation:2,data:{animation:[pt("overlayAnimation",[Ve(":enter",[Fe({opacity:0}),ut("250ms")]),Ve(":leave",[ut(".1s linear",Fe({opacity:0}))])])]},changeDetection:0})}return n})(),Kn=(()=>{class n{static \u0275fac=function(t){return new(t||n)};static \u0275mod=Ge({type:n});static \u0275inj=ze({imports:[lt,Ne,Ne]})}return n})();var Ao=["editInput"],Eo=["tree"],Mo=["class","page"],Po=()=>({height:"calc(100vh - 70px)"});function ko(n,s){n&1&&(a(0,"a",6),x(1,"i",7),p(2," Add"),r())}function Oo(n,s){if(n&1){let e=w();a(0,"input",14,4),Ze("ngModelChange",function(i){let o=_(e).$implicit;return Ue(o.label,i)||(o.label=i),h(i)}),v("keydown",function(i){_(e);let o=l(2);return h(o.handleEditKeydown(i))})("blur",function(i){_(e);let o=l(2);return h(o.onNodeEditBlur(i))}),r()}if(n&2){let e=s.$implicit;je("ngModel",e.label)}}function Fo(n,s){if(n&1){let e=w();a(0,"div",8)(1,"div",9)(2,"p-panel",10)(3,"p-tree",11,2),v("onNodeContextMenuSelect",function(i){_(e);let o=l();return h(o.onNodeContextMenuSelect(i))})("onNodeSelect",function(i){_(e);let o=l();return h(o.onNodeSelect(i))})("onNodeUnselect",function(i){_(e);let o=l();return h(o.onNodeUnselect(i))})("onNodeDrop",function(i){_(e);let o=l();return h(o.onNodeDrop(i))}),f(5,Oo,2,1,"ng-template",12),r(),x(6,"p-contextmenu",13,3),r()()()}if(n&2){let e=Q(7),t=l();m(2),me(O(14,Po)),c("showHeader",!1),m(),c("virtualScroll",!0)("virtualScrollItemSize",40)("scrollHeight","calc(100vh - 142px)")("value",t.categoryTree())("contextMenu",e)("selection",t.selectedCategory)("draggableNodes",!0)("droppableNodes",!0)("propagateSelectionUp",!1)("propagateSelectionDown",!1),m(3),c("model",t.contextMenuItems())}}var qn=(()=>{class n{constructor(){this._coaTypesService=g(le),this._router=g(Y),this.contextMenuItems=I([]),this.categoryTree=I([]),this.selectedCategory=null,this._shouldAutoFocus=I(!1)}ngOnInit(){this._loadCategories().subscribe(),this._initializeContextMenuItems(),this.expandAllNodes()}ngAfterViewChecked(){this.selectedCategory&&!this._shouldAutoFocus()&&this.editInputRef&&(this.editInputRef.nativeElement.focus(),this.editInputRef.nativeElement.select(),this._shouldAutoFocus.set(!0))}_loadCategories(){return this._coaTypesService.fetchCOACategories().pipe(A("COA Categories"),K(e=>this._assignTreeIcons(e)),S(e=>{this.categoryTree.set(e),this.expandAllNodes()}))}_assignTreeIcons(e){return e.map(t=>{let i=!!t.children?.length;return y(C({},t),{icon:void 0,expandedIcon:i?"fa-solid fa-folder-open":void 0,collapsedIcon:i?"fa-solid fa-folder":"fa-solid fa-file",children:i?this._assignTreeIcons(t.children):[]})})}_initializeContextMenuItems(){this.contextMenuItems.set([{label:"Add",icon:"fa-light fa-plus",disabled:!1,command:()=>this._createChildCategory()},{label:"Edit",icon:"fa-light fa-pen-to-square",disabled:!1,command:()=>this._setSelectedNodeToEditMode()},{label:"Delete",icon:"fa-light fa-trash",disabled:!1,command:()=>this._deleteSelectedCategory()},{label:"Properties",icon:"fa-light fa-file",disabled:!1,command:()=>{this._router.navigate(["/chart-of-account/coa-types/info"],{queryParams:{ID:this.selectedCategory?.key}})}}])}_findNodeByKey(e){return this.treeComponent.getNodeWithKey(e,this.categoryTree())??null}_setSelectedNodeToEditMode(){let e=this._findNodeByKey(this.selectedCategory?.key);e&&(this.selectedCategory=e,e.type="edit")}_createChildCategory(){this.selectedCategory?.parent?.key&&this._coaTypesService.submitCategory({Name:"New Child Node",ParentID:this.selectedCategory.key,Code:"",Note:""}).pipe(N(e=>this._loadCategories().pipe(K(()=>e))),S(e=>{let t=this._findNodeByKey(e.id);t&&(this.selectedCategory=t,this._shouldAutoFocus.set(!1),t.type="edit")}),A("Created COA Node")).subscribe()}_deleteSelectedCategory(){this.selectedCategory?.key&&this._coaTypesService.deleteCategory(this.selectedCategory.key).pipe(N(()=>this._loadCategories())).subscribe()}renameNode(e,t=this.selectedCategory){this._coaTypesService.renameCategory(t.key,{Name:e}).pipe(N(()=>this._loadCategories())).subscribe()}onNodeSelect(e){this.selectedCategory=e.node,this._shouldAutoFocus.set(!1),e.node.children?.length&&(e.node.icon="fa-solid fa-folder-open")}onNodeUnselect(e){e.node.children?.length&&(e.node.icon="fa-solid fa-folder")}onNodeContextMenuSelect(e){if(this.selectedCategory=e.node,e.node.parent)this.contextMenuItems.update(t=>t.map(i=>y(C({},i),{disabled:!1})));else{let t=e.node.children?.length===5;this.contextMenuItems.update(i=>i.map(o=>o.label==="Add"?y(C({},o),{disabled:t}):o))}}onNodeDrop(e){let{dragNode:t,dropNode:i}=e;this._coaTypesService.updateParentCategory(t.key,{ParentID:i.key}).pipe(S(()=>this._loadCategories())).subscribe()}onNodeEditBlur(e){let t=e.target;this.renameNode(t.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&delete i.type}handleEditKeydown(e){let t=e.target;if([" ","Enter"].includes(e.key)&&e.stopPropagation(),e.key==="Enter"){this.renameNode(t.value);let i=this._findNodeByKey(this.selectedCategory?.key);i&&(delete i.type,this.treeComponent.updateSerializedValue?.())}}expandAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!0))}collapseAllNodes(){this.categoryTree().forEach(e=>this._expandRecursive(e,!1))}_expandRecursive(e,t){e.expanded=t,e.children?.forEach(i=>this._expandRecursive(i,t))}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=E({type:n,selectors:[["app-coa-type",8,"page"]],viewQuery:function(t,i){if(t&1&&(de(Ao,5),de(Eo,5)),t&2){let o;q(o=z())&&(i.editInputRef=o.first),q(o=z())&&(i.treeComponent=o.first)}},features:[W([pn])],attrs:Mo,decls:5,vars:0,consts:[["actionButton",""],["content",""],["tree",""],["cm",""],["editInput",""],["pageTitle",`Chart of Accounts Category
245
+ `],["routerLink","add",1,"p-button"],[1,"fa-solid","fa-plus"],[1,"row","justify-content-center"],[1,"col"],[3,"showHeader"],["selectionMode","single","draggableScope","self","droppableScope","self",3,"onNodeContextMenuSelect","onNodeSelect","onNodeUnselect","onNodeDrop","virtualScroll","virtualScrollItemSize","scrollHeight","value","contextMenu","selection","draggableNodes","droppableNodes","propagateSelectionUp","propagateSelectionDown"],["pTemplate","edit"],["appendTo","body",3,"model"],["type","text",1,"form-control",3,"ngModelChange","keydown","blur","ngModel"]],template:function(t,i){t&1&&(a(0,"app-main-panel",5),f(1,ko,3,0,"ng-template",null,0,b)(3,Fo,8,15,"ng-template",null,1,b),r())},dependencies:[R,Mn,F,D,Kn,lt,Ye,M,ve,J,te,Qt,B,fn,ae,re],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var Vo=["class","page"],Et=n=>({"is-invalid":n});function No(n,s){if(n&1){let e=w();a(0,"div",3)(1,"p-button",4),v("onClick",function(){_(e);let i=l();return h(i.goBack())}),r(),a(2,"p-button",5),v("onClick",function(){_(e);let i=l();return h(i.onSubmit())}),r()()}}function Lo(n,s){n&1&&(a(0,"div",19),p(1," Name is required "),r())}function Do(n,s){n&1&&(a(0,"div",19),p(1," Code is required "),r())}function Ro(n,s){n&1&&(a(0,"div",19),p(1," Note is required "),r())}function Bo(n,s){if(n&1){let e=w();a(0,"p-panel")(1,"div",6)(2,"div",7)(3,"div",8)(4,"div",9)(5,"div",10)(6,"label",11),p(7,"Name"),r(),x(8,"input",12),f(9,Lo,2,0,"div",13),r()(),a(10,"div",14)(11,"div",10)(12,"label",11),p(13,"Code"),r(),x(14,"input",15),f(15,Do,2,0,"div",13),r()(),a(16,"div",9)(17,"div",10)(18,"label",11),p(19,"Note"),r(),x(20,"textarea",16),f(21,Ro,2,0,"div",13),r()(),a(22,"div",9)(23,"div",17)(24,"label",11),p(25,"Category"),r(),a(26,"p-treeselect",18),v("onFocus",function(){_(e);let i=l();return h(i.loadCategories())}),r()()()()()()()}if(n&2){let e=l();m(3),c("formGroup",e.form),m(5),c("ngClass",T(8,Et,e.form.controls.Name.invalid&&(e.form.controls.Name.dirty||e.form.controls.Name.touched))),m(),c("ngIf",e.form.controls.Name.errors==null?null:e.form.controls.Name.errors.required),m(5),c("ngClass",T(10,Et,e.form.controls.Code.invalid&&(e.form.controls.Code.dirty||e.form.controls.Code.touched))),m(),c("ngIf",e.form.controls.Code==null||e.form.controls.Code.errors==null?null:e.form.controls.Code.errors.required),m(5),c("ngClass",T(12,Et,e.form.controls.Note.invalid&&(e.form.controls.Note.dirty||e.form.controls.Note.touched))),m(),c("ngIf",e.form.controls.Note.errors==null?null:e.form.controls.Note.errors.required),m(5),c("options",e.categories())}}var Mt=(()=>{class n{constructor(){this.categories=I([]),this.COATypeService=g(le),this.COAService=g(G),this.info=I(null),this.route=g(X),this.router=g(Y),this.fb=g(Ie)}goBack(){this.router.navigate(["/chart-of-account/coa-types"])}ngOnInit(){this.generateForm(),Ot([this.route.paramMap.pipe(K(e=>e.get("id")),Ke(e=>!!e)),this.COATypeService.fetchCOACategories()]).pipe(A("fetchCOACategories"),N(([e,t])=>{let i=this.findNodeByKeyInArray(t,e);return this.categories.set(t),this.COATypeService.getCOACategoryByID({ID:e}).pipe(S(o=>{this.form.patchValue({Name:o.name,Code:o.code,Note:o.note,Category:i.parent})}))})).subscribe()}loadCategories(){this.COAService.getCachedCategoriesOptions().pipe(S(e=>this.categories.set(e))).subscribe()}generateForm(){this.form=new Zt({Name:new V("",[ee.required]),Code:new V("",[ee.required]),Category:new V(null),Note:new V("",[ee.required])})}findNodeByKeyInArray(e,t){for(let i of e){let o=this.findNodeByKey(i,t);if(o)return o}return null}findNodeByKey(e,t,i=null){if(e.key===t||e.label===t)return i&&(e.parent=i),e;if(e.children&&e.children.length>0)for(let o of e.children){let u=this.findNodeByKey(o,t,e);if(u)return u}return null}onSubmit(){let{Name:e,Code:t,Note:i,Category:o}=this.form.value,u=null,d=null;this.route.snapshot.params.id?(u=this.findNodeByKeyInArray(this.categories(),this.route.snapshot.params.id),d={Name:e,Code:t,ParentID:u&&u.parent?u.parent.key:u.key,Note:i,ID:this.route.snapshot.params.id||null}):(u=this.findNodeByKeyInArray(this.categories(),o.key),d={Name:e,Code:t,ParentID:u&&u.parent?u.parent.key:u.key,Note:i}),this.COATypeService.submitCategory(d,{observe:"response"}).pipe(A("response"),S(()=>{this.router.navigate(["/chart-of-account/coa-types"])})).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=E({type:n,selectors:[["app-coa-type-form",8,"page"]],attrs:Vo,decls:5,vars:1,consts:[["actionButton",""],["content",""],["pageTitle","Chart of Account Category Form",3,"hasMainWrapperPadding"],[1,"d-flex","gap-2"],["label","Cancel","variant","outlined","severity","secondary",3,"onClick"],["label","Submit",3,"onClick"],[1,"row","justify-content-center"],[1,"col"],[1,"row","row-gap-2",3,"formGroup"],[1,"ol-12","col-md-6","col-lg-6"],[1,"form-group","has-validation"],["for",""],["formControlName","Name",1,"form-control",3,"ngClass"],["id","validationServer03Feedback","class","invalid-feedback",4,"ngIf"],[1,"col-12","col-md-6","col-lg-6"],["formControlName","Code",1,"form-control",3,"ngClass"],["formControlName","Note","placeholder","Enter a description for this COA category","id","floatingTextarea2",1,"form-control",2,"height","100px",3,"ngClass"],[1,"form-group","has-validation","d-flex","flex-column"],["placeholder","Select a Category","formControlName","Category",3,"onFocus","options"],["id","validationServer03Feedback",1,"invalid-feedback"]],template:function(t,i){t&1&&(a(0,"app-main-panel",2),f(1,No,3,0,"ng-template",null,0,b)(3,Bo,27,14,"ng-template",null,1,b),r()),t&2&&c("hasMainWrapperPadding",!0)},dependencies:[R,F,Te,we,Se,J,te,Ce,be,ye,M,_e,L,B,oe,ie,ae,re],styles:["[_nghost-%COMP%]{display:block} .p-treeselect{width:100%}"],changeDetection:0})}}return n})();var $o=n=>[n];function Ko(n,s){if(n&1&&(a(0,"a",4),x(1,"i",5),a(2,"span"),p(3,"Edit"),r()()),n&2){let e=l(2);c("routerLink",T(1,$o,"/chart-of-account/coa-types/"+e.info().id+"/edit"))}}function qo(n,s){if(n&1&&(a(0,"div",6)(1,"div",7)(2,"p-card")(3,"div",8)(4,"div",9)(5,"div",10),p(6,"Name"),r(),a(7,"div",11),p(8),r()(),a(9,"div",9)(10,"div",10),p(11,"Code"),r(),a(12,"div",11),p(13),r()(),a(14,"div",9)(15,"div",10),p(16,"Category"),r(),a(17,"div",11),p(18),r()(),a(19,"div",9)(20,"div",10),p(21,"Note"),r(),a(22,"div",11),x(23,"div",12),r()()()()()()),n&2){let e=l(2);m(8),k(e.info().name),m(5),k(e.info().code),m(5),k(e.info().parentName),m(5),c("innerHTML",e.info().note,Ee)}}function zo(n,s){n&1&&(pe(0),a(1,"app-main-panel",3),f(2,Ko,4,3,"ng-template",null,0,b)(4,qo,24,4,"ng-template",null,1,b),r(),ue())}var zn=(()=>{class n{constructor(){this.COATypeService=g(le),this.route=g(X),this.info=I(null)}ngOnInit(){this.route.queryParamMap.pipe(K(e=>e.get("ID")),N(e=>this.COATypeService.getCOACategoryByID({ID:e})),A("getCOACategoryByID"),S(e=>this.info.set(e))).subscribe()}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=E({type:n,selectors:[["app-coa-type-info"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],[4,"ngIf"],["pageTitle",`Type of Account Info
246
+ `],["type","button",1,"p-button","p-button-success",3,"routerLink"],[1,"fa-solid","fa-pen-to-square"],[1,"row","justify-content-center","mt-3"],[1,"col-12","col-lg-8"],[1,"d-flex","flex-column","gap-3"],[1,"d-flex"],[1,"col-3"],[1,"col"],[3,"innerHTML"]],template:function(t,i){t&1&&f(0,zo,6,0,"ng-container",2),t&2&&c("ngIf",i.info())},dependencies:[M,L,R,B,it,F,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return n})();var tl=[{path:"",redirectTo:"account",pathMatch:"full"},{path:"",children:[{path:"account",component:Dn},{path:"account/add",component:At},{path:"account/import",loadComponent:()=>import("./chunk-4NSHHAXV.js").then(n=>n.CoaImportComponent)},{path:"account/:id",component:Fn},{path:"account/:id/edit",component:At},{path:"coa-types",component:qn},{path:"coa-types/add",component:Mt},{path:"coa-types/info",component:zn},{path:"coa-types/:id/edit",component:Mt}]}],Rn={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[{path:"account",title:"Ticket List",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]},{path:"coa-types",title:"Ticket Details",iconName:"solar:stop-circle-line-duotone",class:"",label:"",labelClass:"",extralink:!1,submenu:[]}]};export{tl as CHART_OF_ACCOUNT_ROUTES,Rn as CHART_OF_ACCOUNT_ROUTE_PAGE};