dealpos 25.43.0 → 25.43.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/browser/chunk-2HUEFC2T.js +1 -0
  2. package/browser/{chunk-QDE7PB5F.js → chunk-2LMF4IMC.js} +1 -1
  3. package/browser/{chunk-NIAATSHN.js → chunk-2QU24F5P.js} +1 -1
  4. package/browser/{chunk-HIALMESF.js → chunk-346EL5B3.js} +1 -1
  5. package/browser/{chunk-ZH7IWOYT.js → chunk-3CUWPIMQ.js} +1 -1
  6. package/browser/{chunk-PHGUFK7B.js → chunk-3XR3MVQE.js} +1 -1
  7. package/browser/{chunk-QCXWKQ7Z.js → chunk-4G344XSZ.js} +1 -1
  8. package/browser/{chunk-JORCTO5O.js → chunk-4QQF4IJE.js} +1 -1
  9. package/browser/{chunk-RDLECCOU.js → chunk-4RRARGON.js} +2 -2
  10. package/browser/{chunk-NXXNEU5Q.js → chunk-4UYZJCFI.js} +1 -1
  11. package/browser/{chunk-7O3BTVW2.js → chunk-5EEOIYLP.js} +1 -1
  12. package/browser/{chunk-KBO5VO7S.js → chunk-5QXTT2Q4.js} +1 -1
  13. package/browser/{chunk-R6NHGFCL.js → chunk-5YJ2OEBF.js} +1 -1
  14. package/browser/{chunk-UEQT5HE5.js → chunk-5YRS6BWA.js} +1 -1
  15. package/browser/{chunk-UP43YMU4.js → chunk-5YUUUZD3.js} +1 -1
  16. package/browser/{chunk-VSF6PYZW.js → chunk-6647Y35T.js} +1 -1
  17. package/browser/{chunk-EENVAF36.js → chunk-6CWGCLY5.js} +1 -1
  18. package/browser/{chunk-5SRC2QUI.js → chunk-6EOWD655.js} +1 -1
  19. package/browser/{chunk-RADHAROZ.js → chunk-6FSVJ3O6.js} +1 -1
  20. package/browser/{chunk-ZPZDGQWP.js → chunk-6HXB7UO4.js} +3 -3
  21. package/browser/{chunk-4SFHOQ3Y.js → chunk-6KPCTTDA.js} +1 -1
  22. package/browser/{chunk-64EULF5I.js → chunk-6VOFZE3V.js} +1 -1
  23. package/browser/chunk-7527AL7Q.js +1 -0
  24. package/browser/{chunk-NGLW2JVN.js → chunk-A7FNJM6G.js} +1 -1
  25. package/browser/{chunk-CX4UR7ZZ.js → chunk-ACD7MZMQ.js} +3 -3
  26. package/browser/{chunk-2CU7XQYN.js → chunk-AER2U57P.js} +1 -1
  27. package/browser/{chunk-IQ4IMICT.js → chunk-ALNSA73T.js} +1 -1
  28. package/browser/{chunk-R4FFGZYI.js → chunk-AWSD3VOK.js} +1 -1
  29. package/browser/{chunk-E7L36INB.js → chunk-AXLH4KKX.js} +1 -1
  30. package/browser/{chunk-GINOZV6C.js → chunk-B6LPY2IZ.js} +1 -1
  31. package/browser/{chunk-U5OIRIFT.js → chunk-B6STMZWX.js} +14 -14
  32. package/browser/chunk-BBGWXLHJ.js +1 -0
  33. package/browser/{chunk-TROJCJRS.js → chunk-BCMMSVJJ.js} +1 -1
  34. package/browser/{chunk-A7R2DZD3.js → chunk-BJ4ZY3VJ.js} +1 -1
  35. package/browser/{chunk-MMX7JWK6.js → chunk-BJMIDKW4.js} +1 -1
  36. package/browser/{chunk-F2Z6MRHX.js → chunk-BPWQFTXE.js} +1 -1
  37. package/browser/{chunk-WYHR2ET7.js → chunk-CFSBMQ5D.js} +2 -2
  38. package/browser/{chunk-772SQL5I.js → chunk-CM4CUWDT.js} +1 -1
  39. package/browser/{chunk-FF56HWOF.js → chunk-CODMBGPI.js} +7 -7
  40. package/browser/{chunk-2DCP5K6S.js → chunk-CSLHA6EL.js} +1 -1
  41. package/browser/{chunk-ASGXDOOQ.js → chunk-CURYSM3Y.js} +1 -1
  42. package/browser/{chunk-3RWVYWJF.js → chunk-DEBIFZGN.js} +1 -1
  43. package/browser/{chunk-2L54CRB2.js → chunk-DH3PTQ3P.js} +1 -1
  44. package/browser/{chunk-TZKLOUVL.js → chunk-DK44EJTX.js} +1 -1
  45. package/browser/{chunk-ZBTG35T6.js → chunk-DKDOVSVH.js} +1 -1
  46. package/browser/chunk-E4DPE3J5.js +1 -0
  47. package/browser/{chunk-ZSE5MOHQ.js → chunk-EDXMXTEK.js} +1 -1
  48. package/browser/{chunk-RXIPRX4H.js → chunk-EJDRY7MH.js} +1 -1
  49. package/browser/{chunk-TTHREZAR.js → chunk-EKDNW5AX.js} +1 -1
  50. package/browser/{chunk-QJ4LGJCR.js → chunk-EOVI4KWG.js} +1 -1
  51. package/browser/{chunk-HAGFCQCM.js → chunk-FIHWJAIR.js} +1 -1
  52. package/browser/{chunk-UQP7S73H.js → chunk-FRDFUCRO.js} +1 -1
  53. package/browser/{chunk-D5P4CYL5.js → chunk-FSTDHLYH.js} +1 -1
  54. package/browser/{chunk-7S4WUQBK.js → chunk-FSXDAB7C.js} +1 -1
  55. package/browser/chunk-FXKRIVYT.js +1 -0
  56. package/browser/{chunk-OL6COSQS.js → chunk-FYACJ2YI.js} +1 -1
  57. package/browser/{chunk-SHMXCJ6Q.js → chunk-G454AF6P.js} +1 -1
  58. package/browser/{chunk-6G37ZXRX.js → chunk-GIDGCFLX.js} +1 -1
  59. package/browser/{chunk-6CQ6XYJG.js → chunk-H3OZSV6V.js} +1 -1
  60. package/browser/{chunk-CD3BSGAP.js → chunk-H7F34T25.js} +1 -1
  61. package/browser/{chunk-JLL2ILJJ.js → chunk-HFYSK74N.js} +1 -1
  62. package/browser/{chunk-CXRVPHHO.js → chunk-HJVO2MYG.js} +1 -1
  63. package/browser/{chunk-Y6VMIGXC.js → chunk-HKJLMHAD.js} +1 -1
  64. package/browser/{chunk-JU6MGU3M.js → chunk-HKUGK6HF.js} +1 -1
  65. package/browser/{chunk-TP762HYD.js → chunk-HMU3DWZJ.js} +1 -1
  66. package/browser/{chunk-GPP3J3W4.js → chunk-HOM424UE.js} +1 -1
  67. package/browser/{chunk-LGVT3CR2.js → chunk-I3YPVX5L.js} +1 -1
  68. package/browser/{chunk-7C7GJT3E.js → chunk-I7HV744J.js} +1 -1
  69. package/browser/{chunk-AEHOTFB4.js → chunk-IAZFUBFX.js} +1 -1
  70. package/browser/chunk-IFFXFKVP.js +14 -0
  71. package/browser/{chunk-MXUYJQOT.js → chunk-INZKDGM2.js} +13 -13
  72. package/browser/{chunk-5CDAHDI5.js → chunk-ITUXL4IU.js} +1 -1
  73. package/browser/{chunk-EJDIY62U.js → chunk-JEZGFXOM.js} +1 -1
  74. package/browser/{chunk-JYNN4IZB.js → chunk-JLXCN2NR.js} +1 -1
  75. package/browser/chunk-K5KGHSAP.js +1 -0
  76. package/browser/{chunk-YCN42CZP.js → chunk-KIQXPGXN.js} +1 -1
  77. package/browser/{chunk-RAIYXIUN.js → chunk-KTD4OMXY.js} +1 -1
  78. package/browser/{chunk-G2NUOEHT.js → chunk-KUN2P3RN.js} +1 -1
  79. package/browser/{chunk-3A4C23H5.js → chunk-KWTU2B2D.js} +1 -1
  80. package/browser/{chunk-IUDDIQMT.js → chunk-L7IGIQVH.js} +2 -2
  81. package/browser/{chunk-INCYKSJF.js → chunk-LAFPISY6.js} +1 -1
  82. package/browser/{chunk-GNXJCMBC.js → chunk-LDF4ZCJN.js} +1 -1
  83. package/browser/chunk-MBA7MORK.js +1 -0
  84. package/browser/{chunk-FAJUK2PL.js → chunk-MK4KDIMG.js} +1 -1
  85. package/browser/{chunk-IGEAG6HP.js → chunk-MSBIWISH.js} +1 -1
  86. package/browser/{chunk-IE6UBT7C.js → chunk-N4FKAPLW.js} +1 -1
  87. package/browser/{chunk-7WLFUG2A.js → chunk-NSXCBKM4.js} +1 -1
  88. package/browser/chunk-NUV6F5WN.js +1 -0
  89. package/browser/chunk-O2QDJGKT.js +112 -0
  90. package/browser/{chunk-NZXT22JH.js → chunk-OB764IZP.js} +1 -1
  91. package/browser/{chunk-MDGMZ65B.js → chunk-ON5DTHAP.js} +1 -1
  92. package/browser/chunk-PBEIFRAA.js +1 -0
  93. package/browser/{chunk-Q3SBBXUT.js → chunk-PD445FIT.js} +1 -1
  94. package/browser/{chunk-W6A2EZUH.js → chunk-PGSKQYIL.js} +2 -2
  95. package/browser/{chunk-TZ74SUXJ.js → chunk-QHBWVJIQ.js} +1 -1
  96. package/browser/{chunk-RJ5DYWUR.js → chunk-QSWKUXSH.js} +1 -1
  97. package/browser/{chunk-7V7Q67KX.js → chunk-QVTFZ7LA.js} +1 -1
  98. package/browser/{chunk-M7QHMLIG.js → chunk-R4CTK5NZ.js} +1 -1
  99. package/browser/{chunk-THXV6YJP.js → chunk-RFO7MTFT.js} +1 -1
  100. package/browser/{chunk-EMP32K7Q.js → chunk-RHUDY63D.js} +1 -1
  101. package/browser/{chunk-H6LHYTUN.js → chunk-RKCLO5OA.js} +1 -1
  102. package/browser/chunk-ROR3RTY5.js +3 -0
  103. package/browser/{chunk-AQUQUDDZ.js → chunk-RP455IK5.js} +1 -1
  104. package/browser/{chunk-TJOJSY2L.js → chunk-S4IKR42Q.js} +1 -1
  105. package/browser/{chunk-D6VG5PSE.js → chunk-SEXUIUP5.js} +1 -1
  106. package/browser/{chunk-4R4W625N.js → chunk-SGFSKIUE.js} +1 -1
  107. package/browser/{chunk-TUQ4INQ4.js → chunk-SRRURHLT.js} +1 -1
  108. package/browser/{chunk-LC3XCQL2.js → chunk-SYQCAXOC.js} +1 -1
  109. package/browser/{chunk-EYE63KIO.js → chunk-T4OMGJF4.js} +1 -1
  110. package/browser/chunk-TE3WGV2Q.js +1 -0
  111. package/browser/{chunk-SEXQYEXV.js → chunk-TLJ2NGVG.js} +1 -1
  112. package/browser/chunk-TSIYPTYI.js +1 -0
  113. package/browser/{chunk-HQQWO76P.js → chunk-U6TUYK6J.js} +1 -1
  114. package/browser/{chunk-DNSE6AZ3.js → chunk-UO2JNN6O.js} +1 -1
  115. package/browser/{chunk-3LKY4V7E.js → chunk-V2LFW5D3.js} +1 -1
  116. package/browser/{chunk-3WSASNIT.js → chunk-V73DMOF7.js} +1 -1
  117. package/browser/{chunk-VFGDPNH2.js → chunk-VPFQM3LL.js} +1 -1
  118. package/browser/{chunk-ITLMINSX.js → chunk-VQBXUZ6U.js} +1 -1
  119. package/browser/{chunk-TQZQYUFG.js → chunk-VZEPVRCY.js} +1 -1
  120. package/browser/{chunk-QEZV5DGZ.js → chunk-WEGDL4GR.js} +1 -1
  121. package/browser/{chunk-AQC5G2DR.js → chunk-WEQFFBAF.js} +1 -1
  122. package/browser/{chunk-5BZEOCFN.js → chunk-WXQELZWQ.js} +1 -1
  123. package/browser/{chunk-XDJ4AOAR.js → chunk-X5OST3RI.js} +1 -1
  124. package/browser/{chunk-BXAYNP7A.js → chunk-XBRBYCWJ.js} +1 -1
  125. package/browser/{chunk-DKPNAGIM.js → chunk-XJ7SOVB2.js} +1 -1
  126. package/browser/{chunk-5NDARG5X.js → chunk-XTL4S3XK.js} +1 -1
  127. package/browser/{chunk-PRBPKAI4.js → chunk-Y75LR4GR.js} +1 -1
  128. package/browser/chunk-YEAPJ2OC.js +1 -0
  129. package/browser/{chunk-IQ26VFNR.js → chunk-YZHVQD5P.js} +1 -1
  130. package/browser/{chunk-IJ3Y6CA4.js → chunk-Z65FTA7V.js} +1 -1
  131. package/browser/{chunk-Q3T47ZI6.js → chunk-ZEQ2QQEK.js} +1 -1
  132. package/browser/{chunk-GFT5QOAV.js → chunk-ZMOEZBOV.js} +1 -1
  133. package/browser/{chunk-3REOXXPI.js → chunk-ZT3ATOCA.js} +1 -1
  134. package/browser/{chunk-HYRNR45J.js → chunk-ZZVT4VHZ.js} +1 -1
  135. package/browser/{chunk-A7PNRSF2.js → chunk-ZZYILM3B.js} +1 -1
  136. package/browser/index.html +2 -2
  137. package/browser/main-QGKQ75P4.js +3 -0
  138. package/package.json +1 -1
  139. package/browser/chunk-4G2HIE3A.js +0 -1
  140. package/browser/chunk-5OS5VELO.js +0 -1
  141. package/browser/chunk-AJCH3WAF.js +0 -1
  142. package/browser/chunk-EH6IO5FW.js +0 -1
  143. package/browser/chunk-FMHXEKSH.js +0 -1
  144. package/browser/chunk-HMER2IC5.js +0 -1
  145. package/browser/chunk-IFQV5GDJ.js +0 -1
  146. package/browser/chunk-JDZEWPPQ.js +0 -1
  147. package/browser/chunk-MDY5R453.js +0 -112
  148. package/browser/chunk-OEEJBHA6.js +0 -1
  149. package/browser/chunk-QU4LPPFI.js +0 -14
  150. package/browser/chunk-RE4ILURJ.js +0 -1
  151. package/browser/chunk-YWGMCAEP.js +0 -3
  152. package/browser/main-XJRM5GZV.js +0 -3
