marketplacepos 5.37.2 → 5.37.4

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 (37) hide show
  1. package/Marketplace/{chunk-F6Y7LJ64.js → chunk-2IHMLXWJ.js} +1 -1
  2. package/Marketplace/{chunk-S4D2PHBV.js → chunk-2Y4PYWHB.js} +1 -1
  3. package/Marketplace/{chunk-AVSGKP57.js → chunk-3DEMAMTN.js} +1 -1
  4. package/Marketplace/{chunk-R4FFSLZS.js → chunk-6ZT6G6ZX.js} +1 -1
  5. package/Marketplace/{chunk-HETMK7WT.js → chunk-74EGQDBL.js} +1 -1
  6. package/Marketplace/{chunk-KC2FFVLF.js → chunk-76DD4KTI.js} +1 -1
  7. package/Marketplace/{chunk-CIKNTHCR.js → chunk-7CIOGSCS.js} +1 -1
  8. package/Marketplace/{chunk-D7G7GVNH.js → chunk-7EO5MRBU.js} +1 -1
  9. package/Marketplace/{chunk-ZHKZ3QZP.js → chunk-7W2EWSOP.js} +1 -1
  10. package/Marketplace/{chunk-ZCGHEDGV.js → chunk-AMVY4XMB.js} +1 -1
  11. package/Marketplace/{chunk-JJFRUJBP.js → chunk-F3YTGLZT.js} +1 -1
  12. package/Marketplace/{chunk-MNMVQQPT.js → chunk-GVAPYZ7X.js} +1 -1
  13. package/Marketplace/{chunk-CAGSG3DY.js → chunk-H5DKI4F4.js} +1 -1
  14. package/Marketplace/{chunk-QP6X3QVC.js → chunk-IPEOCIUA.js} +1 -1
  15. package/Marketplace/chunk-IVX7QWP7.js +1 -0
  16. package/Marketplace/{chunk-64V4L3IJ.js → chunk-JNMDGK2M.js} +1 -1
  17. package/Marketplace/{chunk-XJIHUZS4.js → chunk-JTETVWNX.js} +1 -1
  18. package/Marketplace/{chunk-KEFQSTJD.js → chunk-K27IWV7V.js} +1 -1
  19. package/Marketplace/{chunk-TR23CMVW.js → chunk-K3RLIVYF.js} +1 -1
  20. package/Marketplace/{chunk-S45YFO7W.js → chunk-LBCJNHNR.js} +1 -1
  21. package/Marketplace/{chunk-K7LGJFCY.js → chunk-MH5AVQJR.js} +2 -2
  22. package/Marketplace/{chunk-GG2SCXTS.js → chunk-O55WNQN7.js} +1 -1
  23. package/Marketplace/{chunk-JGKNWNHJ.js → chunk-PNPQ4ROP.js} +1 -1
  24. package/Marketplace/{chunk-2H7UKR4Z.js → chunk-RDBEJJXU.js} +1 -1
  25. package/Marketplace/{chunk-UI3RKKVM.js → chunk-RG5P2GM3.js} +1 -1
  26. package/Marketplace/{chunk-TNQMLUO7.js → chunk-RX6VZ4IG.js} +1 -1
  27. package/Marketplace/{chunk-MV2W43TI.js → chunk-SE5GYDNR.js} +1 -1
  28. package/Marketplace/{chunk-KSJLJ53O.js → chunk-T2UNTDY6.js} +1 -1
  29. package/Marketplace/{chunk-C4ESA6DM.js → chunk-VOCVNYLC.js} +1 -1
  30. package/Marketplace/{chunk-77ESDFMO.js → chunk-WU7L6NYM.js} +2 -2
  31. package/Marketplace/{chunk-3YRPTVAF.js → chunk-XDB5B4VD.js} +1 -1
  32. package/Marketplace/{chunk-BTPFPDPR.js → chunk-YE6BUIS7.js} +1 -1
  33. package/Marketplace/{chunk-4EWARO65.js → chunk-ZEWJSXKY.js} +1 -1
  34. package/Marketplace/index.html +2 -2
  35. package/Marketplace/{main-TSXSJ6BP.js → main-6QPEM5JQ.js} +1 -1
  36. package/package.json +1 -1
  37. package/Marketplace/chunk-I6PVQBH3.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as Ke,b as G,c as He}from"./chunk-WHFC7TE4.js";import"./chunk-WBVTRQFG.js";import{a as $e,b as ze,c as Ye,e as Ge,f as Ue,g as je}from"./chunk-VAPIXIJ3.js";import"./chunk-3NMGN7IE.js";import"./chunk-B5JAZPVU.js";import"./chunk-OS53H77X.js";import{i as We,j as Re,k as Le,l as Be,m as Ae}from"./chunk-VOISFPEM.js";import{a as Ne}from"./chunk-EXFL3GUX.js";import"./chunk-6A4PYMCJ.js";import{a as Fe,b as Oe,c as ke}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-VKJAFLQ6.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-4RAOUTR2.js";import{c as Te,d as be,e as Ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{h as Z,j as ee}from"./chunk-CIKNTHCR.js";import{b as xe,e as De}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Me,m as Ve}from"./chunk-XOT2SZPE.js";import{r as Pe,s as Ie}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as Se,h as Ce,m as ve,y as ye}from"./chunk-AI4XRCAL.js";import{b as X,c as x}from"./chunk-W6T7TOHE.js";import{H as we,J as ge,d as R,f as L,g as B,j as J,k as q,n as F}from"./chunk-B6POIFQM.js";import{Ac as ue,Dc as T,Eb as M,Ec as l,Fc as V,Gc as C,Ic as E,Jc as P,Ka as j,Kb as w,Kc as I,Mc as K,Na as O,Oc as he,Pc as fe,Qa as _,Wb as d,Xc as W,Yc as Y,Z as $,Zc as _e,_c as H,aa as oe,bc as b,ea as z,gc as a,hc as r,ic as S,ja as le,jc as k,kc as N,m as ae,mc as y,ob as pe,od as Q,pa as v,qb as o,rc as g,sc as u,v as U,vc as se,wc as de,ya as m,yc as me,za as c,zc as ce}from"./chunk-EIQCOZF5.js";import{a as ne,b as re}from"./chunk-K2H6WANG.js";var Xe=t=>({"over-due":t});function Ze(t,s){if(t&1&&(a(0,"tr",8)(1,"td"),l(2),r(),a(3,"td"),l(4),r(),a(5,"td"),l(6),r(),a(7,"td"),l(8),r()()),t&2){let e=s.$implicit,n=s.index;d("ngClass",he(5,Xe,e.Exception)),o(2),V(n+1),o(2),V(e.Number),o(2),V(e.Status),o(2),V(e.Exception)}}function et(t,s){if(t&1&&(k(0),w(1,Ze,9,7,"tr",7),N()),t&2){let e,n=u();o(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function tt(t,s){t&1&&(a(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),r(),a(4,"h4",13),l(5," There is no order to processed "),r()()())}var Qe=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(a(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),a(6,"th"),l(7,"Order Number"),r(),a(8,"th"),l(9,"Status"),r(),a(10,"th"),l(11,"Exception"),r()()(),a(12,"tbody"),w(13,et,2,1,"ng-container",6)(14,tt,6,0,"ng-template",null,0,H),r()()()()),n&2){let p,h=T(15);o(13),d("ngIf",((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0)("ngIfElse",h)}},dependencies:[F,R,L,B],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(De),this.toastr=v(xe),this.datePipe=v(q)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(z(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):ae}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),p=e.TimeFrom?e.TimeFrom:"",h=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${h}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?x.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=x.formatTitleFromDate(new Date(e),new Date(n)),p=this.datePipe.transform(e,i),h=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${h}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac})}}return t})();function it(t,s){if(t&1&&(a(0,"ng-option",13),S(1,"img",14),l(2),r()),t&2){let e=s.$implicit;d("value",e.ID),o(),d("src",e==null?null:e.Img,pe),o(),C("",e.Name," ")}}function nt(t,s){if(t&1){let e=y();a(0,"div",8)(1,"div",4)(2,"h5"),l(3,"Type"),r(),a(4,"p",5),l(5,"Select Type want to download"),r()(),a(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),I("ngModelChange",function(i){m(e);let p=u();return P(p.downloadType,i)||(p.downloadType=i),c(i)}),g("ngModelChange",function(){m(e);let i=u();return c(i.onDownloadTypeChange())}),a(10,"mat-radio-button",17),l(11," Orders "),r(),a(12,"mat-radio-button",18),l(13," Disbursement "),r()()()(),a(14,"div",19)(15,"div",20),S(16,"i",21),r(),a(17,"p",22),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=u();o(9),E("ngModel",e.downloadType),o(),d("value",!1),o(2),d("value",!0)}}function rt(t,s){t&1&&(a(0,"p",5),l(1," Select Disbursement date "),a(2,"span",23),l(3,"(payment date / order complete date)"),r(),l(4," of the channel you want to download (Max 1 Week). "),r())}function at(t,s){t&1&&(a(0,"p",5),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function ot(t,s){if(t&1){let e=y();a(0,"div",12)(1,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.startTime,i)||(p.startTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onStartTimeChange())}),r(),a(2,"span",25),l(3,"-"),r(),a(4,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.endTime,i)||(p.endTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onEndTimeChange())}),r()()}if(t&2){let e=u();o(),E("time",e.startTime),o(3),E("time",e.endTime)}}var Je=(()=>{class t{constructor(){this.reset=O(!1),this.authService=v(ee),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0})}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(U(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A])],decls:27,vars:11,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=y();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),l(5,"Select a Channel"),r(),a(6,"p",5),l(7,"Select Channel want to download order"),r()(),a(8,"div",4)(9,"ng-select",6),I("ngModelChange",function(f){return m(p),P(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),g("ngModelChange",function(){return m(p),c(i.onSelectChannel())}),w(10,it,3,3,"ng-option",7),r()()(),w(11,nt,19,3,"div",8),W(12,"async"),a(13,"div",8)(14,"div",4)(15,"h5"),l(16,"Date Range"),r(),w(17,rt,5,0,"p",5)(18,at,2,0,"p",5),r(),a(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),I("ngModelChange",function(f){return m(p),P(i.startDate,f)||(i.startDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())}),r(),a(23,"input",11),I("ngModelChange",function(f){return m(p),P(i.endDate,f)||(i.endDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(p),c(i.onFilterDateChange())}),r()(),S(24,"mat-date-range-picker",null,0),r(),w(26,ot,5,2,"div",12),r()()()()}if(n&2){let p,h,f=T(25);o(9),d("clearable",!1),E("ngModel",i.selectedChannelId),o(),d("ngForOf",i.channelOptions()),o(),b((p=Y(12,9,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?11:-1),o(6),b(i.downloadType()&&((h=i.selectedChannel())==null?null:h.TypeID)==i.channelType.Tokopedia?17:18),o(4),d("rangePicker",f),o(),E("ngModel",i.startDate),o(),E("ngModel",i.endDate),o(3),b(i.showTimePicker()?26:-1)}},dependencies:[F,L,J,Ee,be,Te,ke,Fe,Oe,ye,Se,Ce,ve,He,Be,We,Ae,Re,Le],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var lt=(t,s)=>({"over-due-today":t,"over-due":s});function pt(t,s){if(t&1&&(a(0,"th",21),l(1),r()),t&2){let e=u();o(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function st(t,s){if(t&1&&(a(0,"td"),l(1),W(2,"date"),r()),t&2){let e=u().$implicit;o(),C(" ",_e(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function dt(t,s){if(t&1&&(a(0,"span"),l(1),r()),t&2){let e=u().$implicit;o(),C(" ",e.ActionString," ")}}function mt(t,s){if(t&1&&(a(0,"li"),l(1),r()),t&2){let e=s.$implicit;o(),C(" ",e," ")}}function ct(t,s){if(t&1&&(a(0,"ul",27),w(1,mt,2,1,"li",22),r()),t&2){let e=u().$implicit;o(),d("ngForOf",e.ActionString)}}function ut(t,s){if(t&1&&(a(0,"span",28),S(1,"i",29),r()),t&2){let e=u().$implicit;de("title","Delivery : ",e.DeliveryState,`
