marketplacepos 3.13.5 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/Marketplace/{chunk-KQ5DOU4A.js → chunk-27KRVOVV.js} +1 -1
  2. package/Marketplace/{chunk-BGN73QQI.js → chunk-2U52BOK6.js} +10 -9
  3. package/Marketplace/{chunk-GVS44OWQ.js → chunk-5DAS2XHT.js} +1 -1
  4. package/Marketplace/{chunk-LJDPILCP.js → chunk-5RBA5Q4C.js} +1 -1
  5. package/Marketplace/{chunk-OAKENGDC.js → chunk-6PK2RRGP.js} +1 -1
  6. package/Marketplace/{chunk-44JSD7TR.js → chunk-7SN6N4WR.js} +1 -1
  7. package/Marketplace/{chunk-V2UYOAT2.js → chunk-AQJ4BQQR.js} +1 -1
  8. package/Marketplace/{chunk-E3E6TUYP.js → chunk-ARA5O5PX.js} +1 -1
  9. package/Marketplace/{chunk-4XJJVBCX.js → chunk-D6ANC3SS.js} +1 -1
  10. package/Marketplace/{chunk-Q64RKYUS.js → chunk-F6UMOF3O.js} +1 -1
  11. package/Marketplace/chunk-FTV52HXX.js +1 -0
  12. package/Marketplace/{chunk-D4HBNVTL.js → chunk-H5G3XI3T.js} +1 -1
  13. package/Marketplace/{chunk-UYN5TJJ7.js → chunk-HNOVDG7D.js} +1 -1
  14. package/Marketplace/{chunk-O5GGWOBM.js → chunk-HRKBU5UW.js} +1 -1
  15. package/Marketplace/chunk-J47B3BJQ.js +1 -0
  16. package/Marketplace/{chunk-XLSYUMRS.js → chunk-LBHJSQBZ.js} +1 -1
  17. package/Marketplace/{chunk-N3VBGSQH.js → chunk-MOFF6ASU.js} +1 -1
  18. package/Marketplace/{chunk-GEQYSMX6.js → chunk-O2WRF4JL.js} +1 -1
  19. package/Marketplace/{chunk-YDGPF5OU.js → chunk-Q7FQTBT6.js} +1 -1
  20. package/Marketplace/{chunk-4A2BQXM5.js → chunk-SZX66K7N.js} +1 -1
  21. package/Marketplace/chunk-U75FY3SB.js +3 -0
  22. package/Marketplace/{chunk-HFUGRK45.js → chunk-U7BIKZZA.js} +1 -1
  23. package/Marketplace/{chunk-IYN33JGO.js → chunk-VQQXE7MA.js} +1 -1
  24. package/Marketplace/{chunk-BTKJJ5MP.js → chunk-WVF7SHZL.js} +1 -1
  25. package/Marketplace/{chunk-RPO7IHUU.js → chunk-ZPUPB7UU.js} +1 -1
  26. package/Marketplace/index.html +2 -2
  27. package/Marketplace/{main-TYOAJ6YV.js → main-SOGOPFYM.js} +1 -1
  28. package/package.json +1 -1
  29. package/Marketplace/chunk-MLGEX4PW.js +0 -1
  30. package/Marketplace/chunk-T6XF6UXO.js +0 -3
  31. package/Marketplace/chunk-YUYOQ6ZT.js +0 -1
