marketplacepos 5.41.4 → 5.41.5
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-FX6CFPPN.js → chunk-2BV355IK.js} +1 -1
- package/Marketplace/{chunk-AIIRPK4M.js → chunk-2VSUESZZ.js} +1 -1
- package/Marketplace/{chunk-HUMGZRJQ.js → chunk-56WGJNPW.js} +1 -1
- package/Marketplace/{chunk-B54QGLED.js → chunk-5DX5OS45.js} +2 -2
- package/Marketplace/{chunk-SL4ID42P.js → chunk-5LUTNBYZ.js} +1 -1
- package/Marketplace/{chunk-G5CQLP7H.js → chunk-64MZV5WU.js} +1 -1
- package/Marketplace/{chunk-LEMNVA5V.js → chunk-67JBJ45X.js} +1 -1
- package/Marketplace/{chunk-S7LCZRSD.js → chunk-6ZUAJPGL.js} +1 -1
- package/Marketplace/{chunk-7G53KEUW.js → chunk-72DJCVV6.js} +1 -1
- package/Marketplace/{chunk-VDSO2BHA.js → chunk-A5LJ5SMN.js} +1 -1
- package/Marketplace/{chunk-5FEQZAWX.js → chunk-BFYBCKXD.js} +1 -1
- package/Marketplace/{chunk-SZ6MQ6EW.js → chunk-BTYHZ3BG.js} +1 -1
- package/Marketplace/{chunk-HMB7FZD7.js → chunk-CCX62ZEW.js} +1 -1
- package/Marketplace/{chunk-DVE7IIN7.js → chunk-CGVOFFIH.js} +1 -1
- package/Marketplace/{chunk-BG6DO7RW.js → chunk-CNL3HZIH.js} +1 -1
- package/Marketplace/{chunk-L4JWBBBC.js → chunk-E2FP3UH3.js} +1 -1
- package/Marketplace/{chunk-LFJIZAV2.js → chunk-FBBW443I.js} +1 -1
- package/Marketplace/{chunk-3CZJUTLZ.js → chunk-FMUQPVVH.js} +1 -1
- package/Marketplace/{chunk-REYGC4GG.js → chunk-HDF7PEIR.js} +1 -1
- package/Marketplace/{chunk-O5SSMLCS.js → chunk-HGCZ7LIZ.js} +1 -1
- package/Marketplace/{chunk-HNYOBOEW.js → chunk-HIY3ODHB.js} +2 -2
- package/Marketplace/{chunk-TXPNZLOJ.js → chunk-J4K6QW3J.js} +1 -1
- package/Marketplace/{chunk-7P3SGW2P.js → chunk-JNXB7GCX.js} +1 -1
- package/Marketplace/{chunk-EYNCNJ3I.js → chunk-JPIOBYM7.js} +1 -1
- package/Marketplace/{chunk-UUUVVJG4.js → chunk-LIWNKZGW.js} +1 -1
- package/Marketplace/{chunk-LJTMOYLO.js → chunk-MZBZH6JP.js} +1 -1
- package/Marketplace/{chunk-KC2DJUBC.js → chunk-NN2JDRQD.js} +1 -1
- package/Marketplace/{chunk-4S4G5UPJ.js → chunk-PGHURUHZ.js} +1 -1
- package/Marketplace/{chunk-YPM6IC2W.js → chunk-PYD2QHHH.js} +1 -1
- package/Marketplace/{chunk-QJFAPDI7.js → chunk-QJIMFZTN.js} +1 -1
- package/Marketplace/{chunk-GCJBQRHI.js → chunk-QQJN7OGE.js} +1 -1
- package/Marketplace/{chunk-742J5UZZ.js → chunk-U2V4KOQS.js} +1 -1
- package/Marketplace/{chunk-Y7VC2AGS.js → chunk-VGEOTRB7.js} +1 -1
- package/Marketplace/{chunk-KOJ2R5XW.js → chunk-VQ4QGCSU.js} +1 -1
- package/Marketplace/{chunk-E3HHEPKQ.js → chunk-W7OL4JR7.js} +1 -1
- package/Marketplace/{chunk-K3FQGMAY.js → chunk-WKHHCF3P.js} +1 -1
- package/Marketplace/{chunk-OAVAVDIP.js → chunk-YCPKCFMZ.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-5HHAD6NX.js → main-UY5LIWLP.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as He}from"./chunk-PQ6Z7K5L.js";import{a as Te}from"./chunk-4S4G5UPJ.js";import"./chunk-MS4AQ6UA.js";import{a as K}from"./chunk-ZD5LURJS.js";import{a as De,b as Oe}from"./chunk-VSEWXNVC.js";import{a as ze}from"./chunk-PPDHTO44.js";import{a as at}from"./chunk-7KG3DC5J.js";import{b as Ge}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import{a as we,b as Me}from"./chunk-OE2JYQHN.js";import{e as xt}from"./chunk-AIIRPK4M.js";import{a as Ne}from"./chunk-VETHPEVU.js";import{i as Re,j as Be,k as je,l as $e,m as We}from"./chunk-75BDXSG3.js";import"./chunk-6NNAICJE.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as H}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 Gt}from"./chunk-J3P46Z53.js";import{a as q}from"./chunk-4ASUM4N5.js";import{b as Ke}from"./chunk-7FUVW73P.js";import{a as Ae,b as Ue}from"./chunk-M3SJUKTG.js";import{a as $t,b as Wt,c as Ee}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as st}from"./chunk-YPM6IC2W.js";import{a as rt}from"./chunk-62PFQNHJ.js";import{c as Fe,f as Ve}from"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import{a as Le}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as jt}from"./chunk-RIHLYYZU.js";import{f as ke}from"./chunk-Q2OEJFVT.js";import{a as gt,b as Lt,d as nt,e as xe}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as Se,l as G}from"./chunk-LEMNVA5V.js";import{b as $,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{b as Ct,c as ft,d as Z,e as ye,f as ve,g as be,h as Pe,i as Rt,j as St,k as Bt,m as z,n as Ie}from"./chunk-ITTRZMEX.js";import{r as it,s as ot}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as fe,c as ht,h as U,m as L,y as _t}from"./chunk-DPLEMBB4.js";import{b as I,c as f}from"./chunk-PXB4YEY3.js";import{E as At,F as ge,G as et,H as Ut,J as Ce,d as Nt,f as A,g as V,j as mt,k as _e,m as ut,n as Y}from"./chunk-GPEVUTDI.js";import{$c as he,Dc as B,Eb as M,Ec as p,Fb as de,Fc as N,G as F,Gc as y,Ic as T,Jc as D,Ka as It,Kb as C,Kc as O,Pc as ct,Qa as wt,Qc as Q,Rc as Xt,Tc as ue,Vb as Yt,Wb as l,Xb as pe,Z as re,Zc as k,_c as E,aa as Ft,ad as j,bc as lt,ca as Jt,cc as Zt,ea as le,ec as qt,f as ae,fc as Qt,gc as o,hc as a,ic as _,jc as b,ka as ce,kc as P,mc as x,nb as se,ob as w,pa as tt,qb as r,rc as g,sc as s,tc as me,uc as Vt,v as Et,wb as S,ya as m,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var ln=()=>["/menu/products/download/by-url"],Je=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),a()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),a(),o(8,"div",6)(9,"div",7)(10,"a",8),p(11,"Download Product By Url"),a()()()()()(),_(12,"router-outlet")),n&2&&(r(3),l("Tabs",e.productTabs),r(7),l("routerLink",ct(2,ln)))},dependencies:[we,ge,Ut],encapsulation:2})}}return i})();function cn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function sn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function dn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function pn(i,d){if(i&1){let t=x();o(0,"div",12)(1,"label",13),p(2,"Scan Type"),a(),o(3,"mat-radio-group",14),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.ScanFull,e)||(c.filter.ScanFull=e),u(e)}),o(4,"mat-radio-button",15),p(5," Full (Include Inactive Products) "),a(),o(6,"mat-radio-button",16),p(7," Active "),a()()()}if(i&2){let t=s();r(3),T("ngModel",t.filter.ScanFull),r(),l("value",!0),r(2),l("value",!1)}}function mn(i,d){i&1&&(o(0,"span"),p(1,"Never"),a())}function un(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"async"),a()),i&2){let t=s(2);r(),N(E(2,1,t.lastSync$))}}function hn(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5)(2,"span",17),p(3,"Last Scan:"),a(),C(4,mn,2,0,"span"),k(5,"async"),C(6,un,3,3,"span"),a(),o(7,"mat-radio-group",18),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.UpdatedProduct,e)||(c.filter.UpdatedProduct=e),u(e)}),o(8,"mat-radio-button",19),p(9," Scan All Products "),a(),o(10,"mat-radio-button",20),p(11),a()()()}if(i&2){let t=s();r(4),lt(E(5,6,t.lastSync$)==null?4:6),r(3),T("ngModel",t.filter.UpdatedProduct),r(),l("value",!1),r(2),l("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"),r(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function _n(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5),p(2," Scan Option "),a(),o(3,"mat-radio-group",21),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.Async,e)||(c.filter.Async=e),u(e)}),o(4,"mat-radio-button",22),p(5," Asynchronous (Get Notified when Complete) "),a(),o(6,"mat-radio-button",23),p(7," Synchronous (Wait until Complete) "),a()()()}if(i&2){let t=s();r(3),T("ngModel",t.filter.Async),r(),l("value",!0),r(2),l("value",!1)}}var R=(()=>{class i{constructor(t,n,e){this.dialogRef=t,this.data=n,this.router=e,this.channelService=tt(Te),this.channelType=I,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!1,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new St,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(Et(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),re(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.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 f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(S(Ct),S(ft),S(et))}}static{this.\u0275cmp=M({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 c=x();o(0,"modal-material",2),g("onOk",function(){return m(c),u(e.submit())})("onClose",function(){return m(c),u(e.onClose())})("onCancel",function(){return m(c),u(e.onClose())}),o(1,"div",3)(2,"div",4)(3,"label",5),p(4,"Select a Channel"),a(),o(5,"p-select",6),O("ngModelChange",function(v){return m(c),D(e.filter.ChannelID,v)||(e.filter.ChannelID=v),u(v)}),g("ngModelChange",function(v){return m(c),u(e.onSelectChannel(v))}),C(6,cn,4,3,"ng-template",null,0,j)(8,sn,4,3,"ng-template",null,1,j)(10,dn,4,3,"ng-template",null,1,j),a(),C(12,pn,8,3,"div",7)(13,hn,12,8,"div",8)(14,_n,8,3,"div",9),a()()()}n&2&&(l("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),r(5),l("options",e.channelOptions),T("ngModel",e.filter.ChannelID),l("filter",!0),r(7),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),r(),lt(e.hasScanUpdate&&e.selectedChannel?13:-1),r(),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[Y,V,mt,Oe,De,_t,U,L,Bt,jt,Wt,ot,it,Ve,$t],encapsulation:2})}}return i})();var pt=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(pt||{});var ee={Success:"Success",Info:"Info",Warning:"Warning",Error:"Error"};var gn=[[["header"]],[["content"]],[["footer"]]],Cn=["header","content","footer"],fn=(i,d)=>({bodyScrollable:i,hideScrollbar:d}),Sn=(i,d,t,n)=>({"bg-success":i,"bg-warning":d,"bg-info":t,"bg-danger":n}),xn=i=>({"mx-auto":i}),yn=(i,d)=>({"show-footer":i,"p-0":d});function vn(i,d){if(i&1){let t=x();o(0,"div",8),g("click",function(){m(t);let e=s();return u(e.onBack.emit())}),o(1,"a",9),_(2,"i",10),a()()}}function bn(i,d){if(i&1){let t=x();o(0,"div")(1,"a",11),g("click",function(){m(t);let e=s();return u(e.onClose.emit())}),_(2,"i",12),a()()}}function Pn(i,d){if(i&1){let t=x();o(0,"a",16),g("click",function(){m(t);let e=s(2);return u(e.onCancel.emit())}),p(1),a()}if(i&2){let t=s(2);r(),y(" ",t.config!=null&&t.config.cancelText?t.config==null?null:t.config.cancelText:"Cancel","")}}function In(i,d){if(i&1){let t=x();o(0,"button",17),g("click",function(){m(t);let e=s(2);return u(e.onOk.emit())})("keyup.F2",function(){m(t);let e=s(2);return u(e.onOk.emit())}),a()}if(i&2){let t=s(2);l("disabled",!(t.config!=null&&t.config.validated)||!t.dynamicValidated)("innerHTML",t.config!=null&&t.config.okText?t.config==null?null:t.config.okText:"Ok (F2)",se)}}function wn(i,d){if(i&1&&(o(0,"mat-dialog-actions",13),Vt(1,2),C(2,Pn,2,1,"a",14)(3,In,1,2,"button",15),a()),i&2){let t=s();r(2),l("ngIf",!(t.config!=null&&t.config.hideCancel)),r(),l("ngIf",!(t.config!=null&&t.config.hideOk))}}var ne=class{constructor(){this.title="New Modal",this.okText="Ok (F2)",this.cancelText="Cancel",this.hideFooter=!1,this.hideCancel=!1,this.hideOk=!1,this.hideClose=!1,this.eMoney=!1,this.headerType=ee.Success,this.validated=!0,this.customWidth="initial",this.bodyScrollable=!1,this.hideScrollbar=!1,this.disableKeyup=!1,this.noPadding=!1}},Ye=(()=>{class i{constructor(){this.dynamicValidated=!0,this.onOk=new It,this.onCancel=new It,this.onClose=new It,this.onBack=new It,this.headerType=ee}ngOnInit(){this.config==null&&(this.config=new ne)}onKeyup(t){this.config?.disableKeyup||(t.code=="F2"&&this.onOk.emit("F2"),(t.code=="Enter"||t.code=="NumpadEnter")&&this.onOk.emit("Enter"))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["modal-material"]],inputs:{config:"config",dynamicValidated:"dynamicValidated"},outputs:{onOk:"onOk",onCancel:"onCancel",onClose:"onClose",onBack:"onBack"},ngContentSelectors:Cn,decls:11,vars:23,consts:[["id","modal_material",1,"modal-material","d-flex","align-items-start","flex-column","position-relative","maxHeight",3,"keyup","ngClass"],["mat-dialog-title","",1,"d-flex","w-100","justify-content-between","modal-header","position-relative",3,"ngClass"],["class","back-button position-absolute pointer d-print-none",3,"click",4,"ngIf"],[1,"d-flex","flex-row","d-print-none","align-items-center",3,"ngClass"],[1,"fw-normal"],[4,"ngIf"],[1,"modal-body","w-100",3,"ngClass"],["class","w-100 py-7 border-top d-flex justify-content-end d-print-none",4,"ngIf"],[1,"back-button","position-absolute","pointer","d-print-none",3,"click"],[1,"btn","back-button"],[1,"fa-solid","fa-arrow-left"],[1,"btn-light-blue","btn-sm","pointer","close",3,"click"],[1,"fa-solid","fa-xmark","fa-lg","text-primary"],[1,"w-100","py-7","border-top","d-flex","justify-content-end","d-print-none"],["class","btn btn-light-blue text-primary btn-lg fw-bold mx-3",3,"click",4,"ngIf"],["class","btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3","data-cy","btn-ok",3,"disabled","innerHTML","click","keyup.F2",4,"ngIf"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],["data-cy","btn-ok",1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click","keyup.F2","disabled","innerHTML"]],template:function(n,e){n&1&&(me(gn),o(0,"div",0),g("keyup",function(h){return e.onKeyup(h)}),o(1,"div",1),C(2,vn,3,0,"div",2),o(3,"div",3)(4,"h4",4),p(5),a(),Vt(6),a(),C(7,bn,3,0,"div",5),a(),o(8,"mat-dialog-content",6),Vt(9,1),a(),C(10,wn,4,2,"mat-dialog-actions",7),a()),n&2&&(pe("width",e.config==null?null:e.config.customWidth),l("ngClass",Xt(10,fn,e.config==null?null:e.config.bodyScrollable,e.config==null?null:e.config.hideScrollbar)),r(),l("ngClass",ue(13,Sn,e.headerType.Success==(e.config==null?null:e.config.headerType),e.headerType.Warning==(e.config==null?null:e.config.headerType),e.headerType.Info==(e.config==null?null:e.config.headerType),e.headerType.Error==(e.config==null?null:e.config.headerType))),r(),l("ngIf",e.config==null?null:e.config.eMoney),r(),l("ngClass",Q(18,xn,e.config==null?null:e.config.eMoney)),r(2),N(e.config==null?null:e.config.title),r(2),l("ngIf",!(e.config!=null&&e.config.hideClose)),r(),l("ngClass",Xt(20,yn,!(e.config!=null&&e.config.hideFooter),e.config==null?null:e.config.noPadding)),r(2),l("ngIf",!(e.config!=null&&e.config.hideFooter)))},dependencies:[Y,Nt,V,Pe,ye,be,ve],styles:[".mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important} .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{ .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{ .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body[_ngcontent-%COMP%]{width:100vw!important}}body.modal-body[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}mat-dialog-actions[_ngcontent-%COMP%]{bottom:15px}mat-dialog-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:15px!important;margin-right:12px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:15px!important}mat-dialog-actions[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button[_ngcontent-%COMP%]{top:5px;left:0}.close[_ngcontent-%COMP%]{padding:.4rem .5rem}.no-padding[_ngcontent-%COMP%]{padding:0}.modal-material[_ngcontent-%COMP%]{width:40vw}@media (max-width: 992px){.modal-material[_ngcontent-%COMP%]{width:50vw!important}}@media (max-width: 576px){ .dialog-filter .modal-material{width:100%!important} .dialog-filter mat-dialog-actions{position:sticky;bottom:0;background:#fff} .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow-y:auto}.modal-header[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:15px}.modal-dialog[_ngcontent-%COMP%]{max-width:none}.modal-content[_ngcontent-%COMP%]{width:auto;margin:auto;max-width:850px}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow:auto}.modal-body[_ngcontent-%COMP%]{padding:1rem}.modal-body[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block}.modal-body[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin:0;position:absolute;bottom:-20px}.modal-body[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] input[type=password][_ngcontent-%COMP%]{border:1px solid #c8d3df;padding:5px 7px}.modal-body[_ngcontent-%COMP%] table[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:330px;height:90px}"]})}}return i})();var Mn=i=>({"is-disabled":i});function Tn(i,d){if(i&1&&(b(0),o(1,"tr")(2,"td",10),p(3),a(),o(4,"td",10),p(5),a(),o(6,"td",11)(7,"p",12),p(8,"Product Not in Channel!"),a()()(),P()),i&2){let t=s().$implicit;r(3),y(" ",t==null?null:t.Model," "),r(2),y(" ",t==null?null:t.Code," ")}}function Dn(i,d){if(i&1&&(o(0,"td",10),p(1),a()),i&2){let t=s(3).$implicit;Yt("rowspan",t.Channel.length),r(),y(" ",t==null?null:t.Model," ")}}function On(i,d){if(i&1&&(o(0,"td",10),p(1),a()),i&2){let t=s(3).$implicit;Yt("rowspan",t.Channel.length),r(),y(" ",t==null?null:t.Code," ")}}function kn(i,d){if(i&1){let t=x();o(0,"tr"),C(1,Dn,2,2,"td",13)(2,On,2,2,"td",13),o(3,"td",10)(4,"div",14)(5,"a",15),_(6,"img",16),a(),o(7,"div",17),p(8),a()()(),o(9,"td",10),p(10),k(11,"number"),a(),o(12,"td",18),p(13),k(14,"number"),a(),o(15,"td",19)(16,"div",20)(17,"button",21),g("click",function(){let e=m(t).$implicit,c=s(2).$implicit,h=s();return u(h.onDetach(e,c))}),_(18,"i",22),o(19,"span",23),p(20,"Detach"),a()(),o(21,"a",24),_(22,"i",25),o(23,"span",23),p(24,"Edit"),a()()()()()}if(i&2){let t=d.$implicit,n=d.$index,e=s(3);r(),l("ngIf",n==0),r(),l("ngIf",n==0),r(3),l("href",t.Url,w)("title",t.Title),r(),l("src",e.getChannelLogo(t.TypeID),w),r(),l("matTooltip",(t==null||t.Name==null?null:t.Name.length)>40?t==null?null:t.Name:""),r(),y(" ",t.Name," "),r(2),N(E(11,12,t.Price)),r(3),N(E(14,14,t.Inventory)),r(8),l("href",e.getHyperlinkSellerCenter(t),w)("ngClass",Q(16,Mn,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function En(i,d){if(i&1&&qt(0,kn,25,18,"tr",null,Zt),i&2){let t=s().$implicit;Qt(t==null?null:t.Channel)}}function Fn(i,d){if(i&1&&C(0,Tn,9,2,"ng-container",9)(1,En,2,0,"ng-template",null,0,j),i&2){let t=d.$implicit,n=B(2);l("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var zt=(()=>{class i{constructor(t,n){this.data=t,this.dialogRef=n,this.httpService=tt(W),this.toastr=tt($),this.variants=wt([]),this.channelType=I,this.variants.set(this.data.variants),this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new St,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="850px"}onDetach(t,n){let e={ChannelID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariationID:t.ChannelVariationID};this.httpService.post(Se.DetachVariant,[e]).subscribe(c=>{this.toastr.success(c.Message,"Success"),this.updateVariantAfterDetach(n,t.ChannelVariationID)})}updateVariantAfterDetach(t,n){this.variants.update(e=>{let c=e.findIndex(h=>h.ID===t.ID);return c!==-1&&(e[c].Channel=e[c].Channel.filter(h=>h.ChannelVariationID!==n)),[...e]})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case I.Shopee:n=`${pt.Shoope}/portal/product/${t.ChannelItemID}`;break;case I.Tiktok:n=`${pt.Tiktok}/product/edit/${t.ChannelItemID}`;break;case I.Tokopedia:n=`${pt.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case I.WooCommerce:n=`${pt.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case I.Lazada:n=`${pt.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||i)(S(ft),S(Ct))}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-variant"]],decls:27,vars:1,consts:[["printChannelModal",""],[3,"onClose","onCancel","config"],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],[1,"d-flex","align-items-center"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"btn","btn-small","btn-light","px-4","py-2","me-3",3,"click"],[1,"fa-sharp","fa-link-slash","me-2",2,"font-size","10px"],[1,"fs-6"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-edit","me-2",2,"font-size","10px"]],template:function(n,e){n&1&&(o(0,"modal-material",1),g("onClose",function(){return e.dialogRef.close()})("onCancel",function(){return e.dialogRef.close()}),o(1,"content")(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4)(6,"div",5)(7,"span"),p(8,"VARIANT"),a(),o(9,"sup"),_(10,"i",6),a()()(),o(11,"th",4),p(12,"SKU"),a(),o(13,"th",4)(14,"div",5)(15,"span"),p(16,"PRODUCT"),a(),o(17,"sup"),_(18,"i",7),a()()(),o(19,"th",4),p(20,"PRICE"),a(),o(21,"th",8),p(22,"INVENTORY"),a(),_(23,"th",4),a()(),o(24,"tbody"),qt(25,Fn,3,2,null,null,Zt),a()()()()),n&2&&(l("config",e.modalConfig),r(25),Qt(e.variants()))},dependencies:[Y,Nt,V,ut,ot,it,Ye],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return i})();function Vn(i,d){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),p(4),a()()()),i&2){let t=d.$implicit;l("value",t.ChannelID),r(2),l("src",t.logo,w),r(2),N(t.Title)}}var bt=(()=>{class i{constructor(){this.dialogRef=tt(Ct),this.channels=tt(ft),this.channelIds=wt([]),this.channelOptions=wt([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,c)=>c.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new St,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),p(4,"Select a Channel"),a(),o(5,"mat-form-field",3)(6,"mat-select",4),O("ngModelChange",function(h){return D(e.channelIds,h)||(e.channelIds=h),h}),C(7,Vn,5,3,"mat-option",5),a()()()()()),n&2&&(l("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),r(6),T("ngModel",e.channelIds),l("multiple",!0),r(),l("ngForOf",e.channelOptions()))},dependencies:[Y,A,Bt,jt,ke,Ue,Ae,Fe,_t,U,L,ot],encapsulation:2})}}return i})();function Nn(i,d){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),p(2),a()}if(i&2){let t,n=s();r(2),y("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function An(i,d){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),p(2," Scan Channel "),a()}}function Un(i,d){if(i&1&&(b(0),C(1,An,3,0,"button",15),P()),i&2){let t=s();r(),l("ngIf",!t.productService.hasSelection(t.products))}}function Ln(i,d){if(i&1){let t=x();b(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Rn(i,d){if(i&1){let t=x();b(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Bn(i,d){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),a()()}if(i&2){let t=d.$implicit,n=s();r(),l("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 jn(i,d){i&1&&(b(0),o(1,"div",23),_(2,"app-empty-state"),a(),P())}function $n(i,d){if(i&1){let t=x();b(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()(),P()}if(i&2){let t=s();r(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var Qe=(()=>{class i{constructor(t,n,e,c,h,v,Pt){this.http=t,this.toastr=n,this.dialog=e,this.productService=c,this.authService=h,this.uploadProductService=v,this.route=Pt,this.searchFilter=new at,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=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(zt,{data:{title:this.products[t].Name,variants:n}})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok]);this.dialog.open(R,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(c=>f.IsNotEmpty(c))).subscribe(c=>{this.searchFilter.ChannelID=c.ChannelID,this.searchFilter.ScanFull=c.ScanFull,this.searchFilter.UpdatedProduct=c.UpdatedProduct;let h=this.productService.selectedProduct(this.products),v=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(v)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(c)})}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=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.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=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(bt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Ft(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Rt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(W),S($),S(Z),S(H),S(G),S(xt),S(et))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let c=x();o(0,"mainpanel",1),g("onSubmit",function(v){return m(c),u(e.searchProduct(v))}),o(1,"actions"),C(2,Nn,3,1,"button",2)(3,Un,2,1,"ng-container",3)(4,Ln,4,1,"ng-container",3)(5,Rn,4,1,"ng-container",3),a(),o(6,"filters")(7,"div")(8,"label",4),p(9,"Category"),a(),o(10,"ng-select",5),g("ngModelChange",function(v){return m(c),u(e.searchFilter.Category=v)}),a()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),O("ngModelChange",function(v){return m(c),D(e.startDate,v)||(e.startDate=v),u(v)}),g("click",function(){m(c);let v=B(16);return u(v.open())}),a(),o(14,"input",9),O("ngModelChange",function(v){return m(c),D(e.endDate,v)||(e.endDate=v),u(v)}),g("click",function(){m(c);let v=B(16);return u(v.open())}),a()(),_(15,"mat-date-range-picker",null,0),a()(),o(17,"content")(18,"div",10)(19,"div",11),C(20,Bn,2,11,"div",12)(21,jn,3,0,"ng-container",3),a(),C(22,$n,4,5,"ng-container",3),a()()()}if(n&2){let c=B(16);l("headerTitle","In POS ("+e.rowCount+")"),r(2),lt(e.productService.hasSelection(e.products)?2:-1),r(),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),r(2),l("rangePicker",c),r(),T("ngModel",e.startDate),r(),T("ngModel",e.endDate),r(6),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",e.products.length>0)}},dependencies:[A,V,ht,U,L,z,nt,q,rt,K,Re,Be,je,$e],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Wn(i,d){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),p(2),a()}if(i&2){let t,n=s();r(2),y("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Gn(i,d){if(i&1){let t=x();b(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),p(3," Scan Channel "),a(),P()}}function zn(i,d){if(i&1){let t=x();b(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),p(3),a(),P()}if(i&2){let t=s();r(3),y(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Hn(i,d){if(i&1){let t=x();b(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),p(3),a(),P()}if(i&2){let t=s();r(3),y(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function Kn(i,d){if(i&1&&(o(0,"span",18),_(1,"img",19),a(),p(2)),i&2){let t=d.item;r(),l("src",t.Img,w)("alt",t.Name),r(),y(" ",t.Name," ")}}function Jn(i,d){if(i&1){let t=x();o(0,"div",20)(1,"label",21),p(2,"Item ID"),a(),o(3,"input",22),O("ngModelChange",function(e){m(t);let c=s();return D(c.searchFilter.Item_id,e)||(c.searchFilter.Item_id=e),u(e)}),a()()}if(i&2){let t=s();r(3),T("ngModel",t.searchFilter.Item_id)}}function Yn(i,d){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),a()()}if(i&2){let t=d.$implicit,n=s();r(),l("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 Zn(i,d){i&1&&(b(0),o(1,"div",25),_(2,"app-empty-state"),a(),P())}function qn(i,d){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()()}if(i&2){let t=s();r(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var Xe=(()=>{class i{constructor(t,n,e,c,h,v,Pt,kt){this.http=t,this.dialog=n,this.toastr=e,this.productService=c,this.activateRouter=h,this.authService=v,this.route=Pt,this.uploadProductService=kt,this.searchFilter=new at,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=f.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(zt,{data:{variants:n,title:this.products[t].Name}})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(F(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(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(R,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanProducts(c)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(R,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let c=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(c);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=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.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=f.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(bt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Ft(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Rt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(Z),S($),S(H),S(At),S(G),S(et),S(xt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),C(2,Wn,3,1,"button",1)(3,Gn,4,0,"ng-container",2)(4,zn,4,1,"ng-container",2)(5,Hn,4,1,"ng-container",2),a(),o(6,"filters")(7,"div")(8,"label",3),p(9,"Channel"),a(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),C(11,Kn,3,3,"ng-template",5),a()(),C(12,Jn,4,1,"div",6),a(),o(13,"content")(14,"div",7)(15,"div",8),C(16,Yn,2,11,"div",9)(17,Zn,3,0,"ng-container",2),a(),C(18,qn,3,4,"div",10),a()()()),n&2&&(l("headerTitle","Sold in Channel"),r(2),lt(e.productService.hasSelection(e.products)?2:-1),r(),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),r(2),l("ngIf",e.searchFilter.ListChannelID!=null),r(4),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",e.products==null?null:e.products.length))},dependencies:[A,V,ht,U,L,z,nt,gt,Lt,q,rt,K],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 Qn(i,d){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),p(2),a()}if(i&2){let t=s(2);r(2),y(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function Xn(i,d){if(i&1){let t=x();b(0),o(1,"td",29)(2,"input",30),O("ngModelChange",function(e){m(t);let c=s(2).$implicit;return D(c.selected,e)||(c.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,c=s(3);return u(c.onSelectProduct(e))}),a()(),P()}if(i&2){let t=s(2).$implicit;r(),l("rowSpan",t==null?null:t.Variants.length),r(),T("ngModel",t.selected)}}function ti(i,d){if(i&1){let t=x();b(0),o(1,"img",35),g("click",function(e){m(t);let c=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,c==null?null:c.ImageUrl))}),a(),P()}if(i&2){let t=s(3).$implicit;r(),l("src",t==null?null:t.ImageUrl,w)}}function ei(i,d){i&1&&_(0,"img",36)}function ni(i,d){if(i&1&&(b(0),o(1,"td",29)(2,"div",31),C(3,ti,2,1,"ng-container",11)(4,ei,1,0,"ng-template",null,1,j),a()(),o(6,"td",32)(7,"h4",33)(8,"span",34),p(9),a()()(),P()),i&2){let t=B(5),n=s(2).$implicit;r(),l("rowSpan",n==null?null:n.Variants.length),r(2),l("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),r(3),l("rowSpan",n==null?null:n.Variants.length),r(2),l("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),r(),y(" ",n==null?null:n.Name," ")}}function ii(i,d){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),a()()),i&2){let t=d.$implicit;r(),l("href",t.URL,w),r(),l("src",t.Img,w)("matTooltip",t.Name)}}function oi(i,d){if(i&1&&(o(0,"div"),_(1,"img",37),a()),i&2){let t=d.$implicit;r(),l("src",t.Img,w)("matTooltip",t.Name)}}function ai(i,d){if(i&1&&(o(0,"tr"),C(1,Xn,3,2,"ng-container",12)(2,ni,10,6,"ng-container",12),o(3,"td"),p(4),a(),o(5,"td")(6,"span"),p(7),a(),o(8,"span",24)(9,"a",25),_(10,"i",26),a()()(),o(11,"td",27)(12,"div",28),C(13,ii,3,3,"div",23),a()(),o(14,"td",27)(15,"div",28),C(16,oi,2,2,"div",23),a()()()),i&2){let t=d.$implicit,n=d.index,e=s(5);r(),l("ngIf",n==0),r(),l("ngIf",n==0),r(2),y(" ",t.Name," "),r(3),y(" ",t.Code," "),r(2),l("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),w),r(4),l("ngForOf",t==null?null:t.Available),r(3),l("ngForOf",t==null?null:t.NotAvailable)}}function ri(i,d){if(i&1&&(b(0),C(1,ai,17,7,"tr",23),P()),i&2){let t=d.$implicit;r(),l("ngForOf",t.Variants)}}function li(i,d){if(i&1&&(o(0,"tbody"),C(1,ri,2,1,"ng-container",23),a()),i&2){let t=d.ngIf;r(),l("ngForOf",t)}}function ci(i,d){if(i&1&&(b(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),p(7,"Product"),a(),o(8,"th",20),p(9,"Variant"),a(),o(10,"th",20),p(11,"SKU"),a(),o(12,"th",21),p(13,"Available In"),a(),o(14,"th",22),p(15,"Not Available In"),a()()(),C(16,li,2,1,"tbody",12),k(17,"async"),a()(),P()),i&2){let t=s(2);r(16),l("ngIf",E(17,1,t.data$))}}function si(i,d){i&1&&(o(0,"div",38),_(1,"app-empty-state"),a())}function di(i,d){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),p(2,"?"),a()()}}function pi(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"number"),a()),i&2){let t=d.ngIf;r(),N(E(2,1,t==null?null:t.Count))}}function mi(i,d){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),p(2," Next"),a()}}function ui(i,d){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),p(2," Last"),a()}}function hi(i,d){if(i&1&&(b(0),o(1,"div",39)(2,"div",40)(3,"div",41),p(4),k(5,"number"),C(6,di,3,0,"span",42)(7,pi,3,3,"span",12),k(8,"async"),p(9),a()(),o(10,"div",43),C(11,mi,3,0,"a",44)(12,ui,3,0,"a",45),a()(),P()),i&2){let t=s().ngIf,n=s(2);r(4),y(" Showing 1 - ",E(5,6,t==null?null:t.length)," of "),r(2),l("ngIf",n.paginationService.hideCount),r(),l("ngIf",!n.paginationService.hideCount&&E(8,8,n.rowCount$)),r(2),y(" records ~ ",n.paginationService.footerPageNumber," Page "),r(2),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),r(),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function _i(i,d){if(i&1&&(b(0),C(1,hi,13,10,"ng-container",12),P()),i&2){let t=d.ngIf;r(),l("ngIf",(t==null?null:t.length)>0)}}function gi(i,d){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let c=s();return u(c.searchProduct(e))}),o(1,"actions"),C(2,Qn,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),p(5," Scan Channel "),a(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),p(9,"Export"),a()()(),o(10,"content")(11,"div",9)(12,"div",10),C(13,ci,18,3,"ng-container",11),k(14,"async"),C(15,si,2,0,"ng-template",null,0,j),a(),C(17,_i,2,1,"ng-container",12),k(18,"async"),a()()()}if(i&2){let t,n=B(16),e=s();l("hideSearchDropdown",!0),r(2),l("ngIf",e.hasSelectionProduct),r(11),l("ngIf",((t=E(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),r(4),l("ngIf",E(18,7,e.data$))}}var tn=(()=>{class i{constructor(t,n,e,c,h,v,Pt,kt,rn){this.http=t,this.dialog=n,this.toastr=e,this.route=c,this.productService=h,this.paginationService=v,this.biggerPictureService=Pt,this.authService=kt,this.uploadProductService=rn,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=kt.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(le(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Et(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=f.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=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(Ge,{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(W),S(Z),S($),S(et),S(H),S(ze),S(Le),S(G),S(xt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(C(0,gi,19,9,"mainpanel",2),k(1,"async")),n&2&&l("ngIf",E(1,1,e.loader$))},dependencies:[A,V,fe,U,L,z,it,K,mt,ut],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 Ci=i=>[i],fi=()=>[];function Si(i,d){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),p(2," Scan Channel "),a()}}function xi(i,d){if(i&1){let t=x();b(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function yi(i,d){if(i&1&&(o(0,"span",19),_(1,"img",20),a(),p(2)),i&2){let t=d.item;r(),l("src",t.Img,w)("alt",t.Name),r(),y(" ",t.Name," ")}}function vi(i,d){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let c=m(t).index,h=s();return u(h.onSelectProduct(e,c))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,c=s();return u(c.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanChannel(e))}),a()()}if(i&2){let t=d.$implicit;r(),l("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?Q(10,Ci,t==null?null:t.Channel):ct(12,fi))("showCheckBox",!0)("scanButton",!0)}}function bi(i,d){i&1&&(b(0),o(1,"div",23),_(2,"app-empty-state"),a(),P())}function Pi(i,d){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()()}if(i&2){let t=s();r(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var en=(()=>{class i{constructor(t,n,e,c,h,v){this.http=t,this.dialog=n,this.productService=e,this.toastrService=c,this.activateRouter=h,this.authService=v,this.searchFilter=new at,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(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?f.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=f.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(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(f.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(f.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(He,{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(W),S(Z),S(H),S($),S(At),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),C(2,Si,3,0,"button",1)(3,xi,4,1,"ng-container",2),a(),o(4,"filters")(5,"div")(6,"label",3),p(7,"Channel"),a(),o(8,"ng-select",4),O("ngModelChange",function(h){return D(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),C(9,yi,3,3,"ng-template",5),a()(),o(10,"div",6)(11,"label",7),p(12,"SKU Assigned"),a(),o(13,"mat-radio-group",8),O("ngModelChange",function(h){return D(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),p(15," All "),a(),o(16,"mat-radio-button",9),p(17," Yes "),a(),o(18,"mat-radio-button",9),p(19," No "),a()()(),o(20,"div",6)(21,"label",7),p(22,"Item ID"),a(),o(23,"input",10),O("ngModelChange",function(h){return D(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),a()()(),o(24,"content")(25,"div",11)(26,"div",12),C(27,vi,2,13,"div",13)(28,bi,3,0,"ng-container",2),a(),C(29,Pi,3,4,"div",14),a()()()),n&2&&(r(2),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("items",e.channelOptions),T("ngModel",e.searchFilter.ChannelID),r(5),T("ngModel",e.searchFilter.HaveSku),r(),l("value",0),r(2),l("value",1),r(2),l("value",2),r(5),T("ngModel",e.searchFilter.Item_id),r(4),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[A,V,ht,U,L,z,nt,gt,$t,Wt,q,rt,K],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 Ii(i,d){if(i&1&&(o(0,"span",9),_(1,"img",10),a(),p(2)),i&2){let t=d.item,n=s();r(),l("src",n.getChannelLogo(t.TypeID),w),r(),y(" ",t.Name," ")}}function wi(i,d){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),a()),i&2){let t=d.$implicit,n=d.index;r(),l("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function Mi(i,d){i&1&&(b(0),o(1,"div",13),_(2,"app-empty-state"),a(),P())}function Ti(i,d){if(i&1){let t=x();b(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),a()()(),P()}if(i&2){let t=s();r(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var nn=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new at,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=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(H),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),p(5,"Channel"),a(),o(6,"ng-select",3),O("ngModelChange",function(h){return D(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),C(7,Ii,3,2,"ng-template",4),a()()()(),o(8,"content")(9,"div",5)(10,"div",6),C(11,wi,2,6,"div",7)(12,Mi,3,0,"ng-container",8),a(),C(13,Ti,4,4,"ng-container",8),a()()()),n&2&&(r(6),l("multiple",!0)("clearable",!0)("items",e.channelOptions),T("ngModel",e.searchFilter.ListChannelID),r(5),l("ngForOf",e.products),r(),l("ngIf",(e.products==null?null:e.products.length)==0),r(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[A,V,U,L,z,nt,gt,Lt,Gt,q,K],encapsulation:2})}}return i})();var Di=()=>["/menu/products/status/sold-in-channel"],on=i=>({ID:i}),Oi=()=>["/menu/products/status/not-in-pos"];function ki(i,d){if(i&1&&(b(0),p(1),P()),i&2){let t=s().$implicit;r(),y(" ",t.Count," ")}}function Ei(i,d){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,c=s(2);return u(c.getLiveProductCount(e.ID,e))}),_(1,"i",27),a()}}function Fi(i,d){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),p(4),a()(),o(5,"td",19),C(6,ki,2,1,"ng-container",6)(7,Ei,2,0,"ng-template",null,1,j),a(),o(9,"td",19)(10,"a",20),p(11),k(12,"number"),a()(),o(13,"td",19)(14,"a",20),p(15),k(16,"number"),a()(),o(17,"td"),p(18),k(19,"date"),a(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,c=s(2);return u(c.onScanChannel(e))}),_(23,"i",23),p(24," Scan "),a(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,c=s(2);return u(c.onClearCache(e.ID))}),_(26,"i",25),p(27," Clear "),a()()()()}if(i&2){let t=d.$implicit,n=B(8),e=s(2);r(2),l("src",e.getChannelLogo(t.TypeID),w),r(2),N(t.Name),r(2),l("ngIf",t.Count!==void 0)("ngIfElse",n),r(4),l("routerLink",ct(18,Di))("queryParams",Q(19,on,t.ID)),r(),y(" ",E(12,11,t.SoldInChannel)," "),r(3),l("routerLink",ct(21,Oi))("queryParams",Q(22,on,t.ID)),r(),y(" ",E(16,13,t.NotInPOS)," "),r(3),y("",t.LastSync?he(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Vi(i,d){if(i&1&&(b(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),p(6,"Channel"),a(),o(7,"th",11),p(8,"Live Product"),a(),o(9,"th",12),p(10,"Sold In Channel"),a(),o(11,"th",13),p(12,"Product Not in POS"),a(),o(13,"th",14),p(14,"Last Sync"),a(),_(15,"th",15),a()(),o(16,"tbody"),C(17,Fi,28,24,"tr",16),k(18,"async"),a()()(),P()),i&2){let t,n=s();r(17),l("ngForOf",(t=E(18,1,n.channels$))==null?null:t.Data)}}function Ni(i,d){i&1&&(o(0,"div",28),_(1,"app-empty-state"),a())}var an=(()=>{class i{constructor(t,n,e,c){this.productService=t,this.toastr=n,this.dialog=e,this.authService=c,this.destroy$=new ae,this.channelOptions=c.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(Jt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(R,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(F(n=>f.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(F(c=>c)).subscribe(c=>{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(c,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(Jt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(S(H),S($),S(Z),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),C(5,Vi,19,3,"ng-container",6),k(6,"async"),C(7,Ni,2,0,"ng-template",null,0,j),a()()()()()),n&2){let c,h=B(8);l("hideSearchBox",!0)("hideSearchDropdown",!0),r(5),l("ngIf",((c=E(6,4,e.channels$))==null||c.Data==null?null:c.Data.length)>0)("ngIfElse",h)}},dependencies:[A,V,z,it,Ut,K,mt,ut,_e],encapsulation:2})}}return i})();var Ai=[{component:Je,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Qe,canActivate:[st],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Xe,canActivate:[st],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:tn,canActivate:[st],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:en,canActivate:[st],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:nn,canActivate:[st],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:an,canActivate:[st],data:{title:"Channel Statistic"}}]}],nr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=de({type:i})}static{this.\u0275inj=ce({imports:[Y,_t,Ie,ot,xe,Ke,Ee,Me,Gt,q,rt,Ce.forChild(Ai),We,Ne,bt]})}}return i})();export{nr as StatusModule};
|
|
1
|
+
import{a as He}from"./chunk-PQ6Z7K5L.js";import{a as Te}from"./chunk-PGHURUHZ.js";import"./chunk-MS4AQ6UA.js";import{a as K}from"./chunk-ZD5LURJS.js";import{a as De,b as Oe}from"./chunk-VSEWXNVC.js";import{a as ze}from"./chunk-PPDHTO44.js";import{a as at}from"./chunk-7KG3DC5J.js";import{b as Ge}from"./chunk-ICSMRW7O.js";import"./chunk-YXFTLQ5M.js";import{a as we,b as Me}from"./chunk-OE2JYQHN.js";import{e as xt}from"./chunk-2VSUESZZ.js";import{a as Ne}from"./chunk-VETHPEVU.js";import{i as Re,j as Be,k as je,l as $e,m as We}from"./chunk-75BDXSG3.js";import"./chunk-6NNAICJE.js";import"./chunk-LPXBSHUI.js";import"./chunk-D54NUPYF.js";import{a as H}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 Gt}from"./chunk-J3P46Z53.js";import{a as q}from"./chunk-4ASUM4N5.js";import{b as Ke}from"./chunk-7FUVW73P.js";import{a as Ae,b as Ue}from"./chunk-M3SJUKTG.js";import{a as $t,b as Wt,c as Ee}from"./chunk-GHQH62TZ.js";import"./chunk-CH2MLZU7.js";import{a as st}from"./chunk-PYD2QHHH.js";import{a as rt}from"./chunk-62PFQNHJ.js";import{c as Fe,f as Ve}from"./chunk-Q72ZXPDP.js";import"./chunk-MNFHFW3E.js";import"./chunk-ZZVNB72Q.js";import{a as Le}from"./chunk-VGXQU74M.js";import"./chunk-SDUUFQUI.js";import"./chunk-G6EG5QJS.js";import{a as jt}from"./chunk-RIHLYYZU.js";import{f as ke}from"./chunk-Q2OEJFVT.js";import{a as gt,b as Lt,d as nt,e as xe}from"./chunk-6IAGGRZN.js";import"./chunk-T6QOFDEE.js";import"./chunk-KXZCGKQW.js";import"./chunk-QCZIDOKW.js";import{j as Se,l as G}from"./chunk-67JBJ45X.js";import{b as $,e as W}from"./chunk-BUFEIJAI.js";import"./chunk-K5XRGNWG.js";import"./chunk-V5WYSCVT.js";import"./chunk-KHWTOD6H.js";import{b as Ct,c as ft,d as Z,e as ye,f as ve,g as be,h as Pe,i as Rt,j as St,k as Bt,m as z,n as Ie}from"./chunk-ITTRZMEX.js";import{r as it,s as ot}from"./chunk-TMFFA26Y.js";import"./chunk-WAW37FIG.js";import{b as fe,c as ht,h as U,m as L,y as _t}from"./chunk-DPLEMBB4.js";import{b as I,c as f}from"./chunk-PXB4YEY3.js";import{E as At,F as ge,G as et,H as Ut,J as Ce,d as Nt,f as A,g as V,j as mt,k as _e,m as ut,n as Y}from"./chunk-GPEVUTDI.js";import{$c as he,Dc as B,Eb as M,Ec as p,Fb as de,Fc as N,G as F,Gc as y,Ic as T,Jc as D,Ka as It,Kb as C,Kc as O,Pc as ct,Qa as wt,Qc as Q,Rc as Xt,Tc as ue,Vb as Yt,Wb as l,Xb as pe,Z as re,Zc as k,_c as E,aa as Ft,ad as j,bc as lt,ca as Jt,cc as Zt,ea as le,ec as qt,f as ae,fc as Qt,gc as o,hc as a,ic as _,jc as b,ka as ce,kc as P,mc as x,nb as se,ob as w,pa as tt,qb as r,rc as g,sc as s,tc as me,uc as Vt,v as Et,wb as S,ya as m,za as u}from"./chunk-T5ONJF63.js";import"./chunk-K2H6WANG.js";var ln=()=>["/menu/products/download/by-url"],Je=(()=>{class i{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-status"]],standalone:!1,decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(n,e){n&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),_(3,"nav-tab",2),a()(),o(4,"div")(5,"div",3)(6,"a",4),_(7,"i",5),a(),o(8,"div",6)(9,"div",7)(10,"a",8),p(11,"Download Product By Url"),a()()()()()(),_(12,"router-outlet")),n&2&&(r(3),l("Tabs",e.productTabs),r(7),l("routerLink",ct(2,ln)))},dependencies:[we,ge,Ut],encapsulation:2})}}return i})();function cn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function sn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function dn(i,d){if(i&1&&(o(0,"div",10),_(1,"img",11),o(2,"span"),p(3),a()()),i&2){let t=d.$implicit;l("matTooltip",t.disabled?"Single Product Scan disabled for this type of Channel":null),r(),l("src",t.Img,w),r(2),N(t.Name)}}function pn(i,d){if(i&1){let t=x();o(0,"div",12)(1,"label",13),p(2,"Scan Type"),a(),o(3,"mat-radio-group",14),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.ScanFull,e)||(c.filter.ScanFull=e),u(e)}),o(4,"mat-radio-button",15),p(5," Full (Include Inactive Products) "),a(),o(6,"mat-radio-button",16),p(7," Active "),a()()()}if(i&2){let t=s();r(3),T("ngModel",t.filter.ScanFull),r(),l("value",!0),r(2),l("value",!1)}}function mn(i,d){i&1&&(o(0,"span"),p(1,"Never"),a())}function un(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"async"),a()),i&2){let t=s(2);r(),N(E(2,1,t.lastSync$))}}function hn(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5)(2,"span",17),p(3,"Last Scan:"),a(),C(4,mn,2,0,"span"),k(5,"async"),C(6,un,3,3,"span"),a(),o(7,"mat-radio-group",18),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.UpdatedProduct,e)||(c.filter.UpdatedProduct=e),u(e)}),o(8,"mat-radio-button",19),p(9," Scan All Products "),a(),o(10,"mat-radio-button",20),p(11),a()()()}if(i&2){let t=s();r(4),lt(E(5,6,t.lastSync$)==null?4:6),r(3),T("ngModel",t.filter.UpdatedProduct),r(),l("value",!1),r(2),l("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"),r(),y(" ",t.selectedChannel.TypeID==t.channelType.Tokopedia?"Product Download By URL":"Scan Updated Products"," ")}}function _n(i,d){if(i&1){let t=x();o(0,"div",8)(1,"label",5),p(2," Scan Option "),a(),o(3,"mat-radio-group",21),O("ngModelChange",function(e){m(t);let c=s();return D(c.filter.Async,e)||(c.filter.Async=e),u(e)}),o(4,"mat-radio-button",22),p(5," Asynchronous (Get Notified when Complete) "),a(),o(6,"mat-radio-button",23),p(7," Synchronous (Wait until Complete) "),a()()()}if(i&2){let t=s();r(3),T("ngModel",t.filter.Async),r(),l("value",!0),r(2),l("value",!1)}}var R=(()=>{class i{constructor(t,n,e){this.dialogRef=t,this.data=n,this.router=e,this.channelService=tt(Te),this.channelType=I,this.disabledChannelOption=!1,this.filter={ChannelID:f.GuidEMpty,ScanFull:!1,UpdatedProduct:!1,Async:!1},this.isSingleChannel=f.IsNotEmpty(n.isSingleChannel)?this.data.isSingleChannel:!1,this.disabledChannelOption=f.IsEmpty(n.disabledChannelOption)?!1:this.data.disabledChannelOption}ngOnInit(){this.initChannelOptions(),this.initFilter(),this.onSelectChannel(this.data?.filter?.ChannelID),this.initModalConfig()}initModalConfig(){this.modalConfig=new St,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(Et(n=>(this.selectedChannel.LastSync=n.LastSync,this.setDefaultConfigUpdate(),f.IsNotEmpty(n.LastSync)?f.convertToReadableDate(n.LastSync):null)),re(1))}setDefaultConfigUpdate(){this.filter.UpdatedProduct=!1,this.selectedChannel&&f.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 f.IsNotEmpty(t)}onClose(){this.dialogRef.close()}static{this.\u0275fac=function(n){return new(n||i)(S(Ct),S(ft),S(et))}}static{this.\u0275cmp=M({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 c=x();o(0,"modal-material",2),g("onOk",function(){return m(c),u(e.submit())})("onClose",function(){return m(c),u(e.onClose())})("onCancel",function(){return m(c),u(e.onClose())}),o(1,"div",3)(2,"div",4)(3,"label",5),p(4,"Select a Channel"),a(),o(5,"p-select",6),O("ngModelChange",function(v){return m(c),D(e.filter.ChannelID,v)||(e.filter.ChannelID=v),u(v)}),g("ngModelChange",function(v){return m(c),u(e.onSelectChannel(v))}),C(6,cn,4,3,"ng-template",null,0,j)(8,sn,4,3,"ng-template",null,1,j)(10,dn,4,3,"ng-template",null,1,j),a(),C(12,pn,8,3,"div",7)(13,hn,12,8,"div",8)(14,_n,8,3,"div",9),a()()()}n&2&&(l("dynamicValidated",e.isNotEmpty(e.filter.ChannelID))("config",e.modalConfig),r(5),l("options",e.channelOptions),T("ngModel",e.filter.ChannelID),l("filter",!0),r(7),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)),r(),lt(e.hasScanUpdate&&e.selectedChannel?13:-1),r(),l("ngIf",!e.isSingleChannel&&e.isNotEmpty(e.filter.ChannelID)))},dependencies:[Y,V,mt,Oe,De,_t,U,L,Bt,jt,Wt,ot,it,Ve,$t],encapsulation:2})}}return i})();var pt=function(i){return i.Tokopedia="https://seller.tokopedia.com",i.Shoope="https://seller.shopee.co.id",i.Tiktok="https://seller-id.tiktok.com",i.WooCommerce="https://woocommerce.dealpos.app",i.Lazada="https://sellercenter.lazada.co.id",i}(pt||{});var ee={Success:"Success",Info:"Info",Warning:"Warning",Error:"Error"};var gn=[[["header"]],[["content"]],[["footer"]]],Cn=["header","content","footer"],fn=(i,d)=>({bodyScrollable:i,hideScrollbar:d}),Sn=(i,d,t,n)=>({"bg-success":i,"bg-warning":d,"bg-info":t,"bg-danger":n}),xn=i=>({"mx-auto":i}),yn=(i,d)=>({"show-footer":i,"p-0":d});function vn(i,d){if(i&1){let t=x();o(0,"div",8),g("click",function(){m(t);let e=s();return u(e.onBack.emit())}),o(1,"a",9),_(2,"i",10),a()()}}function bn(i,d){if(i&1){let t=x();o(0,"div")(1,"a",11),g("click",function(){m(t);let e=s();return u(e.onClose.emit())}),_(2,"i",12),a()()}}function Pn(i,d){if(i&1){let t=x();o(0,"a",16),g("click",function(){m(t);let e=s(2);return u(e.onCancel.emit())}),p(1),a()}if(i&2){let t=s(2);r(),y(" ",t.config!=null&&t.config.cancelText?t.config==null?null:t.config.cancelText:"Cancel","")}}function In(i,d){if(i&1){let t=x();o(0,"button",17),g("click",function(){m(t);let e=s(2);return u(e.onOk.emit())})("keyup.F2",function(){m(t);let e=s(2);return u(e.onOk.emit())}),a()}if(i&2){let t=s(2);l("disabled",!(t.config!=null&&t.config.validated)||!t.dynamicValidated)("innerHTML",t.config!=null&&t.config.okText?t.config==null?null:t.config.okText:"Ok (F2)",se)}}function wn(i,d){if(i&1&&(o(0,"mat-dialog-actions",13),Vt(1,2),C(2,Pn,2,1,"a",14)(3,In,1,2,"button",15),a()),i&2){let t=s();r(2),l("ngIf",!(t.config!=null&&t.config.hideCancel)),r(),l("ngIf",!(t.config!=null&&t.config.hideOk))}}var ne=class{constructor(){this.title="New Modal",this.okText="Ok (F2)",this.cancelText="Cancel",this.hideFooter=!1,this.hideCancel=!1,this.hideOk=!1,this.hideClose=!1,this.eMoney=!1,this.headerType=ee.Success,this.validated=!0,this.customWidth="initial",this.bodyScrollable=!1,this.hideScrollbar=!1,this.disableKeyup=!1,this.noPadding=!1}},Ye=(()=>{class i{constructor(){this.dynamicValidated=!0,this.onOk=new It,this.onCancel=new It,this.onClose=new It,this.onBack=new It,this.headerType=ee}ngOnInit(){this.config==null&&(this.config=new ne)}onKeyup(t){this.config?.disableKeyup||(t.code=="F2"&&this.onOk.emit("F2"),(t.code=="Enter"||t.code=="NumpadEnter")&&this.onOk.emit("Enter"))}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["modal-material"]],inputs:{config:"config",dynamicValidated:"dynamicValidated"},outputs:{onOk:"onOk",onCancel:"onCancel",onClose:"onClose",onBack:"onBack"},ngContentSelectors:Cn,decls:11,vars:23,consts:[["id","modal_material",1,"modal-material","d-flex","align-items-start","flex-column","position-relative","maxHeight",3,"keyup","ngClass"],["mat-dialog-title","",1,"d-flex","w-100","justify-content-between","modal-header","position-relative",3,"ngClass"],["class","back-button position-absolute pointer d-print-none",3,"click",4,"ngIf"],[1,"d-flex","flex-row","d-print-none","align-items-center",3,"ngClass"],[1,"fw-normal"],[4,"ngIf"],[1,"modal-body","w-100",3,"ngClass"],["class","w-100 py-7 border-top d-flex justify-content-end d-print-none",4,"ngIf"],[1,"back-button","position-absolute","pointer","d-print-none",3,"click"],[1,"btn","back-button"],[1,"fa-solid","fa-arrow-left"],[1,"btn-light-blue","btn-sm","pointer","close",3,"click"],[1,"fa-solid","fa-xmark","fa-lg","text-primary"],[1,"w-100","py-7","border-top","d-flex","justify-content-end","d-print-none"],["class","btn btn-light-blue text-primary btn-lg fw-bold mx-3",3,"click",4,"ngIf"],["class","btn btn-light-blue me-6 text-primary btn-lg fw-bold mx-3","data-cy","btn-ok",3,"disabled","innerHTML","click","keyup.F2",4,"ngIf"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],["data-cy","btn-ok",1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click","keyup.F2","disabled","innerHTML"]],template:function(n,e){n&1&&(me(gn),o(0,"div",0),g("keyup",function(h){return e.onKeyup(h)}),o(1,"div",1),C(2,vn,3,0,"div",2),o(3,"div",3)(4,"h4",4),p(5),a(),Vt(6),a(),C(7,bn,3,0,"div",5),a(),o(8,"mat-dialog-content",6),Vt(9,1),a(),C(10,wn,4,2,"mat-dialog-actions",7),a()),n&2&&(pe("width",e.config==null?null:e.config.customWidth),l("ngClass",Xt(10,fn,e.config==null?null:e.config.bodyScrollable,e.config==null?null:e.config.hideScrollbar)),r(),l("ngClass",ue(13,Sn,e.headerType.Success==(e.config==null?null:e.config.headerType),e.headerType.Warning==(e.config==null?null:e.config.headerType),e.headerType.Info==(e.config==null?null:e.config.headerType),e.headerType.Error==(e.config==null?null:e.config.headerType))),r(),l("ngIf",e.config==null?null:e.config.eMoney),r(),l("ngClass",Q(18,xn,e.config==null?null:e.config.eMoney)),r(2),N(e.config==null?null:e.config.title),r(2),l("ngIf",!(e.config!=null&&e.config.hideClose)),r(),l("ngClass",Xt(20,yn,!(e.config!=null&&e.config.hideFooter),e.config==null?null:e.config.noPadding)),r(2),l("ngIf",!(e.config!=null&&e.config.hideFooter)))},dependencies:[Y,Nt,V,Pe,ye,be,ve],styles:[".mat-mdc-dialog-container{padding:0!important;border-radius:4px!important;overflow:visible!important} .mat-mdc-dialog-container [mat-dialog-title]{color:#fff;padding:15px;border:none}@media print{ .mat-mdc-dialog-container{box-shadow:unset;width:100vw}}@media print{ .cdk-overlay-pane{position:absolute!important;top:-30px;max-width:100vw!important}.modal-body[_ngcontent-%COMP%]{width:100vw!important}}body.modal-body[_ngcontent-%COMP%]{height:100%;overflow-y:hidden}mat-dialog-actions[_ngcontent-%COMP%]{bottom:15px}mat-dialog-actions[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:15px!important;margin-right:12px}mat-dialog-actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{padding:15px!important}mat-dialog-actions[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin-right:auto;margin-top:-1rem;padding-top:.4rem!important;margin-left:1rem}.back-button[_ngcontent-%COMP%]{top:5px;left:0}.close[_ngcontent-%COMP%]{padding:.4rem .5rem}.no-padding[_ngcontent-%COMP%]{padding:0}.modal-material[_ngcontent-%COMP%]{width:40vw}@media (max-width: 992px){.modal-material[_ngcontent-%COMP%]{width:50vw!important}}@media (max-width: 576px){ .dialog-filter .modal-material{width:100%!important} .dialog-filter mat-dialog-actions{position:sticky;bottom:0;background:#fff} .dialog-filter .modal-material.d-flex.align-items-start.flex-column.position-relative.maxHeight.bodyScrollable.maxHeight.bodyScrollable .modal-body{max-height:100%!important;overflow-y:auto}}.maxHeight.bodyScrollable[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow-y:auto}.modal-header[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%], .modal-footer[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{padding:15px}.modal-dialog[_ngcontent-%COMP%]{max-width:none}.modal-content[_ngcontent-%COMP%]{width:auto;margin:auto;max-width:850px}.maxHeight[_ngcontent-%COMP%] .modal-body[_ngcontent-%COMP%]{max-height:450px;overflow:auto}.modal-body[_ngcontent-%COMP%]{padding:1rem}.modal-body[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{display:block}.modal-body[_ngcontent-%COMP%] .more[_ngcontent-%COMP%]{margin:0;position:absolute;bottom:-20px}.modal-body[_ngcontent-%COMP%] input[type=text][_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%], .modal-body[_ngcontent-%COMP%] input[type=password][_ngcontent-%COMP%]{border:1px solid #c8d3df;padding:5px 7px}.modal-body[_ngcontent-%COMP%] table[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:330px;height:90px}"]})}}return i})();var Mn=i=>({"is-disabled":i});function Tn(i,d){if(i&1&&(b(0),o(1,"tr")(2,"td",10),p(3),a(),o(4,"td",10),p(5),a(),o(6,"td",11)(7,"p",12),p(8,"Product Not in Channel!"),a()()(),P()),i&2){let t=s().$implicit;r(3),y(" ",t==null?null:t.Model," "),r(2),y(" ",t==null?null:t.Code," ")}}function Dn(i,d){if(i&1&&(o(0,"td",10),p(1),a()),i&2){let t=s(3).$implicit;Yt("rowspan",t.Channel.length),r(),y(" ",t==null?null:t.Model," ")}}function On(i,d){if(i&1&&(o(0,"td",10),p(1),a()),i&2){let t=s(3).$implicit;Yt("rowspan",t.Channel.length),r(),y(" ",t==null?null:t.Code," ")}}function kn(i,d){if(i&1){let t=x();o(0,"tr"),C(1,Dn,2,2,"td",13)(2,On,2,2,"td",13),o(3,"td",10)(4,"div",14)(5,"a",15),_(6,"img",16),a(),o(7,"div",17),p(8),a()()(),o(9,"td",10),p(10),k(11,"number"),a(),o(12,"td",18),p(13),k(14,"number"),a(),o(15,"td",19)(16,"div",20)(17,"button",21),g("click",function(){let e=m(t).$implicit,c=s(2).$implicit,h=s();return u(h.onDetach(e,c))}),_(18,"i",22),o(19,"span",23),p(20,"Detach"),a()(),o(21,"a",24),_(22,"i",25),o(23,"span",23),p(24,"Edit"),a()()()()()}if(i&2){let t=d.$implicit,n=d.$index,e=s(3);r(),l("ngIf",n==0),r(),l("ngIf",n==0),r(3),l("href",t.Url,w)("title",t.Title),r(),l("src",e.getChannelLogo(t.TypeID),w),r(),l("matTooltip",(t==null||t.Name==null?null:t.Name.length)>40?t==null?null:t.Name:""),r(),y(" ",t.Name," "),r(2),N(E(11,12,t.Price)),r(3),N(E(14,14,t.Inventory)),r(8),l("href",e.getHyperlinkSellerCenter(t),w)("ngClass",Q(16,Mn,t.TypeID==e.channelType.KalCare))("matTooltip",t.TypeID!=e.channelType.KalCare?"Edit this product in Seller Center, inventory changes must be done via DEALPOS":"")}}function En(i,d){if(i&1&&qt(0,kn,25,18,"tr",null,Zt),i&2){let t=s().$implicit;Qt(t==null?null:t.Channel)}}function Fn(i,d){if(i&1&&C(0,Tn,9,2,"ng-container",9)(1,En,2,0,"ng-template",null,0,j),i&2){let t=d.$implicit,n=B(2);l("ngIf",!t.Channel||t.Channel.length<1)("ngIfElse",n)}}var zt=(()=>{class i{constructor(t,n){this.data=t,this.dialogRef=n,this.httpService=tt(W),this.toastr=tt($),this.variants=wt([]),this.channelType=I,this.variants.set(this.data.variants),this.title=t.title}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new St,this.modalConfig.title=this.data.title,this.modalConfig.bodyScrollable=!0,this.modalConfig.hideFooter=!0,this.modalConfig.customWidth="850px"}onDetach(t,n){let e={ChannelID:t.ChannelID,ChannelItemID:t.ChannelItemID,ChannelVariationID:t.ChannelVariationID};this.httpService.post(Se.DetachVariant,[e]).subscribe(c=>{this.toastr.success(c.Message,"Success"),this.updateVariantAfterDetach(n,t.ChannelVariationID)})}updateVariantAfterDetach(t,n){this.variants.update(e=>{let c=e.findIndex(h=>h.ID===t.ID);return c!==-1&&(e[c].Channel=e[c].Channel.filter(h=>h.ChannelVariationID!==n)),[...e]})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getHyperlinkSellerCenter(t){let n="javascript:void(0)";switch(t.TypeID){case I.Shopee:n=`${pt.Shoope}/portal/product/${t.ChannelItemID}`;break;case I.Tiktok:n=`${pt.Tiktok}/product/edit/${t.ChannelItemID}`;break;case I.Tokopedia:n=`${pt.Tokopedia}/edit-product/${t.ChannelItemID}`;break;case I.WooCommerce:n=`${pt.WooCommerce}/wp-admin/post.php?post=${t.ChannelItemID}&action=edit`;break;case I.Lazada:n=`${pt.Lazada}/apps/product/publish?productId=${t.ChannelItemID}`;break}return n}static{this.\u0275fac=function(n){return new(n||i)(S(ft),S(Ct))}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-variant"]],decls:27,vars:1,consts:[["printChannelModal",""],[3,"onClose","onCancel","config"],[1,"table"],[1,"sticky-top-thead","variant-modal"],[1,"text-start","sticky-top"],[1,"d-flex","align-items-center"],["matTooltip","Variant from POS",1,"fas","fa-info-circle","ms-1"],["matTooltip","Product and Variant from each Channel",1,"fas","fa-info-circle","ms-1"],[1,"text-start","sticky-top",2,"width","0%"],[4,"ngIf","ngIfElse"],[1,"text-start"],["colspan","3",1,"text-center"],[1,"my-auto"],["class","text-start",4,"ngIf"],[1,"d-flex"],["target","_blank",1,"me-1",3,"href","title"],[2,"width","20px","height","20px",3,"src"],[1,"text-ellipsis","ps-2",2,"max-width","18vw",3,"matTooltip"],[1,"text-center"],[1,"text-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"btn","btn-small","btn-light","px-4","py-2","me-3",3,"click"],[1,"fa-sharp","fa-link-slash","me-2",2,"font-size","10px"],[1,"fs-6"],["target","_blank",1,"btn","btn-small","btn-light","px-4","py-2",3,"href","ngClass","matTooltip"],[1,"fa-solid","fa-edit","me-2",2,"font-size","10px"]],template:function(n,e){n&1&&(o(0,"modal-material",1),g("onClose",function(){return e.dialogRef.close()})("onCancel",function(){return e.dialogRef.close()}),o(1,"content")(2,"table",2)(3,"thead",3)(4,"tr")(5,"th",4)(6,"div",5)(7,"span"),p(8,"VARIANT"),a(),o(9,"sup"),_(10,"i",6),a()()(),o(11,"th",4),p(12,"SKU"),a(),o(13,"th",4)(14,"div",5)(15,"span"),p(16,"PRODUCT"),a(),o(17,"sup"),_(18,"i",7),a()()(),o(19,"th",4),p(20,"PRICE"),a(),o(21,"th",8),p(22,"INVENTORY"),a(),_(23,"th",4),a()(),o(24,"tbody"),qt(25,Fn,3,2,null,null,Zt),a()()()()),n&2&&(l("config",e.modalConfig),r(25),Qt(e.variants()))},dependencies:[Y,Nt,V,ut,ot,it,Ye],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.sticky-top-thead[_ngcontent-%COMP%] th.sticky-top[_ngcontent-%COMP%]{top:0}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] tr.sticky-top[_ngcontent-%COMP%]{border:none!important;border-bottom:1px solid!important}table[_ngcontent-%COMP%] > thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%]{border-top:none!important;border-left:none!important;border-right:none!important}.table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#fff!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child:after{border-right:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child:before{border-left:0px!important}.sticky-top-thead.variant-modal[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:before{border-top:0px}a.is-disabled[_ngcontent-%COMP%]{color:gray;cursor:default}a.is-disabled[_ngcontent-%COMP%]:hover{text-decoration:none}"]})}}return i})();function Vn(i,d){if(i&1&&(o(0,"mat-option",6)(1,"div"),_(2,"img",7),o(3,"span"),p(4),a()()()),i&2){let t=d.$implicit;l("value",t.ChannelID),r(2),l("src",t.logo,w),r(2),N(t.Title)}}var bt=(()=>{class i{constructor(){this.dialogRef=tt(Ct),this.channels=tt(ft),this.channelIds=wt([]),this.channelOptions=wt([])}ngOnInit(){this.initModalConfig();let t=this.channels.filter((n,e,c)=>c.findIndex(h=>h.ChannelID===n.ChannelID)===e);this.channelOptions.set(t)}initModalConfig(){this.modalConfig=new St,this.modalConfig.title="Detach Product",this.modalConfig.okText="Save"}onClose(){this.dialogRef.close()}onSave(){let t=this.channels.filter(n=>this.channelIds().includes(n.ChannelID)).map(n=>({ChannelID:n.ChannelID,ChannelItemID:n.ChannelItemID}));this.dialogRef.close(t)}static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275cmp=M({type:i,selectors:[["app-modal-detach-product"]],decls:8,vars:5,consts:[[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mb-2","fw-bold"],["appearance","outline",1,"w-100"],["name","channelid","placeholder","Channel",1,"mat-select-channel",3,"ngModelChange","ngModel","multiple"],["class","channel-option",3,"value",4,"ngFor","ngForOf"],[1,"channel-option",3,"value"],[2,"width","18px","margin-right","10px",3,"src"]],template:function(n,e){n&1&&(o(0,"modal-material",0),g("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSave()}),o(1,"div",1)(2,"div")(3,"label",2),p(4,"Select a Channel"),a(),o(5,"mat-form-field",3)(6,"mat-select",4),O("ngModelChange",function(h){return D(e.channelIds,h)||(e.channelIds=h),h}),C(7,Vn,5,3,"mat-option",5),a()()()()()),n&2&&(l("dynamicValidated",e.channelIds().length>0)("config",e.modalConfig),r(6),T("ngModel",e.channelIds),l("multiple",!0),r(),l("ngForOf",e.channelOptions()))},dependencies:[Y,A,Bt,jt,ke,Ue,Ae,Fe,_t,U,L,ot],encapsulation:2})}}return i})();function Nn(i,d){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",14),p(2),a()}if(i&2){let t,n=s();r(2),y("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function An(i,d){if(i&1){let t=x();o(0,"button",16),g("click",function(){m(t);let e=s(2);return u(e.onOpenScanDialog())}),_(1,"i",17),p(2," Scan Channel "),a()}}function Un(i,d){if(i&1&&(b(0),C(1,An,3,0,"button",15),P()),i&2){let t=s();r(),l("ngIf",!t.productService.hasSelection(t.products))}}function Ln(i,d){if(i&1){let t=x();b(0),o(1,"button",18),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",17),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Scan (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Rn(i,d){if(i&1){let t=x();b(0),o(1,"button",19),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",20),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Upload (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Bn(i,d){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),a()()}if(i&2){let t=d.$implicit,n=s();r(),l("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 jn(i,d){i&1&&(b(0),o(1,"div",23),_(2,"app-empty-state"),a(),P())}function $n(i,d){if(i&1){let t=x();b(0),o(1,"div",24)(2,"div",25)(3,"app-custom-paginator",26),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()(),P()}if(i&2){let t=s();r(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",!0)("nextButtonAlwaysVisible",!0)}}var Qe=(()=>{class i{constructor(t,n,e,c,h,v,Pt){this.http=t,this.toastr=n,this.dialog=e,this.productService=c,this.authService=h,this.uploadProductService=v,this.route=Pt,this.searchFilter=new at,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=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(zt,{data:{title:this.products[t].Name,variants:n}})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty;let n=this.productService.filterChannelByTypeId(this.channelOptions,[I.Tokopedia,I.Tiktok]);this.dialog.open(R,{data:{filter:t,channelOptions:n,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(c=>f.IsNotEmpty(c))).subscribe(c=>{this.searchFilter.ChannelID=c.ChannelID,this.searchFilter.ScanFull=c.ScanFull,this.searchFilter.UpdatedProduct=c.UpdatedProduct;let h=this.productService.selectedProduct(this.products),v=this.productService.getVariantCodesProducts(h);this.scanSingleProduct(v)})}onScanSingleProduct(t){let n=JSON.parse(JSON.stringify(this.searchFilter));n.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(c)})}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=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.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=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(bt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Ft(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Rt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(W),S($),S(Z),S(H),S(G),S(xt),S(et))}}static{this.\u0275cmp=M({type:i,selectors:[["app-in-pos"]],standalone:!1,decls:23,vars:14,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","Name","placeholder","Select Category",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[1,"mt-5"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModelChange","click","ngModel"],["matEndDate","","placeholder","End date",3,"ngModelChange","click","ngModel"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onScan","onDescEvent","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked","nextButtonAlwaysVisible"]],template:function(n,e){if(n&1){let c=x();o(0,"mainpanel",1),g("onSubmit",function(v){return m(c),u(e.searchProduct(v))}),o(1,"actions"),C(2,Nn,3,1,"button",2)(3,Un,2,1,"ng-container",3)(4,Ln,4,1,"ng-container",3)(5,Rn,4,1,"ng-container",3),a(),o(6,"filters")(7,"div")(8,"label",4),p(9,"Category"),a(),o(10,"ng-select",5),g("ngModelChange",function(v){return m(c),u(e.searchFilter.Category=v)}),a()(),o(11,"div",6)(12,"mat-date-range-input",7)(13,"input",8),O("ngModelChange",function(v){return m(c),D(e.startDate,v)||(e.startDate=v),u(v)}),g("click",function(){m(c);let v=B(16);return u(v.open())}),a(),o(14,"input",9),O("ngModelChange",function(v){return m(c),D(e.endDate,v)||(e.endDate=v),u(v)}),g("click",function(){m(c);let v=B(16);return u(v.open())}),a()(),_(15,"mat-date-range-picker",null,0),a()(),o(17,"content")(18,"div",10)(19,"div",11),C(20,Bn,2,11,"div",12)(21,jn,3,0,"ng-container",3),a(),C(22,$n,4,5,"ng-container",3),a()()()}if(n&2){let c=B(16);l("headerTitle","In POS ("+e.rowCount+")"),r(2),lt(e.productService.hasSelection(e.products)?2:-1),r(),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)&&e.multipeScanChannels.length>0),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("items",e.Categories)("ngModel",e.searchFilter.Category),r(2),l("rangePicker",c),r(),T("ngModel",e.startDate),r(),T("ngModel",e.endDate),r(6),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",e.products.length>0)}},dependencies:[A,V,ht,U,L,z,nt,q,rt,K,Re,Be,je,$e],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]})}}return i})();function Wn(i,d){if(i&1){let t=x();o(0,"button",11),g("click",function(){m(t);let e=s();return u(e.onDetachMultipleProduct())}),_(1,"i",12),p(2),a()}if(i&2){let t,n=s();r(2),y("Detach (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function Gn(i,d){if(i&1){let t=x();b(0),o(1,"button",13),g("click",function(){m(t);let e=s();return u(e.onOpenScanDialog())}),_(2,"i",14),p(3," Scan Channel "),a(),P()}}function zn(i,d){if(i&1){let t=x();b(0),o(1,"button",15),g("click",function(){m(t);let e=s();return u(e.onScanMultipleProduct())}),_(2,"i",14),p(3),a(),P()}if(i&2){let t=s();r(3),y(" Scan (",t.productService.selectedProduct(t.products).length,") ")}}function Hn(i,d){if(i&1){let t=x();b(0),o(1,"button",16),g("click",function(){m(t);let e=s();return u(e.onUploadMultipleProduct())}),_(2,"i",17),p(3),a(),P()}if(i&2){let t=s();r(3),y(" Upload (",t.productService.selectedProduct(t.products).length,") ")}}function Kn(i,d){if(i&1&&(o(0,"span",18),_(1,"img",19),a(),p(2)),i&2){let t=d.item;r(),l("src",t.Img,w)("alt",t.Name),r(),y(" ",t.Name," ")}}function Jn(i,d){if(i&1){let t=x();o(0,"div",20)(1,"label",21),p(2,"Item ID"),a(),o(3,"input",22),O("ngModelChange",function(e){m(t);let c=s();return D(c.searchFilter.Item_id,e)||(c.searchFilter.Item_id=e),u(e)}),a()()}if(i&2){let t=s();r(3),T("ngModel",t.searchFilter.Item_id)}}function Yn(i,d){if(i&1){let t=x();o(0,"div",23)(1,"app-product-card",24),g("onUpload",function(){let e=m(t).$implicit,c=s();return u(c.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onOpenVariantDetail(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let c=m(t).$implicit;return u(c.selected=e)})("onDetach",function(){let e=m(t).$implicit,c=s();return u(c.onDetachProduct([e]))}),a()()}if(i&2){let t=d.$implicit,n=s();r(),l("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 Zn(i,d){i&1&&(b(0),o(1,"div",25),_(2,"app-empty-state"),a(),P())}function qn(i,d){if(i&1){let t=x();o(0,"div",26)(1,"div",27)(2,"app-custom-paginator",28),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()()}if(i&2){let t=s();r(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var Xe=(()=>{class i{constructor(t,n,e,c,h,v,Pt,kt){this.http=t,this.dialog=n,this.toastr=e,this.productService=c,this.activateRouter=h,this.authService=v,this.route=Pt,this.uploadProductService=kt,this.searchFilter=new at,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=f.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(n=>{this.searchFilter=n.Filter,n.Filter.ChannelID!=f.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(zt,{data:{variants:n,title:this.products[t].Name}})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(F(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(f.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let n=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(R,{data:{filter:n,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID;let c=this.productService.getVariantCodesProduct(t);this.scanProducts(c)})}onUploadToMultipleChannel(t){this.uploadProductService.setSelectedProduct([t]),this.route.navigate(["/menu/products/upload"])}onScanMultipleProduct(){this.searchFilter.ChannelID=f.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(R,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(F(e=>f.IsNotEmpty(e))).subscribe(e=>{this.searchFilter.ChannelID=e.ChannelID,this.searchFilter.ScanFull=e.ScanFull,this.searchFilter.UpdatedProduct=e.UpdatedProduct;let c=this.productService.selectedProduct(this.products),h=this.productService.getVariantCodesProducts(c);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=f.GuidEMpty,n&&this.getProducts()},error:n=>{this.searchFilter.ChannelID=f.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=f.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.uploadProductService.setSelectedProduct(t),this.route.navigate(["/menu/products/upload"])}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(n=>{this.hasClickRowCount=!0,this.rowCount=n.Total})}onDetachProduct(t){let n=[];t.forEach(e=>{e.Channel=f.assignChannelLogo(e.Channel),n.push(...e.Channel)}),this.dialog.open(bt,{width:"600px",data:[...n]}).afterClosed().pipe(F(e=>f.IsNotEmpty(e)),Ft(e=>this.productService.detachProduct(e))).subscribe(e=>{this.toastr.success(e.Message,Rt.Success),this.getProducts()})}onDetachMultipleProduct(){let t=this.productService.selectedProduct(this.products);this.onDetachProduct(t)}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(Z),S($),S(H),S(At),S(G),S(et),S(xt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-sold-in-channel"]],standalone:!1,decls:19,vars:13,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2"],[4,"ngIf"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","clearable","multiple","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["class","mt-5",4,"ngIf"],[1,"container-fluid"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"fa-sharp","fa-link-slash","me-2"],["type","button","data-cy","scanSoldinChannel",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-2",3,"click"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"mt-5"],[1,"fw-bold"],["type","text","name","Item_id","id","Item_id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onUpload","onDescEvent","onScan","onCheckBoxChange","onDetach","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom","detachButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.searchProduct(h)}),o(1,"actions"),C(2,Wn,3,1,"button",1)(3,Gn,4,0,"ng-container",2)(4,zn,4,1,"ng-container",2)(5,Hn,4,1,"ng-container",2),a(),o(6,"filters")(7,"div")(8,"label",3),p(9,"Channel"),a(),o(10,"ng-select",4),g("ngModelChange",function(h){return e.searchFilter.ListChannelID=h})("clear",function(){return e.onClearFilterChannel()}),C(11,Kn,3,3,"ng-template",5),a()(),C(12,Jn,4,1,"div",6),a(),o(13,"content")(14,"div",7)(15,"div",8),C(16,Yn,2,11,"div",9)(17,Zn,3,0,"ng-container",2),a(),C(18,qn,3,4,"div",10),a()()()),n&2&&(l("headerTitle","Sold in Channel"),r(2),lt(e.productService.hasSelection(e.products)?2:-1),r(),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.multipeScanChannels.length>0&&e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("multiple",!0)("items",e.channelOptions)("ngModel",e.searchFilter.ListChannelID),r(2),l("ngIf",e.searchFilter.ListChannelID!=null),r(4),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",e.products==null?null:e.products.length))},dependencies:[A,V,ht,U,L,z,nt,gt,Lt,q,rt,K],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 Qn(i,d){if(i&1){let t=x();o(0,"button",13),g("click",function(){m(t);let e=s(2);return u(e.uploadMultipleProduct())}),_(1,"i",14),p(2),a()}if(i&2){let t=s(2);r(2),y(" upload (",t.selectedProducts==null?null:t.selectedProducts.length,") ")}}function Xn(i,d){if(i&1){let t=x();b(0),o(1,"td",29)(2,"input",30),O("ngModelChange",function(e){m(t);let c=s(2).$implicit;return D(c.selected,e)||(c.selected=e),u(e)}),g("ngModelChange",function(){m(t);let e=s(3).ngIf,c=s(3);return u(c.onSelectProduct(e))}),a()(),P()}if(i&2){let t=s(2).$implicit;r(),l("rowSpan",t==null?null:t.Variants.length),r(),T("ngModel",t.selected)}}function ti(i,d){if(i&1){let t=x();b(0),o(1,"img",35),g("click",function(e){m(t);let c=s(3).$implicit,h=s(4);return u(h.onZoomImage(e,c==null?null:c.ImageUrl))}),a(),P()}if(i&2){let t=s(3).$implicit;r(),l("src",t==null?null:t.ImageUrl,w)}}function ei(i,d){i&1&&_(0,"img",36)}function ni(i,d){if(i&1&&(b(0),o(1,"td",29)(2,"div",31),C(3,ti,2,1,"ng-container",11)(4,ei,1,0,"ng-template",null,1,j),a()(),o(6,"td",32)(7,"h4",33)(8,"span",34),p(9),a()()(),P()),i&2){let t=B(5),n=s(2).$implicit;r(),l("rowSpan",n==null?null:n.Variants.length),r(2),l("ngIf",n==null?null:n.ImageUrl)("ngIfElse",t),r(3),l("rowSpan",n==null?null:n.Variants.length),r(2),l("matTooltip",(n==null||n.Name==null?null:n.Name.length)>50?n==null?null:n.Name:""),r(),y(" ",n==null?null:n.Name," ")}}function ii(i,d){if(i&1&&(o(0,"div")(1,"a",25),_(2,"img",37),a()()),i&2){let t=d.$implicit;r(),l("href",t.URL,w),r(),l("src",t.Img,w)("matTooltip",t.Name)}}function oi(i,d){if(i&1&&(o(0,"div"),_(1,"img",37),a()),i&2){let t=d.$implicit;r(),l("src",t.Img,w)("matTooltip",t.Name)}}function ai(i,d){if(i&1&&(o(0,"tr"),C(1,Xn,3,2,"ng-container",12)(2,ni,10,6,"ng-container",12),o(3,"td"),p(4),a(),o(5,"td")(6,"span"),p(7),a(),o(8,"span",24)(9,"a",25),_(10,"i",26),a()()(),o(11,"td",27)(12,"div",28),C(13,ii,3,3,"div",23),a()(),o(14,"td",27)(15,"div",28),C(16,oi,2,2,"div",23),a()()()),i&2){let t=d.$implicit,n=d.index,e=s(5);r(),l("ngIf",n==0),r(),l("ngIf",n==0),r(2),y(" ",t.Name," "),r(3),y(" ",t.Code," "),r(2),l("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),w),r(4),l("ngForOf",t==null?null:t.Available),r(3),l("ngForOf",t==null?null:t.NotAvailable)}}function ri(i,d){if(i&1&&(b(0),C(1,ai,17,7,"tr",23),P()),i&2){let t=d.$implicit;r(),l("ngForOf",t.Variants)}}function li(i,d){if(i&1&&(o(0,"tbody"),C(1,ri,2,1,"ng-container",23),a()),i&2){let t=d.ngIf;r(),l("ngForOf",t)}}function ci(i,d){if(i&1&&(b(0),o(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),_(5,"th",18),o(6,"th",19),p(7,"Product"),a(),o(8,"th",20),p(9,"Variant"),a(),o(10,"th",20),p(11,"SKU"),a(),o(12,"th",21),p(13,"Available In"),a(),o(14,"th",22),p(15,"Not Available In"),a()()(),C(16,li,2,1,"tbody",12),k(17,"async"),a()(),P()),i&2){let t=s(2);r(16),l("ngIf",E(17,1,t.data$))}}function si(i,d){i&1&&(o(0,"div",38),_(1,"app-empty-state"),a())}function di(i,d){if(i&1){let t=x();o(0,"span",46),g("click",function(){m(t);let e=s(4);return u(e.getRowCount())}),o(1,"i",47),p(2,"?"),a()()}}function pi(i,d){if(i&1&&(o(0,"span"),p(1),k(2,"number"),a()),i&2){let t=d.ngIf;r(),N(E(2,1,t==null?null:t.Count))}}function mi(i,d){if(i&1){let t=x();o(0,"a",48),g("click",function(){m(t);let e=s(4);return u(e.onNextPage())}),_(1,"i",49),p(2," Next"),a()}}function ui(i,d){if(i&1){let t=x();o(0,"a",50),g("click",function(){m(t);let e=s(4);return u(e.onLastPage())}),_(1,"i",51),p(2," Last"),a()}}function hi(i,d){if(i&1&&(b(0),o(1,"div",39)(2,"div",40)(3,"div",41),p(4),k(5,"number"),C(6,di,3,0,"span",42)(7,pi,3,3,"span",12),k(8,"async"),p(9),a()(),o(10,"div",43),C(11,mi,3,0,"a",44)(12,ui,3,0,"a",45),a()(),P()),i&2){let t=s().ngIf,n=s(2);r(4),y(" Showing 1 - ",E(5,6,t==null?null:t.length)," of "),r(2),l("ngIf",n.paginationService.hideCount),r(),l("ngIf",!n.paginationService.hideCount&&E(8,8,n.rowCount$)),r(2),y(" records ~ ",n.paginationService.footerPageNumber," Page "),r(2),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage),r(),l("ngIf",n.paginationService.disableNextButton&&!n.paginationService.goToLastPage)}}function _i(i,d){if(i&1&&(b(0),C(1,hi,13,10,"ng-container",12),P()),i&2){let t=d.ngIf;r(),l("ngIf",(t==null?null:t.length)>0)}}function gi(i,d){if(i&1){let t=x();o(0,"mainpanel",3),g("onSubmit",function(e){m(t);let c=s();return u(c.searchProduct(e))}),o(1,"actions"),C(2,Qn,3,1,"button",4),o(3,"button",5),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(4,"i",6),p(5," Scan Channel "),a(),o(6,"button",7),g("click",function(){m(t);let e=s();return u(e.openExportDialog())}),_(7,"i",8),o(8,"span"),p(9,"Export"),a()()(),o(10,"content")(11,"div",9)(12,"div",10),C(13,ci,18,3,"ng-container",11),k(14,"async"),C(15,si,2,0,"ng-template",null,0,j),a(),C(17,_i,2,1,"ng-container",12),k(18,"async"),a()()()}if(i&2){let t,n=B(16),e=s();l("hideSearchDropdown",!0),r(2),l("ngIf",e.hasSelectionProduct),r(11),l("ngIf",((t=E(14,5,e.data$))==null?null:t.length)>0)("ngIfElse",n),r(4),l("ngIf",E(18,7,e.data$))}}var tn=(()=>{class i{constructor(t,n,e,c,h,v,Pt,kt,rn){this.http=t,this.dialog=n,this.toastr=e,this.route=c,this.productService=h,this.paginationService=v,this.biggerPictureService=Pt,this.authService=kt,this.uploadProductService=rn,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=kt.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(le(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(Et(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=f.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=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(Ge,{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(W),S(Z),S($),S(et),S(H),S(ze),S(Le),S(G),S(xt))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-channel"]],standalone:!1,decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(n,e){n&1&&(C(0,gi,19,9,"mainpanel",2),k(1,"async")),n&2&&l("ngIf",E(1,1,e.loader$))},dependencies:[A,V,fe,U,L,z,it,K,mt,ut],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 Ci=i=>[i],fi=()=>[];function Si(i,d){if(i&1){let t=x();o(0,"button",15),g("click",function(){m(t);let e=s();return u(e.openScanDialog())}),_(1,"i",16),p(2," Scan Channel "),a()}}function xi(i,d){if(i&1){let t=x();b(0),o(1,"button",17),g("click",function(){m(t);let e=s();return u(e.onDownloadAllProduct("SELECTED"))}),_(2,"i",18),p(3),a(),P()}if(i&2){let t,n=s();r(3),y(" Download (",(t=n.productService.selectedProduct(n.products))==null?null:t.length,") ")}}function yi(i,d){if(i&1&&(o(0,"span",19),_(1,"img",20),a(),p(2)),i&2){let t=d.item;r(),l("src",t.Img,w)("alt",t.Name),r(),y(" ",t.Name," ")}}function vi(i,d){if(i&1){let t=x();o(0,"div",21)(1,"app-product-card",22),g("onCheckBoxChange",function(e){let c=m(t).index,h=s();return u(h.onSelectProduct(e,c))})("onDescEvent",function(){let e=m(t).index,c=s();return u(c.onShowVariantDetail(e))})("onDownload",function(){let e=m(t).$implicit,c=s();return u(c.onDownloadProduct(e))})("onScan",function(){let e=m(t).$implicit,c=s();return u(c.onScanChannel(e))}),a()()}if(i&2){let t=d.$implicit;r(),l("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?Q(10,Ci,t==null?null:t.Channel):ct(12,fi))("showCheckBox",!0)("scanButton",!0)}}function bi(i,d){i&1&&(b(0),o(1,"div",23),_(2,"app-empty-state"),a(),P())}function Pi(i,d){if(i&1){let t=x();o(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),g("total",function(){m(t);let e=s();return u(e.getRowCount())})("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())}),a()()()}if(i&2){let t=s();r(2),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickRowCount)}}var en=(()=>{class i{constructor(t,n,e,c,h,v){this.http=t,this.dialog=n,this.productService=e,this.toastrService=c,this.activateRouter=h,this.authService=v,this.searchFilter=new at,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(f.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(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?f.IsNotEmpty(t?.ChannelItemSKU)?t.SKU=t?.ChannelItemSKU:t.SKU="SKU not assigned":t.SKU=t?.Variant[0]?.ChannelVariationSKU?t?.Variant[0]?.ChannelVariationSKU:"SKU not assigned",t))}onSearch(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onClearChannelFilter(){this.searchFilter.ChannelID=f.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(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(f.GuidEMpty),this.productService.successToastrScanAllProduct(n,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=f.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=f.GuidEMpty,this.dialog.open(R,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(F(e=>f.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(f.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let n=this.products[t].Variant;n.length>0&&this.dialog.open(He,{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(W),S(Z),S(H),S($),S(At),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-not-in-pos"]],standalone:!1,decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"actions"),C(2,Si,3,0,"button",1)(3,xi,4,1,"ng-container",2),a(),o(4,"filters")(5,"div")(6,"label",3),p(7,"Channel"),a(),o(8,"ng-select",4),O("ngModelChange",function(h){return D(e.searchFilter.ChannelID,h)||(e.searchFilter.ChannelID=h),h}),C(9,yi,3,3,"ng-template",5),a()(),o(10,"div",6)(11,"label",7),p(12,"SKU Assigned"),a(),o(13,"mat-radio-group",8),O("ngModelChange",function(h){return D(e.searchFilter.HaveSku,h)||(e.searchFilter.HaveSku=h),h}),o(14,"mat-radio-button",9),p(15," All "),a(),o(16,"mat-radio-button",9),p(17," Yes "),a(),o(18,"mat-radio-button",9),p(19," No "),a()()(),o(20,"div",6)(21,"label",7),p(22,"Item ID"),a(),o(23,"input",10),O("ngModelChange",function(h){return D(e.searchFilter.Item_id,h)||(e.searchFilter.Item_id=h),h}),a()()(),o(24,"content")(25,"div",11)(26,"div",12),C(27,vi,2,13,"div",13)(28,bi,3,0,"ng-container",2),a(),C(29,Pi,3,4,"div",14),a()()()),n&2&&(r(2),l("ngIf",!e.productService.hasSelection(e.products)),r(),l("ngIf",e.productService.hasSelection(e.products)),r(5),l("clearable",!0)("items",e.channelOptions),T("ngModel",e.searchFilter.ChannelID),r(5),T("ngModel",e.searchFilter.HaveSku),r(),l("value",0),r(2),l("value",1),r(2),l("value",2),r(5),T("ngModel",e.searchFilter.Item_id),r(4),l("ngForOf",e.products),r(),l("ngIf",e.products.length==0),r(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[A,V,ht,U,L,z,nt,gt,$t,Wt,q,rt,K],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 Ii(i,d){if(i&1&&(o(0,"span",9),_(1,"img",10),a(),p(2)),i&2){let t=d.item,n=s();r(),l("src",n.getChannelLogo(t.TypeID),w),r(),y(" ",t.Name," ")}}function wi(i,d){if(i&1&&(o(0,"div",11),_(1,"app-duplicate-product-card",12),a()),i&2){let t=d.$implicit,n=d.index;r(),l("imageForZoom",t.ImageUrl)("title",t.Name)("code",t.Code)("id",n)("image",t.ThumbnailURL)("channels",t.Channels)}}function Mi(i,d){i&1&&(b(0),o(1,"div",13),_(2,"app-empty-state"),a(),P())}function Ti(i,d){if(i&1){let t=x();b(0),o(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),g("next",function(){m(t);let e=s();return u(e.getProducts())})("previous",function(){m(t);let e=s();return u(e.getProducts())})("total",function(){m(t);let e=s();return u(e.getRowCount())}),a()()(),P()}if(i&2){let t=s();r(3),l("filter",t.searchFilter)("totaldata",t.products==null?null:t.products.length)("paginationTotal",t.rowCount)("hasClicked",t.hasClickedRowCount)}}var nn=(()=>{class i{constructor(t,n,e){this.httpService=t,this.productService=n,this.authService=e,this.searchFilter=new at,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=f.GuidEMpty}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(n=>{this.hasClickedRowCount=!0,this.rowCount=n.Total})}static{this.\u0275fac=function(n){return new(n||i)(S(W),S(H),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-duplicate-sku"]],standalone:!1,decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(n,e){n&1&&(o(0,"mainpanel",0),g("onSubmit",function(h){return e.onSearch(h)}),o(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),p(5,"Channel"),a(),o(6,"ng-select",3),O("ngModelChange",function(h){return D(e.searchFilter.ListChannelID,h)||(e.searchFilter.ListChannelID=h),h}),g("clear",function(){return e.onClearFilter()}),C(7,Ii,3,2,"ng-template",4),a()()()(),o(8,"content")(9,"div",5)(10,"div",6),C(11,wi,2,6,"div",7)(12,Mi,3,0,"ng-container",8),a(),C(13,Ti,4,4,"ng-container",8),a()()()),n&2&&(r(6),l("multiple",!0)("clearable",!0)("items",e.channelOptions),T("ngModel",e.searchFilter.ListChannelID),r(5),l("ngForOf",e.products),r(),l("ngIf",(e.products==null?null:e.products.length)==0),r(),l("ngIf",(e.products==null?null:e.products.length)>0))},dependencies:[A,V,U,L,z,nt,gt,Lt,Gt,q,K],encapsulation:2})}}return i})();var Di=()=>["/menu/products/status/sold-in-channel"],on=i=>({ID:i}),Oi=()=>["/menu/products/status/not-in-pos"];function ki(i,d){if(i&1&&(b(0),p(1),P()),i&2){let t=s().$implicit;r(),y(" ",t.Count," ")}}function Ei(i,d){if(i&1){let t=x();o(0,"span",26),g("click",function(){m(t);let e=s().$implicit,c=s(2);return u(c.getLiveProductCount(e.ID,e))}),_(1,"i",27),a()}}function Fi(i,d){if(i&1){let t=x();o(0,"tr")(1,"td"),_(2,"img",17),o(3,"span",18),p(4),a()(),o(5,"td",19),C(6,ki,2,1,"ng-container",6)(7,Ei,2,0,"ng-template",null,1,j),a(),o(9,"td",19)(10,"a",20),p(11),k(12,"number"),a()(),o(13,"td",19)(14,"a",20),p(15),k(16,"number"),a()(),o(17,"td"),p(18),k(19,"date"),a(),o(20,"td")(21,"div",21)(22,"button",22),g("click",function(){let e=m(t).$implicit,c=s(2);return u(c.onScanChannel(e))}),_(23,"i",23),p(24," Scan "),a(),o(25,"button",24),g("click",function(){let e=m(t).$implicit,c=s(2);return u(c.onClearCache(e.ID))}),_(26,"i",25),p(27," Clear "),a()()()()}if(i&2){let t=d.$implicit,n=B(8),e=s(2);r(2),l("src",e.getChannelLogo(t.TypeID),w),r(2),N(t.Name),r(2),l("ngIf",t.Count!==void 0)("ngIfElse",n),r(4),l("routerLink",ct(18,Di))("queryParams",Q(19,on,t.ID)),r(),y(" ",E(12,11,t.SoldInChannel)," "),r(3),l("routerLink",ct(21,Oi))("queryParams",Q(22,on,t.ID)),r(),y(" ",E(16,13,t.NotInPOS)," "),r(3),y("",t.LastSync?he(19,15,t.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function Vi(i,d){if(i&1&&(b(0),o(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),p(6,"Channel"),a(),o(7,"th",11),p(8,"Live Product"),a(),o(9,"th",12),p(10,"Sold In Channel"),a(),o(11,"th",13),p(12,"Product Not in POS"),a(),o(13,"th",14),p(14,"Last Sync"),a(),_(15,"th",15),a()(),o(16,"tbody"),C(17,Fi,28,24,"tr",16),k(18,"async"),a()()(),P()),i&2){let t,n=s();r(17),l("ngForOf",(t=E(18,1,n.channels$))==null?null:t.Data)}}function Ni(i,d){i&1&&(o(0,"div",28),_(1,"app-empty-state"),a())}var an=(()=>{class i{constructor(t,n,e,c){this.productService=t,this.toastr=n,this.dialog=e,this.authService=c,this.destroy$=new ae,this.channelOptions=c.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,n){this.productService.getTotalProductLive(t).pipe(Jt(this.destroy$)).subscribe(e=>{n.Count=e.Count})}onScanChannel(t){this.dialog.open(R,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(F(n=>f.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(F(c=>c)).subscribe(c=>{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(c,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(Jt(this.destroy$)).subscribe(e=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return f.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(n){return new(n||i)(S(H),S($),S(Z),S(G))}}static{this.\u0275cmp=M({type:i,selectors:[["app-channel-statistic"]],standalone:!1,decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(n,e){if(n&1&&(o(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),C(5,Vi,19,3,"ng-container",6),k(6,"async"),C(7,Ni,2,0,"ng-template",null,0,j),a()()()()()),n&2){let c,h=B(8);l("hideSearchBox",!0)("hideSearchDropdown",!0),r(5),l("ngIf",((c=E(6,4,e.channels$))==null||c.Data==null?null:c.Data.length)>0)("ngIfElse",h)}},dependencies:[A,V,z,it,Ut,K,mt,ut,_e],encapsulation:2})}}return i})();var Ai=[{component:Je,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:Qe,canActivate:[st],data:{title:"Products in POS"}},{path:"sold-in-channel",component:Xe,canActivate:[st],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:tn,canActivate:[st],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:en,canActivate:[st],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:nn,canActivate:[st],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:an,canActivate:[st],data:{title:"Channel Statistic"}}]}],nr=(()=>{class i{static{this.\u0275fac=function(n){return new(n||i)}}static{this.\u0275mod=de({type:i})}static{this.\u0275inj=ce({imports:[Y,_t,Ie,ot,xe,Ke,Ee,Me,Gt,q,rt,Ce.forChild(Ai),We,Ne,bt]})}}return i})();export{nr as StatusModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as xe,b as Ce}from"./chunk-K3FQGMAY.js";import{a as ge,b as ue}from"./chunk-YXFTLQ5M.js";import{b as se}from"./chunk-J7AGLBPL.js";import{a as de}from"./chunk-VGXQU74M.js";import{a as pe}from"./chunk-RIHLYYZU.js";import{a as ne,l as le}from"./chunk-LEMNVA5V.js";import{d as _e,h as me}from"./chunk-ITTRZMEX.js";import{r as ae,s as ce}from"./chunk-TMFFA26Y.js";import{b as J,h as Q,m as ee,y as te}from"./chunk-DPLEMBB4.js";import{c as ie,e as oe,f as re}from"./chunk-PXB4YEY3.js";import{d as Z,f as q,g as K,i as X,m as Y,n as G}from"./chunk-GPEVUTDI.js";import{$c as H,Dc as b,Eb as z,Ec as s,Fc as V,Gc as y,Ic as k,Jc as O,Ka as $,Kb as p,Kc as D,Na as B,Qc as u,Wb as m,Zc as N,_c as R,ad as w,bc as v,ca as W,cc as P,ec as E,f as L,fc as M,gc as a,hc as _,ic as I,jc as C,kc as h,lc as U,mc as f,ob as S,qb as r,rc as T,sc as o,vc as A,wb as F,ya as d,za as g}from"./chunk-T5ONJF63.js";var j=t=>[t],fe=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"text-danger":t}),ye=t=>({"bg-gradient-warning":t});function Se(t,c){if(t&1){let e=f();a(0,"mat-slide-toggle",13),T("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),a(1,"small",14),s(2),_()()}if(t&2){let e=o();r(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ve(t,c){if(t&1){let e=f();a(0,"th")(1,"input",16),D("ngModelChange",function(n){d(e);let l=o(2);return O(l.checkboxState,n)||(l.checkboxState=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);r(),k("ngModel",e.checkboxState)}}function Ie(t,c){if(t&1&&(p(0,ve,2,1,"ng-template",15),a(1,"th",11),s(2,"POS"),_()),t&2){let e=o();m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function we(t,c){if(t&1&&(C(0),a(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),a(5,"div",21),s(6),N(7,"stringLimit"),_()()()(),h()),t&2){let e=c.$implicit;r(3),m("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),m("src",e==null?null:e.Img,S),r(2),y(" ",H(7,3,e.Name,20)," ")}}function Fe(t,c){t&1&&U(0)}function Pe(t,c){if(t&1&&(C(0),p(1,Fe,1,0,"ng-container",33),h()),t&2){o();let e=b(7);r(),m("ngTemplateOutlet",e)}}function Ee(t,c){t&1&&U(0)}function Me(t,c){if(t&1&&p(0,Ee,1,0,"ng-container",33),t&2){o(2);let e=b(7);m("ngTemplateOutlet",e)}}function Ve(t,c){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let e=o(4);m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function ke(t,c){if(t&1){let e=f();C(0),a(1,"input",34),D("ngModelChange",function(n){d(e);let l=o(4).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(4).$implicit,l=o();return g(l.onCheckboxStateProduct(n.ID))}),_(),h()}if(t&2){let e=o(4).$implicit;r(),k("ngModel",e.selected),m("disabled",!(e!=null&&e.Category))}}function Oe(t,c){if(t&1&&p(0,ke,2,2,"ng-container",22),t&2){let e=o(3).$implicit;m("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function De(t,c){if(t&1){let e=f();C(0),a(1,"img",35),T("click",function(n){d(e);let l=o(3).$implicit,x=o();return g(x.onZoomImage(n,l==null?null:l.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;r(),A("src",e==null?null:e.ThumbnailUrl,S)}}function Ne(t,c){t&1&&I(0,"img",36)}function $e(t,c){if(t&1&&(C(0),a(1,"td",28)(2,"div",29),p(3,Pe,2,1,"ng-container",30)(4,Ve,1,3,"ng-template",null,0,w)(6,Oe,1,1,"ng-template",null,1,w),a(8,"div",26),p(9,De,2,1,"ng-container",30)(10,Ne,1,0,"ng-template",null,2,w),_()()(),a(12,"td",31)(13,"div"),s(14),_(),a(15,"small",32),s(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,l=o();r(),m("rowSpan",n==null?null:n.Variants.length),r(2),m("ngIf",l.table=="inventory")("ngIfElse",e),r(5),m("ngClass",u(10,Te,(n==null||n.Variants==null?null:n.Variants.length)<=1)),r(),m("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",n==null?null:n.Variants.length),r(2),V(n==null?null:n.Name),r(),m("ngClass",u(12,be,!(n!=null&&n.Category))),r(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Be(t,c){if(t&1&&(a(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),S)}}function Ue(t,c){if(t&1){let e=f();a(0,"input",40),D("ngModelChange",function(n){d(e);let l=o(3).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),m("disabled",!(i!=null&&i.Category))}}function Re(t,c){if(t&1&&(a(0,"td",38),p(1,Ue,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);r(),m("ngIf",i.printPOS(e)>=0||i.table=="price")}}function je(t,c){if(t&1&&(p(0,Re,2,1,"ng-template",15),a(1,"td",24),s(2),N(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);m("ngxPermissionsOnly",u(4,j,i.rolePriceEdit)),r(2),V(R(3,2,i.printPOS(e)))}}function Le(t,c){if(t&1){let e=f();C(0),a(1,"td",41),T("click",function(){d(e);let n=o().$implicit,l=o().$implicit,x=o().$implicit,he=o();return g(he.openTableDialog(x.Name,l,n.ID,x.ChannelItemID))}),a(2,"div",29)(3,"div",42),s(4),N(5,"number"),_(),a(6,"a",43),T("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=c.$implicit,i=o(2).$implicit,n=o(2);r(),m("ngClass",u(5,ye,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1)),r(3),y(" ",R(5,3,n.printItem(e))," "),r(2),m("href",e.Url,S)}}function We(t,c){t&1&&(a(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function ze(t,c){if(t&1&&p(0,Le,8,7,"ng-container",30)(1,We,4,0,"ng-template",null,3,w),t&2){let e=c.$implicit,i=b(2),n=o().$implicit,l=o(2);m("ngIf",l.getItemFromChannel(n,e))("ngIfElse",i)}}function Ae(t,c){if(t&1&&(a(0,"tr"),p(1,$e,17,14,"ng-container",22),a(2,"td",23),s(3),_(),a(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),a(8,"div",21),p(9,Be,2,1,"a",27),_()()(),p(10,je,4,6),E(11,ze,3,2,null,null,P),_()),t&2){let e=c.$implicit,i=c.$index,n=o().$implicit,l=o();r(),m("ngIf",i==0),r(2),V(e==null?null:e.Model),r(2),m("matTooltip",e.Discontinued?l.discontinuedVariantMsg:""),r(),m("ngClass",u(7,fe,e.Discontinued)),r(),y(" ",e.Code," "),r(2),v(n.Category?9:-1),r(),v(l.hiddenIPOSInventory()==!1?10:-1),r(),M(l.channel)}}function He(t,c){if(t&1&&(a(0,"tbody"),E(1,Ae,13,9,"tr",null,P),_()),t&2){let e=c.$implicit;r(),M(e.Variants)}}var ht=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=ne.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new $,this.destroy$=new L,this.toggle=new $,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(l=>(l.selected=n.selected,l)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(l=>ie.IsNotEmpty(i.LocationID)?l.LocationID==i.LocationID:l.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}openTableDialog(e,i,n,l){this.dialog.open(xe,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:l}}).afterClosed().pipe(W(this.destroy$)).subscribe(x=>{x!=null&&this.onSubmit.emit(x)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(F(_e),F(de),F(le))}}static{this.\u0275cmp=z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(a(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,Se,3,1,"mat-slide-toggle",9),_()(),a(9,"th",10),s(10,"Variant"),_(),a(11,"th",11),s(12,"SKU"),_(),p(13,Ie,3,3)(14,we,8,6,"ng-container",12),_()(),E(15,He,3,0,"tbody",null,P),_()()),i&2&&(r(8),v(n.showProductToggle?8:-1),r(5),v(n.hiddenIPOSInventory()==!1?13:-1),r(),m("ngForOf",n.channel),r(),M(n.data))},dependencies:[G,Z,q,K,X,Y,te,J,Q,ee,ue,ge,me,pe,se,re,oe,ce,ae,Ce],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{ht as a};
|
|
1
|
+
import{a as xe,b as Ce}from"./chunk-WKHHCF3P.js";import{a as ge,b as ue}from"./chunk-YXFTLQ5M.js";import{b as se}from"./chunk-J7AGLBPL.js";import{a as de}from"./chunk-VGXQU74M.js";import{a as pe}from"./chunk-RIHLYYZU.js";import{a as ne,l as le}from"./chunk-67JBJ45X.js";import{d as _e,h as me}from"./chunk-ITTRZMEX.js";import{r as ae,s as ce}from"./chunk-TMFFA26Y.js";import{b as J,h as Q,m as ee,y as te}from"./chunk-DPLEMBB4.js";import{c as ie,e as oe,f as re}from"./chunk-PXB4YEY3.js";import{d as Z,f as q,g as K,i as X,m as Y,n as G}from"./chunk-GPEVUTDI.js";import{$c as H,Dc as b,Eb as z,Ec as s,Fc as V,Gc as y,Ic as k,Jc as O,Ka as $,Kb as p,Kc as D,Na as B,Qc as u,Wb as m,Zc as N,_c as R,ad as w,bc as v,ca as W,cc as P,ec as E,f as L,fc as M,gc as a,hc as _,ic as I,jc as C,kc as h,lc as U,mc as f,ob as S,qb as r,rc as T,sc as o,vc as A,wb as F,ya as d,za as g}from"./chunk-T5ONJF63.js";var j=t=>[t],fe=t=>({"text-decoration-line-through":t}),Te=t=>({"ms-10":t}),be=t=>({"text-danger":t}),ye=t=>({"bg-gradient-warning":t});function Se(t,c){if(t&1){let e=f();a(0,"mat-slide-toggle",13),T("toggleChange",function(){d(e);let n=o();return n.toggleStatus=!n.toggleStatus,g(n.onToggle())}),a(1,"small",14),s(2),_()()}if(t&2){let e=o();r(2),y(" ",e.productToggleTitle?e.productToggleTitle:"FILTER DIFFERENT INVENTORY"," ")}}function ve(t,c){if(t&1){let e=f();a(0,"th")(1,"input",16),D("ngModelChange",function(n){d(e);let l=o(2);return O(l.checkboxState,n)||(l.checkboxState=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(2);return g(n.onCheckboxStateChange())}),_()()}if(t&2){let e=o(2);r(),k("ngModel",e.checkboxState)}}function Ie(t,c){if(t&1&&(p(0,ve,2,1,"ng-template",15),a(1,"th",11),s(2,"POS"),_()),t&2){let e=o();m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function we(t,c){if(t&1&&(C(0),a(1,"th",17)(2,"div",18)(3,"div",19),I(4,"img",20),a(5,"div",21),s(6),N(7,"stringLimit"),_()()()(),h()),t&2){let e=c.$implicit;r(3),m("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),m("src",e==null?null:e.Img,S),r(2),y(" ",H(7,3,e.Name,20)," ")}}function Fe(t,c){t&1&&U(0)}function Pe(t,c){if(t&1&&(C(0),p(1,Fe,1,0,"ng-container",33),h()),t&2){o();let e=b(7);r(),m("ngTemplateOutlet",e)}}function Ee(t,c){t&1&&U(0)}function Me(t,c){if(t&1&&p(0,Ee,1,0,"ng-container",33),t&2){o(2);let e=b(7);m("ngTemplateOutlet",e)}}function Ve(t,c){if(t&1&&p(0,Me,1,1,"ng-template",15),t&2){let e=o(4);m("ngxPermissionsOnly",u(1,j,e.rolePriceEdit))}}function ke(t,c){if(t&1){let e=f();C(0),a(1,"input",34),D("ngModelChange",function(n){d(e);let l=o(4).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),T("ngModelChange",function(){d(e);let n=o(4).$implicit,l=o();return g(l.onCheckboxStateProduct(n.ID))}),_(),h()}if(t&2){let e=o(4).$implicit;r(),k("ngModel",e.selected),m("disabled",!(e!=null&&e.Category))}}function Oe(t,c){if(t&1&&p(0,ke,2,2,"ng-container",22),t&2){let e=o(3).$implicit;m("ngIf",(e==null||e.Variants==null?null:e.Variants.length)>1)}}function De(t,c){if(t&1){let e=f();C(0),a(1,"img",35),T("click",function(n){d(e);let l=o(3).$implicit,x=o();return g(x.onZoomImage(n,l==null?null:l.ImageUrl))}),_(),h()}if(t&2){let e=o(3).$implicit;r(),A("src",e==null?null:e.ThumbnailUrl,S)}}function Ne(t,c){t&1&&I(0,"img",36)}function $e(t,c){if(t&1&&(C(0),a(1,"td",28)(2,"div",29),p(3,Pe,2,1,"ng-container",30)(4,Ve,1,3,"ng-template",null,0,w)(6,Oe,1,1,"ng-template",null,1,w),a(8,"div",26),p(9,De,2,1,"ng-container",30)(10,Ne,1,0,"ng-template",null,2,w),_()()(),a(12,"td",31)(13,"div"),s(14),_(),a(15,"small",32),s(16),_()(),h()),t&2){let e=b(5),i=b(11),n=o(2).$implicit,l=o();r(),m("rowSpan",n==null?null:n.Variants.length),r(2),m("ngIf",l.table=="inventory")("ngIfElse",e),r(5),m("ngClass",u(10,Te,(n==null||n.Variants==null?null:n.Variants.length)<=1)),r(),m("ngIf",n==null?null:n.ThumbnailUrl)("ngIfElse",i),r(3),m("rowSpan",n==null?null:n.Variants.length),r(2),V(n==null?null:n.Name),r(),m("ngClass",u(12,be,!(n!=null&&n.Category))),r(),y("(",n!=null&&n.Category?n==null?null:n.Category:"Not Found In POS",")")}}function Be(t,c){if(t&1&&(a(0,"a",27),I(1,"i",37),_()),t&2){let e=o().$implicit,i=o(2);m("href",i.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),S)}}function Ue(t,c){if(t&1){let e=f();a(0,"input",40),D("ngModelChange",function(n){d(e);let l=o(3).$implicit;return O(l.selected,n)||(l.selected=n),g(n)}),_()}if(t&2){let e=o(3).$implicit,i=o().$implicit;k("ngModel",e.selected),m("disabled",!(i!=null&&i.Category))}}function Re(t,c){if(t&1&&(a(0,"td",38),p(1,Ue,1,2,"input",39),_()),t&2){let e=o(2).$implicit,i=o(2);r(),m("ngIf",i.printPOS(e)>=0||i.table=="price")}}function je(t,c){if(t&1&&(p(0,Re,2,1,"ng-template",15),a(1,"td",24),s(2),N(3,"number"),_()),t&2){let e=o().$implicit,i=o(2);m("ngxPermissionsOnly",u(4,j,i.rolePriceEdit)),r(2),V(R(3,2,i.printPOS(e)))}}function Le(t,c){if(t&1){let e=f();C(0),a(1,"td",41),T("click",function(){d(e);let n=o().$implicit,l=o().$implicit,x=o().$implicit,he=o();return g(he.openTableDialog(x.Name,l,n.ID,x.ChannelItemID))}),a(2,"div",29)(3,"div",42),s(4),N(5,"number"),_(),a(6,"a",43),T("click",function(n){return d(e),g(n==null?null:n.stopPropagation())}),I(7,"i",37),_()()(),h()}if(t&2){let e=c.$implicit,i=o(2).$implicit,n=o(2);r(),m("ngClass",u(5,ye,n.printPOS(i)!=n.printItem(e)&&n.hiddenIPOSInventory()==!1)),r(3),y(" ",R(5,3,n.printItem(e))," "),r(2),m("href",e.Url,S)}}function We(t,c){t&1&&(a(0,"td",44)(1,"div",29)(2,"span"),s(3,"X"),_()()())}function ze(t,c){if(t&1&&p(0,Le,8,7,"ng-container",30)(1,We,4,0,"ng-template",null,3,w),t&2){let e=c.$implicit,i=b(2),n=o().$implicit,l=o(2);m("ngIf",l.getItemFromChannel(n,e))("ngIfElse",i)}}function Ae(t,c){if(t&1&&(a(0,"tr"),p(1,$e,17,14,"ng-container",22),a(2,"td",23),s(3),_(),a(4,"td",24)(5,"div",25)(6,"div",26),s(7),_(),a(8,"div",21),p(9,Be,2,1,"a",27),_()()(),p(10,je,4,6),E(11,ze,3,2,null,null,P),_()),t&2){let e=c.$implicit,i=c.$index,n=o().$implicit,l=o();r(),m("ngIf",i==0),r(2),V(e==null?null:e.Model),r(2),m("matTooltip",e.Discontinued?l.discontinuedVariantMsg:""),r(),m("ngClass",u(7,fe,e.Discontinued)),r(),y(" ",e.Code," "),r(2),v(n.Category?9:-1),r(),v(l.hiddenIPOSInventory()==!1?10:-1),r(),M(l.channel)}}function He(t,c){if(t&1&&(a(0,"tbody"),E(1,Ae,13,9,"tr",null,P),_()),t&2){let e=c.$implicit;r(),M(e.Variants)}}var ht=(()=>{class t{constructor(e,i,n){this.dialog=e,this.biggerPictureService=i,this.authService=n,this.showProductToggle=!1,this.multiwarehouse=B(!1),this.hiddenIPOSInventory=B(!1),this.toggleStatus=!1,this.checkboxState=!1,this.rolePriceEdit=ne.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.onSubmit=new $,this.destroy$=new L,this.toggle=new $,this.hostName=this.authService.getDomain()}ngOnInit(){this.table=="inventory"?this.stockHeader="Stock":this.table=="price"&&(this.stockHeader="Price")}onCheckboxStateProduct(e){let i=this.data.filter(n=>n.ID==e);i.length>0&&(i=i.map(n=>(n.Variants=n.Variants.map(l=>(l.selected=n.selected,l)),n)))}onCheckboxStateChange(){this.data=this.data.map(e=>(e.Variants=e.Variants.map(i=>(i.selected=this.checkboxState,i)),e))}getItemFromChannel(e,i){return e.Channel.find(l=>ie.IsNotEmpty(i.LocationID)?l.LocationID==i.LocationID:l.ChannelID==i.ID)}printItem(e){if(this.table=="inventory")return e.Inventory;if(this.table=="price")return e.Price}openTableDialog(e,i,n,l){this.dialog.open(xe,{data:{Name:e,Variant:i,ChannelID:n,Table:this.table,ChannelItemID:l}}).afterClosed().pipe(W(this.destroy$)).subscribe(x=>{x!=null&&this.onSubmit.emit(x)})}printPOS(e){return this.table=="inventory"?e.Inventory?e.Inventory:0:this.table=="price"?e.UnitPrice:null}onToggle(){this.toggle.emit(this.toggleStatus)}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||t)(F(_e),F(de),F(le))}}static{this.\u0275cmp=z({type:t,selectors:[["app-table"]],inputs:{data:"data",table:"table",channel:"channel",showProductToggle:"showProductToggle",productToggleTitle:"productToggleTitle",multiwarehouse:[1,"multiwarehouse"],hiddenIPOSInventory:[1,"hiddenIPOSInventory"]},outputs:{onSubmit:"onSubmit",toggle:"onToggle"},decls:17,vars:3,consts:[["PRICE",""],["checkbox_update",""],["elsePic",""],["elseCol",""],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","w-25"],[1,"w-100"],[2,"width","200px"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[4,"ngFor","ngForOf"],[2,"width","200px",3,"toggleChange"],[1,"fw-bold"],[3,"ngxPermissionsOnly"],["type","checkbox",3,"ngModelChange","ngModel"],["scope","col"],[1,"w-100","d-flex","align-items-center","justify-content-center"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],[4,"ngIf"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-end",3,"matTooltip"],[3,"ngClass"],["target","_blank",3,"href"],[1,"text-center",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"padding-left","0px",3,"rowSpan"],[1,"mt-1",3,"ngClass"],[4,"ngTemplateOutlet"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel","disabled"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"align-middle"],["type","checkbox",3,"ngModel","disabled","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel","disabled"],[1,"p-0","pointer","cell-hover",3,"click","ngClass"],[1,"me-2","mt-1"],["target","_blank",3,"click","href"],[1,"table-white","text-center",2,"color","red"]],template:function(i,n){i&1&&(a(0,"div",4)(1,"table",5)(2,"thead",6)(3,"tr")(4,"th",7)(5,"div",8)(6,"div"),s(7,"Product"),_(),p(8,Se,3,1,"mat-slide-toggle",9),_()(),a(9,"th",10),s(10,"Variant"),_(),a(11,"th",11),s(12,"SKU"),_(),p(13,Ie,3,3)(14,we,8,6,"ng-container",12),_()(),E(15,He,3,0,"tbody",null,P),_()()),i&2&&(r(8),v(n.showProductToggle?8:-1),r(5),v(n.hiddenIPOSInventory()==!1?13:-1),r(),m("ngForOf",n.channel),r(),M(n.data))},dependencies:[G,Z,q,K,X,Y,te,J,Q,ee,ue,ge,me,pe,se,re,oe,ce,ae,Ce],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}.text-wrapping[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:88px}.cell-hover[_ngcontent-%COMP%]{width:400px!important}"]})}}return t})();export{ht as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,k as C}from"./chunk-
|
|
1
|
+
import{j as r,k as C}from"./chunk-67JBJ45X.js";import{b as l,e as S}from"./chunk-BUFEIJAI.js";import{b as a,c as u}from"./chunk-PXB4YEY3.js";import{aa as p,ea as h,ja as c,oa as o,v as s}from"./chunk-T5ONJF63.js";var y=(()=>{class i{constructor(e,t,n){this.httpService=e,this.toastr=t,this.tokenService=n}saveChannel(e){return this.httpService.post("/api/Channel/SubmitChannel",e).pipe(p(t=>this.tokenService.refreshToken().pipe(s(n=>t))))}getLastSync(e){return this.httpService.get(`${r.ChannelGetLastSyncByID}/?ID=${e}`)}getChannel(e){return this.httpService.post(r.GetChannel,e)}getChannelLoader(){return this.httpService.get(r.GetChannelLoader)}testShopID(e){return this.httpService.post(r.TestShopID,e).pipe(h(t=>{this.showTostrSuccessTestShopID(t)}))}updateChannelIndex(e){return this.httpService.post(r.UpdateChannelIndex,e)}deleteChannel(e){return this.httpService.post(r.DeleteChannel,e)}mapChannelImage(e){return e.map(t=>(t.img=u.getChannelLogoByTypeId(t.TypeID),t))}showTostrSuccessTestShopID(e){let t="";for(var n in e)t+=n+" : "+e[n]+"<br/>";this.toastr.success(t,"Success",{enableHtml:!0,closeButton:!0,positionClass:"toast-bottom-right"})}getRegisterByOutletName(e){return this.httpService.post(r.GetRegisterByOutletName,{Outlet:e})}getChannelRowCount(e){return this.httpService.post(r.GetChannelRowCount,e).pipe(s(t=>t.Count))}getChannelWarehouse(e){return this.httpService.get(`${r.GetChannelWarehouse}/?ChannelID=${e}`)}unSynchronizedWarehouse(e){return this.httpService.delete(`${r.UnSynchronizedWarehouse}?ID=${e}`)}authorizedChannel(e){let t=this.getApiAuthorize(e);return this.httpService.post(`/api/${t}`,null).pipe(h(n=>{window.open(n.Url,"_blank")}))}getApiAuthorize(e){let t;switch(e){case a.Shopee:t="ChannelAuthorization/ShopeeV2_URL";break;case a.Tiktok:t="ChannelAuthorization/Tiktok_URL";break;case a.Lazada:t="ChannelAuthorization/Lazada_URL";break}return t}static{this.\u0275fac=function(t){return new(t||i)(o(S),o(l),o(C))}}static{this.\u0275prov=c({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})();export{y as a};
|