marketplacepos 5.33.2 → 5.33.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 (56) hide show
  1. package/Marketplace/{chunk-MBG6WYMK.js → chunk-24L5FOB5.js} +1 -1
  2. package/Marketplace/{chunk-KK2Q5Q3P.js → chunk-2PIRXBYL.js} +1 -1
  3. package/Marketplace/{chunk-Q7ZZFOG6.js → chunk-2XS7OQIR.js} +1 -1
  4. package/Marketplace/{chunk-NNQLRLNB.js → chunk-3LR4RLA6.js} +1 -1
  5. package/Marketplace/chunk-47DMD3UG.js +1 -0
  6. package/Marketplace/{chunk-PNVJ62RQ.js → chunk-4LJDBY23.js} +1 -1
  7. package/Marketplace/{chunk-P5YVNHLJ.js → chunk-56RXROJ7.js} +1 -1
  8. package/Marketplace/{chunk-LJHZMQZD.js → chunk-5VEPYUMQ.js} +1 -1
  9. package/Marketplace/{chunk-P2A5AQIO.js → chunk-6XIV3N7A.js} +1 -1
  10. package/Marketplace/{chunk-DLNXH2FE.js → chunk-7XUSMPAA.js} +1 -1
  11. package/Marketplace/{chunk-TQ3TU52C.js → chunk-B3Z4Y52F.js} +1 -1
  12. package/Marketplace/{chunk-2JQFQKKW.js → chunk-CDAOAGKM.js} +1 -1
  13. package/Marketplace/{chunk-QCC5ZGGN.js → chunk-DVSSWF73.js} +1 -1
  14. package/Marketplace/{chunk-IOOEU477.js → chunk-FRYA4RZR.js} +1 -1
  15. package/Marketplace/{chunk-I7Q2FSST.js → chunk-HNVBDDSL.js} +1 -1
  16. package/Marketplace/{chunk-OJFTMV7L.js → chunk-HPHJU75A.js} +1 -1
  17. package/Marketplace/{chunk-BR3BSUIQ.js → chunk-HPLIOAWM.js} +1 -1
  18. package/Marketplace/{chunk-CCP4DXYC.js → chunk-INWZZHLS.js} +1 -1
  19. package/Marketplace/{chunk-5E7C2QHD.js → chunk-JV3UZOBG.js} +1 -1
  20. package/Marketplace/chunk-KABR4K5U.js +1 -0
  21. package/Marketplace/{chunk-4PQYITAE.js → chunk-LQFCI5YI.js} +1 -1
  22. package/Marketplace/{chunk-XFTUE2ST.js → chunk-LUY3WZJE.js} +1 -1
  23. package/Marketplace/{chunk-JNIA6WXE.js → chunk-M3CXSEKC.js} +1 -1
  24. package/Marketplace/{chunk-IHNDCM7T.js → chunk-M7UL2KTJ.js} +1 -1
  25. package/Marketplace/{chunk-OXWBU2ND.js → chunk-MEZONX3R.js} +1 -1
  26. package/Marketplace/{chunk-YND7NT66.js → chunk-OHMSNLFS.js} +1 -1
  27. package/Marketplace/{chunk-QNKFNW7X.js → chunk-OSA3WANL.js} +1 -1
  28. package/Marketplace/{chunk-LB6JFX4H.js → chunk-P5UOWO2P.js} +1 -1
  29. package/Marketplace/{chunk-IP23AD3S.js → chunk-P6KMQO2E.js} +10 -2
  30. package/Marketplace/{chunk-5UYLNF4H.js → chunk-PK4O6QWQ.js} +2 -2
  31. package/Marketplace/chunk-PWJN63P6.js +1 -0
  32. package/Marketplace/{chunk-T4PET7OJ.js → chunk-R26MXOGQ.js} +1 -1
  33. package/Marketplace/{chunk-DDHEMRO7.js → chunk-S2Z3ZGU7.js} +1 -1
  34. package/Marketplace/chunk-S6BGK6BR.js +1 -0
  35. package/Marketplace/{chunk-EFXWMCWY.js → chunk-SD5R2WIO.js} +1 -1
  36. package/Marketplace/{chunk-6KOGCWHI.js → chunk-UAPFZUIT.js} +1 -1
  37. package/Marketplace/{chunk-5SZSDHJB.js → chunk-UEXKIRBJ.js} +1 -1
  38. package/Marketplace/{chunk-IUKHWWDP.js → chunk-URCHO4IV.js} +1 -1
  39. package/Marketplace/{chunk-IQ7CJD65.js → chunk-UYRL4OQM.js} +1 -1
  40. package/Marketplace/{chunk-QK46N4UF.js → chunk-VEDGJJLB.js} +1 -1
  41. package/Marketplace/{chunk-5BGZXXFA.js → chunk-VGZMEOMT.js} +1 -1
  42. package/Marketplace/{chunk-FYULKTNX.js → chunk-VMONTVSP.js} +1 -1
  43. package/Marketplace/{chunk-3HXO7QJQ.js → chunk-VUCBGF73.js} +1 -1
  44. package/Marketplace/{chunk-HTVQCXM6.js → chunk-W6TPMU2O.js} +1 -1
  45. package/Marketplace/{chunk-N3TTJVBG.js → chunk-X2TVRY2Z.js} +1 -1
  46. package/Marketplace/{chunk-2TVASR35.js → chunk-XCMXV2H4.js} +1 -1
  47. package/Marketplace/{chunk-BNKFF5IF.js → chunk-YMT4PQWK.js} +1 -1
  48. package/Marketplace/{chunk-MP6SRJJL.js → chunk-YPLUD27C.js} +1 -1
  49. package/Marketplace/{chunk-P64M4BHW.js → chunk-ZQWAIH5X.js} +1 -1
  50. package/Marketplace/index.html +2 -2
  51. package/Marketplace/{main-LUFJVAF3.js → main-M6EDUJYT.js} +1 -1
  52. package/package.json +1 -1
  53. package/Marketplace/chunk-64G3XLI6.js +0 -1
  54. package/Marketplace/chunk-FPVVWF7G.js +0 -1
  55. package/Marketplace/chunk-G2DFMLE4.js +0 -1
  56. package/Marketplace/chunk-KDCBSUBB.js +0 -1
