dealpos 25.46.3 → 25.47.1

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 (150) hide show
  1. package/browser/{chunk-K4LLK7O5.js → chunk-2B5OZGVM.js} +1 -1
  2. package/browser/{chunk-REYKQIQH.js → chunk-2BWSGD3Z.js} +1 -1
  3. package/browser/{chunk-2RERZJD4.js → chunk-2MCEIRJY.js} +1 -1
  4. package/browser/chunk-2ZXSQTN3.js +1 -0
  5. package/browser/{chunk-OHG6W52G.js → chunk-337Y6LKZ.js} +1 -1
  6. package/browser/{chunk-E7N3FPJF.js → chunk-347WKSZO.js} +1 -1
  7. package/browser/{chunk-E2DUJTA4.js → chunk-3OHHXDTW.js} +1 -1
  8. package/browser/chunk-3PWKXRXD.js +14 -0
  9. package/browser/chunk-4QU3FQ4H.js +1 -0
  10. package/browser/{chunk-3IX77UOP.js → chunk-4VFIXDGC.js} +1 -1
  11. package/browser/{chunk-KTPMM54V.js → chunk-4Y2FYXDF.js} +1 -1
  12. package/browser/{chunk-2HOSLZ77.js → chunk-5BH2H4V6.js} +1 -1
  13. package/browser/{chunk-RF5WGONA.js → chunk-5DQ4MJJT.js} +1 -1
  14. package/browser/{chunk-ABC2ZDB2.js → chunk-5IW47S5R.js} +1 -1
  15. package/browser/{chunk-CPBXXCCO.js → chunk-5O2O7IB4.js} +15 -15
  16. package/browser/{chunk-BOS35V5T.js → chunk-5RTCTJUG.js} +1 -1
  17. package/browser/{chunk-LLEPB2B6.js → chunk-64RUCACD.js} +1 -1
  18. package/browser/{chunk-NBHYM7VE.js → chunk-6BCNB44A.js} +1 -1
  19. package/browser/{chunk-BYO7FJ4O.js → chunk-6GLKD66N.js} +1 -1
  20. package/browser/{chunk-PR7GIWDS.js → chunk-6OSOTMIF.js} +1 -1
  21. package/browser/{chunk-5M7FY5GG.js → chunk-75OKQPDZ.js} +2 -2
  22. package/browser/{chunk-47TR66HI.js → chunk-77V3KNIS.js} +1 -1
  23. package/browser/{chunk-NUL5GL3Q.js → chunk-7DG3RSHK.js} +1 -1
  24. package/browser/{chunk-CRQNIUO7.js → chunk-7FC2PJIW.js} +1 -1
  25. package/browser/{chunk-XI3UF2BK.js → chunk-7LCG4V47.js} +1 -1
  26. package/browser/{chunk-4C5SUQ74.js → chunk-A56Z62HU.js} +1 -1
  27. package/browser/{chunk-DWZLJMWC.js → chunk-ABNUBGXO.js} +1 -1
  28. package/browser/{chunk-K3I6K44J.js → chunk-ADC6Y4AB.js} +1 -1
  29. package/browser/{chunk-APOV2ZYY.js → chunk-AEXXXOEQ.js} +1 -1
  30. package/browser/{chunk-ABO3BJKM.js → chunk-AMONIKLC.js} +1 -1
  31. package/browser/{chunk-B4ZMF63W.js → chunk-AS5WHW7W.js} +1 -1
  32. package/browser/{chunk-INHUUGSI.js → chunk-AUBQH6JY.js} +1 -1
  33. package/browser/chunk-AVTYR2I6.js +1 -0
  34. package/browser/{chunk-QDE5Y76C.js → chunk-B3STLAM7.js} +1 -1
  35. package/browser/{chunk-QZMZBCE7.js → chunk-BA3BDB5Y.js} +1 -1
  36. package/browser/{chunk-ZXOLWDM7.js → chunk-BE4SGNNY.js} +1 -1
  37. package/browser/{chunk-LV3QO3H3.js → chunk-BFLDH5QM.js} +1 -1
  38. package/browser/{chunk-ON47ICI3.js → chunk-C6YPXBIP.js} +1 -1
  39. package/browser/{chunk-IJWE5FIC.js → chunk-CC2THS3J.js} +11 -11
  40. package/browser/chunk-CPCDU4HM.js +4 -0
  41. package/browser/{chunk-PECGNYTX.js → chunk-CSFFF2YO.js} +1 -1
  42. package/browser/{chunk-BZMVZ7BI.js → chunk-CZIC4DAI.js} +1 -1
  43. package/browser/{chunk-BEWTAI6L.js → chunk-D3BHSTT2.js} +1 -1
  44. package/browser/{chunk-HQ4NLUV6.js → chunk-DEGB7PBB.js} +1 -1
  45. package/browser/{chunk-NLLT5X4R.js → chunk-DP3IHIJG.js} +1 -1
  46. package/browser/chunk-DPGY5YXC.js +1 -0
  47. package/browser/{chunk-7TEVE3FN.js → chunk-DQYDWBIK.js} +1 -1
  48. package/browser/{chunk-QBY2W7QQ.js → chunk-DT6QJWPF.js} +1 -1
  49. package/browser/{chunk-V3TK75EE.js → chunk-DUJXPJ4P.js} +2 -2
  50. package/browser/{chunk-NRF37QSD.js → chunk-E5XIALIA.js} +1 -1
  51. package/browser/{chunk-IGNVHAO2.js → chunk-EQR3RN5K.js} +1 -1
  52. package/browser/{chunk-6XWC4HRW.js → chunk-ERJKTHMS.js} +1 -1
  53. package/browser/{chunk-OGB3GW4L.js → chunk-EZRYO7BE.js} +1 -1
  54. package/browser/{chunk-T4QRRRCQ.js → chunk-F45DK6HY.js} +1 -1
  55. package/browser/{chunk-ZXSVZL53.js → chunk-FNH6K4S4.js} +1 -1
  56. package/browser/{chunk-XAQQNM46.js → chunk-FT2CPNDK.js} +1 -1
  57. package/browser/{chunk-Q2FWGC3S.js → chunk-FUKBIYWZ.js} +1 -1
  58. package/browser/{chunk-DZ6Z62ZW.js → chunk-FUYOSIW5.js} +1 -1
  59. package/browser/{chunk-22O4O5EJ.js → chunk-FUZD2YUG.js} +2 -2
  60. package/browser/{chunk-BKBSPC2U.js → chunk-G2VAG4V3.js} +1 -1
  61. package/browser/{chunk-MCI7JNDO.js → chunk-GEIEF2RB.js} +1 -1
  62. package/browser/{chunk-6WEGHV7F.js → chunk-GN3HVOCN.js} +1 -1
  63. package/browser/{chunk-WH6ZELDL.js → chunk-GOZ7JJVG.js} +1 -1
  64. package/browser/{chunk-AS4NJOPX.js → chunk-GSAGOZJT.js} +1 -1
  65. package/browser/{chunk-BY57IAJ7.js → chunk-HD2QU6GJ.js} +1 -1
  66. package/browser/{chunk-SKMY43FK.js → chunk-HEIZUI6B.js} +1 -1
  67. package/browser/{chunk-27Y3MQJV.js → chunk-HVJHE6PQ.js} +1 -1
  68. package/browser/{chunk-KEAT6AT3.js → chunk-I5W4NCFM.js} +1 -1
  69. package/browser/{chunk-3VY4BE7Y.js → chunk-I6RQW6MV.js} +1 -1
  70. package/browser/{chunk-K4MWTDCL.js → chunk-ICXY7J4B.js} +1 -1
  71. package/browser/{chunk-EX4TE4E5.js → chunk-IDOZYC3I.js} +1 -1
  72. package/browser/chunk-IHCO2JK3.js +1 -0
  73. package/browser/{chunk-WM7ROROB.js → chunk-IIDCCGRC.js} +1 -1
  74. package/browser/{chunk-5F2NFZPL.js → chunk-IJ6NUPJY.js} +1 -1
  75. package/browser/{chunk-POJQGU7L.js → chunk-JR5LAUIS.js} +1 -1
  76. package/browser/{chunk-6EH2754P.js → chunk-JYJW5KAE.js} +1 -1
  77. package/browser/{chunk-5FIHIYPN.js → chunk-KSDWEFU5.js} +1 -1
  78. package/browser/{chunk-6HNMTYL2.js → chunk-L5QFOKO7.js} +1 -1
  79. package/browser/{chunk-ESYBXU5L.js → chunk-L72RFTBD.js} +1 -1
  80. package/browser/{chunk-Z7IU5JLK.js → chunk-LDTRYGRE.js} +1 -1
  81. package/browser/{chunk-DC426G2P.js → chunk-LOD3JYZW.js} +1 -1
  82. package/browser/{chunk-I2R577A6.js → chunk-M326IFGL.js} +1 -1
  83. package/browser/{chunk-WH2BY5K4.js → chunk-MVUVDYGQ.js} +1 -1
  84. package/browser/{chunk-SE67GHUX.js → chunk-N3HGHV2Q.js} +1 -1
  85. package/browser/{chunk-2KJCF3ZC.js → chunk-NDFDMJU2.js} +1 -1
  86. package/browser/chunk-NJGJFNQG.js +1 -0
  87. package/browser/{chunk-X4JLZJ6G.js → chunk-NU7GDZKC.js} +1 -1
  88. package/browser/{chunk-UE2HBW5H.js → chunk-NVCUDJUL.js} +1 -1
  89. package/browser/{chunk-KUMJBTY5.js → chunk-NWDPSH4M.js} +2 -2
  90. package/browser/{chunk-PLWCVGTF.js → chunk-O2LFJOK7.js} +1 -1
  91. package/browser/{chunk-WOGTFZCA.js → chunk-O5OL3MSI.js} +1 -1
  92. package/browser/{chunk-77F7XHWC.js → chunk-OBEXYNUM.js} +1 -1
  93. package/browser/{chunk-DGKIIUIQ.js → chunk-P3RYBCCQ.js} +1 -1
  94. package/browser/{chunk-KWRGMAZL.js → chunk-PGVKBOVV.js} +1 -1
  95. package/browser/{chunk-NX6ACGTN.js → chunk-PIZRVCBM.js} +1 -1
  96. package/browser/{chunk-GNODCFOP.js → chunk-PJCGIZLH.js} +1 -1
  97. package/browser/{chunk-2E4N3RZU.js → chunk-PSJRHKCL.js} +1 -1
  98. package/browser/{chunk-7E6JQNGW.js → chunk-QBOUUDFD.js} +1 -1
  99. package/browser/{chunk-KT64U5FF.js → chunk-QCMMZ67T.js} +1 -1
  100. package/browser/{chunk-LEPY5WLJ.js → chunk-QDCZBCN5.js} +1 -1
  101. package/browser/{chunk-HPXM5XAM.js → chunk-QECDT5UJ.js} +1 -1
  102. package/browser/{chunk-EVNVUCMO.js → chunk-QIFLQIWQ.js} +1 -1
  103. package/browser/{chunk-SO4GMA3Y.js → chunk-QPOOLLKY.js} +1 -1
  104. package/browser/{chunk-BD7CNS3O.js → chunk-R4JXP55V.js} +1 -1
  105. package/browser/{chunk-MQPI5PZA.js → chunk-R5SLRG5P.js} +1 -1
  106. package/browser/{chunk-WMUZZ5XX.js → chunk-RAQ5KDLF.js} +1 -1
  107. package/browser/{chunk-ULYBLEXA.js → chunk-RJJYGGF6.js} +1 -1
  108. package/browser/{chunk-3YKXHA6Q.js → chunk-RMB6IO7X.js} +1 -1
  109. package/browser/chunk-RONQFUCZ.js +1 -0
  110. package/browser/{chunk-ZS75AJOT.js → chunk-RPMSR2S2.js} +1 -1
  111. package/browser/{chunk-OAP2TSZ6.js → chunk-S7Y36REW.js} +1 -1
  112. package/browser/chunk-SMUNI47Q.js +3 -0
  113. package/browser/{chunk-XIXDLSA2.js → chunk-SVUUS5JD.js} +1 -1
  114. package/browser/{chunk-7EQG6N5Y.js → chunk-SWPKQM2X.js} +1 -1
  115. package/browser/{chunk-ZGY4RDNA.js → chunk-SXAXSC44.js} +1 -1
  116. package/browser/{chunk-NZYZO47Z.js → chunk-T25N3EEG.js} +1 -1
  117. package/browser/{chunk-KD7WBOUR.js → chunk-T2H2XAEJ.js} +1 -1
  118. package/browser/{chunk-GKWHR2MJ.js → chunk-T6RHBYOY.js} +1 -1
  119. package/browser/{chunk-RRSZSQXZ.js → chunk-T7DUQW7O.js} +1 -1
  120. package/browser/{chunk-SU4Y5X62.js → chunk-TRYMZNEH.js} +1 -1
  121. package/browser/{chunk-S3H5URIA.js → chunk-TV76G36W.js} +1 -1
  122. package/browser/{chunk-TEXHMVYL.js → chunk-TWX33MAO.js} +1 -1
  123. package/browser/{chunk-GDKTBDK6.js → chunk-UNJ5ELA7.js} +1 -1
  124. package/browser/{chunk-WBMSB25X.js → chunk-UTTKPBED.js} +1 -1
  125. package/browser/{chunk-6JCGTOWB.js → chunk-V2HVL2JW.js} +2 -2
  126. package/browser/{chunk-WZEBH7P5.js → chunk-V3PWVI2B.js} +14 -14
  127. package/browser/{chunk-MPAFCKH7.js → chunk-VAPCHGLS.js} +1 -1
  128. package/browser/{chunk-YRGHPSPV.js → chunk-VX5HH3BW.js} +1 -1
  129. package/browser/{chunk-5L54U63F.js → chunk-W4W2KCYV.js} +1 -1
  130. package/browser/{chunk-SARJJ3AZ.js → chunk-WNZKCNMC.js} +1 -1
  131. package/browser/{chunk-P2TEAJG3.js → chunk-WPMZWFSL.js} +1 -1
  132. package/browser/{chunk-MPE7Q4VX.js → chunk-XL7XI3DY.js} +1 -1
  133. package/browser/{chunk-J4JOIFPA.js → chunk-XUDYAWGP.js} +1 -1
  134. package/browser/chunk-XZ7GA7NR.js +1 -0
  135. package/browser/{chunk-U6Q2FJBU.js → chunk-Y3AE3TKV.js} +1 -1
  136. package/browser/{chunk-7N4TQJAF.js → chunk-Y4LWALJN.js} +1 -1
  137. package/browser/{chunk-3XKRDZSE.js → chunk-YQUQYWX3.js} +1 -1
  138. package/browser/{chunk-P6NP3EAO.js → chunk-ZJDY54VM.js} +1 -1
  139. package/browser/index.html +2 -2
  140. package/browser/{main-V7C5NVCN.js → main-O34B6LHF.js} +2 -2
  141. package/package.json +1 -1
  142. package/browser/chunk-4TZSBBYC.js +0 -1
  143. package/browser/chunk-64GEFRCT.js +0 -1
  144. package/browser/chunk-7DTB5U3C.js +0 -14
  145. package/browser/chunk-ES25MU2C.js +0 -3
  146. package/browser/chunk-G53YHV2L.js +0 -4
  147. package/browser/chunk-JPJFLPJG.js +0 -1
  148. package/browser/chunk-M2Y56GL5.js +0 -1
  149. package/browser/chunk-MMP7HKXF.js +0 -1
  150. package/browser/chunk-NB3DCG2R.js +0 -1