@@ -1 +1 @@
1
- import{a as N}from"./chunk-2YXHLXID.js";import{a as Ee}from"./chunk-V6L3NRY3.js";import{a as xe,b as fe,d as Se,e as Pe}from"./chunk-S5GA4AVB.js";import{a as M}from"./chunk-BSBYMQ7J.js";import{a as Me,b as U,c as Ne}from"./chunk-L34D7YAZ.js";import{a as ge}from"./chunk-662E5VTA.js";import{a as be,c as De}from"./chunk-5WXM6HSA.js";import{a as Ve,b as Te}from"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as Fe}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as ue}from"./chunk-XLSYUMRS.js";import{b as oe,e as re}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as Ie,k as ye,l as we,m as ve}from"./chunk-4R22UO7N.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{b as le,c as ce,h as se,k as _e,m as pe,u as me}from"./chunk-B3LBEB32.js";import{c as de,e as he,f as Ce}from"./chunk-QPRFFPO5.js";import{$a as _,$b as Y,B as A,Bc as E,Cc as ae,Ha as V,Hb as J,Ia as l,Ib as d,Ja as f,Jb as B,Kb as T,Lb as Z,Mb as I,Nb as y,Ob as w,Pb as Q,Q as $,Qb as X,Sb as b,X as j,Za as h,Zb as v,_b as F,ac as ee,da as z,ga as G,gb as S,hb as k,jb as R,kb as L,lb as o,mb as c,nb as P,oa as p,ob as K,pa as m,pb as q,rb as x,sc as te,ub as u,vc as ne,wb as r,yc as ie,zb as H}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Le=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),_("src",t==null?null:t.Img,V),l(),T(" ",t.Name," ")}}function We(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){p(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),o(3,"button",14),u("click",function(){p(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),_("ngIf",e.productService.hasSelectionVariant(t))}}function $e(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){p(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function je(i,s){if(i&1){let t=x();o(0,"input",51),w("ngModelChange",function(n){p(t);let a=r(4).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){p(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let t=r(6);_("ngxPermissionsOnly",b(1,O,t.rolePriceEdit))}}function Ge(i,s){if(i&1){let t=x();K(0),o(1,"img",52),u("click",function(n){p(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),q()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,V)}}function Ke(i,s){i&1&&P(0,"img",53)}function qe(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),T("(",t.Category,")")}}function He(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),o(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,Ke,1,0,"ng-template",null,0,ee),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,qe,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;_("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),_("ngClass",b(8,Ue,(e.Variants==null?null:e.Variants.length)<=1)),l(),_("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),_("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Je(i,s){if(i&1){let t=x();o(0,"input",56),w("ngModelChange",function(n){p(t);let a=r(2).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Ze(i,s){if(i&1&&(o(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),T(" ",F(2,1,t.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),_("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),V)}}function et(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){p(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),T(" ",F(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,He,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=p(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),_("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",b(12,Le,t.Discontinued)),l(),T(" ",t.Code," "),l(),_("ngxPermissionsOnly",b(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),_("ngClass",b(16,Be,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),_("href",t.Channel[0]==null?null:t.Channel[0].Url,V)}}function nt(i,s){if(i&1&&R(0,tt,22,18,"tr",33,k),i&2){let t=s.$implicit;L(t.Variants)}}function it(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),w("ngModelChange",function(n){p(t);let a=r(2);return y(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){p(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){p(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),R(26,nt,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){p(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),_("ngxPermissionsOnly",b(17,O,e.rolePriceEdit)),l(4),_("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),_("src",e.selectedChannel==null?null:e.selectedChannel.Img,V),l(2),Z(" ",Y(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),l(3),L(t),l(2),_("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",F(29,15,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function at(i,s){if(i&1){let t=x();o(0,"mainpanel",2),w("textChange",function(n){p(t);let a=r();return y(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){p(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Oe,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,19,"content",9),v(18,"async"),c()}if(i&2){let t=r();_("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),_("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),_("ngIf",F(16,9,t.data$)),l(2),_("ngIf",F(18,11,t.data$))}}var Wt=(()=>{let s=class s{constructor(e,n,a,g,C,D,W,ke,Re){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=D,this.authService=W,this.mainPanelService=ke,this.decimalPipe=Re,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ge.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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Me,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(D=>de.IsNotEmpty(D))).subscribe(D=>{this.updateItemAfterDialog(D,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${a.Price?this.decimalPipe.transform(a.Price):a.Price}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(re),f(oe),f(Ie),f(be),f(Fe),f(N),f(ue),f(ye),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Q([U,N,E]),X],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[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","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,at,19,13,"mainpanel",1),v(1,"async")),n&2&&_("ngIf",F(1,1,a.loader$))},dependencies:[ae,te,ne,ie,E,ve,we,Pe,Se,xe,fe,me,ce,pe,le,se,_e,De,Ne,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{Wt as PriceSingleChannelComponent};
1
+ import{a as N}from"./chunk-2YXHLXID.js";import{a as Ee}from"./chunk-V6L3NRY3.js";import{a as xe,b as fe,d as Pe,e as Se}from"./chunk-S5GA4AVB.js";import{a as M}from"./chunk-BSBYMQ7J.js";import{a as Me,b as U,c as Ne}from"./chunk-L34D7YAZ.js";import{a as ge}from"./chunk-662E5VTA.js";import{a as be,c as De}from"./chunk-5WXM6HSA.js";import{a as Ve,b as Te}from"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as Fe}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as ue}from"./chunk-LBHJSQBZ.js";import{b as oe,e as re}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as Ie,k as ye,l as we,m as ve}from"./chunk-4R22UO7N.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import{b as le,c as ce,h as se,k as _e,m as pe,u as me}from"./chunk-B3LBEB32.js";import{c as de,e as he,f as Ce}from"./chunk-QPRFFPO5.js";import{$a as _,$b as Y,B as A,Bc as E,Cc as ae,Ha as T,Hb as J,Ia as l,Ib as d,Ja as f,Jb as B,Kb as D,Lb as Z,Mb as I,Nb as y,Ob as w,Pb as Q,Q as $,Qb as X,Sb as F,X as j,Za as h,Zb as v,_b as V,ac as ee,da as z,ga as G,gb as P,hb as k,jb as R,kb as L,lb as o,mb as c,nb as S,oa as p,ob as K,pa as m,pb as q,rb as x,sc as te,ub as u,vc as ne,wb as r,yc as ie,zb as H}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Le=i=>({"text-decoration-line-through":i}),Be=i=>({"bg-gradient-warning":i}),Ue=i=>({"ms-10":i});function Oe(i,s){if(i&1&&(o(0,"span",10),S(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),_("src",t==null?null:t.Img,T),l(),D(" ",t.Name," ")}}function We(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){p(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),S(1,"i",17),d(2," Update "),c()}}function Ae(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,We,3,0,"button",13),o(3,"button",14),u("click",function(){p(t);let n=r(2);return m(n.openExportDialog())}),S(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),_("ngIf",e.productService.hasSelectionVariant(t))}}function $e(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){p(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function je(i,s){if(i&1){let t=x();o(0,"input",51),w("ngModelChange",function(n){p(t);let a=r(4).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){p(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function ze(i,s){if(i&1&&h(0,je,1,1,"ng-template",26),i&2){let t=r(6);_("ngxPermissionsOnly",F(1,O,t.rolePriceEdit))}}function Ge(i,s){if(i&1){let t=x();K(0),o(1,"img",52),u("click",function(n){p(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),q()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,T)}}function Ke(i,s){i&1&&S(0,"img",53)}function qe(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),D("(",t.Category,")")}}function He(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,ze,1,3,null,26),o(3,"div",46),h(4,Ge,2,1,"ng-container",47)(5,Ke,1,0,"ng-template",null,0,ee),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,qe,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;_("rowSpan",e.Variants.length),l(2),P((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),_("ngClass",F(8,Ue,(e.Variants==null?null:e.Variants.length)<=1)),l(),_("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),_("rowSpan",e.Variants.length),l(2),B(e.Name),l(),P(e.Category?10:-1)}}function Je(i,s){if(i&1){let t=x();o(0,"input",56),w("ngModelChange",function(n){p(t);let a=r(2).$implicit;return y(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Ze(i,s){if(i&1&&(o(0,"td",54),h(1,Je,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),P(t.UnitPrice>=0?1:-1)}}function Qe(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function Xe(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),D(" ",V(2,1,t.UnitPrice)," ")}}function Ye(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),S(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),_("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),T)}}function et(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){p(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),D(" ",V(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function tt(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,He,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Ze,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Qe,2,0,"div",36)(11,Xe,3,3,"div")(12,Ye,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,et,3,3,"div",39),o(16,"div",37)(17,"a",40),S(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=p(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),S(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),P(e==0?1:-1),l(2),B(t.Model),l(2),_("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",F(12,Le,t.Discontinued)),l(),D(" ",t.Code," "),l(),_("ngxPermissionsOnly",F(14,O,n.rolePriceEdit)),l(3),P((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),P((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),P((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),_("ngClass",F(16,Be,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),P(t.Channel.length>0?15:-1),l(2),_("href",t.Channel[0]==null?null:t.Channel[0].Url,T)}}function nt(i,s){if(i&1&&R(0,tt,22,18,"tr",33,k),i&2){let t=s.$implicit;L(t.Variants)}}function it(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),w("ngModelChange",function(n){p(t);let a=r(2);return y(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){p(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,$e,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){p(t);let n=r(2);return m(n.openModalFilter())}),S(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),R(26,nt,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){p(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){p(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),_("ngxPermissionsOnly",F(17,O,e.rolePriceEdit)),l(4),_("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),_("src",e.selectedChannel==null?null:e.selectedChannel.Img,T),l(2),Z(" ",Y(24,12,e.selectedChannel==null?null:e.selectedChannel.Name,20),"",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?"...":""," "),l(3),L(t),l(2),_("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",V(29,15,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function at(i,s){if(i&1){let t=x();o(0,"mainpanel",2),w("textChange",function(n){p(t);let a=r();return y(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){p(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Oe,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),w("ngModelChange",function(n){p(t);let a=r();return y(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,Ae,7,1,"actions",9),v(16,"async"),h(17,it,30,19,"content",9),v(18,"async"),c()}if(i&2){let t=r();_("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),_("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),_("ngIf",V(16,9,t.data$)),l(2),_("ngIf",V(18,11,t.data$))}}var Wt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,ke,Re){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=ke,this.decimalPipe=Re,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=ge.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.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list.length>0||e.failure_list.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Me,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>de.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Ee,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(re),f(oe),f(Ie),f(be),f(Fe),f(N),f(ue),f(ye),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Q([U,N,E]),X],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[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","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-lg","fa-external-link-alt"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,at,19,13,"mainpanel",1),v(1,"async")),n&2&&_("ngIf",V(1,1,a.loader$))},dependencies:[ae,te,ne,ie,E,ve,we,Se,Pe,xe,fe,me,ce,pe,le,se,_e,De,Ne,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{Wt as PriceSingleChannelComponent};
@@ -1 +1 @@
1
- import{a as C,b as y}from"./chunk-PIIJRFHM.js";import{a as i}from"./chunk-HFUGRK45.js";import"./chunk-XLSYUMRS.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import"./chunk-QPRFFPO5.js";import{$a as d,Cc as o,Ia as c,Qb as h,aa as p,fd as v,ga as l,ha as s,jd as r,lb as u,mb as f,nb as a}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var b=(()=>{let t=class t{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=l({type:t,selectors:[["app-inventory"]],standalone:!0,features:[h],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,M){n&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),f()()(),a(4,"router-outlet")),n&2&&(c(3),d("Tabs",M.inventoryTabs))},dependencies:[o,y,C,r,v],encapsulation:2});let e=t;return e})();var g=[{path:"",component:b,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-GEQYSMX6.js").then(e=>e.MultiChannelComparison)},canActivate:[i],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-E3E6TUYP.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[i],data:{title:"Inventory Comparison"}}]}],E=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=s({type:t}),t.\u0275inj=p({imports:[o,r.forChild(g)]});let e=t;return e})();export{E as InventoryRoutingModule};
1
+ import{a as C,b as y}from"./chunk-PIIJRFHM.js";import{a as i}from"./chunk-U7BIKZZA.js";import"./chunk-LBHJSQBZ.js";import"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import"./chunk-MVPTQRFO.js";import"./chunk-EKCNJX26.js";import"./chunk-QPRFFPO5.js";import{$a as d,Cc as o,Ia as c,Qb as h,aa as p,fd as v,ga as l,ha as s,jd as r,lb as u,mb as f,nb as a}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var b=(()=>{let t=class t{constructor(){this.inventoryTabs=[{Title:"Single Channel Comparison",Url:"/menu/inventory/bychannel"},{Title:"Multi Channel Comparison",Url:"/menu/inventory/pos"}]}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=l({type:t,selectors:[["app-inventory"]],standalone:!0,features:[h],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,M){n&1&&(u(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),f()()(),a(4,"router-outlet")),n&2&&(c(3),d("Tabs",M.inventoryTabs))},dependencies:[o,y,C,r,v],encapsulation:2});let e=t;return e})();var g=[{path:"",component:b,children:[{path:"",redirectTo:"bychannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-O2WRF4JL.js").then(e=>e.MultiChannelComparison)},canActivate:[i],data:{title:"Inventory Comparison"}},{path:"bychannel",loadComponent(){return import("./chunk-ARA5O5PX.js").then(e=>e.SingleChannelComparisonComponent)},canActivate:[i],data:{title:"Inventory Comparison"}}]}],E=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=s({type:t}),t.\u0275inj=p({imports:[o,r.forChild(g)]});let e=t;return e})();export{E as InventoryRoutingModule};
@@ -1 +1 @@
1
- import{a as F,b as It,d as Q,e as de}from"./chunk-IYN33JGO.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-FZ7LVL4C.js";import"./chunk-MLGEX4PW.js";import{a as pe}from"./chunk-V6L3NRY3.js";import{f as re,g as ae,h as le,i as ce,j as se}from"./chunk-R7MYFLXJ.js";import"./chunk-6U6JR5K6.js";import{a as Xt,b as te}from"./chunk-PIIJRFHM.js";import{a as X,b as wt}from"./chunk-HXDXTE2F.js";import{a as z}from"./chunk-YZ42FKNJ.js";import{a as ee,b as ne,c as ie}from"./chunk-2LGY3VGP.js";import{b as me}from"./chunk-QZKWUCMY.js";import"./chunk-MSVZKMTY.js";import"./chunk-RZ7FKABW.js";import{a as rt,b as bt,d as Z,e as Yt}from"./chunk-S5GA4AVB.js";import{a as nt}from"./chunk-HFUGRK45.js";import{a as B}from"./chunk-5WXM6HSA.js";import"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as oe}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as L}from"./chunk-XLSYUMRS.js";import{b as G,e as A}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as J,l as R,m as Qt}from"./chunk-4R22UO7N.js";import{t as vt,u as qt}from"./chunk-MVPTQRFO.js";import{P as Zt}from"./chunk-EKCNJX26.js";import{b as zt,c as ot,h as W,k as K,u as Ht}from"./chunk-B3LBEB32.js";import{b as Y,c as g}from"./chunk-QPRFFPO5.js";import{$ as Lt,$a as s,$b as jt,B as y,Bc as St,Cc as Wt,F as kt,Ha as O,Hb as j,Ia as c,Ib as m,Ja as x,Jb as Ct,Kb as I,Mb as T,Nb as N,O as Vt,Ob as E,Q as Ut,Rb as et,Sb as ct,T as H,V as lt,X as gt,Y as At,Za as S,Zb as D,_b as k,aa as Rt,ac as it,c as _t,ca as Bt,d as Dt,ed as xt,fd as Kt,ga as M,ha as $t,hd as Pt,jd as Jt,lb as a,mb as l,nb as C,oa as u,ob as b,pa as h,pb as v,q as at,rb as P,ub as f,uc as V,vc as U,wb as p,yc as ft,zc as Gt}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var ve=()=>["/menu/products/download/by-url"],ue=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),C(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),m(11,"Download Product By Url"),l()()()()()(),C(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",et(2,ve)))},dependencies:[Xt,Kt,Pt]});let o=r;return o})();function Ie(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function we(o,r){if(o&1&&(b(0),S(1,Ie,3,0,"button",12),v()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function ye(o,r){if(o&1){let n=P();b(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Me(o,r){if(o&1){let n=P();b(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Oe(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function De(o,r){o&1&&(b(0),a(1,"div",20),C(2,"app-empty-state"),l(),v())}function Fe(o,r){if(o&1){let n=P();b(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var _e=(()=>{let r=class r{constructor(t,e,i,d,_){this.http=t,this.toastr=e,this.dialog=i,this.productService=d,this.authService=_,this.searchFilter=new q,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,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(It,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>g.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>g.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok]);this.dialog.open(F,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(d=>g.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct;let _=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(d)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=g.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}};r.\u0275fac=function(e){return new(e||r)(x(A),x(G),x(J),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[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"]],template:function(e,i){if(e&1){let d=P();a(0,"mainpanel",1),f("onSubmit",function(w){return u(d),h(i.searchProduct(w))}),a(1,"actions"),S(2,we,2,1,"ng-container",2)(3,ye,4,1,"ng-container",2)(4,Me,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),m(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(w){return u(d),h(i.searchFilter.Category=w)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),E("ngModelChange",function(w){return u(d),N(i.startDate,w)||(i.startDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l(),a(13,"input",8),E("ngModelChange",function(w){return u(d),N(i.endDate,w)||(i.endDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,Oe,2,10,"div",11)(20,De,3,0,"ng-container",2),l(),S(21,Fe,4,4,"ng-container",2),l()()()}if(e&2){let d=j(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",d),c(),T("ngModel",i.startDate),c(),T("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[V,U,ot,W,K,R,Z,z,X,$,le,re,ae,ce],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function Te(o,r){if(o&1){let n=P();b(0),a(1,"button",10),f("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),v()}}function Ne(o,r){if(o&1){let n=P();b(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Ee(o,r){if(o&1){let n=P();b(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ke(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ve(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",18),m(2,"Item ID"),l(),a(3,"input",19),E("ngModelChange",function(e){u(n);let i=p();return N(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),T("ngModel",n.searchFilter.Item_id)}}function Ue(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenVariantDetail(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Ae(o,r){o&1&&(b(0),a(1,"div",22),C(2,"app-empty-state"),l(),v())}function Le(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var ge=(()=>{let r=class r{constructor(t,e,i,d,_,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.activateRouter=_,this.authService=w,this.searchFilter=new q,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=g.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(g.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(It,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(g.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(F,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanProducts(d)})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>g.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=g.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(F,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let d=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(d);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=g.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>g.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),S(2,Te,4,0,"ng-container",1)(3,Ne,4,1,"ng-container",1)(4,Ee,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),S(10,ke,3,3,"ng-template",4),l()(),S(11,Ve,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ue,2,10,"div",8)(16,Ae,3,0,"ng-container",1),l(),S(17,Le,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[V,U,ot,W,K,R,Z,rt,bt,z,X,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();var Ce=(()=>{let r=class r{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new Dt(null),this.destroy$=new _t,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){g.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new Dt(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(lt(this.destroy$),y(t=>t!=null),kt(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(at(e=>e.Data))),At(this.pagination$),Vt((t,e)=>{let[i,d]=t,[_]=e;return d.PageNumber==1?[_,d]:[i.concat(_),d]}),gt(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),at(([t])=>t),Ut())}};r.\u0275fac=function(e){return new(e||r)(Bt(A))},r.\u0275prov=Lt({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();function $e(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.uploadMultipleProduct())}),C(1,"i",14),m(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function je(o,r){if(o&1){let n=P();b(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return N(i.selected,e)||(i.selected=e),h(e)}),f("ngModelChange",function(){u(n);let e=p(3).ngIf,i=p(3);return h(i.onSelectProduct(e))}),l()(),v()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),T("ngModel",n.selected)}}function Ge(o,r){if(o&1){let n=P();b(0),a(1,"img",35),f("click",function(e){u(n);let i=p(3).$implicit,d=p(4);return h(d.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),v()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,O)}}function We(o,r){o&1&&C(0,"img",36)}function Ke(o,r){if(o&1&&(b(0),a(1,"td",29)(2,"div",31),S(3,Ge,2,1,"ng-container",11)(4,We,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),v()),o&2){let n=j(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function Je(o,r){if(o&1&&(a(0,"div")(1,"a",25),C(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,O),c(),s("src",n.Img,O)("matTooltip",n.Name)}}function ze(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,O)("matTooltip",n.Name)}}function He(o,r){if(o&1&&(a(0,"tr"),S(1,je,3,2,"ng-container",12)(2,Ke,10,6,"ng-container",12),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",24)(9,"a",25),C(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),S(13,Je,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,ze,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),O),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ye(o,r){if(o&1&&(b(0),S(1,He,17,7,"tr",23),v()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function Ze(o,r){if(o&1&&(a(0,"tbody"),S(1,Ye,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function qe(o,r){if(o&1&&(b(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),C(5,"th",18),a(6,"th",19),m(7,"Product"),l(),a(8,"th",20),m(9,"Variant"),l(),a(10,"th",20),m(11,"SKU"),l(),a(12,"th",21),m(13,"Available In"),l(),a(14,"th",22),m(15,"Not Available In"),l()()(),S(16,Ze,2,1,"tbody",12),D(17,"async"),l()(),v()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Qe(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function Xe(o,r){if(o&1){let n=P();a(0,"span",46),f("click",function(){u(n);let e=p(4);return h(e.getRowCount())}),a(1,"i",47),m(2,"?"),l()()}}function tn(o,r){if(o&1&&(a(0,"span"),m(1),D(2,"number"),l()),o&2){let n=r.ngIf;c(),Ct(k(2,1,n==null?null:n.Count))}}function en(o,r){if(o&1){let n=P();a(0,"a",48),f("click",function(){u(n);let e=p(4);return h(e.onNextPage())}),C(1,"i",49),m(2," Next"),l()}}function nn(o,r){if(o&1){let n=P();a(0,"a",50),f("click",function(){u(n);let e=p(4);return h(e.onLastPage())}),C(1,"i",51),m(2," Last"),l()}}function on(o,r){if(o&1&&(b(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),D(5,"number"),S(6,Xe,3,0,"span",42)(7,tn,3,3,"span",12),D(8,"async"),m(9),l()(),a(10,"div",43),S(11,en,3,0,"a",44)(12,nn,3,0,"a",45),l()(),v()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",k(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&k(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function rn(o,r){if(o&1&&(b(0),S(1,on,13,10,"ng-container",12),v()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function an(o,r){if(o&1){let n=P();a(0,"mainpanel",3),f("onSubmit",function(e){u(n);let i=p();return h(i.searchProduct(e))}),a(1,"actions"),S(2,$e,3,1,"button",4),a(3,"button",5),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(4,"i",6),m(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){u(n);let e=p();return h(e.openExportDialog())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,qe,18,3,"ng-container",11),D(14,"async"),S(15,Qe,2,0,"ng-template",null,0,it),l(),S(17,rn,2,1,"ng-container",12),D(18,"async"),l()()()}if(o&2){let n,t=j(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=k(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",k(18,7,e.data$))}}var fe=(()=>{let r=class r{constructor(t,e,i,d,_,w,Et){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=_,this.biggerPictureService=w,this.authService=Et,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Et.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(gt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(at(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=g.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>g.IsNotEmpty(e)),H(e=>{let i=this.getSelectedProductIds();return this.productService.uploadNotInChannel(i,e)})).subscribe({next:()=>{this.paginationService.reloadPagination(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:e=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(e=>({ID:e.ProductID}))}getUniqueChannels(){let t=[];return this.selectedProducts.forEach(e=>{t=[...t,...e.Variants[0].NotAvailable]}),t=t.filter((e,i,d)=>d.findIndex(_=>_.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(pe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(Ce),x(oe),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(S(0,an,19,9,"mainpanel",2),D(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,zt,W,K,R,vt,$,ft,St],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var ln=o=>[o],cn=()=>[];function sn(o,r){if(o&1){let n=P();a(0,"button",15),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(1,"i",16),m(2," Scan Channel "),l()}}function pn(o,r){if(o&1){let n=P();b(0),a(1,"button",17),f("click",function(){u(n);let e=p();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",18),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function dn(o,r){if(o&1&&(a(0,"span",19),C(1,"img",20),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function mn(o,r){if(o&1){let n=P();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=u(n).index,d=p();return h(d.onSelectProduct(e,i))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onShowVariantDetail(e))})("onDownload",function(){let e=u(n).$implicit,i=p();return h(i.onDownloadProduct(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?ct(10,ln,n==null?null:n.Channel):et(12,cn))("showCheckBox",!0)("scanButton",!0)}}function un(o,r){o&1&&(b(0),a(1,"div",23),C(2,"app-empty-state"),l(),v())}function hn(o,r){if(o&1){let n=P();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Se=(()=>{let r=class r{constructor(t,e,i,d,_,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=d,this.activateRouter=_,this.authService=w,this.searchFilter=new q,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(g.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?g.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=g.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(g.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=g.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(g.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(de,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(B),x(G),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),S(2,sn,3,0,"button",1)(3,pn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),E("ngModelChange",function(_){return N(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),S(9,dn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),E("ngModelChange",function(_){return N(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),m(15," All "),l(),a(16,"mat-radio-button",9),m(17," Yes "),l(),a(18,"mat-radio-button",9),m(19," No "),l()()(),a(20,"div",6)(21,"label",7),m(22,"Item ID"),l(),a(23,"input",10),E("ngModelChange",function(_){return N(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,mn,2,13,"div",13)(28,un,3,0,"ng-container",2),l(),S(29,hn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ChannelID),c(5),T("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),T("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,ot,W,K,R,Z,rt,ee,ne,z,X,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function _n(o,r){if(o&1&&(a(0,"span",9),C(1,"img",10),l(),m(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),O),c(),I(" ",n.Name," ")}}function gn(o,r){if(o&1&&(a(0,"div",11),C(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Cn(o,r){o&1&&(b(0),a(1,"div",13),C(2,"app-empty-state"),l(),v())}function fn(o,r){if(o&1){let n=P();b(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())})("total",function(){u(n);let e=p();return h(e.getRowCount())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var xe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new q,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=g.GuidEMpty}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),m(5,"Channel"),l(),a(6,"ng-select",3),E("ngModelChange",function(_){return N(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),f("clear",function(){return i.onClearFilter()}),S(7,_n,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,gn,2,6,"div",7)(12,Cn,3,0,"ng-container",8),l(),S(13,fn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,W,K,R,Z,rt,bt,wt,z,$]});let o=r;return o})();var Sn=()=>["/menu/products/status/sold-in-channel"],Pe=o=>({ID:o}),xn=()=>["/menu/products/status/not-in-pos"];function Pn(o,r){if(o&1&&(b(0),m(1),v()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function bn(o,r){if(o&1){let n=P();a(0,"span",26),f("click",function(){u(n);let e=p().$implicit,i=p(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}function vn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",17),a(3,"span",18),m(4),l()(),a(5,"td",19),S(6,Pn,2,1,"ng-container",6)(7,bn,2,0,"ng-template",null,1,it),l(),a(9,"td",19)(10,"a",20),m(11),D(12,"number"),l()(),a(13,"td",19)(14,"a",20),m(15),D(16,"number"),l()(),a(17,"td"),m(18),D(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onScanChannel(e))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onClearCache(e.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=j(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),O),c(2),Ct(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",et(18,Sn))("queryParams",ct(19,Pe,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",et(21,xn))("queryParams",ct(22,Pe,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function In(o,r){if(o&1&&(b(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),m(6,"Channel"),l(),a(7,"th",11),m(8,"Live Product"),l(),a(9,"th",12),m(10,"Sold In Channel"),l(),a(11,"th",13),m(12,"Product Not in POS"),l(),a(13,"th",14),m(14,"Last Sync"),l(),C(15,"th",15),l()(),a(16,"tbody"),S(17,vn,28,24,"tr",16),D(18,"async"),l()()(),v()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function wn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var be=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new _t,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(lt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(F,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>g.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(d=>d)).subscribe(d=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(d,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(lt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(J),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,In,19,3,"ng-container",6),D(6,"async"),S(7,wn,2,0,"ng-template",null,0,it),l()()()()()),e&2){let d,_=j(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((d=k(6,4,i.channels$))==null||d.Data==null?null:d.Data.length)>0)("ngIfElse",_)}},dependencies:[V,U,R,vt,Pt,$,ft,St,Gt]});let o=r;return o})();var yn=[{component:ue,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:_e,canActivate:[nt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ge,canActivate:[nt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:fe,canActivate:[nt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Se,canActivate:[nt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:xe,canActivate:[nt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:be,canActivate:[nt],data:{title:"Channel Statistic"}}]}],Bi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=Rt({imports:[Wt,Ht,Qt,qt,Yt,me,ie,te,wt,z,X,Jt.forChild(yn),se,Zt]});let o=r;return o})();export{Bi as StatusModule};
1
+ import{a as F,b as It,d as Q,e as de}from"./chunk-VQQXE7MA.js";import{a as q}from"./chunk-IWVYX6KY.js";import{a as $}from"./chunk-FZ7LVL4C.js";import"./chunk-J47B3BJQ.js";import{a as pe}from"./chunk-V6L3NRY3.js";import{f as re,g as ae,h as le,i as ce,j as se}from"./chunk-R7MYFLXJ.js";import"./chunk-6U6JR5K6.js";import{a as Xt,b as te}from"./chunk-PIIJRFHM.js";import{a as X,b as wt}from"./chunk-HXDXTE2F.js";import{a as z}from"./chunk-YZ42FKNJ.js";import{b as me}from"./chunk-QZKWUCMY.js";import"./chunk-MSVZKMTY.js";import{a as ee,b as ne,c as ie}from"./chunk-2LGY3VGP.js";import"./chunk-RZ7FKABW.js";import{a as rt,b as bt,d as Z,e as Yt}from"./chunk-S5GA4AVB.js";import{a as nt}from"./chunk-U7BIKZZA.js";import{a as B}from"./chunk-5WXM6HSA.js";import"./chunk-JTJLVSTV.js";import"./chunk-IPYNDMGQ.js";import{a as oe}from"./chunk-RMD2ZXUN.js";import"./chunk-KWFES5F7.js";import{g as L}from"./chunk-LBHJSQBZ.js";import{b as G,e as A}from"./chunk-DSF55IXM.js";import"./chunk-KCDL7SWP.js";import{d as J,l as R,m as Qt}from"./chunk-4R22UO7N.js";import{t as vt,u as qt}from"./chunk-MVPTQRFO.js";import{P as Zt}from"./chunk-EKCNJX26.js";import{b as zt,c as ot,h as W,k as K,u as Ht}from"./chunk-B3LBEB32.js";import{b as Y,c as g}from"./chunk-QPRFFPO5.js";import{$ as Lt,$a as s,$b as jt,B as y,Bc as St,Cc as Wt,F as kt,Ha as O,Hb as j,Ia as c,Ib as m,Ja as x,Jb as Ct,Kb as I,Mb as T,Nb as N,O as Vt,Ob as E,Q as Ut,Rb as et,Sb as ct,T as H,V as lt,X as gt,Y as At,Za as S,Zb as D,_b as k,aa as Rt,ac as it,c as _t,ca as Bt,d as Dt,ed as xt,fd as Kt,ga as M,ha as $t,hd as Pt,jd as Jt,lb as a,mb as l,nb as C,oa as u,ob as b,pa as h,pb as v,q as at,rb as P,ub as f,uc as V,vc as U,wb as p,yc as ft,zc as Gt}from"./chunk-C3YE27TZ.js";import"./chunk-GNOSNGXM.js";var ve=()=>["/menu/products/download/by-url"],ue=(()=>{let r=class r{constructor(){this.productTabs=[{Title:"Sold in Channel",Url:"/menu/products/status/sold-in-channel",Description:"SKU has been mapped between dealpos and marketplace"},{Title:"Not in POS",Url:"/menu/products/status/not-in-pos",Description:"SKU sold in Marketplace but not exist in DEALPOS"},{Title:"Not in Channel",Url:"/menu/products/status/not-in-channel",Description:"SKU has not been sold on one of channels"},{Title:"In POS",Url:"/menu/products/status/in-pos",Description:"All products which is already available in POS"},{Title:"Multiple Listing",Url:"/menu/products/status/duplicate-sku",Description:"SKU(s) which is listed more than one time (one to many)"},{Title:"Channel Statistic",Url:"/menu/products/status/channel-statistic",Description:"Product statistic from each channel obtained from the last product scan"}]}};r.\u0275fac=function(e){return new(e||r)},r.\u0275cmp=M({type:r,selectors:[["app-status"]],decls:13,vars:3,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-flex"],[1,"dropdown-item",3,"routerLink"]],template:function(e,i){e&1&&(a(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),l()(),a(4,"div")(5,"div",3)(6,"a",4),C(7,"i",5),l(),a(8,"div",6)(9,"div",7)(10,"a",8),m(11,"Download Product By Url"),l()()()()()(),C(12,"router-outlet")),e&2&&(c(3),s("Tabs",i.productTabs),c(7),s("routerLink",et(2,ve)))},dependencies:[Xt,Kt,Pt]});let o=r;return o})();function Ie(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.onOpenScanDialog())}),C(1,"i",14),m(2," Scan Channel "),l()}}function we(o,r){if(o&1&&(b(0),S(1,Ie,3,0,"button",12),v()),o&2){let n=p();c(),s("ngIf",!n.productService.hasSelection(n.products))}}function ye(o,r){if(o&1){let n=P();b(0),a(1,"button",15),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Scan (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Me(o,r){if(o&1){let n=P();b(0),a(1,"button",16),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",17),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Upload (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function Oe(o,r){if(o&1){let n=P();a(0,"div",18)(1,"app-product-card",19),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenDialogVariant(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null?null:n.Variants.length)>1?(n==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",(n==null?null:n.Channel.length)<t.channelOptions.length)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function De(o,r){o&1&&(b(0),a(1,"div",20),C(2,"app-empty-state"),l(),v())}function Fe(o,r){if(o&1){let n=P();b(0),a(1,"div",21)(2,"div",22)(3,"app-custom-paginator",23),f("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",!0)}}var _e=(()=>{let r=class r{constructor(t,e,i,d,_){this.http=t,this.toastr=e,this.dialog=i,this.productService=d,this.authService=_,this.searchFilter=new q,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,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Category:this.searchFilter.Category,From:this.startDate,To:this.endDate};this.http.post("/api/product/GetInPOS",t).subscribe(e=>{this.products=e.Data,this.rowCount=e.Total==null?this.searchFilter.RowCount:e.Total.toString(),this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions)})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){if(this.searchFilter.ChannelID==null){this.toastr.error("Please Select Channel","Error");return}this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(t=>{if(this.searchFilter.Async)this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"});else{this.getLoaderPage();let e=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.successToastrScanAllProduct(t,e,!this.searchFilter.UpdatedProduct)}})}onOpenDialogVariant(t){this.dialog.open(It,{data:{title:this.products[t].Name,variants:this.products[t].Variants},width:"800px"})}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>g.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>g.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}searchProduct(t){this.searchFilter.text=t,this.getProducts()}onScanMultipleProduct(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty;let e=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok]);this.dialog.open(F,{data:{filter:t,channelOptions:e,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(d=>g.IsNotEmpty(d))).subscribe(d=>{this.searchFilter.ChannelID=d.ChannelID,this.searchFilter.ScanFull=d.ScanFull,this.searchFilter.UpdatedProduct=d.UpdatedProduct;let _=this.productService.selectedProduct(this.products),w=this.productService.getVariantCodesProducts(_);this.scanSingleProduct(w)})}onScanSingleProduct(t){let e=JSON.parse(JSON.stringify(this.searchFilter));e.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanSingleProduct(d)})}scanSingleProduct(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{if(e)this.toastr.success("Successfully Scan ","Success");else{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.toastr.error(`This product is not existed in ${i?.Name} `,"Error")}this.searchFilter.ChannelID=g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=g.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}};r.\u0275fac=function(e){return new(e||r)(x(A),x(G),x(J),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-in-pos"]],decls:22,vars:13,consts:[["picker",""],["description","All products which is already available in POS",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[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"]],template:function(e,i){if(e&1){let d=P();a(0,"mainpanel",1),f("onSubmit",function(w){return u(d),h(i.searchProduct(w))}),a(1,"actions"),S(2,we,2,1,"ng-container",2)(3,ye,4,1,"ng-container",2)(4,Me,4,1,"ng-container",2),l(),a(5,"filters")(6,"div")(7,"label",3),m(8,"Category"),l(),a(9,"ng-select",4),f("ngModelChange",function(w){return u(d),h(i.searchFilter.Category=w)}),l()(),a(10,"div",5)(11,"mat-date-range-input",6)(12,"input",7),E("ngModelChange",function(w){return u(d),N(i.startDate,w)||(i.startDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l(),a(13,"input",8),E("ngModelChange",function(w){return u(d),N(i.endDate,w)||(i.endDate=w),h(w)}),f("click",function(){u(d);let w=j(15);return h(w.open())}),l()(),C(14,"mat-date-range-picker",null,0),l()(),a(16,"content")(17,"div",9)(18,"div",10),S(19,Oe,2,10,"div",11)(20,De,3,0,"ng-container",2),l(),S(21,Fe,4,4,"ng-container",2),l()()()}if(e&2){let d=j(15);s("headerTitle","In POS ("+i.rowCount+")"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)&&i.multipeScanChannels.length>0),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.Categories)("ngModel",i.searchFilter.Category),c(2),s("rangePicker",d),c(),T("ngModel",i.startDate),c(),T("ngModel",i.endDate),c(6),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products.length>0)}},dependencies:[V,U,ot,W,K,R,Z,z,X,$,le,re,ae,ce],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.img-logo[_ngcontent-%COMP%]{height:24px;width:24px}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem}"]});let o=r;return o})();function Te(o,r){if(o&1){let n=P();b(0),a(1,"button",10),f("click",function(){u(n);let e=p();return h(e.onOpenScanDialog())}),C(2,"i",11),m(3," Scan Channel "),l(),v()}}function Ne(o,r){if(o&1){let n=P();b(0),a(1,"button",12),f("click",function(){u(n);let e=p();return h(e.onScanMultipleProduct())}),C(2,"i",11),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Scan (",n.productService.selectedProduct(n.products).length,") ")}}function Ee(o,r){if(o&1){let n=P();b(0),a(1,"button",13),f("click",function(){u(n);let e=p();return h(e.onUploadMultipleProduct())}),C(2,"i",14),m(3),l(),v()}if(o&2){let n=p();c(3),I(" Upload (",n.productService.selectedProduct(n.products).length,") ")}}function ke(o,r){if(o&1&&(a(0,"span",15),C(1,"img",16),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function Ve(o,r){if(o&1){let n=P();a(0,"div",17)(1,"label",18),m(2,"Item ID"),l(),a(3,"input",19),E("ngModelChange",function(e){u(n);let i=p();return N(i.searchFilter.Item_id,e)||(i.searchFilter.Item_id=e),h(e)}),l()()}if(o&2){let n=p();c(3),T("ngModel",n.searchFilter.Item_id)}}function Ue(o,r){if(o&1){let n=P();a(0,"div",20)(1,"app-product-card",21),f("onUpload",function(){let e=u(n).$implicit,i=p();return h(i.onUploadToMultipleChannel(e))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onOpenVariantDetail(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanSingleProduct(e))})("onCheckBoxChange",function(e){let i=u(n).$implicit;return h(i.selected=e)}),l()()}if(o&2){let n=r.$implicit,t=p();c(),s("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("channels",t.productService.getChannelProduct(n))("code",t.getVariantCode(n==null?null:n.Variants))("showCheckBox",n==null?null:n.hasScan)("scanButton",!0)("uploadButton",n==null?null:n.hasUpload)("imageForZoom",n==null?null:n.ImageUrl)}}function Ae(o,r){o&1&&(b(0),a(1,"div",22),C(2,"app-empty-state"),l(),v())}function Le(o,r){if(o&1){let n=P();a(0,"div",23)(1,"div",24)(2,"app-custom-paginator",25),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var ge=(()=>{let r=class r{constructor(t,e,i,d,_,w){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.activateRouter=_,this.authService=w,this.searchFilter=new q,this.products=[],this.rowCount=0,this.hasClickRowCount=!1,this.guidEmpty=g.GuidEMpty,this.multipeScanChannels=[],this.channelOptions=this.authService.getChannels(),this.initMultiScanChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(g.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,e.Filter.ChannelID!=g.GuidEMpty&&(this.searchFilter.ListChannelID=[],this.searchFilter.ListChannelID.push(e.Filter.ChannelID)),this.searchFilter.PageSize=e.Filter.RowCount,this.searchFilter.Item_id="",this.getProducts()})}initMultiScanChannels(){this.multipeScanChannels=this.productService.filterChannelByTypeId(this.channelOptions,[Y.Tokopedia,Y.Tiktok])}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount,text:this.searchFilter.text,Item_id:this.searchFilter.Item_id};this.productService.findAllSoldInChannel(t).subscribe(e=>{this.products=e.Data,this.products=this.productService.checkProductHasUploadBtn(this.products,this.channelOptions),this.products=this.productService.checkProductHasScanButton(this.products,this.channelOptions)})}searchProduct(t){this.searchFilter.text=t,this.hasClickRowCount=!1,this.getProducts()}onOpenVariantDetail(t){let e=this.products[t].Variants;this.dialog.open(It,{data:{variants:e,title:this.products[t].Name},width:"800px"})}onOpenScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.Async=i.Async,this.scanAllProduct()})}scanAllProduct(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).pipe(y(e=>e)).subscribe(e=>{this.searchFilter.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct),this.initPageLoader(g.GuidEMpty))})}onScanSingleProduct(t){t.Channel=this.productService.getChannelProduct(t);let e=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(F,{data:{filter:e,channelOptions:this.channelOptions,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID;let d=this.productService.getVariantCodesProduct(t);this.scanProducts(d)})}onUploadToMultipleChannel(t){let e=this.productService.getChannelProduct(t);t.Channel=e;let i=this.productService.filterUnselectedChannel([t],this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:`Upload - ${t.Name}`,channels:i,product:t}}).afterClosed().pipe(y(d=>g.IsNotEmpty(d)),H(d=>this.productService.uploadSingleProduct([t],d))).subscribe({next:d=>{this.getProducts()}})}onScanMultipleProduct(){this.searchFilter.ChannelID=g.GuidEMpty;let t=JSON.parse(JSON.stringify(this.searchFilter));this.dialog.open(F,{data:{filter:t,channelOptions:this.multipeScanChannels,isSingleChannel:!0},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.UpdatedProduct=i.UpdatedProduct;let d=this.productService.selectedProduct(this.products),_=this.productService.getVariantCodesProducts(d);this.scanProducts(_)})}scanProducts(t){this.productService.scanSingle(this.searchFilter.ChannelID,t).subscribe({next:e=>{let i=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);e?this.toastr.success(`Product Successfully scan with ${i?.Name}`,"Success"):this.toastr.error(`This product is not existed in ${i?.Name} `,"Error"),this.searchFilter.ChannelID=g.GuidEMpty,e&&this.getProducts()},error:e=>{this.searchFilter.ChannelID=g.GuidEMpty}})}getVariantCode(t){let e;return t.length>1&&(e=(t[0].model?t[0].model:"")+t[0].Code),t.length==1&&(e=t[0].Code),e}onClearFilterChannel(){this.searchFilter.ChannelID=g.GuidEMpty,this.searchFilter.Item_id=""}onUploadMultipleProduct(){let t=this.productService.selectedProduct(this.products),e=this.productService.filterUnselectedChannel(t,this.channelOptions);this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:e}}).afterClosed().pipe(y(i=>g.IsNotEmpty(i)),H(i=>this.productService.uploadMultipleProduct(t,i))).subscribe({next:i=>{this.getProducts()}})}getRowCount(){let t={ListChannelID:this.searchFilter.ListChannelID,text:this.searchFilter.text};this.http.post("/api/product/GetSoldInChannelRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-sold-in-channel"]],decls:18,vars:12,consts:[["description","SKU has been mapped between dealpos and marketplace",3,"onSubmit","headerTitle"],[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","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","productId","title","image","description","channels","code","showCheckBox","scanButton","uploadButton","imageForZoom"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.searchProduct(_)}),a(1,"actions"),S(2,Te,4,0,"ng-container",1)(3,Ne,4,1,"ng-container",1)(4,Ee,4,1,"ng-container",1),l(),a(5,"filters")(6,"div")(7,"label",2),m(8,"Channel"),l(),a(9,"ng-select",3),f("ngModelChange",function(_){return i.searchFilter.ListChannelID=_})("clear",function(){return i.onClearFilterChannel()}),S(10,ke,3,3,"ng-template",4),l()(),S(11,Ve,4,1,"div",5),l(),a(12,"content")(13,"div",6)(14,"div",7),S(15,Ue,2,10,"div",8)(16,Ae,3,0,"ng-container",1),l(),S(17,Le,3,4,"div",9),l()()()),e&2&&(s("headerTitle","Sold in Channel"),c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.multipeScanChannels.length>0&&i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("multiple",!0)("items",i.channelOptions)("ngModel",i.searchFilter.ListChannelID),c(2),s("ngIf",i.searchFilter.ListChannelID!=null),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",i.products==null?null:i.products.length))},dependencies:[V,U,ot,W,K,R,Z,rt,bt,z,X,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}"]});let o=r;return o})();var Ce=(()=>{let r=class r{get footerPageNumber(){return this._footerPageNumber}set footerPageNumber(t){this._footerPageNumber=t}get hideCount(){return this._hideCount}set hideCount(t){this._hideCount=t}get disableNextButton(){return this._disableNextButton}set disableNextButton(t){this._disableNextButton=t}get goToLastPage(){return this._goToLastPage}set goToLastPage(t){this._goToLastPage=t}constructor(t){this.http=t,this.pagination$=new Dt(null),this.destroy$=new _t,this.data$=this.paginationFunction()}onNextPage(t){t.PageNumber+=1,this.pagination$.next(t)}setPageNumberFooter(t){this.footerPageNumber=t.PageNumber}setPaginationButtonState(t,e){e==0?this.disableNextButton=!0:this.disableNextButton=!(e<t.RowCount*t.PageNumber)}reloadPagination(t){g.IsEmpty(t.PageNumber)&&(t.PageNumber=1),this.pagination$.next(t),this.hideCount=!0,this.goToLastPage=!1}getAllData(t,e){t.RowCount=e,this.pagination$.next(t),this.goToLastPage=!0}destroy(){this.destroy$.next(!0),this.destroy$.complete(),this.pagination$=null,this.pagination$=new Dt(null),this.data$=this.paginationFunction()}paginationFunction(){return this.pagination$.pipe(lt(this.destroy$),y(t=>t!=null),kt(t=>this.http.post(`/API/${this.fetchDataEndpoint}`,JSON.stringify(t)).pipe(at(e=>e.Data))),At(this.pagination$),Vt((t,e)=>{let[i,d]=t,[_]=e;return d.PageNumber==1?[_,d]:[i.concat(_),d]}),gt(([t,e])=>{this.setPageNumberFooter(e),this.setPaginationButtonState(e,t.length)}),at(([t])=>t),Ut())}};r.\u0275fac=function(e){return new(e||r)(Bt(A))},r.\u0275prov=Lt({token:r,factory:r.\u0275fac,providedIn:"root"});let o=r;return o})();function $e(o,r){if(o&1){let n=P();a(0,"button",13),f("click",function(){u(n);let e=p(2);return h(e.uploadMultipleProduct())}),C(1,"i",14),m(2),l()}if(o&2){let n=p(2);c(2),I(" upload (",n.selectedProducts==null?null:n.selectedProducts.length,") ")}}function je(o,r){if(o&1){let n=P();b(0),a(1,"td",29)(2,"input",30),E("ngModelChange",function(e){u(n);let i=p(2).$implicit;return N(i.selected,e)||(i.selected=e),h(e)}),f("ngModelChange",function(){u(n);let e=p(3).ngIf,i=p(3);return h(i.onSelectProduct(e))}),l()(),v()}if(o&2){let n=p(2).$implicit;c(),s("rowSpan",n==null?null:n.Variants.length),c(),T("ngModel",n.selected)}}function Ge(o,r){if(o&1){let n=P();b(0),a(1,"img",35),f("click",function(e){u(n);let i=p(3).$implicit,d=p(4);return h(d.onZoomImage(e,i==null?null:i.ImageUrl))}),l(),v()}if(o&2){let n=p(3).$implicit;c(),s("src",n==null?null:n.ImageUrl,O)}}function We(o,r){o&1&&C(0,"img",36)}function Ke(o,r){if(o&1&&(b(0),a(1,"td",29)(2,"div",31),S(3,Ge,2,1,"ng-container",11)(4,We,1,0,"ng-template",null,1,it),l()(),a(6,"td",32)(7,"h4",33)(8,"span",34),m(9),l()()(),v()),o&2){let n=j(5),t=p(2).$implicit;c(),s("rowSpan",t==null?null:t.Variants.length),c(2),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",n),c(3),s("rowSpan",t==null?null:t.Variants.length),c(2),s("matTooltip",(t==null||t.Name==null?null:t.Name.length)>50?t==null?null:t.Name:""),c(),I(" ",t==null?null:t.Name," ")}}function Je(o,r){if(o&1&&(a(0,"div")(1,"a",25),C(2,"img",37),l()()),o&2){let n=r.$implicit;c(),s("href",n.URL,O),c(),s("src",n.Img,O)("matTooltip",n.Name)}}function ze(o,r){if(o&1&&(a(0,"div"),C(1,"img",37),l()),o&2){let n=r.$implicit;c(),s("src",n.Img,O)("matTooltip",n.Name)}}function He(o,r){if(o&1&&(a(0,"tr"),S(1,je,3,2,"ng-container",12)(2,Ke,10,6,"ng-container",12),a(3,"td"),m(4),l(),a(5,"td")(6,"span"),m(7),l(),a(8,"span",24)(9,"a",25),C(10,"i",26),l()()(),a(11,"td",27)(12,"div",28),S(13,Je,3,3,"div",23),l()(),a(14,"td",27)(15,"div",28),S(16,ze,2,2,"div",23),l()()()),o&2){let n=r.$implicit,t=r.index,e=p(5);c(),s("ngIf",t==0),c(),s("ngIf",t==0),c(2),I(" ",n.Name," "),c(3),I(" ",n.Code," "),c(2),s("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(n==null?null:n.ID),O),c(4),s("ngForOf",n==null?null:n.Available),c(3),s("ngForOf",n==null?null:n.NotAvailable)}}function Ye(o,r){if(o&1&&(b(0),S(1,He,17,7,"tr",23),v()),o&2){let n=r.$implicit;c(),s("ngForOf",n.Variants)}}function Ze(o,r){if(o&1&&(a(0,"tbody"),S(1,Ye,2,1,"ng-container",23),l()),o&2){let n=r.ngIf;c(),s("ngForOf",n)}}function qe(o,r){if(o&1&&(b(0),a(1,"div",15)(2,"table",16)(3,"thead",17)(4,"tr"),C(5,"th",18),a(6,"th",19),m(7,"Product"),l(),a(8,"th",20),m(9,"Variant"),l(),a(10,"th",20),m(11,"SKU"),l(),a(12,"th",21),m(13,"Available In"),l(),a(14,"th",22),m(15,"Not Available In"),l()()(),S(16,Ze,2,1,"tbody",12),D(17,"async"),l()(),v()),o&2){let n=p(2);c(16),s("ngIf",k(17,1,n.data$))}}function Qe(o,r){o&1&&(a(0,"div",38),C(1,"app-empty-state"),l())}function Xe(o,r){if(o&1){let n=P();a(0,"span",46),f("click",function(){u(n);let e=p(4);return h(e.getRowCount())}),a(1,"i",47),m(2,"?"),l()()}}function tn(o,r){if(o&1&&(a(0,"span"),m(1),D(2,"number"),l()),o&2){let n=r.ngIf;c(),Ct(k(2,1,n==null?null:n.Count))}}function en(o,r){if(o&1){let n=P();a(0,"a",48),f("click",function(){u(n);let e=p(4);return h(e.onNextPage())}),C(1,"i",49),m(2," Next"),l()}}function nn(o,r){if(o&1){let n=P();a(0,"a",50),f("click",function(){u(n);let e=p(4);return h(e.onLastPage())}),C(1,"i",51),m(2," Last"),l()}}function on(o,r){if(o&1&&(b(0),a(1,"div",39)(2,"div",40)(3,"div",41),m(4),D(5,"number"),S(6,Xe,3,0,"span",42)(7,tn,3,3,"span",12),D(8,"async"),m(9),l()(),a(10,"div",43),S(11,en,3,0,"a",44)(12,nn,3,0,"a",45),l()(),v()),o&2){let n=p().ngIf,t=p(2);c(4),I(" Showing 1 - ",k(5,6,n==null?null:n.length)," of "),c(2),s("ngIf",t.paginationService.hideCount),c(),s("ngIf",!t.paginationService.hideCount&&k(8,8,t.rowCount$)),c(2),I(" records ~ ",t.paginationService.footerPageNumber," Page "),c(2),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage),c(),s("ngIf",t.paginationService.disableNextButton&&!t.paginationService.goToLastPage)}}function rn(o,r){if(o&1&&(b(0),S(1,on,13,10,"ng-container",12),v()),o&2){let n=r.ngIf;c(),s("ngIf",(n==null?null:n.length)>0)}}function an(o,r){if(o&1){let n=P();a(0,"mainpanel",3),f("onSubmit",function(e){u(n);let i=p();return h(i.searchProduct(e))}),a(1,"actions"),S(2,$e,3,1,"button",4),a(3,"button",5),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(4,"i",6),m(5," Scan Channel "),l(),a(6,"button",7),f("click",function(){u(n);let e=p();return h(e.openExportDialog())}),C(7,"i",8),a(8,"span"),m(9,"Export"),l()()(),a(10,"content")(11,"div",9)(12,"div",10),S(13,qe,18,3,"ng-container",11),D(14,"async"),S(15,Qe,2,0,"ng-template",null,0,it),l(),S(17,rn,2,1,"ng-container",12),D(18,"async"),l()()()}if(o&2){let n,t=j(16),e=p();s("hideSearchDropdown",!0),c(2),s("ngIf",e.hasSelectionProduct),c(11),s("ngIf",((n=k(14,5,e.data$))==null?null:n.length)>0)("ngIfElse",t),c(4),s("ngIf",k(18,7,e.data$))}}var fe=(()=>{let r=class r{constructor(t,e,i,d,_,w,Et){this.http=t,this.dialog=e,this.toastr=i,this.productService=d,this.paginationService=_,this.biggerPictureService=w,this.authService=Et,this.loaderAPI="product/Load",this.rowCountAPI="product/GetNotInChannelRowCount",this.notChannelAPI="product/GetNotInChannelV2",this.hasSelectionProduct=!1,this.selectedProducts=[],this.channelOptions=Et.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(gt(t=>{this.filterSearch=t.Filter,this.paginationService.reloadPagination(t.Filter)}))}iniData(){this.data$=this.paginationService.data$.pipe(at(t=>(t=t.map(e=>(e.Variants=e.Variants.map(i=>(i.Available=this.productService.sortChannel(i.Available),i.NotAvailable=this.productService.sortChannel(i.NotAvailable),i.Available=this.assignLogoChannel(i.Available),i.NotAvailable=this.assignLogoChannel(i.NotAvailable),i)),e)),t)))}assignLogoChannel(t){return t=t.map(e=>(e.Img=g.getChannelLogoByTypeId(e.TypeID),e)),t}searchProduct(t){this.filterSearch.text=t,this.paginationService.reloadPagination(this.filterSearch)}scanAllProduct(){let t=this.productService.findChannelById(this.filterSearch.ChannelID,this.channelOptions);this.productService.scanAll(this.filterSearch.ChannelID,this.filterSearch.ScanFull,this.filterSearch.UpdatedProduct,this.filterSearch.Async).subscribe(e=>{this.filterSearch.Async?this.toastr.success("You will be notified when the scan is completed.","Scan Asynchronous"):(this.productService.successToastrScanAllProduct(e,t,!this.filterSearch.UpdatedProduct),this.initPageLoader())})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.filterSearch));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.filterSearch.ChannelID=i.ChannelID,this.filterSearch.ScanFull=i.ScanFull,this.filterSearch.UpdatedProduct=i.UpdatedProduct,this.filterSearch.Async=i.Async,this.scanAllProduct()})}getRowCount(){this.paginationService.hideCount=!1,this.rowCount$=this.http.post(`/api/${this.rowCountAPI}`,this.filterSearch)}onNextPage(){this.paginationService.onNextPage(this.filterSearch)}onLastPage(){this.http.post(`/api/${this.rowCountAPI}`,{}).subscribe({next:t=>{this.filterSearch.PageNumber=1,this.paginationService.getAllData(this.filterSearch,t.Count)}})}onZoomImage(t,e){this.biggerPictureService.openBiggerPicture(t,e)}onSelectProduct(t){this.hasSelectionProduct=this.productService.hasSelection(t),this.selectedProducts=this.productService.selectedProduct(t)}uploadMultipleProduct(){let t=this.getUniqueChannels();t=t.map(e=>(e.ID=e.ChannelID,e)),this.dialog.open(Q,{width:"700px",data:{title:"Upload Multiple Product",channels:t}}).afterClosed().pipe(y(e=>g.IsNotEmpty(e)),H(e=>{let i=this.getSelectedProductIds();return this.productService.uploadNotInChannel(i,e)})).subscribe({next:()=>{this.paginationService.reloadPagination(this.filterSearch),this.selectedProducts=[],this.hasSelectionProduct=!1},error:e=>{this.selectedProducts=[],this.hasSelectionProduct=!1}})}getSelectedProductIds(){return this.selectedProducts.map(e=>({ID:e.ProductID}))}getUniqueChannels(){let t=[];return this.selectedProducts.forEach(e=>{t=[...t,...e.Variants[0].NotAvailable]}),t=t.filter((e,i,d)=>d.findIndex(_=>_.ChannelID==e.ChannelID)==i),t}ngOnDestroy(){this.paginationService.destroy()}openExportDialog(){this.dialog.open(pe,{data:{title:"Export Not In Channel",pageNumber:this.filterSearch.PageNumber,rowCount:this.filterSearch.RowCount,filterExport:this.filterSearch,getRowCountApi:"product/GetNotInChannelRowCount",exportApi:"product/GetNotInChannelExport"}}).afterClosed().subscribe()}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(G),x(B),x(Ce),x(oe),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-channel"]],decls:2,vars:3,consts:[["EMPTY",""],["elsePic",""],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"hideSearchDropdown","onSubmit",4,"ngIf"],["headerTitle","Not in Channel","description","SKU has not been sold on one of channels",3,"onSubmit","hideSearchDropdown"],["class","btn btn-light shadow rounded ms-2",3,"click",4,"ngIf"],["data-cy","scanNotinChannel","type","button",1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[4,"ngIf","ngIfElse"],[4,"ngIf"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"col-md-12"],[1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","10px"],["colspan","2",1,"ms-5","text-center",2,"width","450px"],[2,"width","150px"],[2,"width","20%"],[2,"width","16%"],[4,"ngFor","ngForOf"],[1,"ms-1"],["target","_blank",3,"href"],[1,"fas","fa-lg","fa-external-link-alt","external-link-custom"],[2,"padding-left","0px"],[1,"d-flex","flex-wrap","mb-1"],[1,"text-center",3,"rowSpan"],["type","checkbox",3,"ngModelChange","ngModel"],[2,"padding-right","0px"],[1,"text-start",3,"rowSpan"],[1,"ms-5","fw-normal","text-ellipsis",2,"max-width","26vw !important"],[3,"matTooltip"],[1,"border","rounded","cursor-pointer",2,"max-width","40px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded",2,"max-width","40px"],["alt","",1,"channel-logo","cursor-pointer","ms-4","mt-3",3,"src","matTooltip"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"font-weight-bold","font-italic","hidden-xxs"],["style","cursor: pointer",3,"click",4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load more for 20 products",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","title","Load all products",3,"click",4,"ngIf"],[2,"cursor","pointer",3,"click"],["title","Retreive rows count",1,"border","p-3"],["role","button","title","Load more for 20 products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-arrow-right"],["role","button","title","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fas","fa-share"]],template:function(e,i){e&1&&(S(0,an,19,9,"mainpanel",2),D(1,"async")),e&2&&s("ngIf",k(1,1,i.loader$))},dependencies:[V,U,zt,W,K,R,vt,$,ft,St],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}thead[_ngcontent-%COMP%]{position:sticky;top:0}.channel-logo[_ngcontent-%COMP%]{width:20px}.w-img[_ngcontent-%COMP%]{width:100%}"]});let o=r;return o})();var ln=o=>[o],cn=()=>[];function sn(o,r){if(o&1){let n=P();a(0,"button",15),f("click",function(){u(n);let e=p();return h(e.openScanDialog())}),C(1,"i",16),m(2," Scan Channel "),l()}}function pn(o,r){if(o&1){let n=P();b(0),a(1,"button",17),f("click",function(){u(n);let e=p();return h(e.onDownloadAllProduct("SELECTED"))}),C(2,"i",18),m(3),l(),v()}if(o&2){let n,t=p();c(3),I(" Download (",(n=t.productService.selectedProduct(t.products))==null?null:n.length,") ")}}function dn(o,r){if(o&1&&(a(0,"span",19),C(1,"img",20),l(),m(2)),o&2){let n=r.item;c(),s("src",n.Img,O)("alt",n.Name),c(),I(" ",n.Name," ")}}function mn(o,r){if(o&1){let n=P();a(0,"div",21)(1,"app-product-card",22),f("onCheckBoxChange",function(e){let i=u(n).index,d=p();return h(d.onSelectProduct(e,i))})("onDescEvent",function(){let e=u(n).index,i=p();return h(i.onShowVariantDetail(e))})("onDownload",function(){let e=u(n).$implicit,i=p();return h(i.onDownloadProduct(e))})("onScan",function(){let e=u(n).$implicit,i=p();return h(i.onScanChannel(e))}),l()()}if(o&2){let n=r.$implicit;c(),s("showRedirectIcon",!1)("title",n==null?null:n.Name)("image",n==null?null:n.Image)("imageForZoom",n==null?null:n.Image)("code",n==null?null:n.SKU)("description",(n==null||n.Variant==null?null:n.Variant.length)>0?(n==null||n.Variant==null?null:n.Variant.length)+" Variants":null)("downloadButton",!0)("channels",n!=null&&n.Channel?ct(10,ln,n==null?null:n.Channel):et(12,cn))("showCheckBox",!0)("scanButton",!0)}}function un(o,r){o&1&&(b(0),a(1,"div",23),C(2,"app-empty-state"),l(),v())}function hn(o,r){if(o&1){let n=P();a(0,"div",24)(1,"div",25)(2,"app-custom-paginator",26),f("total",function(){u(n);let e=p();return h(e.getRowCount())})("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())}),l()()()}if(o&2){let n=p();c(2),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickRowCount)}}var Se=(()=>{let r=class r{constructor(t,e,i,d,_,w){this.http=t,this.dialog=e,this.productService=i,this.toastrService=d,this.activateRouter=_,this.authService=w,this.searchFilter=new q,this.products=[],this.hasClickRowCount=!1,this.channelOptions=this.authService.getChannels()}ngOnInit(){this.activateRouter.queryParams.subscribe(t=>{t.ID?this.initPageLoader(t.ID):this.initPageLoader(g.GuidEMpty)})}initPageLoader(t){this.productService.loader(t).subscribe(e=>{this.searchFilter=e.Filter,this.searchFilter.PageSize=e.Filter.RowCount,this.getProducts()})}getProducts(){this.http.post("/api/product/GetProductChannelNotPOS",this.searchFilter).subscribe(t=>{this.products=t.Data,this.mapChannelToProduct(),this.setSkuProduct()})}mapChannelToProduct(){let t;this.products=this.products.map(e=>(t=this.channelOptions.find(i=>i.ID==e.ChannelID),t?e.Channel=JSON.parse(JSON.stringify(t)):e.Channel=null,e)).map(e=>(e.Channel&&(e.Channel.Url=e.Url),e))}setSkuProduct(){this.products=this.products.map(t=>(t?.Variant?.length==0?g.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=g.GuidEMpty}onScanAll(){let t=this.productService.findChannelById(this.searchFilter.ChannelID,this.channelOptions);this.productService.scanAll(this.searchFilter.ChannelID,this.searchFilter.ScanFull,this.searchFilter.UpdatedProduct,this.searchFilter.Async).subscribe(e=>{this.searchFilter.Async?this.toastrService.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.initPageLoader(g.GuidEMpty),this.productService.successToastrScanAllProduct(e,t,!this.searchFilter.UpdatedProduct)),this.searchFilter.ChannelID=g.GuidEMpty})}openScanDialog(){let t=JSON.parse(JSON.stringify(this.searchFilter));t.ChannelID=g.GuidEMpty,this.dialog.open(F,{data:{filter:t,channelOptions:this.channelOptions},width:"600px"}).afterClosed().pipe(y(i=>g.IsNotEmpty(i))).subscribe(i=>{this.searchFilter.ChannelID=i.ChannelID,this.searchFilter.UpdatedProduct=i.UpdatedProduct,this.searchFilter.ScanFull=i.ScanFull,this.searchFilter.Async=i.Async,this.onScanAll()})}onDownloadAllProduct(t){let e;t=="ALL"?e=this.products:e=this.productService.selectedProduct(this.products),e.length>0&&this.productService.downloadMultipleProduct(e).subscribe({next:()=>{this.getProducts()}})}onSelectProduct(t,e){this.products[e].selected=t}onDownloadProduct(t){confirm(`Are you sure you want to Retrieve product ${t?.Name} from ${t?.Channel.Name} to POS?`)&&this.productService.downloadProduct(t).subscribe({next:()=>{this.getProducts()}})}onScanChannel(t){let e=JSON.parse(JSON.stringify(t));delete e.Channel,this.productService.scanCompareToPos([e]).subscribe(i=>{i.Status?(this.initPageLoader(g.GuidEMpty),this.toastrService.success(`product ${t.Name} have been successfully scanned and synchronized with POS`,"Success")):this.toastrService.error(`Product ${t.Name} is not existed in POS`,"Error")})}onShowVariantDetail(t){let e=this.products[t].Variant;e.length>0&&this.dialog.open(de,{data:{title:this.products[t].Name,variants:e},width:"30%"})}getRowCount(){let t={ChannelID:this.searchFilter.ChannelID,text:this.searchFilter.text,HaveSku:parseInt(this.searchFilter.HaveSku)};this.http.post("/api/product/GetProductChannelNotPOSRowCount",t).subscribe(e=>{this.hasClickRowCount=!0,this.rowCount=e.Count})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(J),x(B),x(G),x(xt),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-not-in-pos"]],decls:30,vars:13,consts:[["headerTitle","Not in POS","textButton","Search","description","SKU sold in Marketplace but not exist in DEALPOS",3,"onSubmit"],["type","button","data-cy","scanNotInPos","class","btn btn-outline-secondary shadow rounded",3,"click",4,"ngIf"],[4,"ngIf"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp",""],[1,"mt-5"],[1,"fw-bold"],["name","haveSKU",1,"form-control","h-100","pt-3","rounded","mt-2",3,"ngModelChange","ngModel"],[1,"me-5",3,"value"],["type","text","name","Item_id","id","Item_id","placeholder","item id",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row","mt-8"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["type","button","data-cy","scanNotInPos",1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],[1,"fas","fa-lg","fa-crosshairs"],["type","button",1,"btn","btn-success","shadow-sm","rounded","ms-3",3,"click"],[1,"fa","fa-download"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"onCheckBoxChange","onDescEvent","onDownload","onScan","showRedirectIcon","title","image","imageForZoom","code","description","downloadButton","channels","showCheckBox","scanButton"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"actions"),S(2,sn,3,0,"button",1)(3,pn,4,1,"ng-container",2),l(),a(4,"filters")(5,"div")(6,"label",3),m(7,"Channel"),l(),a(8,"ng-select",4),E("ngModelChange",function(_){return N(i.searchFilter.ChannelID,_)||(i.searchFilter.ChannelID=_),_}),S(9,dn,3,3,"ng-template",5),l()(),a(10,"div",6)(11,"label",7),m(12,"SKU Assigned"),l(),a(13,"mat-radio-group",8),E("ngModelChange",function(_){return N(i.searchFilter.HaveSku,_)||(i.searchFilter.HaveSku=_),_}),a(14,"mat-radio-button",9),m(15," All "),l(),a(16,"mat-radio-button",9),m(17," Yes "),l(),a(18,"mat-radio-button",9),m(19," No "),l()()(),a(20,"div",6)(21,"label",7),m(22,"Item ID"),l(),a(23,"input",10),E("ngModelChange",function(_){return N(i.searchFilter.Item_id,_)||(i.searchFilter.Item_id=_),_}),l()()(),a(24,"content")(25,"div",11)(26,"div",12),S(27,mn,2,13,"div",13)(28,un,3,0,"ng-container",2),l(),S(29,hn,3,4,"div",14),l()()()),e&2&&(c(2),s("ngIf",!i.productService.hasSelection(i.products)),c(),s("ngIf",i.productService.hasSelection(i.products)),c(5),s("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ChannelID),c(5),T("ngModel",i.searchFilter.HaveSku),c(),s("value",0),c(2),s("value",1),c(2),s("value",2),c(5),T("ngModel",i.searchFilter.Item_id),c(4),s("ngForOf",i.products),c(),s("ngIf",i.products.length==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,ot,W,K,R,Z,rt,ee,ne,z,X,$],styles:[".badge-pill[_ngcontent-%COMP%]{padding-bottom:16px!important}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background:#dfeffc;border:1px solid #dfeffc}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #ddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000;width:80px;text-align:center}.modal-dialog[_ngcontent-%COMP%]{max-width:30%!important}.product[_ngcontent-%COMP%]{height:100%!important}.row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}ul[_ngcontent-%COMP%]{list-style-type:none}.link[_ngcontent-%COMP%]{color:#0202ab;cursor:pointer}.px-1[_ngcontent-%COMP%]{padding-left:5px!important}.sku[_ngcontent-%COMP%]{color:#696969;font-style:italic}.badge-pill[_ngcontent-%COMP%]{height:16px}.itemTitle[_ngcontent-%COMP%]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.no-title[_ngcontent-%COMP%]{margin-top:.33em;margin-bottom:.33rem}.mb-upload[_ngcontent-%COMP%]{padding-bottom:.625rem}.my-1rem[_ngcontent-%COMP%]{margin-bottom:1rem!important;margin-top:1rem!important}.pr-rem[_ngcontent-%COMP%]{padding-right:.6rem}.text-larger[_ngcontent-%COMP%]{font-size:larger}.bg-lightpink[_ngcontent-%COMP%]{background-color:#f9dede}.bottom-buttons[_ngcontent-%COMP%]{margin-left:97px}@media (min-width: 1200px){.max-w-xl[_ngcontent-%COMP%]{max-width:205px}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.itemTitle[_ngcontent-%COMP%]{cursor:pointer}"]});let o=r;return o})();function _n(o,r){if(o&1&&(a(0,"span",9),C(1,"img",10),l(),m(2)),o&2){let n=r.item,t=p();c(),s("src",t.getChannelLogo(n.TypeID),O),c(),I(" ",n.Name," ")}}function gn(o,r){if(o&1&&(a(0,"div",11),C(1,"app-duplicate-product-card",12),l()),o&2){let n=r.$implicit,t=r.index;c(),s("imageForZoom",n.ImageUrl)("title",n.Name)("code",n.Code)("id",t)("image",n.ThumbnailURL)("channels",n.Channels)}}function Cn(o,r){o&1&&(b(0),a(1,"div",13),C(2,"app-empty-state"),l(),v())}function fn(o,r){if(o&1){let n=P();b(0),a(1,"div",14)(2,"div",15)(3,"app-custom-paginator",16),f("next",function(){u(n);let e=p();return h(e.getProducts())})("previous",function(){u(n);let e=p();return h(e.getProducts())})("total",function(){u(n);let e=p();return h(e.getRowCount())}),l()()(),v()}if(o&2){let n=p();c(3),s("filter",n.searchFilter)("totaldata",n.products==null?null:n.products.length)("paginationTotal",n.rowCount)("hasClicked",n.hasClickedRowCount)}}var xe=(()=>{let r=class r{constructor(t,e,i){this.httpService=t,this.productService=e,this.authService=i,this.searchFilter=new q,this.products=[],this.hasClickedRowCount=!1,this.getPageLoader(),this.channelOptions=i.getChannels()}getPageLoader(){this.productService.loader().subscribe(t=>{this.searchFilter=t.Filter,this.searchFilter.PageSize=t.Filter.RowCount,this.getProducts()})}getProducts(){let t={ListChannelID:this.searchFilter.ListChannelID,RowCount:this.searchFilter.RowCount,PageNumber:this.searchFilter.PageNumber,text:this.searchFilter.text};this.httpService.post("/api/product/GetDuplicateInChannel",t).subscribe(e=>{this.products=e.Data})}onSearch(t){this.searchFilter.text=t,this.hasClickedRowCount=!1,this.getProducts()}onClearFilter(){this.searchFilter.ChannelID=g.GuidEMpty}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}getRowCount(){let t={text:this.searchFilter.text,ChannelID:this.searchFilter.ChannelID};this.httpService.post("/api/product/GetDuplicateInChannelRowCount",t).subscribe(e=>{this.hasClickedRowCount=!0,this.rowCount=e.Total})}};r.\u0275fac=function(e){return new(e||r)(x(A),x(B),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-duplicate-sku"]],decls:14,vars:7,consts:[["headerTitle","Multiple Listing","textButton"," Search","description","SKU(s) which is listed more than one time (one to many)",3,"onSubmit"],["container",""],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clear","multiple","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid"],[1,"row","mt-8","mx-1"],["class","col-12 col-md-6 col-xl-4 px-3 my-3",4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[3,"imageForZoom","title","code","id","image","channels"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"row","mt-2","justify-content-end"],[1,"col-md-12"],[3,"next","previous","total","filter","totaldata","paginationTotal","hasClicked"]],template:function(e,i){e&1&&(a(0,"mainpanel",0),f("onSubmit",function(_){return i.onSearch(_)}),a(1,"filters")(2,"div",1)(3,"div")(4,"h6",2),m(5,"Channel"),l(),a(6,"ng-select",3),E("ngModelChange",function(_){return N(i.searchFilter.ListChannelID,_)||(i.searchFilter.ListChannelID=_),_}),f("clear",function(){return i.onClearFilter()}),S(7,_n,3,2,"ng-template",4),l()()()(),a(8,"content")(9,"div",5)(10,"div",6),S(11,gn,2,6,"div",7)(12,Cn,3,0,"ng-container",8),l(),S(13,fn,4,4,"ng-container",8),l()()()),e&2&&(c(6),s("multiple",!0)("clearable",!0)("items",i.channelOptions),T("ngModel",i.searchFilter.ListChannelID),c(5),s("ngForOf",i.products),c(),s("ngIf",(i.products==null?null:i.products.length)==0),c(),s("ngIf",(i.products==null?null:i.products.length)>0))},dependencies:[V,U,W,K,R,Z,rt,bt,wt,z,$]});let o=r;return o})();var Sn=()=>["/menu/products/status/sold-in-channel"],Pe=o=>({ID:o}),xn=()=>["/menu/products/status/not-in-pos"];function Pn(o,r){if(o&1&&(b(0),m(1),v()),o&2){let n=p().$implicit;c(),I(" ",n.Count," ")}}function bn(o,r){if(o&1){let n=P();a(0,"span",26),f("click",function(){u(n);let e=p().$implicit,i=p(2);return h(i.getLiveProductCount(e.ID,e))}),C(1,"i",27),l()}}function vn(o,r){if(o&1){let n=P();a(0,"tr")(1,"td"),C(2,"img",17),a(3,"span",18),m(4),l()(),a(5,"td",19),S(6,Pn,2,1,"ng-container",6)(7,bn,2,0,"ng-template",null,1,it),l(),a(9,"td",19)(10,"a",20),m(11),D(12,"number"),l()(),a(13,"td",19)(14,"a",20),m(15),D(16,"number"),l()(),a(17,"td"),m(18),D(19,"date"),l(),a(20,"td")(21,"div",21)(22,"button",22),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onScanChannel(e))}),C(23,"i",23),m(24," Scan "),l(),a(25,"button",24),f("click",function(){let e=u(n).$implicit,i=p(2);return h(i.onClearCache(e.ID))}),C(26,"i",25),m(27," Clear "),l()()()()}if(o&2){let n=r.$implicit,t=j(8),e=p(2);c(2),s("src",e.getChannelLogo(n.TypeID),O),c(2),Ct(n.Name),c(2),s("ngIf",n.Count!==void 0)("ngIfElse",t),c(4),s("routerLink",et(18,Sn))("queryParams",ct(19,Pe,n.ID)),c(),I(" ",k(12,11,n.SoldInChannel)," "),c(3),s("routerLink",et(21,xn))("queryParams",ct(22,Pe,n.ID)),c(),I(" ",k(16,13,n.NotInPOS)," "),c(3),I("",n.LastSync?jt(19,15,n.LastSync,"dd MMM yyyy HH:mm"):"Never"," ")}}function In(o,r){if(o&1&&(b(0),a(1,"div",7)(2,"table",8)(3,"thead",9)(4,"tr",10)(5,"th"),m(6,"Channel"),l(),a(7,"th",11),m(8,"Live Product"),l(),a(9,"th",12),m(10,"Sold In Channel"),l(),a(11,"th",13),m(12,"Product Not in POS"),l(),a(13,"th",14),m(14,"Last Sync"),l(),C(15,"th",15),l()(),a(16,"tbody"),S(17,vn,28,24,"tr",16),D(18,"async"),l()()(),v()),o&2){let n,t=p();c(17),s("ngForOf",(n=k(18,1,t.channels$))==null?null:n.Data)}}function wn(o,r){o&1&&(a(0,"div",28),C(1,"app-empty-state"),l())}var be=(()=>{let r=class r{constructor(t,e,i,d){this.productService=t,this.toastr=e,this.dialog=i,this.authService=d,this.destroy$=new _t,this.channelOptions=d.getChannels()}ngOnInit(){this.setObsProductStatistic()}setObsProductStatistic(){this.channels$=this.productService.getProductStatistic()}getLiveProductCount(t,e){this.productService.getTotalProductLive(t).pipe(lt(this.destroy$)).subscribe(i=>{e.Count=i.Count})}onScanChannel(t){this.dialog.open(F,{width:"700px",data:{channelOptions:this.channelOptions,filter:{ChannelID:t.ID},disabledChannelOption:!0}}).afterClosed().pipe(y(e=>g.IsNotEmpty(e))).subscribe(e=>{this.scanAllProduct(t.ID,e)})}scanAllProduct(t,e){let i=this.productService.findChannelById(t,this.channelOptions);this.productService.scanAll(e.ChannelID,e.ScanFull,e.UpdatedProduct,e.Async).pipe(y(d=>d)).subscribe(d=>{e.Async?this.toastr.warning("You will be notified when the scan is completed.","Scan In Progress",{toastClass:"ngx-toastr toast-waiting"}):(this.productService.successToastrScanAllProduct(d,i,!e.UpdatedProduct),this.setObsProductStatistic())})}onClearCache(t){confirm("Are you sure you want to Clear Cache? This Process will remove your product integration to marketplace")&&this.productService.clearCacheChannel(t).pipe(lt(this.destroy$)).subscribe(i=>{this.toastr.success("Successfully cleared cache","Success"),this.setObsProductStatistic()})}getChannelLogo(t){return g.getChannelLogoByTypeId(t)}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}};r.\u0275fac=function(e){return new(e||r)(x(B),x(G),x(J),x(L))},r.\u0275cmp=M({type:r,selectors:[["app-channel-statistic"]],decls:9,vars:6,consts:[["EMPTY",""],["QUESTION",""],["headerTitle","Products Statistic",3,"hideSearchBox","hideSearchDropdown"],[1,"container-fluid"],[1,"row","mt-4"],[1,"col-md-12"],[4,"ngIf","ngIfElse"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[1,"text-center",2,"width","13rem"],[1,"text-center",2,"width","9rem"],[1,"text-center",2,"width","14rem"],[2,"width","10rem"],[2,"width","12rem"],[4,"ngFor","ngForOf"],[2,"width","24px","height","24px",3,"src"],[1,"ms-3"],[1,"text-center"],[3,"routerLink","queryParams"],[1,"d-flex","align-items-center","justify-content-center"],[1,"btn","btn-sm","btn-secondary","fs-6",3,"click"],[1,"fa","fa-spinner"],[1,"btn","btn-sm","btn-secondary","fs-6","ms-3",3,"click"],[1,"fa","fa-trash"],["matTooltip","Click to see total live product",1,"cursor-pointer","fs-5","text-primary",3,"click"],[1,"fa-solid","fa-circle-question","cursor"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"]],template:function(e,i){if(e&1&&(a(0,"mainpanel",2)(1,"content")(2,"div",3)(3,"div",4)(4,"div",5),S(5,In,19,3,"ng-container",6),D(6,"async"),S(7,wn,2,0,"ng-template",null,0,it),l()()()()()),e&2){let d,_=j(8);s("hideSearchBox",!0)("hideSearchDropdown",!0),c(5),s("ngIf",((d=k(6,4,i.channels$))==null||d.Data==null?null:d.Data.length)>0)("ngIfElse",_)}},dependencies:[V,U,R,vt,Pt,$,ft,St,Gt]});let o=r;return o})();var yn=[{component:ue,path:"",children:[{path:"",redirectTo:"sold-in-channel",pathMatch:"full"},{path:"in-pos",component:_e,canActivate:[nt],data:{title:"Products in POS"}},{path:"sold-in-channel",component:ge,canActivate:[nt],data:{title:"Products Sold in Channel"}},{path:"not-in-channel",component:fe,canActivate:[nt],data:{title:"Products not in Channel"}},{path:"not-in-pos",component:Se,canActivate:[nt],data:{title:"Products not in POS"}},{path:"duplicate-sku",component:xe,canActivate:[nt],data:{title:"Duplicate Sku in Channel"}},{path:"channel-statistic",component:be,canActivate:[nt],data:{title:"Channel Statistic"}}]}],Bi=(()=>{let r=class r{};r.\u0275fac=function(e){return new(e||r)},r.\u0275mod=$t({type:r}),r.\u0275inj=Rt({imports:[Wt,Ht,Qt,qt,Yt,me,ie,te,wt,z,X,Jt.forChild(yn),se,Zt]});let o=r;return o})();export{Bi as StatusModule};