@@ -1 +1 @@
1
- import{a as Z}from"./chunk-XKUQPHUA.js";import{d as Y}from"./chunk-6G37ZXRX.js";import{a as H,b as G}from"./chunk-ITLMINSX.js";import{c as X}from"./chunk-W6A2EZUH.js";import{b as J}from"./chunk-TZ74SUXJ.js";import{a as Q}from"./chunk-IGEAG6HP.js";import{e as U}from"./chunk-7V7Q67KX.js";import{b as K}from"./chunk-TZKLOUVL.js";import{g as z}from"./chunk-3YKVLHZG.js";import{h as B,o as j}from"./chunk-RVXZOIFQ.js";import{d as q}from"./chunk-ZZGSAFGO.js";import{$a as l,Bc as v,Fc as V,Ib as i,Jb as r,Kb as R,Ob as x,Od as k,Qb as C,Rb as d,Rd as N,Vd as O,Yc as W,Yd as A,Zc as M,db as y,ec as o,ed as P,fc as w,gc as T,jc as u,kb as L,kc as S,lc as f,ob as E,qb as D,tc as I,va as s,vb as m,wa as c,wc as b,zc as h}from"./chunk-UXRO4UFY.js";var ee=(p,g,t,n,e,a)=>({LogisticServiceID:p,EntityID:g,From:t,To:n,StartTime:e,EndTime:a}),te=(p,g,t)=>({From:p,To:g,LogisticsServiceID:t});function ie(p,g){if(p&1){let t=x();i(0,"button",5),C("click",function(){s(t);let e=d();return c(e.openExportModal())}),R(1,"i",6),o(2," Export "),r()}}function ae(p,g){if(p&1){let t=x();i(0,"div",7)(1,"h6"),o(2,"Outlet"),r(),i(3,"outlet-selector",8),f("ngModelChange",function(e){s(t);let a=d();return S(a.pageData.Filter.EntityID,e)||(a.pageData.Filter.EntityID=e),c(e)}),r(),i(4,"h6"),o(5,"From"),r(),i(6,"datepicker",9),f("dateChange",function(e){s(t);let a=d();return S(a.pageData.Filter.From,e)||(a.pageData.Filter.From=e),c(e)}),r(),i(7,"h6"),o(8,"To"),r(),i(9,"datepicker",10),f("dateChange",function(e){s(t);let a=d();return S(a.pageData.Filter.To,e)||(a.pageData.Filter.To=e),c(e)}),r(),i(10,"h6"),o(11,"Time"),r(),i(12,"div",11)(13,"div",12)(14,"app-timepicker",13),f("timeChange",function(e){s(t);let a=d();return S(a.pageData.Filter.StartTime,e)||(a.pageData.Filter.StartTime=e),c(e)}),r()(),i(15,"div",12)(16,"app-timepicker",13),f("timeChange",function(e){s(t);let a=d();return S(a.pageData.Filter.EndTime,e)||(a.pageData.Filter.EndTime=e),c(e)}),r()()()()}if(p&2){let t=d();l(3),m("accessType",2),u("ngModel",t.pageData.Filter.EntityID),m("outlets",t.pageData.Options==null?null:t.pageData.Options.Entities),l(3),u("date",t.pageData.Filter.From),l(3),u("date",t.pageData.Filter.To),l(5),m("fullWidth",!0),u("time",t.pageData.Filter.StartTime),l(2),m("fullWidth",!0),u("time",t.pageData.Filter.EndTime)}}function re(p,g){if(p&1&&(i(0,"tr")(1,"td"),o(2),r(),i(3,"td"),o(4),r(),i(5,"td",23)(6,"a",24),h(7,"date"),h(8,"date"),o(9),r()(),i(10,"td",23)(11,"a",25),h(12,"date"),h(13,"date"),o(14),r()(),i(15,"td",23),o(16),r()()),p&2){let t=g.$implicit,n=g.index,e=d(2);l(2),w(n+1),l(2),w(t.Name),l(2),m("queryParams",b(19,ee,t.ID,e.pageData.Filter.EntityID,v(7,7,e.pageData.Filter.From,"yyyy-MM-dd"),v(8,10,e.pageData.Filter.To,"yyyy-MM-dd"),e.pageData.Filter.StartTime,e.pageData.Filter.EndTime)),l(3),T(" ",t.Trans," "),l(2),m("queryParams",I(26,te,v(12,13,e.pageData.Filter.From,"yyyy-MM-dd"),v(13,16,e.pageData.Filter.To,"yyyy-MM-dd"),t.ID)),l(3),T(" ",t.Qty," "),l(2),w(t.Weight)}}function ne(p,g){if(p&1){let t=x();i(0,"content")(1,"div",14)(2,"table",15),C("matSortChange",function(e){s(t);let a=d();return c(a.sortData(e))}),i(3,"thead",16)(4,"tr")(5,"th",17),o(6,"No"),r(),i(7,"th"),o(8,"Logistics Service Name"),r(),i(9,"th",18),o(10,"Trans"),r(),i(11,"th",19),o(12,"Qty"),r(),i(13,"th",20),o(14,"Weight "),i(15,"small",21),o(16,"(gram)"),r()()()(),i(17,"tbody"),D(18,re,17,30,"tr",22),r()()()()}if(p&2){let t=d();l(18),m("ngForOf",t.data.Data)}}var $=class p extends Q{constructor(t,n,e,a,F,_){super(t,n,"Report/GetLogisticsService","ReportLoader/GetLogisticsService",e,a);this.matDialog=F;this.roleService=_}originalData=[];postInit(t){this.originalData=t.Data}sortData(t){let n=this.data.Data.slice();if(!t.active||t.direction===""){this.data.Data=this.originalData;return}this.data.Data=n.sort((e,a)=>this.compare(e[t.active],a[t.active],t.direction==="asc"))}openExportModal(){this.matDialog.open(J,{data:{title:"Logistic Service",exportTypes:[{ID:"ReportExport/LogisticService",Value:"Default",FileName:"Logistics Service"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onChangeTime(t,n){let e=t.toTimeString().split(" ")[0].slice(0,5);this.pageData.Filter[n]=e}static \u0275fac=function(n){return new(n||p)(y(K),y(A),y(O),y(k),y(z),y(q))};static \u0275cmp=L({type:p,selectors:[["POS-logistics-service-report"]],standalone:!1,features:[E],decls:9,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",1,"btn","btn-outline-secondary"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6"],[3,"timeChange","fullWidth","time"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","50px"],["mat-sort-header","Trans",1,"align-right"],["mat-sort-header","Qty",1,"align-right"],["mat-sort-header","Weight",1,"align-right",2,"width","180px"],[1,"fst-italic","text-dark"],[4,"ngFor","ngForOf"],[1,"text-end"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(n,e){if(n&1){let a=x();i(0,"mainpanel-cmp",1),f("textChange",function(_){return s(a),S(e.pageData.Filter.Name,_)||(e.pageData.Filter.Name=_),c(_)}),C("onSubmit",function(){return s(a),c(e.searchFromPageOne())}),f("filterChange",function(_){return s(a),S(e.pageData.Filter,_)||(e.pageData.Filter=_),c(_)}),i(1,"actions"),D(2,ie,3,0,"button",2),i(3,"a",3),o(4," View Detail "),r()(),i(5,"filters"),D(6,ae,17,9,"ng-template",null,0,V),r(),D(8,ne,19,1,"content",4),r()}n&2&&(m("pageData",e.menuData),u("text",e.pageData.Filter.Name),m("isFilterOnDropdown",!1),u("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(6),m("ngIf",e.data))},dependencies:[W,M,N,B,j,U,Y,H,G,Z,X,P],encapsulation:2})};export{$ as a};
1
+ import{a as Z}from"./chunk-XKUQPHUA.js";import{d as Y}from"./chunk-GIDGCFLX.js";import{a as H,b as G}from"./chunk-VQBXUZ6U.js";import{c as X}from"./chunk-PGSKQYIL.js";import{b as J}from"./chunk-QHBWVJIQ.js";import{a as Q}from"./chunk-MSBIWISH.js";import{e as U}from"./chunk-QVTFZ7LA.js";import{b as K}from"./chunk-DK44EJTX.js";import{g as z}from"./chunk-3YKVLHZG.js";import{h as B,o as j}from"./chunk-RVXZOIFQ.js";import{d as q}from"./chunk-ZZGSAFGO.js";import{$a as l,Bc as v,Fc as V,Ib as i,Jb as r,Kb as R,Ob as x,Od as k,Qb as C,Rb as d,Rd as N,Vd as O,Yc as W,Yd as A,Zc as M,db as y,ec as o,ed as P,fc as w,gc as T,jc as u,kb as L,kc as S,lc as f,ob as E,qb as D,tc as I,va as s,vb as m,wa as c,wc as b,zc as h}from"./chunk-UXRO4UFY.js";var ee=(p,g,t,n,e,a)=>({LogisticServiceID:p,EntityID:g,From:t,To:n,StartTime:e,EndTime:a}),te=(p,g,t)=>({From:p,To:g,LogisticsServiceID:t});function ie(p,g){if(p&1){let t=x();i(0,"button",5),C("click",function(){s(t);let e=d();return c(e.openExportModal())}),R(1,"i",6),o(2," Export "),r()}}function ae(p,g){if(p&1){let t=x();i(0,"div",7)(1,"h6"),o(2,"Outlet"),r(),i(3,"outlet-selector",8),f("ngModelChange",function(e){s(t);let a=d();return S(a.pageData.Filter.EntityID,e)||(a.pageData.Filter.EntityID=e),c(e)}),r(),i(4,"h6"),o(5,"From"),r(),i(6,"datepicker",9),f("dateChange",function(e){s(t);let a=d();return S(a.pageData.Filter.From,e)||(a.pageData.Filter.From=e),c(e)}),r(),i(7,"h6"),o(8,"To"),r(),i(9,"datepicker",10),f("dateChange",function(e){s(t);let a=d();return S(a.pageData.Filter.To,e)||(a.pageData.Filter.To=e),c(e)}),r(),i(10,"h6"),o(11,"Time"),r(),i(12,"div",11)(13,"div",12)(14,"app-timepicker",13),f("timeChange",function(e){s(t);let a=d();return S(a.pageData.Filter.StartTime,e)||(a.pageData.Filter.StartTime=e),c(e)}),r()(),i(15,"div",12)(16,"app-timepicker",13),f("timeChange",function(e){s(t);let a=d();return S(a.pageData.Filter.EndTime,e)||(a.pageData.Filter.EndTime=e),c(e)}),r()()()()}if(p&2){let t=d();l(3),m("accessType",2),u("ngModel",t.pageData.Filter.EntityID),m("outlets",t.pageData.Options==null?null:t.pageData.Options.Entities),l(3),u("date",t.pageData.Filter.From),l(3),u("date",t.pageData.Filter.To),l(5),m("fullWidth",!0),u("time",t.pageData.Filter.StartTime),l(2),m("fullWidth",!0),u("time",t.pageData.Filter.EndTime)}}function re(p,g){if(p&1&&(i(0,"tr")(1,"td"),o(2),r(),i(3,"td"),o(4),r(),i(5,"td",23)(6,"a",24),h(7,"date"),h(8,"date"),o(9),r()(),i(10,"td",23)(11,"a",25),h(12,"date"),h(13,"date"),o(14),r()(),i(15,"td",23),o(16),r()()),p&2){let t=g.$implicit,n=g.index,e=d(2);l(2),w(n+1),l(2),w(t.Name),l(2),m("queryParams",b(19,ee,t.ID,e.pageData.Filter.EntityID,v(7,7,e.pageData.Filter.From,"yyyy-MM-dd"),v(8,10,e.pageData.Filter.To,"yyyy-MM-dd"),e.pageData.Filter.StartTime,e.pageData.Filter.EndTime)),l(3),T(" ",t.Trans," "),l(2),m("queryParams",I(26,te,v(12,13,e.pageData.Filter.From,"yyyy-MM-dd"),v(13,16,e.pageData.Filter.To,"yyyy-MM-dd"),t.ID)),l(3),T(" ",t.Qty," "),l(2),w(t.Weight)}}function ne(p,g){if(p&1){let t=x();i(0,"content")(1,"div",14)(2,"table",15),C("matSortChange",function(e){s(t);let a=d();return c(a.sortData(e))}),i(3,"thead",16)(4,"tr")(5,"th",17),o(6,"No"),r(),i(7,"th"),o(8,"Logistics Service Name"),r(),i(9,"th",18),o(10,"Trans"),r(),i(11,"th",19),o(12,"Qty"),r(),i(13,"th",20),o(14,"Weight "),i(15,"small",21),o(16,"(gram)"),r()()()(),i(17,"tbody"),D(18,re,17,30,"tr",22),r()()()()}if(p&2){let t=d();l(18),m("ngForOf",t.data.Data)}}var $=class p extends Q{constructor(t,n,e,a,F,_){super(t,n,"Report/GetLogisticsService","ReportLoader/GetLogisticsService",e,a);this.matDialog=F;this.roleService=_}originalData=[];postInit(t){this.originalData=t.Data}sortData(t){let n=this.data.Data.slice();if(!t.active||t.direction===""){this.data.Data=this.originalData;return}this.data.Data=n.sort((e,a)=>this.compare(e[t.active],a[t.active],t.direction==="asc"))}openExportModal(){this.matDialog.open(J,{data:{title:"Logistic Service",exportTypes:[{ID:"ReportExport/LogisticService",Value:"Default",FileName:"Logistics Service"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}onChangeTime(t,n){let e=t.toTimeString().split(" ")[0].slice(0,5);this.pageData.Filter[n]=e}static \u0275fac=function(n){return new(n||p)(y(K),y(A),y(O),y(k),y(z),y(q))};static \u0275cmp=L({type:p,selectors:[["POS-logistics-service-report"]],standalone:!1,features:[E],decls:9,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",1,"btn","btn-outline-secondary"],[4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6"],[3,"timeChange","fullWidth","time"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","50px"],["mat-sort-header","Trans",1,"align-right"],["mat-sort-header","Qty",1,"align-right"],["mat-sort-header","Weight",1,"align-right",2,"width","180px"],[1,"fst-italic","text-dark"],[4,"ngFor","ngForOf"],[1,"text-end"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(n,e){if(n&1){let a=x();i(0,"mainpanel-cmp",1),f("textChange",function(_){return s(a),S(e.pageData.Filter.Name,_)||(e.pageData.Filter.Name=_),c(_)}),C("onSubmit",function(){return s(a),c(e.searchFromPageOne())}),f("filterChange",function(_){return s(a),S(e.pageData.Filter,_)||(e.pageData.Filter=_),c(_)}),i(1,"actions"),D(2,ie,3,0,"button",2),i(3,"a",3),o(4," View Detail "),r()(),i(5,"filters"),D(6,ae,17,9,"ng-template",null,0,V),r(),D(8,ne,19,1,"content",4),r()}n&2&&(m("pageData",e.menuData),u("text",e.pageData.Filter.Name),m("isFilterOnDropdown",!1),u("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(6),m("ngIf",e.data))},dependencies:[W,M,N,B,j,U,Y,H,G,Z,X,P],encapsulation:2})};export{$ as a};
@@ -1 +1 @@
1
- import{a as ge}from"./chunk-CSQD5JSK.js";import{a as ve}from"./chunk-IE6UBT7C.js";import{a as Ce}from"./chunk-M3HHWYKD.js";import"./chunk-BYXBJQAS.js";import{e as ce,f as fe}from"./chunk-7V7Q67KX.js";import"./chunk-RXIPRX4H.js";import{b as se}from"./chunk-TZKLOUVL.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{u as pe,v as me,w as ue}from"./chunk-CD3BSGAP.js";import"./chunk-JOXTERIM.js";import{O as F}from"./chunk-5OS5VELO.js";import{e as ae,f as le,g as de}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{E as oe,F as te,G as ne,c as J,e as b,h as Y,i as X,p as Q,t as Z,w as ee}from"./chunk-RVXZOIFQ.js";import"./chunk-D5P4CYL5.js";import"./chunk-QEZV5DGZ.js";import{a as w,d as re}from"./chunk-ZZGSAFGO.js";import"./chunk-HIALMESF.js";import{$a as l,Db as C,E as N,Eb as A,Fc as q,Gb as O,Hb as U,Ib as i,Jb as r,Kb as s,Ma as V,Nb as H,Ob as x,Od as W,Pc as K,Qb as v,Rb as f,Vd as z,Wc as R,Yd as ie,Zc as L,bd as B,db as c,dc as $,ec as a,fc as G,gc as T,jd as M,kb as E,na as h,ob as D,qb as m,rc as _,sc as j,t as k,va as y,vb as p,wa as P}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var I=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function xe(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new pe,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=h(ae);config;fb=h(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[b.required]],validateCoupon:[this.data?.validateCoupon||"",[b.required]],redeemCoupon:[this.data?.redeemCoupon||"",[b.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[b.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(c(le))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),s(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),s(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,xe,2,0,"div",20),r(),i(30,"div",23),s(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",_(10,I,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),C(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",_(12,I,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),C(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",_(14,I,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),C(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",_(16,I,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),C(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,Z,ee,ue,me,ge],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Me(n,d){if(n&1){let e=x();i(0,"button",10),v("click",function(){y(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Ie(n,d){n&1&&s(0,"th",11)}function Ne(n,d){if(n&1){let e=x();i(0,"td",15)(1,"i",16),v("click",function(){y(e);let t=f().$index,u=f(2);return P(u.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=x();i(0,"tr"),m(1,Ne,2,0,"td",12),i(2,"td")(3,"a",13),v("click",function(){let t=y(e),u=t.$implicit,g=t.$index,_e=f(2);return P(_e.onUpdateProvider(u,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",14),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),p("ngIf",o.role.developer.Edit),l(3),T(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),p("ngClass",j(7,Re,e.Enabled,!e.Enabled)),l(),T(" ",e.Enabled?"Enabled":"Disabled"," ")}}function we(n,d){if(n&1&&O(0,Te,14,10,"tr",null,A),n&2){let e=f();U(e.listProviders())}}function Fe(n,d){n&1&&H(0)}function ke(n,d){if(n&1&&m(0,Fe,1,0,"ng-container",17),n&2){f();let e=$(25);p("ngTemplateOutlet",e)}}function Ve(n,d){n&1&&(i(0,"tr",18)(1,"td",19),s(2,"empty-state-table"),r()())}var he=class n extends ve{constructor(e,o,t,u,g){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=u;this.dialog=g}toastr=h(z);couponProviders=V([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let u={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=u,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(c(se),c(ie),c(W),c(re),c(de))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[D],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],["class","text-center","style","width: 10px",4,"ngIf"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center",2,"width","10px"],["class","text-center",4,"ngIf"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Me,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Ie,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,we,2,0)(23,ke,1,1,"ng-container"),r()()()()(),m(24,Ve,3,0,"ng-template",null,0,q),r()()),o&2){let u;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",t.role.developer.Edit),l(8),p("ngIf",t.role.developer.Edit),l(12),C(((u=t.listProviders())==null?null:u.length)>0?22:23)}},dependencies:[M,R,L,B,fe,ce,te,Ce],encapsulation:2})};export{he as CouponConfigurationComponent};
1
+ import{a as ge}from"./chunk-CSQD5JSK.js";import{a as ve}from"./chunk-N4FKAPLW.js";import{a as Ce}from"./chunk-M3HHWYKD.js";import"./chunk-BYXBJQAS.js";import{e as ce,f as fe}from"./chunk-QVTFZ7LA.js";import"./chunk-EJDRY7MH.js";import{b as se}from"./chunk-DK44EJTX.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{u as pe,v as me,w as ue}from"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import{O as F}from"./chunk-TSIYPTYI.js";import{e as ae,f as le,g as de}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{E as oe,F as te,G as ne,c as J,e as b,h as Y,i as X,p as Q,t as Z,w as ee}from"./chunk-RVXZOIFQ.js";import"./chunk-FSTDHLYH.js";import"./chunk-WEGDL4GR.js";import{a as w,d as re}from"./chunk-ZZGSAFGO.js";import"./chunk-346EL5B3.js";import{$a as l,Db as C,E as N,Eb as A,Fc as q,Gb as O,Hb as U,Ib as i,Jb as r,Kb as s,Ma as V,Nb as H,Ob as x,Od as W,Pc as K,Qb as v,Rb as f,Vd as z,Wc as R,Yd as ie,Zc as L,bd as B,db as c,dc as $,ec as a,fc as G,gc as T,jd as M,kb as E,na as h,ob as D,qb as m,rc as _,sc as j,t as k,va as y,vb as p,wa as P}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var I=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function xe(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new pe,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=h(ae);config;fb=h(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[b.required]],validateCoupon:[this.data?.validateCoupon||"",[b.required]],redeemCoupon:[this.data?.redeemCoupon||"",[b.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[b.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(c(le))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),s(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),s(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,xe,2,0,"div",20),r(),i(30,"div",23),s(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",_(10,I,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),C(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",_(12,I,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),C(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",_(14,I,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),C(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",_(16,I,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),C(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,Z,ee,ue,me,ge],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Me(n,d){if(n&1){let e=x();i(0,"button",10),v("click",function(){y(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Ie(n,d){n&1&&s(0,"th",11)}function Ne(n,d){if(n&1){let e=x();i(0,"td",15)(1,"i",16),v("click",function(){y(e);let t=f().$index,u=f(2);return P(u.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=x();i(0,"tr"),m(1,Ne,2,0,"td",12),i(2,"td")(3,"a",13),v("click",function(){let t=y(e),u=t.$implicit,g=t.$index,_e=f(2);return P(_e.onUpdateProvider(u,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",14),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),p("ngIf",o.role.developer.Edit),l(3),T(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),p("ngClass",j(7,Re,e.Enabled,!e.Enabled)),l(),T(" ",e.Enabled?"Enabled":"Disabled"," ")}}function we(n,d){if(n&1&&O(0,Te,14,10,"tr",null,A),n&2){let e=f();U(e.listProviders())}}function Fe(n,d){n&1&&H(0)}function ke(n,d){if(n&1&&m(0,Fe,1,0,"ng-container",17),n&2){f();let e=$(25);p("ngTemplateOutlet",e)}}function Ve(n,d){n&1&&(i(0,"tr",18)(1,"td",19),s(2,"empty-state-table"),r()())}var he=class n extends ve{constructor(e,o,t,u,g){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=u;this.dialog=g}toastr=h(z);couponProviders=V([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let u={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=u,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(c(se),c(ie),c(W),c(re),c(de))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[D],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],["class","text-center","style","width: 10px",4,"ngIf"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center",2,"width","10px"],["class","text-center",4,"ngIf"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Me,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Ie,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,we,2,0)(23,ke,1,1,"ng-container"),r()()()()(),m(24,Ve,3,0,"ng-template",null,0,q),r()()),o&2){let u;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",t.role.developer.Edit),l(8),p("ngIf",t.role.developer.Edit),l(12),C(((u=t.listProviders())==null?null:u.length)>0?22:23)}},dependencies:[M,R,L,B,fe,ce,te,Ce],encapsulation:2})};export{he as CouponConfigurationComponent};
@@ -1 +1 @@
1
- import{b as j}from"./chunk-2YDEXJE5.js";import{a as H}from"./chunk-EWZ63XSS.js";import{a as A}from"./chunk-P3KIIKY4.js";import{b as F}from"./chunk-YRGGDRUH.js";import{u as V,v as R,w as P}from"./chunk-CD3BSGAP.js";import{e as w,f as T}from"./chunk-3YKVLHZG.js";import{$a as d,Fc as y,Ib as c,Jb as u,Lb as g,Ma as U,Mb as v,Ob as f,Qb as _,Rb as m,Vd as x,Yd as O,Zc as E,aa as S,d as h,da as I,db as p,jd as D,kb as M,qb as C,sd as b,va as r,vb as s,wa as l}from"./chunk-UXRO4UFY.js";function N(i,t){if(i&1){let e=f();g(0),c(1,"POS-uppy",3),_("fileUploaded",function(o){r(e);let a=m(2);return l(a.assignFile(o))}),u(),v()}if(i&2){let e=m(2);d(),s("sampleUrl",e.sampleUrl)}}function $(i,t){if(i&1){let e=f();g(0),c(1,"POS-uppy",3),_("fileUploaded",function(o){r(e);let a=m(2);return l(a.assignFile(o))}),u(),v()}if(i&2){let e=m(2);d(),s("sampleUrl",e.sampleUrl)}}function L(i,t){if(i&1&&C(0,N,2,1,"ng-container",2)(1,$,2,1,"ng-container",2),i&2){let e=m();s("ngIf",e.uploadState()===e.uploadStateEnum.Idle||e.uploadState()===e.uploadStateEnum.Uploading),d(),s("ngIf",e.uploadState()===e.uploadStateEnum.Success||e.uploadState()===e.uploadStateEnum.Error)}}var k=class i{constructor(t,e,n,o,a){this.data=t;this.dialogRef=e;this.toastService=n;this.httpService=o;this.convertCsv=a}useUppy=!1;fileEndpoint="";modalConfig;sampleUrl;apiUploadCsv;outletID;fileInput;destroy$=new h;fileName;loadingVal$;uploadState=U(0);uploadStateEnum=A;timeoutID;ngOnInit(){this.initModalConfig(),this.initUpload()}initModalConfig(){this.modalConfig=new V,this.modalConfig.title="Import Items",this.modalConfig.customWidth=this.data.useUppy?"610px":"484px"}initUpload(){this.data&&(this.sampleUrl=this.data.sampleUrl,this.apiUploadCsv=this.data.API,this.outletID=this.data.outletID,this.useUppy=this.data.useUppy,this.fileEndpoint=this.data.fileEndpoint)}onOk(){if(this.fileInput)if(!this.useUppy)this.convertCsv.convert(this.fileInput).pipe(I(this.destroy$),S(t=>this.httpService.post(this.apiUploadCsv,this.outletID?{EntityID:this.outletID,CartItems:t}:t))).subscribe(t=>{this.dialogRef.close(t)});else{let t=new FormData;t.append("File",this.fileInput),t.append("EntityID",this.outletID),this.httpService.postFormData(this.fileEndpoint,t).subscribe({next:e=>{e&&(this.uploadState.set(2),this.dialogRef.close(e))},error:e=>{e instanceof b&&(console.error("error",e.error.Message),this.uploadState.set(3),this.timeoutID=setTimeout(()=>{this.uploadState.set(0)},100))}})}else this.uploadState.set(0),this.toastService.warning("Please drop a CSV file.","Warning")}onClose(){this.dialogRef.close()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete(),this.timeoutID&&clearTimeout(this.timeoutID)}assignFile(t){this.uploadState.set(1),this.fileInput=t}static \u0275fac=function(e){return new(e||i)(p(T),p(w),p(x),p(O),p(H))};static \u0275cmp=M({type:i,selectors:[["POS-modal-upload"]],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf"],[3,"fileUploaded","sampleUrl"]],template:function(e,n){if(e&1){let o=f();c(0,"modal-material",1),_("onOk",function(){return r(o),l(n.onOk())})("onCancel",function(){return r(o),l(n.onClose())})("onClose",function(){return r(o),l(n.onClose())}),C(1,L,2,2,"ng-template",null,0,y),u()}e&2&&s("config",n.modalConfig)},dependencies:[D,E,P,R,j,F],encapsulation:2})};export{k as a};
1
+ import{b as j}from"./chunk-2YDEXJE5.js";import{a as H}from"./chunk-EWZ63XSS.js";import{a as A}from"./chunk-P3KIIKY4.js";import{b as F}from"./chunk-YRGGDRUH.js";import{u as V,v as R,w as P}from"./chunk-H7F34T25.js";import{e as w,f as T}from"./chunk-3YKVLHZG.js";import{$a as d,Fc as y,Ib as c,Jb as u,Lb as g,Ma as U,Mb as v,Ob as f,Qb as _,Rb as m,Vd as x,Yd as O,Zc as E,aa as S,d as h,da as I,db as p,jd as D,kb as M,qb as C,sd as b,va as r,vb as s,wa as l}from"./chunk-UXRO4UFY.js";function N(i,t){if(i&1){let e=f();g(0),c(1,"POS-uppy",3),_("fileUploaded",function(o){r(e);let a=m(2);return l(a.assignFile(o))}),u(),v()}if(i&2){let e=m(2);d(),s("sampleUrl",e.sampleUrl)}}function $(i,t){if(i&1){let e=f();g(0),c(1,"POS-uppy",3),_("fileUploaded",function(o){r(e);let a=m(2);return l(a.assignFile(o))}),u(),v()}if(i&2){let e=m(2);d(),s("sampleUrl",e.sampleUrl)}}function L(i,t){if(i&1&&C(0,N,2,1,"ng-container",2)(1,$,2,1,"ng-container",2),i&2){let e=m();s("ngIf",e.uploadState()===e.uploadStateEnum.Idle||e.uploadState()===e.uploadStateEnum.Uploading),d(),s("ngIf",e.uploadState()===e.uploadStateEnum.Success||e.uploadState()===e.uploadStateEnum.Error)}}var k=class i{constructor(t,e,n,o,a){this.data=t;this.dialogRef=e;this.toastService=n;this.httpService=o;this.convertCsv=a}useUppy=!1;fileEndpoint="";modalConfig;sampleUrl;apiUploadCsv;outletID;fileInput;destroy$=new h;fileName;loadingVal$;uploadState=U(0);uploadStateEnum=A;timeoutID;ngOnInit(){this.initModalConfig(),this.initUpload()}initModalConfig(){this.modalConfig=new V,this.modalConfig.title="Import Items",this.modalConfig.customWidth=this.data.useUppy?"610px":"484px"}initUpload(){this.data&&(this.sampleUrl=this.data.sampleUrl,this.apiUploadCsv=this.data.API,this.outletID=this.data.outletID,this.useUppy=this.data.useUppy,this.fileEndpoint=this.data.fileEndpoint)}onOk(){if(this.fileInput)if(!this.useUppy)this.convertCsv.convert(this.fileInput).pipe(I(this.destroy$),S(t=>this.httpService.post(this.apiUploadCsv,this.outletID?{EntityID:this.outletID,CartItems:t}:t))).subscribe(t=>{this.dialogRef.close(t)});else{let t=new FormData;t.append("File",this.fileInput),t.append("EntityID",this.outletID),this.httpService.postFormData(this.fileEndpoint,t).subscribe({next:e=>{e&&(this.uploadState.set(2),this.dialogRef.close(e))},error:e=>{e instanceof b&&(console.error("error",e.error.Message),this.uploadState.set(3),this.timeoutID=setTimeout(()=>{this.uploadState.set(0)},100))}})}else this.uploadState.set(0),this.toastService.warning("Please drop a CSV file.","Warning")}onClose(){this.dialogRef.close()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete(),this.timeoutID&&clearTimeout(this.timeoutID)}assignFile(t){this.uploadState.set(1),this.fileInput=t}static \u0275fac=function(e){return new(e||i)(p(T),p(w),p(x),p(O),p(H))};static \u0275cmp=M({type:i,selectors:[["POS-modal-upload"]],decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf"],[3,"fileUploaded","sampleUrl"]],template:function(e,n){if(e&1){let o=f();c(0,"modal-material",1),_("onOk",function(){return r(o),l(n.onOk())})("onCancel",function(){return r(o),l(n.onClose())})("onClose",function(){return r(o),l(n.onClose())}),C(1,L,2,2,"ng-template",null,0,y),u()}e&2&&s("config",n.modalConfig)},dependencies:[D,E,P,R,j,F],encapsulation:2})};export{k as a};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-ZT3ATOCA.js";import"./chunk-EOVI4KWG.js";import"./chunk-XJ7SOVB2.js";import"./chunk-GIDGCFLX.js";import"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-FP4HFB5J.js";import"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import"./chunk-VHAM2DWK.js";import"./chunk-MSBIWISH.js";import"./chunk-T4OMGJF4.js";import"./chunk-QVTFZ7LA.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import"./chunk-EJDRY7MH.js";import"./chunk-DK44EJTX.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import"./chunk-TSIYPTYI.js";import"./chunk-XYB3YDKL.js";import"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import"./chunk-RVXZOIFQ.js";import"./chunk-FSTDHLYH.js";import"./chunk-WEGDL4GR.js";import"./chunk-ZZGSAFGO.js";import"./chunk-346EL5B3.js";import"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";export{a as WebhookJobLogsComponent};
@@ -1 +1 @@
1
- import{c as U,d as W}from"./chunk-PHGUFK7B.js";import{a as X,b as Y}from"./chunk-6JAL37Y4.js";import{b as K,c as Q}from"./chunk-JOXTERIM.js";import{a as A}from"./chunk-7VKFVS7K.js";import{la as J}from"./chunk-EEEAUYZ6.js";import{F as G,h as B,o as q}from"./chunk-RVXZOIFQ.js";import{a as C}from"./chunk-ZZGSAFGO.js";import{$a as _,Ac as k,Db as H,Fa as M,Fc as F,Ib as c,Jb as m,Nb as L,Ob as V,Qb as j,Rb as n,Y as S,Yd as d,bd as N,ca as h,cd as P,d as x,db as b,dc as I,ec as v,fa as T,ga as u,gc as E,ja as w,jd as z,kb as $,ma as O,na as D,o as f,qb as a,va as p,vb as l,wa as g,zc as R}from"./chunk-UXRO4UFY.js";var y=class o{signalRClient=D(A);continuedCategories$;allCategories$;_onOpenTreeSelector=new x;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(t){this.continuedCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?(this.signalRClient.resetCategoryCache(),t.post("/api/catalog/product/GetProductStorageOptions")):f(e),[]),S(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?t.get("/API/catalog/category/SelectOptions"):f(e),[]),S(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||o)(O(d))};static \u0275prov=w({token:o,factory:o.\u0275fac,providedIn:"root"})};function ie(o,t){o&1&&L(0)}function re(o,t){if(o&1&&(c(0,"p-floatLabel",1),a(1,ie,1,0,"ng-container",2),c(2,"label",3),v(3,"Category"),m()()),o&2){n();let e=I(3);_(),l("ngTemplateOutlet",e)}}function ne(o,t){o&1&&L(0)}function ae(o,t){if(o&1&&a(0,ne,1,0,"ng-container",2),o&2){n();let e=I(3);l("ngTemplateOutlet",e)}}function le(o,t){if(o&1&&(c(0,"div",6),v(1),m()),o&2){let e=n(2);l("matTooltip",e.selectedCategoryLabel),_(),E(" ",e.selectedCategoryLabel," ")}}function ce(o,t){if(o&1){let e=V();c(0,"p-treeSelect",4),R(1,"async"),j("click",function(){p(e);let r=n();return g(r.loadCategories())})("ngModelChange",function(r){p(e);let s=n();return g(s.onSelectCategory(r))})("onClear",function(){p(e);let r=n();return g(r.onClear())}),a(2,le,2,2,"ng-template",5),m()}if(o&2){let e=n();l("options",k(1,3,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)}}var Z=class o{constructor(t,e){this.http=t;this.treeSelector=e}continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;isInitializedCategoryLabel=!1;selectedCategory;selectedCategoryID;selectedCategoryIDChange=new M;selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let t=document.querySelector("body");this.top=t.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(C.IsEmpty(this.selectedCategoryID)&&C.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(T(t=>{this.selectedCategory=this.findSelectedCategory(t,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(t){this.selectedCategory=t,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=t?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}generateLabelSelectedCategory(t){if(t){let e=[];this.selectedCategoryLabel="";do e=[...e,t.label],t=t.parent;while(t!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel="Select Storage Location"}findSelectedCategory(t,e){if(C.IsNotEmpty(e))for(let i of t){if(i.key===e)return i;{i.children=i.children?i.children:[],i.children=i.children.map(s=>(s.parent=i,s));let r=this.findSelectedCategory(i.children,e);if(r)return r}}else return null}loadCategories(){this.treeSelector.onOpenTreeSelector()}onClear(){this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}static \u0275fac=function(e){return new(e||o)(b(d),b(y))};static \u0275cmp=$({type:o,selectors:[["POS-storage-location-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",isInitializedCategoryLabel:"isInitializedCategoryLabel",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory","placeholder","Select Storage Location",3,"click","ngModelChange","onClear","options","ngModel","showClear"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,i){e&1&&a(0,re,4,1,"p-floatLabel",1)(1,ae,1,1,"ng-container")(2,ce,3,5,"ng-template",null,0,F),e&2&&H(i.showLabel?0:1)},dependencies:[z,N,P,Q,K,W,U,J,G,B,q,Y,X],styles:[".p-popover.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{Z as a};
1
+ import{c as U,d as W}from"./chunk-3XR3MVQE.js";import{a as X,b as Y}from"./chunk-6JAL37Y4.js";import{b as K,c as Q}from"./chunk-JOXTERIM.js";import{a as A}from"./chunk-7VKFVS7K.js";import{la as J}from"./chunk-EEEAUYZ6.js";import{F as G,h as B,o as q}from"./chunk-RVXZOIFQ.js";import{a as C}from"./chunk-ZZGSAFGO.js";import{$a as _,Ac as k,Db as H,Fa as M,Fc as F,Ib as c,Jb as m,Nb as L,Ob as V,Qb as j,Rb as n,Y as S,Yd as d,bd as N,ca as h,cd as P,d as x,db as b,dc as I,ec as v,fa as T,ga as u,gc as E,ja as w,jd as z,kb as $,ma as O,na as D,o as f,qb as a,va as p,vb as l,wa as g,zc as R}from"./chunk-UXRO4UFY.js";var y=class o{signalRClient=D(A);continuedCategories$;allCategories$;_onOpenTreeSelector=new x;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(t){this.continuedCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?(this.signalRClient.resetCategoryCache(),t.post("/api/catalog/product/GetProductStorageOptions")):f(e),[]),S(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?t.get("/API/catalog/category/SelectOptions"):f(e),[]),S(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||o)(O(d))};static \u0275prov=w({token:o,factory:o.\u0275fac,providedIn:"root"})};function ie(o,t){o&1&&L(0)}function re(o,t){if(o&1&&(c(0,"p-floatLabel",1),a(1,ie,1,0,"ng-container",2),c(2,"label",3),v(3,"Category"),m()()),o&2){n();let e=I(3);_(),l("ngTemplateOutlet",e)}}function ne(o,t){o&1&&L(0)}function ae(o,t){if(o&1&&a(0,ne,1,0,"ng-container",2),o&2){n();let e=I(3);l("ngTemplateOutlet",e)}}function le(o,t){if(o&1&&(c(0,"div",6),v(1),m()),o&2){let e=n(2);l("matTooltip",e.selectedCategoryLabel),_(),E(" ",e.selectedCategoryLabel," ")}}function ce(o,t){if(o&1){let e=V();c(0,"p-treeSelect",4),R(1,"async"),j("click",function(){p(e);let r=n();return g(r.loadCategories())})("ngModelChange",function(r){p(e);let s=n();return g(s.onSelectCategory(r))})("onClear",function(){p(e);let r=n();return g(r.onClear())}),a(2,le,2,2,"ng-template",5),m()}if(o&2){let e=n();l("options",k(1,3,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)}}var Z=class o{constructor(t,e){this.http=t;this.treeSelector=e}continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;isInitializedCategoryLabel=!1;selectedCategory;selectedCategoryID;selectedCategoryIDChange=new M;selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let t=document.querySelector("body");this.top=t.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(C.IsEmpty(this.selectedCategoryID)&&C.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(T(t=>{this.selectedCategory=this.findSelectedCategory(t,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(t){this.selectedCategory=t,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=t?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}generateLabelSelectedCategory(t){if(t){let e=[];this.selectedCategoryLabel="";do e=[...e,t.label],t=t.parent;while(t!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel="Select Storage Location"}findSelectedCategory(t,e){if(C.IsNotEmpty(e))for(let i of t){if(i.key===e)return i;{i.children=i.children?i.children:[],i.children=i.children.map(s=>(s.parent=i,s));let r=this.findSelectedCategory(i.children,e);if(r)return r}}else return null}loadCategories(){this.treeSelector.onOpenTreeSelector()}onClear(){this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}static \u0275fac=function(e){return new(e||o)(b(d),b(y))};static \u0275cmp=$({type:o,selectors:[["POS-storage-location-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",isInitializedCategoryLabel:"isInitializedCategoryLabel",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory","placeholder","Select Storage Location",3,"click","ngModelChange","onClear","options","ngModel","showClear"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,i){e&1&&a(0,re,4,1,"p-floatLabel",1)(1,ae,1,1,"ng-container")(2,ce,3,5,"ng-template",null,0,F),e&2&&H(i.showLabel?0:1)},dependencies:[z,N,P,Q,K,W,U,J,G,B,q,Y,X],styles:[".p-popover.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{Z as a};