@@ -1 +1 @@
1
- import{a as I}from"./chunk-DLNZDHGS.js";import{u as S,v as T,w as E}from"./chunk-QZMZBCE7.js";import{e as H,f as D}from"./chunk-A45GTZVV.js";import{Ab as M,Bb as u,Bc as d,Cb as g,Db as i,Dc as p,Eb as n,Fb as h,Ob as x,Qb as P,Xa as l,db as c,dc as o,ec as m,fc as v,hb as f,md as b,pa as s,vb as C,xb as y,yb as _}from"./chunk-JYZTRN6N.js";function R(t,a){if(t&1&&(i(0,"tr")(1,"td",5),o(2),n(),i(3,"td",6),o(4),d(5,"date"),n(),i(6,"td",6),o(7),d(8,"date"),n()()),t&2){let e=a.$implicit;l(2),m(e.CreatorName),l(2),v(" ",p(5,3,e.PrintDate,"dd MMM yyyy")," "),l(3),m(p(8,6,e.PrintDate,"HH:mm"))}}function j(t,a){if(t&1&&M(0,R,9,9,"tr",null,_),t&2){let e=P();u(e.data)}}function w(t,a){t&1&&(i(0,"tr")(1,"td",7),h(2,"app-empty-state",8),n()())}var N=class t{constructor(a){this.data=a;this.config.title="Last Print History",this.config.hideOk=!0,this.config.cancelText="Close"}config=new S;dialogRef=s(H);static \u0275fac=function(e){return new(e||t)(c(D))};static \u0275cmp=f({type:t,selectors:[["POS-modal-print-history"]],decls:16,vars:2,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid"],[1,"table-responsive",2,"max-height","300px","width","400px"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light"],[1,"text-start"],[1,"text-end"],["colspan","3"],["title","No print history","message","No print history available for this invoice"]],template:function(e,r){e&1&&(i(0,"modal-material",0),x("onCancel",function(){return r.dialogRef.close()})("onClose",function(){return r.dialogRef.close()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"thead",4)(6,"tr")(7,"th",5),o(8,"Users"),n(),i(9,"th",6),o(10,"Date"),n(),i(11,"th",6),o(12,"Time"),n()()(),i(13,"tbody"),C(14,j,2,0)(15,w,3,0,"tr"),n()()()()()()),e&2&&(g("config",r.config),l(14),y(r.data&&r.data.length>0?14:15))},dependencies:[E,T,I,b],encapsulation:2})};export{N as a};
1
+ import{a as I}from"./chunk-DLNZDHGS.js";import{u as S,v as T,w as E}from"./chunk-BA3BDB5Y.js";import{e as H,f as D}from"./chunk-A45GTZVV.js";import{Ab as M,Bb as u,Bc as d,Cb as g,Db as i,Dc as p,Eb as n,Fb as h,Ob as x,Qb as P,Xa as l,db as c,dc as o,ec as m,fc as v,hb as f,md as b,pa as s,vb as C,xb as y,yb as _}from"./chunk-JYZTRN6N.js";function R(t,a){if(t&1&&(i(0,"tr")(1,"td",5),o(2),n(),i(3,"td",6),o(4),d(5,"date"),n(),i(6,"td",6),o(7),d(8,"date"),n()()),t&2){let e=a.$implicit;l(2),m(e.CreatorName),l(2),v(" ",p(5,3,e.PrintDate,"dd MMM yyyy")," "),l(3),m(p(8,6,e.PrintDate,"HH:mm"))}}function j(t,a){if(t&1&&M(0,R,9,9,"tr",null,_),t&2){let e=P();u(e.data)}}function w(t,a){t&1&&(i(0,"tr")(1,"td",7),h(2,"app-empty-state",8),n()())}var N=class t{constructor(a){this.data=a;this.config.title="Last Print History",this.config.hideOk=!0,this.config.cancelText="Close"}config=new S;dialogRef=s(H);static \u0275fac=function(e){return new(e||t)(c(D))};static \u0275cmp=f({type:t,selectors:[["POS-modal-print-history"]],decls:16,vars:2,consts:[[3,"onCancel","onClose","config"],[1,"container-fluid"],[1,"table-responsive",2,"max-height","300px","width","400px"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light"],[1,"text-start"],[1,"text-end"],["colspan","3"],["title","No print history","message","No print history available for this invoice"]],template:function(e,r){e&1&&(i(0,"modal-material",0),x("onCancel",function(){return r.dialogRef.close()})("onClose",function(){return r.dialogRef.close()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"table",3)(5,"thead",4)(6,"tr")(7,"th",5),o(8,"Users"),n(),i(9,"th",6),o(10,"Date"),n(),i(11,"th",6),o(12,"Time"),n()()(),i(13,"tbody"),C(14,j,2,0)(15,w,3,0,"tr"),n()()()()()()),e&2&&(g("config",r.config),l(14),y(r.data&&r.data.length>0?14:15))},dependencies:[E,T,I,b],encapsulation:2})};export{N as a};
@@ -1 +1 @@
1
- import{a as Ne}from"./chunk-IFOBYW26.js";import{d as Se,e as xe}from"./chunk-SO4GMA3Y.js";import{B as V,D as L,u as Me,v as ye,w as ve}from"./chunk-QZMZBCE7.js";import{N as we,O as q}from"./chunk-NZYZO47Z.js";import{d as R}from"./chunk-7TBS7SPQ.js";import{e as be,f as he}from"./chunk-A45GTZVV.js";import{A as pe,B as ge,F as Ce,G as fe,c as re,h as ae,i as le,k as de,o as se,p as ce,x as me,y as ue}from"./chunk-RNLSEEMX.js";import{a as ne}from"./chunk-USJ6ILEE.js";import{$ as K,A as k,Ab as Z,Bb as $,Ca as J,Cb as c,D as U,Db as d,Eb as l,Fb as ee,Mb as v,Ob as O,Qb as g,Xa as a,_b as M,be as oe,cd as te,db as P,dc as m,e as j,ee as _e,fc as x,hb as Q,ib as X,ic as _,jc as b,kc as h,la as E,ma as z,oa as S,pc as B,q as A,rd as ie,t as w,ta as u,u as H,ua as p,uc as y,vb as C,xb as f,zb as Y}from"./chunk-JYZTRN6N.js";var F=class i{constructor(n,e){this.localDataService=n;this.toastr=e;this.initLocalDataConfig()}localConfig=new V;_offlineConfigSubject=new j(this.localConfig);offlineConfig$=this._offlineConfigSubject.asObservable();online$=U(k(window,"offline").pipe(w(()=>!1)),k(window,"online").pipe(w(()=>!0))).pipe(K(navigator.onLine));get isOnline(){return navigator.onLine}initLocalDataConfig(){this.localDataService.getOfflineConfig().subscribe({next:n=>{let e=new V(n.configUsingLocal,n.productUsingLocal,n.orderUsingLocal);this.pushNewValue(e),this.localConfig=e,this.updateOfflineConfigDB(n)},error:n=>{this.onErrorInitConfig()}})}onErrorInitConfig(){let n=new V;this.pushNewValue(n),this.localConfig=n,this.updateOfflineConfigDB(n)}getOnlineStatus$(){return H([this.offlineConfig$.pipe(w(n=>n.configUsingLocal)),this.online$]).pipe(w(n=>{let e=n[0],t=n[1],r;return e===!0?r=!1:r=t&&this.isOnline,r}))}pushNewValue(n){this._offlineConfigSubject.next(n)}updateOfflineConfigDB(n){this.localDataService.updateOfflineConfig(n).subscribe({next:e=>{this.pushNewValue(n)}})}static \u0275fac=function(e){return new(e||i)(S(L),S(oe))};static \u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"})};var W=class i{constructor(n,e,t){this.httpService=n;this.LocalData=e;this._onlineStatusService=t}Data=new Ne;addCustomer(n,e){let t=[];n.Group&&t.push(n.Group),e&&(n.DebtLimit=e);let r={contact:n,groups:t};if(this._onlineStatusService.isOnline)return A(this.httpService.post("/API/Contact/Customer/Create",r)).catch(s=>Promise.reject(s))}findCustomerByCode(n){let e={Code:n};return this.httpService.post("/API/Contact/GetByCode",e)}GetPrivilegeByID(n,e){return this.httpService.get(q.GetCustomerPrivilegeByID,[{key:"ID",value:n},{key:"EntityID",value:e}],!0)}getCustomerSuggestionCode(){return this.httpService.get(q.GetCustomerSuggestionCode).pipe(w(n=>n.Code))}static \u0275fac=function(e){return new(e||i)(S(_e),S(L),S(F))};static \u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"})};var T=i=>({selected:i}),Ve=i=>({"border border-danger":i}),I=i=>({"is-invalid":i}),Le=i=>({"is-invalid border border-danger":i}),Fe=i=>({"has-error":i});function We(i,n){if(i&1){let e=v();d(0,"a",12),O("click",function(){u(e);let r=g();return p(r.chooiceDetail("id"))}),m(1," ID "),l()}if(i&2){let e=g();c("ngClass",y(1,T,e.tabState=="id"))}}function ke(i,n){if(i&1&&ee(0,"option",21),i&2){let e=n.$implicit;c("value",e.Name)}}function Be(i,n){if(i&1&&(d(0,"div",24)(1,"i",47),m(2," Name is mandatory."),l()()),i&2){g();let e=M(26);c("ngClass",y(1,Fe,e.touched&&e.invalid))}}function Re(i,n){i&1&&(d(0,"div",40),m(1," Mobile Phone is mandatory "),l())}function qe(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){g(2);let e=M(38);a(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}function Ge(i,n){if(i&1&&(C(0,Re,2,0,"div",40),C(1,qe,2,1,"div",40)),i&2){g();let e=M(38);f(e.getError("required")&&!e.getError("minLength")?0:-1),a(),f(e.getError("minLength")?1:-1)}}function je(i,n){i&1&&(d(0,"div",40),m(1," Email must be a valid email address "),l())}function Ae(i,n){i&1&&(d(0,"div",40),m(1,"Email is mandatory"),l())}function He(i,n){if(i&1&&(C(0,je,2,0,"div",40),C(1,Ae,2,0,"div",40)),i&2){g();let e=M(45);f(e.errors!=null&&e.errors.email?0:-1),a(),f(e.errors!=null&&e.errors.required?1:-1)}}function Ue(i,n){i&1&&(d(0,"div",40),m(1,"Birthdate is mandatory"),l())}function Ke(i,n){if(i&1&&C(0,Ue,2,0,"div",40),i&2){g();let e=M(3);f(e.invalid?0:-1)}}function ze(i,n){if(i&1){let e=v();d(0,"div",33)(1,"div",17)(2,"datepicker",48,6),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Birthdate,r)||(s.customer.Birthdate=r),p(r)}),l(),C(4,Ke,1,1),l()()}if(i&2){let e=M(3),t=g();a(2),_("ngModel",t.customer.Birthdate),c("required",t.requiredField().Birthdate)("ngClass",y(4,I,e.invalid&&(e.dirty||e.touched))),a(2),f(e.dirty||e.touched?4:-1)}}function Je(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){let e=g(2);a(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function Qe(i,n){if(i&1){let e=v();d(0,"div",33)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Code,r)||(s.customer.Code=r),p(r)}),l(),C(4,Je,2,1,"div",40),d(5,"label",50),m(6),l()()()}if(i&2){let e=M(3),t=g();a(2),c("placeholder",B("",t.type=="supplier"?"Supplier":"Member"," code")),_("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),a(2),f(e.invalid&&(e.dirty||e.touched)?4:-1),a(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Xe(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){let e=g(2);a(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function Ye(i,n){if(i&1){let e=v();d(0,"div",36)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Code,r)||(s.customer.Code=r),p(r)}),l(),C(4,Xe,2,1,"div",40),d(5,"label",50),m(6),l()()()}if(i&2){let e=M(3),t=g();a(2),c("placeholder",B("",t.type=="supplier"?"Supplier":"Member"," code")),_("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),a(2),f(e.invalid&&(e.dirty||e.touched)?4:-1),a(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Ze(i,n){if(i&1){let e=v();d(0,"div",36)(1,"div",51)(2,"ng-select",52),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Group,r)||(s.customer.Group=r),p(r)}),l(),d(3,"label",53),m(4,"Group"),l()()()}if(i&2){let e=g();a(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.Group))),a(),_("ngModel",e.customer.Group),c("items",e.options==null?null:e.options.Groups)}}function $e(i,n){if(i&1){let e=v();d(0,"div",36)(1,"div",51)(2,"ng-select",54),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.City,r)||(s.customer.City=r),p(r)}),l(),d(3,"label",55),m(4,"City"),l()()()}if(i&2){let e=g();a(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.City))),a(),_("ngModel",e.customer.City),c("items",e.options==null?null:e.options.Cities)}}function et(i,n){i&1&&(d(0,"div",40),m(1,"Address is mandatory."),l())}function tt(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){g();let e=M(68);a(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}var Ie=class i{constructor(n,e,t){this.dialogRef=n;this.data=e;this._CustomerHttpService=t;this.modalConfig=new Me,this.modalConfig.title=this.data.title,this.modalConfig.customWidth="650px",this.options=this.data.options,this.options?.Genders||(this.options.Genders=[{Key:0,Value:"Male"},{Key:1,Value:"Female"}]),this.config=this.data.config,this.type=this.data.type}customer;options;type;config;more;modalConfig;detailVisible;tabState="general";requiredField=J({Mobile:!1,Email:!1,Code:!1,Address:!1,SignUpOutlet:!1,Birthdate:!1});ngOnInit(){this.customer=new G,this.initFirstName(),this.customer.Gender=this.config.DefaultValue.Gender,this.more=!1,this.initRequiredField()}initRequiredField(){let n=this.config.Advance?.RequiredFields;n&&this.type!="supplier"&&n.forEach(e=>{this.requiredField.update(t=>(t[e]=!0,t))})}initFirstName(){this.data&&this.data.inputTextName&&(this.customer.FirstName=this.data.inputTextName)}onOk(n){if(n.form?.markAllAsTouched(),n.form.invalid)return;let e=this.customer.Title?this.customer.Title:"";e+=" "+this.customer.FirstName,e+=" "+(this.customer.LastName?this.customer.LastName:""),e=e.trim(),this.customer.Name=e,this.type=="customer"?this._CustomerHttpService.addCustomer(this.customer).then(t=>{this.dialogRef.close({ContactName:e,CustomerID:t.ID})}).catch(t=>{this.dialogRef.close({Error:t})}):this.type=="supplier"&&this.dialogRef.close({supplier:this.customer})}chooiceDetail(n){this.tabState=n}isNotEmpty(n){return ne.IsNotEmpty(n)||n==0}static \u0275fac=function(e){return new(e||i)(P(be),P(he),P(W))};static \u0275cmp=Q({type:i,selectors:[["POS-modal-customer"]],standalone:!1,decls:81,vars:55,consts:[["f","ngForm"],["FirstName","ngModel"],["phoneNumber","ngModel"],["Email","ngModel"],["addressCtrl","ngModel"],["nationalId","ngModel"],["birthdateCtrl","ngModel"],["codeCtrl","ngModel"],[3,"onOk","onCancel","onClose","config"],[1,"container",2,"height","270px"],["name","form"],[1,"row","align-items-center","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],[1,"btn","btn-link",3,"ngClass"],[1,"mt-6"],[1,"row","g-4",3,"hidden"],[1,"col-md-2","mt-4"],[1,"form-floating-outline"],["list","cust-title","id","Title","name","Title","placeholder","Title",1,"form-control",3,"ngModelChange","ngModel"],["for","Title"],["id","cust-title"],[3,"value"],[1,"col-md-5","mt-4"],["type","text","id","FirstName","name","FirstName","placeholder","First Name",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],[3,"ngClass"],["for","FirstName"],["type","text","id","LastName","name","LastName","placeholder","Last Name",1,"form-control",3,"ngModelChange","ngModel"],["for","LastName"],[1,"col-md-6","mt-4"],["type","text","name","Phone","placeholder","Mobile",1,"form-control",3,"ngModelChange","ngModel","required","ngClass"],["for","Phone"],["type","email","name","Email","placeholder","Email","email","",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],["for","email"],[1,"col-6","mt-4"],["name","gender","bindLabel","Value","bindValue","Key","placeholder","Gender","dropdownPosition","buttom",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"row","g-4","mt-2",3,"hidden"],[1,"col-4","mt-4"],[1,"col-md-12","mt-4"],["id","address","name","address","placeholder","Address",1,"form-control","h-100",3,"ngModelChange","rows","ngModel","required","ngClass"],["for","address"],[1,"invalid-feedback"],["type","text","id","Identification","name","Identification","placeholder","NationalID","numericInputOnly","nationalId",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","Identification"],["type","text","id","TaxId","name","TaxId","placeholder","TaxID",1,"form-control",3,"ngModelChange","ngModel"],["for","TaxId"],["name","NationalityID","bindLabel","Name","bindValue","ID","placeholder","Nationality","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],["name","race","bindLabel","Name","bindValue","ID","placeholder","Race","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"control-label","text-danger"],["placeholder","Birthdate","name","birthDate",3,"ngModelChange","ngModel","required","ngClass"],["type","text","name","code","id","code",1,"form-control",3,"ngModelChange","ngModel","placeholder","required","ngClass"],["for","code"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","customerGroup","bindLabel","Name","bindValue","ID","name","customerGroup","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","customerGroup",1,"ng-select"],["id","city","bindLabel","Name","bindValue","ID","name","city","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","city",1,"ng-select"]],template:function(e,t){if(e&1){let r=v();d(0,"modal-material",8),O("onOk",function(){u(r);let o=M(4);return p(t.onOk(o))})("onCancel",function(){return u(r),p(t.dialogRef.close())})("onClose",function(){return u(r),p(t.dialogRef.close())}),d(1,"content")(2,"div",9)(3,"form",10,0)(5,"div",11)(6,"div")(7,"a",12),O("click",function(){return u(r),p(t.chooiceDetail("general"))}),m(8," General "),l(),d(9,"a",12),O("click",function(){return u(r),p(t.chooiceDetail("detail"))}),m(10," Detail "),l(),C(11,We,2,3,"a",13),l()(),d(12,"div")(13,"div",14)(14,"div",15)(15,"div",16)(16,"div",17)(17,"input",18),h("ngModelChange",function(o){return u(r),b(t.customer.Title,o)||(t.customer.Title=o),p(o)}),l(),d(18,"label",19),m(19,"Title"),l(),d(20,"datalist",20),Z(21,ke,1,1,"option",21,Y),l()()(),d(23,"div",22)(24,"div",17)(25,"input",23,1),h("ngModelChange",function(o){return u(r),b(t.customer.FirstName,o)||(t.customer.FirstName=o),p(o)}),l(),C(27,Be,3,3,"div",24),d(28,"label",25),m(29,"First Name"),l()()(),d(30,"div",22)(31,"div",17)(32,"input",26),h("ngModelChange",function(o){return u(r),b(t.customer.LastName,o)||(t.customer.LastName=o),p(o)}),l(),d(33,"label",27),m(34,"Last Name"),l()()(),d(35,"div",28)(36,"div",17)(37,"input",29,2),h("ngModelChange",function(o){return u(r),b(t.customer.Mobile,o)||(t.customer.Mobile=o),p(o)}),l(),C(39,Ge,2,2),d(40,"label",30),m(41,"Mobile"),l()()(),d(42,"div",28)(43,"div",17)(44,"input",31,3),h("ngModelChange",function(o){return u(r),b(t.customer.Email,o)||(t.customer.Email=o),p(o)}),l(),C(46,He,2,2),d(47,"label",32),m(48,"Email"),l()()(),C(49,ze,5,6,"div",33),C(50,Qe,7,9,"div",33),d(51,"div",28)(52,"ng-select",34),h("ngModelChange",function(o){return u(r),b(t.customer.Gender,o)||(t.customer.Gender=o),p(o)}),l()()(),d(53,"div",35),C(54,Ye,7,9,"div",36),C(55,Ze,5,5,"div",36),C(56,$e,5,5,"div",36),d(57,"div",37)(58,"div",17)(59,"textarea",38,4),h("ngModelChange",function(o){return u(r),b(t.customer.Address,o)||(t.customer.Address=o),p(o)}),l(),d(61,"label",39),m(62,"Address"),l(),C(63,et,2,0,"div",40),l()()(),d(64,"div",35)(65,"div",28)(66,"div",17)(67,"input",41,5),h("ngModelChange",function(o){return u(r),b(t.customer.NationalIDNumber,o)||(t.customer.NationalIDNumber=o),p(o)}),l(),C(69,tt,2,1,"div",40),d(70,"label",42),m(71,"National ID"),l()()(),d(72,"div",28)(73,"div",17)(74,"input",43),h("ngModelChange",function(o){return u(r),b(t.customer.TaxIDNumber,o)||(t.customer.TaxIDNumber=o),p(o)}),l(),d(75,"label",44),m(76,"Tax ID"),l()()(),d(77,"div",28)(78,"ng-select",45),h("ngModelChange",function(o){return u(r),b(t.customer.NationalityID,o)||(t.customer.NationalityID=o),p(o)}),l()(),d(79,"div",33)(80,"ng-select",46),h("ngModelChange",function(o){return u(r),b(t.customer.RaceID,o)||(t.customer.RaceID=o),p(o)}),l()()()()()()()()()}if(e&2){let r=M(26),s=M(38),o=M(45),N=M(60),D=M(68);c("config",t.modalConfig),a(7),c("ngClass",y(41,T,t.tabState=="general")),a(2),c("ngClass",y(43,T,t.tabState=="detail")),a(2),f(t.type!="supplier"?11:-1),a(3),c("hidden",t.tabState!="general"),a(3),_("ngModel",t.customer.Title),a(4),$(t.options==null?null:t.options.Titles),a(4),c("ngClass",y(45,Ve,r.touched&&r.invalid)),_("ngModel",t.customer.FirstName),c("required",!0),a(2),f(r.touched&&r.invalid?27:-1),a(5),_("ngModel",t.customer.LastName),a(5),_("ngModel",t.customer.Mobile),c("required",t.requiredField().Mobile)("ngClass",y(47,I,s.invalid&&(s.dirty||s.touched))),a(2),f(s.invalid&&(s.dirty||s.touched)?39:-1),a(5),c("ngClass",y(49,Le,o.invalid&&(o.dirty||o.touched))),_("ngModel",t.customer.Email),c("required",t.requiredField().Email),a(2),f(o.invalid&&(o.dirty||o.touched)?46:-1),a(3),f(t.type!="supplier"?49:-1),a(),f(t.type=="supplier"?50:-1),a(2),_("ngModel",t.customer.Gender),c("items",t.options==null?null:t.options.Genders),a(),c("hidden",t.tabState!="detail"),a(),f(t.type!="supplier"?54:-1),a(),f(t.type!="supplier"?55:-1),a(),f(t.type!="supplier"?56:-1),a(3),c("rows",t.type!="supplier"?6:9),_("ngModel",t.customer.Address),c("required",t.requiredField().Address)("ngClass",y(51,I,N.invalid&&(N.dirty||N.touched))),a(4),f(N.invalid&&(N.dirty||N.touched)?63:-1),a(),c("hidden",t.tabState!="id"),a(3),_("ngModel",t.customer.NationalIDNumber),c("ngClass",y(53,I,D.invalid&&(D.dirty||D.touched))),a(2),f(D.invalid&&(D.dirty||D.touched)?69:-1),a(5),_("ngModel",t.customer.TaxIDNumber),a(4),_("ngModel",t.customer.NationalityID),c("items",t.options==null?null:t.options.Nationalities),a(2),_("ngModel",t.customer.RaceID),c("items",t.options==null?null:t.options.Races)}},dependencies:()=>[te,ye,ce,me,ue,re,ae,le,pe,ge,se,de,Se,R],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:2px solid #07a519}.form-floating-outline[_ngcontent-%COMP%]{margin-bottom:.2rem!important}"]})},Oe=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=X({type:i});static \u0275inj=z({imports:[ie,we,ve,Ce,fe,xe,R]})},G=class{Title;FirstName;LastName;Name;Gender;Mobile;Email;TaxIDNumber;TaxID;Group;Code;City;Address;Birthdate;MemberIdentification;NationalIDNumber;NationalityID;RaceID;CreatorEntityID};export{F as a,W as b,Ie as c,Oe as d,G as e};
1
+ import{a as Ne}from"./chunk-IFOBYW26.js";import{d as Se,e as xe}from"./chunk-QPOOLLKY.js";import{B as V,D as L,u as Me,v as ye,w as ve}from"./chunk-BA3BDB5Y.js";import{N as we,O as q}from"./chunk-T25N3EEG.js";import{d as R}from"./chunk-7TBS7SPQ.js";import{e as be,f as he}from"./chunk-A45GTZVV.js";import{A as pe,B as ge,F as Ce,G as fe,c as re,h as ae,i as le,k as de,o as se,p as ce,x as me,y as ue}from"./chunk-RNLSEEMX.js";import{a as ne}from"./chunk-USJ6ILEE.js";import{$ as K,A as k,Ab as Z,Bb as $,Ca as J,Cb as c,D as U,Db as d,Eb as l,Fb as ee,Mb as v,Ob as O,Qb as g,Xa as a,_b as M,be as oe,cd as te,db as P,dc as m,e as j,ee as _e,fc as x,hb as Q,ib as X,ic as _,jc as b,kc as h,la as E,ma as z,oa as S,pc as B,q as A,rd as ie,t as w,ta as u,u as H,ua as p,uc as y,vb as C,xb as f,zb as Y}from"./chunk-JYZTRN6N.js";var F=class i{constructor(n,e){this.localDataService=n;this.toastr=e;this.initLocalDataConfig()}localConfig=new V;_offlineConfigSubject=new j(this.localConfig);offlineConfig$=this._offlineConfigSubject.asObservable();online$=U(k(window,"offline").pipe(w(()=>!1)),k(window,"online").pipe(w(()=>!0))).pipe(K(navigator.onLine));get isOnline(){return navigator.onLine}initLocalDataConfig(){this.localDataService.getOfflineConfig().subscribe({next:n=>{let e=new V(n.configUsingLocal,n.productUsingLocal,n.orderUsingLocal);this.pushNewValue(e),this.localConfig=e,this.updateOfflineConfigDB(n)},error:n=>{this.onErrorInitConfig()}})}onErrorInitConfig(){let n=new V;this.pushNewValue(n),this.localConfig=n,this.updateOfflineConfigDB(n)}getOnlineStatus$(){return H([this.offlineConfig$.pipe(w(n=>n.configUsingLocal)),this.online$]).pipe(w(n=>{let e=n[0],t=n[1],r;return e===!0?r=!1:r=t&&this.isOnline,r}))}pushNewValue(n){this._offlineConfigSubject.next(n)}updateOfflineConfigDB(n){this.localDataService.updateOfflineConfig(n).subscribe({next:e=>{this.pushNewValue(n)}})}static \u0275fac=function(e){return new(e||i)(S(L),S(oe))};static \u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"})};var W=class i{constructor(n,e,t){this.httpService=n;this.LocalData=e;this._onlineStatusService=t}Data=new Ne;addCustomer(n,e){let t=[];n.Group&&t.push(n.Group),e&&(n.DebtLimit=e);let r={contact:n,groups:t};if(this._onlineStatusService.isOnline)return A(this.httpService.post("/API/Contact/Customer/Create",r)).catch(s=>Promise.reject(s))}findCustomerByCode(n){let e={Code:n};return this.httpService.post("/API/Contact/GetByCode",e)}GetPrivilegeByID(n,e){return this.httpService.get(q.GetCustomerPrivilegeByID,[{key:"ID",value:n},{key:"EntityID",value:e}],!0)}getCustomerSuggestionCode(){return this.httpService.get(q.GetCustomerSuggestionCode).pipe(w(n=>n.Code))}static \u0275fac=function(e){return new(e||i)(S(_e),S(L),S(F))};static \u0275prov=E({token:i,factory:i.\u0275fac,providedIn:"root"})};var T=i=>({selected:i}),Ve=i=>({"border border-danger":i}),I=i=>({"is-invalid":i}),Le=i=>({"is-invalid border border-danger":i}),Fe=i=>({"has-error":i});function We(i,n){if(i&1){let e=v();d(0,"a",12),O("click",function(){u(e);let r=g();return p(r.chooiceDetail("id"))}),m(1," ID "),l()}if(i&2){let e=g();c("ngClass",y(1,T,e.tabState=="id"))}}function ke(i,n){if(i&1&&ee(0,"option",21),i&2){let e=n.$implicit;c("value",e.Name)}}function Be(i,n){if(i&1&&(d(0,"div",24)(1,"i",47),m(2," Name is mandatory."),l()()),i&2){g();let e=M(26);c("ngClass",y(1,Fe,e.touched&&e.invalid))}}function Re(i,n){i&1&&(d(0,"div",40),m(1," Mobile Phone is mandatory "),l())}function qe(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){g(2);let e=M(38);a(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}function Ge(i,n){if(i&1&&(C(0,Re,2,0,"div",40),C(1,qe,2,1,"div",40)),i&2){g();let e=M(38);f(e.getError("required")&&!e.getError("minLength")?0:-1),a(),f(e.getError("minLength")?1:-1)}}function je(i,n){i&1&&(d(0,"div",40),m(1," Email must be a valid email address "),l())}function Ae(i,n){i&1&&(d(0,"div",40),m(1,"Email is mandatory"),l())}function He(i,n){if(i&1&&(C(0,je,2,0,"div",40),C(1,Ae,2,0,"div",40)),i&2){g();let e=M(45);f(e.errors!=null&&e.errors.email?0:-1),a(),f(e.errors!=null&&e.errors.required?1:-1)}}function Ue(i,n){i&1&&(d(0,"div",40),m(1,"Birthdate is mandatory"),l())}function Ke(i,n){if(i&1&&C(0,Ue,2,0,"div",40),i&2){g();let e=M(3);f(e.invalid?0:-1)}}function ze(i,n){if(i&1){let e=v();d(0,"div",33)(1,"div",17)(2,"datepicker",48,6),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Birthdate,r)||(s.customer.Birthdate=r),p(r)}),l(),C(4,Ke,1,1),l()()}if(i&2){let e=M(3),t=g();a(2),_("ngModel",t.customer.Birthdate),c("required",t.requiredField().Birthdate)("ngClass",y(4,I,e.invalid&&(e.dirty||e.touched))),a(2),f(e.dirty||e.touched?4:-1)}}function Je(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){let e=g(2);a(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function Qe(i,n){if(i&1){let e=v();d(0,"div",33)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Code,r)||(s.customer.Code=r),p(r)}),l(),C(4,Je,2,1,"div",40),d(5,"label",50),m(6),l()()()}if(i&2){let e=M(3),t=g();a(2),c("placeholder",B("",t.type=="supplier"?"Supplier":"Member"," code")),_("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),a(2),f(e.invalid&&(e.dirty||e.touched)?4:-1),a(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Xe(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){let e=g(2);a(),x(" ",e.type=="supplier"?"Supplier":"Customer"," code is mandatory. ")}}function Ye(i,n){if(i&1){let e=v();d(0,"div",36)(1,"div",17)(2,"input",49,7),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Code,r)||(s.customer.Code=r),p(r)}),l(),C(4,Xe,2,1,"div",40),d(5,"label",50),m(6),l()()()}if(i&2){let e=M(3),t=g();a(2),c("placeholder",B("",t.type=="supplier"?"Supplier":"Member"," code")),_("ngModel",t.customer.Code),c("required",t.requiredField().Code)("ngClass",y(7,I,e.invalid&&(e.dirty||e.touched))),a(2),f(e.invalid&&(e.dirty||e.touched)?4:-1),a(2),x("",t.type=="supplier"?"Supplier":"Member"," Code")}}function Ze(i,n){if(i&1){let e=v();d(0,"div",36)(1,"div",51)(2,"ng-select",52),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.Group,r)||(s.customer.Group=r),p(r)}),l(),d(3,"label",53),m(4,"Group"),l()()()}if(i&2){let e=g();a(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.Group))),a(),_("ngModel",e.customer.Group),c("items",e.options==null?null:e.options.Groups)}}function $e(i,n){if(i&1){let e=v();d(0,"div",36)(1,"div",51)(2,"ng-select",54),h("ngModelChange",function(r){u(e);let s=g();return b(s.customer.City,r)||(s.customer.City=r),p(r)}),l(),d(3,"label",55),m(4,"City"),l()()()}if(i&2){let e=g();a(),c("ngClass",y(3,T,e.isNotEmpty(e.customer.City))),a(),_("ngModel",e.customer.City),c("items",e.options==null?null:e.options.Cities)}}function et(i,n){i&1&&(d(0,"div",40),m(1,"Address is mandatory."),l())}function tt(i,n){if(i&1&&(d(0,"div",40),m(1),l()),i&2){g();let e=M(68);a(),x(" ",e.errors==null||e.errors.minLength==null?null:e.errors.minLength.message," ")}}var Ie=class i{constructor(n,e,t){this.dialogRef=n;this.data=e;this._CustomerHttpService=t;this.modalConfig=new Me,this.modalConfig.title=this.data.title,this.modalConfig.customWidth="650px",this.options=this.data.options,this.options?.Genders||(this.options.Genders=[{Key:0,Value:"Male"},{Key:1,Value:"Female"}]),this.config=this.data.config,this.type=this.data.type}customer;options;type;config;more;modalConfig;detailVisible;tabState="general";requiredField=J({Mobile:!1,Email:!1,Code:!1,Address:!1,SignUpOutlet:!1,Birthdate:!1});ngOnInit(){this.customer=new G,this.initFirstName(),this.customer.Gender=this.config.DefaultValue.Gender,this.more=!1,this.initRequiredField()}initRequiredField(){let n=this.config.Advance?.RequiredFields;n&&this.type!="supplier"&&n.forEach(e=>{this.requiredField.update(t=>(t[e]=!0,t))})}initFirstName(){this.data&&this.data.inputTextName&&(this.customer.FirstName=this.data.inputTextName)}onOk(n){if(n.form?.markAllAsTouched(),n.form.invalid)return;let e=this.customer.Title?this.customer.Title:"";e+=" "+this.customer.FirstName,e+=" "+(this.customer.LastName?this.customer.LastName:""),e=e.trim(),this.customer.Name=e,this.type=="customer"?this._CustomerHttpService.addCustomer(this.customer).then(t=>{this.dialogRef.close({ContactName:e,CustomerID:t.ID})}).catch(t=>{this.dialogRef.close({Error:t})}):this.type=="supplier"&&this.dialogRef.close({supplier:this.customer})}chooiceDetail(n){this.tabState=n}isNotEmpty(n){return ne.IsNotEmpty(n)||n==0}static \u0275fac=function(e){return new(e||i)(P(be),P(he),P(W))};static \u0275cmp=Q({type:i,selectors:[["POS-modal-customer"]],standalone:!1,decls:81,vars:55,consts:[["f","ngForm"],["FirstName","ngModel"],["phoneNumber","ngModel"],["Email","ngModel"],["addressCtrl","ngModel"],["nationalId","ngModel"],["birthdateCtrl","ngModel"],["codeCtrl","ngModel"],[3,"onOk","onCancel","onClose","config"],[1,"container",2,"height","270px"],["name","form"],[1,"row","align-items-center","border-bottom"],[1,"btn","btn-link",3,"click","ngClass"],[1,"btn","btn-link",3,"ngClass"],[1,"mt-6"],[1,"row","g-4",3,"hidden"],[1,"col-md-2","mt-4"],[1,"form-floating-outline"],["list","cust-title","id","Title","name","Title","placeholder","Title",1,"form-control",3,"ngModelChange","ngModel"],["for","Title"],["id","cust-title"],[3,"value"],[1,"col-md-5","mt-4"],["type","text","id","FirstName","name","FirstName","placeholder","First Name",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],[3,"ngClass"],["for","FirstName"],["type","text","id","LastName","name","LastName","placeholder","Last Name",1,"form-control",3,"ngModelChange","ngModel"],["for","LastName"],[1,"col-md-6","mt-4"],["type","text","name","Phone","placeholder","Mobile",1,"form-control",3,"ngModelChange","ngModel","required","ngClass"],["for","Phone"],["type","email","name","Email","placeholder","Email","email","",1,"form-control",3,"ngModelChange","ngClass","ngModel","required"],["for","email"],[1,"col-6","mt-4"],["name","gender","bindLabel","Value","bindValue","Key","placeholder","Gender","dropdownPosition","buttom",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"row","g-4","mt-2",3,"hidden"],[1,"col-4","mt-4"],[1,"col-md-12","mt-4"],["id","address","name","address","placeholder","Address",1,"form-control","h-100",3,"ngModelChange","rows","ngModel","required","ngClass"],["for","address"],[1,"invalid-feedback"],["type","text","id","Identification","name","Identification","placeholder","NationalID","numericInputOnly","nationalId",1,"form-control",3,"ngModelChange","ngModel","ngClass"],["for","Identification"],["type","text","id","TaxId","name","TaxId","placeholder","TaxID",1,"form-control",3,"ngModelChange","ngModel"],["for","TaxId"],["name","NationalityID","bindLabel","Name","bindValue","ID","placeholder","Nationality","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],["name","race","bindLabel","Name","bindValue","ID","placeholder","Race","appendTo","body",1,"tall","outlet","auto-grow",3,"ngModelChange","ngModel","items"],[1,"control-label","text-danger"],["placeholder","Birthdate","name","birthDate",3,"ngModelChange","ngModel","required","ngClass"],["type","text","name","code","id","code",1,"form-control",3,"ngModelChange","ngModel","placeholder","required","ngClass"],["for","code"],[1,"form-floating-outline","flexRow",3,"ngClass"],["id","customerGroup","bindLabel","Name","bindValue","ID","name","customerGroup","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","customerGroup",1,"ng-select"],["id","city","bindLabel","Name","bindValue","ID","name","city","appendTo","body",1,"productform","tall",3,"ngModelChange","ngModel","items"],["for","city",1,"ng-select"]],template:function(e,t){if(e&1){let r=v();d(0,"modal-material",8),O("onOk",function(){u(r);let o=M(4);return p(t.onOk(o))})("onCancel",function(){return u(r),p(t.dialogRef.close())})("onClose",function(){return u(r),p(t.dialogRef.close())}),d(1,"content")(2,"div",9)(3,"form",10,0)(5,"div",11)(6,"div")(7,"a",12),O("click",function(){return u(r),p(t.chooiceDetail("general"))}),m(8," General "),l(),d(9,"a",12),O("click",function(){return u(r),p(t.chooiceDetail("detail"))}),m(10," Detail "),l(),C(11,We,2,3,"a",13),l()(),d(12,"div")(13,"div",14)(14,"div",15)(15,"div",16)(16,"div",17)(17,"input",18),h("ngModelChange",function(o){return u(r),b(t.customer.Title,o)||(t.customer.Title=o),p(o)}),l(),d(18,"label",19),m(19,"Title"),l(),d(20,"datalist",20),Z(21,ke,1,1,"option",21,Y),l()()(),d(23,"div",22)(24,"div",17)(25,"input",23,1),h("ngModelChange",function(o){return u(r),b(t.customer.FirstName,o)||(t.customer.FirstName=o),p(o)}),l(),C(27,Be,3,3,"div",24),d(28,"label",25),m(29,"First Name"),l()()(),d(30,"div",22)(31,"div",17)(32,"input",26),h("ngModelChange",function(o){return u(r),b(t.customer.LastName,o)||(t.customer.LastName=o),p(o)}),l(),d(33,"label",27),m(34,"Last Name"),l()()(),d(35,"div",28)(36,"div",17)(37,"input",29,2),h("ngModelChange",function(o){return u(r),b(t.customer.Mobile,o)||(t.customer.Mobile=o),p(o)}),l(),C(39,Ge,2,2),d(40,"label",30),m(41,"Mobile"),l()()(),d(42,"div",28)(43,"div",17)(44,"input",31,3),h("ngModelChange",function(o){return u(r),b(t.customer.Email,o)||(t.customer.Email=o),p(o)}),l(),C(46,He,2,2),d(47,"label",32),m(48,"Email"),l()()(),C(49,ze,5,6,"div",33),C(50,Qe,7,9,"div",33),d(51,"div",28)(52,"ng-select",34),h("ngModelChange",function(o){return u(r),b(t.customer.Gender,o)||(t.customer.Gender=o),p(o)}),l()()(),d(53,"div",35),C(54,Ye,7,9,"div",36),C(55,Ze,5,5,"div",36),C(56,$e,5,5,"div",36),d(57,"div",37)(58,"div",17)(59,"textarea",38,4),h("ngModelChange",function(o){return u(r),b(t.customer.Address,o)||(t.customer.Address=o),p(o)}),l(),d(61,"label",39),m(62,"Address"),l(),C(63,et,2,0,"div",40),l()()(),d(64,"div",35)(65,"div",28)(66,"div",17)(67,"input",41,5),h("ngModelChange",function(o){return u(r),b(t.customer.NationalIDNumber,o)||(t.customer.NationalIDNumber=o),p(o)}),l(),C(69,tt,2,1,"div",40),d(70,"label",42),m(71,"National ID"),l()()(),d(72,"div",28)(73,"div",17)(74,"input",43),h("ngModelChange",function(o){return u(r),b(t.customer.TaxIDNumber,o)||(t.customer.TaxIDNumber=o),p(o)}),l(),d(75,"label",44),m(76,"Tax ID"),l()()(),d(77,"div",28)(78,"ng-select",45),h("ngModelChange",function(o){return u(r),b(t.customer.NationalityID,o)||(t.customer.NationalityID=o),p(o)}),l()(),d(79,"div",33)(80,"ng-select",46),h("ngModelChange",function(o){return u(r),b(t.customer.RaceID,o)||(t.customer.RaceID=o),p(o)}),l()()()()()()()()()}if(e&2){let r=M(26),s=M(38),o=M(45),N=M(60),D=M(68);c("config",t.modalConfig),a(7),c("ngClass",y(41,T,t.tabState=="general")),a(2),c("ngClass",y(43,T,t.tabState=="detail")),a(2),f(t.type!="supplier"?11:-1),a(3),c("hidden",t.tabState!="general"),a(3),_("ngModel",t.customer.Title),a(4),$(t.options==null?null:t.options.Titles),a(4),c("ngClass",y(45,Ve,r.touched&&r.invalid)),_("ngModel",t.customer.FirstName),c("required",!0),a(2),f(r.touched&&r.invalid?27:-1),a(5),_("ngModel",t.customer.LastName),a(5),_("ngModel",t.customer.Mobile),c("required",t.requiredField().Mobile)("ngClass",y(47,I,s.invalid&&(s.dirty||s.touched))),a(2),f(s.invalid&&(s.dirty||s.touched)?39:-1),a(5),c("ngClass",y(49,Le,o.invalid&&(o.dirty||o.touched))),_("ngModel",t.customer.Email),c("required",t.requiredField().Email),a(2),f(o.invalid&&(o.dirty||o.touched)?46:-1),a(3),f(t.type!="supplier"?49:-1),a(),f(t.type=="supplier"?50:-1),a(2),_("ngModel",t.customer.Gender),c("items",t.options==null?null:t.options.Genders),a(),c("hidden",t.tabState!="detail"),a(),f(t.type!="supplier"?54:-1),a(),f(t.type!="supplier"?55:-1),a(),f(t.type!="supplier"?56:-1),a(3),c("rows",t.type!="supplier"?6:9),_("ngModel",t.customer.Address),c("required",t.requiredField().Address)("ngClass",y(51,I,N.invalid&&(N.dirty||N.touched))),a(4),f(N.invalid&&(N.dirty||N.touched)?63:-1),a(),c("hidden",t.tabState!="id"),a(3),_("ngModel",t.customer.NationalIDNumber),c("ngClass",y(53,I,D.invalid&&(D.dirty||D.touched))),a(2),f(D.invalid&&(D.dirty||D.touched)?69:-1),a(5),_("ngModel",t.customer.TaxIDNumber),a(4),_("ngModel",t.customer.NationalityID),c("items",t.options==null?null:t.options.Nationalities),a(2),_("ngModel",t.customer.RaceID),c("items",t.options==null?null:t.options.Races)}},dependencies:()=>[te,ye,ce,me,ue,re,ae,le,pe,ge,se,de,Se,R],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:2px solid #07a519}.form-floating-outline[_ngcontent-%COMP%]{margin-bottom:.2rem!important}"]})},Oe=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=X({type:i});static \u0275inj=z({imports:[ie,we,ve,Ce,fe,xe,R]})},G=class{Title;FirstName;LastName;Name;Gender;Mobile;Email;TaxIDNumber;TaxID;Group;Code;City;Address;Birthdate;MemberIdentification;NationalIDNumber;NationalityID;RaceID;CreatorEntityID};export{F as a,W as b,Ie as c,Oe as d,G as e};
@@ -1,2 +1,2 @@
1
- import{O as b}from"./chunk-NZYZO47Z.js";import{a as m}from"./chunk-2FWFPV5I.js";import{a as u}from"./chunk-DGKIIUIQ.js";import{be as d,ee as h,la as n,pa as c}from"./chunk-JYZTRN6N.js";import{k as l}from"./chunk-SNAKHGZS.js";var p=class a{constructor(){}copy(t){return new Promise((o,r)=>{try{if(navigator.clipboard)navigator.clipboard.writeText(t).then(o,r);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?o():r(new Error("Failed to copy with execCommand"))}catch(i){r(i)}finally{document.body.removeChild(e)}}}catch(e){r(e)}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};var y=class a{toastr=c(d);httpService=c(h);copyToClipBoard=c(p);createCustomerFromNewNumberAndSendReceipt(t,o,r,e,i){r==0?this.httpService.post(b.CreateCustomerInvoice,{InvoiceID:e.ObjectID,Mobile:t}).subscribe(s=>l(this,null,function*(){this.toastr.success(s.Message,m.Success),yield this.sendReceiptToWhatsapp(t,e,o,i)})):this.toastr.info("WABA is not supported yet",m.Info)}createWhatsappReceipt(t,o,r){let e=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],i=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:g,InvoiceNumber:f}=t,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:e(g),Brand:i,Currency:o,Number:f,ReceiptLink:w},r)}convertWhatsappTemplateMessage(t,o){let r=o||u?.whatsappTemplateMessage,e=["Brand","Number","Currency","Amount","ReceiptLink"],i=r;return e.forEach(s=>i=i.replace(`{${s}}`,t[s])),i}redirectToWhatsapp(t,o){let r=t;r=r[0]==="0"?`62${r.slice(1)}`:r;let e=`whatsapp://send?phone=${r}&text=${encodeURIComponent(o)}`;window.location.href=e,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let t=!1;window.onblur=function(){t=!0},setTimeout(()=>{t||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
1
+ import{O as b}from"./chunk-T25N3EEG.js";import{a as m}from"./chunk-2FWFPV5I.js";import{a as u}from"./chunk-P3RYBCCQ.js";import{be as d,ee as h,la as n,pa as c}from"./chunk-JYZTRN6N.js";import{k as l}from"./chunk-SNAKHGZS.js";var p=class a{constructor(){}copy(t){return new Promise((o,r)=>{try{if(navigator.clipboard)navigator.clipboard.writeText(t).then(o,r);else{let e=document.createElement("textarea");e.value=t,e.style.position="fixed",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")?o():r(new Error("Failed to copy with execCommand"))}catch(i){r(i)}finally{document.body.removeChild(e)}}}catch(e){r(e)}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};var y=class a{toastr=c(d);httpService=c(h);copyToClipBoard=c(p);createCustomerFromNewNumberAndSendReceipt(t,o,r,e,i){r==0?this.httpService.post(b.CreateCustomerInvoice,{InvoiceID:e.ObjectID,Mobile:t}).subscribe(s=>l(this,null,function*(){this.toastr.success(s.Message,m.Success),yield this.sendReceiptToWhatsapp(t,e,o,i)})):this.toastr.info("WABA is not supported yet",m.Info)}createWhatsappReceipt(t,o,r){let e=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],i=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:g,InvoiceNumber:f}=t,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:e(g),Brand:i,Currency:o,Number:f,ReceiptLink:w},r)}convertWhatsappTemplateMessage(t,o){let r=o||u?.whatsappTemplateMessage,e=["Brand","Number","Currency","Amount","ReceiptLink"],i=r;return e.forEach(s=>i=i.replace(`{${s}}`,t[s])),i}redirectToWhatsapp(t,o){let r=t;r=r[0]==="0"?`62${r.slice(1)}`:r;let e=`whatsapp://send?phone=${r}&text=${encodeURIComponent(o)}`;window.location.href=e,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let t=!1;window.onblur=function(){t=!0},setTimeout(()=>{t||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
2
2
  `,"WhatsApp not installed")},2e3)}copyToClipboard(t){return new Promise((o,r)=>this.copyToClipBoard.copy(t).then(()=>{this.toastr.info("Message copied to clipboard. If WhatsApp doesn't show the message, please paste it manually.","Receipt Ready",{timeOut:8e3}),o("Copied to clipboard")}).catch(e=>{console.log(e),this.toastr.warning("Could not copy message to clipboard","Clipboard Error",{timeOut:8e3}),r(e)}))}sendReceiptToWhatsapp(t,o,r,e){return l(this,null,function*(){try{let i=this.createWhatsappReceipt(o,r,e);try{yield this.copyToClipboard(i)}finally{this.redirectToWhatsapp(t,i)}}catch(i){console.warn(i),this.toastr.error("Failed to send receipt")}})}static \u0275fac=function(o){return new(o||a)};static \u0275prov=n({token:a,factory:a.\u0275fac})};export{y as a};