marketplacepos 5.40.0 → 5.41.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{chunk-EZQDEFRB.js → chunk-2Q5YW6MY.js} +1 -1
- package/Marketplace/{chunk-C4LREOY5.js → chunk-2SUNUZ5Y.js} +1 -1
- package/Marketplace/{chunk-I22NQWSR.js → chunk-3BGJ2T6Y.js} +1 -1
- package/Marketplace/chunk-3HTZTPHD.js +1 -0
- package/Marketplace/{chunk-I5F2Q6RZ.js → chunk-3ZWNYMH7.js} +1 -1
- package/Marketplace/{chunk-XJ4SQMJS.js → chunk-56YK4SLT.js} +1 -1
- package/Marketplace/{chunk-OP6TQOYE.js → chunk-5FBFUPHZ.js} +1 -1
- package/Marketplace/{chunk-53KRESUI.js → chunk-6EV6VQBQ.js} +1 -1
- package/Marketplace/chunk-6NNAICJE.js +13 -0
- package/Marketplace/{chunk-M3L5WUPF.js → chunk-AQMHZFKJ.js} +1 -1
- package/Marketplace/{chunk-AREVF7FY.js → chunk-BGEYIOMP.js} +1 -1
- package/Marketplace/{chunk-I24AREHY.js → chunk-EDG73HHT.js} +2 -2
- package/Marketplace/{chunk-KC6J3HFN.js → chunk-EIGDGRRL.js} +1 -1
- package/Marketplace/{chunk-PNH7QN3V.js → chunk-G5MO6R5Z.js} +1 -1
- package/Marketplace/{chunk-P4HXQHNP.js → chunk-I6JDDQC2.js} +3 -3
- package/Marketplace/{chunk-MCBB72MO.js → chunk-IRKRLYXS.js} +1 -1
- package/Marketplace/{chunk-S6HFGRAS.js → chunk-K64THYES.js} +1 -1
- package/Marketplace/{chunk-O5GEOC52.js → chunk-KP4WSF75.js} +1 -1
- package/Marketplace/{chunk-BI277ECG.js → chunk-KQ546ATX.js} +1 -1
- package/Marketplace/{chunk-N7L7VSTY.js → chunk-KQAQTVXQ.js} +1 -1
- package/Marketplace/{chunk-JRVGD3CY.js → chunk-L4NLJBLA.js} +1 -1
- package/Marketplace/{chunk-6E7NG6MV.js → chunk-MNQZPU5N.js} +1 -1
- package/Marketplace/{chunk-MULSBKZG.js → chunk-NEIZYQV3.js} +1 -1
- package/Marketplace/{chunk-P27I2G35.js → chunk-NR7IH2JG.js} +1 -1
- package/Marketplace/{chunk-F63VQUM3.js → chunk-QNT7YFQS.js} +1 -1
- package/Marketplace/{chunk-FTHLIE6P.js → chunk-RLLHX27L.js} +1 -1
- package/Marketplace/{chunk-Z4Y34TNT.js → chunk-RNM3GVNZ.js} +1 -1
- package/Marketplace/chunk-SE2DPPGP.js +1 -0
- package/Marketplace/{chunk-6XL5WHNS.js → chunk-SMZ7F54P.js} +1 -1
- package/Marketplace/{chunk-Q7F2LXH2.js → chunk-SXW52HYQ.js} +1 -1
- package/Marketplace/{chunk-XXTUAZMH.js → chunk-TAO67VCP.js} +1 -1
- package/Marketplace/{chunk-JSJNHX3J.js → chunk-TQ2P22BQ.js} +1 -1
- package/Marketplace/{chunk-QSQ6OKT5.js → chunk-TRHB4HA4.js} +1 -1
- package/Marketplace/{chunk-4SNTIKSF.js → chunk-V6IVDZR7.js} +2 -2
- package/Marketplace/{chunk-LO4HE27Y.js → chunk-XITXJ764.js} +1 -1
- package/Marketplace/chunk-XYIY2TDE.js +1 -0
- package/Marketplace/{chunk-ABVZALC5.js → chunk-Y3U6BFV5.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-RRZE23KA.js → main-DNC2TBQ6.js} +1 -1
- package/Marketplace/{styles-VTPGUJ5G.css → styles-NJFTKO3E.css} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-2P74ZFTI.js +0 -2
- package/Marketplace/chunk-4VXEJ6FD.js +0 -1
- package/Marketplace/chunk-CLKCSTGQ.js +0 -13
- package/Marketplace/chunk-KJHD3O3C.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Rt,b as Ie}from"./chunk-2G6NLWKN.js";import{a as le}from"./chunk-6E7NG6MV.js";import"./chunk-MS4AQ6UA.js";import{a as W}from"./chunk-ZD5LURJS.js";import{a as ce,b as se}from"./chunk-VSEWXNVC.js";import{a as be}from"./chunk-PPDHTO44.js";import{a as X}from"./chunk-7KG3DC5J.js";import{b as Pe}from"./chunk-IEYFOHME.js";import"./chunk-YXFTLQ5M.js";import{a as ae,b as re}from"./chunk-OE2JYQHN.js";import{e as mt}from"./chunk-MULSBKZG.js";import{a as he}from"./chunk-VETHPEVU.js";import{i as fe,j as Se,k as ve,l as xe,m as ye}from"./chunk-75BDXSG3.js";import"./chunk-CLKCSTGQ.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as j}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import{a as Bt}from"./chunk-J3P46Z53.js";import{a as Y}from"./chunk-4ASUM4N5.js";import{b as we}from"./chunk-7FUVW73P.js";import{a as _e,b as ge}from"./chunk-M3SJUKTG.js";import{a as At,b as Lt,c as de}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as it}from"./chunk-KC6J3HFN.js";import{a as tt}from"./chunk-62PFQNHJ.js";import{c as me,f as ue}from"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import{a as Ce}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as Ut}from"./chunk-RIHLYYZU.js";import{f as pe}from"./chunk-Q2OEJFVT.js";import{a as st,b as Ot,d as Q,e as ie}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as R}from"./chunk-C4LREOY5.js";import{b as K,e as J}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{b as Et,c as Ft,d as H,h as Nt,i as Vt,j as kt,l as B,m as oe}from"./chunk-BIQHA7UA.js";import{r as pt,s as dt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ne,c as lt,h as U,m as A,y as ct}from"./chunk-DPLEMBB4.js";import{b as I,c as _}from"./chunk-PXB4YEY3.js";import{E as Dt,F as te,G as q,H as Tt,J as ee,f as V,g as k,j as at,k as Xt,m as Mt,n as rt}from"./chunk-GPEVUTDI.js";import{$c as Qt,Dc as $,Eb as E,Ec as d,Fb as qt,Fc as G,G as O,Gc as b,Ic as M,Jc as D,Kb as f,Kc as T,Pc as nt,Qa as $t,Qc as ft,Wb as c,Z as Ht,Zc as F,_c as N,aa as wt,ad as z,bc as et,ca as Gt,ea as Yt,f as Jt,gc as o,hc as r,ic as g,jc as y,ka as Zt,kc as P,mc as v,ob as w,pa as Ct,qb as a,rc as C,sc as s,v as It,wb as S,ya as m,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var Re=()=>["/menu/products/download/by-url"],Me=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=E({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),r(),o(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),r()()()()()(),g(12,"router-outlet")),n&2&&(a(3),c("Tabs",e.productTabs),a(7),c("routerLink",nt(2,Re)))},dependencies:[ae,te,Tt],encapsulation:2})}}return i})();function Be(i,p){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),d(3),r()()),i&2){let t=p.$implicit;c("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),c("src",t.Img,w),a(2),G(t.Name)}}function je(i,p){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),d(3),r()()),i&2){let t=p.$implicit;c("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),c("src",t.Img,w),a(2),G(t.Name)}}function We(i,p){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),d(3),r()()),i&2){let t=p.$implicit;c("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),c("src",t.Img,w),a(2),G(t.Name)}}function Ge(i,p){if(i&1){let t=v();o(0,"div",12)(1,"label",13),d(2,"Scan Type"),r(),o(3,"mat-radio-group",14),T("ngModelChange",function(e){m(t);let l=s();return D(l.filter.ScanFull,e)||(l.filter.ScanFull=e),u(e)}),o(4,"mat-radio-button",15),d(5," Full (Include Inactive Products) "),r(),o(6,"mat-radio-button",16),d(7," Active "),r()()()}if(i&2){let t=s();a(3),M("ngModel",t.filter.ScanFull),a(),c("value",!0),a(2),c("value",!1)}}function $e(i,p){i&1&&(o(0,"span"),d(1,"Never"),r())}function ze(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"async"),r()),i&2){let t=s(2);a(),G(N(2,1,t.lastSync$))}}function Ke(i,p){if(i&1){let t=v();o(0,"div",8)(1,"label",5)(2,"span",17),d(3,"Last Scan:"),r(),f(4,$e,2,0,"span"),F(5,"async"),f(6,ze,3,3,"span"),r(),o(7,"mat-radio-group",18),T("ngModelChange",function(e){m(t);let l=s();return D(l.filter.UpdatedProduct,e)||(l.filter.UpdatedProduct=e),u(e)}),o(8,"mat-radio-button",19),d(9," Scan All Products "),r(),o(10,"mat-radio-button",20),d(11),r()()()}if(i&2){let t=s();a(4),et(N(5,6,t.lastSync$)==null?4:6),a(3),M("ngModel",t.filter.UpdatedProduct),a(),c("value",!1),a(2),c("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),a(),b(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Je(i,p){if(i&1){let t=v();o(0,"div",8)(1,"label",5),d(2," Scan Option "),r(),o(3,"mat-radio-group",21),T("ngModelChange",function(e){m(t);let l=s();return D(l.filter.Async,e)||(l.filter.Async=e),u(e)}),o(4,"mat-radio-button",22),d(5," Asynchronous (Get Notified when Complete) "),r(),o(6,"mat-radio-button",23),d(7," Synchronous (Wait until Complete) "),r()()()}if(i&2){let t=s();a(3),M("ngModel",t.filter.Async),a(),c("value",!0),a(2),c("value",!1)}}var L=(()=>{class i{constructor(t,n,e){this.dialogRef=t,this.data=n,this.router=e,this.channelService=Ct(le),this.channelType=I,this.disabledChannelOption=!1,this.filter={ChannelID:_.GuidEMpty,ScanFull:!0,UpdatedProduct:!1,Async:!1},this.isSingleChannel=_.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=_.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new Vt,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==I.Tiktok||t.TypeID==I.Tokopedia||t.TypeID==I.Lazada||t.TypeID==I.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(It(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),_.IsNotEmpty(n.LastSync)?_.convertToReadableDate(n.LastSync):null)),Ht(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&_.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==I.Shopee||this.selectedChannel.TypeID==I.Tiktok||this.selectedChannel.TypeID==I.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=I.WooCommerce&&this.selectedChannel?.TypeID!=I.KalCare&&this.selectedChannel?.TypeID!=I.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(e=>e.ID==t)),n}submit(){this.selectedChannel.TypeID==I.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return _.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(S(Et),S(Ft),S(q))}}static{this.\u0275cmp=E({type:i,selectors:[["app-scan-dialog"]],decls:15,vars:8,consts:[["selectedItem",""],["item",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["optionLabel","Name","optionValue","ID","placeholder","Select a Channel","appendTo","body","filterBy","Name",1,"w-100",2,"--p-select-padding-y","0.75rem",3,"ngModelChange","options","ngModel","filter"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","rounded-1",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,e){if(n&1){let l=v();o(0,"modal-material",2),C("onOk",function(){return m(l),u(e.submit())})("onClose",function(){return m(l),u(e.onClose())})("onCancel",function(){return m(l),u(e.onClose())}),o(1,"div",3)(2,"div",4)(3,"label",5),d(4,"Select a Channel"),r(),o(5,"p-select",6),T("ngModelChange",function(x){return m(l),D(e.filter.ChannelID,x)||(e.filter.ChannelID=x),u(x)}),C("ngModelChange",function(x){return m(l),u(e.onSelectChannel(x))}),f(6,Be,4,3,"ng-template",null,0,z)(8,je,4,3,"ng-template",null,1,z)(10,We,4,3,"ng-template",null,1,z),r(),f(12,Ge,8,3,"div",7)(13,Ke,12,8,"div",8)(14,Je,8,3,"div",9),r()()()}n&2&&(c("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),a(5),c("options",e.channelOptions),M("ngModel",e.filter.ChannelID),c("filter",!0),a(7),c("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),a(),et(e.hasScanUpdate&&e.selectedChannel?13:-1),a(),c("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[rt,k,at,se,ce,ct,U,A,kt,Ut,Lt,dt,pt,ue,At],encapsulation:2})}}return i})();function He(i,p){if(i&1&&(o(0,"mat-option",6)(1,"div"),g(2,"img",7),o(3,"span"),d(4),r()()()),i&2){let t=p.$implicit;c("value",t.ChannelID),a(2),c("src",t.logo,w),a(2),G(t.Title)}}var _t=(()=>{class i{constructor(){this.dialogRef=Ct(Et),this.channels=Ct(Ft),this.channelIds=$t([]),this.channelOptions=$t([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,l)=>l.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Vt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=E({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),C("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),T("ngModelChange",function(h){return D(e.channelIds,h)||(e.channelIds=h),h}),f(7,He,5,3,"mat-option",5),r()()()()()),n&2&&(c("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),M("ngModel",e.channelIds),c("multiple",!0),a(),c("ngForOf",e.channelOptions()))},dependencies:[rt,V,kt,Ut,pe,ge,_e,me,ct,U,A,dt],encapsulation:2})}}return i})();function Ye(i,p){if(i&1){let t=v();o(0,"button",13),C("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),g(1,"i",14),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ze(i,p){if(i&1){let t=v();o(0,"button",16),C("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),g(1,"i",17),d(2," Scan Channel "),r()}}function qe(i,p){if(i&1&&(y(0),f(1,Ze,3,0,"button",15),P()),i&2){let t=s();a(),c("ngIf",!t.productService.hasSelection(t.products))}}function Qe(i,p){if(i&1){let t=v();y(0),o(1,"button",18),C("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),g(2,"i",17),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Xe(i,p){if(i&1){let t=v();y(0),o(1,"button",19),C("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),g(2,"i",20),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function tn(i,p){if(i&1){let t=v();o(0,"div",21)(1,"app-product-card",22),C("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function en(i,p){i&1&&(y(0),o(1,"div",23),g(2,"app-empty-state"),r(),P())}function nn(i,p){if(i&1){let t=v();y(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),C("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var Ee=(()=>{class i{constructor(t,n,e,l,h,x,gt){this.http=t,this.toastr=n,this.dialog=e,this.productService=l,this.authService=h,this.uploadProductService=x,this.route=gt,this.searchFilter=new X,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,[I.Tokopedia,I.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Rt,{data:{title:this.products[t].Name,variants:n},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok]);this.dialog.open(L,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(l=>_.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let h=this.productService.selectedProduct(this.products),x=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(x)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(l)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=_.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(_t,{width:"600px",data:[...n]}).afterClosed().pipe(O(e=>_.IsNotEmpty(e)),wt(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Nt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(K),S(H),S(j),S(R),S(mt),S(q))}}static{this.\u0275cmp=E({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let l=v();o(0,"mainpanel",1),C("onSubmit",function(x){return m(l),u(e.searchProduct(x))}),o(1,"actions"),f(2,Ye,3,1,"button",2)(3,qe,2,1,"ng-container",3)(4,Qe,4,1,"ng-container",3)(5,Xe,4,1,"ng-container",3),r(),o(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),r(),o(10,"ng-select",5),C("ngModelChange",function(x){return m(l),u(e.searchFilter.Category=x)}),r()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),T("ngModelChange",function(x){return m(l),D(e.startDate,x)||(e.startDate=x),u(x)}),C("click",function(){m(l);let x=$(16);return u(x.open())}),r(),o(14,"input",9),T("ngModelChange",function(x){return m(l),D(e.endDate,x)||(e.endDate=x),u(x)}),C("click",function(){m(l);let x=$(16);return u(x.open())}),r()(),g(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",10)(19,"div",11),f(20,tn,2,11,"div",12)(21,en,3,0,"ng-container",3),r(),f(22,nn,4,5,"ng-container",3),r()()()}if(n&2){let l=$(16);c("headerTitle","In POS ("+e.rowCount+")"),a(2),et(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),c("rangePicker",l),a(),M("ngModel",e.startDate),a(),M("ngModel",e.endDate),a(6),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products.length>0)}},dependencies:[V,k,lt,U,A,B,Q,Y,tt,W,fe,Se,ve,xe],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function on(i,p){if(i&1){let t=v();o(0,"button",11),C("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),g(1,"i",12),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function an(i,p){if(i&1){let t=v();y(0),o(1,"button",13),C("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),g(2,"i",14),d(3," Scan Channel "),r(),P()}}function rn(i,p){if(i&1){let t=v();y(0),o(1,"button",15),C("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function ln(i,p){if(i&1){let t=v();y(0),o(1,"button",16),C("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function cn(i,p){if(i&1&&(o(0,"span",18),g(1,"img",19),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,w)("alt",t.Name),a(),b(" ",t.Name," ")}}function sn(i,p){if(i&1){let t=v();o(0,"div",20)(1,"label",21),d(2,"Item ID"),r(),o(3,"input",22),T("ngModelChange",function(e){m(t);let l=s();return D(l.searchFilter.Item_id,e)||(l.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),M("ngModel",t.searchFilter.Item_id)}}function pn(i,p){if(i&1){let t=v();o(0,"div",23)(1,"app-product-card",24),C("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function dn(i,p){i&1&&(y(0),o(1,"div",25),g(2,"app-empty-state"),r(),P())}function mn(i,p){if(i&1){let t=v();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),C("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var Fe=(()=>{class i{constructor(t,n,e,l,h,x,gt,bt){this.http=t,this.dialog=n,this.toastr=e,this.productService=l,this.activateRouter=h,this.authService=x,this.route=gt,this.uploadProductService=bt,this.searchFilter=new X,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=_.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=_.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(Rt,{data:{variants:n,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(O(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(L,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanProducts(l)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(L,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let l=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(l);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=_.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=_.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=_.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(_t,{width:"600px",data:[...n]}).afterClosed().pipe(O(e=>_.IsNotEmpty(e)),wt(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Nt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(H),S(K),S(j),S(Dt),S(R),S(q),S(mt))}}static{this.\u0275cmp=E({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),f(2,on,3,1,"button",1)(3,an,4,0,"ng-container",2)(4,rn,4,1,"ng-container",2)(5,ln,4,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),r(),o(10,"ng-select",4),C("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),f(11,cn,3,3,"ng-template",5),r()(),f(12,sn,4,1,"div",6),r(),o(13,"content")(14,"div",7)(15,"div",8),f(16,pn,2,11,"div",9)(17,dn,3,0,"ng-container",2),r(),f(18,mn,3,4,"div",10),r()()()),n&2&&(c("headerTitle","Sold in Channel"),a(2),et(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),c("ngIf",e.searchFilter.ListChannelID!=null),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products==null?null:e.products.length))},dependencies:[V,k,lt,U,A,B,Q,st,Ot,Y,tt,W],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function un(i,p){if(i&1){let t=v();o(0,"button",13),C("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),r()}if(i&2){let t=s(2);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function hn(i,p){if(i&1){let t=v();y(0),o(1,"td",29)(2,"input",30),T("ngModelChange",function(e){m(t);let l=s(2).$implicit;return D(l.selected,e)||(l.selected=e),u(e)}),C("ngModelChange",function(){m(t);let e=s(3).ngIf,l=s(3);return u(l.onSelectProduct(e))}),r()(),P()}if(i&2){let t=s(2).$implicit;a(),c("rowSpan",t==null?null:t.Variants.length),a(),M("ngModel",t.selected)}}function _n(i,p){if(i&1){let t=v();y(0),o(1,"img",35),C("click",function(e){m(t);let l=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,l==null?null:l.ImageUrl))}),r(),P()}if(i&2){let t=s(3).$implicit;a(),c("src",t==null?null:t.ImageUrl,w)}}function gn(i,p){i&1&&g(0,"img",36)}function Cn(i,p){if(i&1&&(y(0),o(1,"td",29)(2,"div",31),f(3,_n,2,1,"ng-container",11)(4,gn,1,0,"ng-template",null,1,z),r()(),o(6,"td",32)(7,"h4",33)(8,"span",34),d(9),r()()(),P()),i&2){let t=$(5),n=s(2).$implicit;a(),c("rowSpan",n==null?null:n.Variants.length),a(2),c("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),c("rowSpan",n==null?null:n.Variants.length),a(2),c("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function fn(i,p){if(i&1&&(o(0,"div")(1,"a",25),g(2,"img",37),r()()),i&2){let t=p.$implicit;a(),c("href",t.URL,w),a(),c("src",t.Img,w)("matTooltip",t.Name)}}function Sn(i,p){if(i&1&&(o(0,"div"),g(1,"img",37),r()),i&2){let t=p.$implicit;a(),c("src",t.Img,w)("matTooltip",t.Name)}}function vn(i,p){if(i&1&&(o(0,"tr"),f(1,hn,3,2,"ng-container",12)(2,Cn,10,6,"ng-container",12),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",24)(9,"a",25),g(10,"i",26),r()()(),o(11,"td",27)(12,"div",28),f(13,fn,3,3,"div",23),r()(),o(14,"td",27)(15,"div",28),f(16,Sn,2,2,"div",23),r()()()),i&2){let t=p.$implicit,n=p.index,e=s(5);a(),c("ngIf",n==0),a(),c("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),c("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),w),a(4),c("ngForOf",t==null?null:t.Available),a(3),c("ngForOf",t==null?null:t.NotAvailable)}}function xn(i,p){if(i&1&&(y(0),f(1,vn,17,7,"tr",23),P()),i&2){let t=p.$implicit;a(),c("ngForOf",t.Variants)}}function yn(i,p){if(i&1&&(o(0,"tbody"),f(1,xn,2,1,"ng-container",23),r()),i&2){let t=p.ngIf;a(),c("ngForOf",t)}}function Pn(i,p){if(i&1&&(y(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),o(6,"th",19),d(7,"Product"),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),f(16,yn,2,1,"tbody",12),F(17,"async"),r()(),P()),i&2){let t=s(2);a(16),c("ngIf",N(17,1,t.data$))}}function bn(i,p){i&1&&(o(0,"div",38),g(1,"app-empty-state"),r())}function In(i,p){if(i&1){let t=v();o(0,"span",46),C("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),d(2,"?"),r()()}}function wn(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"number"),r()),i&2){let t=p.ngIf;a(),G(N(2,1,t==null?null:t.Count))}}function Mn(i,p){if(i&1){let t=v();o(0,"a",48),C("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),r()}}function Dn(i,p){if(i&1){let t=v();o(0,"a",50),C("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),r()}}function Tn(i,p){if(i&1&&(y(0),o(1,"div",39)(2,"div",40)(3,"div",41),d(4),F(5,"number"),f(6,In,3,0,"span",42)(7,wn,3,3,"span",12),F(8,"async"),d(9),r()(),o(10,"div",43),f(11,Mn,3,0,"a",44)(12,Dn,3,0,"a",45),r()(),P()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",N(5,6,t==null?null:t.length)," of "),a(2),c("ngIf",n.paginationService.hideCount),a(),c("ngIf",!n.paginationService.hideCount&&N(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function On(i,p){if(i&1&&(y(0),f(1,Tn,13,10,"ng-container",12),P()),i&2){let t=p.ngIf;a(),c("ngIf",(t==null?null:t.length)>0)}}function En(i,p){if(i&1){let t=v();o(0,"mainpanel",3),C("onSubmit",function(e){m(t);let l=s();return u(l.searchProduct(e))}),o(1,"actions"),f(2,un,3,1,"button",4),o(3,"button",5),C("click",function(){m(t);let e=s();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),r(),o(6,"button",7),C("click",function(){m(t);let e=s();return u(e.openExportDialog())}),g(7,"i",8),o(8,"span"),d(9,"Export"),r()()(),o(10,"content")(11,"div",9)(12,"div",10),f(13,Pn,18,3,"ng-container",11),F(14,"async"),f(15,bn,2,0,"ng-template",null,0,z),r(),f(17,On,2,1,"ng-container",12),F(18,"async"),r()()()}if(i&2){let t,n=$(16),e=s();c("hideSearchDropdown",!0),a(2),c("ngIf",e.hasSelectionProduct),a(11),c("ngIf",((t=N(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),c("ngIf",N(18,7,e.data$))}}var Ne=(()=>{class i{constructor(t,n,e,l,h,x,gt,bt,Le){this.http=t,this.dialog=n,this.toastr=e,this.route=l,this.productService=h,this.paginationService=x,this.biggerPictureService=gt,this.authService=bt,this.uploadProductService=Le,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=bt.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(Yt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(It(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=_.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Pe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(H),S(K),S(q),S(j),S(be),S(Ce),S(R),S(mt))}}static{this.\u0275cmp=E({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(f(0,En,19,9,"mainpanel",2),F(1,"async")),n&2&&c("ngIf",N(1,1,e.loader$))},dependencies:[V,k,ne,U,A,B,pt,W,at,Mt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Fn=i=>[i],Nn=()=>[];function Vn(i,p){if(i&1){let t=v();o(0,"button",15),C("click",function(){m(t);let e=s();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),r()}}function kn(i,p){if(i&1){let t=v();y(0),o(1,"button",17),C("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Un(i,p){if(i&1&&(o(0,"span",19),g(1,"img",20),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,w)("alt",t.Name),a(),b(" ",t.Name," ")}}function An(i,p){if(i&1){let t=v();o(0,"div",21)(1,"app-product-card",22),C("onCheckBoxChange",function(e){let l=m(t).index,h=s();return u(h.onSelectProduct(e,l))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,l=s();return u(l.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanChannel(e))}),r()()}if(i&2){let t=p.$implicit;a(),c("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?ft(10,Fn,t==null?null:t.Channel):nt(12,Nn))("showCheckBox",!0)("scanButton",!0)}}function Ln(i,p){i&1&&(y(0),o(1,"div",23),g(2,"app-empty-state"),r(),P())}function Rn(i,p){if(i&1){let t=v();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),C("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var Ve=(()=>{class i{constructor(t,n,e,l,h,x){this.http=t,this.dialog=n,this.productService=e,this.toastrService=l,this.activateRouter=h,this.authService=x,this.searchFilter=new X,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.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=_.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(_.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(_.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(Ie,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(H),S(j),S(K),S(Dt),S(R))}}static{this.\u0275cmp=E({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),f(2,Vn,3,0,"button",1)(3,kn,4,1,"ng-container",2),r(),o(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),r(),o(8,"ng-select",4),T("ngModelChange",function(h){return D(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),f(9,Un,3,3,"ng-template",5),r()(),o(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),r(),o(13,"mat-radio-group",8),T("ngModelChange",function(h){return D(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),d(15," All "),r(),o(16,"mat-radio-button",9),d(17," Yes "),r(),o(18,"mat-radio-button",9),d(19," No "),r()()(),o(20,"div",6)(21,"label",7),d(22,"Item ID"),r(),o(23,"input",10),T("ngModelChange",function(h){return D(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),r()()(),o(24,"content")(25,"div",11)(26,"div",12),f(27,An,2,13,"div",13)(28,Ln,3,0,"ng-container",2),r(),f(29,Rn,3,4,"div",14),r()()()),n&2&&(a(2),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.channelOptions),M("ngModel",e.searchFilter.ChannelID),a(5),M("ngModel",e.searchFilter.HaveSku),a(),c("value",0),a(2),c("value",1),a(2),c("value",2),a(5),M("ngModel",e.searchFilter.Item_id),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[V,k,lt,U,A,B,Q,st,At,Lt,Y,tt,W],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Bn(i,p){if(i&1&&(o(0,"span",9),g(1,"img",10),r(),d(2)),i&2){let t=p.item,n=s();a(),c("src",n.getChannelLogo(t.TypeID),w),a(),b(" ",t.Name," ")}}function jn(i,p){if(i&1&&(o(0,"div",11),g(1,"app-duplicate-product-card",12),r()),i&2){let t=p.$implicit,n=p.index;a(),c("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function Wn(i,p){i&1&&(y(0),o(1,"div",13),g(2,"app-empty-state"),r(),P())}function Gn(i,p){if(i&1){let t=v();y(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),C("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var ke=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new X,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.GuidEMpty}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(j),S(R))}}static{this.\u0275cmp=E({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),r(),o(6,"ng-select",3),T("ngModelChange",function(h){return D(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),C("clear",function(){return e.onClearFilter()}),f(7,Bn,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),f(11,jn,2,6,"div",7)(12,Wn,3,0,"ng-container",8),r(),f(13,Gn,4,4,"ng-container",8),r()()()),n&2&&(a(6),c("multiple",!0)("clearable",!0)("items",e.channelOptions),M("ngModel",e.searchFilter.ListChannelID),a(5),c("ngForOf",e.products),a(),c("ngIf",(e.products==null?null:e.products.length)==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[V,k,U,A,B,Q,st,Ot,Bt,Y,W],encapsulation:2})}}return i})();var $n=()=>["/menu/products/status/sold-in-channel"],Ue=i=>({ID:i}),zn=()=>["/menu/products/status/not-in-pos"];function Kn(i,p){if(i&1&&(y(0),d(1),P()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function Jn(i,p){if(i&1){let t=v();o(0,"span",26),C("click",function(){m(t);let e=s().$implicit,l=s(2);return u(l.getLiveProductCount(e.ID,e))}),g(1,"i",27),r()}}function Hn(i,p){if(i&1){let t=v();o(0,"tr")(1,"td"),g(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),f(6,Kn,2,1,"ng-container",6)(7,Jn,2,0,"ng-template",null,1,z),r(),o(9,"td",19)(10,"a",20),d(11),F(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),F(16,"number"),r()(),o(17,"td"),d(18),F(19,"date"),r(),o(20,"td")(21,"div",21)(22,"button",22),C("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),r(),o(25,"button",24),C("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),r()()()()}if(i&2){let t=p.$implicit,n=$(8),e=s(2);a(2),c("src",e.getChannelLogo(t.TypeID),w),a(2),G(t.Name),a(2),c("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),c("routerLink",nt(18,$n))("queryParams",ft(19,Ue,t.ID)),a(),b(" ",N(12,11,t.SoldInChannel)," "),a(3),c("routerLink",nt(21,zn))("queryParams",ft(22,Ue,t.ID)),a(),b(" ",N(16,13,t.NotInPOS)," "),a(3),b("",t.LastSync?Qt(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Yn(i,p){if(i&1&&(y(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8,"Live Product"),r(),o(9,"th",12),d(10,"Sold In Channel"),r(),o(11,"th",13),d(12,"Product Not in POS"),r(),o(13,"th",14),d(14,"Last Sync"),r(),g(15,"th",15),r()(),o(16,"tbody"),f(17,Hn,28,24,"tr",16),F(18,"async"),r()()(),P()),i&2){let t,n=s();a(17),c("ngForOf",(t=N(18,1,n.channels$))==null?null:t.Data)}}function Zn(i,p){i&1&&(o(0,"div",28),g(1,"app-empty-state"),r())}var Ae=(()=>{class i{constructor(t,n,e,l){this.productService=t,this.toastr=n,this.dialog=e,this.authService=l,this.destroy$=new Jt,this.channelOptions=l.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(Gt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(L,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(O(n=>_.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(O(l=>l)).subscribe(l=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,e,!n.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(Gt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(S(j),S(K),S(H),S(R))}}static{this.\u0275cmp=E({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),f(5,Yn,19,3,"ng-container",6),F(6,"async"),f(7,Zn,2,0,"ng-template",null,0,z),r()()()()()),n&2){let l,h=$(8);c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",((l=N(6,4,e.channels$))==null||l.Data==null?null:l.Data.length)>0)("ngIfElse",h)}},dependencies:[V,k,B,pt,Tt,W,at,Mt,Xt],encapsulation:2})}}return i})();var qn=[{component:Me,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Ee,canActivate:[it],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Fe,canActivate:[it],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Ne,canActivate:[it],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Ve,canActivate:[it],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:ke,canActivate:[it],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Ae,canActivate:[it],data:{title:"Channel Statistic"}}]}],Ko=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=qt({type:i})}static{this.\u0275inj=Zt({imports:[rt,ct,oe,dt,ie,we,de,re,Bt,Y,tt,ee.forChild(qn),ye,he,_t]})}}return i})();export{Ko as StatusModule};
|
|
1
|
+
import{a as Rt,b as Ie}from"./chunk-2G6NLWKN.js";import{a as le}from"./chunk-MNQZPU5N.js";import"./chunk-MS4AQ6UA.js";import{a as W}from"./chunk-ZD5LURJS.js";import{a as ce,b as se}from"./chunk-VSEWXNVC.js";import{a as be}from"./chunk-PPDHTO44.js";import{a as X}from"./chunk-7KG3DC5J.js";import{b as Pe}from"./chunk-IEYFOHME.js";import"./chunk-YXFTLQ5M.js";import{a as ae,b as re}from"./chunk-OE2JYQHN.js";import{e as mt}from"./chunk-NEIZYQV3.js";import{a as he}from"./chunk-VETHPEVU.js";import{i as fe,j as Se,k as ve,l as xe,m as ye}from"./chunk-75BDXSG3.js";import"./chunk-6NNAICJE.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as j}from"./chunk-EGTYAIU5.js";import"./chunk-7TWBIV3T.js";import"./chunk-J7AGLBPL.js";import"./chunk-6ALHX2I4.js";import"./chunk-4G3QN54S.js";import"./chunk-3RK6DDJD.js";import{a as Bt}from"./chunk-J3P46Z53.js";import{a as Y}from"./chunk-4ASUM4N5.js";import{b as we}from"./chunk-7FUVW73P.js";import{a as _e,b as ge}from"./chunk-M3SJUKTG.js";import{a as At,b as Lt,c as de}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as it}from"./chunk-EIGDGRRL.js";import{a as tt}from"./chunk-62PFQNHJ.js";import{c as me,f as ue}from"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import{a as Ce}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as Ut}from"./chunk-RIHLYYZU.js";import{f as pe}from"./chunk-Q2OEJFVT.js";import{a as st,b as Ot,d as Q,e as ie}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{l as R}from"./chunk-2SUNUZ5Y.js";import{b as K,e as J}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{b as Et,c as Ft,d as H,h as Nt,i as Vt,j as kt,l as B,m as oe}from"./chunk-BIQHA7UA.js";import{r as pt,s as dt}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as ne,c as lt,h as U,m as A,y as ct}from"./chunk-DPLEMBB4.js";import{b as I,c as _}from"./chunk-PXB4YEY3.js";import{E as Dt,F as te,G as q,H as Tt,J as ee,f as V,g as k,j as at,k as Xt,m as Mt,n as rt}from"./chunk-GPEVUTDI.js";import{$c as Qt,Dc as $,Eb as E,Ec as d,Fb as qt,Fc as G,G as O,Gc as b,Ic as M,Jc as D,Kb as f,Kc as T,Pc as nt,Qa as $t,Qc as ft,Wb as c,Z as Ht,Zc as F,_c as N,aa as wt,ad as z,bc as et,ca as Gt,ea as Yt,f as Jt,gc as o,hc as r,ic as g,jc as y,ka as Zt,kc as P,mc as v,ob as w,pa as Ct,qb as a,rc as C,sc as s,v as It,wb as S,ya as m,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var Re=()=>["/menu/products/download/by-url"],Me=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=E({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),g(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),g(7,"i",5),r(),o(8,"div",6)(9,"div",7)(10,"a",8),d(11,"Download Product By Url"),r()()()()()(),g(12,"router-outlet")),n&2&&(a(3),c("Tabs",e.productTabs),a(7),c("routerLink",nt(2,Re)))},dependencies:[ae,te,Tt],encapsulation:2})}}return i})();function Be(i,p){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),d(3),r()()),i&2){let t=p.$implicit;c("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),c("src",t.Img,w),a(2),G(t.Name)}}function je(i,p){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),d(3),r()()),i&2){let t=p.$implicit;c("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),c("src",t.Img,w),a(2),G(t.Name)}}function We(i,p){if(i&1&&(o(0,"div",10),g(1,"img",11),o(2,"span"),d(3),r()()),i&2){let t=p.$implicit;c("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),a(),c("src",t.Img,w),a(2),G(t.Name)}}function Ge(i,p){if(i&1){let t=v();o(0,"div",12)(1,"label",13),d(2,"Scan Type"),r(),o(3,"mat-radio-group",14),T("ngModelChange",function(e){m(t);let l=s();return D(l.filter.ScanFull,e)||(l.filter.ScanFull=e),u(e)}),o(4,"mat-radio-button",15),d(5," Full (Include Inactive Products) "),r(),o(6,"mat-radio-button",16),d(7," Active "),r()()()}if(i&2){let t=s();a(3),M("ngModel",t.filter.ScanFull),a(),c("value",!0),a(2),c("value",!1)}}function $e(i,p){i&1&&(o(0,"span"),d(1,"Never"),r())}function ze(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"async"),r()),i&2){let t=s(2);a(),G(N(2,1,t.lastSync$))}}function Ke(i,p){if(i&1){let t=v();o(0,"div",8)(1,"label",5)(2,"span",17),d(3,"Last Scan:"),r(),f(4,$e,2,0,"span"),F(5,"async"),f(6,ze,3,3,"span"),r(),o(7,"mat-radio-group",18),T("ngModelChange",function(e){m(t);let l=s();return D(l.filter.UpdatedProduct,e)||(l.filter.UpdatedProduct=e),u(e)}),o(8,"mat-radio-button",19),d(9," Scan All Products "),r(),o(10,"mat-radio-button",20),d(11),r()()()}if(i&2){let t=s();a(4),et(N(5,6,t.lastSync$)==null?4:6),a(3),M("ngModel",t.filter.UpdatedProduct),a(),c("value",!1),a(2),c("value",!0)("matTooltip",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Use Tokopedia URL for mapping SKU between POS and Tokopedia":"Scan only products that have been updated since the last channel scan"),a(),b(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function Je(i,p){if(i&1){let t=v();o(0,"div",8)(1,"label",5),d(2," Scan Option "),r(),o(3,"mat-radio-group",21),T("ngModelChange",function(e){m(t);let l=s();return D(l.filter.Async,e)||(l.filter.Async=e),u(e)}),o(4,"mat-radio-button",22),d(5," Asynchronous (Get Notified when Complete) "),r(),o(6,"mat-radio-button",23),d(7," Synchronous (Wait until Complete) "),r()()()}if(i&2){let t=s();a(3),M("ngModel",t.filter.Async),a(),c("value",!0),a(2),c("value",!1)}}var L=(()=>{class i{constructor(t,n,e){this.dialogRef=t,this.data=n,this.router=e,this.channelService=Ct(le),this.channelType=I,this.disabledChannelOption=!1,this.filter={ChannelID:_.GuidEMpty,ScanFull:!1,UpdatedProduct:!1,Async:!1},this.isSingleChannel=_.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=_.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new Vt,this.modalConfig.title=this.isSingleChannel?"Scan Single Product":"Scan Channel Marketplace",this.modalConfig.bodyScrollable=!0}initFilter(){this.filter.ChannelID=this.data?.filter?.ChannelID}initChannelOptions(){this.channelOptions=JSON.parse(JSON.stringify(this.data.channelOptions)),this.isSingleChannel&&(this.channelOptions=this.channelOptions.map(t=>(t.disabled=!0,(t.TypeID==I.Tiktok||t.TypeID==I.Tokopedia||t.TypeID==I.Lazada||t.TypeID==I.WooCommerce)&&(t.disabled=!1),t)).sort(t=>t.disabled?1:-1))}onSelectChannel(t){let n=this.filterChannelById(t);this.selectedChannel=n,this.filter.Async=!0,this.iniHasScanUpdate(),this.getLastSync(t)}getLastSync(t){this.lastSync$=this.channelService.getLastSync(t).pipe(It(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),_.IsNotEmpty(n.LastSync)?_.convertToReadableDate(n.LastSync):null)),Ht(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&_.IsNotEmpty(this.selectedChannel.LastSync)&&(this.selectedChannel.TypeID==I.Shopee||this.selectedChannel.TypeID==I.Tiktok||this.selectedChannel.TypeID==I.Lazada)&&(this.filter.UpdatedProduct=!0)}iniHasScanUpdate(){this.selectedChannel?.TypeID!=I.WooCommerce&&this.selectedChannel?.TypeID!=I.KalCare&&this.selectedChannel?.TypeID!=I.None&&!this.isSingleChannel?this.hasScanUpdate=!0:this.hasScanUpdate=!1}filterChannelById(t){let n;return this.channelOptions&&(n=this.channelOptions.find(e=>e.ID==t)),n}submit(){this.selectedChannel.TypeID==I.Tokopedia&&this.filter.UpdatedProduct?this.router.navigate(["/menu/products/download/by-url"]).then(()=>{this.dialogRef.close()}):this.dialogRef.close(this.filter)}isNotEmpty(t){return _.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(S(Et),S(Ft),S(q))}}static{this.\u0275cmp=E({type:i,selectors:[["app-scan-dialog"]],decls:15,vars:8,consts:[["selectedItem",""],["item",""],[3,"onOk","onClose","onCancel","dynamicValidated","config"],["content",""],[1,"mx-4"],[1,"mb-2","fw-bold"],["optionLabel","Name","optionValue","ID","placeholder","Select a Channel","appendTo","body","filterBy","Name",1,"w-100",2,"--p-select-padding-y","0.75rem",3,"ngModelChange","options","ngModel","filter"],["class","mt-4",4,"ngIf"],[1,"mt-8"],["class","mt-8",4,"ngIf"],["matTooltipPosition","above","matTooltipClass","custom-width-tooltip",3,"matTooltip"],[2,"width","18px","margin-right","10px",3,"src"],[1,"mt-4"],[1,"mb-2","fw-bold","mt-3"],["name","scanType",1,"form-control","h-100","rounded-1",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Full Scan Product",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Only Active Product",1,"me-5",3,"value"],[1,"me-2"],["name","ScanFull",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above","matTooltip","Scan product from beginning ( use this if you haven't scanned at all)",1,"me-5",3,"value"],["matTooltipClass","custom-width-tooltip","matTooltipPosition","above",1,"me-5",3,"value","matTooltip"],["name","Async",1,"form-control","h-100","rounded-1",2,"line-height","2",3,"ngModelChange","ngModel"],["matTooltipClass","custom-width-tooltip","matTooltip","Scan is running in the background, status will be visible in the notification menu","matTooltipPosition","above",1,"me-5",3,"value"],[1,"me-5",3,"value"]],template:function(n,e){if(n&1){let l=v();o(0,"modal-material",2),C("onOk",function(){return m(l),u(e.submit())})("onClose",function(){return m(l),u(e.onClose())})("onCancel",function(){return m(l),u(e.onClose())}),o(1,"div",3)(2,"div",4)(3,"label",5),d(4,"Select a Channel"),r(),o(5,"p-select",6),T("ngModelChange",function(x){return m(l),D(e.filter.ChannelID,x)||(e.filter.ChannelID=x),u(x)}),C("ngModelChange",function(x){return m(l),u(e.onSelectChannel(x))}),f(6,Be,4,3,"ng-template",null,0,z)(8,je,4,3,"ng-template",null,1,z)(10,We,4,3,"ng-template",null,1,z),r(),f(12,Ge,8,3,"div",7)(13,Ke,12,8,"div",8)(14,Je,8,3,"div",9),r()()()}n&2&&(c("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),a(5),c("options",e.channelOptions),M("ngModel",e.filter.ChannelID),c("filter",!0),a(7),c("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),a(),et(e.hasScanUpdate&&e.selectedChannel?13:-1),a(),c("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[rt,k,at,se,ce,ct,U,A,kt,Ut,Lt,dt,pt,ue,At],encapsulation:2})}}return i})();function He(i,p){if(i&1&&(o(0,"mat-option",6)(1,"div"),g(2,"img",7),o(3,"span"),d(4),r()()()),i&2){let t=p.$implicit;c("value",t.ChannelID),a(2),c("src",t.logo,w),a(2),G(t.Title)}}var _t=(()=>{class i{constructor(){this.dialogRef=Ct(Et),this.channels=Ct(Ft),this.channelIds=$t([]),this.channelOptions=$t([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,l)=>l.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new Vt,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=E({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),C("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),d(4,"Select a Channel"),r(),o(5,"mat-form-field",3)(6,"mat-select",4),T("ngModelChange",function(h){return D(e.channelIds,h)||(e.channelIds=h),h}),f(7,He,5,3,"mat-option",5),r()()()()()),n&2&&(c("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),a(6),M("ngModel",e.channelIds),c("multiple",!0),a(),c("ngForOf",e.channelOptions()))},dependencies:[rt,V,kt,Ut,pe,ge,_e,me,ct,U,A,dt],encapsulation:2})}}return i})();function Ye(i,p){if(i&1){let t=v();o(0,"button",13),C("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),g(1,"i",14),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Ze(i,p){if(i&1){let t=v();o(0,"button",16),C("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),g(1,"i",17),d(2," Scan Channel "),r()}}function qe(i,p){if(i&1&&(y(0),f(1,Ze,3,0,"button",15),P()),i&2){let t=s();a(),c("ngIf",!t.productService.hasSelection(t.products))}}function Qe(i,p){if(i&1){let t=v();y(0),o(1,"button",18),C("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),g(2,"i",17),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Xe(i,p){if(i&1){let t=v();y(0),o(1,"button",19),C("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),g(2,"i",20),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function tn(i,p){if(i&1){let t=v();o(0,"div",21)(1,"app-product-card",22),C("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",(t==null?null:t.Channel.length)<n.channelOptions.length)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function en(i,p){i&1&&(y(0),o(1,"div",23),g(2,"app-empty-state"),r(),P())}function nn(i,p){if(i&1){let t=v();y(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),C("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var Ee=(()=>{class i{constructor(t,n,e,l,h,x,gt){this.http=t,this.toastr=n,this.dialog=e,this.productService=l,this.authService=h,this.uploadProductService=x,this.route=gt,this.searchFilter=new X,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,[I.Tokopedia,I.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(n=>{this.products=n.Data,this.rowCount=n.Total==null?this.searchFilter.RowCount:n.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let n=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,n,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){let n=this.products[t]?.Variants||[];this.dialog.open(Rt,{data:{title:this.products[t].Name,variants:n},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok]);this.dialog.open(L,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(l=>_.IsNotEmpty(l))).subscribe(l=>{this.searchFilter.ChannelID=l.ChannelID,this.searchFilter.ScanFull=l.ScanFull,this.searchFilter.UpdatedProduct=l.UpdatedProduct;let h=this.productService.selectedProduct(this.products),x=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(x)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(l)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{if(n)this.toastr.success("Successfully Scan ","Success");else{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${e?.Name} `,"Error")}this.searchFilter.ChannelID=_.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t=[]){let n;return t?.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t?.length==1&&(n=t[0].Code),n}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=_.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(_t,{width:"600px",data:[...n]}).afterClosed().pipe(O(e=>_.IsNotEmpty(e)),wt(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Nt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(K),S(H),S(j),S(R),S(mt),S(q))}}static{this.\u0275cmp=E({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let l=v();o(0,"mainpanel",1),C("onSubmit",function(x){return m(l),u(e.searchProduct(x))}),o(1,"actions"),f(2,Ye,3,1,"button",2)(3,qe,2,1,"ng-container",3)(4,Qe,4,1,"ng-container",3)(5,Xe,4,1,"ng-container",3),r(),o(6,"filters")(7,"div")(8,"label",4),d(9,"Category"),r(),o(10,"ng-select",5),C("ngModelChange",function(x){return m(l),u(e.searchFilter.Category=x)}),r()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),T("ngModelChange",function(x){return m(l),D(e.startDate,x)||(e.startDate=x),u(x)}),C("click",function(){m(l);let x=$(16);return u(x.open())}),r(),o(14,"input",9),T("ngModelChange",function(x){return m(l),D(e.endDate,x)||(e.endDate=x),u(x)}),C("click",function(){m(l);let x=$(16);return u(x.open())}),r()(),g(15,"mat-date-range-picker",null,0),r()(),o(17,"content")(18,"div",10)(19,"div",11),f(20,tn,2,11,"div",12)(21,en,3,0,"ng-container",3),r(),f(22,nn,4,5,"ng-container",3),r()()()}if(n&2){let l=$(16);c("headerTitle","In POS ("+e.rowCount+")"),a(2),et(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),a(2),c("rangePicker",l),a(),M("ngModel",e.startDate),a(),M("ngModel",e.endDate),a(6),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products.length>0)}},dependencies:[V,k,lt,U,A,B,Q,Y,tt,W,fe,Se,ve,xe],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function on(i,p){if(i&1){let t=v();o(0,"button",11),C("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),g(1,"i",12),d(2),r()}if(i&2){let t,n=s();a(2),b("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function an(i,p){if(i&1){let t=v();y(0),o(1,"button",13),C("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),g(2,"i",14),d(3," Scan Channel "),r(),P()}}function rn(i,p){if(i&1){let t=v();y(0),o(1,"button",15),C("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),g(2,"i",14),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function ln(i,p){if(i&1){let t=v();y(0),o(1,"button",16),C("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),g(2,"i",17),d(3),r(),P()}if(i&2){let t=s();a(3),b(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function cn(i,p){if(i&1&&(o(0,"span",18),g(1,"img",19),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,w)("alt",t.Name),a(),b(" ",t.Name," ")}}function sn(i,p){if(i&1){let t=v();o(0,"div",20)(1,"label",21),d(2,"Item ID"),r(),o(3,"input",22),T("ngModelChange",function(e){m(t);let l=s();return D(l.searchFilter.Item_id,e)||(l.searchFilter.Item_id=e),u(e)}),r()()}if(i&2){let t=s();a(3),M("ngModel",t.searchFilter.Item_id)}}function pn(i,p){if(i&1){let t=v();o(0,"div",23)(1,"app-product-card",24),C("onUpload",function(){let e=m(t).$implicit,l=s();return u(l.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let l=m(t).$implicit;return u(l.selected=e)})("onDetach",function(){let e=m(t).$implicit,l=s();return u(l.onDetachProduct([e]))}),r()()}if(i&2){let t=p.$implicit,n=s();a(),c("productId",t==null?null:t.ID)("title",t==null?null:t.Name)("image",t==null?null:t.ThumbnailUrl)("description",(t==null||t.Variants==null?null:t.Variants.length)>1?(t==null||t.Variants==null?null:t.Variants.length)+" Variants":null)("channels",n.productService.getChannelProduct(t))("code",n.getVariantCode(t==null?null:t.Variants))("showCheckBox",t==null?null:t.hasScan)("scanButton",!0)("uploadButton",t==null?null:t.hasUpload)("imageForZoom",t==null?null:t.ImageUrl)("detachButton",(t==null||t.Channel==null?null:t.Channel.length)>0)}}function dn(i,p){i&1&&(y(0),o(1,"div",25),g(2,"app-empty-state"),r(),P())}function mn(i,p){if(i&1){let t=v();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),C("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var Fe=(()=>{class i{constructor(t,n,e,l,h,x,gt,bt){this.http=t,this.dialog=n,this.toastr=e,this.productService=l,this.activateRouter=h,this.authService=x,this.route=gt,this.uploadProductService=bt,this.searchFilter=new X,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=_.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=_.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(n.Filter.ChannelID)),this.searchFilter.PageSize=n.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(n=>{this.products=n.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let n=this.products[t].Variants;this.dialog.open(Rt,{data:{variants:n,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.Async=e.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(O(n=>n)).subscribe(n=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(_.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(L,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let l=this.productService.getVariantCodesProduct(t);this.scanProducts(l)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=_.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(L,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let l=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(l);this.scanProducts(h)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:n=>{let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);n?this.toastr.success(`Product Successfully scan with ${e?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${e?.Name} `,"Error"),this.searchFilter.ChannelID=_.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=_.GuidEMpty}})}getVariantCode(t){let n;return t.length>1&&(n=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(n=t[0].Code),n}onClearFilterChannel(){this.searchFilter.ChannelID=_.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=_.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(_t,{width:"600px",data:[...n]}).afterClosed().pipe(O(e=>_.IsNotEmpty(e)),wt(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Nt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(H),S(K),S(j),S(Dt),S(R),S(q),S(mt))}}static{this.\u0275cmp=E({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),f(2,on,3,1,"button",1)(3,an,4,0,"ng-container",2)(4,rn,4,1,"ng-container",2)(5,ln,4,1,"ng-container",2),r(),o(6,"filters")(7,"div")(8,"label",3),d(9,"Channel"),r(),o(10,"ng-select",4),C("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),f(11,cn,3,3,"ng-template",5),r()(),f(12,sn,4,1,"div",6),r(),o(13,"content")(14,"div",7)(15,"div",8),f(16,pn,2,11,"div",9)(17,dn,3,0,"ng-container",2),r(),f(18,mn,3,4,"div",10),r()()()),n&2&&(c("headerTitle","Sold in Channel"),a(2),et(e.productService.hasSelection(e.products)?2:-1),a(),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),a(2),c("ngIf",e.searchFilter.ListChannelID!=null),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",e.products==null?null:e.products.length))},dependencies:[V,k,lt,U,A,B,Q,st,Ot,Y,tt,W],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]})}}return i})();function un(i,p){if(i&1){let t=v();o(0,"button",13),C("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),g(1,"i",14),d(2),r()}if(i&2){let t=s(2);a(2),b(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function hn(i,p){if(i&1){let t=v();y(0),o(1,"td",29)(2,"input",30),T("ngModelChange",function(e){m(t);let l=s(2).$implicit;return D(l.selected,e)||(l.selected=e),u(e)}),C("ngModelChange",function(){m(t);let e=s(3).ngIf,l=s(3);return u(l.onSelectProduct(e))}),r()(),P()}if(i&2){let t=s(2).$implicit;a(),c("rowSpan",t==null?null:t.Variants.length),a(),M("ngModel",t.selected)}}function _n(i,p){if(i&1){let t=v();y(0),o(1,"img",35),C("click",function(e){m(t);let l=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,l==null?null:l.ImageUrl))}),r(),P()}if(i&2){let t=s(3).$implicit;a(),c("src",t==null?null:t.ImageUrl,w)}}function gn(i,p){i&1&&g(0,"img",36)}function Cn(i,p){if(i&1&&(y(0),o(1,"td",29)(2,"div",31),f(3,_n,2,1,"ng-container",11)(4,gn,1,0,"ng-template",null,1,z),r()(),o(6,"td",32)(7,"h4",33)(8,"span",34),d(9),r()()(),P()),i&2){let t=$(5),n=s(2).$implicit;a(),c("rowSpan",n==null?null:n.Variants.length),a(2),c("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),a(3),c("rowSpan",n==null?null:n.Variants.length),a(2),c("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),a(),b(" ",n==null?null:n.Name," ")}}function fn(i,p){if(i&1&&(o(0,"div")(1,"a",25),g(2,"img",37),r()()),i&2){let t=p.$implicit;a(),c("href",t.URL,w),a(),c("src",t.Img,w)("matTooltip",t.Name)}}function Sn(i,p){if(i&1&&(o(0,"div"),g(1,"img",37),r()),i&2){let t=p.$implicit;a(),c("src",t.Img,w)("matTooltip",t.Name)}}function vn(i,p){if(i&1&&(o(0,"tr"),f(1,hn,3,2,"ng-container",12)(2,Cn,10,6,"ng-container",12),o(3,"td"),d(4),r(),o(5,"td")(6,"span"),d(7),r(),o(8,"span",24)(9,"a",25),g(10,"i",26),r()()(),o(11,"td",27)(12,"div",28),f(13,fn,3,3,"div",23),r()(),o(14,"td",27)(15,"div",28),f(16,Sn,2,2,"div",23),r()()()),i&2){let t=p.$implicit,n=p.index,e=s(5);a(),c("ngIf",n==0),a(),c("ngIf",n==0),a(2),b(" ",t.Name," "),a(3),b(" ",t.Code," "),a(2),c("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),w),a(4),c("ngForOf",t==null?null:t.Available),a(3),c("ngForOf",t==null?null:t.NotAvailable)}}function xn(i,p){if(i&1&&(y(0),f(1,vn,17,7,"tr",23),P()),i&2){let t=p.$implicit;a(),c("ngForOf",t.Variants)}}function yn(i,p){if(i&1&&(o(0,"tbody"),f(1,xn,2,1,"ng-container",23),r()),i&2){let t=p.ngIf;a(),c("ngForOf",t)}}function Pn(i,p){if(i&1&&(y(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),g(5,"th",18),o(6,"th",19),d(7,"Product"),r(),o(8,"th",20),d(9,"Variant"),r(),o(10,"th",20),d(11,"SKU"),r(),o(12,"th",21),d(13,"Available In"),r(),o(14,"th",22),d(15,"Not Available In"),r()()(),f(16,yn,2,1,"tbody",12),F(17,"async"),r()(),P()),i&2){let t=s(2);a(16),c("ngIf",N(17,1,t.data$))}}function bn(i,p){i&1&&(o(0,"div",38),g(1,"app-empty-state"),r())}function In(i,p){if(i&1){let t=v();o(0,"span",46),C("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),d(2,"?"),r()()}}function wn(i,p){if(i&1&&(o(0,"span"),d(1),F(2,"number"),r()),i&2){let t=p.ngIf;a(),G(N(2,1,t==null?null:t.Count))}}function Mn(i,p){if(i&1){let t=v();o(0,"a",48),C("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),g(1,"i",49),d(2," Next"),r()}}function Dn(i,p){if(i&1){let t=v();o(0,"a",50),C("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),g(1,"i",51),d(2," Last"),r()}}function Tn(i,p){if(i&1&&(y(0),o(1,"div",39)(2,"div",40)(3,"div",41),d(4),F(5,"number"),f(6,In,3,0,"span",42)(7,wn,3,3,"span",12),F(8,"async"),d(9),r()(),o(10,"div",43),f(11,Mn,3,0,"a",44)(12,Dn,3,0,"a",45),r()(),P()),i&2){let t=s().ngIf,n=s(2);a(4),b(" Showing 1 - ",N(5,6,t==null?null:t.length)," of "),a(2),c("ngIf",n.paginationService.hideCount),a(),c("ngIf",!n.paginationService.hideCount&&N(8,8,n.rowCount$)),a(2),b(" records ~ ",n.paginationService.footerPageNumber," Page "),a(2),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),a(),c("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function On(i,p){if(i&1&&(y(0),f(1,Tn,13,10,"ng-container",12),P()),i&2){let t=p.ngIf;a(),c("ngIf",(t==null?null:t.length)>0)}}function En(i,p){if(i&1){let t=v();o(0,"mainpanel",3),C("onSubmit",function(e){m(t);let l=s();return u(l.searchProduct(e))}),o(1,"actions"),f(2,un,3,1,"button",4),o(3,"button",5),C("click",function(){m(t);let e=s();return u(e.openScanDialog())}),g(4,"i",6),d(5," Scan Channel "),r(),o(6,"button",7),C("click",function(){m(t);let e=s();return u(e.openExportDialog())}),g(7,"i",8),o(8,"span"),d(9,"Export"),r()()(),o(10,"content")(11,"div",9)(12,"div",10),f(13,Pn,18,3,"ng-container",11),F(14,"async"),f(15,bn,2,0,"ng-template",null,0,z),r(),f(17,On,2,1,"ng-container",12),F(18,"async"),r()()()}if(i&2){let t,n=$(16),e=s();c("hideSearchDropdown",!0),a(2),c("ngIf",e.hasSelectionProduct),a(11),c("ngIf",((t=N(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),a(4),c("ngIf",N(18,7,e.data$))}}var Ne=(()=>{class i{constructor(t,n,e,l,h,x,gt,bt,Le){this.http=t,this.dialog=n,this.toastr=e,this.route=l,this.productService=h,this.paginationService=x,this.biggerPictureService=gt,this.authService=bt,this.uploadProductService=Le,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=bt.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(Yt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(It(t=>(t=t.map(n=>(n.Variants=n.Variants.map(e=>(e.Available=this.productService.sortChannel(e.Available),e.NotAvailable=this.productService.sortChannel(e.NotAvailable),e.Available=this.assignLogoChannel(e.Available),e.NotAvailable=this.assignLogoChannel(e.NotAvailable),e)),n.Channel=n?.Variants[0]?.Available,n)),t)))}assignLogoChannel(t){return t=t.map(n=>(n.Img=_.getChannelLogoByTypeId(n.TypeID),n)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(n=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(n,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.filterSearch.ChannelID=e.ChannelID,this.filterSearch.ScanFull=e.ScanFull,this.filterSearch.UpdatedProduct=e.UpdatedProduct,this.filterSearch.Async=e.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,n){this.biggerPictureService.openBiggerPicture(t,n)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){this.uploadProductService.setSelectedProduct(this.selectedProducts),this.route.navigate(["/menu/products/upload"])}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(Pe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(H),S(K),S(q),S(j),S(be),S(Ce),S(R),S(mt))}}static{this.\u0275cmp=E({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(f(0,En,19,9,"mainpanel",2),F(1,"async")),n&2&&c("ngIf",N(1,1,e.loader$))},dependencies:[V,k,ne,U,A,B,pt,W,at,Mt],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]})}}return i})();var Fn=i=>[i],Nn=()=>[];function Vn(i,p){if(i&1){let t=v();o(0,"button",15),C("click",function(){m(t);let e=s();return u(e.openScanDialog())}),g(1,"i",16),d(2," Scan Channel "),r()}}function kn(i,p){if(i&1){let t=v();y(0),o(1,"button",17),C("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),g(2,"i",18),d(3),r(),P()}if(i&2){let t,n=s();a(3),b(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Un(i,p){if(i&1&&(o(0,"span",19),g(1,"img",20),r(),d(2)),i&2){let t=p.item;a(),c("src",t.Img,w)("alt",t.Name),a(),b(" ",t.Name," ")}}function An(i,p){if(i&1){let t=v();o(0,"div",21)(1,"app-product-card",22),C("onCheckBoxChange",function(e){let l=m(t).index,h=s();return u(h.onSelectProduct(e,l))})("onDescEvent",function(){let e=m(t).index,l=s();return u(l.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,l=s();return u(l.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,l=s();return u(l.onScanChannel(e))}),r()()}if(i&2){let t=p.$implicit;a(),c("showRedirectIcon",!1)("title",t==null?null:t.Name)("image",t==null?null:t.Image)("imageForZoom",t==null?null:t.Image)("code",t==null?null:t.SKU)("description",(t==null||t.Variant==null?null:t.Variant.length)>0?(t==null||t.Variant==null?null:t.Variant.length)+" Variants":null)("downloadButton",!0)("channels",t!=null&&t.Channel?ft(10,Fn,t==null?null:t.Channel):nt(12,Nn))("showCheckBox",!0)("scanButton",!0)}}function Ln(i,p){i&1&&(y(0),o(1,"div",23),g(2,"app-empty-state"),r(),P())}function Rn(i,p){if(i&1){let t=v();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),C("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),r()()()}if(i&2){let t=s();a(2),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var Ve=(()=>{class i{constructor(t,n,e,l,h,x){this.http=t,this.dialog=n,this.productService=e,this.toastrService=l,this.activateRouter=h,this.authService=x,this.searchFilter=new X,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(_.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,this.searchFilter.PageSize=n.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(n=>(t=this.channelOptions.find(e=>e.ID==n.ChannelID),t?n.Channel=JSON.parse(JSON.stringify(t)):n.Channel=null,n)).map(n=>(n.Channel&&(n.Channel.Url=n.Url),n))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?_.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=_.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(n=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(_.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=_.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=_.GuidEMpty,this.dialog.open(L,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(O(e=>_.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.UpdatedProduct=e.UpdatedProduct,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.Async=e.Async,this.onScanAll()})}onDownloadAllProduct(t){let n;t=="ALL"?n=this.products:n=this.productService.selectedProduct(this.products),n.length>0&&this.productService.downloadMultipleProduct(n).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,n){this.products[n].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let n=JSON.parse(JSON.stringify(t));delete n.Channel,this.productService.scanCompareToPos([n]).subscribe(e=>{e.Status?(this.initPageLoader(_.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(Ie,{data:{title:this.products[t].Name,variants:n},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Count})}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(H),S(j),S(K),S(Dt),S(R))}}static{this.\u0275cmp=E({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),f(2,Vn,3,0,"button",1)(3,kn,4,1,"ng-container",2),r(),o(4,"filters")(5,"div")(6,"label",3),d(7,"Channel"),r(),o(8,"ng-select",4),T("ngModelChange",function(h){return D(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),f(9,Un,3,3,"ng-template",5),r()(),o(10,"div",6)(11,"label",7),d(12,"SKU Assigned"),r(),o(13,"mat-radio-group",8),T("ngModelChange",function(h){return D(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),d(15," All "),r(),o(16,"mat-radio-button",9),d(17," Yes "),r(),o(18,"mat-radio-button",9),d(19," No "),r()()(),o(20,"div",6)(21,"label",7),d(22,"Item ID"),r(),o(23,"input",10),T("ngModelChange",function(h){return D(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),r()()(),o(24,"content")(25,"div",11)(26,"div",12),f(27,An,2,13,"div",13)(28,Ln,3,0,"ng-container",2),r(),f(29,Rn,3,4,"div",14),r()()()),n&2&&(a(2),c("ngIf",!e.productService.hasSelection(e.products)),a(),c("ngIf",e.productService.hasSelection(e.products)),a(5),c("clearable",!0)("items",e.channelOptions),M("ngModel",e.searchFilter.ChannelID),a(5),M("ngModel",e.searchFilter.HaveSku),a(),c("value",0),a(2),c("value",1),a(2),c("value",2),a(5),M("ngModel",e.searchFilter.Item_id),a(4),c("ngForOf",e.products),a(),c("ngIf",e.products.length==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[V,k,lt,U,A,B,Q,st,At,Lt,Y,tt,W],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]})}}return i})();function Bn(i,p){if(i&1&&(o(0,"span",9),g(1,"img",10),r(),d(2)),i&2){let t=p.item,n=s();a(),c("src",n.getChannelLogo(t.TypeID),w),a(),b(" ",t.Name," ")}}function jn(i,p){if(i&1&&(o(0,"div",11),g(1,"app-duplicate-product-card",12),r()),i&2){let t=p.$implicit,n=p.index;a(),c("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function Wn(i,p){i&1&&(y(0),o(1,"div",13),g(2,"app-empty-state"),r(),P())}function Gn(i,p){if(i&1){let t=v();y(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),C("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),r()()(),P()}if(i&2){let t=s();a(3),c("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var ke=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new X,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=e.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(n=>{this.products=n.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=_.GuidEMpty}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(S(J),S(j),S(R))}}static{this.\u0275cmp=E({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),C("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),d(5,"Channel"),r(),o(6,"ng-select",3),T("ngModelChange",function(h){return D(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),C("clear",function(){return e.onClearFilter()}),f(7,Bn,3,2,"ng-template",4),r()()()(),o(8,"content")(9,"div",5)(10,"div",6),f(11,jn,2,6,"div",7)(12,Wn,3,0,"ng-container",8),r(),f(13,Gn,4,4,"ng-container",8),r()()()),n&2&&(a(6),c("multiple",!0)("clearable",!0)("items",e.channelOptions),M("ngModel",e.searchFilter.ListChannelID),a(5),c("ngForOf",e.products),a(),c("ngIf",(e.products==null?null:e.products.length)==0),a(),c("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[V,k,U,A,B,Q,st,Ot,Bt,Y,W],encapsulation:2})}}return i})();var $n=()=>["/menu/products/status/sold-in-channel"],Ue=i=>({ID:i}),zn=()=>["/menu/products/status/not-in-pos"];function Kn(i,p){if(i&1&&(y(0),d(1),P()),i&2){let t=s().$implicit;a(),b(" ",t.Count," ")}}function Jn(i,p){if(i&1){let t=v();o(0,"span",26),C("click",function(){m(t);let e=s().$implicit,l=s(2);return u(l.getLiveProductCount(e.ID,e))}),g(1,"i",27),r()}}function Hn(i,p){if(i&1){let t=v();o(0,"tr")(1,"td"),g(2,"img",17),o(3,"span",18),d(4),r()(),o(5,"td",19),f(6,Kn,2,1,"ng-container",6)(7,Jn,2,0,"ng-template",null,1,z),r(),o(9,"td",19)(10,"a",20),d(11),F(12,"number"),r()(),o(13,"td",19)(14,"a",20),d(15),F(16,"number"),r()(),o(17,"td"),d(18),F(19,"date"),r(),o(20,"td")(21,"div",21)(22,"button",22),C("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onScanChannel(e))}),g(23,"i",23),d(24," Scan "),r(),o(25,"button",24),C("click",function(){let e=m(t).$implicit,l=s(2);return u(l.onClearCache(e.ID))}),g(26,"i",25),d(27," Clear "),r()()()()}if(i&2){let t=p.$implicit,n=$(8),e=s(2);a(2),c("src",e.getChannelLogo(t.TypeID),w),a(2),G(t.Name),a(2),c("ngIf",t.Count!==void 0)("ngIfElse",n),a(4),c("routerLink",nt(18,$n))("queryParams",ft(19,Ue,t.ID)),a(),b(" ",N(12,11,t.SoldInChannel)," "),a(3),c("routerLink",nt(21,zn))("queryParams",ft(22,Ue,t.ID)),a(),b(" ",N(16,13,t.NotInPOS)," "),a(3),b("",t.LastSync?Qt(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Yn(i,p){if(i&1&&(y(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),d(6,"Channel"),r(),o(7,"th",11),d(8,"Live Product"),r(),o(9,"th",12),d(10,"Sold In Channel"),r(),o(11,"th",13),d(12,"Product Not in POS"),r(),o(13,"th",14),d(14,"Last Sync"),r(),g(15,"th",15),r()(),o(16,"tbody"),f(17,Hn,28,24,"tr",16),F(18,"async"),r()()(),P()),i&2){let t,n=s();a(17),c("ngForOf",(t=N(18,1,n.channels$))==null?null:t.Data)}}function Zn(i,p){i&1&&(o(0,"div",28),g(1,"app-empty-state"),r())}var Ae=(()=>{class i{constructor(t,n,e,l){this.productService=t,this.toastr=n,this.dialog=e,this.authService=l,this.destroy$=new Jt,this.channelOptions=l.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(Gt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(L,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(O(n=>_.IsNotEmpty(n))).subscribe(n=>{this.scanAllProduct(t.ID,n)})}scanAllProduct(t,n){let e=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(n.ChannelID,n.ScanFull,n.UpdatedProduct,n.Async).pipe(O(l=>l)).subscribe(l=>{n.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(l,e,!n.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(Gt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return _.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(S(j),S(K),S(H),S(R))}}static{this.\u0275cmp=E({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),f(5,Yn,19,3,"ng-container",6),F(6,"async"),f(7,Zn,2,0,"ng-template",null,0,z),r()()()()()),n&2){let l,h=$(8);c("hideSearchBox",!0)("hideSearchDropdown",!0),a(5),c("ngIf",((l=N(6,4,e.channels$))==null||l.Data==null?null:l.Data.length)>0)("ngIfElse",h)}},dependencies:[V,k,B,pt,Tt,W,at,Mt,Xt],encapsulation:2})}}return i})();var qn=[{component:Me,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Ee,canActivate:[it],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Fe,canActivate:[it],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:Ne,canActivate:[it],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Ve,canActivate:[it],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:ke,canActivate:[it],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:Ae,canActivate:[it],data:{title:"Channel Statistic"}}]}],Ko=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=qt({type:i})}static{this.\u0275inj=Zt({imports:[rt,ct,oe,dt,ie,we,de,re,Bt,Y,tt,ee.forChild(qn),ye,he,_t]})}}return i})();export{Ko as StatusModule};
|