1
+ import{a as Ke,b as G,c as He}from"./chunk-WHFC7TE4.js";import"./chunk-WBVTRQFG.js";import{a as $e,b as ze,c as Ye,e as Ge,f as Ue,g as je}from"./chunk-VAPIXIJ3.js";import"./chunk-3NMGN7IE.js";import"./chunk-B5JAZPVU.js";import"./chunk-OS53H77X.js";import{i as We,j as Re,k as Le,l as Be,m as Ae}from"./chunk-VOISFPEM.js";import{a as Ne}from"./chunk-EXFL3GUX.js";import"./chunk-6A4PYMCJ.js";import{a as Fe,b as Oe,c as ke}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import"./chunk-VKJAFLQ6.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import"./chunk-4RAOUTR2.js";import{c as Te,d as be,e as Ee}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{h as Z,j as ee}from"./chunk-7CIOGSCS.js";import{b as xe,e as De}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{l as Me,m as Ve}from"./chunk-XOT2SZPE.js";import{r as Pe,s as Ie}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{c as Se,h as Ce,m as ve,y as ye}from"./chunk-AI4XRCAL.js";import{b as X,c as x}from"./chunk-W6T7TOHE.js";import{H as we,J as ge,d as R,f as L,g as B,j as J,k as q,n as F}from"./chunk-B6POIFQM.js";import{Ac as ue,Dc as T,Eb as M,Ec as l,Fc as V,Gc as C,Ic as E,Jc as P,Ka as j,Kb as w,Kc as I,Mc as K,Na as O,Oc as he,Pc as fe,Qa as _,Wb as d,Xc as W,Yc as Y,Z as $,Zc as _e,_c as H,aa as oe,bc as b,ea as z,gc as a,hc as r,ic as S,ja as le,jc as k,kc as N,m as ae,mc as y,ob as pe,od as Q,pa as v,qb as o,rc as g,sc as u,v as U,vc as se,wc as de,ya as m,yc as me,za as c,zc as ce}from"./chunk-EIQCOZF5.js";import{a as ne,b as re}from"./chunk-K2H6WANG.js";var Xe=t=>({"over-due":t});function Ze(t,s){if(t&1&&(a(0,"tr",8)(1,"td"),l(2),r(),a(3,"td"),l(4),r(),a(5,"td"),l(6),r(),a(7,"td"),l(8),r()()),t&2){let e=s.$implicit,n=s.index;d("ngClass",he(5,Xe,e.Exception)),o(2),V(n+1),o(2),V(e.Number),o(2),V(e.Status),o(2),V(e.Exception)}}function et(t,s){if(t&1&&(k(0),w(1,Ze,9,7,"tr",7),N()),t&2){let e,n=u();o(),d("ngForOf",(e=n.downloadResult())==null?null:e.Body)}}function tt(t,s){t&1&&(a(0,"tr",9)(1,"td",10)(2,"div",11),S(3,"i",12),r(),a(4,"h4",13),l(5," There is no order to processed "),r()()())}var Qe=(()=>{class t{constructor(){this.downloadResult=O()}ngOnInit(){}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["complete-step"]],inputs:{downloadResult:[1,"downloadResult"]},decls:16,vars:2,consts:[["EMPTY_DOWNLOAD",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"table"],[1,"thead-light"],["width","1%"],[4,"ngIf","ngIfElse"],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1&&(a(0,"div",1)(1,"div",2)(2,"table",3)(3,"thead",4)(4,"tr"),S(5,"th",5),a(6,"th"),l(7,"Order Number"),r(),a(8,"th"),l(9,"Status"),r(),a(10,"th"),l(11,"Exception"),r()()(),a(12,"tbody"),w(13,et,2,1,"ng-container",6)(14,tt,6,0,"ng-template",null,0,H),r()()()()),n&2){let p,h=T(15);o(13),d("ngIf",((p=i.downloadResult())==null||p.Body==null?null:p.Body.length)>0)("ngIfElse",h)}},dependencies:[F,R,L,B],encapsulation:2})}}return t})();var A=(()=>{class t{constructor(){this.httpService=v(De),this.toastr=v(xe),this.datePipe=v(q)}gerChannelDetailById(e){return this.httpService.post(Z.GetChannelDetail,{ID:e})}getOrderPreview(e){return this.httpService.post(Z.GetOrderPreviewV2,e)}getDownloadOrder(e){return this.httpService.post(Z.GetDownloadOrderV2,e)}onPreviewOrder(e){return this.validateDatePreview(e)?this.getOrderPreview(e).pipe(z(n=>{n.Data?.length===0&&this.toastrEmptyPreview(e)})):ae}toastrEmptyPreview(e){let n=this.datePipe.transform(e.From,"dd MMM yyyy"),i=this.datePipe.transform(e.To,"dd MMM yyyy"),p=e.TimeFrom?e.TimeFrom:"",h=e.TimeTo?e.TimeTo:"";this.toastr.info(`There is no orders from ${n} ${p} to ${i} ${h}!`,"No Orders!")}validateDatePreview(e){let n=!0;return e.downloadType==!0?x.getDaysDiff(e?.From,e?.To)+1>7&&(this.toastr.warning("Dates cannot be more than 7 days apart!","Warning"),n=!1):x.getDaysDiff(e?.From,e?.To)+1>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Warning"),n=!1),n}getDateTitle(e,n){let i=x.formatTitleFromDate(new Date(e),new Date(n)),p=this.datePipe.transform(e,i),h=this.datePipe.transform(n,"dd MMM yyyy");return`${i==null?"":p+"-"} ${h}`}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=le({token:t,factory:t.\u0275fac})}}return t})();function it(t,s){if(t&1&&(a(0,"ng-option",13),S(1,"img",14),l(2),r()),t&2){let e=s.$implicit;d("value",e.ID),o(),d("src",e==null?null:e.Img,pe),o(),C("",e.Name," ")}}function nt(t,s){if(t&1){let e=y();a(0,"div",8)(1,"div",4)(2,"h5"),l(3,"Type"),r(),a(4,"p",5),l(5,"Select Type want to download"),r()(),a(6,"div",4)(7,"div",15)(8,"div")(9,"mat-radio-group",16),I("ngModelChange",function(i){m(e);let p=u();return P(p.downloadType,i)||(p.downloadType=i),c(i)}),g("ngModelChange",function(){m(e);let i=u();return c(i.onDownloadTypeChange())}),a(10,"mat-radio-button",17),l(11," Orders "),r(),a(12,"mat-radio-button",18),l(13," Disbursement "),r()()()(),a(14,"div",19)(15,"div",20),S(16,"i",21),r(),a(17,"p",22),l(18," If there are completed transactions, to obtain payment and service fee, you need to download disbursement. "),r()()()()}if(t&2){let e=u();o(9),E("ngModel",e.downloadType),o(),d("value",!1),o(2),d("value",!0)}}function rt(t,s){t&1&&(a(0,"p",5),l(1," Select Disbursement date "),a(2,"span",23),l(3,"(payment date / order complete date)"),r(),l(4," of the channel you want to download (Max 1 Week). "),r())}function at(t,s){t&1&&(a(0,"p",5),l(1," Select transaction date of the channel you want to download (Max 2 Weeks) "),r())}function ot(t,s){if(t&1){let e=y();a(0,"div",12)(1,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.startTime,i)||(p.startTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onStartTimeChange())}),r(),a(2,"span",25),l(3,"-"),r(),a(4,"app-timepicker",24),I("timeChange",function(i){m(e);let p=u();return P(p.endTime,i)||(p.endTime=i),c(i)}),g("timeChange",function(){m(e);let i=u();return c(i.onEndTimeChange())}),r()()}if(t&2){let e=u();o(),E("time",e.startTime),o(3),E("time",e.endTime)}}var Je=(()=>{class t{constructor(){this.reset=O(!1),this.authService=v(ee),this.downloadService=v(A),this.downloadType=_(!1),this.selectedChannelId=_(null),this.channelOptions=_(this.authService.getChannels()),this.channelType=X,this.selectedChannel=_(null),this.showTimePicker=_(!1),this.startDate=_(null),this.endDate=_(null),this.startTime=_("00:00"),this.endTime=_("23:59"),this.filterData=new j,Q(()=>{this.reset()&&this.resetFilter()},{allowSignalWrites:!0})}resetFilter(){this.selectedChannelId.update(()=>null),this.startDate.update(()=>null),this.endDate.update(()=>null),this.startTime.update(()=>null),this.endTime.update(()=>null),this.downloadType.update(()=>!1),this.selectedChannel.update(()=>null),this.showTimePicker.update(()=>!1),this.channelDetail$=null}onSelectChannel(){this.selectedChannel.update(()=>this.channelOptions().find(e=>e.ID===this.selectedChannelId())),this.selectedChannel()?this.channelDetail$=this.downloadService.gerChannelDetailById(this.selectedChannelId()).pipe(U(e=>e?.Model),$(1)):this.channelDetail$=null,this.emitFilterData()}onFilterDateChange(){let e=1;this.startDate()&&this.endDate()&&(e=x.getDaysDiff(this.startDate(),this.endDate())),this.showTimePicker.update(()=>e==0),this.emitFilterData()}onDownloadTypeChange(){this.emitFilterData()}onStartTimeChange(){this.emitFilterData()}onEndTimeChange(){this.emitFilterData()}emitFilterData(){this.filterData.emit({channelId:this.selectedChannelId(),startDate:this.startDate(),endDate:this.endDate(),downloadType:this.downloadType(),startTime:this.startTime(),endTime:this.endTime()})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["filter-step"]],inputs:{reset:[1,"reset"]},outputs:{filterData:"onFilterChange"},features:[K([A])],decls:27,vars:11,consts:[["picker",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-12"],[1,"row"],[1,"col-6"],[1,"text-muted"],["appendTo","body","placeholder","Select Channel",3,"ngModelChange","clearable","ngModel"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-6"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"mt-8"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"form-label-group","radio","download-type",2,"margin-bottom","0px"],["name","dowloadType",3,"ngModelChange","ngModel"],["matTooltip","Download from Create sales order until create logistics status",1,"me-5",3,"value"],["matTooltip","Download only Payment and write off",1,"me-5",3,"value"],[1,"d-flex","border","mb-4","pt-6","px-6","mt-3",2,"background","#1f87ac0a","border-radius","5px"],[1,"me-3","pt-1"],[1,"fa","fa-lightbulb","fs-5"],[1,"mb-6"],[1,"fw-bold"],[3,"timeChange","time"],[1,"mx-4"]],template:function(n,i){if(n&1){let p=y();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"h5"),l(5,"Select a Channel"),r(),a(6,"p",5),l(7,"Select Channel want to download order"),r()(),a(8,"div",4)(9,"ng-select",6),I("ngModelChange",function(f){return m(p),P(i.selectedChannelId,f)||(i.selectedChannelId=f),c(f)}),g("ngModelChange",function(){return m(p),c(i.onSelectChannel())}),w(10,it,3,3,"ng-option",7),r()()(),w(11,nt,19,3,"div",8),W(12,"async"),a(13,"div",8)(14,"div",4)(15,"h5"),l(16,"Date Range"),r(),w(17,rt,5,0,"p",5)(18,at,2,0,"p",5),r(),a(19,"div",4)(20,"div",2)(21,"mat-date-range-input",9)(22,"input",10),I("ngModelChange",function(f){return m(p),P(i.startDate,f)||(i.startDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())}),r(),a(23,"input",11),I("ngModelChange",function(f){return m(p),P(i.endDate,f)||(i.endDate=f),c(f)}),g("click",function(){m(p);let f=T(25);return c(f.open())})("ngModelChange",function(){return m(p),c(i.onFilterDateChange())}),r()(),S(24,"mat-date-range-picker",null,0),r(),w(26,ot,5,2,"div",12),r()()()()}if(n&2){let p,h,f=T(25);o(9),d("clearable",!1),E("ngModel",i.selectedChannelId),o(),d("ngForOf",i.channelOptions()),o(),b((p=Y(12,9,i.channelDetail$))!=null&&p.ServiceFeeWriteOff&&((p=i.selectedChannel())==null?null:p.TypeID)==i.channelType.Tokopedia?11:-1),o(6),b(i.downloadType()&&((h=i.selectedChannel())==null?null:h.TypeID)==i.channelType.Tokopedia?17:18),o(4),d("rangePicker",f),o(),E("ngModel",i.startDate),o(),E("ngModel",i.endDate),o(3),b(i.showTimePicker()?26:-1)}},dependencies:[F,L,J,Ee,be,Te,ke,Fe,Oe,ye,Se,Ce,ve,He,Be,We,Ae,Re,Le],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}.form-label-group.radio.download-type[_ngcontent-%COMP%]{height:45.5938px!important;border-radius:.375rem!important}"]})}}return t})();var D=function(t){return t.ALL="all",t.SYNC="sync",t.WRONG="wrong",t.UNSYNC="unsync",t}(D||{});var lt=(t,s)=>({"over-due-today":t,"over-due":s});function pt(t,s){if(t&1&&(a(0,"th",21),l(1),r()),t&2){let e=u();o(),C(" ",e.selectedChannel()?"Created Date":"Last Status Update"," ")}}function st(t,s){if(t&1&&(a(0,"td"),l(1),W(2,"date"),r()),t&2){let e=u().$implicit;o(),C(" ",_e(2,1,e.Modified,"dd MMM yyyy HH:mm:ss")," ")}}function dt(t,s){if(t&1&&(a(0,"span"),l(1),r()),t&2){let e=u().$implicit;o(),C(" ",e.ActionString," ")}}function mt(t,s){if(t&1&&(a(0,"li"),l(1),r()),t&2){let e=s.$implicit;o(),C(" ",e," ")}}function ct(t,s){if(t&1&&(a(0,"ul",27),w(1,mt,2,1,"li",22),r()),t&2){let e=u().$implicit;o(),d("ngForOf",e.ActionString)}}function ut(t,s){if(t&1&&(a(0,"span",28),S(1,"i",29),r()),t&2){let e=u().$implicit;de("title","Delivery : ",e.DeliveryState,`
2
2
  Payment : `,e.PaymentState,"")}}function ht(t,s){if(t&1&&(a(0,"tr")(1,"td"),l(2),r(),a(3,"td"),l(4),r(),w(5,st,3,4,"td",23),a(6,"td")(7,"span"),l(8),r(),l(9),r(),a(10,"td",24)(11,"span"),l(12),r(),l(13),r(),a(14,"td"),w(15,dt,2,1,"span",23)(16,ct,2,1,"ul",25),r(),a(17,"td"),w(18,ut,2,3,"span",26),r()()),t&2){let e,n=s.$implicit,i=s.index,p=u(2);o(2),V(i+1),o(2),V(n.Number),o(),d("ngIf",((e=p.selectedChannel())==null?null:e.TypeID)!=p.channelType.Shopee&&((e=p.selectedChannel())==null?null:e.TypeID)!==p.channelType.Tiktok),o(3),C("",n.ChannelStatus," - "),o(),C("",n.ChannelStatusDescription," "),o(),d("ngClass",fe(12,lt,(n==null?null:n.Action)==p.actionPreviewOrder.Update,(n==null?null:n.Action)==p.actionPreviewOrder.New))("matTooltip",n.POSStatus==91||n.POSStatusDescription=="Conflict"?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),o(2),C("",n.POSStatus," - "),o(),C("",n.POSStatusDescription," "),o(2),d("ngIf",n.ActionString.length==1),o(),d("ngIf",n.ActionString.length>1),o(2),d("ngIf",n.ChannelStatus!=99&&n.POSStatus!=99)}}function ft(t,s){if(t&1&&(k(0),w(1,ht,19,15,"tr",22),N()),t&2){let e=u();o(),d("ngForOf",e.displayPreviewData())}}function _t(t,s){t&1&&(a(0,"tr",30)(1,"td",31)(2,"div",32),S(3,"i",33),r(),a(4,"h4",34),l(5," There is no order to processed "),r()()())}var qe=(()=>{class t{constructor(){this.orderPreview=O(),this.selectedChannel=O(),this.channelType=X,this.allData=_(0),this.syncData=_(0),this.wrongData=_(0),this.unsyncData=_(0),this.pillStatus=_(D.ALL),this.actionPreviewOrder=G,this.previewStatus=D,this.displayPreviewData=_([]),this.exportOrders=new j,Q(()=>{this.orderPreview()&&(this.filterPreviewData(D.ALL),this.initLengthStatusData())},{allowSignalWrites:!0})}filterPreviewData(e){this.pillStatus.update(()=>e),this.displayPreviewData.update(()=>this.filterDataByStatus(e))}initLengthStatusData(){this.wrongData.update(()=>this.filterDataByStatus(D.WRONG).length),this.syncData.update(()=>this.filterDataByStatus(D.SYNC).length),this.allData.update(()=>this.orderPreview().length),this.unsyncData.update(()=>this.filterDataByStatus(D.UNSYNC).length)}filterDataByStatus(e){let n=[];switch(e){case D.ALL:n=this.orderPreview();break;case D.SYNC:n=this.orderPreview().filter(i=>i.Action==G.DoNothing);break;case D.WRONG:n=this.orderPreview().filter(i=>i.Action==G.Update);break;case D.UNSYNC:n=this.orderPreview().filter(i=>i.Action==G.New);break}return n}onExportOrders(){this.exportOrders.emit()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["preview-step"]],inputs:{orderPreview:[1,"orderPreview"],selectedChannel:[1,"selectedChannel"]},outputs:{exportOrders:"onExportOrders"},decls:41,vars:11,consts:[["EMPTY",""],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"col-12","d-flex","justify-content-between","align-items-end",2,"padding-left","0px","padding-right","0px"],[1,"nav","nav-pills"],[1,"nav-item","me-3"],[1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],[1,"nav-item","mx-3"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"click","ngClass"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["width","15%"],[4,"ngFor","ngForOf"],[4,"ngIf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"]],template:function(n,i){if(n&1){let p=y();a(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"ul",5)(6,"li",6)(7,"button",7),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.ALL))}),l(8),r()(),a(9,"li",8)(10,"button",9),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.SYNC))}),l(11),r()(),a(12,"li",8)(13,"button",10),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.WRONG))}),l(14),r()(),a(15,"li",8)(16,"button",11),g("click",function(){return m(p),c(i.filterPreviewData(i.previewStatus.UNSYNC))}),l(17),r()()()(),a(18,"div")(19,"button",12),g("click",function(){return m(p),c(i.onExportOrders())}),S(20,"i",13),a(21,"span"),l(22,"Export"),r()()()()(),a(23,"table",14)(24,"thead",15)(25,"tr"),S(26,"th",16),a(27,"th",17),l(28,"Number"),r(),w(29,pt,2,1,"th",18),a(30,"th",19),l(31,"Channel Status"),r(),a(32,"th",19),l(33,"POS Status"),r(),a(34,"th"),l(35,"Action"),r(),S(36,"th",16),r()(),a(37,"tbody"),w(38,ft,2,1,"ng-container",20)(39,_t,6,0,"ng-template",null,0,H),r()()()()}if(n&2){let p,h,f=T(40);o(7),d("ngClass",i.pillStatus()=="all"?"btn-secondary text-white":"btn-outline-dark"),o(),C(" All (",i.allData(),") "),o(2),d("ngClass",i.pillStatus()=="sync"?"btn-success":"btn-outline-success"),o(),C(" Existing (",i.syncData(),") "),o(2),d("ngClass",i.pillStatus()=="wrong"?"btn-warning text-white":"btn-outline-warning"),o(),C(" Wrong Status (",i.wrongData(),") "),o(2),d("ngClass",i.pillStatus()=="unsync"?"btn-danger":"btn-outline-danger"),o(),C(" Missing (",i.unsyncData(),") "),o(12),d("ngIf",((p=i.selectedChannel())==null?null:p.TypeID)!=i.channelType.Shopee&&((p=i.selectedChannel())==null?null:p.TypeID)!==i.channelType.Tiktok),o(9),d("ngIf",((h=i.displayPreviewData())==null?null:h.length)>0)("ngIfElse",f)}},dependencies:[F,R,L,B,q,Ie,Pe],encapsulation:2})}}return t})();var wt=["stepper"];function gt(t,s){t&1&&(a(0,"a",2),l(1," Download V1 "),r())}function St(t,s){if(t&1){let e=y();a(0,"div",3)(1,"button",20),g("click",function(){m(e);let i=u();return c(i.onStepperBack())}),l(2," Back "),r(),a(3,"button",21),g("click",function(){m(e);let i=u();return c(i.onNextStep())}),l(4," Next "),r()()}if(t&2){let e=u();o(3),d("disabled",e.disabledNextFilter())}}function Ct(t,s){if(t&1){let e=y();a(0,"button",22),g("click",function(){m(e);let i=u();return c(i.onNextStep())}),l(1," Next "),r()}if(t&2){let e=u();d("disabled",e.disabledNextFilter())}}function vt(t,s){if(t&1){let e=y();a(0,"button",23),g("click",function(){m(e);let i=u();return c(i.onNewDownload())}),S(1,"i",24),l(2," New "),r()}}function yt(t,s){t&1&&(S(0,"i",25),a(1,"span"),l(2,"Filter"),r())}function xt(t,s){t&1&&(S(0,"i",26),a(1,"span"),l(2,"Preview"),r())}function Dt(t,s){if(t&1){let e=y();k(0),a(1,"preview-step",27),g("onExportOrders",function(){m(e);let i=u();return c(i.onExportOrders())}),r(),N()}if(t&2){let e=s.ngIf;o(),d("orderPreview",e)}}function Tt(t,s){t&1&&(S(0,"i",28),a(1,"span"),l(2,"Finish"),r())}function bt(t,s){if(t&1&&(k(0),S(1,"complete-step",29),N()),t&2){let e=s.ngIf;o(),d("downloadResult",e)}}function Et(t,s){t&1&&(a(0,"h6"),l(1,"1"),r())}function Pt(t,s){t&1&&(a(0,"h6"),l(1,"2"),r())}function It(t,s){t&1&&(a(0,"h6"),l(1,"3"),r())}var $i=(()=>{class t{constructor(){this.downloadService=v(A),this.orderService=v(Ke),this.productService=v(Ne),this.authService=v(ee),this.stepperSelectedIndex=_(0),this.disabledNextFilter=_(!0),this.isResetFilter=_(!1),this.pageTitle=_("Download to POS"),this.cacheKey=_(x.GuidEMpty)}onFilterChange(e){this.filter=e,this.validateDisabledNext()}validateDisabledNext(){this.disabledNextFilter.update(()=>x.IsEmpty(this.filter?.channelId)||!x.isValidDate(this.filter.startDate)||!x.isValidDate(this.filter.endDate))}onNextStep(){switch(this.stepper.selectedIndex){case 0:this.onPreview();let e=this.productService.findChannelById(this.filter.channelId,this.authService.getChannels());this.setPageTitle(`Preview ${e?.Name}`);break;case 1:this.onDownload(),this.setPageTitle("Download");break}}onStepperNext(){this.stepper.selected.completed=!0,this.stepper.next()}onPreview(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,IsDisbursement:this.filter.downloadType};x.IsNotEmpty(this.filter.startTime)&&(e=re(ne({},e),{TimeFrom:this.filter.startTime+":00",TimeTo:this.filter.endTime+":00"})),this.orderPreview$=this.downloadService.onPreviewOrder(e).pipe(z(n=>{n.Data?.length>0&&(this.cacheKey.update(()=>n.CacheKey),this.onStepperNext())}),U(n=>n.Data),$(1))}onExportOrders(){let e={ID:this.filter.channelId,From:this.filter.startDate?JSON.stringify(this.filter.startDate):null,To:this.filter.endDate?JSON.stringify(this.filter.endDate):null},n=`Orders ${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)}`;this.orderService.exportOrders(e,n).subscribe()}onDownload(){let e={ID:this.filter.channelId,From:this.filter.startDate,To:this.filter.endDate,ListPreview:[],IsDisbursement:this.filter.downloadType,CacheKey:this.cacheKey()};this.downloadPreview$=this.orderPreview$.pipe(oe(n=>(e.ListPreview=n,this.downloadService.getDownloadOrder(e))),z(()=>{this.onStepperNext()}),$(1))}setPageTitle(e){this.pageTitle.update(()=>`
