marketplacepos 26.43.0 → 26.44.0

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 (74) hide show
  1. package/Marketplace/{chunk-WXWT4LQC.js → chunk-3CACAFL7.js} +1 -1
  2. package/Marketplace/{chunk-YWJOPGQU.js → chunk-3EK2HGB5.js} +1 -1
  3. package/Marketplace/{chunk-KHTYUPUR.js → chunk-4DQDJDWR.js} +1 -1
  4. package/Marketplace/{chunk-ULSIOO47.js → chunk-4T46J7KF.js} +1 -1
  5. package/Marketplace/{chunk-K3O4KCFF.js → chunk-573SRSN2.js} +1 -1
  6. package/Marketplace/{chunk-55IGSH64.js → chunk-5R5VSKST.js} +1 -1
  7. package/Marketplace/{chunk-HIUYOWFR.js → chunk-62H5VEXV.js} +1 -1
  8. package/Marketplace/{chunk-4S6LZJST.js → chunk-7IHWCG7V.js} +1 -1
  9. package/Marketplace/chunk-7JXTAGFY.js +17 -0
  10. package/Marketplace/{chunk-XK76S2DI.js → chunk-7TZMLIVI.js} +1 -1
  11. package/Marketplace/chunk-AF67O6OF.js +1 -0
  12. package/Marketplace/{chunk-ID7ST3HT.js → chunk-AJAAOUOP.js} +1 -1
  13. package/Marketplace/{chunk-JUVFMERU.js → chunk-AJRIEXAZ.js} +1 -1
  14. package/Marketplace/chunk-ALAG4HXV.js +2 -0
  15. package/Marketplace/{chunk-V4UEGXVZ.js → chunk-AOVACJRS.js} +1 -1
  16. package/Marketplace/chunk-AP4VVI4Q.js +2 -0
  17. package/Marketplace/{chunk-BRCPY2BN.js → chunk-AUPM35MA.js} +1 -1
  18. package/Marketplace/{chunk-XTW5WVBF.js → chunk-BJ4PF3IX.js} +1 -1
  19. package/Marketplace/{chunk-DPP3IVOD.js → chunk-CJG5IRCS.js} +1 -1
  20. package/Marketplace/{chunk-GOAHKYR2.js → chunk-CZ54SV5Z.js} +1 -1
  21. package/Marketplace/{chunk-GSZUUDQZ.js → chunk-DIITCV4M.js} +1 -1
  22. package/Marketplace/chunk-DPB6F5JO.js +1 -0
  23. package/Marketplace/{chunk-KU25KD46.js → chunk-EAAWYMGM.js} +1 -1
  24. package/Marketplace/{chunk-CQ4ASGXQ.js → chunk-FF26XLTH.js} +1 -1
  25. package/Marketplace/{chunk-NLHR7PW3.js → chunk-G5NSFJHJ.js} +1 -1
  26. package/Marketplace/{chunk-ZWOU5BRN.js → chunk-GESFA2ZC.js} +1 -1
  27. package/Marketplace/chunk-GGXBO54D.js +1 -0
  28. package/Marketplace/{chunk-JLQFWDMI.js → chunk-H6W5ETMM.js} +1 -1
  29. package/Marketplace/{chunk-2R3JATH5.js → chunk-HO4HAIWH.js} +1 -1
  30. package/Marketplace/{chunk-5J4Q5ZBB.js → chunk-IDHA5FQH.js} +1 -1
  31. package/Marketplace/{chunk-374BCHEH.js → chunk-JLWYF6CA.js} +1 -1
  32. package/Marketplace/{chunk-HP7ZS4OU.js → chunk-JQGFFQTR.js} +1 -1
  33. package/Marketplace/{chunk-QLH3OTGA.js → chunk-KFDGIETK.js} +1 -1
  34. package/Marketplace/{chunk-7ZXZOAQG.js → chunk-KS5RMDHP.js} +1 -1
  35. package/Marketplace/{chunk-OEPDHZQL.js → chunk-LZUUCVEY.js} +1 -1
  36. package/Marketplace/{chunk-WO4SJFHE.js → chunk-MKVEYBIH.js} +1 -1
  37. package/Marketplace/{chunk-YNRIOWOL.js → chunk-MY5XC6YO.js} +1 -1
  38. package/Marketplace/{chunk-XKIQDO7W.js → chunk-N3X6LYCC.js} +1 -1
  39. package/Marketplace/{chunk-5BB6TB2H.js → chunk-OHSE4HCU.js} +1 -1
  40. package/Marketplace/chunk-ON6KM3OX.js +1 -0
  41. package/Marketplace/{chunk-LQKUJM65.js → chunk-QT46BBIE.js} +2 -2
  42. package/Marketplace/{chunk-VGVOCODE.js → chunk-QZ4E2XRZ.js} +1 -1
  43. package/Marketplace/{chunk-GIUK5WNF.js → chunk-RBEQRGC3.js} +1 -1
  44. package/Marketplace/{chunk-VWMH26LX.js → chunk-RDD27FVJ.js} +1 -1
  45. package/Marketplace/{chunk-7UMGEXVB.js → chunk-RH62JCAG.js} +1 -1
  46. package/Marketplace/{chunk-3QDWLCB5.js → chunk-SFFPXVOD.js} +1 -1
  47. package/Marketplace/{chunk-TN52KDYF.js → chunk-SRN7IBV7.js} +1 -1
  48. package/Marketplace/{chunk-JC5MUX4Z.js → chunk-TAVCB44W.js} +1 -1
  49. package/Marketplace/{chunk-H7PNKBUL.js → chunk-TNOFQGQU.js} +1 -1
  50. package/Marketplace/{chunk-Q2ZMQAAK.js → chunk-TNVMVUFJ.js} +1 -1
  51. package/Marketplace/{chunk-L34NDMLR.js → chunk-U5IJUOZZ.js} +1 -1
  52. package/Marketplace/{chunk-2Q3SIQPZ.js → chunk-W27XJPMH.js} +1 -1
  53. package/Marketplace/{chunk-J4JI3SM6.js → chunk-W6MIFW5U.js} +1 -1
  54. package/Marketplace/{chunk-L6PRP5DX.js → chunk-WHWTIACL.js} +1 -1
  55. package/Marketplace/{chunk-YTT526J3.js → chunk-WRI2Y2AL.js} +1 -1
  56. package/Marketplace/{chunk-I4T3MIH2.js → chunk-X4NK3VLV.js} +1 -1
  57. package/Marketplace/{chunk-NFMA3PBT.js → chunk-XBK4V6E5.js} +1 -1
  58. package/Marketplace/{chunk-3644CQOR.js → chunk-XDMGP3CQ.js} +1 -1
  59. package/Marketplace/{chunk-PS2YAPBI.js → chunk-XKUGAXOU.js} +1 -1
  60. package/Marketplace/{chunk-WMA6DKHK.js → chunk-YJG3OPMM.js} +1 -1
  61. package/Marketplace/{chunk-GHEWEE5Q.js → chunk-YVCOOQHK.js} +1 -1
  62. package/Marketplace/{chunk-QJQSPF5R.js → chunk-Z2UK6C26.js} +1 -1
  63. package/Marketplace/{chunk-6SBON7GY.js → chunk-ZZ7RVUST.js} +1 -1
  64. package/Marketplace/index.html +2 -2
  65. package/Marketplace/{main-S5Q6FBPI.js → main-VYIV4BMZ.js} +2 -2
  66. package/package.json +1 -1
  67. package/Marketplace/chunk-6R4B4AH7.js +0 -1
  68. package/Marketplace/chunk-FSIRYC4Q.js +0 -1
  69. package/Marketplace/chunk-GIQDY6DE.js +0 -1
  70. package/Marketplace/chunk-I6GEE3L6.js +0 -1
  71. package/Marketplace/chunk-MFUVGBJQ.js +0 -1
  72. package/Marketplace/chunk-QNSVLW6H.js +0 -13
  73. package/Marketplace/chunk-SRBD76V2.js +0 -5
  74. package/Marketplace/chunk-VJ4Q6L5M.js +0 -1