@@ -1 +1 @@
1
- import{a as v,b}from"./chunk-N3TTJVBG.js";import{a as r}from"./chunk-2TVASR35.js";import"./chunk-QK46N4UF.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-64G3XLI6.js";import{n as h,r as i}from"./chunk-OVEJFFL6.js";import{Cd as o,Gb as u,Sb as d,Tb as C,Ub as a,jb as s,ka as l,ta as m,ua as c,vc as f}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-EFXWMCWY.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-KK2Q5Q3P.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-5E7C2QHD.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
1
+ import{a as v,b}from"./chunk-X2TVRY2Z.js";import{a as r}from"./chunk-XCMXV2H4.js";import"./chunk-VEDGJJLB.js";import"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import"./chunk-47DMD3UG.js";import{n as h,r as i}from"./chunk-OVEJFFL6.js";import{Cd as o,Gb as u,Sb as d,Tb as C,Ub as a,jb as s,ka as l,ta as m,ua as c,vc as f}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-SD5R2WIO.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-2PIRXBYL.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-JV3UZOBG.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
@@ -1 +1 @@
1
- import"./chunk-5SZSDHJB.js";import{a as Ue}from"./chunk-7LZ5ZSXM.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-DLNXH2FE.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-QNKFNW7X.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-DDHEMRO7.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-P64M4BHW.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-XFTUE2ST.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{j as K}from"./chunk-QK46N4UF.js";import{b as Pe,e as be}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-64G3XLI6.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[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"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
1
+ import"./chunk-UEXKIRBJ.js";import{a as Ue}from"./chunk-7LZ5ZSXM.js";import{a as X}from"./chunk-XHAXYWZ7.js";import{a as Ae,b as We,c as te}from"./chunk-7XUSMPAA.js";import{a as xe}from"./chunk-BVIRHZTZ.js";import{a as $e}from"./chunk-OSA3WANL.js";import{a as Ne}from"./chunk-7KG3DC5J.js";import{b as Re}from"./chunk-S2Z3ZGU7.js";import{a as Le}from"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import"./chunk-JXTGH22T.js";import"./chunk-GCKSYCMI.js";import{a as ke}from"./chunk-ZQWAIH5X.js";import"./chunk-ADRVUMMW.js";import{a as De,b as Oe,c as Ve}from"./chunk-UMNGKENU.js";import{a as Be}from"./chunk-LUY3WZJE.js";import"./chunk-HCDKYABV.js";import{a as ye,b as Ie,d as we,e as Fe}from"./chunk-CCXKODFV.js";import{j as K}from"./chunk-VEDGJJLB.js";import{b as Pe,e as be}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{d as Me,m as Ee,n as Te}from"./chunk-BO4PPSB5.js";import{t as H,u as J}from"./chunk-HUUFOAKH.js";import"./chunk-E5GGIVK7.js";import{a as Ce,b as fe,h as k,m as B,y as L}from"./chunk-BSN7ZAXG.js";import{c as G,e as Se,f as ve}from"./chunk-47DMD3UG.js";import"./chunk-OVEJFFL6.js";import{$b as g,Bd as he,Cd as N,Da as C,Ea as f,Eb as u,G as Z,Gb as s,Gc as y,Hc as T,Ic as de,Jb as ce,Jc as ee,Ma as Y,Nb as W,Ob as R,Pa as re,Qb as $,Rb as U,Sb as r,Tb as l,Ub as P,Vb as I,Wb as w,Yb as b,Z as q,bc as m,ea as ae,ec as se,gb as S,jb as c,kb as v,mc as Q,nc as p,oc as me,pa as A,pc as x,rc as F,sc as M,sd as _e,ta as D,tc as E,uc as j,ud as z,v as oe,vc as O,vd as ue,xb as le,xc as V,yc as pe,yd as ge}from"./chunk-PQDPS2ID.js";import{a as ne,b as ie}from"./chunk-GNOSNGXM.js";var qe=(n,a)=>({color:n,"font-weight":a});function Ye(n,a){if(n&1&&(r(0,"mat-radio-button",2),p(1),l()),n&2){let i=a.$implicit,o=a.index,e=m();ce(pe(7,qe,e.model==i.Key&&e.activeBold?"#0976b4":"",e.model==i.Key&&e.activeBold?"700":"")),s("disabled",e.exception==i.Value)("matTooltip",e.title.length>0?e.title[o]:"")("value",i.Key)("name",e.name),c(),x("",i.Value," ")}}var Ge=(()=>{let a=class a{constructor(){this.disabled=!1,this.modelChange=new re,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(o){this.modelChange.emit(o)}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},standalone:!0,features:[O],decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(e,t){e&1&&(r(0,"mat-radio-group",0),g("ngModelChange",function(_){return t.change(_)}),u(1,Ye,2,10,"mat-radio-button",1),l()),e&2&&(s("disabled",t.disabled)("ngModel",t.model),c(),s("ngForOf",t.options))},dependencies:[N,z,Ve,De,Oe,L,k,B,J,H],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px;--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]});let n=a;return n})();function Qe(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l()),n&2){let i=a.item;c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," ")}}function et(n,a){if(n&1){let i=b();r(0,"span",6),g("click",function(){C(i);let e=m(),t=e.item,d=e.clear;return f(d(t))}),p(1,"x"),l()}}function tt(n,a){if(n&1&&(r(0,"span",3),P(1,"img",4),l(),r(2,"span"),p(3),l(),u(4,et,2,0,"span",5)),n&2){let i=a.item,o=m();c(),s("src",i==null?null:i.Img,S),c(2),x(" ",i.Name," "),c(),W(o.clearable()?4:-1)}}var Ke=(()=>{let a=class a{constructor(){this.authService=A(K),this.multiple=Y(!1),this.clearable=Y(!0),this.options=this.authService.getChannels(),this.onChange=o=>{}}onChannelChange(o){this.onChange(o)}writeValue(o){this.selectedChannels=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){}};a.\u0275fac=function(e){return new(e||a)},a.\u0275cmp=D({type:a,selectors:[["channel-select-options"]],inputs:{multiple:[1,"multiple"],clearable:[1,"clearable"]},standalone:!0,features:[j([{provide:Ce,multi:!0,useExisting:a}]),O],decls:3,vars:4,consts:[["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel","multiple"],["ng-option-tmp",""],["ng-label-tmp",""],[1,"me-2"],[2,"width","18px",3,"src"],["aria-hidden","true",1,"ng-value-icon","right"],["aria-hidden","true",1,"ng-value-icon","right",3,"click"]],template:function(e,t){e&1&&(r(0,"ng-select",0),E("ngModelChange",function(_){return M(t.selectedChannels,_)||(t.selectedChannels=_),_}),g("ngModelChange",function(_){return t.onChannelChange(_)}),u(1,Qe,4,2,"ng-template",1)(2,tt,5,3,"ng-template",2),l()),e&2&&(s("clearable",t.clearable())("items",t.options),F("ngModel",t.selectedChannels),s("multiple",t.multiple()))},dependencies:[N,Fe,we,ye,Ie,L,k,B]});let n=a;return n})();var He=n=>[n],nt=n=>({"text-decoration-line-through":n}),it=n=>({"border-bottom":n}),ot=n=>({"bg-gradient-warning":n});function at(n,a){if(n&1){let i=b();I(0),r(1,"div")(2,"label",21),p(3,"Channel"),l(),r(4,"channel-select-options",22),E("ngModelChange",function(e){C(i);let t=m();return M(t.searchFilter.ListChannelID,e)||(t.searchFilter.ListChannelID=e),f(e)}),l()(),r(5,"div",23)(6,"label",24),p(7,"Filter by"),l(),r(8,"lib-radio-options",25),E("modelChange",function(e){C(i);let t=m();return M(t.searchFilter.filterModel,e)||(t.searchFilter.filterModel=e),f(e)}),l()(),w()}if(n&2){let i=m();c(4),s("multiple",!0),F("ngModel",i.searchFilter.ListChannelID),c(4),F("model",i.searchFilter.filterModel),s("options",i.filterTypeOptions)}}function rt(n,a){if(n&1){let i=b();r(0,"button",27),g("click",function(){C(i);let e=m().ngIf,t=m();return f(t.onUpdateItems(e))}),P(1,"i",28),p(2," Update "),l()}}function lt(n,a){if(n&1&&(I(0),r(1,"div",4),u(2,rt,3,0,"button",26),l(),w()),n&2){let i=a.ngIf,o=m();c(2),s("ngIf",o.productService.hasSelectionVariant(i))}}function ct(n,a){if(n&1&&(r(0,"th",15)(1,"div",29),P(2,"img",30),r(3,"div",31),p(4),y(5,"stringLimit"),l()()()),n&2){let i=a.$implicit;c(),s("matTooltip",(i.Name==null?null:i.Name.length)>20?i.Name:""),c(),s("src",i==null?null:i.Img,S),c(2),x(" ",de(5,3,i.Name,20)," ")}}function st(n,a){if(n&1){let i=b();r(0,"th")(1,"input",32),E("ngModelChange",function(e){C(i);let t=m();return M(t.checkboxState,e)||(t.checkboxState=e),f(e)}),g("ngModelChange",function(){C(i);let e=m();return f(e.onSelectAllData())}),l()()}if(n&2){let i=m();c(),F("ngModel",i.checkboxState)}}function mt(n,a){n&1&&(r(0,"th",33)(1,"span"),p(2,"Expected"),l(),r(3,"span",34),p(4,"(POS)"),l()(),r(5,"th",33),p(6,"Channel"),l())}function pt(n,a){if(n&1){let i=b();r(0,"img",47),g("click",function(e){C(i);let t=m(3).$implicit,d=m(2);return f(d.onZoomImage(e,t==null?null:t.ImageUrl))}),l()}if(n&2){let i=m(3).$implicit;se("src",i==null?null:i.ImageUrl,S)}}function dt(n,a){n&1&&P(0,"img",48)}function _t(n,a){if(n&1&&(r(0,"small",46),p(1),l()),n&2){let i=m(3).$implicit;c(),x("(",i==null?null:i.Category,")")}}function ut(n,a){if(n&1&&(I(0),r(1,"td",42),u(2,pt,1,1,"img",43)(3,dt,1,0,"ng-template",null,0,ee),l(),r(5,"td",44)(6,"h5",45),p(7),l(),u(8,_t,2,1,"small",46),l(),w()),n&2){let i=Q(4),o=m().$index,e=m().$implicit,t=m().ngIf;c(),s("rowSpan",e==null?null:e.Variants.length)("ngClass",V(7,it,o+1==t.length)),c(),s("ngIf",e==null?null:e.ImageUrl)("ngIfElse",i),c(3),s("rowSpan",e==null?null:e.Variants.length),c(2),me(e==null?null:e.Name),c(),W(e!=null&&e.Category?8:-1)}}function gt(n,a){if(n&1){let i=b();r(0,"td",49)(1,"input",32),E("ngModelChange",function(e){C(i);let t=m().$implicit;return M(t.selected,e)||(t.selected=e),f(e)}),l()()}if(n&2){let i=m().$implicit;c(),F("ngModel",i.selected)}}function ht(n,a){if(n&1){let i=b();I(0),r(1,"td",51),p(2),y(3,"number"),l(),r(4,"td",52),g("click",function(){let e=C(i).$implicit,t=m(2).$implicit,d=m().$implicit,_=m(2);return f(_.openTableDialog(t,d,e))}),r(5,"div",53)(6,"div",54),p(7),y(8,"number"),l(),r(9,"a",55),g("click",function(e){return C(i),f(e==null?null:e.stopPropagation())}),P(10,"i",40),l()()(),w()}if(n&2){let i=a.$implicit;c(2),x(" ",T(3,4,i.PriceExpected)," "),c(2),s("ngClass",V(8,ot,i.Price!=i.PriceExpected)),c(3),x(" ",T(8,6,i.Price)," "),c(2),s("href",i.Url,S)}}function Ct(n,a){n&1&&(r(0,"td",56),p(1," X "),l(),r(2,"td",56),p(3," X "),l())}function ft(n,a){if(n&1&&(I(0),u(1,ht,11,10,"ng-container",50)(2,Ct,4,0,"ng-template",null,1,ee),w()),n&2){let i=a.$implicit,o=Q(3),e=m().$implicit,t=m(3);c(),s("ngIf",t.getItemFromChannel(e,i.ID))("ngIfElse",o)}}function xt(n,a){if(n&1&&(r(0,"tr"),u(1,ut,9,9,"ng-container",3),r(2,"td",35),p(3),l(),r(4,"td",36)(5,"div",37)(6,"div",38),p(7),l(),r(8,"div",31)(9,"a",39),P(10,"i",40),l()()()(),u(11,gt,2,1,"ng-template",19)(12,ft,4,2,"ng-container",41),l()),n&2){let i=a.$implicit,o=a.$index,e=m(3);c(),s("ngIf",o==0),c(2),x(" ",i==null?null:i.Model," "),c(),s("matTooltip",i.Discontinued?e.discontinuedVariantMsg:""),c(2),s("ngClass",V(8,nt,i.Discontinued)),c(),x(" ",i==null?null:i.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(i==null?null:i.ID),S),c(2),s("ngxPermissionsOnly",V(10,He,e.rolePriceEdit)),c(),s("ngForOf",e.channels())}}function Pt(n,a){if(n&1&&(r(0,"tbody"),$(1,xt,13,12,"tr",null,R),l()),n&2){let i=a.$implicit;c(),U(i.Variants)}}function bt(n,a){if(n&1&&(I(0),$(1,Pt,3,0,"tbody",null,R),w()),n&2){let i=a.ngIf;c(),U(i)}}var xn=(()=>{let a=class a{constructor(o,e,t,d,_,h,Je){this.http=o,this.toastr=e,this.dialog=t,this.productService=d,this.authService=_,this.biggerPictureService=h,this.paginationService=Je,this.infinitePagination=A(te),this.searchFilter=new Ne,this.checkboxState=!1,this.rolePriceEdit=xe.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=le([]),this.filterTypeOptions=[{Key:X.ALL,Value:"All"},{Key:X.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let o=this.searchFilter.ListChannelID,e=[];G.IsEmpty(o)||o?.length==0?e=this.channelOptions:e=this.channelOptions.filter(t=>o.findIndex(d=>d==t.ID)>-1),this.channels.update(()=>e)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(q(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ae(o=>{this.searchFilter=o.Filter,this.searchFilter.filterModel=X.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),q(1))}onSelectAllData(){this.data$=this.data$.pipe(oe(o=>(o.map(e=>(e.Variants&&(e.Variants=e.Variants.map(t=>(t.selected=this.checkboxState,t))),e)),o)))}onFilter(o){this.searchFilter.text=o;let e=ie(ne({},this.searchFilter),{text:o,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(e)}updatePrice(o){let e=this.productService.selectedVariantProduct(o);if(e.length>0){let t=e.map(h=>h.ID),_={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",_).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+_.ListID.length+" items in "+_.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(o=>(o.selected=!1,o))}getItemFromChannel(o,e){return o.Channel.find(t=>t.ChannelID==e)}onUpdateItems(o){let e=this.productService.selectedVariantProduct(o);this.dialog.open(Ue,{data:{title:"Updating Price",selectedItems:e,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(Z(t=>G.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(o)})}openTableDialog(o,e,t){let d=JSON.parse(JSON.stringify(o));this.dialog.open(Ae,{data:{Name:e.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(Z(h=>G.IsNotEmpty(h))).subscribe(h=>{this.updateProductPrice(h,t)})}updateProductPrice(o,e){let t={ID:o.ChannelID,ChannelItemID:o.ChannelItemID,ChannelVariantID:o.ChannelVariationID,Price:parseFloat(o.Price),VariantID:o.ID,SKU:o.Sku};this.http.post("/api/Price/UpdatePriceByID",t).subscribe(d=>{e.Price=t.Price;let _=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${o.ItemName} (${o.VarName}) inventory in ${_.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(o,e){this.biggerPictureService.openBiggerPicture(o,e)}};a.\u0275fac=function(e){return new(e||a)(v(be),v(Pe),v(Me),v(ke),v(K),v(Be),v($e))},a.\u0275cmp=D({type:a,selectors:[["app-custom-channel-price"]],standalone:!0,features:[j([te]),O],decls:38,vars:23,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[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"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center","border","pointer","cell-hover",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(e,t){e&1&&(r(0,"mainpanel",2),g("onSubmit",function(_){return t.onFilter(_)}),r(1,"filters"),u(2,at,9,4,"ng-container",3),y(3,"async"),l(),r(4,"actions")(5,"div",4),u(6,lt,3,1,"ng-container",3),y(7,"async"),r(8,"button",5),g("click",function(){return t.openExportDialog()}),P(9,"i",6),r(10,"span"),p(11,"Export"),l()()()(),r(12,"content")(13,"div",7)(14,"div",8)(15,"div",9)(16,"div",10)(17,"table",11)(18,"thead",12)(19,"tr",13),P(20,"th",14),$(21,ct,6,6,"th",15,R),l(),r(23,"tr")(24,"th",16)(25,"span"),p(26," Product "),l()(),r(27,"th",17),p(28,"Variant"),l(),r(29,"th",18),p(30,"SKU"),l(),u(31,st,2,1,"ng-template",19),$(32,mt,7,0,null,null,R),l()(),u(34,bt,3,0,"ng-container",3),y(35,"async"),l(),r(36,"infinite-paginator",20),y(37,"async"),g("onNextPage",function(){return t.infinitePagination.onNextPage(t.searchFilter)})("onLastPage",function(){return t.infinitePagination.onLastPage(t.searchFilter)})("onGetRowCount",function(){return t.infinitePagination.getRowCount(t.searchFilter)}),l()()()()()()()),e&2&&(s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),c(2),s("ngIf",T(3,13,t.loader$)),c(4),s("ngIf",T(7,15,t.data$)),c(15),U(t.channels()),c(10),s("ngxPermissionsOnly",V(21,He,t.rolePriceEdit)),c(),U(t.channels()),c(2),s("ngIf",T(35,17,t.data$)),c(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",T(37,19,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[N,_e,z,ue,ge,he,Te,Ee,L,fe,k,B,We,Ge,J,H,Le,ve,Se,Ke],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]});let n=a;return n})();export{xn as CustomChannelPriceComponent};
@@ -1 +1 @@
1
- import{a as N,b as Tt,c as Pe}from"./chunk-P5YVNHLJ.js";import"./chunk-IHNDCM7T.js";import{a as $}from"./chunk-RENQ3YZH.js";import{a as ve}from"./chunk-QNKFNW7X.js";import{a as Z}from"./chunk-7KG3DC5J.js";import{b as xe}from"./chunk-DDHEMRO7.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import{a as re,b as ae}from"./chunk-N3TTJVBG.js";import{e as at}from"./chunk-5BGZXXFA.js";import{f as _e,g as ge,h as Ce,i as fe,j as Se}from"./chunk-FGPSBTFS.js";import"./chunk-QCC5ZGGN.js";import"./chunk-GCKSYCMI.js";import{a as j}from"./chunk-P64M4BHW.js";import"./chunk-ADRVUMMW.js";import{a as Ft}from"./chunk-IUKHWWDP.js";import{a as z}from"./chunk-YYWSBXIP.js";import{b as be}from"./chunk-WT6W7RAQ.js";import{a as me,b as ue}from"./chunk-BQ7NR3ET.js";import{a as le,b as ce,c as se}from"./chunk-UMNGKENU.js";import{a as tt}from"./chunk-2TVASR35.js";import{a as q}from"./chunk-PNVJ62RQ.js";import"./chunk-FMV4LYKN.js";import{a as he}from"./chunk-XFTUE2ST.js";import{f as pe,g as de}from"./chunk-HCDKYABV.js";import{a as rt,b as yt,d as Y,e as qt}from"./chunk-CCXKODFV.js";import{j as R}from"./chunk-QK46N4UF.js";import{b as W,e as K}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{b as te,c as ee,d as J,h as Ot,i as ne,j as ie,m as B,n as oe}from"./chunk-BO4PPSB5.js";import{t as Mt,u as Dt}from"./chunk-HUUFOAKH.js";import{P as Qt,X as Xt}from"./chunk-E5GGIVK7.js";import{b as Zt,c as ot,h as U,m as L,y as wt}from"./chunk-BSN7ZAXG.js";import{b as H,c as f}from"./chunk-64G3XLI6.js";import{m as bt,n as Ht,o as it,p as It,r as Yt}from"./chunk-OVEJFFL6.js";import{$b as C,Bd as vt,Cd as Pt,Da as m,Ea as u,Eb as x,G as y,Gb as s,Gc as E,Hc as V,Ic as Jt,Jc as nt,Nb as St,Sb as a,Tb as l,Ub as g,Vb as P,Wb as b,Yb as v,aa as ft,bc as p,ca as Vt,ea as $t,f as Bt,gb as D,jb as c,ka as Gt,kb as S,mc as G,nc as d,oc as et,pa as At,pc as I,rc as O,sc as T,ta as M,tc as F,ua as Wt,ud as k,v as jt,vc as Kt,vd as A,wc as X,xb as Ut,xc as pt,yd as xt,zd as zt}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Ve=()=>["/menu/products/download/by-url"],Ie=(()=>{let r=class r{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"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],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(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),l()()()()()(),g(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",X(2,Ve)))},dependencies:[re,Ht,It]});let o=r;return o})();function Ae(o,r){if(o&1&&(a(0,"mat-option",6)(1,"div"),g(2,"img",7),a(3,"span"),d(4),l()()()),o&2){let n=r.$implicit;s("value",n.ChannelID),c(2),s("src",n.logo,D),c(2),et(n.Title)}}var ct=(()=>{let r=class r{constructor(){this.dialogRef=At(te),this.channels=At(ee),this.channelIds=Ut([]),this.channelOptions=Ut([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((e,i,h)=>h.findIndex(_=>_.ChannelID===e.ChannelID)===i);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new ne,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(e=>this.channelIds().includes(e.ChannelID)).map(e=>({ChannelID:e.ChannelID,ChannelItemID:e.ChannelItemID}));this.dialogRef.close(t)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-modal-detach-product"]],standalone:!0,features:[Kt],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(e,i){e&1&&(a(0,"modal-material",0),C("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()})("onOk",function(){return i.onSave()}),a(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),l(),a(5,"mat-form-field",3)(6,"mat-select",4),F("ngModelChange",function(_){return T(i.channelIds,_)||(i.channelIds=_),_}),x(7,Ae,5,3,"mat-option",5),l()()()()()),e&2&&(s("dynamicValidated",i.channelIds().length>0)("config",i.modalConfig),c(6),O("ngModel",i.channelIds),s("multiple",!0),c(),s("ngForOf",i.channelOptions()))},dependencies:[Pt,k,ie,de,pe,ue,me,Xt,wt,U,L,Dt]});let o=r;return o})();function Ue(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Le(o,r){if(o&1){let n=v();a(0,"button",16),C("click",function(){m(n);let e=p(2);return u(e.onOpenScanDialog())}),g(1,"i",17),d(2," Scan Channel "),l()}}function Re(o,r){if(o&1&&(P(0),x(1,Le,3,0,"button",15),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function Be(o,r){if(o&1){let n=v();P(0),a(1,"button",18),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function je(o,r){if(o&1){let n=v();P(0),a(1,"button",19),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",20),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function $e(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Ge(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function We(o,r){if(o&1){let n=v();P(0),a(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var Me=(()=>{let r=class r{constructor(t,e,i,h,_,w,st){this.http=t,this.toastr=e,this.dialog=i,this.productService=h,this.authService=_,this.uploadProductService=w,this.route=st,this.searchFilter=new Z,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,[H.Tokopedia,H.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(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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 e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let e=this.products[t]?.Variants||[];this.dialog.open(Tt,{data:{title:this.products[t].Name,variants:e},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=f.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(h=>f.IsNotEmpty(h))).subscribe(h=>{this.searchFilter.ChannelID=h.ChannelID,this.searchFilter.ScanFull=h.ScanFull,this.searchFilter.UpdatedProduct=h.UpdatedProduct;let _=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(h)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t=[]){let e;return t?.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(e=t[0].Code),e}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(W),S(J),S(j),S(R),S(at),S(it))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],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(e,i){if(e&1){let h=v();a(0,"mainpanel",1),C("onSubmit",function(w){return m(h),u(i.searchProduct(w))}),a(1,"actions"),x(2,Ue,3,1,"button",2)(3,Re,2,1,"ng-container",3)(4,Be,4,1,"ng-container",3)(5,je,4,1,"ng-container",3),l(),a(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),l(),a(10,"ng-select",5),C("ngModelChange",function(w){return m(h),u(i.searchFilter.Category=w)}),l()(),a(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),F("ngModelChange",function(w){return m(h),T(i.startDate,w)||(i.startDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l(),a(14,"input",9),F("ngModelChange",function(w){return m(h),T(i.endDate,w)||(i.endDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l()(),g(15,"mat-date-range-picker",null,0),l()(),a(17,"content")(18,"div",10)(19,"div",11),x(20,$e,2,11,"div",12)(21,Ge,3,0,"ng-container",3),l(),x(22,We,4,5,"ng-container",3),l()()()}if(e&2){let h=G(16);s("headerTitle","In POS ("+i.rowCount+")"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",h),c(),O("ngModel",i.startDate),c(),O("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[k,A,ot,U,L,B,Y,z,q,$,Ce,_e,ge,fe],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}"]});let o=r;return o})();function Ke(o,r){if(o&1){let n=v();a(0,"button",11),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",12),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Je(o,r){if(o&1){let n=v();P(0),a(1,"button",13),C("click",function(){m(n);let e=p();return u(e.onOpenScanDialog())}),g(2,"i",14),d(3," Scan Channel "),l(),b()}}function ze(o,r){if(o&1){let n=v();P(0),a(1,"button",15),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function He(o,r){if(o&1){let n=v();P(0),a(1,"button",16),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function Ye(o,r){if(o&1&&(a(0,"span",18),g(1,"img",19),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ze(o,r){if(o&1){let n=v();a(0,"div",20)(1,"label",21),d(2,"Item ID"),l(),a(3,"input",22),F("ngModelChange",function(e){m(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),u(e)}),l()()}if(o&2){let n=p();c(3),O("ngModel",n.searchFilter.Item_id)}}function qe(o,r){if(o&1){let n=v();a(0,"div",23)(1,"app-product-card",24),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenVariantDetail(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Qe(o,r){o&1&&(P(0),a(1,"div",25),g(2,"app-empty-state"),l(),b())}function Xe(o,r){if(o&1){let n=v();a(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var De=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct){this.http=t,this.dialog=e,this.toastr=i,this.productService=h,this.activateRouter=_,this.authService=w,this.route=st,this.uploadProductService=Ct,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=f.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.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(e=>{this.products=e.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 e=this.products[t].Variants;this.dialog.open(Tt,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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(y(e=>e)).subscribe(e=>{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(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanProducts(h)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.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(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let h=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(h);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=f.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(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(j),S(bt),S(R),S(it),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],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(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),x(2,Ke,3,1,"button",1)(3,Je,4,0,"ng-container",2)(4,ze,4,1,"ng-container",2)(5,He,4,1,"ng-container",2),l(),a(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),l(),a(10,"ng-select",4),C("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),x(11,Ye,3,3,"ng-template",5),l()(),x(12,Ze,4,1,"div",6),l(),a(13,"content")(14,"div",7)(15,"div",8),x(16,qe,2,11,"div",9)(17,Qe,3,0,"ng-container",2),l(),x(18,Xe,3,4,"div",10),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[k,A,ot,U,L,B,Y,rt,yt,z,q,$],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}"]});let o=r;return o})();function en(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function nn(o,r){if(o&1){let n=v();P(0),a(1,"td",29)(2,"input",30),F("ngModelChange",function(e){m(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),u(e)}),C("ngModelChange",function(){m(n);let e=p(3).ngIf,i=p(3);return u(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),O("ngModel",n.selected)}}function on(o,r){if(o&1){let n=v();P(0),a(1,"img",35),C("click",function(e){m(n);let i=p(3).$implicit,h=p(4);return u(h.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,D)}}function rn(o,r){o&1&&g(0,"img",36)}function an(o,r){if(o&1&&(P(0),a(1,"td",29)(2,"div",31),x(3,on,2,1,"ng-container",11)(4,rn,1,0,"ng-template",null,1,nt),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),d(9),l()()(),b()),o&2){let n=G(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function ln(o,r){if(o&1&&(a(0,"div")(1,"a",25),g(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,D),c(),s("src",n.Img,D)("matTooltip",n.Name)}}function cn(o,r){if(o&1&&(a(0,"div"),g(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,D)("matTooltip",n.Name)}}function sn(o,r){if(o&1&&(a(0,"tr"),x(1,nn,3,2,"ng-container",12)(2,an,10,6,"ng-container",12),a(3,"td"),d(4),l(),a(5,"td")(6,"span"),d(7),l(),a(8,"span",24)(9,"a",25),g(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),x(13,ln,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),x(16,cn,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),D),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function pn(o,r){if(o&1&&(P(0),x(1,sn,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function dn(o,r){if(o&1&&(a(0,"tbody"),x(1,pn,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function mn(o,r){if(o&1&&(P(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),a(6,"th",19),d(7,"Product"),l(),a(8,"th",20),d(9,"Variant"),l(),a(10,"th",20),d(11,"SKU"),l(),a(12,"th",21),d(13,"Available In"),l(),a(14,"th",22),d(15,"Not Available In"),l()()(),x(16,dn,2,1,"tbody",12),E(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",V(17,1,n.data$))}}function un(o,r){o&1&&(a(0,"div",38),g(1,"app-empty-state"),l())}function hn(o,r){if(o&1){let n=v();a(0,"span",46),C("click",function(){m(n);let e=p(4);return u(e.getRowCount())}),a(1,"i",47),d(2,"?"),l()()}}function _n(o,r){if(o&1&&(a(0,"span"),d(1),E(2,"number"),l()),o&2){let n=r.ngIf;c(),et(V(2,1,n==null?null:n.Count))}}function gn(o,r){if(o&1){let n=v();a(0,"a",48),C("click",function(){m(n);let e=p(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),l()}}function Cn(o,r){if(o&1){let n=v();a(0,"a",50),C("click",function(){m(n);let e=p(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),l()}}function fn(o,r){if(o&1&&(P(0),a(1,"div",39)(2,"div",40)(3,"div",41),d(4),E(5,"number"),x(6,hn,3,0,"span",42)(7,_n,3,3,"span",12),E(8,"async"),d(9),l()(),a(10,"div",43),x(11,gn,3,0,"a",44)(12,Cn,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",V(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&V(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Sn(o,r){if(o&1&&(P(0),x(1,fn,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function xn(o,r){if(o&1){let n=v();a(0,"mainpanel",3),C("onSubmit",function(e){m(n);let i=p();return u(i.searchProduct(e))}),a(1,"actions"),x(2,en,3,1,"button",4),a(3,"button",5),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),l(),a(6,"button",7),C("click",function(){m(n);let e=p();return u(e.openExportDialog())}),g(7,"i",8),a(8,"span"),d(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),x(13,mn,18,3,"ng-container",11),E(14,"async"),x(15,un,2,0,"ng-template",null,0,nt),l(),x(17,Sn,2,1,"ng-container",12),E(18,"async"),l()()()}if(o&2){let n,t=G(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=V(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",V(18,7,e.data$))}}var Oe=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct,Ne){this.http=t,this.dialog=e,this.toastr=i,this.route=h,this.productService=_,this.paginationService=w,this.biggerPictureService=st,this.authService=Ct,this.uploadProductService=Ne,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ct.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($t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(jt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e.Channel=e?.Variants[0]?.Available,e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=f.getChannelLogoByTypeId(e.TypeID),e)),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(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.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,e){this.biggerPictureService.openBiggerPicture(t,e)}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(xe,{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()}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(it),S(j),S(ve),S(he),S(R),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],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(e,i){e&1&&(x(0,xn,19,9,"mainpanel",2),E(1,"async")),e&2&&s("ngIf",V(1,1,i.loader$))},dependencies:[k,A,Zt,U,L,B,Mt,$,xt,vt],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%}"]});let o=r;return o})();var vn=o=>[o],Pn=()=>[];function bn(o,r){if(o&1){let n=v();a(0,"button",15),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),l()}}function In(o,r){if(o&1){let n=v();P(0),a(1,"button",17),C("click",function(){m(n);let e=p();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function wn(o,r){if(o&1&&(a(0,"span",19),g(1,"img",20),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function yn(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onCheckBoxChange",function(e){let i=m(n).index,h=p();return u(h.onSelectProduct(e,i))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onShowVariantDetail(e))})("onDownload",function(){let e=m(n).$implicit,i=p();return u(i.onDownloadProduct(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?pt(10,vn,n==null?null:n.Channel):X(12,Pn))("showCheckBox",!0)("scanButton",!0)}}function Mn(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function Dn(o,r){if(o&1){let n=v();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Te=(()=>{let r=class r{constructor(t,e,i,h,_,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=h,this.activateRouter=_,this.authService=w,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.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(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?f.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=f.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(e=>{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(f.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].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 e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(f.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 e=this.products[t].Variant;e.length>0&&this.dialog.open(Pe,{data:{title:this.products[t].Name,variants:e},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(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(j),S(W),S(bt),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],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(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),x(2,bn,3,0,"button",1)(3,In,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),l(),a(8,"ng-select",4),F("ngModelChange",function(_){return T(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),x(9,wn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),F("ngModelChange",function(_){return T(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),d(15," All "),l(),a(16,"mat-radio-button",9),d(17," Yes "),l(),a(18,"mat-radio-button",9),d(19," No "),l()()(),a(20,"div",6)(21,"label",7),d(22,"Item ID"),l(),a(23,"input",10),F("ngModelChange",function(_){return T(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),x(27,yn,2,13,"div",13)(28,Mn,3,0,"ng-container",2),l(),x(29,Dn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ChannelID),c(5),O("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),O("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,ot,U,L,B,Y,rt,le,ce,z,q,$],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}"]});let o=r;return o})();function On(o,r){if(o&1&&(a(0,"span",9),g(1,"img",10),l(),d(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),D),c(),I(" ",n.Name," ")}}function Tn(o,r){if(o&1&&(a(0,"div",11),g(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Fn(o,r){o&1&&(P(0),a(1,"div",13),g(2,"app-empty-state"),l(),b())}function En(o,r){if(o&1){let n=v();P(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())})("total",function(){m(n);let e=p();return u(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var Fe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.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(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(j),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],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(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),l(),a(6,"ng-select",3),F("ngModelChange",function(_){return T(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),C("clear",function(){return i.onClearFilter()}),x(7,On,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),x(11,Tn,2,6,"div",7)(12,Fn,3,0,"ng-container",8),l(),x(13,En,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,U,L,B,Y,rt,yt,Ft,z,$]});let o=r;return o})();var kn=()=>["/menu/products/status/sold-in-channel"],Ee=o=>({ID:o}),Nn=()=>["/menu/products/status/not-in-pos"];function Vn(o,r){if(o&1&&(P(0),d(1),b()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function An(o,r){if(o&1){let n=v();a(0,"span",26),C("click",function(){m(n);let e=p().$implicit,i=p(2);return u(i.getLiveProductCount(e.ID,e))}),g(1,"i",27),l()}}function Un(o,r){if(o&1){let n=v();a(0,"tr")(1,"td"),g(2,"img",17),a(3,"span",18),d(4),l()(),a(5,"td",19),x(6,Vn,2,1,"ng-container",6)(7,An,2,0,"ng-template",null,1,nt),l(),a(9,"td",19)(10,"a",20),d(11),E(12,"number"),l()(),a(13,"td",19)(14,"a",20),d(15),E(16,"number"),l()(),a(17,"td"),d(18),E(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),l(),a(25,"button",24),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=G(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),D),c(2),et(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",X(18,kn))("queryParams",pt(19,Ee,n.ID)),c(),I(" ",V(12,11,n.SoldInChannel)," "),c(3),s("routerLink",X(21,Nn))("queryParams",pt(22,Ee,n.ID)),c(),I(" ",V(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Ln(o,r){if(o&1&&(P(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),l(),a(7,"th",11),d(8,"Live Product"),l(),a(9,"th",12),d(10,"Sold In Channel"),l(),a(11,"th",13),d(12,"Product Not in POS"),l(),a(13,"th",14),d(14,"Last Sync"),l(),g(15,"th",15),l()(),a(16,"tbody"),x(17,Un,28,24,"tr",16),E(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=V(18,1,t.channels$))==null?null:n.Data)}}function Rn(o,r){o&1&&(a(0,"div",28),g(1,"app-empty-state"),l())}var ke=(()=>{let r=class r{constructor(t,e,i,h){this.productService=t,this.toastr=e,this.dialog=i,this.authService=h,this.destroy$=new Bt,this.channelOptions=h.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(Vt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>f.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(h=>h)).subscribe(h=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(h,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(Vt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(S(j),S(W),S(J),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],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(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),x(5,Ln,19,3,"ng-container",6),E(6,"async"),x(7,Rn,2,0,"ng-template",null,0,nt),l()()()()()),e&2){let h,_=G(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((h=V(6,4,i.channels$))==null||h.Data==null?null:h.Data.length)>0)("ngIfElse",_)}},dependencies:[k,A,B,Mt,It,$,xt,vt,zt]});let o=r;return o})();var Bn=[{component:Ie,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Me,canActivate:[tt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:De,canActivate:[tt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Oe,canActivate:[tt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Te,canActivate:[tt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Fe,canActivate:[tt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:ke,canActivate:[tt],data:{title:"Channel Statistic"}}]}],go=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=Wt({type:r}),r.\u0275inj=Gt({imports:[Pt,wt,oe,Dt,qt,be,se,ae,Ft,z,q,Yt.forChild(Bn),Se,Qt,ct]});let o=r;return o})();export{go as StatusModule};
1
+ import{a as N,b as Tt,c as Pe}from"./chunk-56RXROJ7.js";import"./chunk-M7UL2KTJ.js";import{a as $}from"./chunk-RENQ3YZH.js";import{a as ve}from"./chunk-OSA3WANL.js";import{a as Z}from"./chunk-7KG3DC5J.js";import{b as xe}from"./chunk-S2Z3ZGU7.js";import"./chunk-N6IHFFFZ.js";import"./chunk-PD4CUVAW.js";import{a as re,b as ae}from"./chunk-X2TVRY2Z.js";import{e as at}from"./chunk-VGZMEOMT.js";import{f as _e,g as ge,h as Ce,i as fe,j as Se}from"./chunk-FGPSBTFS.js";import"./chunk-DVSSWF73.js";import"./chunk-GCKSYCMI.js";import{a as j}from"./chunk-ZQWAIH5X.js";import"./chunk-ADRVUMMW.js";import{a as Ft}from"./chunk-URCHO4IV.js";import{a as z}from"./chunk-YYWSBXIP.js";import{b as be}from"./chunk-WT6W7RAQ.js";import{a as me,b as ue}from"./chunk-BQ7NR3ET.js";import{a as le,b as ce,c as se}from"./chunk-UMNGKENU.js";import{a as tt}from"./chunk-XCMXV2H4.js";import{a as q}from"./chunk-4LJDBY23.js";import"./chunk-FMV4LYKN.js";import{a as he}from"./chunk-LUY3WZJE.js";import{f as pe,g as de}from"./chunk-HCDKYABV.js";import{a as rt,b as yt,d as Y,e as qt}from"./chunk-CCXKODFV.js";import{j as R}from"./chunk-VEDGJJLB.js";import{b as W,e as K}from"./chunk-E3NPUJ23.js";import"./chunk-KCDL7SWP.js";import{b as te,c as ee,d as J,h as Ot,i as ne,j as ie,m as B,n as oe}from"./chunk-BO4PPSB5.js";import{t as Mt,u as Dt}from"./chunk-HUUFOAKH.js";import{P as Qt,X as Xt}from"./chunk-E5GGIVK7.js";import{b as Zt,c as ot,h as U,m as L,y as wt}from"./chunk-BSN7ZAXG.js";import{b as H,c as f}from"./chunk-47DMD3UG.js";import{m as bt,n as Ht,o as it,p as It,r as Yt}from"./chunk-OVEJFFL6.js";import{$b as C,Bd as vt,Cd as Pt,Da as m,Ea as u,Eb as x,G as y,Gb as s,Gc as E,Hc as V,Ic as Jt,Jc as nt,Nb as St,Sb as a,Tb as l,Ub as g,Vb as P,Wb as b,Yb as v,aa as ft,bc as p,ca as Vt,ea as $t,f as Bt,gb as D,jb as c,ka as Gt,kb as S,mc as G,nc as d,oc as et,pa as At,pc as I,rc as O,sc as T,ta as M,tc as F,ua as Wt,ud as k,v as jt,vc as Kt,vd as A,wc as X,xb as Ut,xc as pt,yd as xt,zd as zt}from"./chunk-PQDPS2ID.js";import"./chunk-GNOSNGXM.js";var Ve=()=>["/menu/products/download/by-url"],Ie=(()=>{let r=class r{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"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],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(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),l()()()()()(),g(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",X(2,Ve)))},dependencies:[re,Ht,It]});let o=r;return o})();function Ae(o,r){if(o&1&&(a(0,"mat-option",6)(1,"div"),g(2,"img",7),a(3,"span"),d(4),l()()()),o&2){let n=r.$implicit;s("value",n.ChannelID),c(2),s("src",n.logo,D),c(2),et(n.Title)}}var ct=(()=>{let r=class r{constructor(){this.dialogRef=At(te),this.channels=At(ee),this.channelIds=Ut([]),this.channelOptions=Ut([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((e,i,h)=>h.findIndex(_=>_.ChannelID===e.ChannelID)===i);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new ne,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(e=>this.channelIds().includes(e.ChannelID)).map(e=>({ChannelID:e.ChannelID,ChannelItemID:e.ChannelItemID}));this.dialogRef.close(t)}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-modal-detach-product"]],standalone:!0,features:[Kt],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(e,i){e&1&&(a(0,"modal-material",0),C("onClose",function(){return i.onClose()})("onCancel",function(){return i.onClose()})("onOk",function(){return i.onSave()}),a(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),l(),a(5,"mat-form-field",3)(6,"mat-select",4),F("ngModelChange",function(_){return T(i.channelIds,_)||(i.channelIds=_),_}),x(7,Ae,5,3,"mat-option",5),l()()()()()),e&2&&(s("dynamicValidated",i.channelIds().length>0)("config",i.modalConfig),c(6),O("ngModel",i.channelIds),s("multiple",!0),c(),s("ngForOf",i.channelOptions()))},dependencies:[Pt,k,ie,de,pe,ue,me,Xt,wt,U,L,Dt]});let o=r;return o})();function Ue(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Le(o,r){if(o&1){let n=v();a(0,"button",16),C("click",function(){m(n);let e=p(2);return u(e.onOpenScanDialog())}),g(1,"i",17),d(2," Scan Channel "),l()}}function Re(o,r){if(o&1&&(P(0),x(1,Le,3,0,"button",15),b()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function Be(o,r){if(o&1){let n=v();P(0),a(1,"button",18),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function je(o,r){if(o&1){let n=v();P(0),a(1,"button",19),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",20),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function $e(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Ge(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function We(o,r){if(o&1){let n=v();P(0),a(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var Me=(()=>{let r=class r{constructor(t,e,i,h,_,w,st){this.http=t,this.toastr=e,this.dialog=i,this.productService=h,this.authService=_,this.uploadProductService=w,this.route=st,this.searchFilter=new Z,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,[H.Tokopedia,H.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(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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 e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let e=this.products[t]?.Variants||[];this.dialog.open(Tt,{data:{title:this.products[t].Name,variants:e},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=f.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.Tiktok]);this.dialog.open(N,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(h=>f.IsNotEmpty(h))).subscribe(h=>{this.searchFilter.ChannelID=h.ChannelID,this.searchFilter.ScanFull=h.ScanFull,this.searchFilter.UpdatedProduct=h.UpdatedProduct;let _=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(h)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t=[]){let e;return t?.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(e=t[0].Code),e}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(W),S(J),S(j),S(R),S(at),S(it))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],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(e,i){if(e&1){let h=v();a(0,"mainpanel",1),C("onSubmit",function(w){return m(h),u(i.searchProduct(w))}),a(1,"actions"),x(2,Ue,3,1,"button",2)(3,Re,2,1,"ng-container",3)(4,Be,4,1,"ng-container",3)(5,je,4,1,"ng-container",3),l(),a(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),l(),a(10,"ng-select",5),C("ngModelChange",function(w){return m(h),u(i.searchFilter.Category=w)}),l()(),a(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),F("ngModelChange",function(w){return m(h),T(i.startDate,w)||(i.startDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l(),a(14,"input",9),F("ngModelChange",function(w){return m(h),T(i.endDate,w)||(i.endDate=w),u(w)}),C("click",function(){m(h);let w=G(16);return u(w.open())}),l()(),g(15,"mat-date-range-picker",null,0),l()(),a(17,"content")(18,"div",10)(19,"div",11),x(20,$e,2,11,"div",12)(21,Ge,3,0,"ng-container",3),l(),x(22,We,4,5,"ng-container",3),l()()()}if(e&2){let h=G(16);s("headerTitle","In POS ("+i.rowCount+")"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",h),c(),O("ngModel",i.startDate),c(),O("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[k,A,ot,U,L,B,Y,z,q,$,Ce,_e,ge,fe],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}"]});let o=r;return o})();function Ke(o,r){if(o&1){let n=v();a(0,"button",11),C("click",function(){m(n);let e=p();return u(e.onDetachMultipleProduct())}),g(1,"i",12),d(2),l()}if(o&2){let n,t=p();c(2),I("Detach (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Je(o,r){if(o&1){let n=v();P(0),a(1,"button",13),C("click",function(){m(n);let e=p();return u(e.onOpenScanDialog())}),g(2,"i",14),d(3," Scan Channel "),l(),b()}}function ze(o,r){if(o&1){let n=v();P(0),a(1,"button",15),C("click",function(){m(n);let e=p();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function He(o,r){if(o&1){let n=v();P(0),a(1,"button",16),C("click",function(){m(n);let e=p();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),l(),b()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function Ye(o,r){if(o&1&&(a(0,"span",18),g(1,"img",19),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ze(o,r){if(o&1){let n=v();a(0,"div",20)(1,"label",21),d(2,"Item ID"),l(),a(3,"input",22),F("ngModelChange",function(e){m(n);let i=p();return T(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),u(e)}),l()()}if(o&2){let n=p();c(3),O("ngModel",n.searchFilter.Item_id)}}function qe(o,r){if(o&1){let n=v();a(0,"div",23)(1,"app-product-card",24),C("onUpload",function(){let e=m(n).$implicit,i=p();return u(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onOpenVariantDetail(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=m(n).$implicit;return u(i.selected=e)})("onDetach",function(){let e=m(n).$implicit,i=p();return u(i.onDetachProduct([e]))}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)("detachButton",(n==null||n.Channel==null?null:n.Channel.length)>0)}}function Qe(o,r){o&1&&(P(0),a(1,"div",25),g(2,"app-empty-state"),l(),b())}function Xe(o,r){if(o&1){let n=v();a(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var De=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct){this.http=t,this.dialog=e,this.toastr=i,this.productService=h,this.activateRouter=_,this.authService=w,this.route=st,this.uploadProductService=Ct,this.searchFilter=new Z,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=f.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[H.Tokopedia,H.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(e=>{this.products=e.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 e=this.products[t].Variants;this.dialog.open(Tt,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.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(y(e=>e)).subscribe(e=>{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(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(N,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let h=this.productService.getVariantCodesProduct(t);this.scanProducts(h)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.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(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let h=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(h);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=f.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=f.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=f.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(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}onDetachProduct(t){let e=[];t.forEach(i=>{i.Channel=f.assignChannelLogo(i.Channel),e.push(...i.Channel)}),this.dialog.open(ct,{width:"600px",data:[...e]}).afterClosed().pipe(y(i=>f.IsNotEmpty(i)),ft(i=>this.productService.detachProduct(i))).subscribe(i=>{this.toastr.success(i.Message,Ot.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(j),S(bt),S(R),S(it),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],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(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),x(2,Ke,3,1,"button",1)(3,Je,4,0,"ng-container",2)(4,ze,4,1,"ng-container",2)(5,He,4,1,"ng-container",2),l(),a(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),l(),a(10,"ng-select",4),C("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),x(11,Ye,3,3,"ng-template",5),l()(),x(12,Ze,4,1,"div",6),l(),a(13,"content")(14,"div",7)(15,"div",8),x(16,qe,2,11,"div",9)(17,Qe,3,0,"ng-container",2),l(),x(18,Xe,3,4,"div",10),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),St(i.productService.hasSelection(i.products)?2:-1),c(),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[k,A,ot,U,L,B,Y,rt,yt,z,q,$],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}"]});let o=r;return o})();function en(o,r){if(o&1){let n=v();a(0,"button",13),C("click",function(){m(n);let e=p(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function nn(o,r){if(o&1){let n=v();P(0),a(1,"td",29)(2,"input",30),F("ngModelChange",function(e){m(n);let i=p(2).$implicit;return T(i.selected,e)||(i.selected=e),u(e)}),C("ngModelChange",function(){m(n);let e=p(3).ngIf,i=p(3);return u(i.onSelectProduct(e))}),l()(),b()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),O("ngModel",n.selected)}}function on(o,r){if(o&1){let n=v();P(0),a(1,"img",35),C("click",function(e){m(n);let i=p(3).$implicit,h=p(4);return u(h.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),b()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,D)}}function rn(o,r){o&1&&g(0,"img",36)}function an(o,r){if(o&1&&(P(0),a(1,"td",29)(2,"div",31),x(3,on,2,1,"ng-container",11)(4,rn,1,0,"ng-template",null,1,nt),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),d(9),l()()(),b()),o&2){let n=G(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function ln(o,r){if(o&1&&(a(0,"div")(1,"a",25),g(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,D),c(),s("src",n.Img,D)("matTooltip",n.Name)}}function cn(o,r){if(o&1&&(a(0,"div"),g(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,D)("matTooltip",n.Name)}}function sn(o,r){if(o&1&&(a(0,"tr"),x(1,nn,3,2,"ng-container",12)(2,an,10,6,"ng-container",12),a(3,"td"),d(4),l(),a(5,"td")(6,"span"),d(7),l(),a(8,"span",24)(9,"a",25),g(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),x(13,ln,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),x(16,cn,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),D),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function pn(o,r){if(o&1&&(P(0),x(1,sn,17,7,"tr",23),b()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function dn(o,r){if(o&1&&(a(0,"tbody"),x(1,pn,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function mn(o,r){if(o&1&&(P(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),a(6,"th",19),d(7,"Product"),l(),a(8,"th",20),d(9,"Variant"),l(),a(10,"th",20),d(11,"SKU"),l(),a(12,"th",21),d(13,"Available In"),l(),a(14,"th",22),d(15,"Not Available In"),l()()(),x(16,dn,2,1,"tbody",12),E(17,"async"),l()(),b()),o&2){let n=p(2);c(16),s("ngIf",V(17,1,n.data$))}}function un(o,r){o&1&&(a(0,"div",38),g(1,"app-empty-state"),l())}function hn(o,r){if(o&1){let n=v();a(0,"span",46),C("click",function(){m(n);let e=p(4);return u(e.getRowCount())}),a(1,"i",47),d(2,"?"),l()()}}function _n(o,r){if(o&1&&(a(0,"span"),d(1),E(2,"number"),l()),o&2){let n=r.ngIf;c(),et(V(2,1,n==null?null:n.Count))}}function gn(o,r){if(o&1){let n=v();a(0,"a",48),C("click",function(){m(n);let e=p(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),l()}}function Cn(o,r){if(o&1){let n=v();a(0,"a",50),C("click",function(){m(n);let e=p(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),l()}}function fn(o,r){if(o&1&&(P(0),a(1,"div",39)(2,"div",40)(3,"div",41),d(4),E(5,"number"),x(6,hn,3,0,"span",42)(7,_n,3,3,"span",12),E(8,"async"),d(9),l()(),a(10,"div",43),x(11,gn,3,0,"a",44)(12,Cn,3,0,"a",45),l()(),b()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",V(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&V(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function Sn(o,r){if(o&1&&(P(0),x(1,fn,13,10,"ng-container",12),b()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function xn(o,r){if(o&1){let n=v();a(0,"mainpanel",3),C("onSubmit",function(e){m(n);let i=p();return u(i.searchProduct(e))}),a(1,"actions"),x(2,en,3,1,"button",4),a(3,"button",5),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),l(),a(6,"button",7),C("click",function(){m(n);let e=p();return u(e.openExportDialog())}),g(7,"i",8),a(8,"span"),d(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),x(13,mn,18,3,"ng-container",11),E(14,"async"),x(15,un,2,0,"ng-template",null,0,nt),l(),x(17,Sn,2,1,"ng-container",12),E(18,"async"),l()()()}if(o&2){let n,t=G(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=V(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",V(18,7,e.data$))}}var Oe=(()=>{let r=class r{constructor(t,e,i,h,_,w,st,Ct,Ne){this.http=t,this.dialog=e,this.toastr=i,this.route=h,this.productService=_,this.paginationService=w,this.biggerPictureService=st,this.authService=Ct,this.uploadProductService=Ne,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Ct.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($t(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(jt(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e.Channel=e?.Variants[0]?.Available,e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=f.getChannelLogoByTypeId(e.TypeID),e)),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(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.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,e){this.biggerPictureService.openBiggerPicture(t,e)}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(xe,{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()}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(W),S(it),S(j),S(ve),S(he),S(R),S(at))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],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(e,i){e&1&&(x(0,xn,19,9,"mainpanel",2),E(1,"async")),e&2&&s("ngIf",V(1,1,i.loader$))},dependencies:[k,A,Zt,U,L,B,Mt,$,xt,vt],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%}"]});let o=r;return o})();var vn=o=>[o],Pn=()=>[];function bn(o,r){if(o&1){let n=v();a(0,"button",15),C("click",function(){m(n);let e=p();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),l()}}function In(o,r){if(o&1){let n=v();P(0),a(1,"button",17),C("click",function(){m(n);let e=p();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),l(),b()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function wn(o,r){if(o&1&&(a(0,"span",19),g(1,"img",20),l(),d(2)),o&2){let n=r.item;c(),s("src",n.Img,D)("alt",n.Name),c(),I(" ",n.Name," ")}}function yn(o,r){if(o&1){let n=v();a(0,"div",21)(1,"app-product-card",22),C("onCheckBoxChange",function(e){let i=m(n).index,h=p();return u(h.onSelectProduct(e,i))})("onDescEvent",function(){let e=m(n).index,i=p();return u(i.onShowVariantDetail(e))})("onDownload",function(){let e=m(n).$implicit,i=p();return u(i.onDownloadProduct(e))})("onScan",function(){let e=m(n).$implicit,i=p();return u(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?pt(10,vn,n==null?null:n.Channel):X(12,Pn))("showCheckBox",!0)("scanButton",!0)}}function Mn(o,r){o&1&&(P(0),a(1,"div",23),g(2,"app-empty-state"),l(),b())}function Dn(o,r){if(o&1){let n=v();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),C("total",function(){m(n);let e=p();return u(e.getRowCount())})("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Te=(()=>{let r=class r{constructor(t,e,i,h,_,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=h,this.activateRouter=_,this.authService=w,this.searchFilter=new Z,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.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(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?f.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=f.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(e=>{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(f.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(N,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>f.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].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 e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(f.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 e=this.products[t].Variant;e.length>0&&this.dialog.open(Pe,{data:{title:this.products[t].Name,variants:e},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(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(J),S(j),S(W),S(bt),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],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(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),x(2,bn,3,0,"button",1)(3,In,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),l(),a(8,"ng-select",4),F("ngModelChange",function(_){return T(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),x(9,wn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),F("ngModelChange",function(_){return T(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),d(15," All "),l(),a(16,"mat-radio-button",9),d(17," Yes "),l(),a(18,"mat-radio-button",9),d(19," No "),l()()(),a(20,"div",6)(21,"label",7),d(22,"Item ID"),l(),a(23,"input",10),F("ngModelChange",function(_){return T(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),x(27,yn,2,13,"div",13)(28,Mn,3,0,"ng-container",2),l(),x(29,Dn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ChannelID),c(5),O("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),O("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,ot,U,L,B,Y,rt,le,ce,z,q,$],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}"]});let o=r;return o})();function On(o,r){if(o&1&&(a(0,"span",9),g(1,"img",10),l(),d(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),D),c(),I(" ",n.Name," ")}}function Tn(o,r){if(o&1&&(a(0,"div",11),g(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Fn(o,r){o&1&&(P(0),a(1,"div",13),g(2,"app-empty-state"),l(),b())}function En(o,r){if(o&1){let n=v();P(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),C("next",function(){m(n);let e=p();return u(e.getProducts())})("previous",function(){m(n);let e=p();return u(e.getProducts())})("total",function(){m(n);let e=p();return u(e.getRowCount())}),l()()(),b()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var Fe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new Z,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.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(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(S(K),S(j),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],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(e,i){e&1&&(a(0,"mainpanel",0),C("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),l(),a(6,"ng-select",3),F("ngModelChange",function(_){return T(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),C("clear",function(){return i.onClearFilter()}),x(7,On,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),x(11,Tn,2,6,"div",7)(12,Fn,3,0,"ng-container",8),l(),x(13,En,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),O("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[k,A,U,L,B,Y,rt,yt,Ft,z,$]});let o=r;return o})();var kn=()=>["/menu/products/status/sold-in-channel"],Ee=o=>({ID:o}),Nn=()=>["/menu/products/status/not-in-pos"];function Vn(o,r){if(o&1&&(P(0),d(1),b()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function An(o,r){if(o&1){let n=v();a(0,"span",26),C("click",function(){m(n);let e=p().$implicit,i=p(2);return u(i.getLiveProductCount(e.ID,e))}),g(1,"i",27),l()}}function Un(o,r){if(o&1){let n=v();a(0,"tr")(1,"td"),g(2,"img",17),a(3,"span",18),d(4),l()(),a(5,"td",19),x(6,Vn,2,1,"ng-container",6)(7,An,2,0,"ng-template",null,1,nt),l(),a(9,"td",19)(10,"a",20),d(11),E(12,"number"),l()(),a(13,"td",19)(14,"a",20),d(15),E(16,"number"),l()(),a(17,"td"),d(18),E(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),l(),a(25,"button",24),C("click",function(){let e=m(n).$implicit,i=p(2);return u(i.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=G(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),D),c(2),et(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",X(18,kn))("queryParams",pt(19,Ee,n.ID)),c(),I(" ",V(12,11,n.SoldInChannel)," "),c(3),s("routerLink",X(21,Nn))("queryParams",pt(22,Ee,n.ID)),c(),I(" ",V(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?Jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Ln(o,r){if(o&1&&(P(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),l(),a(7,"th",11),d(8,"Live Product"),l(),a(9,"th",12),d(10,"Sold In Channel"),l(),a(11,"th",13),d(12,"Product Not in POS"),l(),a(13,"th",14),d(14,"Last Sync"),l(),g(15,"th",15),l()(),a(16,"tbody"),x(17,Un,28,24,"tr",16),E(18,"async"),l()()(),b()),o&2){let n,t=p();c(17),s("ngForOf",(n=V(18,1,t.channels$))==null?null:n.Data)}}function Rn(o,r){o&1&&(a(0,"div",28),g(1,"app-empty-state"),l())}var ke=(()=>{let r=class r{constructor(t,e,i,h){this.productService=t,this.toastr=e,this.dialog=i,this.authService=h,this.destroy$=new Bt,this.channelOptions=h.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(Vt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(N,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>f.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(h=>h)).subscribe(h=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(h,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(Vt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(S(j),S(W),S(J),S(R))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],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(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),x(5,Ln,19,3,"ng-container",6),E(6,"async"),x(7,Rn,2,0,"ng-template",null,0,nt),l()()()()()),e&2){let h,_=G(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((h=V(6,4,i.channels$))==null||h.Data==null?null:h.Data.length)>0)("ngIfElse",_)}},dependencies:[k,A,B,Mt,It,$,xt,vt,zt]});let o=r;return o})();var Bn=[{component:Ie,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Me,canActivate:[tt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:De,canActivate:[tt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Oe,canActivate:[tt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Te,canActivate:[tt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:Fe,canActivate:[tt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:ke,canActivate:[tt],data:{title:"Channel Statistic"}}]}],go=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=Wt({type:r}),r.\u0275inj=Gt({imports:[Pt,wt,oe,Dt,qt,be,se,ae,Ft,z,q,Yt.forChild(Bn),Se,Qt,ct]});let o=r;return o})();export{go as StatusModule};
@@ -1 +1 @@
1
- import{a as H}from"./chunk-O4CRP4WO.js";import{a as V,b as G}from"./chunk-IJYSJN63.js";import{Y as q}from"./chunk-OULUJ2IO.js";import{k as j}from"./chunk-BO4PPSB5.js";import{t as W,u as $}from"./chunk-HUUFOAKH.js";import{a as R,h as A,m as D,y as U}from"./chunk-BSN7ZAXG.js";import{b as a,c as r}from"./chunk-64G3XLI6.js";import{$b as y,Cd as I,Eb as f,Gb as u,Gc as O,Hc as z,La as w,Ma as g,Nb as N,Pa as k,Sb as m,Tb as c,Z as S,bc as M,ia as T,jb as p,nc as C,pa as h,pc as v,rc as L,sc as P,ta as _,tc as B,uc as E,v as b,vc as x,xb as d,yd as F}from"./chunk-PQDPS2ID.js";function Q(s,n){if(s&1&&(m(0,"div",4),C(1),c()),s&2){let J=M();p(),v(" ",J.selectedCategoryLabel()," ")}}function X(s,n){s&1&&(m(0,"label",3),C(1,"Channel"),c())}var fe=(()=>{let n=class n{constructor(){this.multiwarehousTreeService=h(H),this.destroyRef=h(w),this.selectedCategoryLabel=d("Select a Channel"),this.disabled=d(!1),this.selectedNode=d(null),this.multiple=g(!1),this.floatingLabel=g(!1),this.onChannelChange=new k,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(b(e=>e.map(t=>{t.children=t.children.map(i=>(i.icon="fa-solid fa-warehouse",i));let o=this.getChannelType(t.typeid);return t.icon=`custom-icon-${o}`,t.expandedIcon=null,t.collapsedIcon=null,t.styleClass=`custom-icon-${o}`,t.logo=r.getChannelLogoByTypeId(t.typeId),t})),S(1)),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case a.Tokopedia:return"tokopedia";case a.Shopee:return"shopee";case a.Lazada:return"lazada";case a.Shopify:return"shopify";case a.WooCommerce:return"woocommerce";case a.Tiktok:return"tiktok";case a.Plugo:return"plugo"}}initSelectedNode(e){this.channels$.pipe(j(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let i of e){let l=r.searchByIdWithParentDFS(t,i),K=Object.assign({},l);o.push(K)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=r.searchByIdWithParentDFS(t,e),i=Object.assign({},o);this.selectedNode.set(i),this.emitSingleNode(i)}})}onNodeSelect(e){let t=Object.assign({},e.node);this.multiple()?this.emitMultipleNodes():this.emitSingleNode(t)}emitMultipleNodes(){let e=Object.assign([],this.selectedNode()),t=e.map(o=>o.id);this.onChange(t),this.onChannelChange.emit(e),this.generateLabel()}emitSingleNode(e){this.onChange(e.id),this.onChannelChange.emit(e),this.generateLabel()}onNodeUnSelect(e){if(this.multiple()){let t=e.node;this.selectedNode.update(o=>o.filter(i=>i.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=r.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=r.getLabelPathTree(t),this.selectedCategoryLabel.set(e)):this.selectedCategoryLabel.set(e)}}onClear(){this.onChange(null)}onClick(){let e=this.getBodyTop(),t=document.querySelector(".p-overlay.p-component"),o=e+t.getBoundingClientRect().top,i=t.getAttribute("style")||"";t.setAttribute("style",`${i} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){r.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_({type:n,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},standalone:!0,features:[E([{provide:R,useExisting:T(()=>n),multi:!0}]),x],decls:5,vars:9,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","onNodeSelect","ngModelChange","onClear","onNodeUnselect","filter","filterInputAutoFocus","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(m(0,"span",0)(1,"p-treeSelect",1),O(2,"async"),y("click",function(){return o.onClick()})("onNodeSelect",function(l){return o.onNodeSelect(l)}),B("ngModelChange",function(l){return P(o.selectedNode,l)||(o.selectedNode=l),l}),y("onClear",function(){return o.onClear()})("onNodeUnselect",function(l){return o.onNodeUnSelect(l)}),f(3,Q,2,1,"ng-template",2),c(),f(4,X,2,0,"label",3),c()),t&2&&(u("matTooltip",o.selectedCategoryLabel()),p(),u("filter",!0)("filterInputAutoFocus",!0)("options",z(2,7,o.channels$)),L("ngModel",o.selectedNode),u("selectionMode",o.multiple()?"multiple":"single"),p(3),N(o.floatingLabel()?4:-1))},dependencies:[I,F,G,V,q,U,A,D,$,W],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-element .p-icon-wrapper{width:14px} .p-float-label .multiwarehouse-select.p-treeselect{padding:7px!important;min-height:.6rem!important} .custom-icon-tokopedia.p-tree-node-icon, .custom-icon-shopee.p-tree-node-icon, .custom-icon-woocommerce.p-tree-node-icon, .custom-icon-lazada.p-tree-node-icon, .custom-icon-tiktok.p-tree-node-icon, .custom-icon-shopify.p-tree-node-icon, .custom-icon-plugo.p-tree-node-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-plugo.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico)} .custom-icon-shopee .fa-warehouse.p-tree-node-icon, .custom-icon-tiktok .fa-warehouse.p-tree-node-icon, .custom-icon-tokopedia .fa-warehouse.p-tree-node-icon, .custom-icon-lazada .fa-warehouse.p-tree-node-icon, .custom-icon-shopify .fa-warehouse.p-tree-node-icon, .custom-icon-woocommerce .fa-warehouse.p-tree-node-icon, .custom-icon-plugo .fa-warehouse.p-tree-node-icon{background-image:none!important;display:inline-block!important}"]});let s=n;return s})();export{fe as a};
1
+ import{a as H}from"./chunk-O4CRP4WO.js";import{a as V,b as G}from"./chunk-IJYSJN63.js";import{Y as q}from"./chunk-OULUJ2IO.js";import{k as j}from"./chunk-BO4PPSB5.js";import{t as W,u as $}from"./chunk-HUUFOAKH.js";import{a as R,h as A,m as D,y as U}from"./chunk-BSN7ZAXG.js";import{b as a,c as r}from"./chunk-47DMD3UG.js";import{$b as y,Cd as I,Eb as f,Gb as u,Gc as O,Hc as z,La as w,Ma as g,Nb as N,Pa as k,Sb as m,Tb as c,Z as S,bc as M,ia as T,jb as p,nc as C,pa as h,pc as v,rc as L,sc as P,ta as _,tc as B,uc as E,v as b,vc as x,xb as d,yd as F}from"./chunk-PQDPS2ID.js";function Q(s,n){if(s&1&&(m(0,"div",4),C(1),c()),s&2){let J=M();p(),v(" ",J.selectedCategoryLabel()," ")}}function X(s,n){s&1&&(m(0,"label",3),C(1,"Channel"),c())}var fe=(()=>{let n=class n{constructor(){this.multiwarehousTreeService=h(H),this.destroyRef=h(w),this.selectedCategoryLabel=d("Select a Channel"),this.disabled=d(!1),this.selectedNode=d(null),this.multiple=g(!1),this.floatingLabel=g(!1),this.onChannelChange=new k,this.channels$=this.multiwarehousTreeService.getChannelTree$().pipe(b(e=>e.map(t=>{t.children=t.children.map(i=>(i.icon="fa-solid fa-warehouse",i));let o=this.getChannelType(t.typeid);return t.icon=`custom-icon-${o}`,t.expandedIcon=null,t.collapsedIcon=null,t.styleClass=`custom-icon-${o}`,t.logo=r.getChannelLogoByTypeId(t.typeId),t})),S(1)),this.htmlBody=document.querySelector("body"),this.onChange=e=>{},this.onTouched=()=>{}}getChannelType(e){switch(e){case a.Tokopedia:return"tokopedia";case a.Shopee:return"shopee";case a.Lazada:return"lazada";case a.Shopify:return"shopify";case a.WooCommerce:return"woocommerce";case a.Tiktok:return"tiktok";case a.Plugo:return"plugo"}}initSelectedNode(e){this.channels$.pipe(j(this.destroyRef)).subscribe(t=>{if(this.multiple()){let o=[];for(let i of e){let l=r.searchByIdWithParentDFS(t,i),K=Object.assign({},l);o.push(K)}this.selectedNode.set(o),this.emitMultipleNodes()}else{let o=r.searchByIdWithParentDFS(t,e),i=Object.assign({},o);this.selectedNode.set(i),this.emitSingleNode(i)}})}onNodeSelect(e){let t=Object.assign({},e.node);this.multiple()?this.emitMultipleNodes():this.emitSingleNode(t)}emitMultipleNodes(){let e=Object.assign([],this.selectedNode()),t=e.map(o=>o.id);this.onChange(t),this.onChannelChange.emit(e),this.generateLabel()}emitSingleNode(e){this.onChange(e.id),this.onChannelChange.emit(e),this.generateLabel()}onNodeUnSelect(e){if(this.multiple()){let t=e.node;this.selectedNode.update(o=>o.filter(i=>i.id!==t.id)),this.emitMultipleNodes(),this.generateLabel()}}generateLabel(){let e="Select a Channel";if(this.multiple()){e="";for(let t of this.selectedNode())e+=r.getLabelPathTree(t)+", ";this.selectedCategoryLabel.set(e)}else{let t=this.selectedNode();t?(e=r.getLabelPathTree(t),this.selectedCategoryLabel.set(e)):this.selectedCategoryLabel.set(e)}}onClear(){this.onChange(null)}onClick(){let e=this.getBodyTop(),t=document.querySelector(".p-overlay.p-component"),o=e+t.getBoundingClientRect().top,i=t.getAttribute("style")||"";t.setAttribute("style",`${i} top: ${o+e}px;`)}getBodyTop(){return this.htmlBody.getBoundingClientRect().top*-1}writeValue(e){r.IsNotEmpty(e)&&this.initSelectedNode(e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabled.set(e)}};n.\u0275fac=function(t){return new(t||n)},n.\u0275cmp=_({type:n,selectors:[["multiwarehouse-tree-select"]],inputs:{multiple:[1,"multiple"],floatingLabel:[1,"floatingLabel"]},outputs:{onChannelChange:"onChannelChange"},standalone:!0,features:[E([{provide:R,useExisting:T(()=>n),multi:!0}]),x],decls:5,vars:9,consts:[["matTooltipPosition","above",1,"p-float-label",3,"matTooltip"],["appendTo","body","containerStyleClass","w-100","id","selectChannel",1,"multiwarehouse-select",3,"click","onNodeSelect","ngModelChange","onClear","onNodeUnselect","filter","filterInputAutoFocus","options","ngModel","selectionMode"],["pTemplate","value","type","default"],["for","selectChannel"],["matTooltipPosition","above"]],template:function(t,o){t&1&&(m(0,"span",0)(1,"p-treeSelect",1),O(2,"async"),y("click",function(){return o.onClick()})("onNodeSelect",function(l){return o.onNodeSelect(l)}),B("ngModelChange",function(l){return P(o.selectedNode,l)||(o.selectedNode=l),l}),y("onClear",function(){return o.onClear()})("onNodeUnselect",function(l){return o.onNodeUnSelect(l)}),f(3,Q,2,1,"ng-template",2),c(),f(4,X,2,0,"label",3),c()),t&2&&(u("matTooltip",o.selectedCategoryLabel()),p(),u("filter",!0)("filterInputAutoFocus",!0)("options",z(2,7,o.channels$)),L("ngModel",o.selectedNode),u("selectionMode",o.multiple()?"multiple":"single"),p(3),N(o.floatingLabel()?4:-1))},dependencies:[I,F,G,V,q,U,A,D,$,W],styles:["[_nghost-%COMP%] .p-treeselect{width:100%;display:inline-flex;border:1px solid #ced4da;font-size:.875rem!important} .p-element .p-icon-wrapper{width:14px} .p-float-label .multiwarehouse-select.p-treeselect{padding:7px!important;min-height:.6rem!important} .custom-icon-tokopedia.p-tree-node-icon, .custom-icon-shopee.p-tree-node-icon, .custom-icon-woocommerce.p-tree-node-icon, .custom-icon-lazada.p-tree-node-icon, .custom-icon-tiktok.p-tree-node-icon, .custom-icon-shopify.p-tree-node-icon, .custom-icon-plugo.p-tree-node-icon{background-size:contain;background-repeat:no-repeat;width:20px;height:20px;display:inline-block} .custom-icon-tokopedia.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262221/icons/marketplace_icons/tokopedia.png)} .custom-icon-woocommerce.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_50/v1632447439/icons/WooCommerce/woocommerce-icon.webp)} .custom-icon-shopee.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1598262220/icons/marketplace_icons/shopee.png)} .custom-icon-tiktok.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/w_30/v1645761611/icons/Marketplace%20logo/tiktok.png)} .custom-icon-lazada.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1680681836/icons/marketplace_icons/Lazadanew.png)} .custom-icon-shopify.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1707987435/icons/marketplace_icons/shopify.png)} .custom-icon-plugo.p-tree-node-icon{background-image:url(https://res.cloudinary.com/pos/image/upload/v1739236419/icons/marketplace_icons/plugo.ico)} .custom-icon-shopee .fa-warehouse.p-tree-node-icon, .custom-icon-tiktok .fa-warehouse.p-tree-node-icon, .custom-icon-tokopedia .fa-warehouse.p-tree-node-icon, .custom-icon-lazada .fa-warehouse.p-tree-node-icon, .custom-icon-shopify .fa-warehouse.p-tree-node-icon, .custom-icon-woocommerce .fa-warehouse.p-tree-node-icon, .custom-icon-plugo .fa-warehouse.p-tree-node-icon{background-image:none!important;display:inline-block!important}"]});let s=n;return s})();export{fe as a};