3
3
  ${e} (${this.downloadService.getDateTitle(this.filter.startDate,this.filter.endDate)})
4
4
  `)}onStepperBack(){this.stepper.previous(),this.pageTitle.update(()=>"Download to POS")}onNewDownload(){this.isResetFilter.update(()=>!0),this.stepper.reset(),this.stepperSelectedIndex.update(()=>0),this.orderPreview$=null,this.downloadPreview$=null,this.pageTitle.update(()=>"Download to POS")}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=M({type:t,selectors:[["app-download-v2"]],viewQuery:function(n,i){if(n&1&&me(wt,5),n&2){let p;ce(p=ue())&&(i.stepper=p.first)}},features:[K([A,{provide:$e,useValue:{displayDefaultIndicatorType:!1}}])],decls:27,vars:21,consts:[["stepper",""],[3,"hideSearchBox","hideSearchDropdown","headerTitle","description"],["routerLink","/menu/Order/Download/V1",1,"btn","btn-outline-secondary","btn-fill","me-3"],[1,"btn-group","me-3"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"disabled"],[1,"btn","btn-outline-secondary","btn-fill"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["linear","",1,"w-100","stepper-download",3,"selectedIndexChange","ngClass","selectedIndex"],["state","filter",3,"completed","editable"],["matStepLabel",""],[1,"w-100",3,"onFilterChange","reset"],["state","preview",3,"editable","completed"],[4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","bg-success","text-white",3,"click","disabled"],["type","button",1,"btn","btn-outline-secondary","btn-fill","me-3","bg-success","text-white",3,"click","disabled"],[1,"btn","btn-outline-secondary","btn-fill",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[1,"fa-solid","fa-filter","me-3"],[1,"fa-solid","fa-file","me-3"],[3,"onExportOrders","orderPreview"],[1,"fa-solid","fa-flag","me-3"],[3,"downloadResult"]],template:function(n,i){if(n&1){let p=y();a(0,"mainpanel",1)(1,"actions"),w(2,gt,2,0,"a",2)(3,St,5,1,"div",3)(4,Ct,2,1,"button",4)(5,vt,3,0,"button",5),r(),a(6,"content")(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"mat-stepper",10,0),I("selectedIndexChange",function(f){return m(p),P(i.stepperSelectedIndex,f)||(i.stepperSelectedIndex=f),c(f)}),a(13,"mat-step",11),w(14,yt,3,0,"ng-template",12),a(15,"filter-step",13),g("onFilterChange",function(f){return m(p),c(i.onFilterChange(f))}),r()(),a(16,"mat-step",14),w(17,xt,3,0,"ng-template",12)(18,Dt,2,1,"ng-container",15),W(19,"async"),r(),a(20,"mat-step",16),w(21,Tt,3,0,"ng-template",12)(22,bt,2,1,"ng-container",15),W(23,"async"),r(),w(24,Et,2,0,"ng-template",17)(25,Pt,2,0,"ng-template",18)(26,It,2,0,"ng-template",19),r()()()()()()()}if(n&2){let p=T(12);d("hideSearchBox",!0)("hideSearchDropdown",!0)("headerTitle",i.pageTitle())("description",i.pageTitle()),o(2),b(i.stepperSelectedIndex()==0?2:-1),o(),b(i.stepperSelectedIndex()==1?3:-1),o(),b(i.stepperSelectedIndex()==0?4:-1),o(),b(i.stepperSelectedIndex()==2?5:-1),o(6),se("ngClass","last-edited-step-"+p.selectedIndex),E("selectedIndex",i.stepperSelectedIndex),o(2),d("completed",!1)("editable",i.stepperSelectedIndex()!=2),o(2),d("reset",i.isResetFilter()),o(),d("editable",i.stepperSelectedIndex()!=2)("completed",!1),o(2),d("ngIf",Y(19,17,i.orderPreview$)),o(4),d("ngIf",Y(23,19,i.downloadPreview$))}},dependencies:[F,R,B,J,Qe,Je,qe,je,Ge,ze,Ue,Ye,Ve,Me,ge,we],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.vertical-radio{display:flex;flex-direction:column;margin:15px 0}.mt-1rem{margin-top:1rem}.dateRange{padding-top:.8rem;padding-bottom:.8rem}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px}mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}.form-label-group.radio.download-type{height:45.5938px!important;border-radius:.375rem!important}
@@ -1 +1 @@
1
- import{a as N,b as Ot,c as Se}from"./chunk-ZCGHEDGV.js";import"./chunk-64V4L3IJ.js";import"./chunk-MS4AQ6UA.js";import{a as j}from"./chunk-6HVHZ3HN.js";import{a as fe}from"./chunk-PF4F4EAR.js";import{a as Y}from"./chunk-7KG3DC5J.js";import{b as Ce}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import{a as ee,b as ne}from"./chunk-ARIW575T.js";import{e as rt}from"./chunk-R4FFSLZS.js";import{a as ve}from"./chunk-T7KM2WP6.js";import{i as me,j as ue,k as he,l as _e,m as ge}from"./chunk-VOISFPEM.js";import"./chunk-WNAVUGZ4.js";import"./chunk-UOAYF4SW.js";import{a as B}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Tt}from"./chunk-5UHZLNDT.js";import{a as J}from"./chunk-DG3PIXFJ.js";import{b as xe}from"./chunk-WYOXUN3H.js";import{a as se,b as pe}from"./chunk-23MIIDCT.js";import{a as ie,b as oe,c as re}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import{a as X}from"./chunk-MV2W43TI.js";import{a as Z}from"./chunk-67USXWWF.js";import{c as ce}from"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import{a as de}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import{a as le}from"./chunk-R5IDWUP6.js";import{f as ae}from"./chunk-4RAOUTR2.js";import{a as ot,b as wt,d as H,e as Yt}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as L}from"./chunk-CIKNTHCR.js";import{b as G,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{b as Zt,c as qt,d as K,h as Dt,i as Qt,j as Xt,l as R,m as te}from"./chunk-XOT2SZPE.js";import{r as yt,s as Mt}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as Ht,c as it,h as A,m as U,y as It}from"./chunk-AI4XRCAL.js";import{b as z,c as C}from"./chunk-W6T7TOHE.js";import{E as Pt,F as Jt,G as nt,H as bt,J as zt,f as E,g as V,j as St,k as Kt,m as xt,n as vt}from"./chunk-B6POIFQM.js";import{Dc as $,Eb as M,Ec as d,Fb as Gt,Fc as tt,G as w,Gc as b,Ic as D,Jc as O,Kb as S,Kc as T,Nc as Q,Oc as st,Qa as At,Wb as c,Xc as F,Yc as k,Zc as Wt,_c as et,aa as Ct,bc as ft,ca as kt,ea as jt,f as Rt,gc as o,hc as r,ic as _,jc as v,ka as $t,kc as P,mc as x,ob as y,pa as Vt,qb as a,rc as g,sc as s,v as Bt,wb as f,ya as m,za as u}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var Ne=()=>["/menu/products/download/by-url"],Pe=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),r(),o(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),r()()()()()(),_(12,"router-outlet")),n&2&&(a(3),c("Tabs",e.productTabs),a(7),c("routerLink",Q(2,Ne)))},dependencies:[ee,Jt,bt],encapsulation:2})}}return i})();function ke(i,p){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),d(4),r()()()),i&2){let t=p.$implicit;c("value",t.ChannelID),a(2),c("src",t.logo,y),a(2),tt(t.Title)}}var lt=(()=>{class i{constructor(){this.dialogRef=Vt(Zt),this.channels=Vt(qt),this.channelIds=At([]),this.channelOptions=At([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,l)=>l.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Qt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),T("ngModelChange",function(h){return O(e.channelIds,h)||(e.channelIds=h),h}),S(7,ke,5,3,"mat-option",5),r()()()()()),n&2&&(c("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),D("ngModel",e.channelIds),c("multiple",!0),a(),c("ngForOf",e.channelOptions()))},dependencies:[vt,E,Xt,le,ae,pe,se,ce,It,A,U,Mt],encapsulation:2})}}return i})();function Ve(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ae(i,p){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),d(2," Scan Channel "),r()}}function Ue(i,p){if(i&1&&(v(0),S(1,Ae,3,0,"button",15),P()),i&2){let t=s();a(),c("ngIf",!t.productService.hasSelection(t.products))}}function Le(i,p){if(i&1){let t=x();v(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Re(i,p){if(i&1){let t=x();v(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Be(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function je(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function $e(i,p){if(i&1){let t=x();v(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var we=(()=>{class i{constructor(t,n,e,l,h,I,ct){this.http=t,this.toastr=n,this.dialog=e,this.productService=l,this.authService=h,this.uploadProductService=I,this.route=ct,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Ot,{data:{title:this.products[t].Name,variants:n},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(l=>C.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let h=this.productService.selectedProduct(this.products),I=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(I)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(l)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(G),f(K),f(B),f(L),f(rt),f(nt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let l=x();o(0,"mainpanel",1),g("onSubmit",function(I){return m(l),u(e.searchProduct(I))}),o(1,"actions"),S(2,Ve,3,1,"button",2)(3,Ue,2,1,"ng-container",3)(4,Le,4,1,"ng-container",3)(5,Re,4,1,"ng-container",3),r(),o(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),r(),o(10,"ng-select",5),g("ngModelChange",function(I){return m(l),u(e.searchFilter.Category=I)}),r()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),T("ngModelChange",function(I){return m(l),O(e.startDate,I)||(e.startDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r(),o(14,"input",9),T("ngModelChange",function(I){return m(l),O(e.endDate,I)||(e.endDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r()(),_(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",10)(19,"div",11),S(20,Be,2,11,"div",12)(21,je,3,0,"ng-container",3),r(),S(22,$e,4,5,"ng-container",3),r()()()}if(n&2){let l=$(16);c("headerTitle","In POS ("+e.rowCount+")"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),c("rangePicker",l),a(),D("ngModel",e.startDate),a(),D("ngModel",e.endDate),a(6),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products.length>0)}},dependencies:[E,V,it,A,U,R,H,J,Z,j,me,ue,he,_e],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Ge(i,p){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function We(i,p){if(i&1){let t=x();v(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),d(3," Scan Channel "),r(),P()}}function Ke(i,p){if(i&1){let t=x();v(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Je(i,p){if(i&1){let t=x();v(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function ze(i,p){if(i&1&&(o(0,"span",18),_(1,"img",19),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function He(i,p){if(i&1){let t=x();o(0,"div",20)(1,"label",21),d(2,"Item ID"),r(),o(3,"input",22),T("ngModelChange",function(e){m(t);let l=s();return O(l.searchFilter.Item_id,e)||(l.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),D("ngModel",t.searchFilter.Item_id)}}function Ye(i,p){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function Ze(i,p){i&1&&(v(0),o(1,"div",25),_(2,"app-empty-state"),r(),P())}function qe(i,p){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var ye=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt){this.http=t,this.dialog=n,this.toastr=e,this.productService=l,this.activateRouter=h,this.authService=I,this.route=ct,this.uploadProductService=gt,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(Ot,{data:{variants:n,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(w(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanProducts(l)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let l=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(l);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=C.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(B),f(Pt),f(L),f(nt),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),S(2,Ge,3,1,"button",1)(3,We,4,0,"ng-container",2)(4,Ke,4,1,"ng-container",2)(5,Je,4,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),r(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),S(11,ze,3,3,"ng-template",5),r()(),S(12,He,4,1,"div",6),r(),o(13,"content")(14,"div",7)(15,"div",8),S(16,Ye,2,11,"div",9)(17,Ze,3,0,"ng-container",2),r(),S(18,qe,3,4,"div",10),r()()()),n&2&&(c("headerTitle","Sold in Channel"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),c("ngIf",e.searchFilter.ListChannelID!=null),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products==null?null:e.products.length))},dependencies:[E,V,it,A,U,R,H,ot,wt,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function Xe(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t=s(2);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function tn(i,p){if(i&1){let t=x();v(0),o(1,"td",29)(2,"input",30),T("ngModelChange",function(e){m(t);let l=s(2).$implicit;return O(l.selected,e)||(l.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,l=s(3);return u(l.onSelectProduct(e))}),r()(),P()}if(i&2){let t=s(2).$implicit;a(),c("rowSpan",t==null?null:t.Variants.length),a(),D("ngModel",t.selected)}}function en(i,p){if(i&1){let t=x();v(0),o(1,"img",35),g("click",function(e){m(t);let l=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,l==null?null:l.ImageUrl))}),r(),P()}if(i&2){let t=s(3).$implicit;a(),c("src",t==null?null:t.ImageUrl,y)}}function nn(i,p){i&1&&_(0,"img",36)}function on(i,p){if(i&1&&(v(0),o(1,"td",29)(2,"div",31),S(3,en,2,1,"ng-container",11)(4,nn,1,0,"ng-template",null,1,et),r()(),o(6,"td",32)(7,"h4",33)(8,"span",34),d(9),r()()(),P()),i&2){let t=$(5),n=s(2).$implicit;a(),c("rowSpan",n==null?null:n.Variants.length),a(2),c("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),c("rowSpan",n==null?null:n.Variants.length),a(2),c("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function rn(i,p){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),r()()),i&2){let t=p.$implicit;a(),c("href",t.URL,y),a(),c("src",t.Img,y)("matTooltip",t.Name)}}function an(i,p){if(i&1&&(o(0,"div"),_(1,"img",37),r()),i&2){let t=p.$implicit;a(),c("src",t.Img,y)("matTooltip",t.Name)}}function ln(i,p){if(i&1&&(o(0,"tr"),S(1,tn,3,2,"ng-container",12)(2,on,10,6,"ng-container",12),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",24)(9,"a",25),_(10,"i",26),r()()(),o(11,"td",27)(12,"div",28),S(13,rn,3,3,"div",23),r()(),o(14,"td",27)(15,"div",28),S(16,an,2,2,"div",23),r()()()),i&2){let t=p.$implicit,n=p.index,e=s(5);a(),c("ngIf",n==0),a(),c("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),c("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),y),a(4),c("ngForOf",t==null?null:t.Available),a(3),c("ngForOf",t==null?null:t.NotAvailable)}}function cn(i,p){if(i&1&&(v(0),S(1,ln,17,7,"tr",23),P()),i&2){let t=p.$implicit;a(),c("ngForOf",t.Variants)}}function sn(i,p){if(i&1&&(o(0,"tbody"),S(1,cn,2,1,"ng-container",23),r()),i&2){let t=p.ngIf;a(),c("ngForOf",t)}}function pn(i,p){if(i&1&&(v(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),d(7,"Product"),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),S(16,sn,2,1,"tbody",12),F(17,"async"),r()(),P()),i&2){let t=s(2);a(16),c("ngIf",k(17,1,t.data$))}}function dn(i,p){i&1&&(o(0,"div",38),_(1,"app-empty-state"),r())}function mn(i,p){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),d(2,"?"),r()()}}function un(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"number"),r()),i&2){let t=p.ngIf;a(),tt(k(2,1,t==null?null:t.Count))}}function hn(i,p){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),d(2," Next"),r()}}function _n(i,p){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),d(2," Last"),r()}}function gn(i,p){if(i&1&&(v(0),o(1,"div",39)(2,"div",40)(3,"div",41),d(4),F(5,"number"),S(6,mn,3,0,"span",42)(7,un,3,3,"span",12),F(8,"async"),d(9),r()(),o(10,"div",43),S(11,hn,3,0,"a",44)(12,_n,3,0,"a",45),r()(),P()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",k(5,6,t==null?null:t.length)," of "),a(2),c("ngIf",n.paginationService.hideCount),a(),c("ngIf",!n.paginationService.hideCount&&k(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Cn(i,p){if(i&1&&(v(0),S(1,gn,13,10,"ng-container",12),P()),i&2){let t=p.ngIf;a(),c("ngIf",(t==null?null:t.length)>0)}}function fn(i,p){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let l=s();return u(l.searchProduct(e))}),o(1,"actions"),S(2,Xe,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),d(5," Scan Channel "),r(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),d(9,"Export"),r()()(),o(10,"content")(11,"div",9)(12,"div",10),S(13,pn,18,3,"ng-container",11),F(14,"async"),S(15,dn,2,0,"ng-template",null,0,et),r(),S(17,Cn,2,1,"ng-container",12),F(18,"async"),r()()()}if(i&2){let t,n=$(16),e=s();c("hideSearchDropdown",!0),a(2),c("ngIf",e.hasSelectionProduct),a(11),c("ngIf",((t=k(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),c("ngIf",k(18,7,e.data$))}}var Me=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt,Ee){this.http=t,this.dialog=n,this.toastr=e,this.route=l,this.productService=h,this.paginationService=I,this.biggerPictureService=ct,this.authService=gt,this.uploadProductService=Ee,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=gt.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(jt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Bt(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=C.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Ce,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(nt),f(B),f(fe),f(de),f(L),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(S(0,fn,19,9,"mainpanel",2),F(1,"async")),n&2&&c("ngIf",k(1,1,e.loader$))},dependencies:[E,V,Ht,A,U,R,yt,j,St,xt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Sn=i=>[i],xn=()=>[];function vn(i,p){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),d(2," Scan Channel "),r()}}function Pn(i,p){if(i&1){let t=x();v(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function bn(i,p){if(i&1&&(o(0,"span",19),_(1,"img",20),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function In(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let l=m(t).index,h=s();return u(h.onSelectProduct(e,l))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,l=s();return u(l.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanChannel(e))}),r()()}if(i&2){let t=p.$implicit;a(),c("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?st(10,Sn,t==null?null:t.Channel):Q(12,xn))("showCheckBox",!0)("scanButton",!0)}}function wn(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function yn(i,p){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var De=(()=>{class i{constructor(t,n,e,l,h,I){this.http=t,this.dialog=n,this.productService=e,this.toastrService=l,this.activateRouter=h,this.authService=I,this.searchFilter=new Y,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(Se,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(B),f(G),f(Pt),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),S(2,vn,3,0,"button",1)(3,Pn,4,1,"ng-container",2),r(),o(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),r(),o(8,"ng-select",4),T("ngModelChange",function(h){return O(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),S(9,bn,3,3,"ng-template",5),r()(),o(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),r(),o(13,"mat-radio-group",8),T("ngModelChange",function(h){return O(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),d(15," All "),r(),o(16,"mat-radio-button",9),d(17," Yes "),r(),o(18,"mat-radio-button",9),d(19," No "),r()()(),o(20,"div",6)(21,"label",7),d(22,"Item ID"),r(),o(23,"input",10),T("ngModelChange",function(h){return O(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),r()()(),o(24,"content")(25,"div",11)(26,"div",12),S(27,In,2,13,"div",13)(28,wn,3,0,"ng-container",2),r(),S(29,yn,3,4,"div",14),r()()()),n&2&&(a(2),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ChannelID),a(5),D("ngModel",e.searchFilter.HaveSku),a(),c("value",0),a(2),c("value",1),a(2),c("value",2),a(5),D("ngModel",e.searchFilter.Item_id),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,it,A,U,R,H,ot,ie,oe,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Mn(i,p){if(i&1&&(o(0,"span",9),_(1,"img",10),r(),d(2)),i&2){let t=p.item,n=s();a(),c("src",n.getChannelLogo(t.TypeID),y),a(),b(" ",t.Name," ")}}function Dn(i,p){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),r()),i&2){let t=p.$implicit,n=p.index;a(),c("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function On(i,p){i&1&&(v(0),o(1,"div",13),_(2,"app-empty-state"),r(),P())}function Tn(i,p){if(i&1){let t=x();v(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var Oe=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new Y,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(B),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),r(),o(6,"ng-select",3),T("ngModelChange",function(h){return O(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),S(7,Mn,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),S(11,Dn,2,6,"div",7)(12,On,3,0,"ng-container",8),r(),S(13,Tn,4,4,"ng-container",8),r()()()),n&2&&(a(6),c("multiple",!0)("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ListChannelID),a(5),c("ngForOf",e.products),a(),c("ngIf",(e.products==null?null:e.products.length)==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,A,U,R,H,ot,wt,Tt,J,j],encapsulation:2})}}return i})();var Fn=()=>["/menu/products/status/sold-in-channel"],Te=i=>({ID:i}),En=()=>["/menu/products/status/not-in-pos"];function Nn(i,p){if(i&1&&(v(0),d(1),P()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function kn(i,p){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,l=s(2);return u(l.getLiveProductCount(e.ID,e))}),_(1,"i",27),r()}}function Vn(i,p){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),S(6,Nn,2,1,"ng-container",6)(7,kn,2,0,"ng-template",null,1,et),r(),o(9,"td",19)(10,"a",20),d(11),F(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),F(16,"number"),r()(),o(17,"td"),d(18),F(19,"date"),r(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onScanChannel(e))}),_(23,"i",23),d(24," Scan "),r(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onClearCache(e.ID))}),_(26,"i",25),d(27," Clear "),r()()()()}if(i&2){let t=p.$implicit,n=$(8),e=s(2);a(2),c("src",e.getChannelLogo(t.TypeID),y),a(2),tt(t.Name),a(2),c("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),c("routerLink",Q(18,Fn))("queryParams",st(19,Te,t.ID)),a(),b(" ",k(12,11,t.SoldInChannel)," "),a(3),c("routerLink",Q(21,En))("queryParams",st(22,Te,t.ID)),a(),b(" ",k(16,13,t.NotInPOS)," "),a(3),b("",t.LastSync?Wt(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function An(i,p){if(i&1&&(v(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8,"Live Product"),r(),o(9,"th",12),d(10,"Sold In Channel"),r(),o(11,"th",13),d(12,"Product Not in POS"),r(),o(13,"th",14),d(14,"Last Sync"),r(),_(15,"th",15),r()(),o(16,"tbody"),S(17,Vn,28,24,"tr",16),F(18,"async"),r()()(),P()),i&2){let t,n=s();a(17),c("ngForOf",(t=k(18,1,n.channels$))==null?null:t.Data)}}function Un(i,p){i&1&&(o(0,"div",28),_(1,"app-empty-state"),r())}var Fe=(()=>{class i{constructor(t,n,e,l){this.productService=t,this.toastr=n,this.dialog=e,this.authService=l,this.destroy$=new Rt,this.channelOptions=l.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(kt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(w(n=>C.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(w(l=>l)).subscribe(l=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,e,!n.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(kt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(f(B),f(G),f(K),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,An,19,3,"ng-container",6),F(6,"async"),S(7,Un,2,0,"ng-template",null,0,et),r()()()()()),n&2){let l,h=$(8);c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",((l=k(6,4,e.channels$))==null||l.Data==null?null:l.Data.length)>0)("ngIfElse",h)}},dependencies:[E,V,R,yt,bt,j,St,xt,Kt],encapsulation:2})}}return i})();var Ln=[{component:Pe,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:we,canActivate:[X],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ye,canActivate:[X],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Me,canActivate:[X],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:De,canActivate:[X],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Oe,canActivate:[X],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Fe,canActivate:[X],data:{title:"Channel Statistic"}}]}],uo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Gt({type:i})}static{this.\u0275inj=$t({imports:[vt,It,te,Mt,Yt,xe,re,ne,Tt,J,Z,zt.forChild(Ln),ge,ve,lt]})}}return i})();export{uo as StatusModule};
1
+ import{a as N,b as Ot,c as Se}from"./chunk-AMVY4XMB.js";import"./chunk-JNMDGK2M.js";import"./chunk-MS4AQ6UA.js";import{a as j}from"./chunk-6HVHZ3HN.js";import{a as fe}from"./chunk-PF4F4EAR.js";import{a as Y}from"./chunk-7KG3DC5J.js";import{b as Ce}from"./chunk-OBN6RKRH.js";import"./chunk-5Z63CRGG.js";import{a as ee,b as ne}from"./chunk-ARIW575T.js";import{e as rt}from"./chunk-6ZT6G6ZX.js";import{a as ve}from"./chunk-T7KM2WP6.js";import{i as me,j as ue,k as he,l as _e,m as ge}from"./chunk-VOISFPEM.js";import"./chunk-WNAVUGZ4.js";import"./chunk-UOAYF4SW.js";import{a as B}from"./chunk-EXFL3GUX.js";import"./chunk-BSATGCWC.js";import"./chunk-6A4PYMCJ.js";import"./chunk-3RK6DDJD.js";import{a as Tt}from"./chunk-5UHZLNDT.js";import{a as J}from"./chunk-DG3PIXFJ.js";import{b as xe}from"./chunk-WYOXUN3H.js";import{a as se,b as pe}from"./chunk-23MIIDCT.js";import{a as ie,b as oe,c as re}from"./chunk-K5CKXDIJ.js";import"./chunk-SD7UKXTX.js";import{a as X}from"./chunk-SE5GYDNR.js";import{a as Z}from"./chunk-67USXWWF.js";import{c as ce}from"./chunk-E24BKGBJ.js";import"./chunk-VKJAFLQ6.js";import"./chunk-TY4H2W6F.js";import{a as de}from"./chunk-VYKDVKG3.js";import"./chunk-SDUUFQUI.js";import"./chunk-HPS3WVU5.js";import{a as le}from"./chunk-R5IDWUP6.js";import{f as ae}from"./chunk-4RAOUTR2.js";import{a as ot,b as wt,d as H,e as Yt}from"./chunk-TTAS23MO.js";import"./chunk-HA5WIDED.js";import"./chunk-AFMNWVBL.js";import"./chunk-EQ2ZKEVE.js";import{j as L}from"./chunk-7CIOGSCS.js";import{b as G,e as W}from"./chunk-JSPVOV7M.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-ORPJLSXE.js";import{b as Zt,c as qt,d as K,h as Dt,i as Qt,j as Xt,l as R,m as te}from"./chunk-XOT2SZPE.js";import{r as yt,s as Mt}from"./chunk-AKJ4I7KF.js";import"./chunk-2NECQ3RY.js";import{b as Ht,c as it,h as A,m as U,y as It}from"./chunk-AI4XRCAL.js";import{b as z,c as C}from"./chunk-W6T7TOHE.js";import{E as Pt,F as Jt,G as nt,H as bt,J as zt,f as E,g as V,j as St,k as Kt,m as xt,n as vt}from"./chunk-B6POIFQM.js";import{Dc as $,Eb as M,Ec as d,Fb as Gt,Fc as tt,G as w,Gc as b,Ic as D,Jc as O,Kb as S,Kc as T,Nc as Q,Oc as st,Qa as At,Wb as c,Xc as F,Yc as k,Zc as Wt,_c as et,aa as Ct,bc as ft,ca as kt,ea as jt,f as Rt,gc as o,hc as r,ic as _,jc as v,ka as $t,kc as P,mc as x,ob as y,pa as Vt,qb as a,rc as g,sc as s,v as Bt,wb as f,ya as m,za as u}from"./chunk-EIQCOZF5.js";import"./chunk-K2H6WANG.js";var Ne=()=>["/menu/products/download/by-url"],Pe=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),r(),o(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),r()()()()()(),_(12,"router-outlet")),n&2&&(a(3),c("Tabs",e.productTabs),a(7),c("routerLink",Q(2,Ne)))},dependencies:[ee,Jt,bt],encapsulation:2})}}return i})();function ke(i,p){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),d(4),r()()()),i&2){let t=p.$implicit;c("value",t.ChannelID),a(2),c("src",t.logo,y),a(2),tt(t.Title)}}var lt=(()=>{class i{constructor(){this.dialogRef=Vt(Zt),this.channels=Vt(qt),this.channelIds=At([]),this.channelOptions=At([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,l)=>l.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Qt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),T("ngModelChange",function(h){return O(e.channelIds,h)||(e.channelIds=h),h}),S(7,ke,5,3,"mat-option",5),r()()()()()),n&2&&(c("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),D("ngModel",e.channelIds),c("multiple",!0),a(),c("ngForOf",e.channelOptions()))},dependencies:[vt,E,Xt,le,ae,pe,se,ce,It,A,U,Mt],encapsulation:2})}}return i})();function Ve(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ae(i,p){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),d(2," Scan Channel "),r()}}function Ue(i,p){if(i&1&&(v(0),S(1,Ae,3,0,"button",15),P()),i&2){let t=s();a(),c("ngIf",!t.productService.hasSelection(t.products))}}function Le(i,p){if(i&1){let t=x();v(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Re(i,p){if(i&1){let t=x();v(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Be(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function je(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function $e(i,p){if(i&1){let t=x();v(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var we=(()=>{class i{constructor(t,n,e,l,h,I,ct){this.http=t,this.toastr=n,this.dialog=e,this.productService=l,this.authService=h,this.uploadProductService=I,this.route=ct,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.multipeScanChannels=[],this.getLoaderPage(),this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}getLoaderPage(){this.productService.LoadInPOS().subscribe(t=>{this.Categories=t.Options.Categories,this.searchFilter.PageNumber=t.Filter.PageNumber,this.searchFilter.RowCount=t.Filter.RowCount,this.searchFilter.ChannelID=null,this.searchFilter.Category=t.Filter.Category,this.searchFilter.PageSize=100,this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Ot,{data:{title:this.products[t].Name,variants:n},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(l=>C.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let h=this.productService.selectedProduct(this.products),I=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(I)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(l)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(G),f(K),f(B),f(L),f(rt),f(nt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let l=x();o(0,"mainpanel",1),g("onSubmit",function(I){return m(l),u(e.searchProduct(I))}),o(1,"actions"),S(2,Ve,3,1,"button",2)(3,Ue,2,1,"ng-container",3)(4,Le,4,1,"ng-container",3)(5,Re,4,1,"ng-container",3),r(),o(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),r(),o(10,"ng-select",5),g("ngModelChange",function(I){return m(l),u(e.searchFilter.Category=I)}),r()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),T("ngModelChange",function(I){return m(l),O(e.startDate,I)||(e.startDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r(),o(14,"input",9),T("ngModelChange",function(I){return m(l),O(e.endDate,I)||(e.endDate=I),u(I)}),g("click",function(){m(l);let I=$(16);return u(I.open())}),r()(),_(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",10)(19,"div",11),S(20,Be,2,11,"div",12)(21,je,3,0,"ng-container",3),r(),S(22,$e,4,5,"ng-container",3),r()()()}if(n&2){let l=$(16);c("headerTitle","In POS ("+e.rowCount+")"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),c("rangePicker",l),a(),D("ngModel",e.startDate),a(),D("ngModel",e.endDate),a(6),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products.length>0)}},dependencies:[E,V,it,A,U,R,H,J,Z,j,me,ue,he,_e],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Ge(i,p){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function We(i,p){if(i&1){let t=x();v(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),d(3," Scan Channel "),r(),P()}}function Ke(i,p){if(i&1){let t=x();v(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Je(i,p){if(i&1){let t=x();v(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function ze(i,p){if(i&1&&(o(0,"span",18),_(1,"img",19),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function He(i,p){if(i&1){let t=x();o(0,"div",20)(1,"label",21),d(2,"Item ID"),r(),o(3,"input",22),T("ngModelChange",function(e){m(t);let l=s();return O(l.searchFilter.Item_id,e)||(l.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),D("ngModel",t.searchFilter.Item_id)}}function Ye(i,p){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function Ze(i,p){i&1&&(v(0),o(1,"div",25),_(2,"app-empty-state"),r(),P())}function qe(i,p){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var ye=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt){this.http=t,this.dialog=n,this.toastr=e,this.productService=l,this.activateRouter=h,this.authService=I,this.route=ct,this.uploadProductService=gt,this.searchFilter=new Y,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=C.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=C.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[z.Tokopedia,z.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(Ot,{data:{variants:n,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(w(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(C.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanProducts(l)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=C.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let l=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(l);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=C.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=C.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=C.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=C.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(lt,{width:"600px",data:[...n]}).afterClosed().pipe(w(e=>C.IsNotEmpty(e)),Ct(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Dt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(B),f(Pt),f(L),f(nt),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),S(2,Ge,3,1,"button",1)(3,We,4,0,"ng-container",2)(4,Ke,4,1,"ng-container",2)(5,Je,4,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),r(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),S(11,ze,3,3,"ng-template",5),r()(),S(12,He,4,1,"div",6),r(),o(13,"content")(14,"div",7)(15,"div",8),S(16,Ye,2,11,"div",9)(17,Ze,3,0,"ng-container",2),r(),S(18,qe,3,4,"div",10),r()()()),n&2&&(c("headerTitle","Sold in Channel"),a(2),ft(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),c("ngIf",e.searchFilter.ListChannelID!=null),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products==null?null:e.products.length))},dependencies:[E,V,it,A,U,R,H,ot,wt,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function Xe(i,p){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),d(2),r()}if(i&2){let t=s(2);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function tn(i,p){if(i&1){let t=x();v(0),o(1,"td",29)(2,"input",30),T("ngModelChange",function(e){m(t);let l=s(2).$implicit;return O(l.selected,e)||(l.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,l=s(3);return u(l.onSelectProduct(e))}),r()(),P()}if(i&2){let t=s(2).$implicit;a(),c("rowSpan",t==null?null:t.Variants.length),a(),D("ngModel",t.selected)}}function en(i,p){if(i&1){let t=x();v(0),o(1,"img",35),g("click",function(e){m(t);let l=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,l==null?null:l.ImageUrl))}),r(),P()}if(i&2){let t=s(3).$implicit;a(),c("src",t==null?null:t.ImageUrl,y)}}function nn(i,p){i&1&&_(0,"img",36)}function on(i,p){if(i&1&&(v(0),o(1,"td",29)(2,"div",31),S(3,en,2,1,"ng-container",11)(4,nn,1,0,"ng-template",null,1,et),r()(),o(6,"td",32)(7,"h4",33)(8,"span",34),d(9),r()()(),P()),i&2){let t=$(5),n=s(2).$implicit;a(),c("rowSpan",n==null?null:n.Variants.length),a(2),c("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),c("rowSpan",n==null?null:n.Variants.length),a(2),c("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function rn(i,p){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),r()()),i&2){let t=p.$implicit;a(),c("href",t.URL,y),a(),c("src",t.Img,y)("matTooltip",t.Name)}}function an(i,p){if(i&1&&(o(0,"div"),_(1,"img",37),r()),i&2){let t=p.$implicit;a(),c("src",t.Img,y)("matTooltip",t.Name)}}function ln(i,p){if(i&1&&(o(0,"tr"),S(1,tn,3,2,"ng-container",12)(2,on,10,6,"ng-container",12),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",24)(9,"a",25),_(10,"i",26),r()()(),o(11,"td",27)(12,"div",28),S(13,rn,3,3,"div",23),r()(),o(14,"td",27)(15,"div",28),S(16,an,2,2,"div",23),r()()()),i&2){let t=p.$implicit,n=p.index,e=s(5);a(),c("ngIf",n==0),a(),c("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),c("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),y),a(4),c("ngForOf",t==null?null:t.Available),a(3),c("ngForOf",t==null?null:t.NotAvailable)}}function cn(i,p){if(i&1&&(v(0),S(1,ln,17,7,"tr",23),P()),i&2){let t=p.$implicit;a(),c("ngForOf",t.Variants)}}function sn(i,p){if(i&1&&(o(0,"tbody"),S(1,cn,2,1,"ng-container",23),r()),i&2){let t=p.ngIf;a(),c("ngForOf",t)}}function pn(i,p){if(i&1&&(v(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),d(7,"Product"),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),S(16,sn,2,1,"tbody",12),F(17,"async"),r()(),P()),i&2){let t=s(2);a(16),c("ngIf",k(17,1,t.data$))}}function dn(i,p){i&1&&(o(0,"div",38),_(1,"app-empty-state"),r())}function mn(i,p){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),d(2,"?"),r()()}}function un(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"number"),r()),i&2){let t=p.ngIf;a(),tt(k(2,1,t==null?null:t.Count))}}function hn(i,p){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),d(2," Next"),r()}}function _n(i,p){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),d(2," Last"),r()}}function gn(i,p){if(i&1&&(v(0),o(1,"div",39)(2,"div",40)(3,"div",41),d(4),F(5,"number"),S(6,mn,3,0,"span",42)(7,un,3,3,"span",12),F(8,"async"),d(9),r()(),o(10,"div",43),S(11,hn,3,0,"a",44)(12,_n,3,0,"a",45),r()(),P()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",k(5,6,t==null?null:t.length)," of "),a(2),c("ngIf",n.paginationService.hideCount),a(),c("ngIf",!n.paginationService.hideCount&&k(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function Cn(i,p){if(i&1&&(v(0),S(1,gn,13,10,"ng-container",12),P()),i&2){let t=p.ngIf;a(),c("ngIf",(t==null?null:t.length)>0)}}function fn(i,p){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let l=s();return u(l.searchProduct(e))}),o(1,"actions"),S(2,Xe,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),d(5," Scan Channel "),r(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),d(9,"Export"),r()()(),o(10,"content")(11,"div",9)(12,"div",10),S(13,pn,18,3,"ng-container",11),F(14,"async"),S(15,dn,2,0,"ng-template",null,0,et),r(),S(17,Cn,2,1,"ng-container",12),F(18,"async"),r()()()}if(i&2){let t,n=$(16),e=s();c("hideSearchDropdown",!0),a(2),c("ngIf",e.hasSelectionProduct),a(11),c("ngIf",((t=k(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),c("ngIf",k(18,7,e.data$))}}var Me=(()=>{class i{constructor(t,n,e,l,h,I,ct,gt,Ee){this.http=t,this.dialog=n,this.toastr=e,this.route=l,this.productService=h,this.paginationService=I,this.biggerPictureService=ct,this.authService=gt,this.uploadProductService=Ee,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=gt.getChannels(),this.hostName=this.authService.getDomain()}ngOnInit(){this.initPageLoader(),this.iniData()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.notChannelAPI,this.loader$=this.http.post(`api/${this.loaderAPI}`,{}).pipe(jt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Bt(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=C.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Ce,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(G),f(nt),f(B),f(fe),f(de),f(L),f(rt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(S(0,fn,19,9,"mainpanel",2),F(1,"async")),n&2&&c("ngIf",k(1,1,e.loader$))},dependencies:[E,V,Ht,A,U,R,yt,j,St,xt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Sn=i=>[i],xn=()=>[];function vn(i,p){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),d(2," Scan Channel "),r()}}function Pn(i,p){if(i&1){let t=x();v(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function bn(i,p){if(i&1&&(o(0,"span",19),_(1,"img",20),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,y)("alt",t.Name),a(),b(" ",t.Name," ")}}function In(i,p){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let l=m(t).index,h=s();return u(h.onSelectProduct(e,l))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,l=s();return u(l.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanChannel(e))}),r()()}if(i&2){let t=p.$implicit;a(),c("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?st(10,Sn,t==null?null:t.Channel):Q(12,xn))("showCheckBox",!0)("scanButton",!0)}}function wn(i,p){i&1&&(v(0),o(1,"div",23),_(2,"app-empty-state"),r(),P())}function yn(i,p){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var De=(()=>{class i{constructor(t,n,e,l,h,I){this.http=t,this.dialog=n,this.productService=e,this.toastrService=l,this.activateRouter=h,this.authService=I,this.searchFilter=new Y,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(C.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?C.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=C.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(C.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=C.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=C.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(w(e=>C.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(C.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(Se,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(K),f(B),f(G),f(Pt),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),S(2,vn,3,0,"button",1)(3,Pn,4,1,"ng-container",2),r(),o(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),r(),o(8,"ng-select",4),T("ngModelChange",function(h){return O(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),S(9,bn,3,3,"ng-template",5),r()(),o(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),r(),o(13,"mat-radio-group",8),T("ngModelChange",function(h){return O(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),d(15," All "),r(),o(16,"mat-radio-button",9),d(17," Yes "),r(),o(18,"mat-radio-button",9),d(19," No "),r()()(),o(20,"div",6)(21,"label",7),d(22,"Item ID"),r(),o(23,"input",10),T("ngModelChange",function(h){return O(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),r()()(),o(24,"content")(25,"div",11)(26,"div",12),S(27,In,2,13,"div",13)(28,wn,3,0,"ng-container",2),r(),S(29,yn,3,4,"div",14),r()()()),n&2&&(a(2),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ChannelID),a(5),D("ngModel",e.searchFilter.HaveSku),a(),c("value",0),a(2),c("value",1),a(2),c("value",2),a(5),D("ngModel",e.searchFilter.Item_id),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,it,A,U,R,H,ot,ie,oe,J,Z,j],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Mn(i,p){if(i&1&&(o(0,"span",9),_(1,"img",10),r(),d(2)),i&2){let t=p.item,n=s();a(),c("src",n.getChannelLogo(t.TypeID),y),a(),b(" ",t.Name," ")}}function Dn(i,p){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),r()),i&2){let t=p.$implicit,n=p.index;a(),c("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function On(i,p){i&1&&(v(0),o(1,"div",13),_(2,"app-empty-state"),r(),P())}function Tn(i,p){if(i&1){let t=x();v(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var Oe=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new Y,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=C.GuidEMpty}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(f(W),f(B),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),r(),o(6,"ng-select",3),T("ngModelChange",function(h){return O(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),S(7,Mn,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),S(11,Dn,2,6,"div",7)(12,On,3,0,"ng-container",8),r(),S(13,Tn,4,4,"ng-container",8),r()()()),n&2&&(a(6),c("multiple",!0)("clearable",!0)("items",e.channelOptions),D("ngModel",e.searchFilter.ListChannelID),a(5),c("ngForOf",e.products),a(),c("ngIf",(e.products==null?null:e.products.length)==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[E,V,A,U,R,H,ot,wt,Tt,J,j],encapsulation:2})}}return i})();var Fn=()=>["/menu/products/status/sold-in-channel"],Te=i=>({ID:i}),En=()=>["/menu/products/status/not-in-pos"];function Nn(i,p){if(i&1&&(v(0),d(1),P()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function kn(i,p){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,l=s(2);return u(l.getLiveProductCount(e.ID,e))}),_(1,"i",27),r()}}function Vn(i,p){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),S(6,Nn,2,1,"ng-container",6)(7,kn,2,0,"ng-template",null,1,et),r(),o(9,"td",19)(10,"a",20),d(11),F(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),F(16,"number"),r()(),o(17,"td"),d(18),F(19,"date"),r(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onScanChannel(e))}),_(23,"i",23),d(24," Scan "),r(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onClearCache(e.ID))}),_(26,"i",25),d(27," Clear "),r()()()()}if(i&2){let t=p.$implicit,n=$(8),e=s(2);a(2),c("src",e.getChannelLogo(t.TypeID),y),a(2),tt(t.Name),a(2),c("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),c("routerLink",Q(18,Fn))("queryParams",st(19,Te,t.ID)),a(),b(" ",k(12,11,t.SoldInChannel)," "),a(3),c("routerLink",Q(21,En))("queryParams",st(22,Te,t.ID)),a(),b(" ",k(16,13,t.NotInPOS)," "),a(3),b("",t.LastSync?Wt(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function An(i,p){if(i&1&&(v(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8,"Live Product"),r(),o(9,"th",12),d(10,"Sold In Channel"),r(),o(11,"th",13),d(12,"Product Not in POS"),r(),o(13,"th",14),d(14,"Last Sync"),r(),_(15,"th",15),r()(),o(16,"tbody"),S(17,Vn,28,24,"tr",16),F(18,"async"),r()()(),P()),i&2){let t,n=s();a(17),c("ngForOf",(t=k(18,1,n.channels$))==null?null:t.Data)}}function Un(i,p){i&1&&(o(0,"div",28),_(1,"app-empty-state"),r())}var Fe=(()=>{class i{constructor(t,n,e,l){this.productService=t,this.toastr=n,this.dialog=e,this.authService=l,this.destroy$=new Rt,this.channelOptions=l.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(kt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(w(n=>C.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(w(l=>l)).subscribe(l=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,e,!n.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(kt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return C.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(f(B),f(G),f(K),f(L))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[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,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,An,19,3,"ng-container",6),F(6,"async"),S(7,Un,2,0,"ng-template",null,0,et),r()()()()()),n&2){let l,h=$(8);c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",((l=k(6,4,e.channels$))==null||l.Data==null?null:l.Data.length)>0)("ngIfElse",h)}},dependencies:[E,V,R,yt,bt,j,St,xt,Kt],encapsulation:2})}}return i})();var Ln=[{component:Pe,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:we,canActivate:[X],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ye,canActivate:[X],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Me,canActivate:[X],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:De,canActivate:[X],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Oe,canActivate:[X],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Fe,canActivate:[X],data:{title:"Channel Statistic"}}]}],uo=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=Gt({type:i})}static{this.\u0275inj=$t({imports:[vt,It,te,Mt,Yt,xe,re,ne,Tt,J,Z,zt.forChild(Ln),ge,ve,lt]})}}return i})();export{uo as StatusModule};