@@ -1 +1 @@
1
- import{a as tt}from"./chunk-HV46UVNS.js";import"./chunk-REDMZUTI.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as nt}from"./chunk-EYHQ2ZKL.js";import{a as et}from"./chunk-HP7ZS4OU.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BKR7YPEW.js";import"./chunk-BRCPY2BN.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as Z}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import{c as X}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as W}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as Q}from"./chunk-ZSUWHVKX.js";import{f as K}from"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as G,c as J}from"./chunk-MDHMVGYC.js";import{c as M}from"./chunk-NNVT5X6O.js";import"./chunk-7HUEGPJN.js";import{b as H}from"./chunk-ZE4OOGMT.js";import{e as Y}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as q,D as U,z as j}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as $,Aa as I,C as y,Eb as E,Ic as c,Jc as N,Kc as C,W as v,Wc as O,Xb as w,Xc as P,Yb as L,Zb as b,ac as B,bc as A,cc as h,d as D,db as k,dc as i,ec as o,ed as u,fc as p,fd as _,gb as l,gd as z,ha as d,jc as F,kc as V,mc as f,oa as x,pa as g,rc as S,tc as s,yb as T,yd as R}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var ot=()=>["/menu/products/status/sold-in-channel"],it=n=>({ID:n}),at=()=>["/menu/products/status/not-in-pos"],rt=n=>[n];function ct(n,m){if(n&1&&c(0),n&2){let t=s().$implicit;C(" ",t.Count," ")}}function lt(n,m){if(n&1){let t=f();i(0,"span",24),S("click",function(){x(t);let a=s().$implicit,r=s(2);return g(r.getLiveProductCount(a.ID,a))}),p(1,"i",25),o()}}function st(n,m){if(n&1){let t=f();F(0),i(1,"button",26),S("click",function(){x(t);let a=s().$implicit,r=s(2);return g(r.onScanChannel(a))}),p(2,"i",27),c(3," Scan "),o(),V()}}function pt(n,m){if(n&1){let t=f();i(0,"tr")(1,"td",9),p(2,"img",15),i(3,"span",16),c(4),o()(),i(5,"td",17),w(6,ct,1,1)(7,lt,2,0,"span",18),o(),i(8,"td",17)(9,"a",19),c(10),u(11,"number"),o()(),i(12,"td",17)(13,"a",19),c(14),u(15,"number"),o()(),i(16,"td"),c(17),u(18,"date"),o(),i(19,"td")(20,"div",20),E(21,st,4,0,"ng-container",21),i(22,"button",22),S("click",function(){let a=x(t).$implicit,r=s(2);return g(r.onClearCache(a.ID))}),p(23,"i",23),c(24," Clear "),o()()()()}if(n&2){let t=m.$implicit,e=s(2);l(2),h("src",e.getChannelLogo(t.TypeID),k),l(2),N(t.Name),l(2),b(t.Count!==void 0?6:7),l(3),h("routerLink",O(18,ot))("queryParams",P(19,it,t.ID)),l(),C(" ",_(11,11,t.SoldInChannel)," "),l(3),h("routerLink",O(21,at))("queryParams",P(22,it,t.ID)),l(),C(" ",_(15,13,t.NotInPOS)," "),l(3),C(" ",t.LastSync?z(18,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," "),l(4),h("ngxPermissionsOnly",P(24,rt,e.scanProductRole))}}function mt(n,m){if(n&1&&(i(0,"div",4)(1,"table",6)(2,"thead",7)(3,"tr",8)(4,"th",9),c(5,"Channel"),o(),i(6,"th",10),c(7," Live Product "),o(),i(8,"th",11),c(9," Sold In Channel "),o(),i(10,"th",12),c(11," Product Not in POS "),o(),i(12,"th",13),c(13,"Last Sync"),o(),p(14,"th",14),o()(),i(15,"tbody"),B(16,pt,25,26,"tr",null,$),u(18,"async"),o()()()),n&2){let t,e=s();l(16),A((t=_(18,0,e.channels$))==null?null:t.Data)}}function dt(n,m){n&1&&(i(0,"div",5),p(1,"app-empty-state"),o())}var Et=(()=>{class n{constructor(){this.productService=d(et),this.toastr=d(H),this.dialog=d(X),this.authService=d(K),this.cdr=d(R),this.channelOptions=I([]),this.scanProductRole=Q.ProductScan;let t=this.authService;this.destroy$=new D,this.channelOptions.set(t.getChannels())}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(v(this.destroy$)).subscribe(a=>{e.Count=a.Count})}onScanChannel(t){this.dialog.open(tt,{width:"700px",data:{channelOptions:this.channelOptions(),filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>M.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let a=this.productService.findChannelById(t,this.channelOptions());this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(r=>r)).subscribe(r=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(r,a,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(v(this.destroy$)).subscribe(a=>{this.toastr.success("Successfully cleared cache","Success"),this.channels$=null,this.setObsProductStatistic(),this.cdr.detectChanges()})}getChannelLogo(t){return M.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-channel-statistic"]],decls:8,vars:5,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"channel-col"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngxPermissionsOnly"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"]],template:function(e,a){if(e&1&&(i(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),w(5,mt,19,2,"div",4),u(6,"async"),L(7,dt,2,0,"div",5),o()()()()()),e&2){let r;h("hideSearchBox",!0)("hideSearchDropdown",!0),l(5),b(((r=_(6,3,a.channels$))==null||r.Data==null?null:r.Data.length)>0?5:7)}},dependencies:[Z,W,Y,J,G,nt,j,U,q],styles:["@media(max-width:991px){.container-fluid[_ngcontent-%COMP%]{padding:0 8px}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}[class*=col-][_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;flex:0 0 100%!important;margin-bottom:20px}.card[_ngcontent-%COMP%]{margin-bottom:20px;min-width:0}.card-title[_ngcontent-%COMP%]{font-size:1.2rem;margin-left:0!important;margin-top:0!important}.table-responsive[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{font-size:13px;min-width:500px}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:6px 4px!important;word-break:break-word}.btn-sm[_ngcontent-%COMP%]{font-size:11px!important;padding:4px 8px!important}.mt-5[_ngcontent-%COMP%], .mt-6[_ngcontent-%COMP%], .my-6[_ngcontent-%COMP%], .ms-10[_ngcontent-%COMP%]{margin-top:12px!important;margin-bottom:12px!important;margin-left:0!important}th.channel-col[_ngcontent-%COMP%], td.channel-col[_ngcontent-%COMP%]{width:auto!important;min-width:100px!important;max-width:none!important;white-space:nowrap}}@media(max-width:600px){.container-fluid[_ngcontent-%COMP%]{padding:0 2px}.card-title[_ngcontent-%COMP%]{font-size:1rem}.table[_ngcontent-%COMP%]{font-size:12px}.card-body[_ngcontent-%COMP%]{padding:10px!important}.table-responsive[_ngcontent-%COMP%]{min-width:0}.btn-sm[_ngcontent-%COMP%]{min-width:60px;font-size:11px;padding:3px 6px!important}img[_ngcontent-%COMP%]{max-width:90%;height:auto}th.channel-col[_ngcontent-%COMP%], td.channel-col[_ngcontent-%COMP%]{width:auto!important;min-width:100px!important;max-width:none!important;white-space:nowrap}}"],changeDetection:0})}}return n})();export{Et as ChannelStatisticComponent};
1
+ import{a as tt}from"./chunk-HV46UVNS.js";import"./chunk-REDMZUTI.js";import"./chunk-F4NRX6ZE.js";import"./chunk-ON5KFKHE.js";import"./chunk-62QUGB6I.js";import{a as nt}from"./chunk-EYHQ2ZKL.js";import{a as et}from"./chunk-JQGFFQTR.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BKR7YPEW.js";import"./chunk-AUPM35MA.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as Z}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import{c as X}from"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as W}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as Q}from"./chunk-ZSUWHVKX.js";import{f as K}from"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as G,c as J}from"./chunk-MDHMVGYC.js";import{c as M}from"./chunk-NNVT5X6O.js";import"./chunk-7HUEGPJN.js";import{b as H}from"./chunk-ZE4OOGMT.js";import{e as Y}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as q,D as U,z as j}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as $,Aa as I,C as y,Eb as E,Ic as c,Jc as N,Kc as C,W as v,Wc as O,Xb as w,Xc as P,Yb as L,Zb as b,ac as B,bc as A,cc as h,d as D,db as k,dc as i,ec as o,ed as u,fc as p,fd as _,gb as l,gd as z,ha as d,jc as F,kc as V,mc as f,oa as x,pa as g,rc as S,tc as s,yb as T,yd as R}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var ot=()=>["/menu/products/status/sold-in-channel"],it=n=>({ID:n}),at=()=>["/menu/products/status/not-in-pos"],rt=n=>[n];function ct(n,m){if(n&1&&c(0),n&2){let t=s().$implicit;C(" ",t.Count," ")}}function lt(n,m){if(n&1){let t=f();i(0,"span",24),S("click",function(){x(t);let a=s().$implicit,r=s(2);return g(r.getLiveProductCount(a.ID,a))}),p(1,"i",25),o()}}function st(n,m){if(n&1){let t=f();F(0),i(1,"button",26),S("click",function(){x(t);let a=s().$implicit,r=s(2);return g(r.onScanChannel(a))}),p(2,"i",27),c(3," Scan "),o(),V()}}function pt(n,m){if(n&1){let t=f();i(0,"tr")(1,"td",9),p(2,"img",15),i(3,"span",16),c(4),o()(),i(5,"td",17),w(6,ct,1,1)(7,lt,2,0,"span",18),o(),i(8,"td",17)(9,"a",19),c(10),u(11,"number"),o()(),i(12,"td",17)(13,"a",19),c(14),u(15,"number"),o()(),i(16,"td"),c(17),u(18,"date"),o(),i(19,"td")(20,"div",20),E(21,st,4,0,"ng-container",21),i(22,"button",22),S("click",function(){let a=x(t).$implicit,r=s(2);return g(r.onClearCache(a.ID))}),p(23,"i",23),c(24," Clear "),o()()()()}if(n&2){let t=m.$implicit,e=s(2);l(2),h("src",e.getChannelLogo(t.TypeID),k),l(2),N(t.Name),l(2),b(t.Count!==void 0?6:7),l(3),h("routerLink",O(18,ot))("queryParams",P(19,it,t.ID)),l(),C(" ",_(11,11,t.SoldInChannel)," "),l(3),h("routerLink",O(21,at))("queryParams",P(22,it,t.ID)),l(),C(" ",_(15,13,t.NotInPOS)," "),l(3),C(" ",t.LastSync?z(18,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," "),l(4),h("ngxPermissionsOnly",P(24,rt,e.scanProductRole))}}function mt(n,m){if(n&1&&(i(0,"div",4)(1,"table",6)(2,"thead",7)(3,"tr",8)(4,"th",9),c(5,"Channel"),o(),i(6,"th",10),c(7," Live Product "),o(),i(8,"th",11),c(9," Sold In Channel "),o(),i(10,"th",12),c(11," Product Not in POS "),o(),i(12,"th",13),c(13,"Last Sync"),o(),p(14,"th",14),o()(),i(15,"tbody"),B(16,pt,25,26,"tr",null,$),u(18,"async"),o()()()),n&2){let t,e=s();l(16),A((t=_(18,0,e.channels$))==null?null:t.Data)}}function dt(n,m){n&1&&(i(0,"div",5),p(1,"app-empty-state"),o())}var Et=(()=>{class n{constructor(){this.productService=d(et),this.toastr=d(H),this.dialog=d(X),this.authService=d(K),this.cdr=d(R),this.channelOptions=I([]),this.scanProductRole=Q.ProductScan;let t=this.authService;this.destroy$=new D,this.channelOptions.set(t.getChannels())}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(v(this.destroy$)).subscribe(a=>{e.Count=a.Count})}onScanChannel(t){this.dialog.open(tt,{width:"700px",data:{channelOptions:this.channelOptions(),filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>M.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let a=this.productService.findChannelById(t,this.channelOptions());this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(r=>r)).subscribe(r=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(r,a,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(v(this.destroy$)).subscribe(a=>{this.toastr.success("Successfully cleared cache","Success"),this.channels$=null,this.setObsProductStatistic(),this.cdr.detectChanges()})}getChannelLogo(t){return M.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(e){return new(e||n)}}static{this.\u0275cmp=T({type:n,selectors:[["app-channel-statistic"]],decls:8,vars:5,consts:[["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"channel-col"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngxPermissionsOnly"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"]],template:function(e,a){if(e&1&&(i(0,"mainpanel",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div",3),w(5,mt,19,2,"div",4),u(6,"async"),L(7,dt,2,0,"div",5),o()()()()()),e&2){let r;h("hideSearchBox",!0)("hideSearchDropdown",!0),l(5),b(((r=_(6,3,a.channels$))==null||r.Data==null?null:r.Data.length)>0?5:7)}},dependencies:[Z,W,Y,J,G,nt,j,U,q],styles:["@media(max-width:991px){.container-fluid[_ngcontent-%COMP%]{padding:0 8px}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}[class*=col-][_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;flex:0 0 100%!important;margin-bottom:20px}.card[_ngcontent-%COMP%]{margin-bottom:20px;min-width:0}.card-title[_ngcontent-%COMP%]{font-size:1.2rem;margin-left:0!important;margin-top:0!important}.table-responsive[_ngcontent-%COMP%]{overflow-x:auto}table[_ngcontent-%COMP%]{font-size:13px;min-width:500px}th[_ngcontent-%COMP%], td[_ngcontent-%COMP%]{padding:6px 4px!important;word-break:break-word}.btn-sm[_ngcontent-%COMP%]{font-size:11px!important;padding:4px 8px!important}.mt-5[_ngcontent-%COMP%], .mt-6[_ngcontent-%COMP%], .my-6[_ngcontent-%COMP%], .ms-10[_ngcontent-%COMP%]{margin-top:12px!important;margin-bottom:12px!important;margin-left:0!important}th.channel-col[_ngcontent-%COMP%], td.channel-col[_ngcontent-%COMP%]{width:auto!important;min-width:100px!important;max-width:none!important;white-space:nowrap}}@media(max-width:600px){.container-fluid[_ngcontent-%COMP%]{padding:0 2px}.card-title[_ngcontent-%COMP%]{font-size:1rem}.table[_ngcontent-%COMP%]{font-size:12px}.card-body[_ngcontent-%COMP%]{padding:10px!important}.table-responsive[_ngcontent-%COMP%]{min-width:0}.btn-sm[_ngcontent-%COMP%]{min-width:60px;font-size:11px;padding:3px 6px!important}img[_ngcontent-%COMP%]{max-width:90%;height:auto}th.channel-col[_ngcontent-%COMP%], td.channel-col[_ngcontent-%COMP%]{width:auto!important;min-width:100px!important;max-width:none!important;white-space:nowrap}}"],changeDetection:0})}}return n})();export{Et as ChannelStatisticComponent};
@@ -1 +1 @@
1
- import{a as oe,b as le,c as pe}from"./chunk-DSBGQ5B7.js";import{a as me}from"./chunk-374BCHEH.js";import{a as T}from"./chunk-CLX6T6AB.js";import{a as de}from"./chunk-ZLMUYIKY.js";import{a as ae}from"./chunk-GIUK5WNF.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as re}from"./chunk-PGDBJOSL.js";import"./chunk-VYXSV6K4.js";import{a as ne}from"./chunk-EYHQ2ZKL.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as ie}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import{a as te}from"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as ee}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as Q,h as X,m as Y,o as Z,z as $}from"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as J,D as K,z as G}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as O,Hc as k,Ic as l,Jc as v,Kc as w,Mc as g,Nc as _,Oc as f,Pc as z,Qc as A,Rc as R,Vc as H,Wc as j,Xb as y,Xc as U,Zb as b,_b as W,ac as I,bc as B,cc as u,db as F,dc as t,ec as i,ed as x,fc as c,fd as V,gb as o,gd as q,ha as N,mc as E,oa as d,pa as m,rc as M,tc as h,yb as D}from"./chunk-5VYDZBNH.js";import{a as P,b as L}from"./chunk-QWWW7GFA.js";var se=()=>[],ce=r=>({"td-cell-hover":r});function ue(r,S){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function he(r,S){if(r&1&&c(0,"variant-with-image",32),r&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function ge(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=h().$implicit;o(),w("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function _e(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),c(14,"order-link",29),i(),t(15,"small"),l(16),x(17,"date"),i(),c(18,"br"),t(19,"small"),c(20,"i",30),l(21),i()()(),t(22,"td"),y(23,ue,1,1,"variants-dropdown",31)(24,he,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),x(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),y(33,ge,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),r&2){let e=S.$implicit;o(3),u("src",V(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(4),u("order",e),o(2),w(" ",q(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(5),w(" ",e.Customer," "),o(),k(U(21,ce,(e.Variants==null?null:e.Variants.length)>1)),o(),b((e.Variants==null?null:e.Variants.length)>1?23:24),o(3),v(V(27,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),o(2),w(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function fe(r,S){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th"),l(9,"Items"),i(),t(10,"th",21),l(11,"Amount"),i(),t(12,"th",22),l(13,"Shipping"),i()()(),t(14,"tbody"),I(15,_e,36,23,"tr",null,W),i()(),t(17,"app-custom-paginator",23),M("next",function(){d(e);let n=h();return m(n.initShippedOrders())})("previous",function(){d(e);let n=h();return m(n.initShippedOrders())}),i()()}if(r&2){let e=h(),p=R(0);o(15),B(p),o(2),u("filter",e.filter())("totaldata",p==null?null:p.length)}}function Se(r,S){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var ze=(()=>{class r{constructor(){this.orderService=N(T),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:void 0})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=D({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(p,n){if(p&1){let s=E();z(0),x(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return d(s),m(n.initShippedOrders())}),f("textChange",function(a){return d(s),_(n.filter().Number,a)||(n.filter().Number=a),m(a)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(a){return d(s),_(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),m(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return d(s),_(n.filter().From,a)||(n.filter().From=a),m(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return d(s),_(n.filter().To,a)||(n.filter().To=a),m(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return d(s),_(n.filter().PageNumber,a)||(n.filter().PageNumber=a),m(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return d(s),_(n.filter().PageSize,a)||(n.filter().PageSize=a),m(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,fe,18,2,"div",15)(33,Se,2,0,"div",16),i()()()()()}if(p&2){let s=A(V(1,8,n.shippedOrders$)||j(11,se));o(2),g("text",n.filter().Number),o(10),u("multiple",!0),g("ngModel",n.filter().ListChannelID),o(5),g("date",n.filter().From),o(2),g("date",n.filter().To),o(4),g("ngModel",n.filter().PageNumber),o(4),g("ngModel",n.filter().PageSize),o(5),b(s.length>0?32:33)}},dependencies:[ie,ne,re,$,Q,Z,X,Y,le,pe,de,te,ee,me,ae,oe,G,J,K],encapsulation:2,changeDetection:0})}}return r})();export{ze as ShippedComponent};
1
+ import{a as oe,b as le,c as pe}from"./chunk-DSBGQ5B7.js";import{a as me}from"./chunk-JLWYF6CA.js";import{a as T}from"./chunk-CLX6T6AB.js";import{a as de}from"./chunk-ZLMUYIKY.js";import{a as re}from"./chunk-PGDBJOSL.js";import{a as ae}from"./chunk-RBEQRGC3.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VYXSV6K4.js";import{a as ne}from"./chunk-EYHQ2ZKL.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as ie}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import{a as te}from"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as ee}from"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as Q,h as X,m as Y,o as Z,z as $}from"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as J,D as K,z as G}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as O,Hc as k,Ic as l,Jc as v,Kc as w,Mc as g,Nc as _,Oc as f,Pc as z,Qc as A,Rc as R,Vc as H,Wc as j,Xb as y,Xc as U,Zb as b,_b as W,ac as I,bc as B,cc as u,db as F,dc as t,ec as i,ed as x,fc as c,fd as V,gb as o,gd as q,ha as N,mc as E,oa as d,pa as m,rc as M,tc as h,yb as D}from"./chunk-5VYDZBNH.js";import{a as P,b as L}from"./chunk-QWWW7GFA.js";var se=()=>[],ce=r=>({"td-cell-hover":r});function ue(r,S){if(r&1&&c(0,"variants-dropdown",31),r&2){let e=h().$implicit;u("variants",e==null?null:e.Variants)}}function he(r,S){if(r&1&&c(0,"variant-with-image",32),r&2){let e=h().$implicit;u("variant",e==null?null:e.Variants[0])}}function ge(r,S){if(r&1&&(t(0,"span"),l(1),i()),r&2){let e=h().$implicit;o(),w("(",e.LogisticService==null?null:e.LogisticService.Option,")")}}function _e(r,S){if(r&1&&(t(0,"tr")(1,"td")(2,"div",24),c(3,"img",25),x(4,"channelImage"),t(5,"div",26)(6,"div"),l(7),i(),t(8,"small",27)(9,"span"),l(10),i()()()()(),t(11,"td")(12,"div",28)(13,"div"),c(14,"order-link",29),i(),t(15,"small"),l(16),x(17,"date"),i(),c(18,"br"),t(19,"small"),c(20,"i",30),l(21),i()()(),t(22,"td"),y(23,ue,1,1,"variants-dropdown",31)(24,he,1,1,"variant-with-image",32),i(),t(25,"td",33),l(26),x(27,"number"),i(),t(28,"td")(29,"div",28)(30,"div",34)(31,"span"),l(32),i(),y(33,ge,2,1,"span"),i(),t(34,"small"),l(35),i()()()()),r&2){let e=S.$implicit;o(3),u("src",V(4,14,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),o(4),v(e.Outlet),o(3),v(e.ChannelName),o(4),u("order",e),o(2),w(" ",q(17,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),o(5),w(" ",e.Customer," "),o(),k(U(21,ce,(e.Variants==null?null:e.Variants.length)>1)),o(),b((e.Variants==null?null:e.Variants.length)>1?23:24),o(3),v(V(27,19,e.Amount)),o(6),v(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),o(),b(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?33:-1),o(2),w(" ",e.ReferenceNumber?e.ReferenceNumber:"-"," ")}}function fe(r,S){if(r&1){let e=E();t(0,"div",15)(1,"table",17)(2,"thead",18)(3,"tr",19)(4,"th",20),l(5,"Outlet"),i(),t(6,"th",20),l(7,"Number"),i(),t(8,"th"),l(9,"Items"),i(),t(10,"th",21),l(11,"Amount"),i(),t(12,"th",22),l(13,"Shipping"),i()()(),t(14,"tbody"),I(15,_e,36,23,"tr",null,W),i()(),t(17,"app-custom-paginator",23),M("next",function(){d(e);let n=h();return m(n.initShippedOrders())})("previous",function(){d(e);let n=h();return m(n.initShippedOrders())}),i()()}if(r&2){let e=h(),p=R(0);o(15),B(p),o(2),u("filter",e.filter())("totaldata",p==null?null:p.length)}}function Se(r,S){r&1&&(t(0,"div",16),c(1,"app-empty-state"),i())}var ze=(()=>{class r{constructor(){this.orderService=N(T),this.filter=O({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:void 0})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}initFromDate(e){this.filter.update(p=>L(P({},p),{From:e})),this.initShippedOrders()}initShippedOrders(){this.shippedOrders$=this.orderService.getShippedOrders(this.filter())}static{this.\u0275fac=function(p){return new(p||r)}}static{this.\u0275cmp=D({type:r,selectors:[["app-shipped"]],features:[H([T])],decls:34,vars:12,consts:[["headerTitle","Shipped","searchBoxPlaceHolder","Order Number...",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-regular","fa-tv","me-3"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[1,"text-end",2,"width","100px"],[2,"width","80px"],["rowCountApi","/api/orders/shippedcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"lh-sm"],[2,"font-size","14px",3,"order"],[1,"fa-solid","fa-user"],[3,"variants"],[3,"variant"],[1,"text-end"],[1,"d-flex","align-items-end","gap-2"]],template:function(p,n){if(p&1){let s=E();z(0),x(1,"async"),t(2,"mainpanel",0),M("onSubmit",function(){return d(s),m(n.initShippedOrders())}),f("textChange",function(a){return d(s),_(n.filter().Number,a)||(n.filter().Number=a),m(a)}),t(3,"actions")(4,"a",1),c(5,"i",2),t(6,"span"),l(7,"Order Fulfillment Display"),i()()(),t(8,"filters")(9,"div")(10,"label",3),l(11,"Channel"),i(),t(12,"app-channel-options-v2",4),f("ngModelChange",function(a){return d(s),_(n.filter().ListChannelID,a)||(n.filter().ListChannelID=a),m(a)}),i()(),t(13,"div",5)(14,"label",3),l(15,"From/To"),i(),t(16,"div",6)(17,"datepicker",7),f("dateChange",function(a){return d(s),_(n.filter().From,a)||(n.filter().From=a),m(a)}),i()(),t(18,"div")(19,"datepicker",8),f("dateChange",function(a){return d(s),_(n.filter().To,a)||(n.filter().To=a),m(a)}),i()()(),t(20,"div",5)(21,"label",9),l(22,"Page Number"),i(),t(23,"input",10),f("ngModelChange",function(a){return d(s),_(n.filter().PageNumber,a)||(n.filter().PageNumber=a),m(a)}),i()(),t(24,"div",5)(25,"label",9),l(26,"Page Size"),i(),t(27,"input",11),f("ngModelChange",function(a){return d(s),_(n.filter().PageSize,a)||(n.filter().PageSize=a),m(a)}),i()()(),t(28,"content")(29,"div",12)(30,"div",13)(31,"div",14),y(32,fe,18,2,"div",15)(33,Se,2,0,"div",16),i()()()()()}if(p&2){let s=A(V(1,8,n.shippedOrders$)||j(11,se));o(2),g("text",n.filter().Number),o(10),u("multiple",!0),g("ngModel",n.filter().ListChannelID),o(5),g("date",n.filter().From),o(2),g("date",n.filter().To),o(4),g("ngModel",n.filter().PageNumber),o(4),g("ngModel",n.filter().PageSize),o(5),b(s.length>0?32:33)}},dependencies:[ie,ne,re,$,Q,Z,X,Y,le,pe,de,te,ee,me,ae,oe,G,J,K],encapsulation:2,changeDetection:0})}}return r})();export{ze as ShippedComponent};
@@ -1 +1 @@
1
- import"./chunk-QWWW7GFA.js";var o=[{path:"",loadComponent(){return import("./chunk-KU25KD46.js").then(t=>t.LoginComponent)},data:{title:"Dealpos x Marketplace"}},{path:"shopee",loadComponent(){return import("./chunk-WFZ7FTDK.js").then(t=>t.ShopeeAuthorizedComponent)},data:{title:"Success"}},{path:"tiktok",loadComponent(){return import("./chunk-TWCWB2SP.js").then(t=>t.TiktokComponent)},data:{title:"Success"}},{path:"lazada",loadComponent(){return import("./chunk-QGI2NKDM.js").then(t=>t.LazadaComponent)},data:{title:"Success"}},{path:"shopify",loadComponent(){return import("./chunk-34GI32CQ.js").then(t=>t.ShopifyAuthorizedComponent)},data:{title:"Success"}}];export{o as routes};
1
+ import"./chunk-QWWW7GFA.js";var o=[{path:"",loadComponent(){return import("./chunk-EAAWYMGM.js").then(t=>t.LoginComponent)},data:{title:"Dealpos x Marketplace"}},{path:"shopee",loadComponent(){return import("./chunk-WFZ7FTDK.js").then(t=>t.ShopeeAuthorizedComponent)},data:{title:"Success"}},{path:"tiktok",loadComponent(){return import("./chunk-TWCWB2SP.js").then(t=>t.TiktokComponent)},data:{title:"Success"}},{path:"lazada",loadComponent(){return import("./chunk-QGI2NKDM.js").then(t=>t.LazadaComponent)},data:{title:"Success"}},{path:"shopify",loadComponent(){return import("./chunk-34GI32CQ.js").then(t=>t.ShopifyAuthorizedComponent)},data:{title:"Success"}}];export{o as routes};
@@ -1 +1 @@
1
- import{a as e}from"./chunk-7UMGEXVB.js";import{a as d}from"./chunk-7KBF6RRT.js";import"./chunk-CBPURQKN.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-ZE4OOGMT.js";import{c as m}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as a,cc as l,dc as p,ec as c,fc as o,gb as r,yb as i}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var h=(()=>{class t{constructor(){this.ObjectlogTabs=a([{Title:"Inventory Sync Log",Url:"/menu/log/inventory"},{Title:"Channel Push Log Exception",Url:"/menu/log/exception"},{Title:"Channel Push Log",Url:"/menu/log/rawlog"},{Title:"POS Sync Order Log",Url:"/menu/log/order"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"},{Title:"Flush Cache ",Url:"/menu/log/flush-cache"}])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=i({type:t,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,s){n&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),c()()(),o(4,"router-outlet")),n&2&&(r(3),l("Tabs",s.ObjectlogTabs()))},dependencies:[d,m],encapsulation:2,changeDetection:0})}}return t})();var T=[{path:"",component:h,children:[{path:"",redirectTo:"inventory",pathMatch:"full"},{path:"order",loadComponent(){return import("./chunk-QJQSPF5R.js").then(t=>t.OrderComponent)},canActivate:[e],data:{title:"Order Log"}},{path:"inventory/sync-inventory",loadComponent(){return import("./chunk-TN52KDYF.js").then(t=>t.InventoryLogComponent)},canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"rawlog",loadComponent(){return import("./chunk-XTW5WVBF.js").then(t=>t.RawLogComponent)},canActivate:[e],data:{title:"Raw Log"}},{path:"rawlog/detail",loadComponent(){return import("./chunk-APE7ONZY.js").then(t=>t.RawDetailComponent)},canActivate:[e],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",loadComponent(){return import("./chunk-BHGCKC7N.js").then(t=>t.InventoryDetailComponent)},canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",loadComponent(){return import("./chunk-K7JKPYCX.js").then(t=>t.OrderdetailComponent)},canActivate:[e],data:{title:"Order Details"}},{path:"order/detail-user",loadComponent(){return import("./chunk-FKNJBXAN.js").then(t=>t.OrderdetailUserComponent)},canActivate:[e],data:{title:"Order User Details"}},{path:"exception",loadComponent(){return import("./chunk-XK76S2DI.js").then(t=>t.ExceptionLogComponent)},canActivate:[e],data:{title:"Exception Log"}},{path:"exception/detail",loadComponent(){return import("./chunk-VWMH26LX.js").then(t=>t.ExceptionDetailComponent)},canActivate:[e],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-I2MBDGML.js").then(t=>t.InventoryAsyncLogComponent),canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-4DEBQV7M.js").then(t=>t.InventoryAsyncDetailComponent),canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-GHEWEE5Q.js").then(t=>t.ChannelLogComponent)},canActivate:[e],data:{title:"Authorization Log"}},{path:"flush-cache",loadComponent(){return import("./chunk-7ZFJU2UX.js").then(t=>t.FlushCacheComponent)},canActivate:[e],data:{title:"Flush Cache"}}]}];export{T as routes};
1
+ import{a as e}from"./chunk-RH62JCAG.js";import{a as d}from"./chunk-7KBF6RRT.js";import"./chunk-CBPURQKN.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-ZE4OOGMT.js";import{c as m}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as a,cc as l,dc as p,ec as c,fc as o,gb as r,yb as i}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var h=(()=>{class t{constructor(){this.ObjectlogTabs=a([{Title:"Inventory Sync Log",Url:"/menu/log/inventory"},{Title:"Channel Push Log Exception",Url:"/menu/log/exception"},{Title:"Channel Push Log",Url:"/menu/log/rawlog"},{Title:"POS Sync Order Log",Url:"/menu/log/order"},{Title:"Authorization Log ",Url:"/menu/log/authorization-log"},{Title:"Flush Cache ",Url:"/menu/log/flush-cache"}])}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=i({type:t,selectors:[["app-logs"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,s){n&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),c()()(),o(4,"router-outlet")),n&2&&(r(3),l("Tabs",s.ObjectlogTabs()))},dependencies:[d,m],encapsulation:2,changeDetection:0})}}return t})();var T=[{path:"",component:h,children:[{path:"",redirectTo:"inventory",pathMatch:"full"},{path:"order",loadComponent(){return import("./chunk-Z2UK6C26.js").then(t=>t.OrderComponent)},canActivate:[e],data:{title:"Order Log"}},{path:"inventory/sync-inventory",loadComponent(){return import("./chunk-SRN7IBV7.js").then(t=>t.InventoryLogComponent)},canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"rawlog",loadComponent(){return import("./chunk-BJ4PF3IX.js").then(t=>t.RawLogComponent)},canActivate:[e],data:{title:"Raw Log"}},{path:"rawlog/detail",loadComponent(){return import("./chunk-APE7ONZY.js").then(t=>t.RawDetailComponent)},canActivate:[e],data:{title:"Raw Log Detail"}},{path:"inventory/sync-inventory/detail",loadComponent(){return import("./chunk-BHGCKC7N.js").then(t=>t.InventoryDetailComponent)},canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"order/detail",loadComponent(){return import("./chunk-K7JKPYCX.js").then(t=>t.OrderdetailComponent)},canActivate:[e],data:{title:"Order Details"}},{path:"order/detail-user",loadComponent(){return import("./chunk-FKNJBXAN.js").then(t=>t.OrderdetailUserComponent)},canActivate:[e],data:{title:"Order User Details"}},{path:"exception",loadComponent(){return import("./chunk-7TZMLIVI.js").then(t=>t.ExceptionLogComponent)},canActivate:[e],data:{title:"Exception Log"}},{path:"exception/detail",loadComponent(){return import("./chunk-RDD27FVJ.js").then(t=>t.ExceptionDetailComponent)},canActivate:[e],data:{title:"Exception Log Detail"}},{path:"inventory",loadComponent:()=>import("./chunk-I2MBDGML.js").then(t=>t.InventoryAsyncLogComponent),canActivate:[e],data:{title:"Product Inventory Sync"}},{path:"inventory/detail",loadComponent:()=>import("./chunk-4DEBQV7M.js").then(t=>t.InventoryAsyncDetailComponent),canActivate:[e],data:{title:"Product Inventory Sync Detail"}},{path:"authorization-log",loadComponent(){return import("./chunk-YVCOOQHK.js").then(t=>t.ChannelLogComponent)},canActivate:[e],data:{title:"Authorization Log"}},{path:"flush-cache",loadComponent(){return import("./chunk-7ZFJU2UX.js").then(t=>t.FlushCacheComponent)},canActivate:[e],data:{title:"Flush Cache"}}]}];export{T as routes};
@@ -1 +1 @@
1
- import{a as q}from"./chunk-A46ZW26C.js";import{a as z}from"./chunk-GIUK5WNF.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as j}from"./chunk-PGDBJOSL.js";import{a as Z}from"./chunk-VYXSV6K4.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as H}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as y}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{h as W,m as $,z as G}from"./chunk-7HUEGPJN.js";import{e as R}from"./chunk-ZE4OOGMT.js";import{e as F,g as O}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as N,z as A}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as V,Ic as a,Jc as g,Mc as K,Nc as T,Oc as P,Pc as B,S as D,Xb as k,Zb as U,_b as I,ac as E,bc as L,cc as d,db as b,dc as e,ec as t,ed as w,fc as c,fd as v,gb as l,ha as f,mc as x,oa as m,pa as u,rc as S,tc as _,yb as M}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function J(o,h){if(o&1){let i=x();e(0,"img",21),S("click",function(r){m(i);let n=_().$implicit,s=_();return u(s.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=_().$implicit;d("src",i==null?null:i.ThumbnailUrl,b)}}function Q(o,h){o&1&&c(0,"img",17)}function X(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,J,1,1,"img",16)(4,Q,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),d("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var he=(()=>{class o{constructor(){this.httpService=f(R),this.biggerPictureService=f(Z),this.filter=V({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(D(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=M({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),S("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),P("ngModelChange",function(C){return m(n),T(r.filter().ListChannelID,C)||(r.filter().ListChannelID=C),u(C)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,X,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),S("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),d("hideSearchBox",!0),l(10),d("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),d("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[H,j,O,F,q,z,G,W,$,A,N],encapsulation:2,changeDetection:0})}}return o})();export{he as DuplicateSkuV2Component};
1
+ import{a as q}from"./chunk-A46ZW26C.js";import{a as j}from"./chunk-PGDBJOSL.js";import{a as z}from"./chunk-RBEQRGC3.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as Z}from"./chunk-VYXSV6K4.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as H}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as y}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{h as W,m as $,z as G}from"./chunk-7HUEGPJN.js";import{e as R}from"./chunk-ZE4OOGMT.js";import{e as F,g as O}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as N,z as A}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as V,Ic as a,Jc as g,Mc as K,Nc as T,Oc as P,Pc as B,S as D,Xb as k,Zb as U,_b as I,ac as E,bc as L,cc as d,db as b,dc as e,ec as t,ed as w,fc as c,fd as v,gb as l,ha as f,mc as x,oa as m,pa as u,rc as S,tc as _,yb as M}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function J(o,h){if(o&1){let i=x();e(0,"img",21),S("click",function(r){m(i);let n=_().$implicit,s=_();return u(s.onZoomImage(r,n==null?null:n.ImageUrl))}),t()}if(o&2){let i=_().$implicit;d("src",i==null?null:i.ThumbnailUrl,b)}}function Q(o,h){o&1&&c(0,"img",17)}function X(o,h){if(o&1&&(e(0,"tr")(1,"td")(2,"div",15),k(3,J,1,1,"img",16)(4,Q,1,0,"img",17),t()(),e(5,"td"),a(6),t(),e(7,"td"),a(8),t(),e(9,"td")(10,"div",18),c(11,"app-channel-logo",19),e(12,"span"),a(13),t()()(),e(14,"td",20),a(15),w(16,"number"),t()()),o&2){let i=h.$implicit;l(3),U(i.ImageUrl?3:4),l(3),g(i.Name),l(2),g(i.SKU),l(3),d("typeId",i.TypeID),l(2),g(i.ChannelName),l(2),g(v(16,6,i.Count))}}var he=(()=>{class o{constructor(){this.httpService=f(R),this.biggerPictureService=f(Z),this.filter=V({PageNumber:1,RowCount:20,ListChannelID:[]}),this.rowCountApi=y.GetMultilistingSKUCount,this.initMultipleListingSKU()}initMultipleListingSKU(){this.multipleListingSKU$=this.httpService.post(y.GetMultiListingSKU,this.filter()).pipe(D(1))}onZoomImage(i,p){this.biggerPictureService.openBiggerPicture(i,p)}static{this.\u0275fac=function(p){return new(p||o)}}static{this.\u0275cmp=M({type:o,selectors:[["app-duplicate-sku-v2"]],decls:33,vars:8,consts:[["headerTitle","Duplicate SKU","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit","hideSearchBox"],["routerLink","/menu/products/status/duplicate-sku",1,"d-flex","align-items-center","gap-2","btn","btn-outline-secondary","btn-lg"],[1,"fa-solid","fa-credit-card"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","40px"],[2,"width","200px"],[2,"width","250px"],[1,"text-end",2,"width","50px"],[3,"next","previous","filter","totaldata","rowCountApi"],[2,"padding-right","0px"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],[1,"d-flex","align-items-center"],[3,"typeId"],[1,"text-end"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"]],template:function(p,r){if(p&1){let n=x();B(0),w(1,"async"),e(2,"mainpanel",0),S("onSubmit",function(){return m(n),u(r.initMultipleListingSKU())}),e(3,"actions")(4,"a",1),c(5,"i",2),e(6,"span"),a(7,"Card View"),t()()(),e(8,"filters")(9,"div")(10,"label",3),a(11,"Channel"),t(),e(12,"app-channel-options-v2",4),P("ngModelChange",function(C){return m(n),T(r.filter().ListChannelID,C)||(r.filter().ListChannelID=C),u(C)}),t()()(),e(13,"content")(14,"div",5)(15,"div",6)(16,"div",7)(17,"table",8)(18,"thead",9)(19,"tr"),c(20,"th",10),e(21,"th"),a(22,"Product"),t(),e(23,"th",11),a(24,"SKU"),t(),e(25,"th",12),a(26,"Channel"),t(),e(27,"th",13),a(28,"Count"),t()()(),e(29,"tbody"),E(30,X,17,8,"tr",null,I),t()(),e(32,"app-custom-paginator",14),S("next",function(){return m(n),u(r.initMultipleListingSKU())})("previous",function(){return m(n),u(r.initMultipleListingSKU())}),t()()()()()()}if(p&2){let n=v(1,6,r.multipleListingSKU$);l(2),d("hideSearchBox",!0),l(10),d("multiple",!0),K("ngModel",r.filter().ListChannelID),l(18),L(n==null?null:n.Data),l(2),d("filter",r.filter())("totaldata",n==null||n.Data==null?null:n.Data.length)("rowCountApi",r.rowCountApi)}},dependencies:[H,j,O,F,q,z,G,W,$,A,N],encapsulation:2,changeDetection:0})}}return o})();export{he as DuplicateSkuV2Component};
@@ -1,2 +1,2 @@
1
- import{a as Ot,b as Dt,c as At}from"./chunk-DSBGQ5B7.js";import{a as Et}from"./chunk-374BCHEH.js";import{a as j}from"./chunk-CLX6T6AB.js";import{a as Tt}from"./chunk-ZLMUYIKY.js";import{a as Pt}from"./chunk-GIUK5WNF.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import{a as Mt}from"./chunk-PGDBJOSL.js";import"./chunk-VYXSV6K4.js";import{a as St}from"./chunk-EYHQ2ZKL.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as wt}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import{a as I,b as V,c as xt,j as F}from"./chunk-TFTF5VH3.js";import{a as yt}from"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as vt}from"./chunk-KMY7VNWE.js";import{D as ut}from"./chunk-NMXGNJWD.js";import"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as ft,h as ht,m as _t,o as Ct,z as bt}from"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{A as pt,B as gt,D as k,u as ct,z as st}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as U,Eb as B,Fc as it,Hc as nt,Ic as o,Jc as S,Kc as T,Lc as L,Mc as M,Nc as P,Oc as O,Pc as at,Qc as rt,Rc as ot,S as G,Vc as lt,Wc as dt,Xb as x,Xc as D,Yb as Q,Zb as w,_b as Y,ac as Z,bc as $,cc as u,da as X,db as q,dc as i,ec as a,ed as C,fa as K,fc as c,fd as A,gb as l,gd as E,ha as _,mc as b,md as mt,oa as s,pa as p,rc as h,tc as f,uc as tt,vc as et,yb as y,zb as J}from"./chunk-5VYDZBNH.js";import{a as W,b as H}from"./chunk-QWWW7GFA.js";var Ft=["*"];var Nt=new K("MAT_CARD_CONFIG"),N=(()=>{class n{appearance;constructor(){let e=_(Nt,{optional:!0});this.appearance=e?.appearance||"raised"}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=y({type:n,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:8,hostBindings:function(r,t){r&2&&it("mat-mdc-card-outlined",t.appearance==="outlined")("mdc-card--outlined",t.appearance==="outlined")("mat-mdc-card-filled",t.appearance==="filled")("mdc-card--filled",t.appearance==="filled")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:Ft,decls:1,vars:0,template:function(r,t){r&1&&(tt(),et(0))},styles:[`.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-elevated-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mat-card-outlined-container-color, var(--mat-sys-surface));border-radius:var(--mat-card-outlined-container-shape, var(--mat-sys-corner-medium));border-width:var(--mat-card-outlined-outline-width, 1px);border-color:var(--mat-card-outlined-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mat-card-outlined-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mat-mdc-card-filled{background-color:var(--mat-card-filled-container-color, var(--mat-sys-surface-container-highest));border-radius:var(--mat-card-filled-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-filled-container-elevation, var(--mat-sys-level0))}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}
1
+ import{a as Ot,b as Dt,c as At}from"./chunk-DSBGQ5B7.js";import{a as Et}from"./chunk-JLWYF6CA.js";import{a as j}from"./chunk-CLX6T6AB.js";import{a as Tt}from"./chunk-ZLMUYIKY.js";import{a as Mt}from"./chunk-PGDBJOSL.js";import{a as Pt}from"./chunk-RBEQRGC3.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VYXSV6K4.js";import{a as St}from"./chunk-EYHQ2ZKL.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{b as wt}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import{a as I,b as V,c as xt,j as F}from"./chunk-TFTF5VH3.js";import{a as yt}from"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-7LEHDN2Q.js";import"./chunk-3OTK6GG2.js";import"./chunk-KFJBIBDQ.js";import{b as vt}from"./chunk-KMY7VNWE.js";import{D as ut}from"./chunk-NMXGNJWD.js";import"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as ft,h as ht,m as _t,o as Ct,z as bt}from"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{A as pt,B as gt,D as k,u as ct,z as st}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as U,Eb as B,Fc as it,Hc as nt,Ic as o,Jc as S,Kc as T,Lc as L,Mc as M,Nc as P,Oc as O,Pc as at,Qc as rt,Rc as ot,S as G,Vc as lt,Wc as dt,Xb as x,Xc as D,Yb as Q,Zb as w,_b as Y,ac as Z,bc as $,cc as u,da as X,db as q,dc as i,ec as a,ed as C,fa as K,fc as c,fd as A,gb as l,gd as E,ha as _,mc as b,md as mt,oa as s,pa as p,rc as h,tc as f,uc as tt,vc as et,yb as y,zb as J}from"./chunk-5VYDZBNH.js";import{a as W,b as H}from"./chunk-QWWW7GFA.js";var Ft=["*"];var Nt=new K("MAT_CARD_CONFIG"),N=(()=>{class n{appearance;constructor(){let e=_(Nt,{optional:!0});this.appearance=e?.appearance||"raised"}static \u0275fac=function(r){return new(r||n)};static \u0275cmp=y({type:n,selectors:[["mat-card"]],hostAttrs:[1,"mat-mdc-card","mdc-card"],hostVars:8,hostBindings:function(r,t){r&2&&it("mat-mdc-card-outlined",t.appearance==="outlined")("mdc-card--outlined",t.appearance==="outlined")("mat-mdc-card-filled",t.appearance==="filled")("mdc-card--filled",t.appearance==="filled")},inputs:{appearance:"appearance"},exportAs:["matCard"],ngContentSelectors:Ft,decls:1,vars:0,template:function(r,t){r&1&&(tt(),et(0))},styles:[`.mat-mdc-card{display:flex;flex-direction:column;box-sizing:border-box;position:relative;border-style:solid;border-width:0;background-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-color:var(--mat-card-elevated-container-color, var(--mat-sys-surface-container-low));border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-elevated-container-elevation, var(--mat-sys-level1))}.mat-mdc-card::after{position:absolute;top:0;left:0;width:100%;height:100%;border:solid 1px rgba(0,0,0,0);content:"";display:block;pointer-events:none;box-sizing:border-box;border-radius:var(--mat-card-elevated-container-shape, var(--mat-sys-corner-medium))}.mat-mdc-card-outlined{background-color:var(--mat-card-outlined-container-color, var(--mat-sys-surface));border-radius:var(--mat-card-outlined-container-shape, var(--mat-sys-corner-medium));border-width:var(--mat-card-outlined-outline-width, 1px);border-color:var(--mat-card-outlined-outline-color, var(--mat-sys-outline-variant));box-shadow:var(--mat-card-outlined-container-elevation, var(--mat-sys-level0))}.mat-mdc-card-outlined::after{border:none}.mat-mdc-card-filled{background-color:var(--mat-card-filled-container-color, var(--mat-sys-surface-container-highest));border-radius:var(--mat-card-filled-container-shape, var(--mat-sys-corner-medium));box-shadow:var(--mat-card-filled-container-elevation, var(--mat-sys-level0))}.mdc-card__media{position:relative;box-sizing:border-box;background-repeat:no-repeat;background-position:center;background-size:cover}.mdc-card__media::before{display:block;content:""}.mdc-card__media:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.mdc-card__media:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.mat-mdc-card-actions{display:flex;flex-direction:row;align-items:center;box-sizing:border-box;min-height:52px;padding:8px}.mat-mdc-card-title{font-family:var(--mat-card-title-text-font, var(--mat-sys-title-large-font));line-height:var(--mat-card-title-text-line-height, var(--mat-sys-title-large-line-height));font-size:var(--mat-card-title-text-size, var(--mat-sys-title-large-size));letter-spacing:var(--mat-card-title-text-tracking, var(--mat-sys-title-large-tracking));font-weight:var(--mat-card-title-text-weight, var(--mat-sys-title-large-weight))}.mat-mdc-card-subtitle{color:var(--mat-card-subtitle-text-color, var(--mat-sys-on-surface));font-family:var(--mat-card-subtitle-text-font, var(--mat-sys-title-medium-font));line-height:var(--mat-card-subtitle-text-line-height, var(--mat-sys-title-medium-line-height));font-size:var(--mat-card-subtitle-text-size, var(--mat-sys-title-medium-size));letter-spacing:var(--mat-card-subtitle-text-tracking, var(--mat-sys-title-medium-tracking));font-weight:var(--mat-card-subtitle-text-weight, var(--mat-sys-title-medium-weight))}.mat-mdc-card-title,.mat-mdc-card-subtitle{display:block;margin:0}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle{padding:16px 16px 0}.mat-mdc-card-header{display:flex;padding:16px 16px 0}.mat-mdc-card-content{display:block;padding:0 16px}.mat-mdc-card-content:first-child{padding-top:16px}.mat-mdc-card-content:last-child{padding-bottom:16px}.mat-mdc-card-title-group{display:flex;justify-content:space-between;width:100%}.mat-mdc-card-avatar{height:40px;width:40px;border-radius:50%;flex-shrink:0;margin-bottom:16px;object-fit:cover}.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-avatar~.mat-mdc-card-header-text .mat-mdc-card-title{line-height:normal}.mat-mdc-card-sm-image{width:80px;height:80px}.mat-mdc-card-md-image{width:112px;height:112px}.mat-mdc-card-lg-image{width:152px;height:152px}.mat-mdc-card-xl-image{width:240px;height:240px}.mat-mdc-card-subtitle~.mat-mdc-card-title,.mat-mdc-card-title~.mat-mdc-card-subtitle,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-title,.mat-mdc-card-header .mat-mdc-card-header-text .mat-mdc-card-subtitle,.mat-mdc-card-title-group .mat-mdc-card-title,.mat-mdc-card-title-group .mat-mdc-card-subtitle{padding-top:0}.mat-mdc-card-content>:last-child:not(.mat-mdc-card-footer){margin-bottom:0}.mat-mdc-card-actions-align-end{justify-content:flex-end}
2
2
  `],encapsulation:2,changeDetection:0})}return n})();var z=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=J({type:n});static \u0275inj=X({imports:[ut]})}return n})();var zt=n=>({title:n,hideFooter:!1,hideClose:!1,customWidth:"420px",headerClass:"custom-green-header",validated:!0,hideCancel:!0,hideOk:!0});function Bt(n,g){n&1&&(i(0,"mat-card",4)(1,"div",9),c(2,"i",10),i(3,"span"),o(4,"Mismatch detected! Press Sync to synchronize statuses"),a()()())}function Lt(n,g){n&1&&(i(0,"mat-card",5)(1,"div",9),c(2,"i",11),i(3,"span"),o(4,"POS and Channel statuses match. No action needed."),a()()())}function jt(n,g){if(n&1){let e=b();i(0,"button",12),h("click",function(){s(e);let t=f();return p(t.onSync())}),o(1," Sync "),a()}}var It=(()=>{class n{constructor(){this.dialogRef=_(I),this.data=_(V),this.isMismatch=mt(()=>this.data?.POSStatus!==this.data?.ChannelStatus)}onClose(){this.dialogRef.close()}onSync(){this.dialogRef.close("sync")}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=y({type:n,selectors:[["preview-order-status-dialog"]],decls:22,vars:9,consts:[[3,"onCancel","config"],["content",""],[1,"table","table-bordered","align-middle","-mb-4"],[1,"text-center"],[1,"mt-3","-mb-4","warning-card"],[1,"mt-3","-mb-4","success-card"],["footer","",1,"d-flex","justify-content-end","-mt-3"],["type","button",1,"btn","btn-secondary","btn-lg","mx-3","py-5","mr-2",3,"click"],["type","button",1,"btn","btn-outline-primary","btn-lg","fw-bold","mx-3","py-5","mr-2"],[1,"d-flex","align-items-center"],[1,"fas","fa-exclamation-triangle","me-2"],[1,"fas","fa-check","me-2"],["type","button",1,"btn","btn-outline-primary","btn-lg","fw-bold","mx-3","py-5","mr-2",3,"click"]],template:function(r,t){r&1&&(i(0,"modal-material",0),h("onCancel",function(){return t.onClose()}),i(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3),o(6,"POS Status"),a(),i(7,"th",3),o(8,"Channel Status"),a()()(),i(9,"tbody")(10,"tr")(11,"td",3),o(12),a(),i(13,"td",3),o(14),a()()()(),c(15,"br"),x(16,Bt,5,0,"mat-card",4)(17,Lt,5,0,"mat-card",5),a(),i(18,"div",6)(19,"button",7),h("click",function(){return t.onClose()}),o(20," Close "),a(),x(21,jt,2,0,"button",8),a()()),r&2&&(u("config",D(7,zt,(t.data==null?null:t.data.Number)+" - Order Status")),l(12),L("(",t.data==null?null:t.data.POSStatus,") - ",t.data==null?null:t.data.POSStatusDescription),l(2),L("(",t.data==null?null:t.data.ChannelStatus,") - ",t.data==null?null:t.data.ChannelStatusDescription),l(2),w(t.isMismatch()?16:17),l(5),w(t.isMismatch()?21:-1))},dependencies:[F,z,N],styles:[".mat-mdc-dialog-title, .mdc-dialog__title{background-color:#89b03e;color:#fff}.warning-card[_ngcontent-%COMP%]{background-color:#fff3cd;color:#856404;border:1px solid #ffeeba;padding:14px 16px;border-radius:4px;font-weight:500;display:flex;align-items:left;gap:6px}.success-card[_ngcontent-%COMP%]{background-color:#89b03e;color:#fff;border:1px solid #89B03E;padding:14px 16px;border-radius:4px;font-weight:500;display:flex;align-items:left;gap:6px}thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#f2f2f2}"],changeDetection:0})}}return n})();var Rt=n=>({title:n,hideFooter:!1,hideClose:!1,customWidth:"420px",headerClass:"custom-green-header",validated:!0,hideCancel:!0,hideOk:!0});function Wt(n,g){n&1&&(i(0,"mat-card",9)(1,"div",10),c(2,"i",11),i(3,"span"),o(4,"Amount mismatch detected between POS total and channel escrow balance."),a()()())}function Ht(n,g){n&1&&(i(0,"mat-card",12)(1,"div",10),c(2,"i",13),i(3,"span"),o(4,"POS amount and channel escrow balance match. No action needed."),a()()())}function Gt(n,g){if(n&1){let e=b();i(0,"button",14),h("click",function(){s(e);let t=f();return p(t.onSync())}),o(1," Sync "),a()}}var Vt=(()=>{class n{constructor(){this.dialogRef=_(I),this.data=_(V)}onClose(){this.dialogRef.close()}get isMismatch(){return this.data?.POSAmount!==this.data?.EscrowAmount}onSync(){this.dialogRef.close("sync")}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=y({type:n,selectors:[["preview-payment-amounts-dialog"]],decls:24,vars:14,consts:[[3,"onCancel","config"],["content",""],[1,"table","table-bordered","align-middle","-mb-4"],[1,"text-center"],["class","mt-3 -mb-4 warning-card",4,"ngIf"],["class","mt-3 -mb-4 success-card",4,"ngIf"],["footer","",1,"d-flex","justify-content-end","-mt-3"],["type","button",1,"btn","btn-secondary","btn-lg","mx-3","py-5","mr-2",3,"click"],["type","button","class","btn btn-outline-primary btn-lg fw-bold mx-3 py-5 mr-2",3,"click",4,"ngIf"],[1,"mt-3","-mb-4","warning-card"],[1,"d-flex","align-items-center"],[1,"fas","fa-exclamation-triangle","me-2"],[1,"mt-3","-mb-4","success-card"],[1,"fas","fa-check","me-2"],["type","button",1,"btn","btn-outline-primary","btn-lg","fw-bold","mx-3","py-5","mr-2",3,"click"]],template:function(r,t){r&1&&(i(0,"modal-material",0),h("onCancel",function(){return t.onClose()}),i(1,"div",1)(2,"table",2)(3,"thead")(4,"tr")(5,"th",3),o(6,"POS Amount"),a(),i(7,"th",3),o(8,"Escrow Balance"),a()()(),i(9,"tbody")(10,"tr")(11,"td",3),o(12),C(13,"number"),a(),i(14,"td",3),o(15),C(16,"number"),a()()()(),c(17,"br"),B(18,Wt,5,0,"mat-card",4)(19,Ht,5,0,"mat-card",5),a(),i(20,"div",6)(21,"button",7),h("click",function(){return t.onClose()}),o(22," Close "),a(),B(23,Gt,2,0,"button",8),a()()),r&2&&(u("config",D(12,Rt,(t.data==null?null:t.data.Number)+" - Payment Amounts")),l(12),T(" ",E(13,6,t.data==null?null:t.data.POSAmount,"1.2-2")," "),l(3),T(" ",E(16,9,t.data==null?null:t.data.EscrowAmount,"1.2-2")," "),l(3),u("ngIf",t.isMismatch),l(),u("ngIf",!t.isMismatch),l(4),u("ngIf",t.isMismatch))},dependencies:[F,z,N,ct,k],styles:[".mat-mdc-dialog-title, .mdc-dialog__title{background-color:#89b03e;color:#fff}.warning-card[_ngcontent-%COMP%]{background-color:#fff3cd;color:#856404;border:1px solid #ffeeba;padding:14px 16px;border-radius:4px;font-weight:500;display:flex;align-items:left;gap:6px}.success-card[_ngcontent-%COMP%]{background-color:#89b03e;color:#fff;border:1px solid #89B03E;padding:14px 16px;border-radius:4px;font-weight:500;display:flex;align-items:left;gap:6px}thead[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]{background-color:#f2f2f2}"]})}}return n})();var Xt=()=>[],Kt=n=>({"td-cell-hover":n});function Ut(n,g){if(n&1&&(i(0,"small"),o(1),a()),n&2){let e=f().$implicit;l(),S(e.ReferenceNumber)}}function qt(n,g){n&1&&(i(0,"small")(1,"a",45),o(2,"Update Tracking No."),a()())}function Jt(n,g){if(n&1&&c(0,"variants-dropdown",34),n&2){let e=f().$implicit;u("variants",e==null?null:e.Variants)}}function Qt(n,g){if(n&1&&c(0,"variant-with-image",35),n&2){let e=f().$implicit;u("variant",e==null?null:e.Variants[0])}}function Yt(n,g){if(n&1){let e=b();i(0,"a",46),h("click",function(){s(e);let t=f().$implicit,d=f(2);return p(d.onPaymentStatusSync(t))}),o(1,"Payment Status Sync"),a()}}function Zt(n,g){n&1&&(i(0,"a",43)(1,"span"),o(2,"Payment Status Sync"),a(),c(3,"br"),i(4,"small",47),c(5,"i",48),o(6,"Can only work for completed orders "),a()())}function $t(n,g){if(n&1){let e=b();i(0,"tr")(1,"td")(2,"div",25),c(3,"img",26),C(4,"channelImage"),i(5,"div",27)(6,"div"),o(7),a(),i(8,"small",28)(9,"span"),o(10),a()(),i(11,"small"),c(12,"i",29),o(13),a()()()(),i(14,"td")(15,"div",30)(16,"div"),c(17,"i",31)(18,"order-link",32),a(),i(19,"div"),c(20,"i",33),x(21,Ut,2,1,"small")(22,qt,3,0,"small"),a(),i(23,"small"),o(24),C(25,"date"),a()()(),i(26,"td"),x(27,Jt,1,1,"variants-dropdown",34)(28,Qt,1,1,"variant-with-image",35),a(),i(29,"td"),o(30),C(31,"number"),a(),i(32,"td",36),o(33),a(),i(34,"td")(35,"div",37)(36,"button",38),c(37,"i",39),o(38," Sync "),a(),i(39,"ul",40)(40,"li")(41,"a",41),h("click",function(){let t=s(e).$implicit,d=f(2);return p(d.onDownloadPreview(t))}),o(42,"Order Status Sync"),a()(),i(43,"li"),x(44,Yt,2,0,"a",42),C(45,"lowercase"),C(46,"lowercase"),Q(47,Zt,7,0,"a",43),a(),i(48,"li")(49,"a",44),o(50,"Tracking Number Sync (Coming Soon!)"),a()()()()()()}if(n&2){let e=g.$implicit;l(3),u("src",A(4,14,e==null?null:e.MarketType),q)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),l(4),S(e.Outlet),l(3),S(e.ChannelName),l(3),T(" ",e.Customer," "),l(5),u("order",e),l(3),w(e.ReferenceNumber?21:22),l(3),S(E(25,16,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")),l(2),nt(D(25,Kt,(e.Variants==null?null:e.Variants.length)>1)),l(),w((e.Variants==null?null:e.Variants.length)>1?27:28),l(3),S(A(31,19,e.Amount)),l(3),S(e.Status),l(11),w(A(45,21,e.Payment)==="paid"||A(46,23,e.Payment)==="settled"?44:47)}}function te(n,g){if(n&1){let e=b();i(0,"div",14)(1,"table",16)(2,"thead",17)(3,"tr",18)(4,"th",19),o(5,"Outlet"),a(),i(6,"th",20),o(7,"Number"),a(),i(8,"th"),o(9,"Items"),a(),i(10,"th",21),o(11,"Amount"),a(),i(12,"th",22),o(13,"Order Status"),a(),c(14,"th",23),a()(),i(15,"tbody"),Z(16,$t,51,27,"tr",null,Y),a()(),i(18,"app-custom-paginator",24),h("next",function(){s(e);let t=f();return p(t.initAllOrders())})("previous",function(){s(e);let t=f();return p(t.initAllOrders())}),a()()}if(n&2){let e=f(),r=ot(0);l(16),$(r),l(2),u("filter",e.filter())("totaldata",r==null?null:r.length)}}function ee(n,g){n&1&&(i(0,"div",15),c(1,"app-empty-state"),a())}var Ye=(()=>{class n{constructor(){this.orderService=_(j),this.dialog=_(xt),this.filter=U({PageNumber:1,PageSize:20,ListChannelID:[],From:null,To:null,Number:void 0})}ngOnInit(){this.orderService.getOrderDefaultValue().subscribe({next:e=>{this.initFromDate(e)},error:e=>{console.error("Error fetching default date:",e),this.initFromDate(null)}})}onDownloadPreview(e){let r=e.ShopID||e.ShopId||e.shopId,t=e.Number||e.OrderNumber||e.number;if(!r||!t){alert("ShopID or Order Number missing");return}this.orderService.previewSingleOrder(r,t).subscribe({next:d=>{this.dialog.open(It,{data:{ChannelStatus:d?.ChannelStatus??"-",ChannelStatusDescription:d?.ChannelStatusDescription??"-",POSStatus:d?.POSStatus??"-",POSStatusDescription:d?.POSStatusDescription??"-",Number:d?.Number??"-",ShopID:r},width:"420px",disableClose:!1}).afterClosed().subscribe(m=>{m==="sync"&&this.orderService.downloadSingleOrder(r,t).subscribe({next:()=>{this.initAllOrders()},error:()=>{this.initAllOrders()}})})},error:d=>{}})}onPaymentStatusSync(e){let r=e.ShopID||e.ShopId||e.shopId,t=e.Number||e.OrderNumber||e.number;if(!r||!t){alert("ShopId or Order Number missing");return}this.orderService.previewPaymentAmounts(r,t).subscribe({next:d=>{this.dialog.open(Vt,{data:{Number:d?.Number??t,POSAmount:d?.POSAmount??0,EscrowAmount:d?.ChannelAmount??0,CacheKey:d?.CacheKey,ShopID:r},width:"420px",disableClose:!1}).afterClosed().subscribe(m=>{m==="sync"&&this.orderService.downloadPaymentAmounts(r,t,d?.CacheKey).subscribe({next:()=>{this.initAllOrders()},error:()=>{this.initAllOrders()}})})},error:()=>{}})}initFromDate(e){this.filter.update(r=>H(W({},r),{From:e})),this.initAllOrders()}initAllOrders(){this.allOrders$=this.orderService.getAllOrders(this.filter()).pipe(G(1))}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=y({type:n,selectors:[["app-all"]],features:[lt([j])],decls:36,vars:12,consts:[["headerTitle","All Orders","searchBoxPlaceHolder","Order Number...","filterDialogWidth","625px",3,"onSubmit","textChange","text"],["href","https://ods.dealpos.app","target","_blank","matTooltip","Monitor your Order & Fulfillment in real-time from TV!",1,"btn","btn-outline-secondary","shadow","rounded","ms-2"],[1,"fa-solid","fa-clipboard-list","me-3"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],[3,"ngModelChange","multiple","ngModel"],[1,"filter-item"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],["type","number","name","PageNumber",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","200px"],[2,"width","250px"],[2,"width","150px"],[2,"width","150px","text-align","right"],[2,"width","120px"],["rowCountApi","/api/orders/allcount",3,"next","previous","filter","totaldata"],[1,"d-flex","align-items-center","gap-3"],[2,"width","20px","height","20px","margin-right","6px",3,"src","alt"],[1,"lh-base"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-user"],[1,"lh-sm"],[1,"fa-clipboard-list","fas"],[2,"font-size","14px",3,"order"],[1,"fa-dolly","fas","me-2"],[3,"variants"],[3,"variant"],[2,"text-align","right"],[1,"dropdown"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-primary","btn-lg","fw-bold","mx-3","py-3","mr-2","dropdown-toggle"],[1,"fa","fa-sync","fa-sm"],[1,"dropdown-menu"],["matTooltip","Preview and synchronize order status between POS and the sales channel","matTooltipShowDelay","800","matTooltipPosition","left",1,"dropdown-item",3,"click"],["matTooltip","Preview and update payment amounts if there's a discrepancy between POS total and channel escrow balance","matTooltipShowDelay","800","matTooltipPosition","left",1,"dropdown-item"],[1,"dropdown-item","disabled",2,"pointer-events","none","cursor","default","line-height","1.2"],["matTooltip","Preview and update the Outbound Logistic number if it differs from the Tracking Number","matTooltipShowDelay","800","href","#",1,"dropdown-item","disabled",2,"pointer-events","auto"],["href","#","target","_blank"],["matTooltip","Preview and update payment amounts if there's a discrepancy between POS total and channel escrow balance","matTooltipShowDelay","800","matTooltipPosition","left",1,"dropdown-item",3,"click"],[1,"text-muted","fw-normal",2,"font-size","10px","white-space","normal"],[1,"fa","fa-info-circle","me-1"]],template:function(r,t){if(r&1){let d=b();at(0),C(1,"async"),i(2,"mainpanel",0),h("onSubmit",function(){return s(d),p(t.initAllOrders())}),O("textChange",function(m){return s(d),P(t.filter().Number,m)||(t.filter().Number=m),p(m)}),i(3,"actions")(4,"a",1),c(5,"i",2),i(6,"span"),o(7,"Order Fulfillment Display"),a()()(),i(8,"filters")(9,"div",3)(10,"div",4)(11,"h6"),o(12,"Channel"),a(),i(13,"app-channel-options-v2",5),O("ngModelChange",function(m){return s(d),P(t.filter().ListChannelID,m)||(t.filter().ListChannelID=m),p(m)}),a()(),i(14,"div",6)(15,"h6"),o(16,"From"),a(),i(17,"datepicker",7),O("dateChange",function(m){return s(d),P(t.filter().From,m)||(t.filter().From=m),p(m)}),a()(),i(18,"div",6)(19,"h6"),o(20,"To"),a(),i(21,"datepicker",8),O("dateChange",function(m){return s(d),P(t.filter().To,m)||(t.filter().To=m),p(m)}),a()(),i(22,"div",6)(23,"h6"),o(24,"Page Number"),a(),i(25,"input",9),O("ngModelChange",function(m){return s(d),P(t.filter().PageNumber,m)||(t.filter().PageNumber=m),p(m)}),a()(),i(26,"div",6)(27,"h6"),o(28,"Page Size"),a(),i(29,"input",10),O("ngModelChange",function(m){return s(d),P(t.filter().PageSize,m)||(t.filter().PageSize=m),p(m)}),a()()()(),i(30,"content")(31,"div",11)(32,"div",12)(33,"div",13),x(34,te,19,2,"div",14)(35,ee,2,0,"div",15),a()()()()()}if(r&2){let d=rt(A(1,8,t.allOrders$)||dt(11,Xt));l(2),M("text",t.filter().Number),l(11),u("multiple",!0),M("ngModel",t.filter().ListChannelID),l(4),M("date",t.filter().From),l(4),M("date",t.filter().To),l(4),M("ngModel",t.filter().PageNumber),l(4),M("ngModel",t.filter().PageSize),l(5),w((d==null?null:d.length)>0?34:35)}},dependencies:[wt,St,Mt,bt,ft,Ct,ht,_t,Dt,At,Tt,yt,vt,Et,Pt,Ot,st,gt,k,pt],styles:[".all-preview-modal-wrapper[_ngcontent-%COMP%] .modal-material[_ngcontent-%COMP%]{max-height:80vh;overflow-y:auto;z-index:1050}.btn-outline-primary[_ngcontent-%COMP%]{background:transparent;color:#1565c0;border:1px solid #1976d2;box-shadow:none;transition:background .2s,color .2s}.btn-outline-primary[_ngcontent-%COMP%]:hover, .btn-outline-primary[_ngcontent-%COMP%]:focus{background:#1565c0;color:#fff;border-color:#1565c0}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] multiwarehouse-tree-select[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] radio-options[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%], .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]{height:40px;min-height:40px;border:1px solid #ccc;border-radius:4px;font-size:.875rem;padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] input.input-filter[_ngcontent-%COMP%]:focus, .dialog-filter.grid-filter[_ngcontent-%COMP%] input.form-control[_ngcontent-%COMP%]:focus{border:1px solid #86b7fe;box-shadow:none;outline:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-select-container{height:40px!important;min-height:40px!important;align-items:center;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#86b7fe!important;box-shadow:none!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value-container{padding-left:.75rem;padding-right:.75rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-value, .dialog-filter.grid-filter[_ngcontent-%COMP%] ng-select .ng-placeholder{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-multiselect{box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;--p-multiselect-padding-y: 8px;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-multiselect:not(.p-disabled):hover{border-color:#ccc}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-multiselect-label, .dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2 .p-multiselect-chip{font-size:.75rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined{height:40px!important;min-height:40px!important;padding-left:.75rem!important;padding-right:.75rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .mdc-notched-outline__leading, .dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .mdc-notched-outline__notch, .dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .mdc-notched-outline__trailing{border-color:#ccc!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .mdc-notched-outline__leading, .dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .mdc-notched-outline__trailing{width:.75rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .mat-mdc-form-field-infix{display:flex;align-items:center;height:40px;min-height:0!important;padding:0!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker input.mat-mdc-input-element{font-size:.875rem}.dialog-filter.grid-filter[_ngcontent-%COMP%] datepicker .datepicker-toggle-icon{height:auto;width:auto;margin-right:0}"],changeDetection:0})}}return n})();export{Ye as AllComponent};
@@ -1 +1 @@
1
- import{a as Y}from"./chunk-GIUK5WNF.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{e as J}from"./chunk-474G6BPL.js";import{b as G}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as q}from"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as Q}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import{b as z}from"./chunk-NNVT5X6O.js";import{c as j,h as H,m as $,z as B}from"./chunk-7HUEGPJN.js";import{b as F,e as V}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as D,r as R}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as b,Fc as P,Ic as a,Jc as p,Kc as E,Xb as g,Zb as _,ac as A,bc as T,cc as C,dc as n,ec as i,ed as I,fc as v,fd as N,gb as l,ha as S,mc as w,md as L,oa as M,pa as y,rc as u,tc as m,yb as k}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var K=(t,d)=>d.key;function W(t,d){if(t&1){let e=w();n(0,"button",31),u("click",function(){M(e);let r=m(2);return y(r.searchQuery.set(""))}),v(1,"i",32),i()}}function X(t,d){if(t&1){let e=w();n(0,"div",17),v(1,"i",28),n(2,"input",29),u("ngModelChange",function(r){M(e);let c=m();return y(c.searchQuery.set(r))}),i(),g(3,W,2,0,"button",30),i()}if(t&2){let e=m();l(2),C("ngModel",e.searchQuery()),l(),_(e.searchQuery()?3:-1)}}function Z(t,d){if(t&1&&(n(0,"span",18),a(1),i()),t&2){let e=m();l(),E(" ",e.orderLog()?"Order #"+e.orderNumber():"Response"," ")}}function ee(t,d){t&1&&(n(0,"span",37),a(1,"true"),i())}function te(t,d){t&1&&(n(0,"span",38),a(1,"false"),i())}function ne(t,d){if(t&1&&(n(0,"span",39),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function ie(t,d){t&1&&(n(0,"span",40),a(1,"null"),i())}function oe(t,d){if(t&1&&(n(0,"span",41),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function re(t,d){if(t&1&&(n(0,"tr")(1,"td",36),a(2),i(),n(3,"td"),g(4,ee,2,0,"span",37)(5,te,2,0,"span",38)(6,ne,2,1,"span",39)(7,ie,2,0,"span",40)(8,oe,2,1,"span",41),i()()),t&2){let e,o=d.$implicit;l(2),p(o.key),l(2),_((e=o.type)==="true"?4:e==="false"?5:e==="number"?6:e==="null"?7:8)}}function ae(t,d){if(t&1&&(n(0,"tr")(1,"td",42),a(2),i()()),t&2){let e=m(3);l(2),E(' No matching properties for "',e.searchQuery(),'" ')}}function le(t,d){if(t&1&&(n(0,"div",33)(1,"table",35)(2,"thead")(3,"tr")(4,"th"),a(5,"Field"),i(),n(6,"th"),a(7,"Value"),i()()(),n(8,"tbody"),A(9,re,9,2,"tr",null,K,!1,ae,3,1,"tr"),i()()()),t&2){let e=m(2);l(9),T(e.getFilteredTableRows(e.orderLog()))}}function de(t,d){if(t&1&&(n(0,"pre",34),a(1),I(2,"json"),i()),t&2){let e=m(2);l(),p(N(2,1,e.orderLog()))}}function ce(t,d){if(t&1&&(g(0,le,12,1,"div",33),g(1,de,3,3,"pre",34)),t&2){let e=m();_(e.activeView()==="table"?0:-1),l(),_(e.activeView()==="raw"?1:-1)}}function pe(t,d){t&1&&(n(0,"p",26),a(1," Your data will be shown here once it's available "),i())}function se(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Cancellation status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"cancel_reason"),i(),n(7,"span",52),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"cancel_by"),i(),n(12,"span",52),a(13),i()(),n(14,"div",53)(15,"span",48),a(16,"checkout_shipping_carrier"),i(),n(17,"span",52),a(18),i()()()()),t&2){let e=d;l(8),p(e.cancelReason),l(5),p(e.cancelBy),l(5),p(e.checkoutShippingCarrier)}}function me(t,d){if(t&1&&(n(0,"div",43)(1,"div",45),a(2,"Return status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"return_requested_qty"),i(),n(7,"span",54),a(8),i()(),n(9,"div",53)(10,"span",48),a(11,"returned_qty"),i(),n(12,"span",54),a(13),i()()()()),t&2){let e=d;l(8),p(e.returnRequestedQty),l(5),p(e.returnedQty)}}function ge(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Shipping and Status"),i(),n(3,"div",46)(4,"div",47)(5,"span",48),a(6,"order_status"),i(),n(7,"span",49),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"logistics_status"),i(),n(12,"span",51),a(13),i()(),n(14,"div",50)(15,"span",48),a(16,"shipping_carrier"),i(),n(17,"span",52),a(18),i()(),n(19,"div",50)(20,"span",48),a(21,"package_number"),i(),n(22,"span",51),a(23),i()(),n(24,"div",53)(25,"span",48),a(26,"booking_sn"),i(),n(27,"span",51),a(28),i()()()(),g(29,se,19,3,"div",44),g(30,me,14,2,"div",43)),t&2){let e,o,r=d,c=m(2);l(7),C("ngClass",c.getOrderStatusClass(r.orderStatus)),l(),p(r.orderStatus),l(5),p(r.logisticsStatus),l(5),p(r.shippingCarrier),l(5),p(r.packageNumber),l(5),p(r.bookingSn),l(),_((e=c.getCancellationStatus(c.orderLog()))?29:-1,e),l(),_((o=c.getReturnStatus(c.orderLog()))?30:-1,o)}}function _e(t,d){t&1&&(n(0,"div",43)(1,"div",55),a(2," Highlights will appear after search "),i()())}function ue(t,d){if(t&1&&g(0,ge,31,8)(1,_e,3,0,"div",43),t&2){let e,o=m();_((e=o.getShippingAndStatus(o.orderLog()))?0:1,e)}}var Ie=(()=>{class t{constructor(){this.httpService=S(V),this.toastr=S(F),this.authService=S(q),this.selectedChannel=b(null),this.orderNumber=b(null),this.activeView=b("raw"),this.searchQuery=b(""),this.isShopeeSelected=L(()=>{let e=this.selectedChannel();return e?this.authService.getChannels().find(r=>r.ID===e)?.TypeID===z.Shopee:!1}),this.orderLog=b(null)}getTableRows(e){if(!e)return[];let o=e?.response?.order_list?.[0]??e?.order_list?.[0]??e;if(!o)return[];let r=[],c=(f,x="")=>{for(let h of Object.keys(f)){let O=x?`${x}.${h}`:h,s=f[h];if(s!==null&&typeof s=="object"&&!Array.isArray(s))c(s,O);else if(Array.isArray(s))s.length>0&&typeof s[0]=="object"?c(s[0],`${O}[0]`):r.push({key:O,value:JSON.stringify(s),type:"string"});else{let U=s===null?"null":typeof s=="boolean"?s?"true":"false":typeof s=="number"?"number":"string";r.push({key:O,value:s,type:U})}}};return c(o),r}getFilteredTableRows(e){let o=this.getTableRows(e),r=this.searchQuery().trim().toLowerCase();return r?o.filter(c=>c.key.toLowerCase().includes(r)||String(c.value).toLowerCase().includes(r)):o}getOrder(e){return e?.response?.order_list?.[0]??e?.order_list?.[0]??e}fmt(e){return e==null||e===""?"\u2014":String(e)}getShippingAndStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.package_list?.[0]??{};return{orderStatus:this.fmt(o.order_status),logisticsStatus:this.fmt(r.logistics_status??o.logistics_status),shippingCarrier:this.fmt(r.shipping_carrier??o.shipping_carrier),packageNumber:this.fmt(r.package_number),bookingSn:this.fmt(o.booking_sn)}}getCancellationStatus(e){if(!e)return null;let o=this.getOrder(e);return o?{cancelReason:this.fmt(o.cancel_reason),cancelBy:this.fmt(o.cancel_by),checkoutShippingCarrier:this.fmt(o.checkout_shipping_carrier)}:null}getReturnStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.item_list??[];if(r.length===0)return{returnRequestedQty:o.return_requested_qty??0,returnedQty:o.returned_qty??0};let c=r.reduce((x,h)=>x+(h.return_requested_qty??0),0),f=r.reduce((x,h)=>x+(h.returned_qty??0),0);return{returnRequestedQty:c,returnedQty:f}}getOrderStatusClass(e){let o=(e??"").toUpperCase();return["COMPLETED","DELIVERED","SHIPPED","LOGISTICS_DELIVERY_DONE"].includes(o)?"oapi-badge--success":["CANCELLED","CANCEL","FAILED","LOGISTICS_DELIVERY_FAILED"].includes(o)?"oapi-badge--danger":["TO_SHIP","SHIPPING","IN_TRANSIT","RETRY_SHIP","UNPAID"].includes(o)?"oapi-badge--warn":"oapi-badge--info"}formatRupiah(e){return new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}).format(e)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.httpService.post(Q.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).subscribe({next:e=>{this.orderLog.set(e),this.searchQuery.set("")},error:e=>{this.toastr.error("Failed to fetch order log","Error"),console.error(e)}})}copyToClipboard(e){if(!e)return;let o=typeof e=="string"?e:JSON.stringify(e,null,2);navigator.clipboard.writeText(o),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-order-api"]],decls:46,vars:12,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-8","pe-3"],[1,"card","oapi-card","h-100"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"oapi-search-wrap"],[1,"text-muted","oapi-field-count"],[1,"d-flex","align-items-center","gap-2"],[1,"oapi-view-toggle"],[1,"oapi-vtab",3,"click"],[1,"fa","fa-table"],[1,"fa","fa-code"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body","p-0"],[1,"text-center","my-12","text-muted"],[1,"col-4","ps-2"],[1,"fa","fa-search","oapi-search-icon"],["type","text","placeholder","Search property...",1,"form-control","oapi-search-input",3,"ngModelChange","ngModel"],["type","button",1,"oapi-search-clear"],["type","button",1,"oapi-search-clear",3,"click"],[1,"fa","fa-times"],[1,"oapi-table-wrap"],[1,"oapi-raw"],[1,"table","table-sm","oapi-table","mb-0"],[1,"oapi-key-col"],[1,"oapi-val","oapi-val--true"],[1,"oapi-val","oapi-val--false"],[1,"oapi-val","oapi-val--num"],[1,"oapi-val","oapi-val--null"],[1,"oapi-val"],["colspan","2",1,"text-center","text-muted","py-3",2,"font-size","12px"],[1,"card","oapi-card","oapi-highlight-card"],[1,"card","oapi-card","oapi-highlight-card","mb-3"],[1,"card-header","oapi-card-header-sm"],[1,"card-body","py-2","px-3"],[1,"oapi-hl-row","oapi-hl-row--highlight"],[1,"oapi-hl-key"],[1,"badge","oapi-badge",3,"ngClass"],[1,"oapi-hl-row"],[1,"oapi-hl-val","oapi-hl-val--mono"],[1,"oapi-hl-val"],[1,"oapi-hl-row","oapi-hl-row--last"],[1,"oapi-hl-val","oapi-hl-val--num"],[1,"card-body","text-center","text-muted","py-4",2,"font-size","13px"]],template:function(o,r){o&1&&(n(0,"mainpanel",0)(1,"actions")(2,"button",1),u("click",function(){return r.fetchLog()}),v(3,"i",2),a(4," Search "),i()(),n(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),a(12,"Channel"),i(),n(13,"p",8),a(14," View logs related to Order API activities. "),i()(),n(15,"div",9)(16,"app-channel-options-v2",10),u("ngModelChange",function(f){return r.selectedChannel.set(f)}),i()()(),n(17,"div",11)(18,"div",7)(19,"h6"),a(20,"Order Number"),i(),n(21,"p",8),a(22," Order or Invoice number from Channel. "),i()(),n(23,"div",9)(24,"input",12),u("ngModelChange",function(f){return r.orderNumber.set(f)}),i()()()()(),n(25,"div",13)(26,"div",14)(27,"div",15)(28,"div",16),g(29,X,4,2,"div",17)(30,Z,2,1,"span",18),n(31,"div",19)(32,"div",20)(33,"button",21),u("click",function(){return r.activeView.set("table")}),v(34,"i",22),a(35," Table "),i(),n(36,"button",21),u("click",function(){return r.activeView.set("raw")}),v(37,"i",23),a(38," Raw JSON "),i()(),n(39,"button",24),u("click",function(){return r.copyToClipboard(r.orderLog())}),a(40," Copy "),i()()(),n(41,"div",25),g(42,ce,2,2)(43,pe,2,0,"p",26),i()()(),n(44,"div",27),g(45,ue,2,1),i()()()()()),o&2&&(C("hideSearchBox",!0)("hideSearchDropdown",!0),l(16),C("ngModel",r.selectedChannel()),l(8),C("ngModel",r.orderNumber()),l(5),_(r.activeView()==="table"&&r.orderLog()?29:30),l(4),P("active",r.activeView()==="table"),l(3),P("active",r.activeView()==="raw"),l(3),C("disabled",!r.orderLog()),l(3),_(r.orderLog()?42:43),l(3),_(r.isShopeeSelected()?45:-1))},dependencies:[G,J,B,j,H,$,Y,R,D],styles:[".oapi-card[_ngcontent-%COMP%]{border:1px solid #e9ecef;border-radius:10px;overflow:hidden}.oapi-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:10px 14px;min-height:unset}.oapi-field-count[_ngcontent-%COMP%]{font-size:13px}.oapi-search-wrap[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;width:260px;max-width:40%}.oapi-search-icon[_ngcontent-%COMP%]{position:absolute;left:9px;font-size:11px;color:#adb5bd;pointer-events:none}.oapi-search-input[_ngcontent-%COMP%]{height:28px!important;font-size:12px!important;padding:4px 28px 4px 26px!important;border-radius:6px!important;border:1px solid #dee2e6!important;background:#fff!important;line-height:1.4}.oapi-search-input[_ngcontent-%COMP%]::placeholder{color:#adb5bd}.oapi-search-input[_ngcontent-%COMP%]:focus{border-color:#adb5bd!important;box-shadow:none!important}.oapi-search-clear[_ngcontent-%COMP%]{position:absolute;right:6px;border:none;background:#f1f3f5;color:#868e96;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;cursor:pointer;padding:0}.oapi-search-clear[_ngcontent-%COMP%]:hover{background:#e9ecef;color:#495057}.oapi-view-toggle[_ngcontent-%COMP%]{display:inline-flex;background:#f1f3f5;border:1px solid #dee2e6;border-radius:6px;padding:2px;gap:2px}.oapi-vtab[_ngcontent-%COMP%]{font-size:12px;border:none;background:transparent;color:#6c757d;padding:4px 10px;border-radius:4px;cursor:pointer;line-height:1.4;transition:background .15s,color .15s}.oapi-vtab[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:4px}.oapi-vtab.active[_ngcontent-%COMP%]{background:#fff;color:#212529;font-weight:500;border:1px solid #dee2e6}.oapi-vtab[_ngcontent-%COMP%]:hover:not(.active){background:#e9ecef;color:#495057}.oapi-table-wrap[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto}.oapi-table[_ngcontent-%COMP%]{font-size:13px;margin-top:5px;margin-bottom:0}.oapi-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;background:#f8f9fa;font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;padding:8px 14px;border-bottom:1px solid #dee2e6;z-index:1}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td[_ngcontent-%COMP%]{background-color:#f8f9fa}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px 14px;border-bottom:1px solid #f1f3f5;vertical-align:top;color:#212529}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.oapi-key-col[_ngcontent-%COMP%]{color:#6c757d!important;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px!important;width:46%}.oapi-val[_ngcontent-%COMP%]{font-size:13px;color:#212529}.oapi-val--true[_ngcontent-%COMP%]{color:#2f9e44;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--false[_ngcontent-%COMP%]{color:#868e96;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--num[_ngcontent-%COMP%]{color:#1971c2;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--null[_ngcontent-%COMP%]{color:#adb5bd;font-style:italic;font-size:12px}.oapi-raw[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;line-height:1.8;padding:14px;margin:0;max-height:600px;overflow-y:auto;overflow-x:auto;color:#212529;background:transparent;white-space:pre}.oapi-highlight-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{padding:8px 12px}.oapi-card-header-sm[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:8px 12px}.oapi-hl-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #f1f3f5}.oapi-hl-row--last[_ngcontent-%COMP%]{border-bottom:none;padding-bottom:0}.oapi-hl-row--highlight[_ngcontent-%COMP%]{background:#f8f9fa;margin:0 -12px;padding:8px 12px;border-bottom:1px solid #e9ecef}.oapi-hl-key[_ngcontent-%COMP%]{font-size:12px;color:#6c757d}.oapi-hl-val[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#212529}.oapi-hl-val--mono[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;font-weight:400}.oapi-hl-val--num[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,monospace;color:#1971c2;font-size:12px}.oapi-badge[_ngcontent-%COMP%]{font-size:11px;font-weight:500;padding:2px 8px;border-radius:999px}.oapi-badge--yes[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e}.oapi-badge--no[_ngcontent-%COMP%]{background-color:#f1f3f5;color:#868e96;border:1px solid #dee2e6}.oapi-badge--info[_ngcontent-%COMP%]{background-color:#dbe4ff;color:#364fc7}.oapi-badge--success[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e;border:1px solid #b2f2bb}.oapi-badge--danger[_ngcontent-%COMP%]{background-color:#ffe3e3;color:#c92a2a;border:1px solid #ffc9c9}.oapi-badge--warn[_ngcontent-%COMP%]{background-color:#fff3bf;color:#e67700;border:1px solid #ffec99}.oapi-fee-big[_ngcontent-%COMP%]{font-size:20px;font-weight:600;font-family:SFMono-Regular,Consolas,monospace;color:#212529}.oapi-fee-sub[_ngcontent-%COMP%]{font-size:11px;color:#adb5bd;margin-top:2px}@media(max-width:767.98px){.container-fluid[_ngcontent-%COMP%]{padding-left:1rem!important;padding-right:1rem!important}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}.col-7[_ngcontent-%COMP%], .col-8[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%], .col-12[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;padding-left:0!important;padding-right:0!important}.d-flex[_ngcontent-%COMP%]{flex-direction:column!important;align-items:stretch!important;gap:1rem}.w-75[_ngcontent-%COMP%], .w-100[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important}.oapi-highlight-card[_ngcontent-%COMP%]{margin-top:1rem}.oapi-table-wrap[_ngcontent-%COMP%], .oapi-raw[_ngcontent-%COMP%]{max-height:400px}}@media(max-width:400px){.card-header[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{font-size:1rem}.oapi-raw[_ngcontent-%COMP%]{font-size:.85rem}}"],changeDetection:0})}}return t})();export{Ie as OrderApiComponent};
1
+ import{a as Y}from"./chunk-RBEQRGC3.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import"./chunk-2KBEFXEF.js";import"./chunk-O476ULLD.js";import"./chunk-HBAHB3P5.js";import"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import"./chunk-KRIYDIQQ.js";import{e as J}from"./chunk-474G6BPL.js";import{b as G}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7LEHDN2Q.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as q}from"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import{a as Q}from"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import{b as z}from"./chunk-NNVT5X6O.js";import{c as j,h as H,m as $,z as B}from"./chunk-7HUEGPJN.js";import{b as F,e as V}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{C as D,r as R}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as b,Fc as P,Ic as a,Jc as p,Kc as E,Xb as g,Zb as _,ac as A,bc as T,cc as C,dc as n,ec as i,ed as I,fc as v,fd as N,gb as l,ha as S,mc as w,md as L,oa as M,pa as y,rc as u,tc as m,yb as k}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var K=(t,d)=>d.key;function W(t,d){if(t&1){let e=w();n(0,"button",31),u("click",function(){M(e);let r=m(2);return y(r.searchQuery.set(""))}),v(1,"i",32),i()}}function X(t,d){if(t&1){let e=w();n(0,"div",17),v(1,"i",28),n(2,"input",29),u("ngModelChange",function(r){M(e);let c=m();return y(c.searchQuery.set(r))}),i(),g(3,W,2,0,"button",30),i()}if(t&2){let e=m();l(2),C("ngModel",e.searchQuery()),l(),_(e.searchQuery()?3:-1)}}function Z(t,d){if(t&1&&(n(0,"span",18),a(1),i()),t&2){let e=m();l(),E(" ",e.orderLog()?"Order #"+e.orderNumber():"Response"," ")}}function ee(t,d){t&1&&(n(0,"span",37),a(1,"true"),i())}function te(t,d){t&1&&(n(0,"span",38),a(1,"false"),i())}function ne(t,d){if(t&1&&(n(0,"span",39),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function ie(t,d){t&1&&(n(0,"span",40),a(1,"null"),i())}function oe(t,d){if(t&1&&(n(0,"span",41),a(1),i()),t&2){let e=m().$implicit;l(),p(e.value)}}function re(t,d){if(t&1&&(n(0,"tr")(1,"td",36),a(2),i(),n(3,"td"),g(4,ee,2,0,"span",37)(5,te,2,0,"span",38)(6,ne,2,1,"span",39)(7,ie,2,0,"span",40)(8,oe,2,1,"span",41),i()()),t&2){let e,o=d.$implicit;l(2),p(o.key),l(2),_((e=o.type)==="true"?4:e==="false"?5:e==="number"?6:e==="null"?7:8)}}function ae(t,d){if(t&1&&(n(0,"tr")(1,"td",42),a(2),i()()),t&2){let e=m(3);l(2),E(' No matching properties for "',e.searchQuery(),'" ')}}function le(t,d){if(t&1&&(n(0,"div",33)(1,"table",35)(2,"thead")(3,"tr")(4,"th"),a(5,"Field"),i(),n(6,"th"),a(7,"Value"),i()()(),n(8,"tbody"),A(9,re,9,2,"tr",null,K,!1,ae,3,1,"tr"),i()()()),t&2){let e=m(2);l(9),T(e.getFilteredTableRows(e.orderLog()))}}function de(t,d){if(t&1&&(n(0,"pre",34),a(1),I(2,"json"),i()),t&2){let e=m(2);l(),p(N(2,1,e.orderLog()))}}function ce(t,d){if(t&1&&(g(0,le,12,1,"div",33),g(1,de,3,3,"pre",34)),t&2){let e=m();_(e.activeView()==="table"?0:-1),l(),_(e.activeView()==="raw"?1:-1)}}function pe(t,d){t&1&&(n(0,"p",26),a(1," Your data will be shown here once it's available "),i())}function se(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Cancellation status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"cancel_reason"),i(),n(7,"span",52),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"cancel_by"),i(),n(12,"span",52),a(13),i()(),n(14,"div",53)(15,"span",48),a(16,"checkout_shipping_carrier"),i(),n(17,"span",52),a(18),i()()()()),t&2){let e=d;l(8),p(e.cancelReason),l(5),p(e.cancelBy),l(5),p(e.checkoutShippingCarrier)}}function me(t,d){if(t&1&&(n(0,"div",43)(1,"div",45),a(2,"Return status"),i(),n(3,"div",46)(4,"div",50)(5,"span",48),a(6,"return_requested_qty"),i(),n(7,"span",54),a(8),i()(),n(9,"div",53)(10,"span",48),a(11,"returned_qty"),i(),n(12,"span",54),a(13),i()()()()),t&2){let e=d;l(8),p(e.returnRequestedQty),l(5),p(e.returnedQty)}}function ge(t,d){if(t&1&&(n(0,"div",44)(1,"div",45),a(2,"Shipping and Status"),i(),n(3,"div",46)(4,"div",47)(5,"span",48),a(6,"order_status"),i(),n(7,"span",49),a(8),i()(),n(9,"div",50)(10,"span",48),a(11,"logistics_status"),i(),n(12,"span",51),a(13),i()(),n(14,"div",50)(15,"span",48),a(16,"shipping_carrier"),i(),n(17,"span",52),a(18),i()(),n(19,"div",50)(20,"span",48),a(21,"package_number"),i(),n(22,"span",51),a(23),i()(),n(24,"div",53)(25,"span",48),a(26,"booking_sn"),i(),n(27,"span",51),a(28),i()()()(),g(29,se,19,3,"div",44),g(30,me,14,2,"div",43)),t&2){let e,o,r=d,c=m(2);l(7),C("ngClass",c.getOrderStatusClass(r.orderStatus)),l(),p(r.orderStatus),l(5),p(r.logisticsStatus),l(5),p(r.shippingCarrier),l(5),p(r.packageNumber),l(5),p(r.bookingSn),l(),_((e=c.getCancellationStatus(c.orderLog()))?29:-1,e),l(),_((o=c.getReturnStatus(c.orderLog()))?30:-1,o)}}function _e(t,d){t&1&&(n(0,"div",43)(1,"div",55),a(2," Highlights will appear after search "),i()())}function ue(t,d){if(t&1&&g(0,ge,31,8)(1,_e,3,0,"div",43),t&2){let e,o=m();_((e=o.getShippingAndStatus(o.orderLog()))?0:1,e)}}var Ie=(()=>{class t{constructor(){this.httpService=S(V),this.toastr=S(F),this.authService=S(q),this.selectedChannel=b(null),this.orderNumber=b(null),this.activeView=b("raw"),this.searchQuery=b(""),this.isShopeeSelected=L(()=>{let e=this.selectedChannel();return e?this.authService.getChannels().find(r=>r.ID===e)?.TypeID===z.Shopee:!1}),this.orderLog=b(null)}getTableRows(e){if(!e)return[];let o=e?.response?.order_list?.[0]??e?.order_list?.[0]??e;if(!o)return[];let r=[],c=(f,x="")=>{for(let h of Object.keys(f)){let O=x?`${x}.${h}`:h,s=f[h];if(s!==null&&typeof s=="object"&&!Array.isArray(s))c(s,O);else if(Array.isArray(s))s.length>0&&typeof s[0]=="object"?c(s[0],`${O}[0]`):r.push({key:O,value:JSON.stringify(s),type:"string"});else{let U=s===null?"null":typeof s=="boolean"?s?"true":"false":typeof s=="number"?"number":"string";r.push({key:O,value:s,type:U})}}};return c(o),r}getFilteredTableRows(e){let o=this.getTableRows(e),r=this.searchQuery().trim().toLowerCase();return r?o.filter(c=>c.key.toLowerCase().includes(r)||String(c.value).toLowerCase().includes(r)):o}getOrder(e){return e?.response?.order_list?.[0]??e?.order_list?.[0]??e}fmt(e){return e==null||e===""?"\u2014":String(e)}getShippingAndStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.package_list?.[0]??{};return{orderStatus:this.fmt(o.order_status),logisticsStatus:this.fmt(r.logistics_status??o.logistics_status),shippingCarrier:this.fmt(r.shipping_carrier??o.shipping_carrier),packageNumber:this.fmt(r.package_number),bookingSn:this.fmt(o.booking_sn)}}getCancellationStatus(e){if(!e)return null;let o=this.getOrder(e);return o?{cancelReason:this.fmt(o.cancel_reason),cancelBy:this.fmt(o.cancel_by),checkoutShippingCarrier:this.fmt(o.checkout_shipping_carrier)}:null}getReturnStatus(e){if(!e)return null;let o=this.getOrder(e);if(!o)return null;let r=o.item_list??[];if(r.length===0)return{returnRequestedQty:o.return_requested_qty??0,returnedQty:o.returned_qty??0};let c=r.reduce((x,h)=>x+(h.return_requested_qty??0),0),f=r.reduce((x,h)=>x+(h.returned_qty??0),0);return{returnRequestedQty:c,returnedQty:f}}getOrderStatusClass(e){let o=(e??"").toUpperCase();return["COMPLETED","DELIVERED","SHIPPED","LOGISTICS_DELIVERY_DONE"].includes(o)?"oapi-badge--success":["CANCELLED","CANCEL","FAILED","LOGISTICS_DELIVERY_FAILED"].includes(o)?"oapi-badge--danger":["TO_SHIP","SHIPPING","IN_TRANSIT","RETRY_SHIP","UNPAID"].includes(o)?"oapi-badge--warn":"oapi-badge--info"}formatRupiah(e){return new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR",maximumFractionDigits:0}).format(e)}fetchLog(){if(!this.selectedChannel()||!this.orderNumber()){this.toastr.warning("Please select a channel and enter an order number","Warning");return}this.httpService.post(Q.GetOrderApiLog,{ChannelID:this.selectedChannel(),OrderNumber:this.orderNumber()}).subscribe({next:e=>{this.orderLog.set(e),this.searchQuery.set("")},error:e=>{this.toastr.error("Failed to fetch order log","Error"),console.error(e)}})}copyToClipboard(e){if(!e)return;let o=typeof e=="string"?e:JSON.stringify(e,null,2);navigator.clipboard.writeText(o),this.toastr.success("Copied to clipboard!","Success")}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=k({type:t,selectors:[["app-order-api"]],decls:46,vars:12,consts:[["headerTitle","Origin Order Api",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-success","btn-fill","me-3",3,"click"],[1,"fa","fa-search"],[1,"container-fluid","mt-8","px-10"],[1,"row"],[1,"col-7"],[1,"d-flex","align-items-center"],[1,"w-75"],[1,"mb-0","text-muted","fst-italic"],[1,"w-100"],[3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","mt-3"],["type","text","placeholder","Order Number or Invoice Number",1,"form-control","rounded-1",2,"height","40px",3,"ngModelChange","ngModel"],[1,"row","mt-6"],[1,"col-8","pe-3"],[1,"card","oapi-card","h-100"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"oapi-search-wrap"],[1,"text-muted","oapi-field-count"],[1,"d-flex","align-items-center","gap-2"],[1,"oapi-view-toggle"],[1,"oapi-vtab",3,"click"],[1,"fa","fa-table"],[1,"fa","fa-code"],["type","button",1,"btn","btn-sm","btn-outline-primary",3,"click","disabled"],[1,"card-body","p-0"],[1,"text-center","my-12","text-muted"],[1,"col-4","ps-2"],[1,"fa","fa-search","oapi-search-icon"],["type","text","placeholder","Search property...",1,"form-control","oapi-search-input",3,"ngModelChange","ngModel"],["type","button",1,"oapi-search-clear"],["type","button",1,"oapi-search-clear",3,"click"],[1,"fa","fa-times"],[1,"oapi-table-wrap"],[1,"oapi-raw"],[1,"table","table-sm","oapi-table","mb-0"],[1,"oapi-key-col"],[1,"oapi-val","oapi-val--true"],[1,"oapi-val","oapi-val--false"],[1,"oapi-val","oapi-val--num"],[1,"oapi-val","oapi-val--null"],[1,"oapi-val"],["colspan","2",1,"text-center","text-muted","py-3",2,"font-size","12px"],[1,"card","oapi-card","oapi-highlight-card"],[1,"card","oapi-card","oapi-highlight-card","mb-3"],[1,"card-header","oapi-card-header-sm"],[1,"card-body","py-2","px-3"],[1,"oapi-hl-row","oapi-hl-row--highlight"],[1,"oapi-hl-key"],[1,"badge","oapi-badge",3,"ngClass"],[1,"oapi-hl-row"],[1,"oapi-hl-val","oapi-hl-val--mono"],[1,"oapi-hl-val"],[1,"oapi-hl-row","oapi-hl-row--last"],[1,"oapi-hl-val","oapi-hl-val--num"],[1,"card-body","text-center","text-muted","py-4",2,"font-size","13px"]],template:function(o,r){o&1&&(n(0,"mainpanel",0)(1,"actions")(2,"button",1),u("click",function(){return r.fetchLog()}),v(3,"i",2),a(4," Search "),i()(),n(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h6"),a(12,"Channel"),i(),n(13,"p",8),a(14," View logs related to Order API activities. "),i()(),n(15,"div",9)(16,"app-channel-options-v2",10),u("ngModelChange",function(f){return r.selectedChannel.set(f)}),i()()(),n(17,"div",11)(18,"div",7)(19,"h6"),a(20,"Order Number"),i(),n(21,"p",8),a(22," Order or Invoice number from Channel. "),i()(),n(23,"div",9)(24,"input",12),u("ngModelChange",function(f){return r.orderNumber.set(f)}),i()()()()(),n(25,"div",13)(26,"div",14)(27,"div",15)(28,"div",16),g(29,X,4,2,"div",17)(30,Z,2,1,"span",18),n(31,"div",19)(32,"div",20)(33,"button",21),u("click",function(){return r.activeView.set("table")}),v(34,"i",22),a(35," Table "),i(),n(36,"button",21),u("click",function(){return r.activeView.set("raw")}),v(37,"i",23),a(38," Raw JSON "),i()(),n(39,"button",24),u("click",function(){return r.copyToClipboard(r.orderLog())}),a(40," Copy "),i()()(),n(41,"div",25),g(42,ce,2,2)(43,pe,2,0,"p",26),i()()(),n(44,"div",27),g(45,ue,2,1),i()()()()()),o&2&&(C("hideSearchBox",!0)("hideSearchDropdown",!0),l(16),C("ngModel",r.selectedChannel()),l(8),C("ngModel",r.orderNumber()),l(5),_(r.activeView()==="table"&&r.orderLog()?29:30),l(4),P("active",r.activeView()==="table"),l(3),P("active",r.activeView()==="raw"),l(3),C("disabled",!r.orderLog()),l(3),_(r.orderLog()?42:43),l(3),_(r.isShopeeSelected()?45:-1))},dependencies:[G,J,B,j,H,$,Y,R,D],styles:[".oapi-card[_ngcontent-%COMP%]{border:1px solid #e9ecef;border-radius:10px;overflow:hidden}.oapi-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:10px 14px;min-height:unset}.oapi-field-count[_ngcontent-%COMP%]{font-size:13px}.oapi-search-wrap[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;width:260px;max-width:40%}.oapi-search-icon[_ngcontent-%COMP%]{position:absolute;left:9px;font-size:11px;color:#adb5bd;pointer-events:none}.oapi-search-input[_ngcontent-%COMP%]{height:28px!important;font-size:12px!important;padding:4px 28px 4px 26px!important;border-radius:6px!important;border:1px solid #dee2e6!important;background:#fff!important;line-height:1.4}.oapi-search-input[_ngcontent-%COMP%]::placeholder{color:#adb5bd}.oapi-search-input[_ngcontent-%COMP%]:focus{border-color:#adb5bd!important;box-shadow:none!important}.oapi-search-clear[_ngcontent-%COMP%]{position:absolute;right:6px;border:none;background:#f1f3f5;color:#868e96;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;cursor:pointer;padding:0}.oapi-search-clear[_ngcontent-%COMP%]:hover{background:#e9ecef;color:#495057}.oapi-view-toggle[_ngcontent-%COMP%]{display:inline-flex;background:#f1f3f5;border:1px solid #dee2e6;border-radius:6px;padding:2px;gap:2px}.oapi-vtab[_ngcontent-%COMP%]{font-size:12px;border:none;background:transparent;color:#6c757d;padding:4px 10px;border-radius:4px;cursor:pointer;line-height:1.4;transition:background .15s,color .15s}.oapi-vtab[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:4px}.oapi-vtab.active[_ngcontent-%COMP%]{background:#fff;color:#212529;font-weight:500;border:1px solid #dee2e6}.oapi-vtab[_ngcontent-%COMP%]:hover:not(.active){background:#e9ecef;color:#495057}.oapi-table-wrap[_ngcontent-%COMP%]{max-height:600px;overflow-y:auto}.oapi-table[_ngcontent-%COMP%]{font-size:13px;margin-top:5px;margin-bottom:0}.oapi-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky;top:0;background:#f8f9fa;font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;padding:8px 14px;border-bottom:1px solid #dee2e6;z-index:1}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover td[_ngcontent-%COMP%]{background-color:#f8f9fa}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:7px 14px;border-bottom:1px solid #f1f3f5;vertical-align:top;color:#212529}.oapi-table[_ngcontent-%COMP%] tbody[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:last-child td[_ngcontent-%COMP%]{border-bottom:none}.oapi-key-col[_ngcontent-%COMP%]{color:#6c757d!important;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px!important;width:46%}.oapi-val[_ngcontent-%COMP%]{font-size:13px;color:#212529}.oapi-val--true[_ngcontent-%COMP%]{color:#2f9e44;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--false[_ngcontent-%COMP%]{color:#868e96;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--num[_ngcontent-%COMP%]{color:#1971c2;font-family:SFMono-Regular,Consolas,monospace;font-size:12px}.oapi-val--null[_ngcontent-%COMP%]{color:#adb5bd;font-style:italic;font-size:12px}.oapi-raw[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;line-height:1.8;padding:14px;margin:0;max-height:600px;overflow-y:auto;overflow-x:auto;color:#212529;background:transparent;white-space:pre}.oapi-highlight-card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{padding:8px 12px}.oapi-card-header-sm[_ngcontent-%COMP%]{font-size:11px;font-weight:600;color:#868e96;text-transform:uppercase;letter-spacing:.04em;background-color:#f8f9fa;border-bottom:1px solid #e9ecef;padding:8px 12px}.oapi-hl-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid #f1f3f5}.oapi-hl-row--last[_ngcontent-%COMP%]{border-bottom:none;padding-bottom:0}.oapi-hl-row--highlight[_ngcontent-%COMP%]{background:#f8f9fa;margin:0 -12px;padding:8px 12px;border-bottom:1px solid #e9ecef}.oapi-hl-key[_ngcontent-%COMP%]{font-size:12px;color:#6c757d}.oapi-hl-val[_ngcontent-%COMP%]{font-size:13px;font-weight:500;color:#212529}.oapi-hl-val--mono[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:12px;font-weight:400}.oapi-hl-val--num[_ngcontent-%COMP%]{font-family:SFMono-Regular,Consolas,monospace;color:#1971c2;font-size:12px}.oapi-badge[_ngcontent-%COMP%]{font-size:11px;font-weight:500;padding:2px 8px;border-radius:999px}.oapi-badge--yes[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e}.oapi-badge--no[_ngcontent-%COMP%]{background-color:#f1f3f5;color:#868e96;border:1px solid #dee2e6}.oapi-badge--info[_ngcontent-%COMP%]{background-color:#dbe4ff;color:#364fc7}.oapi-badge--success[_ngcontent-%COMP%]{background-color:#d3f9d8;color:#2b8a3e;border:1px solid #b2f2bb}.oapi-badge--danger[_ngcontent-%COMP%]{background-color:#ffe3e3;color:#c92a2a;border:1px solid #ffc9c9}.oapi-badge--warn[_ngcontent-%COMP%]{background-color:#fff3bf;color:#e67700;border:1px solid #ffec99}.oapi-fee-big[_ngcontent-%COMP%]{font-size:20px;font-weight:600;font-family:SFMono-Regular,Consolas,monospace;color:#212529}.oapi-fee-sub[_ngcontent-%COMP%]{font-size:11px;color:#adb5bd;margin-top:2px}@media(max-width:767.98px){.container-fluid[_ngcontent-%COMP%]{padding-left:1rem!important;padding-right:1rem!important}.row[_ngcontent-%COMP%]{flex-direction:column!important;margin-left:0!important;margin-right:0!important}.col-7[_ngcontent-%COMP%], .col-8[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%], .col-12[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important;padding-left:0!important;padding-right:0!important}.d-flex[_ngcontent-%COMP%]{flex-direction:column!important;align-items:stretch!important;gap:1rem}.w-75[_ngcontent-%COMP%], .w-100[_ngcontent-%COMP%]{width:100%!important;max-width:100%!important}.oapi-highlight-card[_ngcontent-%COMP%]{margin-top:1rem}.oapi-table-wrap[_ngcontent-%COMP%], .oapi-raw[_ngcontent-%COMP%]{max-height:400px}}@media(max-width:400px){.card-header[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{font-size:1rem}.oapi-raw[_ngcontent-%COMP%]{font-size:.85rem}}"],changeDetection:0})}}return t})();export{Ie as OrderApiComponent};
@@ -1 +1 @@
1
- import{b as P}from"./chunk-BRCPY2BN.js";import"./chunk-BGFEVOPZ.js";import{b as R}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import{b as I,e as M,g as T}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as g,D as y,z as b}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Ic as n,Jc as d,Kc as _,V as h,Xb as c,Zb as m,cc as D,dc as i,ec as t,ed as p,fd as E,gb as o,gd as f,ha as s,r as x,tc as u,yb as C}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function w(a,v){if(a&1&&(i(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e.Perflog)}}function k(a,v){if(a&1&&(i(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"StackTrace"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e==null?null:e.StackTrace)}}function B(a,v){if(a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),n(3,"Back"),t()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),n(11,"General"),t()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),n(17,"Created Date"),t(),i(18,"div")(19,"span"),n(20),p(21,"date"),t()()()(),i(22,"div",9)(23,"div",10)(24,"label"),n(25,"Status"),t(),i(26,"div")(27,"span"),n(28),t()()()()(),i(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),n(33,"Duration"),t(),i(34,"div")(35,"span"),n(36),p(37,"number"),t()()()(),i(38,"div",9)(39,"div",10)(40,"label"),n(41,"Label"),t(),i(42,"div")(43,"span"),n(44),t()()()()()()()()(),i(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),n(50,"Message"),t()(),i(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),n(55),t()()()()()(),c(56,w,10,1,"div",9),c(57,k,10,1,"div",15),t()()()()),a&2){let e=v;D("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(f(21,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",f(37,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m(e!=null&&e.Perflog?56:-1),o(),m(e!=null&&e.StackTrace?57:-1)}}var J=(()=>{class a{constructor(){this.activatedRoute=s(I),this.notificationService=s(P)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(h(e=>{let l=e.ID;return this.notificationService.getNotificationDetail(l).pipe(x(r=>(r.DurationInSecond=parseInt(r.Duration)/1e3,r)))}))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275cmp=C({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(l,r){if(l&1&&(c(0,B,58,16,"mainpanel",0),p(1,"async")),l&2){let S;m((S=E(1,1,r.notification$))?0:-1,S)}},dependencies:[R,T,M,b,g,y],encapsulation:2,changeDetection:0})}}return a})();export{J as DetailComponent};
1
+ import{b as P}from"./chunk-AUPM35MA.js";import"./chunk-BGFEVOPZ.js";import{b as R}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import"./chunk-7HUEGPJN.js";import"./chunk-ZE4OOGMT.js";import{b as I,e as M,g as T}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B as g,D as y,z as b}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Ic as n,Jc as d,Kc as _,V as h,Xb as c,Zb as m,cc as D,dc as i,ec as t,ed as p,fd as E,gb as o,gd as f,ha as s,r as x,tc as u,yb as C}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";function w(a,v){if(a&1&&(i(0,"div",9)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"Perflog"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e.Perflog)}}function k(a,v){if(a&1&&(i(0,"div",15)(1,"div",12)(2,"div",6)(3,"h5"),n(4,"StackTrace"),t()(),i(5,"div",7)(6,"div",13)(7,"div",14)(8,"pre"),n(9),t()()()()()()),a&2){let e=u();o(9),d(e==null?null:e.StackTrace)}}function B(a,v){if(a&1&&(i(0,"mainpanel",0)(1,"actions")(2,"a",1),n(3,"Back"),t()(),i(4,"content")(5,"div",2)(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"h5"),n(11,"General"),t()(),i(12,"div",7)(13,"div",8)(14,"div",9)(15,"div",10)(16,"label"),n(17,"Created Date"),t(),i(18,"div")(19,"span"),n(20),p(21,"date"),t()()()(),i(22,"div",9)(23,"div",10)(24,"label"),n(25,"Status"),t(),i(26,"div")(27,"span"),n(28),t()()()()(),i(29,"div",11)(30,"div",9)(31,"div",10)(32,"label"),n(33,"Duration"),t(),i(34,"div")(35,"span"),n(36),p(37,"number"),t()()()(),i(38,"div",9)(39,"div",10)(40,"label"),n(41,"Label"),t(),i(42,"div")(43,"span"),n(44),t()()()()()()()()(),i(45,"div",3)(46,"div",9)(47,"div",12)(48,"div",6)(49,"h5"),n(50,"Message"),t()(),i(51,"div",7)(52,"div",13)(53,"div",14)(54,"pre"),n(55),t()()()()()(),c(56,w,10,1,"div",9),c(57,k,10,1,"div",15),t()()()()),a&2){let e=v;D("headerTitle","Notification "+e.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),o(20),d(f(21,10,e.Created,"dd MMM yyyy HH:mm:ss")),o(8),d(e.StatusLabel),o(8),_("",f(37,13,e.DurationInSecond,"1.1-1")," s"),o(8),d(e.Label),o(11),d(e.Message),o(),m(e!=null&&e.Perflog?56:-1),o(),m(e!=null&&e.StackTrace?57:-1)}}var J=(()=>{class a{constructor(){this.activatedRoute=s(I),this.notificationService=s(P)}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(h(e=>{let l=e.ID;return this.notificationService.getNotificationDetail(l).pipe(x(r=>(r.DurationInSecond=parseInt(r.Duration)/1e3,r)))}))}static{this.\u0275fac=function(l){return new(l||a)}}static{this.\u0275cmp=C({type:a,selectors:[["app-detail"]],decls:2,vars:3,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/products/status/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],[1,"col-sm-12"]],template:function(l,r){if(l&1&&(c(0,B,58,16,"mainpanel",0),p(1,"async")),l&2){let S;m((S=E(1,1,r.notification$))?0:-1,S)}},dependencies:[R,T,M,b,g,y],encapsulation:2,changeDetection:0})}}return a})();export{J as DetailComponent};
@@ -0,0 +1,17 @@
1
+ import{a as ye,b as Te,c as Se,d as xe,e as Ie,f as Ne,g as Fe,h as Ve,j as Be}from"./chunk-LLMHCE7Y.js";import"./chunk-DCGQK4V6.js";import{a as Le,b as Re}from"./chunk-DEBF436Y.js";import"./chunk-RZM45AEI.js";import{b as Pe}from"./chunk-H276HPOG.js";import{a as we}from"./chunk-SJBVLNCR.js";import{a as De}from"./chunk-RBEQRGC3.js";import"./chunk-P2ISUSTI.js";import"./chunk-W3ZGCYFJ.js";import{a as ze}from"./chunk-IO5P3Z5D.js";import"./chunk-FBOJCUGO.js";import"./chunk-VGVK74K7.js";import"./chunk-EPY6UT4Z.js";import{a as ke}from"./chunk-2KBEFXEF.js";import{c as Ee,g as Me}from"./chunk-O476ULLD.js";import{d as ve}from"./chunk-HBAHB3P5.js";import{a as Ce}from"./chunk-5BO5IGZG.js";import"./chunk-CP5ER4QN.js";import"./chunk-TZFPNLRF.js";import"./chunk-BGFEVOPZ.js";import"./chunk-HY5QRLIV.js";import"./chunk-AWU3GJLO.js";import{f as _e}from"./chunk-KRIYDIQQ.js";import{b as be}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import{ra as Q,sa as j}from"./chunk-7LEHDN2Q.js";import{a as q,c as fe}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{a as he}from"./chunk-ZSUWHVKX.js";import{f as pe}from"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import{b as de,c as ce}from"./chunk-MDHMVGYC.js";import{c as D}from"./chunk-NNVT5X6O.js";import{b as ue,h as me,m as ge,z as O}from"./chunk-7HUEGPJN.js";import{b as B,e as se}from"./chunk-ZE4OOGMT.js";import"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{D as re,F as ae}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{Aa as E,Eb as w,Fc as S,Ic as d,Jc as le,Kc as _,Mc as U,Nc as $,Oc as G,Vc as W,Wc as V,Xb as N,Xc as z,Y as K,Zb as F,_b as ie,ac as ne,bc as oe,ca as P,cc as m,da as Y,db as R,dc as o,ec as r,ed as x,fc as T,fd as I,gb as a,ha as C,id as L,jc as k,kc as M,mc as v,oa as f,pa as b,r as Z,rc as y,tc as s,ua as ee,yb as A,zb as te}from"./chunk-5VYDZBNH.js";import"./chunk-QWWW7GFA.js";var Oe=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=te({type:n});static \u0275inj=Y({imports:[ae,Ne,Me,Ee,ye,Te,Se,Ie,xe,Pe,Ce,ve,we,ze,j,O,_e,j]})}return n})();var He=(()=>{class n{constructor(){this.toastrService=C(B)}showToastrUploadMultiple(e,i){let t=[],l=[],p=null,u=this.getResponseList(e);if(e.filter(h=>D.IsNotEmpty(h)).forEach(h=>{typeof h?.Response=="string"?l=[...l,u.length>1?this.setHtmlli(h.Response):this.setHtmlli(h.Response,!1)]:(h?.Response?.Success_list.forEach(g=>{t=[...t,u.length>1?this.setHtmlli(i?i(g,h.Channel):`
2
+ <div>
3
+ Product ${g.Name} was <div class="d-inline fw-bold">successfully</div> uploaded to ${h.Channel}
4
+ </div>
5
+ `):this.setHtmlli(i?i(g,h.Channel):`
6
+ <div>
7
+ Product ${g.Name} was <div class="d-inline fw-bold">successfully</div> uploaded to ${h.Channel}
8
+ </div>
9
+ `,!1)]}),h?.Response.Fail_list.forEach(g=>{l=[...l,u.length>1?this.setHtmlli(`<b>${g.Name}</b> - ${g.Message}`):this.setHtmlli(`<b>${g.Name}</b> - ${g.Message}`,!1)],g?.Title&&(p=g.Title)}))}),l.length>0&&t.length>0){let h=[...t,...l];this.toastrService.warning(this.concatMessage(h),"Warning!",{enableHtml:!0})}else if(t.length>0&&l.length==0)this.toastrService.success(this.concatMessage(t),"Success",{enableHtml:!0});else{let h=this.concatMessage(l);if(this.isValidJson(h)){let g=JSON.parse(h)?.message;h=g||h}this.toastrService.error(`
10
+ <div style="word-wrap: break-word">
11
+ ${h}
12
+ </div>
13
+ `,p||"Upload Failed",{enableHtml:!0})}}isValidJson(e){try{return JSON.parse(e),!0}catch{return!1}}concatMessage(e=[]){let i="";return e.forEach(t=>{i+=t}),e.length>1?`<ol>${i}</ol>`:i}getResponseList(e){let i=[];return e.filter(t=>D.IsNotEmpty(t)).forEach(t=>{typeof t.Response=="string"?i=[...i,t.Response]:(t?.Response.Success_list.forEach(l=>{i=[...i,l.Name]}),t?.Response.Fail_list.forEach(l=>{i=[...i,l.Message]}))}),i}setHtmlli(e,i=!0){return i?`<li>${e}</li>`:e}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var X=(()=>{class n{constructor(){this.httpSerivice=C(se),this.toastrHandlingService=C(He),this.toastr=C(B)}getChannelSummary$(e=[]){return this.httpSerivice.post("api/inventory/InventorySummary",{ListChannelID:e}).pipe(Z(i=>i.Data.map((t,l)=>(t.id=l,t.Img=D.getChannelLogoByTypeId(t.Type),t.Groups=this.groupingProductByOutlet(t.Products),t.LocationNames=this.groupingLocationName(t.Groups),t))))}groupingProductByOutlet(e){let i=null;return D.IsNotEmpty(e[0].Outlet)&&(i=e.reduce((t,l)=>{let p=l.Outlet;return t[p]||(t[p]=[]),t[p].push(l),t},{})),i}groupingLocationName(e){let i=[];return e&&(i=Object.keys(e).map(t=>t)),i}refreshInventory(e,i){let t={ChannelItemID:e.ChannelItemID,ChannelVariationID:e.ChannelVariationID,ChannelID:i,VariantID:e.POSVariantID};return this.httpSerivice.post("/api/Inventory/RefreshInventoryChannel",t).pipe(K(()=>{this.toastr.success("Inventory refreshed successfully","Success")}))}updateChannelInventory(e){let i=this.mappingPayloadUpdateInventory(e);return this.httpSerivice.post("/api/Inventory/UpdateChannel",i).pipe(K(t=>{this.toastrHandlingService.showToastrUploadMultiple(t,this.customizeToastrMessage)}))}customizeToastrMessage(e,i){return`
14
+ <div>
15
+ Product ${e.Name} was <div class="d-inline fw-bold">successfully</div> updated to ${i}
16
+ </div>
17
+ `}mappingPayloadUpdateInventory(e){let i=[],t=[];return e.filter(p=>p.Products.some(u=>u.Selected)).forEach(p=>{p.Products.filter(u=>u.Selected).forEach(u=>{i.push({ChannelItemID:u.ChannelItemID,ChannelVariationID:u.ChannelVariationID,Inventory:u.InventoryPOS,LocationID:u.LocationID})}),t.push(p.ChannelID)}),{ListChannelID:t,List:i}}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=P({token:n,factory:n.\u0275fac})}}return n})();var Ke=()=>[],Ae=()=>({"min-width":"60rem"}),H=n=>[n];function Ue(n,c){if(n&1){let e=v();o(0,"button",13),y("click",function(){let t=f(e),l=s(2);return b(l.onUpdateInventory(t))}),T(1,"i",14),d(2," Update "),r()}}function $e(n,c){if(n&1&&N(0,Ue,3,0,"button",12),n&2){let e,i=s();F((e=i.inventories.value())?0:-1,e)}}function Ge(n,c){n&1&&(o(0,"tr"),T(1,"th",15),o(2,"th"),d(3,"Channel"),r(),o(4,"th",16),d(5,"Sold In Channel"),r(),o(6,"th",17),d(7," Different Inventory "),r()())}function We(n,c){if(n&1&&(o(0,"tr",18)(1,"td"),T(2,"p-button",19),r(),o(3,"td"),T(4,"img",20),o(5,"span"),d(6),r()(),o(7,"td",21),d(8),r(),o(9,"td",21),d(10),r()()),n&2){let e=c.$implicit,i=c.expanded;a(2),m("pRowToggler",e)("text",!0)("rounded",!0)("plain",!0)("icon",i?"fa-solid fa-chevron-down":"fa fa-chevron-right"),a(2),m("src",e.Img,R),a(2),_(" ",e.ChannelName," "),a(2),_(" ",e.SoldInChannel," "),a(2),_(" ",e==null||e.Products==null?null:e.Products.length," ")}}function Qe(n,c){if(n&1){let e=v();k(0),o(1,"th",30)(2,"div",31)(3,"input",32),y("change",function(t){f(e);let l=s(3).$implicit,p=s();return b(p.onCheckAllProduct(t==null||t.target==null?null:t.target.checked,l.Products))}),r()()(),M()}}function je(n,c){if(n&1&&(o(0,"tr"),w(1,Qe,4,0,"ng-container",26),o(2,"th"),d(3,"Product"),r(),o(4,"th",27),d(5,"Code"),r(),o(6,"th",28),d(7,"POS"),r(),o(8,"th",28),d(9," Reserved "),r(),o(10,"th",29),d(11," Channel "),r()()),n&2){let e=s(3);a(),m("ngxPermissionsOnly",z(1,H,e.inventoryUpdateRole))}}function qe(n,c){if(n&1){let e=v();k(0),o(1,"td")(2,"div",31)(3,"input",43),G("ngModelChange",function(t){f(e);let l=s().$implicit;return $(l.Selected,t)||(l.Selected=t),b(t)}),y("ngModelChange",function(){f(e);let t=s(4).$implicit,l=s();return b(l.onCheckProduct(t==null?null:t.Products))}),r()()(),M()}if(n&2){let e=s().$implicit;a(3),U("ngModel",e.Selected)}}function Je(n,c){if(n&1){let e=v();o(0,"tr"),w(1,qe,4,1,"ng-container",26),o(2,"td"),d(3),r(),o(4,"td"),d(5),r(),o(6,"td",21),d(7),x(8,"number"),r(),o(9,"td",21),d(10),x(11,"number"),r(),o(12,"td",36)(13,"div",37)(14,"div"),d(15),x(16,"number"),r(),o(17,"div",38)(18,"a",39),T(19,"i",40),r()(),o(20,"div",38)(21,"span",41),y("click",function(){let t=f(e).$implicit,l=s(3).$implicit,p=s();return b(p.onRefreshInventory(t,l==null?null:l.ChannelID))}),T(22,"i",42),r()()()()()}if(n&2){let e=c.$implicit,i=s().rowIndex,t=s(2).$implicit,l=s();S("child-border",i!==(t==null||t.Products==null?null:t.Products.length)-1),a(),m("ngxPermissionsOnly",z(15,H,l.inventoryUpdateRole)),a(2),le(e.Name),a(2),_(" ",e.Code," "),a(2),_(" ",I(8,9,e.InventoryPOS)," "),a(3),_(" ",I(11,11,e.InventoryReserved)," "),a(5),_(" ",I(16,13,e.InventoryChannel)," "),a(3),m("href",e==null?null:e.URL_External,R)}}function Xe(n,c){if(n&1&&(o(0,"tr")(1,"td",33)(2,"h4",34),d(3),r()()(),ne(4,Je,23,17,"tr",35,ie)),n&2){let e=c.$implicit,i=c.rowIndex,t=s(2).$implicit;S("child-border",i!==(t==null||t.Products==null?null:t.Products.length)-1),a(3),_(" ",e," "),a(),oe(t.Groups[e])}}function Ze(n,c){if(n&1&&(o(0,"p-table",23),w(1,je,12,3,"ng-template",24)(2,Xe,6,3,"ng-template",25),r()),n&2){let e=s().$implicit;m("value",e.LocationNames)}}function Ye(n,c){if(n&1){let e=v();k(0),o(1,"th",30)(2,"div",31)(3,"input",32),y("change",function(t){f(e);let l=s(3).$implicit,p=s();return b(p.onCheckAllProduct(t==null||t.target==null?null:t.target.checked,l.Products))}),r()()(),M()}}function et(n,c){if(n&1&&(o(0,"tr"),w(1,Ye,4,0,"ng-container",26),o(2,"th"),d(3,"Product"),r(),o(4,"th",27),d(5,"Code"),r(),o(6,"th",28),d(7,"POS"),r(),o(8,"th",28),d(9," Reserved "),r(),o(10,"th",29),d(11," Channel "),r()()),n&2){let e=s(3);a(),m("ngxPermissionsOnly",z(1,H,e.inventoryUpdateRole))}}function tt(n,c){if(n&1){let e=v();k(0),o(1,"td")(2,"div",31)(3,"input",43),G("ngModelChange",function(t){f(e);let l=s().$implicit;return $(l.Selected,t)||(l.Selected=t),b(t)}),y("ngModelChange",function(){f(e);let t=s(3).$implicit,l=s();return b(l.onCheckProduct(t==null?null:t.Products))}),r()()(),M()}if(n&2){let e=s(),i=e.$implicit,t=e.rowIndex,l=s(2).$implicit;a(),S("child-border",t==(l==null||l.Products==null?null:l.Products.length)-1),a(2),U("ngModel",i.Selected)}}function it(n,c){if(n&1){let e=v();o(0,"tr"),w(1,tt,4,3,"ng-container",26),o(2,"td"),d(3),r(),o(4,"td"),d(5),r(),o(6,"td",21),d(7),x(8,"number"),r(),o(9,"td",21),d(10),x(11,"number"),r(),o(12,"td",36)(13,"div",37)(14,"div"),d(15),x(16,"number"),r(),o(17,"div",38)(18,"a",39),T(19,"i",40),r()(),o(20,"div",38)(21,"span",41),y("click",function(){let t=f(e).$implicit,l=s(2).$implicit,p=s();return b(p.onRefreshInventory(t,l==null?null:l.ChannelID))}),T(22,"i",42),r()()()()()}if(n&2){let e=c.$implicit,i=c.rowIndex,t=s(2).$implicit,l=s();S("child-border",i==(t==null||t.Products==null?null:t.Products.length)-1),a(),m("ngxPermissionsOnly",z(23,H,l.inventoryUpdateRole)),a(),S("child-border",i==(t==null||t.Products==null?null:t.Products.length)-1),a(),_(" ",e.Name," "),a(2),_(" ",e.Code," "),a(),S("child-border",i==(t==null||t.Products==null?null:t.Products.length)-1),a(),_(" ",I(8,17,e.InventoryPOS)," "),a(2),S("child-border",i==(t==null||t.Products==null?null:t.Products.length)-1),a(),_(" ",I(11,19,e.InventoryReserved)," "),a(2),S("child-border",i==(t==null||t.Products==null?null:t.Products.length)-1),a(3),_(" ",I(16,21,e.InventoryChannel)," "),a(3),m("href",e==null?null:e.URL_External,R)}}function nt(n,c){if(n&1&&(o(0,"p-table",23),w(1,et,12,3,"ng-template",24)(2,it,23,25,"ng-template",25),r()),n&2){let e=s().$implicit;m("value",e.Products)}}function ot(n,c){if(n&1&&(o(0,"tr"),T(1,"td"),o(2,"td",22)(3,"div"),N(4,Ze,3,1,"p-table",23)(5,nt,3,1,"p-table",23),r()()()),n&2){let e=c.$implicit;a(4),F(e.Groups?4:5)}}var Ei=(()=>{class n{constructor(){this.channelSummaryService=C(X),this.authService=C(pe),this.destroyRef=C(ee),this.channelOptions=E(this.authService.getChannels()),this.filteredChannels=E([]),this.reloadToken=E(0),this.inventories=fe({params:()=>this.reloadToken(),stream:()=>this.channelSummaryService.getChannelSummary$(this.filteredChannels())}),this.inventoryUpdateRole=he.InventoryUpdate,this.hasSelectedProducts=E(!1),this.expandedRows=E({})}onCheckAllProduct(e,i){this.hasSelectedProducts.set(e),i=i.map(t=>t.Selected=e)}onCheckProduct(e=[]){this.hasSelectedProducts.set(e.some(i=>i.Selected))}onFilter(){this.reloadToken.update(e=>e+1)}onUpdateInventory(e){this.channelSummaryService.updateChannelInventory(e).pipe(q(this.destroyRef)).subscribe(()=>this.reloadToken.update(i=>i+1))}onRefreshInventory(e,i){this.channelSummaryService.refreshInventory(e,i).pipe(q(this.destroyRef)).subscribe(()=>this.reloadToken.update(t=>t+1))}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=A({type:n,selectors:[["app-channel-summary"]],features:[W([X])],decls:20,vars:9,consts:[["header",""],["body",""],["expandedrow",""],["headerTitle","Different Inventory","filterDialogWidth","625px",3,"onSubmit","hideSearchBox"],[1,"dialog-filter","grid-filter"],[1,"filter-item","full"],[3,"ngModelChange","multiple","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["dataKey","id",3,"expandedRowKeysChange","value","tableStyle","expandedRowKeys"],["pTemplate","rowexpansion"],[1,"btn","btn-success"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[2,"width","10px"],[1,"text-end",2,"width","200px"],[1,"text-end",2,"width","432px"],[1,"parent-border-bottom"],["type","button","pRipple","",3,"pRowToggler","text","rounded","plain","icon"],[1,"me-2",2,"width","20px",3,"src"],[1,"text-end"],["colspan","3",1,"py-8",2,"padding-right","0px"],["dataKey","id",3,"value"],["pTemplate","header"],["pTemplate","body"],[4,"ngxPermissionsOnly"],[2,"width","270px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","270px"],[2,"width","1rem"],[1,"d-flex","align-items-center","justify-content-center"],["type","checkbox",3,"change"],["colspan","5"],[1,"w-100","text-center","fw-normal","text-uppercase"],[3,"child-border"],[1,"text-end","bg-gradient-warning"],[1,"d-flex","align-items-center","justify-content-end"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(i,t){if(i&1){let l=v();o(0,"mainpanel",3),y("onSubmit",function(){return f(l),b(t.onFilter())}),o(1,"actions"),N(2,$e,1,1),r(),o(3,"filters")(4,"div",4)(5,"div",5)(6,"h6"),d(7,"Channel"),r(),o(8,"app-channel-options-v2",6),y("ngModelChange",function(u){return f(l),b(t.filteredChannels.set(u))}),r()()()(),o(9,"content")(10,"div",7)(11,"div",8)(12,"div",9)(13,"p-table",10),y("expandedRowKeysChange",function(u){return f(l),b(t.expandedRows.set(u))}),w(14,Ge,8,0,"ng-template",null,0,L)(16,We,11,9,"ng-template",null,1,L)(18,ot,6,1,"ng-template",11,2,L),r()()()()()()}i&2&&(m("hideSearchBox",!0),a(2),F(t.hasSelectedProducts()?2:-1),a(6),m("multiple",!0)("ngModel",t.filteredChannels()),a(5),m("value",t.inventories.value()??V(7,Ke))("tableStyle",V(8,Ae))("expandedRowKeys",t.expandedRows()))},dependencies:[be,Be,Fe,Q,Ve,Re,Le,O,ue,me,ge,ke,Oe,ce,de,De,re],styles:[".p-datatable .p-datatable-thead>tr>th{color:#3b3b3b!important;font-size:12px!important;text-transform:uppercase!important;background:#f4f4f4!important;padding:.571rem .857rem!important;border-width:0} p-table .p-datatable-tbody>tr.parent-border-bottom{border-bottom-width:1px;border-color:#dee2e6} p-table .p-datatable-tbody>tr.child-border, td.child-border{border-bottom:none!important} p-table .p-datatable-tbody>tr>td{font-size:14px!important} p-table .p-datatable-tbody>tr>th{font-family:Roboto,system-ui!important;font-weight:400;font-style:normal} p-button .p-button-icon{font-size:.8rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 20px;width:100%}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{margin-bottom:6px}.dialog-filter.grid-filter[_ngcontent-%COMP%] .filter-item.full[_ngcontent-%COMP%]{grid-column:1/-1}.dialog-filter.grid-filter[_ngcontent-%COMP%] app-channel-options-v2[_ngcontent-%COMP%]{min-width:0!important;width:100%!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] .p-multiselect, .dialog-filter.grid-filter[_ngcontent-%COMP%] .p-select{box-sizing:border-box;width:100%!important;height:40px!important;min-height:40px!important;--p-multiselect-padding-y: 8px;--p-select-padding-y: 8px;border:1px solid #ccc!important;border-radius:4px!important;font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] .p-multiselect:not(.p-disabled):hover, .dialog-filter.grid-filter[_ngcontent-%COMP%] .p-select:not(.p-disabled):hover{border-color:#ccc}.dialog-filter.grid-filter[_ngcontent-%COMP%] .p-multiselect-label, .dialog-filter.grid-filter[_ngcontent-%COMP%] .p-select-label{font-size:.875rem!important}.dialog-filter.grid-filter[_ngcontent-%COMP%] .p-multiselect .p-multiselect-chip{font-size:.75rem!important}"],changeDetection:0})}}return n})();export{Ei as ChannelSummaryComponent};
@@ -1 +1 @@
1
- import{a as ne}from"./chunk-5PXKFEXJ.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-WM7WOQJI.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{c as S}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as G}from"./chunk-5BB6TB2H.js";import"./chunk-3644CQOR.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as J,h as U,m as $,o as K,z as Q}from"./chunk-7HUEGPJN.js";import{e as H}from"./chunk-ZE4OOGMT.js";import{e as j}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as F,Aa as s,Da as D,Ea as L,Eb as w,Ic as l,Jc as O,Kc as _,Wc as z,Xb as C,Xc as V,Y as T,Zb as x,ac as R,bc as k,cc as d,db as E,dc as n,ec as i,ed as A,fc as v,gb as r,gd as q,ha as b,l as N,mc as P,oa as y,pa as M,rc as c,tc as h,yb as I}from"./chunk-5VYDZBNH.js";import{a as u,b as f}from"./chunk-QWWW7GFA.js";var ie=()=>["/menu/log/exception/detail"],oe=o=>({ID:o});function ae(o,g){if(o&1&&(n(0,"span",17),v(1,"img",18),i(),l(2)),o&2){let e=g.item;r(),d("src",e.Img,E)("alt",e.Name),r(),_(" ",e.Name," ")}}function re(o,g){if(o&1&&v(0,"img",23),o&2){let e=h().$implicit;d("src",e.Logo,E)}}function le(o,g){if(o&1&&(n(0,"tr")(1,"td"),C(2,re,1,1,"img",23),l(3),i(),n(4,"td")(5,"a",24),l(6),i()(),n(7,"td"),l(8),A(9,"date"),i(),n(10,"td")(11,"div"),l(12),i()()()),o&2){let e=g.$implicit;r(2),x(e.Logo?2:-1),r(),_(" ",e.ChannelName," "),r(2),d("routerLink",z(10,ie))("queryParams",V(11,oe,e.id)),r(),_(" ",e.number??"N/A"," "),r(2),_(" ",q(9,7,e.date,"dd-MM-yyyy hh:mm:ss")," "),r(4),O(e.response)}}function me(o,g){if(o&1){let e=P();n(0,"mat-paginator",25),c("page",function(t){y(e);let m=h(2);return M(m.onPaginationChange(t))}),i()}if(o&2){let e=h(2);d("length",e.pageTotal())("pageSize",e.pageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,g){if(o&1&&(n(0,"div",15)(1,"table",19)(2,"thead")(3,"tr",20)(4,"th",21),l(5,"Channel Name"),i(),n(6,"th",21),l(7,"Number"),i(),n(8,"th",21),l(9,"Date"),i(),n(10,"th"),l(11,"Exception"),i()()(),n(12,"tbody"),R(13,le,13,13,"tr",null,F),i()(),C(15,me,1,3,"mat-paginator",22),i()),o&2){let e,a=h();r(13),k(a.exceptions()),r(2),x(((e=a.exceptions())==null?null:e.length)>0?15:-1)}}function de(o,g){o&1&&(n(0,"div",16),v(1,"app-empty-state"),i())}var Ie=(()=>{class o{loadExceptions(){return this.http.post("/api/Orders/GetExceptionList",this.filter()).pipe(T(e=>{this.exceptions.set(e.hits.map(a=>{let t=a._source||{};return{id:a._id,ChannelName:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Name:t.shopId,Logo:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Img:null,number:t.error?.number,date:t["@timestamp_received"]||t["@timestamp"]||null,stackTrace:t.error?.stackTrace,response:t.error?.response,message:t.message,requestJSON:t.error?.requestJSON}})),this.pageTotal.set(e.total?.value),this.pageSize.set(this.filter().RowCount>this.pageTotal()?this.pageTotal():this.filter()?.RowCount)}))}constructor(){this.http=b(H),this.authService=b(G),this.exceptions=s([]),this.pageTotal=s(0),this.pageSize=s(0),this.filter=s({RowCount:50,PageNumber:1,Number:null,From:null,To:null,ChannelID:null}),this.channelOptions=s(this.authService.getChannels()),this.loaderResource=S({params:()=>0,stream:()=>this.http.post("/api/OrdersLoader/Get",{})}),this.reloadToken=s(0),this.filterReady=s(!1),this.resource=S({params:()=>({token:this.reloadToken(),loader:this.loaderResource.value(),ready:this.filterReady()}),stream:({params:e})=>!e.loader||!e.ready?N([]):this.loadExceptions()}),D(()=>{let e=this.loaderResource.value();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.filterReady.set(!0),L(()=>this.getData()))})}getData(e){this.filter.update(a=>f(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}onPaginationChange(e){this.filter.update(a=>f(u({},a),{PageNumber:e.pageIndex+1})),this.getData()}updateFilter(e,a){this.filter.update(t=>f(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=I({type:o,selectors:[["app-exception-log"]],decls:28,vars:8,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...",3,"onSubmit"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","10%"],[3,"length","pageSize","pageIndex"],["alt","Logo",2,"width","18px",3,"src"],[3,"routerLink","queryParams"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&(n(0,"mainpanel",0),c("onSubmit",function(p){return t.getData(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),c("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),w(6,ae,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),c("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),c("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),c("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),c("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),C(26,pe,16,1,"div",15)(27,de,2,0,"div",16),i()()()()()),a&2&&(r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),x(t.exceptions().length>0?26:27))},dependencies:[W,Z,Q,J,K,U,$,X,Y,te,j,ne,ee,B],encapsulation:2,changeDetection:0})}}return o})();export{Ie as ExceptionLogComponent};
1
+ import{a as ne}from"./chunk-5PXKFEXJ.js";import{a as te}from"./chunk-ZLMUYIKY.js";import"./chunk-WM7WOQJI.js";import"./chunk-ON5KFKHE.js";import{a as ee}from"./chunk-EYHQ2ZKL.js";import"./chunk-BGFEVOPZ.js";import{a as X,b as Y,d as Z}from"./chunk-474G6BPL.js";import{b as W}from"./chunk-636FAHVP.js";import"./chunk-7BDGR7WQ.js";import"./chunk-TFTF5VH3.js";import"./chunk-CBPURQKN.js";import"./chunk-7RKWOSCN.js";import"./chunk-3RA4CRAW.js";import"./chunk-W55ZHKHY.js";import"./chunk-P6EVJYEB.js";import"./chunk-DXXROE3I.js";import"./chunk-3X54ZT7P.js";import"./chunk-GDOAWQKS.js";import"./chunk-TIHANIPI.js";import"./chunk-PF3J5XPT.js";import"./chunk-IRNBEBQA.js";import"./chunk-P2HR36CY.js";import"./chunk-NCZ46DU6.js";import"./chunk-OUE6X2ER.js";import"./chunk-JYH45M2L.js";import"./chunk-SOTWA42R.js";import"./chunk-3OTK6GG2.js";import{c as S}from"./chunk-KFJBIBDQ.js";import"./chunk-KMY7VNWE.js";import"./chunk-NMXGNJWD.js";import{f as G}from"./chunk-OHSE4HCU.js";import"./chunk-XDMGP3CQ.js";import"./chunk-HQPDTUOR.js";import"./chunk-QXRG5XYP.js";import"./chunk-63X2BBS4.js";import"./chunk-MDHMVGYC.js";import"./chunk-NNVT5X6O.js";import{c as J,h as U,m as $,o as K,z as Q}from"./chunk-7HUEGPJN.js";import{e as H}from"./chunk-ZE4OOGMT.js";import{e as j}from"./chunk-56N77BXA.js";import"./chunk-I7RVCGXC.js";import{B}from"./chunk-QEN2WRFO.js";import"./chunk-ASFPLYOZ.js";import{$b as F,Aa as s,Da as D,Ea as L,Eb as w,Ic as l,Jc as O,Kc as _,Wc as z,Xb as C,Xc as V,Y as T,Zb as x,ac as R,bc as k,cc as d,db as E,dc as n,ec as i,ed as A,fc as v,gb as r,gd as q,ha as b,l as N,mc as P,oa as y,pa as M,rc as c,tc as h,yb as I}from"./chunk-5VYDZBNH.js";import{a as u,b as f}from"./chunk-QWWW7GFA.js";var ie=()=>["/menu/log/exception/detail"],oe=o=>({ID:o});function ae(o,g){if(o&1&&(n(0,"span",17),v(1,"img",18),i(),l(2)),o&2){let e=g.item;r(),d("src",e.Img,E)("alt",e.Name),r(),_(" ",e.Name," ")}}function re(o,g){if(o&1&&v(0,"img",23),o&2){let e=h().$implicit;d("src",e.Logo,E)}}function le(o,g){if(o&1&&(n(0,"tr")(1,"td"),C(2,re,1,1,"img",23),l(3),i(),n(4,"td")(5,"a",24),l(6),i()(),n(7,"td"),l(8),A(9,"date"),i(),n(10,"td")(11,"div"),l(12),i()()()),o&2){let e=g.$implicit;r(2),x(e.Logo?2:-1),r(),_(" ",e.ChannelName," "),r(2),d("routerLink",z(10,ie))("queryParams",V(11,oe,e.id)),r(),_(" ",e.number??"N/A"," "),r(2),_(" ",q(9,7,e.date,"dd-MM-yyyy hh:mm:ss")," "),r(4),O(e.response)}}function me(o,g){if(o&1){let e=P();n(0,"mat-paginator",25),c("page",function(t){y(e);let m=h(2);return M(m.onPaginationChange(t))}),i()}if(o&2){let e=h(2);d("length",e.pageTotal())("pageSize",e.pageSize())("pageIndex",e.filter().PageNumber==0?0:e.filter().PageNumber-1)}}function pe(o,g){if(o&1&&(n(0,"div",15)(1,"table",19)(2,"thead")(3,"tr",20)(4,"th",21),l(5,"Channel Name"),i(),n(6,"th",21),l(7,"Number"),i(),n(8,"th",21),l(9,"Date"),i(),n(10,"th"),l(11,"Exception"),i()()(),n(12,"tbody"),R(13,le,13,13,"tr",null,F),i()(),C(15,me,1,3,"mat-paginator",22),i()),o&2){let e,a=h();r(13),k(a.exceptions()),r(2),x(((e=a.exceptions())==null?null:e.length)>0?15:-1)}}function de(o,g){o&1&&(n(0,"div",16),v(1,"app-empty-state"),i())}var Ie=(()=>{class o{loadExceptions(){return this.http.post("/api/Orders/GetExceptionList",this.filter()).pipe(T(e=>{this.exceptions.set(e.hits.map(a=>{let t=a._source||{};return{id:a._id,ChannelName:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Name:t.shopId,Logo:t.channelId!=null?this.channelOptions().find(m=>m.ID===t.channelId)?.Img:null,number:t.error?.number,date:t["@timestamp_received"]||t["@timestamp"]||null,stackTrace:t.error?.stackTrace,response:t.error?.response,message:t.message,requestJSON:t.error?.requestJSON}})),this.pageTotal.set(e.total?.value),this.pageSize.set(this.filter().RowCount>this.pageTotal()?this.pageTotal():this.filter()?.RowCount)}))}constructor(){this.http=b(H),this.authService=b(G),this.exceptions=s([]),this.pageTotal=s(0),this.pageSize=s(0),this.filter=s({RowCount:50,PageNumber:1,Number:null,From:null,To:null,ChannelID:null}),this.channelOptions=s(this.authService.getChannels()),this.loaderResource=S({params:()=>0,stream:()=>this.http.post("/api/OrdersLoader/Get",{})}),this.reloadToken=s(0),this.filterReady=s(!1),this.resource=S({params:()=>({token:this.reloadToken(),loader:this.loaderResource.value(),ready:this.filterReady()}),stream:({params:e})=>!e.loader||!e.ready?N([]):this.loadExceptions()}),D(()=>{let e=this.loaderResource.value();e&&(this.filter.update(a=>u(u({},a),e.Filter)),this.filterReady.set(!0),L(()=>this.getData()))})}getData(e){this.filter.update(a=>f(u({},a),{Number:e})),this.reloadToken.update(a=>a+1)}onPaginationChange(e){this.filter.update(a=>f(u({},a),{PageNumber:e.pageIndex+1})),this.getData()}updateFilter(e,a){this.filter.update(t=>f(u({},t),{[e]:a}))}static{this.\u0275fac=function(a){return new(a||o)}}static{this.\u0275cmp=I({type:o,selectors:[["app-exception-log"]],decls:28,vars:8,consts:[["headerTitle","Exception Log","searchBoxPlaceHolder","Enter Number...",3,"onSubmit"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","RowCount",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","10%"],[3,"length","pageSize","pageIndex"],["alt","Logo",2,"width","18px",3,"src"],[3,"routerLink","queryParams"],[3,"page","length","pageSize","pageIndex"]],template:function(a,t){a&1&&(n(0,"mainpanel",0),c("onSubmit",function(p){return t.getData(p)}),n(1,"filters")(2,"div")(3,"label",1),l(4,"Channel"),i(),n(5,"ng-select",2),c("ngModelChange",function(p){return t.updateFilter("ChannelID",p)}),w(6,ae,3,3,"ng-template",3),i()(),n(7,"div",4)(8,"label",5),l(9,"From/To"),i(),n(10,"div",6)(11,"datepicker",7),c("dateChange",function(p){return t.updateFilter("From",p)}),i()(),n(12,"div")(13,"datepicker",8),c("dateChange",function(p){return t.updateFilter("To",p)}),i()()(),n(14,"div",4)(15,"label",9),l(16,"Page Number"),i(),n(17,"input",10),c("ngModelChange",function(p){return t.updateFilter("PageNumber",p)}),i()(),n(18,"div",4)(19,"label",9),l(20,"Page Size"),i(),n(21,"input",11),c("ngModelChange",function(p){return t.updateFilter("RowCount",p)}),i()()(),n(22,"content")(23,"div",12)(24,"div",13)(25,"div",14),C(26,pe,16,1,"div",15)(27,de,2,0,"div",16),i()()()()()),a&2&&(r(5),d("clearable",!0)("items",t.channelOptions())("ngModel",t.filter().ChannelID),r(6),d("date",t.filter().From),r(2),d("date",t.filter().To),r(4),d("ngModel",t.filter().PageNumber),r(4),d("ngModel",t.filter().RowCount),r(5),x(t.exceptions().length>0?26:27))},dependencies:[W,Z,Q,J,K,U,$,X,Y,te,j,ne,ee,B],encapsulation:2,changeDetection:0})}}return o})();export{Ie as ExceptionLogComponent};